Kernel KVM virtualization development
 help / color / mirror / Atom feed
* [PATCH kvmtool v1 0/5] Add guest_memfd support for arm64
@ 2026-07-06  8:35 Fuad Tabba
  2026-07-06  8:35 ` [PATCH kvmtool v1 1/5] Initialize the return value in kvm__for_each_mem_bank() Fuad Tabba
                   ` (4 more replies)
  0 siblings, 5 replies; 20+ messages in thread
From: Fuad Tabba @ 2026-07-06  8:35 UTC (permalink / raw)
  To: kvm
  Cc: kvmarm, Will Deacon, Alexandru Elisei, Suzuki K Poulose,
	Andre Przywara, Oliver Upton, Marc Zyngier, Fuad Tabba

Hi folks,

Due to popular demand, i.e., Alexandru asking me about it, I repolished my
guest_memfd support series. The one I sent years ago was stale and
over-engineered, so this is a fresh start instead.

This series adds support for backing guest RAM with guest_memfd on
arm64, for non-protected VMs under both regular KVM and pKVM.

The first two patches are standalone fixes in the code this series
builds on: an uninitialized return value in kvm__for_each_mem_bank(),
and doubled newlines in die() messages. The next two switch memory
registration to kvm_userspace_memory_region2 unconditionally and add
guest_memfd plumbing to kvm__register_mem().

A new --guest-memfd option creates guest RAM from a guest_memfd with
mmap support (GUEST_MEMFD_FLAG_MMAP and GUEST_MEMFD_FLAG_INIT_SHARED,
Linux 6.18+), maps it to provide the userspace mapping, and registers
it with KVM_SET_USER_MEMORY_REGION2.

Protected VMs need in-place shared/private conversion of guest_memfd,
which is still in progress in the kernel [1], so --protected rejects
the option.

Based on kvmtool master (ca0ddafa941d).

Cheers,
/fuad

[1] https://lore.kernel.org/all/20260618-gmem-inplace-conversion-v8-0-9d2959357853@google.com/

Fuad Tabba (5):
  Initialize the return value in kvm__for_each_mem_bank()
  Remove newline from end of die() aborts
  Use kvm_userspace_memory_region2 for all memory registration
  Add guest_memfd support to kvm__register_mem()
  arm64: Add --guest-memfd option to back guest RAM with guest_memfd

 arm64/include/kvm/kvm-config-arch.h |  5 +++-
 arm64/kvm.c                         | 38 +++++++++++++++++++------
 hw/cfi_flash.c                      |  2 +-
 include/kvm/kvm.h                   | 16 +++++++++--
 include/kvm/util.h                  |  1 +
 kvm.c                               | 26 +++++++++++------
 util/util.c                         | 44 +++++++++++++++++++++++++----
 7 files changed, 106 insertions(+), 26 deletions(-)

-- 
2.39.5


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2026-07-06 12:36 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-06  8:35 [PATCH kvmtool v1 0/5] Add guest_memfd support for arm64 Fuad Tabba
2026-07-06  8:35 ` [PATCH kvmtool v1 1/5] Initialize the return value in kvm__for_each_mem_bank() Fuad Tabba
2026-07-06  8:35 ` [PATCH kvmtool v1 2/5] Remove newline from end of die() aborts Fuad Tabba
2026-07-06 10:53   ` Suzuki K Poulose
2026-07-06 10:57     ` Fuad Tabba
2026-07-06  8:35 ` [PATCH kvmtool v1 3/5] Use kvm_userspace_memory_region2 for all memory registration Fuad Tabba
2026-07-06 10:23   ` Suzuki K Poulose
2026-07-06 10:41     ` Fuad Tabba
2026-07-06 10:46       ` Will Deacon
2026-07-06 10:47         ` Fuad Tabba
2026-07-06 10:57     ` Alexandru Elisei
2026-07-06 10:59       ` Fuad Tabba
2026-07-06  8:35 ` [PATCH kvmtool v1 4/5] Add guest_memfd support to kvm__register_mem() Fuad Tabba
2026-07-06 11:00   ` Suzuki K Poulose
2026-07-06 11:13     ` Suzuki K Poulose
2026-07-06 11:25       ` Fuad Tabba
2026-07-06 12:34         ` Suzuki K Poulose
2026-07-06  8:35 ` [PATCH kvmtool v1 5/5] arm64: Add --guest-memfd option to back guest RAM with guest_memfd Fuad Tabba
2026-07-06 11:18   ` Suzuki K Poulose
2026-07-06 11:24     ` Fuad Tabba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox