* [Qemu-devel] [PATCH] spapr/ppc: fix backward migration to QEMU 2.9
@ 2017-06-19 17:05 Greg Kurz
2017-06-20 13:08 ` [Qemu-devel] [Qemu-ppc] " Laurent Vivier
0 siblings, 1 reply; 4+ messages in thread
From: Greg Kurz @ 2017-06-19 17:05 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-ppc, David Gibson
Commit c783b0012708 ("ppc: Rework CPU compatibility testing across
migration") added a subsection to the vmstate description of CPUs.
This subsection is sent when the CPU compat_pvr field is non-zero,
which is likely to happen after CAS negociation (since QEMU 2.9) or
even before CAS negociation if the user explicitely asked for compat
mode.
This breaks backward migration of existing pseries-2.9 machine types
since they don't know about this "compat" subsection:
qemu-system-ppc64: error while loading state for instance 0x0 of
device 'cpu'
This patch reverts to the behavior of simply ignoring the PVR when
migrating older machines (ie, let the migration succeed if the user
is sure that the CPU on the destination is close enough to work).
Signed-off-by: Greg Kurz <groug@kaod.org>
---
hw/ppc/spapr.c | 7 ++++++-
target/ppc/cpu.h | 1 +
target/ppc/machine.c | 2 +-
target/ppc/translate_init.c | 2 ++
4 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index d4d781876b27..265d49bbcd7f 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -3474,7 +3474,12 @@ DEFINE_SPAPR_MACHINE(2_10, "2.10", true);
* pseries-2.9
*/
#define SPAPR_COMPAT_2_9 \
- HW_COMPAT_2_9
+ HW_COMPAT_2_9 \
+ { \
+ .driver = TYPE_POWERPC_CPU, \
+ .property = "pre-2.10-migration", \
+ .value = "on", \
+ }, \
static void spapr_machine_2_9_instance_options(MachineState *machine)
{
diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
index 09393e601fd9..6ee2a26a963d 100644
--- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h
@@ -1211,6 +1211,7 @@ struct PowerPCCPU {
uint64_t mig_insns_flags;
uint64_t mig_insns_flags2;
uint32_t mig_nb_BATs;
+ bool pre_2_10_migration;
};
static inline PowerPCCPU *ppc_env_get_cpu(CPUPPCState *env)
diff --git a/target/ppc/machine.c b/target/ppc/machine.c
index a29aabe8f079..1b7aede579ea 100644
--- a/target/ppc/machine.c
+++ b/target/ppc/machine.c
@@ -608,7 +608,7 @@ static bool compat_needed(void *opaque)
PowerPCCPU *cpu = opaque;
assert(!(cpu->compat_pvr && !cpu->vhyp));
- return (cpu->compat_pvr != 0);
+ return !cpu->pre_2_10_migration && cpu->compat_pvr != 0;
}
static const VMStateDescription vmstate_compat = {
diff --git a/target/ppc/translate_init.c b/target/ppc/translate_init.c
index 53aff5a7b734..783bf98217cc 100644
--- a/target/ppc/translate_init.c
+++ b/target/ppc/translate_init.c
@@ -10610,6 +10610,8 @@ static gchar *ppc_gdb_arch_name(CPUState *cs)
static Property ppc_cpu_properties[] = {
DEFINE_PROP_BOOL("pre-2.8-migration", PowerPCCPU, pre_2_8_migration, false),
+ DEFINE_PROP_BOOL("pre-2.10-migration", PowerPCCPU, pre_2_10_migration,
+ false),
DEFINE_PROP_END_OF_LIST(),
};
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH] spapr/ppc: fix backward migration to QEMU 2.9
2017-06-19 17:05 [Qemu-devel] [PATCH] spapr/ppc: fix backward migration to QEMU 2.9 Greg Kurz
@ 2017-06-20 13:08 ` Laurent Vivier
2017-06-20 14:19 ` Greg Kurz
0 siblings, 1 reply; 4+ messages in thread
From: Laurent Vivier @ 2017-06-20 13:08 UTC (permalink / raw)
To: Greg Kurz, qemu-devel; +Cc: qemu-ppc, David Gibson
On 19/06/2017 19:05, Greg Kurz wrote:
> Commit c783b0012708 ("ppc: Rework CPU compatibility testing across
> migration") added a subsection to the vmstate description of CPUs.
> This subsection is sent when the CPU compat_pvr field is non-zero,
> which is likely to happen after CAS negociation (since QEMU 2.9) or
> even before CAS negociation if the user explicitely asked for compat
> mode.
>
> This breaks backward migration of existing pseries-2.9 machine types
> since they don't know about this "compat" subsection:
>
> qemu-system-ppc64: error while loading state for instance 0x0 of
> device 'cpu'
>
> This patch reverts to the behavior of simply ignoring the PVR when
> migrating older machines (ie, let the migration succeed if the user
> is sure that the CPU on the destination is close enough to work).
>
> Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
but I think it should be merged with patch ("ppc: Rework CPU
compatibility testing across migration") that is not merged and in the
maintainer tree.
thanks,
Laurent
> ---
> hw/ppc/spapr.c | 7 ++++++-
> target/ppc/cpu.h | 1 +
> target/ppc/machine.c | 2 +-
> target/ppc/translate_init.c | 2 ++
> 4 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index d4d781876b27..265d49bbcd7f 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -3474,7 +3474,12 @@ DEFINE_SPAPR_MACHINE(2_10, "2.10", true);
> * pseries-2.9
> */
> #define SPAPR_COMPAT_2_9 \
> - HW_COMPAT_2_9
> + HW_COMPAT_2_9 \
> + { \
> + .driver = TYPE_POWERPC_CPU, \
> + .property = "pre-2.10-migration", \
> + .value = "on", \
> + }, \
>
> static void spapr_machine_2_9_instance_options(MachineState *machine)
> {
> diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
> index 09393e601fd9..6ee2a26a963d 100644
> --- a/target/ppc/cpu.h
> +++ b/target/ppc/cpu.h
> @@ -1211,6 +1211,7 @@ struct PowerPCCPU {
> uint64_t mig_insns_flags;
> uint64_t mig_insns_flags2;
> uint32_t mig_nb_BATs;
> + bool pre_2_10_migration;
> };
>
> static inline PowerPCCPU *ppc_env_get_cpu(CPUPPCState *env)
> diff --git a/target/ppc/machine.c b/target/ppc/machine.c
> index a29aabe8f079..1b7aede579ea 100644
> --- a/target/ppc/machine.c
> +++ b/target/ppc/machine.c
> @@ -608,7 +608,7 @@ static bool compat_needed(void *opaque)
> PowerPCCPU *cpu = opaque;
>
> assert(!(cpu->compat_pvr && !cpu->vhyp));
> - return (cpu->compat_pvr != 0);
> + return !cpu->pre_2_10_migration && cpu->compat_pvr != 0;
> }
>
> static const VMStateDescription vmstate_compat = {
> diff --git a/target/ppc/translate_init.c b/target/ppc/translate_init.c
> index 53aff5a7b734..783bf98217cc 100644
> --- a/target/ppc/translate_init.c
> +++ b/target/ppc/translate_init.c
> @@ -10610,6 +10610,8 @@ static gchar *ppc_gdb_arch_name(CPUState *cs)
>
> static Property ppc_cpu_properties[] = {
> DEFINE_PROP_BOOL("pre-2.8-migration", PowerPCCPU, pre_2_8_migration, false),
> + DEFINE_PROP_BOOL("pre-2.10-migration", PowerPCCPU, pre_2_10_migration,
> + false),
> DEFINE_PROP_END_OF_LIST(),
> };
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH] spapr/ppc: fix backward migration to QEMU 2.9
2017-06-20 13:08 ` [Qemu-devel] [Qemu-ppc] " Laurent Vivier
@ 2017-06-20 14:19 ` Greg Kurz
2017-06-21 8:05 ` David Gibson
0 siblings, 1 reply; 4+ messages in thread
From: Greg Kurz @ 2017-06-20 14:19 UTC (permalink / raw)
To: Laurent Vivier; +Cc: qemu-devel, qemu-ppc, David Gibson
[-- Attachment #1: Type: text/plain, Size: 4031 bytes --]
On Tue, 20 Jun 2017 15:08:47 +0200
Laurent Vivier <lvivier@redhat.com> wrote:
> On 19/06/2017 19:05, Greg Kurz wrote:
> > Commit c783b0012708 ("ppc: Rework CPU compatibility testing across
> > migration") added a subsection to the vmstate description of CPUs.
> > This subsection is sent when the CPU compat_pvr field is non-zero,
> > which is likely to happen after CAS negociation (since QEMU 2.9) or
> > even before CAS negociation if the user explicitely asked for compat
> > mode.
> >
> > This breaks backward migration of existing pseries-2.9 machine types
> > since they don't know about this "compat" subsection:
> >
> > qemu-system-ppc64: error while loading state for instance 0x0 of
> > device 'cpu'
> >
> > This patch reverts to the behavior of simply ignoring the PVR when
> > migrating older machines (ie, let the migration succeed if the user
> > is sure that the CPU on the destination is close enough to work).
> >
> > Signed-off-by: Greg Kurz <groug@kaod.org>
>
> Reviewed-by: Laurent Vivier <lvivier@redhat.com>
>
> but I think it should be merged with patch ("ppc: Rework CPU
> compatibility testing across migration") that is not merged and in the
> maintainer tree.
>
I agree this would be better for bisect.
Cheers,
--
Greg
> thanks,
> Laurent
>
> > ---
> > hw/ppc/spapr.c | 7 ++++++-
> > target/ppc/cpu.h | 1 +
> > target/ppc/machine.c | 2 +-
> > target/ppc/translate_init.c | 2 ++
> > 4 files changed, 10 insertions(+), 2 deletions(-)
> >
> > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> > index d4d781876b27..265d49bbcd7f 100644
> > --- a/hw/ppc/spapr.c
> > +++ b/hw/ppc/spapr.c
> > @@ -3474,7 +3474,12 @@ DEFINE_SPAPR_MACHINE(2_10, "2.10", true);
> > * pseries-2.9
> > */
> > #define SPAPR_COMPAT_2_9 \
> > - HW_COMPAT_2_9
> > + HW_COMPAT_2_9 \
> > + { \
> > + .driver = TYPE_POWERPC_CPU, \
> > + .property = "pre-2.10-migration", \
> > + .value = "on", \
> > + }, \
> >
> > static void spapr_machine_2_9_instance_options(MachineState *machine)
> > {
> > diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
> > index 09393e601fd9..6ee2a26a963d 100644
> > --- a/target/ppc/cpu.h
> > +++ b/target/ppc/cpu.h
> > @@ -1211,6 +1211,7 @@ struct PowerPCCPU {
> > uint64_t mig_insns_flags;
> > uint64_t mig_insns_flags2;
> > uint32_t mig_nb_BATs;
> > + bool pre_2_10_migration;
> > };
> >
> > static inline PowerPCCPU *ppc_env_get_cpu(CPUPPCState *env)
> > diff --git a/target/ppc/machine.c b/target/ppc/machine.c
> > index a29aabe8f079..1b7aede579ea 100644
> > --- a/target/ppc/machine.c
> > +++ b/target/ppc/machine.c
> > @@ -608,7 +608,7 @@ static bool compat_needed(void *opaque)
> > PowerPCCPU *cpu = opaque;
> >
> > assert(!(cpu->compat_pvr && !cpu->vhyp));
> > - return (cpu->compat_pvr != 0);
> > + return !cpu->pre_2_10_migration && cpu->compat_pvr != 0;
> > }
> >
> > static const VMStateDescription vmstate_compat = {
> > diff --git a/target/ppc/translate_init.c b/target/ppc/translate_init.c
> > index 53aff5a7b734..783bf98217cc 100644
> > --- a/target/ppc/translate_init.c
> > +++ b/target/ppc/translate_init.c
> > @@ -10610,6 +10610,8 @@ static gchar *ppc_gdb_arch_name(CPUState *cs)
> >
> > static Property ppc_cpu_properties[] = {
> > DEFINE_PROP_BOOL("pre-2.8-migration", PowerPCCPU, pre_2_8_migration, false),
> > + DEFINE_PROP_BOOL("pre-2.10-migration", PowerPCCPU, pre_2_10_migration,
> > + false),
> > DEFINE_PROP_END_OF_LIST(),
> > };
> >
> >
> >
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH] spapr/ppc: fix backward migration to QEMU 2.9
2017-06-20 14:19 ` Greg Kurz
@ 2017-06-21 8:05 ` David Gibson
0 siblings, 0 replies; 4+ messages in thread
From: David Gibson @ 2017-06-21 8:05 UTC (permalink / raw)
To: Greg Kurz; +Cc: Laurent Vivier, qemu-devel, qemu-ppc
[-- Attachment #1: Type: text/plain, Size: 1641 bytes --]
On Tue, Jun 20, 2017 at 04:19:01PM +0200, Greg Kurz wrote:
> On Tue, 20 Jun 2017 15:08:47 +0200
> Laurent Vivier <lvivier@redhat.com> wrote:
>
> > On 19/06/2017 19:05, Greg Kurz wrote:
> > > Commit c783b0012708 ("ppc: Rework CPU compatibility testing across
> > > migration") added a subsection to the vmstate description of CPUs.
> > > This subsection is sent when the CPU compat_pvr field is non-zero,
> > > which is likely to happen after CAS negociation (since QEMU 2.9) or
> > > even before CAS negociation if the user explicitely asked for compat
> > > mode.
> > >
> > > This breaks backward migration of existing pseries-2.9 machine types
> > > since they don't know about this "compat" subsection:
> > >
> > > qemu-system-ppc64: error while loading state for instance 0x0 of
> > > device 'cpu'
> > >
> > > This patch reverts to the behavior of simply ignoring the PVR when
> > > migrating older machines (ie, let the migration succeed if the user
> > > is sure that the CPU on the destination is close enough to work).
> > >
> > > Signed-off-by: Greg Kurz <groug@kaod.org>
> >
> > Reviewed-by: Laurent Vivier <lvivier@redhat.com>
> >
> > but I think it should be merged with patch ("ppc: Rework CPU
> > compatibility testing across migration") that is not merged and in the
> > maintainer tree.
> >
>
> I agree this would be better for bisect.
As suggested, folded into the existing patch.
--
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 --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-06-21 8:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-19 17:05 [Qemu-devel] [PATCH] spapr/ppc: fix backward migration to QEMU 2.9 Greg Kurz
2017-06-20 13:08 ` [Qemu-devel] [Qemu-ppc] " Laurent Vivier
2017-06-20 14:19 ` Greg Kurz
2017-06-21 8:05 ` David Gibson
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).