All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: qemu-devel@nongnu.org,
	"Zhenzhong Duan" <zhenzhong.duan@intel.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"David Hildenbrand" <david@kernel.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@mailo.com>,
	qemu-rust@nongnu.org, "Alex Williamson" <alex@shazbot.org>,
	"Cédric Le Goater" <clg@redhat.com>,
	"Maciej S. Szmigiero" <maciej.szmigiero@oracle.com>,
	"Fabiano Rosas" <farosas@suse.de>,
	"Mark Kanda" <mark.kanda@oracle.com>,
	"Ben Chaney" <bchaney@akamai.com>,
	"Marcelo Tosatti" <mtosatti@redhat.com>,
	kvm@vger.kernel.org, "Dr. David Alan Gilbert" <dave@treblig.org>,
	"Zhao Liu" <zhao1.liu@intel.com>,
	"Eric Blake" <eblake@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Xiaoyao Li" <xiaoyao.li@intel.com>
Subject: Re: [PATCH v5 00/12] Make RamDiscardManager work with multiple sources & virtio-mem
Date: Mon, 22 Jun 2026 15:28:12 -0400	[thread overview]
Message-ID: <ajmMzMAXay65Sl7U@x1.local> (raw)
In-Reply-To: <CAMxuvazRnZw4PEsdKCEBD8X1ua5LMj5K-k+-oh-J_uvXm5vT1w@mail.gmail.com>

