All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC v3 0/2] target/ppc/cpu-models: set POWER9_v1.0 as POWER9 DD1
@ 2017-07-03 13:14 Laurent Vivier
  2017-07-03 13:14 ` [Qemu-devel] [RFC v3 1/2] " Laurent Vivier
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Laurent Vivier @ 2017-07-03 13:14 UTC (permalink / raw)
  To: David Gibson
  Cc: joserz, qemu-devel, Thomas Huth, qemu-ppc, Suraj Singh,
	Cédric Le Goater, Sam Bobroff, Greg Kurz, Laurent Vivier

This patch series allows to use "-cpu POWER9" with a POWER9
DD1 host and KVM HV. With TCG, "-cpu POWER9" selects
POWER9_v2.0 (POWER9 DD2).

v3:
  add the patch to move POWER9 DD1 workaround to
  the generic part (not only for "-cpu host").

v2:
  add POWER9_v2.0
  sent as RFC as "-cpu POWER9" breaks the kernel

Laurent Vivier (2):
  target/ppc/cpu-models: set POWER9_v1.0 as POWER9 DD1
  target/ppc: move POWER9 DD1 workaround to ppc_cpu_initfn

 hw/ppc/spapr_cpu_core.c     |  5 ++++-
 target/ppc/cpu-models.c     |  6 ++++--
 target/ppc/cpu-models.h     |  1 +
 target/ppc/kvm.c            | 11 -----------
 target/ppc/translate_init.c | 10 ++++++++++
 5 files changed, 19 insertions(+), 14 deletions(-)

-- 
2.9.4

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Qemu-devel] [RFC v3 1/2] target/ppc/cpu-models: set POWER9_v1.0 as POWER9 DD1
  2017-07-03 13:14 [Qemu-devel] [RFC v3 0/2] target/ppc/cpu-models: set POWER9_v1.0 as POWER9 DD1 Laurent Vivier
@ 2017-07-03 13:14 ` Laurent Vivier
  2017-07-04  7:42   ` [Qemu-devel] [Qemu-ppc] " Thomas Huth
  2017-07-03 13:14 ` [Qemu-devel] [RFC v3 2/2] target/ppc: move POWER9 DD1 workaround to ppc_cpu_initfn Laurent Vivier
  2017-07-04  9:22 ` [Qemu-devel] [RFC v3 0/2] target/ppc/cpu-models: set POWER9_v1.0 as POWER9 DD1 David Gibson
  2 siblings, 1 reply; 11+ messages in thread
From: Laurent Vivier @ 2017-07-03 13:14 UTC (permalink / raw)
  To: David Gibson
  Cc: joserz, qemu-devel, Thomas Huth, qemu-ppc, Suraj Singh,
	Cédric Le Goater, Sam Bobroff, Greg Kurz, Laurent Vivier

CPU_POWERPC_POWER9_DD1 is 0x004E0100, so this is the POWER9 v1.0.

When we run qemu on a POWER9 DD1 host, we must use either
"-cpu host" or "-cpu POWER9", but in the latter case it fails with

    Unable to find sPAPR CPU Core definition

because POWER9 DD1 doesn't appear in the list of known CPUs.

This patch fixes this by defining POWER9_v1.0 with POWER9 DD1
PVR instead of CPU_POWERPC_POWER9_BASE. It also adds POWER_v2.0
with POWER9 DD2 PVR to avoid to trigger kernel POWER9 DD1 workaround
in TCG mode.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
 hw/ppc/spapr_cpu_core.c | 5 ++++-
 target/ppc/cpu-models.c | 6 ++++--
 target/ppc/cpu-models.h | 1 +
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
index 9fb896b..00918a5 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -249,8 +249,11 @@ static const char *spapr_core_models[] = {
     /* POWER8NVL */
     "POWER8NVL_v1.0",
 
-    /* POWER9 */
+    /* POWER9 DD1 */
     "POWER9_v1.0",
+
+    /* POWER9 DD2 */
+    "POWER9_v2.0",
 };
 
 static Property spapr_cpu_core_properties[] = {
diff --git a/target/ppc/cpu-models.c b/target/ppc/cpu-models.c
index 4d3e635..ac7e299 100644
--- a/target/ppc/cpu-models.c
+++ b/target/ppc/cpu-models.c
@@ -1144,8 +1144,10 @@
     POWERPC_DEF("970_v2.2",      CPU_POWERPC_970_v22,                970,
                 "PowerPC 970 v2.2")
 
-    POWERPC_DEF("POWER9_v1.0",   CPU_POWERPC_POWER9_BASE,            POWER9,
+    POWERPC_DEF("POWER9_v1.0",   CPU_POWERPC_POWER9_DD1,             POWER9,
                 "POWER9 v1.0")
+    POWERPC_DEF("POWER9_v2.0",   CPU_POWERPC_POWER9_DD2,             POWER9,
+                "POWER9 v2.0")
 
     POWERPC_DEF("970fx_v1.0",    CPU_POWERPC_970FX_v10,              970,
                 "PowerPC 970FX v1.0 (G5)")
@@ -1391,7 +1393,7 @@ PowerPCCPUAlias ppc_cpu_aliases[] = {
     { "POWER8E", "POWER8E_v2.1" },
     { "POWER8", "POWER8_v2.0" },
     { "POWER8NVL", "POWER8NVL_v1.0" },
-    { "POWER9", "POWER9_v1.0" },
+    { "POWER9", "POWER9_v2.0" },
     { "970", "970_v2.2" },
     { "970fx", "970fx_v3.1" },
     { "970mp", "970mp_v1.1" },
diff --git a/target/ppc/cpu-models.h b/target/ppc/cpu-models.h
index b563c45..25045bd 100644
--- a/target/ppc/cpu-models.h
+++ b/target/ppc/cpu-models.h
@@ -562,6 +562,7 @@ enum {
     CPU_POWERPC_POWER8NVL_v10      = 0x004C0100,
     CPU_POWERPC_POWER9_BASE        = 0x004E0000,
     CPU_POWERPC_POWER9_DD1         = 0x004E0100,
+    CPU_POWERPC_POWER9_DD2         = 0x004E1200,
     CPU_POWERPC_970_v22            = 0x00390202,
     CPU_POWERPC_970FX_v10          = 0x00391100,
     CPU_POWERPC_970FX_v20          = 0x003C0200,
-- 
2.9.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [RFC v3 2/2] target/ppc: move POWER9 DD1 workaround to ppc_cpu_initfn
  2017-07-03 13:14 [Qemu-devel] [RFC v3 0/2] target/ppc/cpu-models: set POWER9_v1.0 as POWER9 DD1 Laurent Vivier
  2017-07-03 13:14 ` [Qemu-devel] [RFC v3 1/2] " Laurent Vivier
