Apologies for the delayed response, and thank you for the review.

On Fri, 26 Jun 2026 14:45:45 +0000, Brendan Jackman wrote:
> On Tue Apr 21, 2026 at 4:55 PM UTC, Marc Zyngier wrote:
> > 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.
> >
> > Where is this 4kB requirement enforced? Or is it that you means
> > "PAGE_SIZE"?
>
> Yeah I believe this means PAGE_SIZE and that it's effectively enforced
> by checking can_set_direct_map() in
> kvm_arch_gmem_supports_no_direct_map().

Yes, this should say PAGE_SIZE rather than 4k.

If I understand the arm64 MM code correctly, can_set_direct_map() is the
capability gate, but it does not require the linear map to be built with
page-sized PTEs from boot. Without BBML2_NOABORT, force_pte_mapping()
builds the linear map with PAGE_SIZE PTEs. With BBML2_NOABORT,
update_range_prot() can use split_kernel_leaf_mapping() to safely split
larger mappings on demand before changing a PAGE_SIZE range.

I'll update the v13 commit message to describe this.

On Tue, 21 Apr 2026 17:55:05 +0100, Marc Zyngier wrote:
> KVM/arm64 has:
>
>         select KVM_GUEST_MEMFD

I also confirmed that KVM/arm64 selects KVM_GUEST_MEMFD, so I'll drop the
redundant #ifdef in v13.

> Why is it an inline function? Given that it takes a kvm parameter,
> I fully expect that you'll have to evaluate this at some point.
>
> But since struct kvm cannot be dereferenced in asm/kvm_host.h, it will
> have to move. How about doing it right now?

Agreed. Although the current implementation does not dereference kvm, it
makes sense to move it out of asm/kvm_host.h now. I'll move the
implementation to an arm64 KVM .c file in v13.

Reply via email to