[PATCH 0/2] Use guest mem inodes instead of anonymous inodes

Ackerley Tng posted 2 patches 6 months, 2 weeks ago
fs/anon_inodes.c           |  22 ++++--
include/linux/fs.h         |   1 +
include/uapi/linux/magic.h |   1 +
mm/secretmem.c             |   9 +--
virt/kvm/guest_memfd.c     | 134 +++++++++++++++++++++++++++++++------
virt/kvm/kvm_main.c        |   7 +-
virt/kvm/kvm_mm.h          |   9 ++-
7 files changed, 143 insertions(+), 40 deletions(-)
[PATCH 0/2] Use guest mem inodes instead of anonymous inodes
Posted by Ackerley Tng 6 months, 2 weeks ago
Hi,

This small patch series makes guest_memfd use guest mem inodes instead
of anonymous inodes and also includes some refactoring to expose a new
function that allocates an inode and runs security checks.

This patch series will serve as a common base for some in-flight series:

* Add NUMA mempolicy support for KVM guest-memfd [1]
* New KVM ioctl to link a gmem inode to a new gmem file [2]
* Restricted mapping of guest_memfd at the host and arm64 support [3]
  aka shared/private conversion support for guest_memfd

[1] https://lore.kernel.org/all/20250408112402.181574-1-shivankg@amd.com/
[2] https://lore.kernel.org/lkml/cover.1747368092.git.afranji@google.com/
[3] https://lore.kernel.org/all/20250328153133.3504118-1-tabba@google.com/

Ackerley Tng (2):
  fs: Provide function that allocates a secure anonymous inode
  KVM: guest_memfd: Use guest mem inodes instead of anonymous inodes

 fs/anon_inodes.c           |  22 ++++--
 include/linux/fs.h         |   1 +
 include/uapi/linux/magic.h |   1 +
 mm/secretmem.c             |   9 +--
 virt/kvm/guest_memfd.c     | 134 +++++++++++++++++++++++++++++++------
 virt/kvm/kvm_main.c        |   7 +-
 virt/kvm/kvm_mm.h          |   9 ++-
 7 files changed, 143 insertions(+), 40 deletions(-)


base-commit: a5806cd506af5a7c19bcd596e4708b5c464bfd21
--
2.49.0.1204.g71687c7c1d-goog