Re: [PATCH v5 6/7] KVM: x86: Combine .gmem_prepare()+.gmem_invalidate() into .gmem_convert()
From: Sean Christopherson
Date: Tue Jul 14 2026 - 20:11:09 EST
On Tue, Jul 14, 2026, Ackerley Tng wrote:
> Sean Christopherson <seanjc@xxxxxxxxxx> writes:
> > #ifdef CONFIG_HAVE_KVM_ARCH_GMEM_RECLAIM
> > void kvm_arch_gmem_reclaim(kvm_pfn_t pfn, kvm_pfn_t nr_pages, int max_order)
> > {
> > - kvm_x86_call(gmem_invalidate)(pfn, pfn + nr_pages);
> > + WARN_ON_ONCE(kvm_x86_call(gmem_convert)(NULL, -1ull, pfn, nr_pages, max_order, false));
>
> This setup means later pKVM would have to define a .gmem_convert but
> actually only use it for reclaim, which seems kind of an odd
> definition. (We can fix this later.)
No, pKVM (on arm64) would just implement kvm_arch_gmem_reclaim(), and then do
whatever it wants under the hood.