Re: [PATCH v4 0/2] KVM: guest_memfd: use write for population
From: David Hildenbrand
Date: Thu Aug 28 2025 - 16:07:52 EST
On 28.08.25 17:30, Kalyazin, Nikita wrote:
[ based on kvm/next ]
Implement guest_memfd allocation and population via the write syscall.
This is useful in non-CoCo use cases where the host can access guest
memory. Even though the same can also be achieved via userspace mapping
and memcpying from userspace, write provides a more performant option
because it does not need to set page tables and it does not cause a page
fault for every page like memcpy would. Note that memcpy cannot be
accelerated via MADV_POPULATE_WRITE as it is not supported by
guest_memfd and relies on GUP.
I also added this patch to the pile of guestmemfd preview patches located at
https://git.kernel.org/pub/scm/linux/kernel/git/david/linux.git/log/?h=guestmemfd-preview
There was only one minor conflict regarding setting file->f_mode.
--
Cheers
David / dhildenb