Skip to contentSkip to conversation

ppc/spapr: fix default cpu for pre-10.0 machines.

PATCH Superseded Harsh Prateek Bora 3 participants 6 messages Mar 12, 2025 – Mar 13, 2025

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ppc/spapr: fix default cpu for pre-10.0 machines.

When POWER10 CPU was made as default, we missed keeping POWER9 as default for older pseries releases (pre-10.0) at that time. This caused breakge in default cpu evaluation for older pseries machines and hence this fix.

Fixes 51113013f3 ("ppc/spapr: change pseries machine default to POWER10 CPU")
---
 hw/ppc/spapr.c | 1 +
 1 file changed, 1 insertion(+)
hw/ppc/spapr.c +1 -0
index c15340a58d..b31a91e2e2 100644
@@ -4748,6 +4748,7 @@ static void spapr_machine_9_2_class_options(MachineClass *mc)
 {
     spapr_machine_10_0_class_options(mc);
     compat_props_add(mc->compat_props, hw_compat_9_2, hw_compat_9_2_len);
+    mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power9_v2.2");
 }
 
 DEFINE_SPAPR_MACHINE(9, 2);
Signature · 1 line
2.43.5
#1 lore raw
Quoted 5 lines · Harsh Prateek Bora

When POWER10 CPU was made as default, we missed keeping POWER9 as default for older pseries releases (pre-10.0) at that time. This caused breakge in default cpu evaluation for older pseries machines and hence this fix.

Should we also include:

?

Quoted 11 lines
Fixes 51113013f3 ("ppc/spapr: change pseries machine default to POWER10 CPU")
---
  hw/ppc/spapr.c | 1 +
  1 file changed, 1 insertion(+)
hw/ppc/spapr.c +0 -0
index c15340a58d..b31a91e2e2 100644

hw/ppc/spapr.c static void spapr_machine_9_2_class_options(MachineClass *mc) · line 4751

Quoted 4 lines
hw/ppc/spapr.c +1 -0
@@ -4748,6 +4748,7 @@ static void spapr_machine_9_2_class_options(MachineClass *mc)
  {
      spapr_machine_10_0_class_options(mc);
      compat_props_add(mc->compat_props, hw_compat_9_2, hw_compat_9_2_len);
+    mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power9_v2.2");

This is confusing because v9.2 has already been released with that...

Quoted 3 lines
hw/ppc/spapr.c +0 -0
  }
 
  DEFINE_SPAPR_MACHINE(9, 2);
#2 lore raw
Quoted 7 lines · Philippe Mathieu-Daudé
Quoted 5 lines · Harsh Prateek Bora

When POWER10 CPU was made as default, we missed keeping POWER9 as default for older pseries releases (pre-10.0) at that time. This caused breakge in default cpu evaluation for older pseries machines and hence this fix.

Quoted 6 lines

Should we also include:

?

I guess so. Not sure if we need a patch v2 for just that.

Quoted 6 lines
Quoted 6 lines
Fixes 51113013f3 ("ppc/spapr: change pseries machine default to POWER10 CPU")

---
  hw/ppc/spapr.c | 1 +

  1 file changed, 1 insertion(+)
Quoted 12 lines

hw/ppc/spapr.c static void · line 4752

Quoted 10 lines
hw/ppc/spapr.c +1 -0
index c15340a58d..b31a91e2e2 100644
@@ -4748,6 +4748,7 @@ static void 
 spapr_machine_9_2_class_options(MachineClass *mc)
   {
       spapr_machine_10_0_class_options(mc);
       compat_props_add(mc->compat_props, hw_compat_9_2, hw_compat_9_2_len);
+    mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power9_v2.2");

This is confusing because v9.2 has already been released with that...

I think it still needs to be fixed for v9.2 (and older) if someone wants to use pseries-9.2 (and older) with future releases.

Thanks
Harsh

Quoted 5 lines
Quoted 3 lines
hw/ppc/spapr.c +0 -0
   }
   DEFINE_SPAPR_MACHINE(9, 2);
#3 lore raw
Quoted 38 lines · Harsh Prateek Bora
Quoted 7 lines · Philippe Mathieu-Daudé
Quoted 5 lines · Harsh Prateek Bora

When POWER10 CPU was made as default, we missed keeping POWER9 as default for older pseries releases (pre-10.0) at that time. This caused breakge in default cpu evaluation for older pseries machines and hence this fix.

Quoted 6 lines

Should we also include:

?

I guess so. Not sure if we need a patch v2 for just that.

