[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 09/73] spapr_pci: advertise explicit numa IDs even when
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 09/73] spapr_pci: advertise explicit numa IDs even when there's 1 node |
Date: |
Fri, 28 Oct 2016 12:37:10 +1100 |
From: Michael Roth <address@hidden>
With the addition of "numa_node" properties for PHBs we began
advertising NUMA affinity in cases where nb_numa_nodes > 1.
Since the default on the guest side is to make no assumptions about
PHB NUMA affinity (defaulting to -1), there is still a valid use-case
for explicitly defining a PHB's NUMA affinity even when there's just
one node. In particular, some workloads make faulty assumptions about
/sys/bus/pci/<devid>/numa_node being >= 0, warranting the use of
this property as a workaround even if there's just 1 PHB or NUMA
node.
Enable this use-case by always advertising the PHB's NUMA affinity
if "numa_node" has been explicitly set.
We could achieve this by relaxing the check to simply be
nb_numa_nodes > 0, but even safer would be to check
numa_info[nodeid].present explicitly, and to fail at start time
for cases where it does not exist.
This has an additional affect of no longer advertising PHB NUMA
affinity unconditionally if nb_numa_nodes > 1 and "numa_node"
property is unset/-1, but since the default value on the guest
side for each PHB is also -1, the behavior should be the same for
that situation. We could still retain the old behavior if desired,
but the decision seems arbitrary, so we take the simpler route.
Cc: Alexey Kardashevskiy <address@hidden>
Cc: Shivaprasad G. Bhat <address@hidden>
Signed-off-by: Michael Roth <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/spapr_pci.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index 2a1ccf5..7cde30e 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -1392,6 +1392,12 @@ static void spapr_phb_realize(DeviceState *dev, Error
**errp)
return;
}
+ if (sphb->numa_node != -1 &&
+ (sphb->numa_node >= MAX_NODES || !numa_info[sphb->numa_node].present))
{
+ error_setg(errp, "Invalid NUMA node ID for PCI host bridge");
+ return;
+ }
+
sphb->dtbusname = g_strdup_printf("address@hidden" PRIx64, sphb->buid);
namebuf = alloca(strlen(sphb->dtbusname) + 32);
@@ -1880,7 +1886,7 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb,
}
/* Advertise NUMA via ibm,associativity */
- if (nb_numa_nodes > 1) {
+ if (phb->numa_node != -1) {
_FDT(fdt_setprop(fdt, bus_off, "ibm,associativity", associativity,
sizeof(associativity)));
}
--
2.7.4
- [Qemu-ppc] [PULL 00/73] ppc-for-2.8 queue 20161028, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 05/73] tests: move QVirtioBus pointer into QVirtioDevice, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 03/73] tests: fix memory leak in virtio-scsi-test, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 14/73] target-ppc: implement vnegw/d instructions, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 04/73] tests: don't check if qtest_spapr_boot() returns NULL, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 16/73] ppc/xics: add a xics_set_nr_servers common routine, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 02/73] ppc/xics: Add xics to the monitor "info pic" command, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 11/73] sparc: Use the new common NVRAM functions for system and free space partition, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 19/73] ppc: fix MSR_ME handling for system reset interrupt, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 09/73] spapr_pci: advertise explicit numa IDs even when there's 1 node,
David Gibson <=
- [Qemu-ppc] [PULL 08/73] tests: enable virtio tests on SPAPR, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 24/73] ppc/pnv: add skeleton PowerNV platform, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 26/73] ppc/pnv: add a core mask to PnvChip, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 10/73] nvram: Introduce helper functions for CHRP "system" and "free space" partitions, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 06/73] tests: rename target_big_endian() as qvirtio_is_big_endian(), David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 15/73] target-ppc: implement xxbr[qdwh] instruction, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 13/73] nvram: Rename openbios_firmware_abi.h into sun_nvram.h, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 12/73] nvram: Move the remaining CHRP NVRAM related code to chrp_nvram.[ch], David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 20/73] pseries: Remove unused callbacks from sPAPR VIO bus state, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 27/73] ppc/pnv: add a PIR handler to PnvChip, David Gibson, 2016/10/27