]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: arm64: Seed pkvm_ownership_selftest vcpu memcache
authorFuad Tabba <tabba@google.com>
Fri, 1 May 2026 11:21:47 +0000 (12:21 +0100)
committerMarc Zyngier <maz@kernel.org>
Thu, 7 May 2026 13:12:41 +0000 (14:12 +0100)
commit5130d450d1488e62e1b5310f41910a3c7320e827
treef0b5832abb5646d0d06f2887c0b07e516729331f
parentd4d215e5b81ba5acb17752cab12c514a8062bada
KVM: arm64: Seed pkvm_ownership_selftest vcpu memcache

The hypercall handlers call pkvm_refill_memcache() to top up the
hyp_vcpu memcache before invoking __pkvm_host_{share,donate}_guest().
pkvm_ownership_selftest invokes those functions directly with a
static selftest_vcpu that has an empty memcache.

Seed selftest_vcpu's memcache from the prepopulated selftest
pages, leaving the remainder for selftest_vm.pool. Required by
the memcache-sufficiency pre-check added in the following
patches.

Assisted-by: Gemini:gemini-3.1-pro review-prompts
Signed-off-by: Fuad Tabba <tabba@google.com>
Link: https://patch.msgid.link/20260501112149.2824881-5-tabba@google.com
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/hyp/nvhe/pkvm.c