Quoted 6 lines
Quoted 6 lines
Fixes 51113013f3 ("ppc/spapr: change pseries machine default to POWER10 CPU")

---
  hw/ppc/spapr.c | 1 +

  1 file changed, 1 insertion(+)
Quoted 12 lines

hw/ppc/spapr.c static void · line 4752

Quoted 10 lines
hw/ppc/spapr.c +1 -0
index c15340a58d..b31a91e2e2 100644
@@ -4748,6 +4748,7 @@ static void 
 spapr_machine_9_2_class_options(MachineClass *mc)
   {
       spapr_machine_10_0_class_options(mc);
       compat_props_add(mc->compat_props, hw_compat_9_2, hw_compat_9_2_len);
+    mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power9_v2.2");

This is confusing because v9.2 has already been released with that...

Quoted 1 line

I think it still needs to be fixed for v9.2 (and older) if someone wants to use pseries-9.2 (and older) with future releases.

Gave it another thought. May be moving the default to v9.1 could be relatively better. 9.2 stable shall get the fix for pre-9.2 but 9.2 default need not change.

Nick, Daniel, comments?

Thanks
Harsh

Quoted 10 lines

Thanks
Harsh

Quoted 5 lines
Quoted 3 lines
hw/ppc/spapr.c +0 -0
   }
   DEFINE_SPAPR_MACHINE(9, 2);
#4 lore raw
In reply to Harsh Prateek Bora
Quoted 16 lines · Harsh Prateek Bora

When POWER10 CPU was made as default, we missed keeping POWER9 as default for older pseries releases (pre-10.0) at that time. This caused breakge in default cpu evaluation for older pseries machines and hence this fix.

Fixes 51113013f3 ("ppc/spapr: change pseries machine default to POWER10 CPU")
---
 hw/ppc/spapr.c | 1 +
 1 file changed, 1 insertion(+)
hw/ppc/spapr.c +0 -0
index c15340a58d..b31a91e2e2 100644

hw/ppc/spapr.c static void spapr_machine_9_2_class_options(MachineClass *mc) · line 4752

Quoted 5 lines
hw/ppc/spapr.c +1 -0
@@ -4748,6 +4748,7 @@ static void spapr_machine_9_2_class_options(MachineClass *mc)
 {
     spapr_machine_10_0_class_options(mc);
     compat_props_add(mc->compat_props, hw_compat_9_2, hw_compat_9_2_len);
+    mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power9_v2.2");
 }

This doesn't make sense.

AFAICT, the commit 51113013f3 was introduced in the QEMU 9.0.0 release, so it is correct that every machine from pseries-9.0 and newer had the POWER10 CPU model.

What broke were the machines that already existed prior to the 9.0.0 release, whose default CPU got changed. IOW, the pseries-8.2 and earlier machines.

With regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#5 lore raw
Quoted 25 lines · Daniel P. Berrangé
Quoted 16 lines · Harsh Prateek Bora

When POWER10 CPU was made as default, we missed keeping POWER9 as default for older pseries releases (pre-10.0) at that time. This caused breakge in default cpu evaluation for older pseries machines and hence this fix.

Fixes 51113013f3 ("ppc/spapr: change pseries machine default to POWER10 CPU")
---
  hw/ppc/spapr.c | 1 +
  1 file changed, 1 insertion(+)
hw/ppc/spapr.c +0 -0
index c15340a58d..b31a91e2e2 100644

hw/ppc/spapr.c static void spapr_machine_9_2_class_options(MachineClass *mc) · line 4752

Quoted 5 lines
hw/ppc/spapr.c +1 -0
@@ -4748,6 +4748,7 @@ static void spapr_machine_9_2_class_options(MachineClass *mc)
  {
      spapr_machine_10_0_class_options(mc);
      compat_props_add(mc->compat_props, hw_compat_9_2, hw_compat_9_2_len);
+    mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power9_v2.2");
  }

This doesn't make sense.

Quoted 7 lines

AFAICT, the commit 51113013f3 was introduced in the QEMU 9.0.0 release, so it is correct that every machine from pseries-9.0 and newer had the POWER10 CPU model.

What broke were the machines that already existed prior to the 9.0.0 release, whose default CPU got changed. IOW, the pseries-8.2 and earlier machines.

Thanks Daniel for catching this.
I should have checked using git tags. I have posted v2 here:

https://lore.kernel.org/qemu-devel/[email protected]/T/#u

regards,
Harsh

Quoted 4 lines

With regards,
Daniel