From: Peter Xu <peterx@redhat.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: Fabiano Rosas <farosas@suse.de>,
Alistair Francis <Alistair.Francis@wdc.com>,
Zishun Yi <vulab@iscas.ac.cn>,
"qemu-riscv@nongnu.org" <qemu-riscv@nongnu.org>,
"qemu-stable@nongnu.org" <qemu-stable@nongnu.org>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [PATCH v1] target/riscv: Add mseccfg to VMStateDescription
Date: Mon, 1 Jun 2026 17:07:44 -0400 [thread overview]
Message-ID: <ah30oAWataEPHDfu@x1.local> (raw)
In-Reply-To: <da24799f-dd23-49b6-8e7f-65d757721d3d@tls.msk.ru>
On Fri, May 29, 2026 at 10:43:13AM +0300, Michael Tokarev wrote:
> [Trimmed the Cc list a bit]
>
> On 27.05.2026 15:20, Fabiano Rosas wrote:
>
> > There are no migration compatibility guarantees for an unversioned
> > machine type. Only migration and snapshots from same-version QEMUs are
> > expected to work in this case. Other scenarios may or may not work.
> ..
> >
> > The addition from this patch is in a subsection, so .needed will
> > determine whether it will be put on the stream. If we backport the
> > change, then the stable QEMU build will (likely) start sending this
> > subsection, which the old, non-stable QEMU will not recognize and
> > migration will fail. Migration from stable-stable would likely work.
> >
> > So any stable versions that (would) contain this patch are likely to
> > block migration from that version into an unpatched QEMU.
> >
> > Note that since the machine is unversioned, migration from QEMU x to
> > QEMU x+1 is already prone to being broken.
>
> Yeah, this was my understanding too.
>
> And given all the above, I think we should apply the fixes to the
> stable series, and treat this as changing version (the version is
> actually changed, but only the minor version). Yes, the VMs wont
> be migratable between 10.0.9 and 10.0.10, exactly like it was
> not-migratable between 10.0.x and 10.1.x. Because basically, with
> no versioned machines, there's basically no migration capability
> between different qemus *at all*.
>
> When we do have versioned machines, we can't add fields to previous
> versions anymore, exactly because of the migration guarantees. But
> as long as we don't, there's no guarantees at all. And the only
> place where migration can be done is between different hosts with
> the same qemu versions.
>
> The above description leaves one question still. What happens when
> migrating from unpatched qemu to a patched qemu? Will the migration
> fail due to missing field, or succeed, making the missing field to
> have a default value?
>
> If it will succeed, then we definitely should add the field to fix
> the original issue.
>
> BTW, can't we just skip, at the receive end, fields we don't know about?
We don't have enough info to skip.
We have headers for VMSD, we don't have headers for VMSD fields. We
currently dump fields with pure binary streams. It means when there's a
new field added to migration stream, dest QEMU has no way to know it's a
new field, it'll treat it as the next thing it expects to see, which can be
anything. We still have the VMSD footer to guard us making sure it don't
bleed outside of the current VMSD, though.
>
> But all this is.. well... sort of moot for this very change already.
>
> I haven't realized that this discussion is about a change which I
> *already* applied (I wanted to revert it until this question settles,
> but I forgot to do that!). And meanwhile, I released the next set
> of stable qemu releases, with the changes in question (two of them)
> applied. It wasn't my intention (or else I'd not start this
> discussion in the first place, obviously).
>
> So we do have this migration breakage already, "thanks" to my sloppiness.
>
> And I don't want to break things for users for no reason. The original
> issue were described as a security issue even, so there's a reason to
> fix it. I think.
>
> But in the future I'll try to be more careful about such things.
> Again, understanding the machinery and consequences helps here too.
Before machine versioning is introduced, this looks like the right thing to
do.
Thanks,
--
Peter Xu
prev parent reply other threads:[~2026-06-01 21:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-11 12:48 [PATCH v1] target/riscv: Add mseccfg to VMStateDescription Zishun Yi
2026-05-11 12:54 ` Daniel P. Berrangé
2026-05-18 0:39 ` Alistair Francis
2026-05-18 0:42 ` Alistair Francis
2026-05-26 7:26 ` Michael Tokarev
2026-05-26 7:32 ` Michael Tokarev
2026-05-26 23:57 ` Alistair Francis
2026-05-27 7:03 ` Michael Tokarev
2026-05-27 12:20 ` Fabiano Rosas
2026-05-27 13:18 ` Peter Xu
2026-05-29 7:43 ` Michael Tokarev
2026-06-01 21:07 ` Peter Xu [this message]
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=ah30oAWataEPHDfu@x1.local \
--to=peterx@redhat.com \
--cc=Alistair.Francis@wdc.com \
--cc=farosas@suse.de \
--cc=mjt@tls.msk.ru \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=qemu-stable@nongnu.org \
--cc=vulab@iscas.ac.cn \
/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.