Re: [PATCH v10 08/15] KVM: arm64: define kvm_arch_gmem_supports_no_direct_map()

From: David Hildenbrand (Arm)

Date: Thu Mar 05 2026 - 14:09:42 EST


On 1/26/26 17:50, Kalyazin, Nikita wrote:
> From: Patrick Roy <patrick.roy@xxxxxxxxx>
>
> Support for GUEST_MEMFD_FLAG_NO_DIRECT_MAP on arm64 depends on 1) direct
> map manipulations at 4k granularity being possible, and 2) FEAT_S2FWB.
>
> 1) is met whenever the direct map is set up at 4k granularity (e.g. not
> with huge/gigantic pages) at boottime, as due to ARM's
> break-before-make semantics, breaking huge mappings into 4k mappings in
> the direct map is not possible (BBM would require temporary invalidation
> of the entire huge mapping, even if only a 4k subrange should be zapped,
> which will probably crash the kernel). However, the current default for
> rodata_full is true, which forces a 4k direct map.
>
> 2) is required to allow KVM to elide cache coherency operations when
> installing stage 2 page tables, which require the direct map to be
> entry for the newly mapped memory to be present (which it will not be,
> as guest_memfd would have removed direct map entries in
> kvm_gmem_get_pfn()).
>
> Cc: Will Deacon <will@xxxxxxxxxx>
> Signed-off-by: Patrick Roy <patrick.roy@xxxxxxxxx>
> Signed-off-by: Nikita Kalyazin <kalyazin@xxxxxxxxxx>
> ---

Reviewed-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>

--
Cheers,

David