Re: [PATCH v2 3/3] KVM: arm64: Don't replace a valid hyp block mapping with a table

From: Xuheng Li

Date: Fri Nov 06 2026 - 12:18:19 EST


Hi Fuad, Vincent,

On Fri, Nov 06, 2026 at 02:34:55PM +0000, Fuad Tabba wrote:
> Actually, like Vincent pointed out, why the WARN_ON(). The caller can
> just handle the error.

Makes sense, I'll drop the WARN_ON() and just return -EEXIST.

One thing I noticed: the kernel-doc of kvm_pgtable_hyp_map() says that
a mapping over an existing one is "rejected with an error and a
WARN()", and the leaf case in hyp_map_walker_try_leaf() still warns.
Without the WARN_ON(), the comment would no longer match this case.
By the same reasoning, should the leaf case's WARN_ON() go too, in a
separate patch, with the comment reduced to "rejected with an error"?

Thanks,
Xuheng