diff mbox

[RFC,17/17] pseries: Default to POWER8 compatibility mode

Message ID 1477825928-10803-18-git-send-email-david@gibson.dropbear.id.au
State New
Headers show

Commit Message

David Gibson Oct. 30, 2016, 11:12 a.m. UTC
Currently, the pseries machine defaults to running in the "raw" mode of
whatever the CPU version is - that is, without any compatibility options
enabled in the CPU.

However, migration is only really safe in "raw" mode if source and
destination have exactly the same cpu model.  Since HV KVM exposes the
version of the host CPU to the guest, that means "raw" migration between
hosts with different minor revisions isn't strictly safe, although it
generally works in practice.

To allow this sort of migration in a more clearly defined way, instead
default to running in POWER8 compatibility mode - if an older CPU is used
that will automatically be downgraded to the higest available compatibility
mode.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/ppc/spapr.c | 1 +
 1 file changed, 1 insertion(+)

Comments

David Gibson Oct. 30, 2016, 11:58 a.m. UTC | #1
On Sun, Oct 30, 2016 at 10:12:08PM +1100, David Gibson wrote:
> Currently, the pseries machine defaults to running in the "raw" mode of
> whatever the CPU version is - that is, without any compatibility options
> enabled in the CPU.
> 
> However, migration is only really safe in "raw" mode if source and
> destination have exactly the same cpu model.  Since HV KVM exposes the
> version of the host CPU to the guest, that means "raw" migration between
> hosts with different minor revisions isn't strictly safe, although it
> generally works in practice.
> 
> To allow this sort of migration in a more clearly defined way, instead
> default to running in POWER8 compatibility mode - if an older CPU is used
> that will automatically be downgraded to the higest available compatibility
> mode.
> 
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

Ugh, sorry.  When I said minimally tested I did mean that it passed
make check, but unfortunately I was sloppy and this last patch breaks
a bunch of stuff.

> ---
>  hw/ppc/spapr.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 2aa0900..8c18dc8 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -2194,6 +2194,7 @@ static void spapr_machine_initfn(Object *obj)
>                                      " (required for memory hot-unplug support)",
>                                      NULL);
>  
> +    spapr->max_compat_pvr = CPU_POWERPC_LOGICAL_2_07; /* POWER8 */
>      object_property_add(obj, "max-cpu-compat", "str",
>                          ppc_compat_prop_get, ppc_compat_prop_set,
>                          NULL, &spapr->max_compat_pvr, &error_fatal);
diff mbox

Patch

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 2aa0900..8c18dc8 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2194,6 +2194,7 @@  static void spapr_machine_initfn(Object *obj)
                                     " (required for memory hot-unplug support)",
                                     NULL);
 
+    spapr->max_compat_pvr = CPU_POWERPC_LOGICAL_2_07; /* POWER8 */
     object_property_add(obj, "max-cpu-compat", "str",
                         ppc_compat_prop_get, ppc_compat_prop_set,
                         NULL, &spapr->max_compat_pvr, &error_fatal);