]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: Allow and advertise support for host mmap() on guest_memfd files
authorFuad Tabba <tabba@google.com>
Tue, 29 Jul 2025 22:54:52 +0000 (15:54 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 27 Aug 2025 08:37:03 +0000 (04:37 -0400)
commit3d3a04fad25a6621828518a2abe536142d2c1a7d
treea72390ea2a3a669a23d63e7eeb8d1f59851429cd
parent32e200bd6e4407c31aef0392be041274bfa3f20e
KVM: Allow and advertise support for host mmap() on guest_memfd files

Now that all the x86 and arm64 plumbing for mmap() on guest_memfd is in
place, allow userspace to set GUEST_MEMFD_FLAG_MMAP and advertise support
via a new capability, KVM_CAP_GUEST_MEMFD_MMAP.

The availability of this capability is determined per architecture, and
its enablement for a specific guest_memfd instance is controlled by the
GUEST_MEMFD_FLAG_MMAP flag at creation time.

Update the KVM API documentation to detail the KVM_CAP_GUEST_MEMFD_MMAP
capability, the associated GUEST_MEMFD_FLAG_MMAP, and provide essential
information regarding support for mmap in guest_memfd.

Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Reviewed-by: Shivank Garg <shivankg@amd.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Signed-off-by: Fuad Tabba <tabba@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-ID: <20250729225455.670324-22-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Documentation/virt/kvm/api.rst
include/uapi/linux/kvm.h
virt/kvm/guest_memfd.c
virt/kvm/kvm_main.c