From: David Gibson <david@gibson.dropbear.id.au>
To: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
bharata@linux.vnet.ibm.com, aik@ozlabs.ru, qemu-devel@nongnu.org,
qemu-ppc@nongnu.org, clg@kaod.org
Subject: Re: [Qemu-devel] pseries-2.6 migration from QEMU-2.6 to QEMU-2.7 broken
Date: Fri, 23 Sep 2016 10:52:31 +1000 [thread overview]
Message-ID: <20160923005231.GM2085@umbus.fritz.box> (raw)
In-Reply-To: <87d1jw5mr0.fsf@abhimanyu.i-did-not-set--mail-host-address--so-tickle-me>
[-- Attachment #1: Type: text/plain, Size: 2879 bytes --]
On Thu, Sep 22, 2016 at 02:34:19PM +0530, Nikunj A Dadhania wrote:
> Benjamin Herrenschmidt <benh@kernel.crashing.org> writes:
>
> > On Thu, 2016-09-22 at 11:45 +0530, Bharata B Rao wrote:
> >> On Thu, Sep 22, 2016 at 04:07:21PM +1000, Benjamin Herrenschmidt wrote:
> >> >
> >> > On Thu, 2016-09-22 at 10:51 +0530, Bharata B Rao wrote:
> >> > >
> >> > > The flag values are expected to remain same for a machine version for
> >> > > the migration to succeed, but this expectation is broken now. Should
> >> > > we make the addition of these flags conditional on machine type
> >> > > version ?
> >> > > But these flags are part of POWER8 CPU definition which is common for
> >> > > both pseries and upcoming powernv.
> >> >
> >> > Does this affect KVM ? (And if yes why on earth would KVM give a flying
> >> > f*** about the TCG instruction flags ?) ... If not, then I think we can
> >> > safely not care.
> >>
> >> Yes, KVM migration is broken.
> >
> > Argh then ... stupid design in QEMU. We can't fix anything without
> > breaking migration, yay !
>
> Looking back in the history of the code:
>
> commit: a90db1584a00dc1d1439dc7729d99674b666b85e (target-ppc: Convert
> ppc cpu savevm to VMStateDescription) added this:
>
> + /* Sanity checking */
> + VMSTATE_UINT64_EQUAL(env.insns_flags, PowerPCCPU),
> + VMSTATE_UINT64_EQUAL(env.insns_flags2, PowerPCCPU),
>
> These flags weren't part of vmstate, I am not sure what was the reason
> behind adding it though. Its a bit old, Alexey do you remember?
>
> > I don't know what to do to fix that to be honest. Do we have a way to filter
> > what flags actually matter and filter things out when KVM is enabled ?
>
> Something like this works for KVM:
>
> diff --git a/target-ppc/machine.c b/target-ppc/machine.c
> index 4820f22..1cf3779 100644
> --- a/target-ppc/machine.c
> +++ b/target-ppc/machine.c
> @@ -563,8 +563,8 @@ const VMStateDescription vmstate_ppc_cpu = {
>
> /* Sanity checking */
> VMSTATE_UINTTL_EQUAL(env.msr_mask, PowerPCCPU),
> - VMSTATE_UINT64_EQUAL(env.insns_flags, PowerPCCPU),
> - VMSTATE_UINT64_EQUAL(env.insns_flags2, PowerPCCPU),
> + VMSTATE_UNUSED(sizeof(target_ulong)), /* was _EQUAL(env.insns_flags) */
> + VMSTATE_UNUSED(sizeof(target_ulong)), /* was _EQUAL(env.insns_flags2) */
> VMSTATE_UINT32_EQUAL(env.nb_BATs, PowerPCCPU),
> VMSTATE_END_OF_LIST()
> },
This looks like the right solution to me. AFAICT this was just a
sanity check that wasn't thought through well enough.
> TCG migration still remains broken with this.
Uh.. why?
--
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:[~2016-09-23 2:49 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-22 5:21 [Qemu-devel] pseries-2.6 migration from QEMU-2.6 to QEMU-2.7 broken Bharata B Rao
2016-09-22 5:30 ` David Gibson
2016-09-22 6:00 ` Bharata B Rao
2016-09-22 6:36 ` Cédric Le Goater
2016-09-22 9:46 ` Dr. David Alan Gilbert
2016-09-22 10:01 ` Nikunj A Dadhania
2016-09-22 10:28 ` Dr. David Alan Gilbert
2016-09-22 11:18 ` Nikunj A Dadhania
2016-09-22 6:07 ` Benjamin Herrenschmidt
2016-09-22 6:15 ` Bharata B Rao
2016-09-22 8:47 ` Benjamin Herrenschmidt
2016-09-22 9:04 ` Nikunj A Dadhania
2016-09-22 10:04 ` Benjamin Herrenschmidt
2016-09-22 10:32 ` Paolo Bonzini
2016-09-22 11:07 ` Benjamin Herrenschmidt
2016-09-23 1:01 ` David Gibson
2016-09-22 11:07 ` Nikunj A Dadhania
2016-09-22 11:27 ` Cédric Le Goater
2016-09-22 11:37 ` Benjamin Herrenschmidt
2016-09-23 1:37 ` David Gibson
2016-09-23 3:27 ` Benjamin Herrenschmidt
2016-09-23 5:49 ` David Gibson
2016-09-22 19:00 ` Nikunj A Dadhania
2016-09-22 16:07 ` Dr. David Alan Gilbert
2016-09-22 17:27 ` Nikunj A Dadhania
2016-09-22 10:34 ` Alexey Kardashevskiy
2016-09-22 11:09 ` Benjamin Herrenschmidt
2016-09-23 0:52 ` David Gibson [this message]
2016-09-23 3:18 ` Nikunj A Dadhania
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=20160923005231.GM2085@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=aik@ozlabs.ru \
--cc=benh@kernel.crashing.org \
--cc=bharata@linux.vnet.ibm.com \
--cc=clg@kaod.org \
--cc=nikunj@linux.vnet.ibm.com \
--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 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.