Skip to contentSkip to conversation

More pSeries machine tweaks

PATCH In review David Gibson 3 participants 11 messages Apr 19, 2011 – Apr 26, 2011

lore
Share & tools
lore
#0 lore raw

cover More pSeries machine tweaks

Hi Alex,

Here are several more minor tweaks/improvements to the pseries machine emulation.

#1 lore raw

PATCH 1/3 pseries: Increase maximum CPUs to 256

From: Anton Blanchard <[email protected]>

The original pSeries machine was limited to 32 CPUs, more or less arbitrarily. Particularly when we get SMT KVM guests it will be pretty easy to exceed this. Therefore, raise the max number of CPUs in a pseries machine guest to 256.

---
 hw/spapr.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/spapr.c +1 -1
index 1782cc0..67dd1e5 100644
@@ -51,7 +51,7 @@
 
 #define TIMEBASE_FREQ           512000000ULL
 
-#define MAX_CPUS                32
+#define MAX_CPUS                256
 #define XICS_IRQS		1024
 
 sPAPREnvironment *spapr;
Signature · 1 line
1.7.1
#2 lore raw

Re: [Qemu-devel] [PATCH 1/3] pseries: Increase maximum CPUs to 256

Quoted 6 lines · David Gibson

From: Anton Blanchard <[email protected]>

The original pSeries machine was limited to 32 CPUs, more or less arbitrarily. Particularly when we get SMT KVM guests it will be pretty easy to exceed this. Therefore, raise the max number of CPUs in a pseries machine guest to 256.

Are the 256 limited by technical limits or arbitrary as well? :)

Alex

#3 lore raw

Re: [Qemu-devel] [PATCH 1/3] pseries: Increase maximum CPUs to 256

Quoted 11 lines · Alexander Graf
Quoted 6 lines · David Gibson

From: Anton Blanchard <[email protected]>

The original pSeries machine was limited to 32 CPUs, more or less arbitrarily. Particularly when we get SMT KVM guests it will be pretty easy to exceed this. Therefore, raise the max number of CPUs in a pseries machine guest to 256.

Are the 256 limited by technical limits or arbitrary as well? :)

Still arbitrary, just bigger.

Signature · 4 lines
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
#4 lore raw

Re: [Qemu-devel] [PATCH 1/3] pseries: Increase maximum CPUs to 256

Quoted 11 lines · David Gibson
Quoted 9 lines · Alexander Graf
Quoted 6 lines · David Gibson

From: Anton Blanchard<[email protected]>

The original pSeries machine was limited to 32 CPUs, more or less arbitrarily. Particularly when we get SMT KVM guests it will be pretty easy to exceed this. Therefore, raise the max number of CPUs in a pseries machine guest to 256.

Are the 256 limited by technical limits or arbitrary as well? :)

Still arbitrary, just bigger.

Can't we set it to the real, technical limit then?

Alex

#5 lore raw

Re: [Qemu-devel] [PATCH 1/3] pseries: Increase maximum CPUs to 256

Quoted 6 lines · Alexander Graf
Quoted 5 lines · David Gibson
Quoted 4 lines · Alexander Graf
Quoted 2 lines · David Gibson

From: Anton Blanchard<[email protected]>

Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
Quoted 4 lines

The original pSeries machine was limited to 32 CPUs, more or less arbitrarily. Particularly when we get SMT KVM guests it will be pretty easy to exceed this. Therefore, raise the max number of CPUs in a pseries machine guest to 256.

Are the 256 limited by technical limits or arbitrary as well? :)

Still arbitrary, just bigger.

Can't we set it to the real, technical limit then?

There is no clear real, technical limit. It would depend on exactly what generation of pSeries we're talking about, and be in the thousands.

Signature · 4 lines
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
#6 lore raw

Re: [Qemu-devel] [PATCH 1/3] pseries: Increase maximum CPUs to 256

Quoted 11 lines · David Gibson
Quoted 10 lines · Alexander Graf
Quoted 9 lines · David Gibson
Quoted 8 lines · Alexander Graf
Quoted 6 lines · David Gibson

From: Anton Blanchard<[email protected]>

The original pSeries machine was limited to 32 CPUs, more or less arbitrarily. Particularly when we get SMT KVM guests it will be pretty easy to exceed this. Therefore, raise the max number of CPUs in a pseries machine guest to 256.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Quoted 1 line

Are the 256 limited by technical limits or arbitrary as well? :)

Still arbitrary, just bigger.

Can't we set it to the real, technical limit then?

There is no clear real, technical limit. It would depend on exactly what generation of pSeries we're talking about, and be in the thousands.

So I suppose we should set the max to the thousands then? Why limit it arbitrarily?

Alex

#7 lore raw

PATCH 2/3 Make pSeries 'model' property more closely resemble real hardware

In reply to David Gibson

