From: David Gibson <david@gibson.dropbear.id.au>
To: Greg Kurz <groug@kaod.org>
Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
Cedric Le Goater <clg@kaod.org>
Subject: Re: [Qemu-devel] [PATCH v4 5/6] xics: directly register ICPState objects to vmstate
Date: Mon, 12 Jun 2017 22:15:46 +0800 [thread overview]
Message-ID: <20170612141546.GH18542@umbus> (raw)
In-Reply-To: <149692939833.12119.5229563110691809599.stgit@bahia>
[-- Attachment #1: Type: text/plain, Size: 2374 bytes --]
On Thu, Jun 08, 2017 at 03:43:18PM +0200, Greg Kurz wrote:
> The ICPState objects are currently registered to vmstate as qdev objects.
> Their instance ids are hence computed automatically in the migration code,
> and thus depends on the order the CPU cores were plugged.
>
> If the destination had its CPU cores plugged in a different order than the
> source, then ICPState objects will have different instance_ids and load
> the wrong state.
>
> Since CPU objects have a reliable cpu_index which is already used as
> instance_id in vmstate, let's use it for ICPState as well.
>
> Signed-off-by: Greg Kurz <groug@kaod.org>
This is certainly an improvement. You answered my query on the
previous version as to why this doesn't break migration, but that
information should go into the commit message.
So, ideally, we would use the XICS "server number" as the migration
key. That's an architected part of the XICs state, since those values
are entered explicitly into the ICS. We have a way to go from server
number to ICP at the moment, but not the reverse, but we can fix that.
Unfortunately I think those won't always match existing automatically
generated IDs, which makes things harder.
> ---
> hw/intc/xics.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/hw/intc/xics.c b/hw/intc/xics.c
> index 7ccfb53c55a0..faa5c631f655 100644
> --- a/hw/intc/xics.c
> +++ b/hw/intc/xics.c
> @@ -344,10 +344,14 @@ static void icp_realize(DeviceState *dev, Error **errp)
> }
>
> qemu_register_reset(icp_reset, dev);
> + vmstate_register(NULL, icp->cs->cpu_index, &vmstate_icp_server, icp);
> }
>
> static void icp_unrealize(DeviceState *dev, Error **errp)
> {
> + ICPState *icp = ICP(dev);
> +
> + vmstate_unregister(NULL, &vmstate_icp_server, icp);
> qemu_unregister_reset(icp_reset, dev);
> }
>
> @@ -355,7 +359,6 @@ static void icp_class_init(ObjectClass *klass, void *data)
> {
> DeviceClass *dc = DEVICE_CLASS(klass);
>
> - dc->vmsd = &vmstate_icp_server;
> dc->realize = icp_realize;
> dc->unrealize = icp_unrealize;
> }
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2017-06-12 14:22 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-08 13:42 [Qemu-devel] [PATCH v4 0/6] spapr/xics: fix migration of older machine types Greg Kurz
2017-06-08 13:42 ` [Qemu-devel] [PATCH v4 1/6] xics: introduce macros for ICP/ICS link properties Greg Kurz
2017-06-08 14:04 ` Cédric Le Goater
2017-06-08 14:32 ` Greg Kurz
2017-06-08 14:51 ` Cédric Le Goater
2017-06-08 15:45 ` Greg Kurz
2017-06-08 16:08 ` Cédric Le Goater
2017-06-08 17:00 ` Greg Kurz
2017-06-08 17:26 ` Cédric Le Goater
2017-06-09 2:10 ` David Gibson
2017-06-09 5:46 ` Cédric Le Goater
2017-06-08 13:42 ` [Qemu-devel] [PATCH v4 2/6] xics: pass appropriate types to realize() handlers Greg Kurz
2017-06-08 13:42 ` [Qemu-devel] [PATCH v4 3/6] xics: setup cpu at realize time Greg Kurz
2017-06-08 14:08 ` Cédric Le Goater
2017-06-08 13:43 ` [Qemu-devel] [PATCH v4 4/6] xics: drop ICPStateClass::cpu_setup() handler Greg Kurz
2017-06-08 14:09 ` Cédric Le Goater
2017-06-08 13:43 ` [Qemu-devel] [PATCH v4 5/6] xics: directly register ICPState objects to vmstate Greg Kurz
2017-06-12 14:15 ` David Gibson [this message]
2017-06-13 7:14 ` Greg Kurz
2017-06-13 8:07 ` David Gibson
2017-06-08 13:43 ` [Qemu-devel] [PATCH v4 6/6] spapr: fix migration of ICPState objects from/to older QEMU Greg Kurz
2017-06-12 14:21 ` David Gibson
2017-06-13 7:39 ` Greg Kurz
2017-06-09 2:28 ` [Qemu-devel] [PATCH v4 0/6] spapr/xics: fix migration of older machine types David Gibson
2017-06-09 9:36 ` Greg Kurz
2017-06-09 10:28 ` David Gibson
2017-06-09 15:09 ` Greg Kurz
2017-06-11 9:38 ` David Gibson
2017-06-13 7:43 ` Greg Kurz
2017-06-13 8:29 ` Nikunj A Dadhania
2017-06-14 1:41 ` David Gibson
2017-06-14 4:57 ` Nikunj A Dadhania
2017-06-16 10:53 ` Nikunj A Dadhania
2017-06-16 14:28 ` David Gibson
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=20170612141546.GH18542@umbus \
--to=david@gibson.dropbear.id.au \
--cc=clg@kaod.org \
--cc=groug@kaod.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/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).