diff mbox

[RFC,v1,5/5] cpu, spapr: Use migration_id from pseries-2.7 onwards

Message ID 1467795561-1007-6-git-send-email-bharata@linux.vnet.ibm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Bharata B Rao July 6, 2016, 8:59 a.m. UTC
Turn on use-migration-id property. Starting from pseries-2.7, prefer the
use of migration_id (cpu_dt_id) over cpu_index for cpu vmstate registration
and in XICS code.

This allows migration to work when CPU cores are not necessarily
unplugged in LIFO order.

TODO: Property use-migration-id is by default turned on, check
if this needs to turned off for older machine type versions of
all archs.

Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
---
 hw/ppc/spapr.c | 5 +++++
 qom/cpu.c      | 1 +
 2 files changed, 6 insertions(+)

Comments

Igor Mammedov July 6, 2016, 11:44 a.m. UTC | #1
On Wed,  6 Jul 2016 14:29:21 +0530
Bharata B Rao <bharata@linux.vnet.ibm.com> wrote:

> Turn on use-migration-id property. Starting from pseries-2.7, prefer
> the use of migration_id (cpu_dt_id) over cpu_index for cpu vmstate
> registration and in XICS code.
> 
> This allows migration to work when CPU cores are not necessarily
> unplugged in LIFO order.
> 
> TODO: Property use-migration-id is by default turned on, check
> if this needs to turned off for older machine type versions of
> all archs.
> 
> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> ---
>  hw/ppc/spapr.c | 5 +++++
>  qom/cpu.c      | 1 +
>  2 files changed, 6 insertions(+)
> 
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 7f33a1b..be9af10 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -2501,6 +2501,11 @@ DEFINE_SPAPR_MACHINE(2_7, "2.7", true);
>          .driver   = TYPE_SPAPR_PCI_HOST_BRIDGE,\
>          .property = "ddw",\
>          .value    = stringify(off),\
> +    }, \
> +    { \
> +        .driver   = TYPE_CPU,\
> +        .property = "use-migration-id",\
> +        .value    = stringify(off),\
>      },
>  
>  static void spapr_machine_2_6_instance_options(MachineState *machine)
> diff --git a/qom/cpu.c b/qom/cpu.c
> index 01cf136..e505810 100644
> --- a/qom/cpu.c
> +++ b/qom/cpu.c
> @@ -351,6 +351,7 @@ static void cpu_common_initfn(Object *obj)
>      object_property_add_bool(obj, "use-migration-id",
>                               cpu_common_get_use_migration_id,
>                               cpu_common_set_use_migration_id, NULL);
> +    object_property_set_bool(obj, true, "use-migration-id", NULL);
this hunk doesn't belong here, it should be in patch that introduces,
default FALSE and targets that use it can flip it on and off depending
on machine version.


>  }
>  
>  static void cpu_common_finalize(Object *obj)
Igor Mammedov July 6, 2016, 11:45 a.m. UTC | #2
On Wed,  6 Jul 2016 14:29:21 +0530
Bharata B Rao <bharata@linux.vnet.ibm.com> wrote:

> Turn on use-migration-id property. Starting from pseries-2.7, prefer
> the use of migration_id (cpu_dt_id) over cpu_index for cpu vmstate
> registration and in XICS code.
> 
> This allows migration to work when CPU cores are not necessarily
> unplugged in LIFO order.
> 
> TODO: Property use-migration-id is by default turned on, check
> if this needs to turned off for older machine type versions of
> all archs.
> 
> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> ---
>  hw/ppc/spapr.c | 5 +++++
>  qom/cpu.c      | 1 +
>  2 files changed, 6 insertions(+)
> 
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 7f33a1b..be9af10 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -2501,6 +2501,11 @@ DEFINE_SPAPR_MACHINE(2_7, "2.7", true);
>          .driver   = TYPE_SPAPR_PCI_HOST_BRIDGE,\
>          .property = "ddw",\
>          .value    = stringify(off),\
> +    }, \
> +    { \
> +        .driver   = TYPE_CPU,\
> +        .property = "use-migration-id",\
> +        .value    = stringify(off),\
nit,
 why not to use "off" directly, stringify looks odd here.

>      },
>  
>  static void spapr_machine_2_6_instance_options(MachineState *machine)
> diff --git a/qom/cpu.c b/qom/cpu.c
> index 01cf136..e505810 100644
> --- a/qom/cpu.c
> +++ b/qom/cpu.c
> @@ -351,6 +351,7 @@ static void cpu_common_initfn(Object *obj)
>      object_property_add_bool(obj, "use-migration-id",
>                               cpu_common_get_use_migration_id,
>                               cpu_common_set_use_migration_id, NULL);
> +    object_property_set_bool(obj, true, "use-migration-id", NULL);
>  }
>  
>  static void cpu_common_finalize(Object *obj)
Bharata B Rao July 6, 2016, 2:24 p.m. UTC | #3
On Wed, Jul 06, 2016 at 01:45:54PM +0200, Igor Mammedov wrote:
> On Wed,  6 Jul 2016 14:29:21 +0530
> Bharata B Rao <bharata@linux.vnet.ibm.com> wrote:
> 
> > Turn on use-migration-id property. Starting from pseries-2.7, prefer
> > the use of migration_id (cpu_dt_id) over cpu_index for cpu vmstate
> > registration and in XICS code.
> > 
> > This allows migration to work when CPU cores are not necessarily
> > unplugged in LIFO order.
> > 
> > TODO: Property use-migration-id is by default turned on, check
> > if this needs to turned off for older machine type versions of
> > all archs.
> > 
> > Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> > ---
> >  hw/ppc/spapr.c | 5 +++++
> >  qom/cpu.c      | 1 +
> >  2 files changed, 6 insertions(+)
> > 
> > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> > index 7f33a1b..be9af10 100644
> > --- a/hw/ppc/spapr.c
> > +++ b/hw/ppc/spapr.c
> > @@ -2501,6 +2501,11 @@ DEFINE_SPAPR_MACHINE(2_7, "2.7", true);
> >          .driver   = TYPE_SPAPR_PCI_HOST_BRIDGE,\
> >          .property = "ddw",\
> >          .value    = stringify(off),\
> > +    }, \
> > +    { \
> > +        .driver   = TYPE_CPU,\
> > +        .property = "use-migration-id",\
> > +        .value    = stringify(off),\
> nit,
>  why not to use "off" directly, stringify looks odd here.

Was just following the previous property "ddw" did, will check if
stringify can be dropped.

Regards,
Bharata.
diff mbox

Patch

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 7f33a1b..be9af10 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2501,6 +2501,11 @@  DEFINE_SPAPR_MACHINE(2_7, "2.7", true);
         .driver   = TYPE_SPAPR_PCI_HOST_BRIDGE,\
         .property = "ddw",\
         .value    = stringify(off),\
+    }, \
+    { \
+        .driver   = TYPE_CPU,\
+        .property = "use-migration-id",\
+        .value    = stringify(off),\
     },
 
 static void spapr_machine_2_6_instance_options(MachineState *machine)
diff --git a/qom/cpu.c b/qom/cpu.c
index 01cf136..e505810 100644
--- a/qom/cpu.c
+++ b/qom/cpu.c
@@ -351,6 +351,7 @@  static void cpu_common_initfn(Object *obj)
     object_property_add_bool(obj, "use-migration-id",
                              cpu_common_get_use_migration_id,
                              cpu_common_set_use_migration_id, NULL);
+    object_property_set_bool(obj, true, "use-migration-id", NULL);
 }
 
 static void cpu_common_finalize(Object *obj)