Currently, the qemu emulated pseries machine puts "qemu,emulated-pSeries-LPAR" in the device tree's root level 'model' property. Unfortunately this confuses some installers and ybin, which expect this to start with "IBM" on pSeries machines. This patch addresses this problem, making the property more closely resemble the pattern of existing real hardware.

---
 hw/spapr.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/spapr.c +1 -1
index 67dd1e5..884c667 100644
@@ -93,7 +93,7 @@ static void *spapr_create_fdt_skel(const char *cpu_model,
     /* Root node */
     _FDT((fdt_begin_node(fdt, "")));
     _FDT((fdt_property_string(fdt, "device_type", "chrp")));
-    _FDT((fdt_property_string(fdt, "model", "qemu,emulated-pSeries-LPAR")));
+    _FDT((fdt_property_string(fdt, "model", "IBM pSeries (emulated by qemu)")));
 
     _FDT((fdt_property_cell(fdt, "#address-cells", 0x2)));
     _FDT((fdt_property_cell(fdt, "#size-cells", 0x2)));
Signature · 1 line
1.7.1
#8 lore raw

PATCH 3/3 Place pseries vty devices at addresses more similar to existing machines

In reply to David Gibson

Currently the qemu pseries machine numbers its virtual serial devices from 0. However, existing pSeries machines running pHyp number them from 0x30000000.

In theory these indices are arbitrary, since everything necessary for the kernel to find them is advertised in the device tree. However the debian installer, at least, incorrectly looks for a device named vty@30... to determine whether to use the hypervisor console.

Therefore this patch moves the numbers we use to match the existing pHyp practice, in order to workaround broken userspace apps of this type.

---
 hw/spapr.c      |    5 +++--
 hw/spapr_rtas.c |    3 ++-
 hw/spapr_vio.h  |    2 ++
 3 files changed, 7 insertions(+), 3 deletions(-)
hw/spapr.c +3 -2
index 884c667..109b774 100644
@@ -362,8 +362,9 @@ static void ppc_spapr_init(ram_addr_t ram_size,
 
     for (i = 0; i < MAX_SERIAL_PORTS; i++, irq++) {
         if (serial_hds[i]) {
-            spapr_vty_create(spapr->vio_bus, i, serial_hds[i],
-                             xics_find_qirq(spapr->icp, irq), irq);
+            spapr_vty_create(spapr->vio_bus, SPAPR_VTY_BASE_ADDRESS + i,
+                             serial_hds[i], xics_find_qirq(spapr->icp, irq),
+                             irq);
         }
     }
 
hw/spapr_rtas.c +2 -1
index 16b6542..00c8ce5 100644
@@ -44,7 +44,8 @@ static void rtas_display_character(sPAPREnvironment *spapr,
                                    uint32_t nret, target_ulong rets)
 {
     uint8_t c = rtas_ld(args, 0);
-    VIOsPAPRDevice *sdev = spapr_vio_find_by_reg(spapr->vio_bus, 0);
+    VIOsPAPRDevice *sdev = spapr_vio_find_by_reg(spapr->vio_bus,
+                                                 SPAPR_VTY_BASE_ADDRESS);
 
     if (!sdev) {
         rtas_st(rets, 0, -1);
hw/spapr_vio.h +2 -0
index 841b043..603a8c4 100644
@@ -32,6 +32,8 @@ enum VIOsPAPR_TCEAccess {
     SPAPR_TCE_RW = 3,
 };
 
+#define SPAPR_VTY_BASE_ADDRESS     0x30000000
+
 struct VIOsPAPRDevice;
 
 typedef struct VIOsPAPR_RTCE {
Signature · 1 line
1.7.1
#9 lore raw

[Qemu-devel] pSeries build breakage

In reply to David Gibson

Hello,

Building QEMU HEAD (347ac8e35661eff1c2b5ec74d11ee152f2a61856 target-i386: switch to softfloat) on OSX/ppc64 results in:

[...]
LINK arm-softmmu/qemu-system-arm
make: *** pc-bios/spapr-rtas: No such file or directory. Stop.
make: *** [romsubdir-spapr-rtas] Error 2

Could this be a VPATH issue? The source pc-bios dir does have such a directory but not the build dir.

Regards,
Andreas

#10 lore raw

Re: [Qemu-devel] pSeries build breakage

Quoted 5 lines · Andreas Färber

Hello,

Building QEMU HEAD (347ac8e35661eff1c2b5ec74d11ee152f2a61856 target-
i386: switch to softfloat) on OSX/ppc64 results in:

Quoted 7 lines

[...]
LINK arm-softmmu/qemu-system-arm
make: *** pc-bios/spapr-rtas: No such file or directory. Stop.
make: *** [romsubdir-spapr-rtas] Error 2

Could this be a VPATH issue? The source pc-bios dir does have such a directory but not the build dir.

I think it probably is. I hit something else when fiddling with some debian packaging, seemed to go away when I built in the source directory.

The makefile rules for this copied from the ones for optionrom/ and I don't really understand what's going wrong :/

Signature · 4 lines
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