From: Markus Armbruster <armbru@redhat.com>
To: Michael Roth <michael.roth@amd.com>
Cc: <qemu-devel@nongnu.org>, <pbonzini@redhat.com>,
<berrange@redhat.com>, <pankaj.gupta@amd.com>,
<isaku.yamahata@intel.com>, <xiaoyao.li@intel.com>,
<chao.p.peng@linux.intel.com>, <david@kernel.org>,
Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>
Subject: Re: [PATCH v5 08/12] hostmem: Support fully shared guest memfd to back a VM
Date: Fri, 11 Sep 2026 07:56:11 +0200 [thread overview]
Message-ID: <87mrtobabo.fsf@pond.sub.org> (raw)
In-Reply-To: <wli5vbctw6wxsqlxs6e5ojarvxq3xj3xv6ottjfenios2ndxld@etwnuqkbvmzf> (Michael Roth's message of "Thu, 10 Sep 2026 17:58:56 -0500")
Michael Roth <michael.roth@amd.com> writes:
> On Tue, Sep 08, 2026 at 04:03:28PM +0200, Markus Armbruster wrote:
>> Michael Roth <michael.roth@amd.com> writes:
>>
>> > From: Peter Xu <peterx@redhat.com>
>> >
>> > Host backends supports guest-memfd now by detecting whether it's a
>> > confidential VM. There's no way to choose it yet from the memory level to
>> > use it fully shared. If we use guest-memfd, it so far always implies we
>> > need two layers of memory backends, while the guest-memfd only provides the
>> > private set of pages.
>> >
>> > This patch introduces a way so that QEMU can consume guest memfd as the
>> > only source of memory to back the object (aka, fully shared).
>> >
>> > To use the fully shared guest-memfd, one can add a memfd object with:
>> >
>> > -object memory-backend-memfd,guest-memfd=on,share=on
>> >
>> > Note that share=on is required with fully shared guest_memfd.
>> >
>> > PS: there's a trivial touch-up on fd<0 check, because the stub to create
>> > guest-memfd may return negative but not -1.
>> >
>> > Signed-off-by: Peter Xu <peterx@redhat.com>
>> > Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
>> > Reviewed-by: Fabiano Rosas <farosas@suse.de>
>> > Signed-off-by: Michael Roth <michael.roth@amd.com>
>>
>> [...]
>>
>> > diff --git a/qapi/qom.json b/qapi/qom.json
>> > index 4a9b7f9088..909add4299 100644
>> > --- a/qapi/qom.json
>> > +++ b/qapi/qom.json
>> > @@ -771,13 +771,17 @@
>> > # @seal: if true, create a sealed-file, which will block further
>> > # resizing of the memory (default: true)
>> > #
>> > +# @guest-memfd: if true, use guest-memfd to back the memory region.
>> > +# (default: false, since: 11.2)
>>
>> What's guest-memfd and why would I want to use it?
>
> I'm planning to squash the below documentation patch into this commit so
> it can be referenced in the schema documentation for the @guest-memfd
> option.
>
> I think it explains the "what", but the "why" is a bit awkward at this
> stage because we anticipate a lot of use-cases, and potentially it
> becoming the general default for backing guest memory that doesn't
> specifically need any functionality provided by the other
> memory-backend-* implementations, but admittedly at this stage it would
> be primarily for experimentation and getting infrastructure in place
> because there are feature gaps like hugepage/THP support that would
> prevent it from being a drop in replacement for memfd users.
>
> The first 'real' use-case will come when either one of the features
> mentioned in the documentation below (or something else) goes upstream,
> or (more likely at this point) the in-place conversion patches land and
> the @guest-memfd=on functionality becomes a requirement for Confidential
> VMs that want to run in that mode (which does have immediately tangible
> benefits like not needing to reallocate memory after every
> shared<->private conversion and will likely deprecate the existing
> out-of-place conversion mode currently used by SNP/TDX fairly quickly)).
> I plan to add that use-case to the document as well, but it seems more
> appropriate to do so in the context of the in-place conversion series
> where I can talk about it in a non-theoretical context.
Would it make sense to mark it experimental until then? Also makes me
more willing to accept documentation gaps, and could serve as a reminder
to fill them.
I've come to ask "why would I want to use this?" more and more. QEMU
has so many knobs to push and turn, and we provide so little guidance on
what to use them for. Users' need for guidance is easy to miss when you
don't feel it yourself, because you're deep into the feature.
> But hopefully the below documentation is enough to at least let people
> know who should/shouldn't care about this option in the context of this
> series though. If that seems acceptable I can it into this patch for v6
> to compliment the schema documentation.
Yes, please. Consider wrapping lines around column 70 to make it easier
to read.
[...]
next prev parent reply other threads:[~2026-09-11 5:56 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-08 13:30 [PATCH v5 00/12] KVM/hostmem: Support init-shared guest-memfd as VM backends Michael Roth
2026-09-08 13:30 ` [PATCH v5 01/12] kvm: Decouple memory attribute check from kvm_guest_memfd_supported Michael Roth
2026-09-10 8:47 ` David Hildenbrand
2026-09-08 13:30 ` [PATCH v5 02/12] kvm: Detect guest-memfd flags supported Michael Roth
2026-09-08 13:30 ` [PATCH v5 03/12] kvm: Provide explicit error for kvm_create_guest_memfd() Michael Roth
2026-09-10 8:48 ` David Hildenbrand
2026-09-08 13:30 ` [PATCH v5 04/12] ramblock: Rename guest_memfd to guest_memfd_private Michael Roth
2026-09-10 8:49 ` David Hildenbrand
2026-09-08 13:30 ` [PATCH v5 05/12] memory: Rename RAM_GUEST_MEMFD to RAM_GUEST_MEMFD_PRIVATE Michael Roth
2026-09-10 8:50 ` David Hildenbrand
2026-09-08 13:30 ` [PATCH v5 06/12] memory: Rename memory_region_has_guest_memfd() to *_private() Michael Roth
2026-09-10 8:50 ` David Hildenbrand
2026-09-08 13:30 ` [PATCH v5 07/12] hostmem: Rename guest_memfd to guest_memfd_private Michael Roth
2026-09-10 8:51 ` David Hildenbrand
2026-09-08 13:30 ` [PATCH v5 08/12] hostmem: Support fully shared guest memfd to back a VM Michael Roth
2026-09-08 14:03 ` Markus Armbruster
2026-09-10 22:58 ` Michael Roth
2026-09-11 5:56 ` Markus Armbruster [this message]
2026-09-11 19:22 ` Michael Roth
2026-09-10 8:54 ` David Hildenbrand
2026-09-10 23:00 ` Michael Roth
2026-09-11 12:06 ` Peter Xu
2026-09-11 16:00 ` David Hildenbrand (Arm)
2026-09-14 12:59 ` Peter Xu
2026-09-15 15:02 ` David Hildenbrand (Arm)
2026-09-08 13:30 ` [PATCH v5 09/12] machine: Rename machine_require_guest_memfd() to *_private() Michael Roth
2026-09-10 8:55 ` David Hildenbrand
2026-09-10 23:08 ` Michael Roth
2026-09-11 10:48 ` David Hildenbrand (Arm)
2026-09-11 19:27 ` Michael Roth
2026-09-08 13:31 ` [PATCH v5 10/12] memory: Rename memory_region_init_ram_guest_memfd() " Michael Roth
2026-09-10 8:56 ` David Hildenbrand
2026-09-08 13:31 ` [PATCH v5 11/12] tests/migration-test: Support guest-memfd init shared mem type Michael Roth
2026-09-08 13:31 ` [PATCH v5 12/12] tests/migration-test: Add a precopy test for guest-memfd Michael Roth
2026-09-10 8:45 ` [PATCH v5 00/12] KVM/hostmem: Support init-shared guest-memfd as VM backends David Hildenbrand
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=87mrtobabo.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=chao.p.peng@linux.intel.com \
--cc=david@kernel.org \
--cc=farosas@suse.de \
--cc=isaku.yamahata@intel.com \
--cc=michael.roth@amd.com \
--cc=pankaj.gupta@amd.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=xiaoyao.li@intel.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