@ 2017-07-03 13:14 ` Laurent Vivier
  2017-07-04  8:17   ` Thomas Huth
  2017-07-04  9:22 ` [Qemu-devel] [RFC v3 0/2] target/ppc/cpu-models: set POWER9_v1.0 as POWER9 DD1 David Gibson
  2 siblings, 1 reply; 11+ messages in thread
From: Laurent Vivier @ 2017-07-03 13:14 UTC (permalink / raw)
  To: David Gibson
  Cc: joserz, qemu-devel, Thomas Huth, qemu-ppc, Suraj Singh,
	Cédric Le Goater, Sam Bobroff, Greg Kurz, Laurent Vivier

Commit 5f3066d ("target/ppc: Allow workarounds for POWER9 DD1")
disables compatibility mode for POWER9 DD1 to allow to
boot on POWER9 DD1 host with KVM.

As the workaround has been added in kvmppc_host_cpu_class_init(),
it applies only on CPU created with "-cpu host".
As we want to be able to use also "-cpu POWER9" on a POWER9 DD1
host, this patch moves the workaround from kvmppc_host_cpu_class_init()
to ppc_cpu_initfn().

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
 target/ppc/kvm.c            | 11 -----------
 target/ppc/translate_init.c | 10 ++++++++++
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
index f2f7c53..9d76817 100644
--- a/target/ppc/kvm.c
+++ b/target/ppc/kvm.c
@@ -2381,17 +2381,6 @@ static void kvmppc_host_cpu_class_init(ObjectClass *oc, void *data)
 
 #if defined(TARGET_PPC64)
     pcc->radix_page_info = kvm_get_radix_page_info();
-
-    if ((pcc->pvr & 0xffffff00) == CPU_POWERPC_POWER9_DD1) {
-        /*
-         * POWER9 DD1 has some bugs which make it not really ISA 3.00
-         * compliant.  More importantly, advertising ISA 3.00
-         * architected mode may prevent guests from activating
-         * necessary DD1 workarounds.
-         */
-        pcc->pcr_supported &= ~(PCR_COMPAT_3_00 | PCR_COMPAT_2_07
-                                | PCR_COMPAT_2_06 | PCR_COMPAT_2_05);
-    }
 #endif /* defined(TARGET_PPC64) */
 }
 
diff --git a/target/ppc/translate_init.c b/target/ppc/translate_init.c
index 56a0ab2..ceb5bdb 100644
--- a/target/ppc/translate_init.c
+++ b/target/ppc/translate_init.c
@@ -10617,6 +10617,16 @@ static void ppc_cpu_initfn(Object *obj)
         };
         env->sps = (env->mmu_model & POWERPC_MMU_64K) ? defsps_64k : defsps_4k;
     }
+    if ((pcc->pvr & 0xffffff00) == CPU_POWERPC_POWER9_DD1) {
+        /*
+         * POWER9 DD1 has some bugs which make it not really ISA 3.00
+         * compliant.  More importantly, advertising ISA 3.00
+         * architected mode may prevent guests from activating
+         * necessary DD1 workarounds.
+         */
+        pcc->pcr_supported &= ~(PCR_COMPAT_3_00 | PCR_COMPAT_2_07
+                                | PCR_COMPAT_2_06 | PCR_COMPAT_2_05);
+    }
 #endif /* defined(TARGET_PPC64) */
 
     if (tcg_enabled()) {
-- 
2.9.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [Qemu-ppc] [RFC v3 1/2] target/ppc/cpu-models: set POWER9_v1.0 as POWER9 DD1
  2017-07-03 13:14 ` [Qemu-devel] [RFC v3 1/2] " Laurent Vivier
