Re: [PATCH v4 18/18] KVM: guest_memfd: Combine .gmem_prepare()+.gmem_invalidate() into .gmem_convert()
From: Ackerley Tng
Date: Thu Jul 09 2026 - 20:34:29 EST
Sean Christopherson <seanjc@xxxxxxxxxx> writes:
>
> [...snip...]
>
> @@ -532,7 +531,7 @@ static const struct address_space_operations kvm_gmem_aops = {
> .dirty_folio = noop_dirty_folio,
> .migrate_folio = kvm_gmem_migrate_folio,
> .error_remove_folio = kvm_gmem_error_folio,
> -#ifdef CONFIG_HAVE_KVM_ARCH_GMEM_INVALIDATE
> +#ifdef CONFIG_HAVE_KVM_ARCH_GMEM_CONVERT
> .free_folio = kvm_gmem_free_folio,
This part looks odd to have CONVERT gate free_folio, maybe this is where
it's nice to have CONFIG_HAVE_KVM_ARCH_GMEM_CONVERT ifdef the contents
of free_folio above.
Not a huge deal, thanks for this cleanup!
Reviewed-by: Ackerley Tng <ackerleytng@xxxxxxxxxx>
> #endif
> };
> @@ -802,7 +801,7 @@ int kvm_gmem_get_pfn(struct kvm *kvm, struct kvm_memory_slot *slot,
> folio_mark_uptodate(folio);
> }
>
> - r = kvm_gmem_prepare_folio(kvm, slot, gfn, folio);
> + r = kvm_gmem_make_private(kvm, slot, gfn, folio);
>
> folio_unlock(folio);
>
> --
> 2.55.0.795.g602f6c329a-goog