Re: [PATCH v6 7/9] KVM: guest_memfd: Rename prepare() hook and Kconfig to make_private() / CONVERT

From: Xiaoyao Li

Date: Mon Jul 27 2026 - 21:01:41 EST


On 7/27/2026 10:41 PM, Sean Christopherson wrote:
On Mon, Jul 27, 2026, Xiaoyao Li wrote:
On 7/24/2026 5:08 AM, Sean Christopherson wrote:
Rework guest_memfd's prepare() hook into a more accurate make_private(),
and rework its Kconfig from PREPARE to a more generic CONVERT.

This will
allow x86 to share (pun intended) a kvm_x86_ops.gmem_make_shared() hook
between the "convert to shared" and "reclaim" flows, which are one and the
same for SNP.

Does it mean in the future we will introduce something like below?

#ifdef CONFIG_HAVE_KVM_ARCH_GMEM_CONVERT
int kvm_arch_gmem_make_private(struct kvm *kvm, gfn_t gfn, kvm_pfn_t pfn,
int max_order)
{
return kvm_x86_call(gmem_make_private)(kvm, pfn, gfn, max_order);
}

+int kvm_arch_gmem_make_shared(kvm_pfn_t pfn, kvm_pfn_t nr_pages)
+{
+ return kvm_x86_call(gmem_make_private)(pfn, nr_pages);

s/gmem_make_private/gmem_make_shared, but yeah, that's the plan for the in-place
conversion series.

/faceplam my copy-paste mistake.

The patch looks good to me,

Reviewed-by: Xiaoyao Li <xiaoyao.li@xxxxxxxxx>