Re: [PATCH v6 10/11] KVM: arm64: CCA: Support runtime faulting of memory
From: Kohei Enju
Date: Fri Dec 04 2026 - 10:32:54 EST
On 12/04 11:57, Steven Price wrote:
> At runtime, if the realm guest accesses an IPA without a stage-2
> mapping, then KVM fixes up the stage-2 mapping for the backing memory.
>
> For memory in the lower (protected) region of IPA, verify that the
> corresponding guest_memfd page is private before delegating to the RMM.
> The RMM then maps the delegated page into the Realm.
>
> For memory in the upper (shared) IPA region, map the backing page as
> non-secure memory. Check that a guest_memfd page is shared when the
> fault uses guest_memfd; ordinary userspace-backed memslots can only be
> mapped at unprotected IPAs and follow the normal user memory fault path.
>
> If the fault IPA and guest_memfd attributes disagree then exit to
> userspace with KVM_EXIT_MEMORY_FAULT so the VMM can perform the required
> conversion. If a shared IPA has no memslot, KVM follows the existing
> MMIO or abort-injection path. The latter can result in injecting a SEA
> to the guest.
>
> Realm faults may need to create RTTs, including when updating a
> mapping after a permission fault. Take the write side of mmu_lock
> and top up the MMU cache for these faults. Do not pre-fault Realm
> memory.
Hello Steve,
Not a review comment, but just a question for clarification.
My understanding is that this series and the following ones aim to
provide basic CCA/KVM functionality, leaving out optional features for
the initial upstream support.
I've been looking into supporting pre-faulting for CCA/KVM in the
future, and I'm not aware of any architectural blockers.
Are you aware of any potential blockers or limitations that might
prevent us from supporting pre-faulting in the future, or is it simply
being left out for now as an *optional* feature, as I assume?
Thanks,
Kohei