linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v2 0/2] KVM: guest_memfd: use write for population
@ 2024-11-29 12:39 Nikita Kalyazin
  2024-11-29 12:39 ` [RFC PATCH v2 1/2] KVM: guest_memfd: add generic population via write Nikita Kalyazin
  2024-11-29 12:39 ` [RFC PATCH v2 2/2] KVM: selftests: update guest_memfd write tests Nikita Kalyazin
  0 siblings, 2 replies; 4+ messages in thread
From: Nikita Kalyazin @ 2024-11-29 12:39 UTC (permalink / raw)
  To: pbonzini, shuah, kvm, linux-kselftest, linux-kernel
  Cc: linux-mm, michael.day, david, quic_eberman, jthoughton,
	brijesh.singh, michael.roth, graf, jgowans, roypat, derekmn,
	nsaenz, xmarcalx, kalyazin

As discussed in the v1 [1], with guest_memfd moving from KVM to mm, it
is more practical to have a non-KVM-specific API to populate guest
memory in a generic way.  The series proposes using the write syscall
for this purpose instead of a KVM ioctl as in the v1.  The approach also
has an advantage that the guest_memfd handle can be sent to another
process that would be responsible for population.  I also included a
suggestion from Mike Day for excluding the code from compilation if AMD
SEV is configured.

There is a potential for refactoring of the kvm_gmem_populate to extract
common parts with the write.  I did not do that in this series yet to
keep it clear what the write would do and get feedback on whether
write's behaviour is sensible.

Nikita

[1]: https://lore.kernel.org/kvm/20241024095429.54052-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                        | 79 +++++++++++++++++
 2 files changed, 158 insertions(+), 6 deletions(-)


base-commit: 1508bae37044ebffd7c7e09915f041936f338123
-- 
2.40.1



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

end of thread, other threads:[~2024-12-03 14:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-29 12:39 [RFC PATCH v2 0/2] KVM: guest_memfd: use write for population Nikita Kalyazin
2024-11-29 12:39 ` [RFC PATCH v2 1/2] KVM: guest_memfd: add generic population via write Nikita Kalyazin
2024-12-03 14:55   ` Mike Day
2024-11-29 12:39 ` [RFC PATCH v2 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