From: Fabiano Rosas <farosas@suse.de>
To: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Cédric Le Goater" <clg@kaod.org>,
qemu-devel@nongnu.org, "Markus Armbruster" <armbru@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Tyrone Ting" <kfting@nuvoton.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Manos Pitsidianakis" <manos.pitsidianakis@linaro.org>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Joel Stanley" <joel@jms.id.au>,
"Alistair Francis" <alistair@alistair23.me>,
"Anton Johansson" <anjo@rev.ng>,
"Andrey Smirnov" <andrew.smirnov@gmail.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Hao Wu" <wuhaotsh@google.com>,
"Jean-Christophe Dubois" <jcd@tribudubois.net>,
"Igor Mitsyanko" <i.mitsyanko@gmail.com>,
"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
"Andrew Jeffery" <andrew@codeconstruct.com.au>,
"Rob Herring" <robh@kernel.org>,
qemu-arm@nongnu.org,
"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>
Subject: Re: [PATCH 00/33] hw/cpu/arm: Remove one use of qemu_get_cpu() in A7/A15 MPCore priv
Date: Wed, 10 Jan 2024 10:19:44 -0300 [thread overview]
Message-ID: <874jfl8gwf.fsf@suse.de> (raw)
In-Reply-To: <87cyu9hgit.fsf@pond.sub.org>
Markus Armbruster <armbru@redhat.com> writes:
> Peter Xu <peterx@redhat.com> writes:
>
>> On Tue, Jan 09, 2024 at 10:22:31PM +0100, Philippe Mathieu-Daudé wrote:
>>> Hi Fabiano,
>>>
>>> On 9/1/24 21:21, Fabiano Rosas wrote:
>>> > Cédric Le Goater <clg@kaod.org> writes:
>>> >
>>> > > On 1/9/24 18:40, Fabiano Rosas wrote:
>>> > > > Cédric Le Goater <clg@kaod.org> writes:
>>> > > >
>>> > > > > On 1/3/24 20:53, Fabiano Rosas wrote:
>>> > > > > > Philippe Mathieu-Daudé <philmd@linaro.org> writes:
>>> > > > > >
>>> > > > > > > +Peter/Fabiano
>>> > > > > > >
>>> > > > > > > On 2/1/24 17:41, Cédric Le Goater wrote:
>>> > > > > > > > On 1/2/24 17:15, Philippe Mathieu-Daudé wrote:
>>> > > > > > > > > Hi Cédric,
>>> > > > > > > > >
>>> > > > > > > > > On 2/1/24 15:55, Cédric Le Goater wrote:
>>> > > > > > > > > > On 12/12/23 17:29, Philippe Mathieu-Daudé wrote:
>>> > > > > > > > > > > Hi,
>>> > > > > > > > > > >
>>> > > > > > > > > > > When a MPCore cluster is used, the Cortex-A cores belong the the
>>> > > > > > > > > > > cluster container, not to the board/soc layer. This series move
>>> > > > > > > > > > > the creation of vCPUs to the MPCore private container.
>>> > > > > > > > > > >
>>> > > > > > > > > > > Doing so we consolidate the QOM model, moving common code in a
>>> > > > > > > > > > > central place (abstract MPCore parent).
>>> > > > > > > > > >
>>> > > > > > > > > > Changing the QOM hierarchy has an impact on the state of the machine
>>> > > > > > > > > > and some fixups are then required to maintain migration compatibility.
>>> > > > > > > > > > This can become a real headache for KVM machines like virt for which
>>> > > > > > > > > > migration compatibility is a feature, less for emulated ones.
>>> > > > > > > > >
>>> > > > > > > > > All changes are either moving properties (which are not migrated)
>>> > > > > > > > > or moving non-migrated QOM members (i.e. pointers of ARMCPU, which
>>> > > > > > > > > is still migrated elsewhere). So I don't see any obvious migration
>>> > > > > > > > > problem, but I might be missing something, so I Cc'ed Juan :>
>>> > > > > >
>>> > > > > > FWIW, I didn't spot anything problematic either.
>>> > > > > >
>>> > > > > > I've ran this through my migration compatibility series [1] and it
>>> > > > > > doesn't regress aarch64 migration from/to 8.2. The tests use '-M
>>> > > > > > virt -cpu max', so the cortex-a7 and cortex-a15 are not covered. I don't
>>> > > > > > think we even support migration of anything non-KVM on arm.
>>> > > > >
>>> > > > > it happens we do.
>>> > > > >
>>> > > >
>>> > > > Oh, sorry, I didn't mean TCG here. Probably meant to say something like
>>> > > > non-KVM-capable cpus, as in 32-bit. Nevermind.
>>> > >
>>> > > Theoretically, we should be able to migrate to a TCG guest. Well, this
>>> > > worked in the past for PPC. When I was doing more KVM related changes,
>>> > > this was very useful for dev. Also, some machines are partially emulated.
>>> > > Anyhow I agree this is not a strong requirement and we often break it.
>>> > > Let's focus on KVM only.
>>> > >
>>> > > > > > 1- https://gitlab.com/farosas/qemu/-/jobs/5853599533
>>> > > > >
>>> > > > > yes it depends on the QOM hierarchy and virt seems immune to the changes.
>>> > > > > Good.
>>> > > > >
>>> > > > > However, changing the QOM topology clearly breaks migration compat,
>>> > > >
>>> > > > Well, "clearly" is relative =) You've mentioned pseries and aspeed
>>> > > > already, do you have a pointer to one of those cases were we broke
>>> > > > migration
>>> > >
>>> > > Regarding pseries, migration compat broke because of 5bc8d26de20c
>>> > > ("spapr: allocate the ICPState object from under sPAPRCPUCore") which
>>> > > is similar to the changes proposed by this series, it impacts the QOM
>>> > > hierarchy. Here is the workaround/fix from Greg : 46f7afa37096
>>> > > ("spapr: fix migration of ICPState objects from/to older QEMU") which
>>> > > is quite an headache and this turned out to raise another problem some
>>> > > months ago ... :/ That's why I sent [1] to prepare removal of old
>>> > > machines and workarounds becoming a burden.
>>> >
>>> > This feels like something that could be handled by the vmstate code
>>> > somehow. The state is there, just under a different path.
>>>
>>> What, the QOM path is used in migration? ...
>>
>> Hopefully not..
Unfortunately the original fix doesn't mention _what_ actually broke
with migration. I assumed the QOM path was needed because otherwise I
don't think the fix makes sense. The thread discussing that patch also
directly mentions the QOM path:
https://www.mail-archive.com/qemu-devel@nongnu.org/msg450912.html
But I probably misunderstood something while reading that thread.
>>
>>>
>>> See recent discussions on "QOM path stability":
>>> https://lore.kernel.org/qemu-devel/ZZfYvlmcxBCiaeWE@redhat.com/
>>> https://lore.kernel.org/qemu-devel/87jzojbxt7.fsf@pond.sub.org/
>>> https://lore.kernel.org/qemu-devel/87v883by34.fsf@pond.sub.org/
>>
>> If I read it right, the commit 46f7afa37096 example is pretty special that
>> the QOM path more or less decided more than the hierachy itself but changes
>> the existances of objects.
>
> Let's see whether I got this...
>
> We removed some useless objects, moved the useful ones to another home.
> The move changed their QOM path.
>
> The problem was the removal of useless objects, because this also
> removed their vmstate.
If you checkout at the removal commit (5bc8d26de20c), the vmstate has
been kept untouched.
>
> The fix was adding the vmstate back as a dummy.
Since the vmstate was kept I don't see why would we need a dummy. The
incoming migration stream would still have the state, only at a
different point in the stream. It's surprising to me that that would
cause an issue, but I'm not well versed in that code.
>
> The QOM patch changes are *not* part of the problem.
The only explanation I can come up with is that after the patch
migration has broken after a hotplug or similar operation. In such
situation, the preallocated state would always be present before the
patch, but sometimes not present after the patch in case, say, a
hot-unplug has taken away a cpu + ICPState.
next prev parent reply other threads:[~2024-01-10 13:21 UTC|newest]
Thread overview: 76+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-12 16:29 [PATCH 00/33] hw/cpu/arm: Remove one use of qemu_get_cpu() in A7/A15 MPCore priv Philippe Mathieu-Daudé
2023-12-12 16:29 ` [PATCH 01/33] hw/arm/boot: Propagate vCPU to arm_load_dtb() Philippe Mathieu-Daudé
2024-01-02 13:51 ` Cédric Le Goater
2023-12-12 16:29 ` [PATCH 02/33] hw/arm/fsl-imx6: Add a local 'gic' variable Philippe Mathieu-Daudé
2024-01-02 13:52 ` Cédric Le Goater
2023-12-12 16:29 ` [PATCH 03/33] hw/arm/fsl-imx6ul: " Philippe Mathieu-Daudé
2024-01-02 13:52 ` Cédric Le Goater
2023-12-12 16:29 ` [PATCH 04/33] hw/arm/fsl-imx7: " Philippe Mathieu-Daudé
2024-01-02 13:53 ` Cédric Le Goater
2023-12-12 16:29 ` [PATCH 05/33] hw/cpu: Remove dead Kconfig Philippe Mathieu-Daudé
2024-01-02 13:53 ` Cédric Le Goater
2023-12-12 16:29 ` [PATCH 06/33] hw/cpu/arm: Rename 'busdev' -> 'gicsbd' in a15mp_priv_realize() Philippe Mathieu-Daudé
2024-01-02 13:54 ` Cédric Le Goater
2023-12-12 16:29 ` [PATCH 07/33] hw/cpu/arm: Alias 'num-cpu' property on TYPE_REALVIEW_MPCORE Philippe Mathieu-Daudé
2024-01-02 13:57 ` Cédric Le Goater
2023-12-12 16:29 ` [PATCH 08/33] hw/cpu/arm: Declare CPU QOM types using DEFINE_TYPES() macro Philippe Mathieu-Daudé
2024-01-02 13:57 ` Cédric Le Goater
2023-12-12 16:29 ` [PATCH 09/33] hw/cpu/arm: Merge {a9mpcore.h, a15mpcore.h} as cortex_mpcore.h Philippe Mathieu-Daudé
2024-01-02 14:00 ` Cédric Le Goater
2023-12-12 16:29 ` [PATCH 10/33] hw/cpu/arm: Introduce abstract CORTEX_MPCORE_PRIV QOM type Philippe Mathieu-Daudé
2024-01-02 14:23 ` Cédric Le Goater
2023-12-12 16:29 ` [PATCH 11/33] hw/cpu/arm: Have A9MPCORE/A15MPCORE inheritate common CORTEX_MPCORE_PRIV Philippe Mathieu-Daudé
2024-01-02 14:23 ` Cédric Le Goater
2023-12-12 16:29 ` [PATCH 12/33] hw/cpu/arm: Create MPCore container in QOM parent Philippe Mathieu-Daudé
2024-01-02 14:23 ` Cédric Le Goater
2023-12-12 16:29 ` [PATCH 13/33] hw/cpu/arm: Handle 'num_cores' property once in MPCore parent Philippe Mathieu-Daudé
2023-12-12 16:29 ` [PATCH 14/33] hw/cpu/arm: Handle 'has_el2/3' properties " Philippe Mathieu-Daudé
2024-01-12 21:33 ` Fabiano Rosas
2024-01-16 16:25 ` Philippe Mathieu-Daudé
2023-12-12 16:29 ` [PATCH 15/33] hw/cpu/arm: Handle 'gic-irq' property " Philippe Mathieu-Daudé
2023-12-12 16:29 ` [PATCH 16/33] hw/cpu/arm: Handle GIC " Philippe Mathieu-Daudé
2023-12-12 16:29 ` [PATCH 17/33] hw/cpu/arm: Document more properties of CORTEX_MPCORE_PRIV QOM type Philippe Mathieu-Daudé
2023-12-12 16:29 ` [PATCH 18/33] hw/cpu/arm: Replace A15MPPrivState by CortexMPPrivState Philippe Mathieu-Daudé
2023-12-12 16:29 ` [PATCH 19/33] hw/cpu/arm: Introduce TYPE_A7MPCORE_PRIV for Cortex-A7 MPCore Philippe Mathieu-Daudé
2023-12-12 16:29 ` [PATCH 20/33] hw/cpu/arm: Consolidate check on max GIC spi supported Philippe Mathieu-Daudé
2023-12-12 16:29 ` [PATCH 21/33] hw/cpu/arm: Create CPUs once in MPCore parent Philippe Mathieu-Daudé
2023-12-12 16:29 ` [PATCH 22/33] hw/arm/aspeed_ast2600: Let the A7MPcore create/wire the CPU cores Philippe Mathieu-Daudé
2024-01-02 0:11 ` Andrew Jeffery
2023-12-12 16:29 ` [PATCH 23/33] hw/arm/exynos4210: Let the A9MPcore " Philippe Mathieu-Daudé
2023-12-12 16:29 ` [PATCH 24/33] hw/arm/fsl-imx6: " Philippe Mathieu-Daudé
2023-12-12 16:29 ` [PATCH 25/33] hw/arm/fsl-imx6ul: Let the A7MPcore " Philippe Mathieu-Daudé
2023-12-12 16:29 ` [PATCH 26/33] hw/arm/fsl-imx7: " Philippe Mathieu-Daudé
2023-12-12 16:29 ` [PATCH 27/33] hw/arm/highbank: Let the A9/A15MPcore " Philippe Mathieu-Daudé
2023-12-12 16:29 ` [PATCH 28/33] hw/arm/vexpress: " Philippe Mathieu-Daudé
2023-12-12 16:29 ` [PATCH 29/33] hw/arm/xilinx_zynq: Let the A9MPcore " Philippe Mathieu-Daudé
2023-12-12 16:29 ` [PATCH 30/33] hw/arm/npcm7xx: " Philippe Mathieu-Daudé
2023-12-12 16:29 ` [PATCH 31/33] hw/cpu/a9mpcore: Remove legacy code Philippe Mathieu-Daudé
2023-12-12 16:29 ` [PATCH 32/33] hw/cpu/arm: Remove 'num-cpu' property alias Philippe Mathieu-Daudé
2023-12-12 16:29 ` [PATCH 33/33] hw/cpu/arm: Remove use of qemu_get_cpu() in A7/A15 realize() Philippe Mathieu-Daudé
2023-12-26 11:17 ` [PATCH 00/33] hw/cpu/arm: Remove one use of qemu_get_cpu() in A7/A15 MPCore priv Philippe Mathieu-Daudé
2024-01-02 14:55 ` Cédric Le Goater
2024-01-02 16:15 ` Philippe Mathieu-Daudé
2024-01-02 16:41 ` Cédric Le Goater
2024-01-03 9:19 ` Philippe Mathieu-Daudé
2024-01-03 19:53 ` Fabiano Rosas
2024-01-09 15:02 ` Cédric Le Goater
2024-01-09 17:40 ` Fabiano Rosas
2024-01-09 18:06 ` Cédric Le Goater
2024-01-09 20:21 ` Fabiano Rosas
2024-01-09 21:22 ` Philippe Mathieu-Daudé
2024-01-10 3:36 ` Peter Xu
2024-01-10 6:03 ` Markus Armbruster
2024-01-10 6:26 ` Peter Xu
2024-01-10 8:09 ` Markus Armbruster
2024-01-10 8:44 ` Peter Xu
2024-01-12 9:03 ` Cédric Le Goater
2024-01-10 13:19 ` Fabiano Rosas [this message]
2024-01-10 13:54 ` Markus Armbruster
2024-01-12 10:26 ` Cédric Le Goater
2024-01-12 19:54 ` Fabiano Rosas
2024-01-15 9:04 ` Cédric Le Goater
2024-01-12 8:41 ` Cédric Le Goater
2024-01-09 21:07 ` Philippe Mathieu-Daudé
2024-01-09 21:09 ` Philippe Mathieu-Daudé
2024-01-12 8:00 ` Cédric Le Goater
2024-01-12 7:29 ` Cédric Le Goater
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=874jfl8gwf.fsf@suse.de \
--to=farosas@suse.de \
--cc=alex.bennee@linaro.org \
--cc=alistair@alistair23.me \
--cc=andrew.smirnov@gmail.com \
--cc=andrew@codeconstruct.com.au \
--cc=anjo@rev.ng \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=clg@kaod.org \
--cc=edgar.iglesias@gmail.com \
--cc=eduardo@habkost.net \
--cc=i.mitsyanko@gmail.com \
--cc=jcd@tribudubois.net \
--cc=joel@jms.id.au \
--cc=kfting@nuvoton.com \
--cc=manos.pitsidianakis@linaro.org \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=peterx@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=robh@kernel.org \
--cc=wuhaotsh@google.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;
as well as URLs for NNTP newsgroup(s).