@ 2017-07-04  7:42   ` Thomas Huth
  2017-07-04  8:51     ` Greg Kurz
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Huth @ 2017-07-04  7:42 UTC (permalink / raw)
  To: Laurent Vivier, David Gibson
  Cc: Suraj Singh, joserz, qemu-devel, Greg Kurz, qemu-ppc,
	Cédric Le Goater, Sam Bobroff

On 03.07.2017 15:14, Laurent Vivier wrote:
> CPU_POWERPC_POWER9_DD1 is 0x004E0100, so this is the POWER9 v1.0.
> 
> When we run qemu on a POWER9 DD1 host, we must use either
> "-cpu host" or "-cpu POWER9", but in the latter case it fails with
> 
>     Unable to find sPAPR CPU Core definition
> 
> because POWER9 DD1 doesn't appear in the list of known CPUs.
> 
> This patch fixes this by defining POWER9_v1.0 with POWER9 DD1
> PVR instead of CPU_POWERPC_POWER9_BASE. It also adds POWER_v2.0
> with POWER9 DD2 PVR to avoid to trigger kernel POWER9 DD1 workaround
> in TCG mode.
> 
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
>  hw/ppc/spapr_cpu_core.c | 5 ++++-
>  target/ppc/cpu-models.c | 6 ++++--
>  target/ppc/cpu-models.h | 1 +
>  3 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
> index 9fb896b..00918a5 100644
> --- a/hw/ppc/spapr_cpu_core.c
> +++ b/hw/ppc/spapr_cpu_core.c
> @@ -249,8 +249,11 @@ static const char *spapr_core_models[] = {
>      /* POWER8NVL */
>      "POWER8NVL_v1.0",
>  
> -    /* POWER9 */
> +    /* POWER9 DD1 */
>      "POWER9_v1.0",
> +
> +    /* POWER9 DD2 */
> +    "POWER9_v2.0",

In case you re-spin, what about a more compact listing:

    /* POWER9 */
    "POWER9_v1.0",
    "POWER9_v2.0",

?

Anyway, patch looks good to me, so:

Reviewed-by: Thomas Huth <thuth@redhat.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [RFC v3 2/2] target/ppc: move POWER9 DD1 workaround to ppc_cpu_initfn
  2017-07-03 13:14 ` [Qemu-devel] [RFC v3 2/2] target/ppc: move POWER9 DD1 workaround to ppc_cpu_initfn Laurent Vivier
@ 2017-07-04  8:17   ` Thomas Huth
  2017-07-04  9:27     ` David Gibson
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Huth @ 2017-07-04  8:17 UTC (permalink / raw)
  To: Laurent Vivier, David Gibson
  Cc: joserz, qemu-devel, qemu-ppc, Suraj Singh, Cédric Le Goater,
	Sam Bobroff, Greg Kurz

On 03.07.2017 15:14, Laurent Vivier wrote:
> Commit 5f3066d ("target/ppc: Allow workarounds for POWER9 DD1")
> disables compatibility mode for POWER9 DD1 to allow to
> boot on POWER9 DD1 host with KVM.
> 
> As the workaround has been added in kvmppc_host_cpu_class_init(),
> it applies only on CPU created with "-cpu host".
> As we want to be able to use also "-cpu POWER9" on a POWER9 DD1
> host, this patch moves the workaround from kvmppc_host_cpu_class_init()
> to ppc_cpu_initfn().

Would it be feasible to move it to init_proc_POWER9() instead? I think
that would be a better location for the POWER9 workaround ... not sure
whether it can be done there, though.

 Thomas

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [Qemu-ppc] [RFC v3 1/2] target/ppc/cpu-models: set POWER9_v1.0 as POWER9 DD1
  2017-07-04  7:42   ` [Qemu-devel] [Qemu-ppc] " Thomas Huth
@ 2017-07-04  8:51     ` Greg Kurz
  2017-07-04  8:56       ` Laurent Vivier
  0 siblings, 1 reply; 11+ messages in thread
From: Greg Kurz @ 2017-07-04  8:51 UTC (permalink / raw)
  To: Thomas Huth
  Cc: Laurent Vivier, David Gibson, Suraj Singh, joserz, qemu-devel,
	qemu-ppc, Cédric Le Goater, Sam Bobroff

[-- Attachment #1: Type: text/plain, Size: 1694 bytes --]

On Tue, 4 Jul 2017 09:42:33 +0200
Thomas Huth <thuth@redhat.com> wrote:

> On 03.07.2017 15:14, Laurent Vivier wrote:
> > CPU_POWERPC_POWER9_DD1 is 0x004E0100, so this is the POWER9 v1.0.
> > 
> > When we run qemu on a POWER9 DD1 host, we must use either
> > "-cpu host" or "-cpu POWER9", but in the latter case it fails with
> > 
> >     Unable to find sPAPR CPU Core definition
> > 
> > because POWER9 DD1 doesn't appear in the list of known CPUs.
> > 
> > This patch fixes this by defining POWER9_v1.0 with POWER9 DD1
> > PVR instead of CPU_POWERPC_POWER9_BASE. It also adds POWER_v2.0
> > with POWER9 DD2 PVR to avoid to trigger kernel POWER9 DD1 workaround
> > in TCG mode.
> > 
> > Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> > ---
> >  hw/ppc/spapr_cpu_core.c | 5 ++++-
> >  target/ppc/cpu-models.c | 6 ++++--
> >  target/ppc/cpu-models.h | 1 +
> >  3 files changed, 9 insertions(+), 3 deletions(-)
> > 
> > diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
> > index 9fb896b..00918a5 100644
> > --- a/hw/ppc/spapr_cpu_core.c
> > +++ b/hw/ppc/spapr_cpu_core.c
> > @@ -249,8 +249,11 @@ static const char *spapr_core_models[] = {
> >      /* POWER8NVL */
> >      "POWER8NVL_v1.0",
> >  
> > -    /* POWER9 */
> > +    /* POWER9 DD1 */
> >      "POWER9_v1.0",
> > +
> > +    /* POWER9 DD2 */
> > +    "POWER9_v2.0",  
> 
> In case you re-spin, what about a more compact listing:
> 
>     /* POWER9 */
>     "POWER9_v1.0",
>     "POWER9_v2.0",
> 
> ?
> 

I second that but anyway:

Reviewed-by: Greg Kurz <groug@kaod.org>

> Anyway, patch looks good to me, so:
> 
> Reviewed-by: Thomas Huth <thuth@redhat.com>


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [Qemu-ppc] [RFC v3 1/2] target/ppc/cpu-models: set POWER9_v1.0 as POWER9 DD1
  2017-07-04  8:51     ` Greg Kurz
@ 2017-07-04  8:56       ` Laurent Vivier
  2017-07-04  9:25         ` David Gibson
  0 siblings, 1 reply; 11+ messages in thread
From: Laurent Vivier @ 2017-07-04  8:56 UTC (permalink / raw)
  To: Greg Kurz, Thomas Huth
  Cc: David Gibson, Suraj Singh, joserz, qemu-devel, qemu-ppc,
	Cédric Le Goater, Sam Bobroff

On 04/07/2017 10:51, Greg Kurz wrote:
> On Tue, 4 Jul 2017 09:42:33 +0200
> Thomas Huth <thuth@redhat.com> wrote:
> 
>> On 03.07.2017 15:14, Laurent Vivier wrote:
>>> CPU_POWERPC_POWER9_DD1 is 0x004E0100, so this is the POWER9 v1.0.
>>>
>>> When we run qemu on a POWER9 DD1 host, we must use either
>>> "-cpu host" or "-cpu POWER9", but in the latter case it fails with
>>>
>>>     Unable to find sPAPR CPU Core definition
>>>
>>> because POWER9 DD1 doesn't appear in the list of known CPUs.
>>>
>>> This patch fixes this by defining POWER9_v1.0 with POWER9 DD1
>>> PVR instead of CPU_POWERPC_POWER9_BASE. It also adds POWER_v2.0
>>> with POWER9 DD2 PVR to avoid to trigger kernel POWER9 DD1 workaround
>>> in TCG mode.
>>>
>>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
>>> ---
>>>  hw/ppc/spapr_cpu_core.c | 5 ++++-
>>>  target/ppc/cpu-models.c | 6 ++++--
>>>  target/ppc/cpu-models.h | 1 +
>>>  3 files changed, 9 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
>>> index 9fb896b..00918a5 100644
>>> --- a/hw/ppc/spapr_cpu_core.c
>>> +++ b/hw/ppc/spapr_cpu_core.c
>>> @@ -249,8 +249,11 @@ static const char *spapr_core_models[] = {
>>>      /* POWER8NVL */
>>>      "POWER8NVL_v1.0",
>>>  
>>> -    /* POWER9 */
>>> +    /* POWER9 DD1 */
>>>      "POWER9_v1.0",
>>> +
>>> +    /* POWER9 DD2 */
>>> +    "POWER9_v2.0",  
>>
>> In case you re-spin, what about a more compact listing:
>>
>>     /* POWER9 */
>>     "POWER9_v1.0",
>>     "POWER9_v2.0",
>>
>> ?
>>
> 
> I second that but anyway:
> 
> Reviewed-by: Greg Kurz <groug@kaod.org>
> 
>> Anyway, patch looks good to me, so:
>>
>> Reviewed-by: Thomas Huth <thuth@redhat.com>
> 

I agree, but as I was focused on the problem with "-cpu POWER9" I forgot
to update the first patch.

Thanks,
Laurent

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [RFC v3 0/2] target/ppc/cpu-models: set POWER9_v1.0 as POWER9 DD1
  2017-07-03 13:14 [Qemu-devel] [RFC v3 0/2] target/ppc/cpu-models: set POWER9_v1.0 as POWER9 DD1 Laurent Vivier
  2017-07-03 13:14 ` [Qemu-devel] [RFC v3 1/2] " Laurent Vivier
  2017-07-03 13:14 ` [Qemu-devel] [RFC v3 2/2] target/ppc: move POWER9 DD1 workaround to ppc_cpu_initfn Laurent Vivier
@ 2017-07-04  9:22 ` David Gibson
  2 siblings, 0 replies; 11+ messages in thread
From: David Gibson @ 2017-07-04  9:22 UTC (permalink / raw)
  To: Laurent Vivier
  Cc: joserz, qemu-devel, Thomas Huth, qemu-ppc, Suraj Singh,
	Cédric Le Goater, Sam Bobroff, Greg Kurz

[-- Attachment #1: Type: text/plain, Size: 1170 bytes --]

On Mon, Jul 03, 2017 at 03:14:53PM +0200, Laurent Vivier wrote:
> This patch series allows to use "-cpu POWER9" with a POWER9
> DD1 host and KVM HV. With TCG, "-cpu POWER9" selects
> POWER9_v2.0 (POWER9 DD2).

Since these fix a real bug, I've applied them to ppc-for-2.10.  There
are some revisions which might be good as a follow up.

> 
> v3:
>   add the patch to move POWER9 DD1 workaround to
>   the generic part (not only for "-cpu host").
> 
> v2:
>   add POWER9_v2.0
>   sent as RFC as "-cpu POWER9" breaks the kernel
> 
> Laurent Vivier (2):
>   target/ppc/cpu-models: set POWER9_v1.0 as POWER9 DD1
>   target/ppc: move POWER9 DD1 workaround to ppc_cpu_initfn
> 
>  hw/ppc/spapr_cpu_core.c     |  5 ++++-
>  target/ppc/cpu-models.c     |  6 ++++--
>  target/ppc/cpu-models.h     |  1 +
>  target/ppc/kvm.c            | 11 -----------
>  target/ppc/translate_init.c | 10 ++++++++++
>  5 files changed, 19 insertions(+), 14 deletions(-)
> 

-- 
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] 11+ messages in thread

* Re: [Qemu-devel] [Qemu-ppc] [RFC v3 1/2] target/ppc/cpu-models: set POWER9_v1.0 as POWER9 DD1
  2017-07-04  8:56       ` Laurent Vivier
@ 2017-07-04  9:25         ` David Gibson
  0 siblings, 0 replies; 11+ messages in thread
From: David Gibson @ 2017-07-04  9:25 UTC (permalink / raw)
  To: Laurent Vivier
  Cc: Greg Kurz, Thomas Huth, Suraj Singh, joserz, qemu-devel,
	qemu-ppc, Cédric Le Goater, Sam Bobroff

[-- Attachment #1: Type: text/plain, Size: 2506 bytes --]

On Tue, Jul 04, 2017 at 10:56:56AM +0200, Laurent Vivier wrote:
> On 04/07/2017 10:51, Greg Kurz wrote:
> > On Tue, 4 Jul 2017 09:42:33 +0200
> > Thomas Huth <thuth@redhat.com> wrote:
> > 
> >> On 03.07.2017 15:14, Laurent Vivier wrote:
> >>> CPU_POWERPC_POWER9_DD1 is 0x004E0100, so this is the POWER9 v1.0.
> >>>
> >>> When we run qemu on a POWER9 DD1 host, we must use either
> >>> "-cpu host" or "-cpu POWER9", but in the latter case it fails with
> >>>
> >>>     Unable to find sPAPR CPU Core definition
> >>>
> >>> because POWER9 DD1 doesn't appear in the list of known CPUs.
> >>>
> >>> This patch fixes this by defining POWER9_v1.0 with POWER9 DD1
> >>> PVR instead of CPU_POWERPC_POWER9_BASE. It also adds POWER_v2.0
> >>> with POWER9 DD2 PVR to avoid to trigger kernel POWER9 DD1 workaround
> >>> in TCG mode.
> >>>
> >>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> >>> ---
> >>>  hw/ppc/spapr_cpu_core.c | 5 ++++-
> >>>  target/ppc/cpu-models.c | 6 ++++--
> >>>  target/ppc/cpu-models.h | 1 +
> >>>  3 files changed, 9 insertions(+), 3 deletions(-)
> >>>
> >>> diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
> >>> index 9fb896b..00918a5 100644
> >>> --- a/hw/ppc/spapr_cpu_core.c
> >>> +++ b/hw/ppc/spapr_cpu_core.c
> >>> @@ -249,8 +249,11 @@ static const char *spapr_core_models[] = {
> >>>      /* POWER8NVL */
> >>>      "POWER8NVL_v1.0",
> >>>  
> >>> -    /* POWER9 */
> >>> +    /* POWER9 DD1 */
> >>>      "POWER9_v1.0",
> >>> +
> >>> +    /* POWER9 DD2 */
> >>> +    "POWER9_v2.0",  
> >>
> >> In case you re-spin, what about a more compact listing:
> >>
> >>     /* POWER9 */
> >>     "POWER9_v1.0",
> >>     "POWER9_v2.0",
> >>
> >> ?
> >>
> > 
> > I second that but anyway:
> > 
> > Reviewed-by: Greg Kurz <groug@kaod.org>
> > 
> >> Anyway, patch looks good to me, so:
> >>
> >> Reviewed-by: Thomas Huth <thuth@redhat.com>
> > 
> 
> I agree, but as I was focused on the problem with "-cpu POWER9" I forgot
> to update the first patch.

Ok, we can do that as a follow up.

I think it would also be good to add a comment saying which of the DD2
variants that PVR is for.  Optionally, we could add PVRs for the other
variants.  I don't think it matters which variant we point the POWER9
alias at.

-- 
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] 11+ messages in thread

* Re: [Qemu-devel] [RFC v3 2/2] target/ppc: move POWER9 DD1 workaround to ppc_cpu_initfn
  2017-07-04  8:17   ` Thomas Huth
@ 2017-07-04  9:27     ` David Gibson
  2017-07-04 11:13       ` [Qemu-devel] [Qemu-ppc] " Thomas Huth
  0 siblings, 1 reply; 11+ messages in thread
From: David Gibson @ 2017-07-04  9:27 UTC (permalink / raw)
  To: Thomas Huth
  Cc: Laurent Vivier, joserz, qemu-devel, qemu-ppc, Suraj Singh,
	Cédric Le Goater, Sam Bobroff, Greg Kurz

[-- Attachment #1: Type: text/plain, Size: 1119 bytes --]

On Tue, Jul 04, 2017 at 10:17:18AM +0200, Thomas Huth wrote:
> On 03.07.2017 15:14, Laurent Vivier wrote:
> > Commit 5f3066d ("target/ppc: Allow workarounds for POWER9 DD1")
> > disables compatibility mode for POWER9 DD1 to allow to
> > boot on POWER9 DD1 host with KVM.
> > 
> > As the workaround has been added in kvmppc_host_cpu_class_init(),
> > it applies only on CPU created with "-cpu host".
> > As we want to be able to use also "-cpu POWER9" on a POWER9 DD1
> > host, this patch moves the workaround from kvmppc_host_cpu_class_init()
> > to ppc_cpu_initfn().
> 
> Would it be feasible to move it to init_proc_POWER9() instead? I think
> that would be a better location for the POWER9 workaround ... not sure
> whether it can be done there, though.

That would be neater if it works.  I've applied the patch as is for
now, but if that does work, a follow up to move the workaround would
be nice.

-- 
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] 11+ messages in thread

* Re: [Qemu-devel] [Qemu-ppc] [RFC v3 2/2] target/ppc: move POWER9 DD1 workaround to ppc_cpu_initfn
  2017-07-04  9:27     ` David Gibson
@ 2017-07-04 11:13       ` Thomas Huth
  0 siblings, 0 replies; 11+ messages in thread
From: Thomas Huth @ 2017-07-04 11:13 UTC (permalink / raw)
  To: David Gibson
  Cc: Laurent Vivier, Suraj Singh, joserz, qemu-devel, Greg Kurz,
	qemu-ppc, Cédric Le Goater, Sam Bobroff

[-- Attachment #1: Type: text/plain, Size: 1065 bytes --]

On 04.07.2017 11:27, David Gibson wrote:
> On Tue, Jul 04, 2017 at 10:17:18AM +0200, Thomas Huth wrote:
>> On 03.07.2017 15:14, Laurent Vivier wrote:
>>> Commit 5f3066d ("target/ppc: Allow workarounds for POWER9 DD1")
>>> disables compatibility mode for POWER9 DD1 to allow to
>>> boot on POWER9 DD1 host with KVM.
>>>
>>> As the workaround has been added in kvmppc_host_cpu_class_init(),
>>> it applies only on CPU created with "-cpu host".
>>> As we want to be able to use also "-cpu POWER9" on a POWER9 DD1
>>> host, this patch moves the workaround from kvmppc_host_cpu_class_init()
>>> to ppc_cpu_initfn().
>>
>> Would it be feasible to move it to init_proc_POWER9() instead? I think
>> that would be a better location for the POWER9 workaround ... not sure
>> whether it can be done there, though.
> 
> That would be neater if it works.  I've applied the patch as is for
> now, but if that does work, a follow up to move the workaround would
> be nice.

Seems like it works ... Could you use the patches from v4 instead?

 Thomas




[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-07-04 11:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-03 13:14 [Qemu-devel] [RFC v3 0/2] target/ppc/cpu-models: set POWER9_v1.0 as POWER9 DD1 Laurent Vivier
2017-07-03 13:14 ` [Qemu-devel] [RFC v3 1/2] " Laurent Vivier
2017-07-04  7:42   ` [Qemu-devel] [Qemu-ppc] " Thomas Huth
2017-07-04  8:51     ` Greg Kurz
2017-07-04  8:56       ` Laurent Vivier
2017-07-04  9:25         ` David Gibson
2017-07-03 13:14 ` [Qemu-devel] [RFC v3 2/2] target/ppc: move POWER9 DD1 workaround to ppc_cpu_initfn Laurent Vivier
2017-07-04  8:17   ` Thomas Huth
2017-07-04  9:27     ` David Gibson
2017-07-04 11:13       ` [Qemu-devel] [Qemu-ppc] " Thomas Huth
2017-07-04  9:22 ` [Qemu-devel] [RFC v3 0/2] target/ppc/cpu-models: set POWER9_v1.0 as POWER9 DD1 David Gibson

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.