Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Nikita Kalyazin <kalyazin@amazon.com>
To: <pbonzini@redhat.com>, <shuah@kernel.org>
Cc: <kvm@vger.kernel.org>, <linux-kselftest@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <michael.day@amd.com>,
	<david@redhat.com>, <quic_eberman@quicinc.com>,
	<jthoughton@google.com>, <brijesh.singh@amd.com>,
	<michael.roth@amd.com>, <graf@amazon.de>, <jgowans@amazon.com>,
	<roypat@amazon.co.uk>, <derekmn@amazon.com>, <nsaenz@amazon.es>,
	<xmarcalx@amazon.com>, <kalyazin@amazon.com>
Subject: [v3 PATCH 0/2] KVM: guest_memfd: use write for population
Date: Mon, 3 Mar 2025 13:08:36 +0000	[thread overview]
Message-ID: <20250303130838.28812-1-kalyazin@amazon.com> (raw)

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


             reply	other threads:[~2025-03-03 13:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-03 13:08 Nikita Kalyazin [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250303130838.28812-1-kalyazin@amazon.com \
    --to=kalyazin@amazon.com \
    --cc=brijesh.singh@amd.com \
    --cc=david@redhat.com \
    --cc=derekmn@amazon.com \
    --cc=graf@amazon.de \
    --cc=jgowans@amazon.com \
    --cc=jthoughton@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=michael.day@amd.com \
    --cc=michael.roth@amd.com \
    --cc=nsaenz@amazon.es \
    --cc=pbonzini@redhat.com \
    --cc=quic_eberman@quicinc.com \
    --cc=roypat@amazon.co.uk \
    --cc=shuah@kernel.org \
    --cc=xmarcalx@amazon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox