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=guest...
There was only one minor conflict regarding setting file->f_mode.