]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: guest_memfd: Remove partial hugepage handling from kvm_gmem_populate()
authorMichael Roth <michael.roth@amd.com>
Thu, 8 Jan 2026 21:46:18 +0000 (15:46 -0600)
committerSean Christopherson <seanjc@google.com>
Thu, 15 Jan 2026 20:30:48 +0000 (12:30 -0800)
commit6538b6221cc2feda415ca1946e66a5ef02dc6a0a
tree8c366f716bc59f3c2d0e32480217150826e8aaf8
parent60b590de8b30dad8b11e9e4fba0df2eae81afb98
KVM: guest_memfd: Remove partial hugepage handling from kvm_gmem_populate()

kvm_gmem_populate(), and the associated post-populate callbacks, have
some limited support for dealing with guests backed by hugepages by
passing the order information along to each post-populate callback and
iterating through the pages passed to kvm_gmem_populate() in
hugepage-chunks.

However, guest_memfd doesn't yet support hugepages, and in most cases
additional changes in the kvm_gmem_populate() path would also be needed
to actually allow for this functionality.

This makes the existing code unnecessarily complex, and makes changes
difficult to work through upstream due to theoretical impacts on
hugepage support that can't be considered properly without an actual
hugepage implementation to reference. So for now, remove what's there
so changes for things like in-place conversion can be
implemented/reviewed more efficiently.

Suggested-by: Vishal Annapurve <vannapurve@google.com>
Co-developed-by: Vishal Annapurve <vannapurve@google.com>
Signed-off-by: Vishal Annapurve <vannapurve@google.com>
Tested-by: Vishal Annapurve <vannapurve@google.com>
Tested-by: Kai Huang <kai.huang@intel.com>
Signed-off-by: Michael Roth <michael.roth@amd.com>
Tested-by: Yan Zhao <yan.y.zhao@intel.com>
Reviewed-by: Yan Zhao <yan.y.zhao@intel.com>
Link: https://patch.msgid.link/20260108214622.1084057-3-michael.roth@amd.com
[sean: check for !IS_ERR() before checking folio_order()]
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/sev.c
arch/x86/kvm/vmx/tdx.c
include/linux/kvm_host.h
virt/kvm/guest_memfd.c