On Mon, Jun 22, 2026 at 03:53:33PM +0400, Marc-André Lureau wrote:
> Hi Peter
> 
> On Fri, Jun 19, 2026 at 7:13 PM Peter Xu <peterx@redhat.com> wrote:
> >
> > On Fri, Jun 19, 2026 at 12:11:48AM +0400, Marc-André Lureau wrote:
> > > Hi
> > >
> > > On Thu, Jun 4, 2026 at 5:46 PM Marc-André Lureau
> > > <marcandre.lureau@redhat.com> wrote:
> > > >
> > > > Hi,
> > > >
> > > > This is an attempt to fix the incompatibility of virtio-mem with confidential
> > > > VMs. The solution implements what was discussed earlier with D. Hildenbrand:
> > > > https://patchwork.ozlabs.org/project/qemu-devel/patch/20250407074939.18657-5-chenyi.qiang@intel.com/#3502238
> > > >
> > > > The first patches are misc cleanups. Then some code refactoring to have split a
> > > > manager/source. And finally, the manager learns to deal with multiple sources.
> > > >
> > > > This has been tested together with the Linux kernel series from
> > > > Zhenzhong Duan [1] for TDX guests.
> > > >
> > > > (help fix https://issues.redhat.com/browse/RHEL-131968)
> > >
> > > Can the patch 1-11 be queued or are we missing something?
> > > (RFC patch 12 can be dropped for now)
> >
> > Likely yes.. one thing to double check with you before I do: We don't need
> > the kernel series, do we?  Since when unplug, I expect with the truncation
> > approach that this series proposed, KVM will emit TDH.MEM.PAGE.REMOVE then
> > unaccept is done (?).
> 
> > Say, what happens if we run QEMU with this series applied, but without the
> > kernel series?
> 
> The kernel series is needed at least for PAGE.ACCEPT. Without it, QEMU
> will have KVM_RUN return EIO, and finish into assert (while tearing
> down ioeventfd).

Could you elaborate a bit more on why ACCEPT would fail?

I used to ask the event flow here:

https://lore.kernel.org/qemu-devel/agTjb3M8ElUAlfp1@x1.local/

If AUG existed, then why ACCEPT would fail?

PS: I didn't read a lot of what a Linux guest would do; I know there're
some lazy accept approach, but IIUC it's only a matter of time to ACCEPT,
not correctness.  My understanding is if we properly notify these new slots
with AUG, then it should be able to ACCEPT?

> 
> > What confused me a bit is the dependency of this series v.s. the kernel
> > one.  It seems to use different approaches, but then I don't understand why
> > this series was tested with the kernel change.
> 
> My understanding is that the kernel may perform TDG.MEM.PAGE.RELEASE.
> That depends on TDX config TDCS_CONFIG_PAGE_RELEASE which qemu/kvm
> doesnt currently control. I don't know whether this is then
> redundant/needless with qemu doing discard on the guest_memfd..

The problem is if this series depends on the kernel series, should we then
wait for the kernel solution be accepted first in case it'll change?

But obviously I still don't yet fully understand how this whole thing
works.. :(

Thanks,

-- 
Peter Xu



  reply	other threads:[~2026-06-22 19:28 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-04 13:43 [PATCH v5 00/12] Make RamDiscardManager work with multiple sources & virtio-mem Marc-André Lureau
2026-06-04 13:43 ` [PATCH v5 01/12] system/memory: split RamDiscardManager into source and manager Marc-André Lureau
2026-06-18 20:51   ` Philippe Mathieu-Daudé
2026-06-04 13:43 ` [PATCH v5 02/12] system/memory: move RamDiscardManager to separate compilation unit Marc-André Lureau
2026-06-18 20:46   ` Philippe Mathieu-Daudé
2026-06-04 13:43 ` [PATCH v5 03/12] system/memory: constify section arguments Marc-André Lureau
2026-06-05 11:16   ` David Hildenbrand (Arm)
2026-06-08 12:48   ` Maciej S. Szmigiero
2026-06-18 20:42   ` Philippe Mathieu-Daudé
2026-06-04 13:43 ` [PATCH v5 04/12] system/ram-discard-manager: implement replay via is_populated iteration Marc-André Lureau
2026-06-05 12:00   ` David Hildenbrand (Arm)
2026-06-04 13:43 ` [PATCH v5 05/12] virtio-mem: remove replay_populated/replay_discarded implementation Marc-André Lureau
2026-06-04 13:43 ` [PATCH v5 06/12] system/ram-discard-manager: drop replay from source interface Marc-André Lureau
2026-06-04 13:43 ` [PATCH v5 07/12] system/memory: implement RamDiscardManager multi-source aggregation Marc-André Lureau
2026-06-04 13:43 ` [PATCH v5 08/12] system/physmem: destroy ram block attributes before RCU-deferred reclaim Marc-André Lureau
2026-06-04 13:43 ` [PATCH v5 09/12] system/memory: add RamDiscardManager reference counting and cleanup Marc-André Lureau
2026-06-04 13:43 ` [PATCH v5 10/12] tests: add unit tests for RamDiscardManager multi-source aggregation Marc-André Lureau
2026-06-04 13:43 ` [PATCH v5 11/12] system/physmem: make ram_block_discard_range() handle guest_memfd Marc-André Lureau
2026-06-04 13:43 ` [PATCH v5 12/12] RFC: monitor: add 'info ramblock-attributes' command Marc-André Lureau
2026-06-05 13:28   ` Dr. David Alan Gilbert
2026-06-08 13:36     ` Markus Armbruster
2026-06-08 13:30   ` Markus Armbruster
2026-06-18 20:11 ` [PATCH v5 00/12] Make RamDiscardManager work with multiple sources & virtio-mem Marc-André Lureau
2026-06-19 15:13   ` Peter Xu
2026-06-22 11:53     ` Marc-André Lureau
2026-06-22 19:28       ` Peter Xu [this message]
2026-06-22 20:00         ` Marc-André Lureau
2026-06-22 21:07           ` Peter Xu

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=ajmMzMAXay65Sl7U@x1.local \
    --to=peterx@redhat.com \
    --cc=alex@shazbot.org \
    --cc=armbru@redhat.com \
    --cc=bchaney@akamai.com \
    --cc=clg@redhat.com \
    --cc=dave@treblig.org \
    --cc=david@kernel.org \
    --cc=eblake@redhat.com \
    --cc=farosas@suse.de \
    --cc=kvm@vger.kernel.org \
    --cc=maciej.szmigiero@oracle.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mark.kanda@oracle.com \
    --cc=mst@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@mailo.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-rust@nongnu.org \
    --cc=xiaoyao.li@intel.com \
    --cc=zhao1.liu@intel.com \
    --cc=zhenzhong.duan@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.