Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [v3 PATCH 0/2] KVM: guest_memfd: use write for population
@ 2025-03-03 13:08 Nikita Kalyazin
  2025-03-03 13:08 ` [v3 PATCH 1/2] KVM: guest_memfd: add generic population via write Nikita Kalyazin
  2025-03-03 13:08 ` [v3 PATCH 2/2] KVM: selftests: update guest_memfd write tests Nikita Kalyazin
  0 siblings, 2 replies; 3+ messages in thread
From: Nikita Kalyazin @ 2025-03-03 13:08 UTC (permalink / raw)
  To: pbonzini, shuah
  Cc: kvm, linux-kselftest, linux-kernel, michael.day, david,
	quic_eberman, jthoughton, brijesh.singh, michael.roth, graf,
	jgowans, roypat, derekmn, nsaenz, xmarcalx, kalyazin

This series is rebased on top of Fuad's v4 for shared mapping of
guest_memfd [1].

Change since v2 [2]:
 - David/Mike D: Only compile support for the write syscall if
   CONFIG_KVM_GMEM_SHARED_MEM introduced in [1] is enabled.

In non-CoCo use cases where the host can access guest memory,
guest_memfd can be allocated and populated via the write syscall.  Even
though the same can also be achieved via userspace mapping and memcpy
from userspace, write provides a more performant option because it 1)
avoids double initialisation as the kernel does not need to zero pages
and 2) does not require setting up page tables.

Nikita

[1] https://lore.kernel.org/kvm/20250218172500.807733-4-tabba@google.com/T/
[2] https://lore.kernel.org/kvm/20241129123929.64790-1-kalyazin@amazon.com/T/

Nikita Kalyazin (2):
  KVM: guest_memfd: add generic population via write
  KVM: selftests: update guest_memfd write tests

 .../testing/selftests/kvm/guest_memfd_test.c  | 85 +++++++++++++++--
 virt/kvm/guest_memfd.c                        | 94 ++++++++++++++++++-
 2 files changed, 170 insertions(+), 9 deletions(-)


base-commit: 005f6404708d430abab7fab9b422d0daf6e0c2fe
-- 
2.47.1


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

end of thread, other threads:[~2025-03-03 13:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-03 13:08 [v3 PATCH 0/2] KVM: guest_memfd: use write for population Nikita Kalyazin
2025-03-03 13:08 ` [v3 PATCH 1/2] KVM: guest_memfd: add generic population via write Nikita Kalyazin
2025-03-03 13:08 ` [v3 PATCH 2/2] KVM: selftests: update guest_memfd write tests Nikita Kalyazin

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