qemu-e2k/hw/ppc
Greg Kurz 776e887f08 spapr: Fix DR properties of the root node
Section 13.5.2 of LoPAPR mandates various DR related indentifiers
for all hot-pluggable entities to be exposed in the "ibm,drc-indexes",
"ibm,drc-power-domains", "ibm,drc-names" and "ibm,drc-types" properties
of their parent node. These properties are created with spapr_dt_drc().

PHBs and LMBs are both children of the machine. Their DR identifiers
are thus supposed to be exposed in the afore mentioned properties of
the root node.

When PHB hot-plug support was added, an extra call to spapr_dt_drc()
was introduced: this overwrites the existing properties, previously
populated with the LMB identifiers, and they end up containing only
PHB identifiers. This went unseen so far because linux doesn't care,
but this is still not conformant with LoPAPR.

Fortunately spapr_dt_drc() is able to handle multiple DR entity types
at the same time. Use that to handle DR indentifiers for PHBs and LMBs
with a single call to spapr_dt_drc(). While here also account for PMEM
DR identifiers, which were forgotten when NVDIMM hot-plug support was
added. Also add an assert to prevent further misuse of spapr_dt_drc().

With -m 1G,maxmem=2G,slots=8 passed on the QEMU command line we get:

Without this patch:

/proc/device-tree/ibm,drc-indexes
		 0000001f 20000001 20000002 20000003
		 20000000 20000005 20000006 20000007
		 20000004 20000009 20000008 20000010
		 20000011 20000012 20000013 20000014
		 20000015 20000016 20000017 20000018
		 20000019 2000000a 2000000b 2000000c
		 2000000d 2000000e 2000000f 2000001a
		 2000001b 2000001c 2000001d 2000001e

These are the DRC indexes for the 31 possible PHBs.

With this patch:

/proc/device-tree/ibm,drc-indexes
		 0000002b 90000000 90000001 90000002
		 90000003 90000004 90000005 90000006
		 90000007 20000001 20000002 20000003
		 20000000 20000005 20000006 20000007
		 20000004 20000009 20000008 20000010
		 20000011 20000012 20000013 20000014
		 20000015 20000016 20000017 20000018
		 20000019 2000000a 2000000b 2000000c
		 2000000d 2000000e 2000000f 2000001a
		 2000001b 2000001c 2000001d 2000001e
		 80000004 80000005 80000006 80000007

And now we also have the 4 ((2G - 1G) / 256M) LMBs and the
8 (slots) PMEMs.

Fixes: 3998ccd092 ("spapr: populate PHB DRC entries for root DT node")
Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <160794479566.35245.17809158217760761558.stgit@bahia.lan>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-01-06 11:09:59 +11:00
..
e500-ccsr.h
e500.c vl: make qemu_get_machine_opts static 2020-12-15 12:51:55 -05:00
e500.h
e500plat.c
fdt.c
fw_cfg.c
Kconfig ppc: Convert PPC UIC to a QOM device 2021-01-06 11:09:59 +11:00
mac_newworld.c vl: extract softmmu/datadir.c 2020-12-10 12:15:18 -05:00
mac_oldworld.c vl: extract softmmu/datadir.c 2020-12-10 12:15:18 -05:00
mac.h
meson.build
mpc8544_guts.c
mpc8544ds.c
pnv_bmc.c
pnv_core.c
pnv_homer.c
pnv_lpc.c
pnv_occ.c
pnv_pnor.c qdev: Move softmmu properties to qdev-properties-system.h 2020-12-18 15:20:17 -05:00
pnv_psi.c
pnv_xscom.c
pnv.c vl: extract softmmu/datadir.c 2020-12-10 12:15:18 -05:00
ppc4xx_devs.c ppc: Convert PPC UIC to a QOM device 2021-01-06 11:09:59 +11:00
ppc4xx_pci.c
ppc405_boards.c vl: extract softmmu/datadir.c 2020-12-10 12:15:18 -05:00
ppc405_uc.c
ppc405.h
ppc440_bamboo.c hw/ppc/ppc440_bamboo: Drop use of ppcuic_init() 2021-01-06 11:09:59 +11:00
ppc440_pcix.c
ppc440_uc.c
ppc440.h
ppc_booke.c
ppc.c hw/ppc: Do not re-read the clock on pre_save if doing savevm 2020-12-14 15:54:12 +11:00
ppce500_spin.c
prep_systemio.c
prep.c
rs6000_mc.c
sam460ex.c vl: extract softmmu/datadir.c 2020-12-10 12:15:18 -05:00
spapr_caps.c
spapr_cpu_core.c
spapr_drc.c spapr: Fix DR properties of the root node 2021-01-06 11:09:59 +11:00
spapr_events.c spapr: Pass sPAPR machine state to some RTAS events handling functions 2020-12-14 15:54:12 +11:00
spapr_hcall.c spapr: Pass sPAPR machine state down to spapr_pci_switch_vga() 2020-12-14 15:54:12 +11:00
spapr_iommu.c
spapr_irq.c spapr/xics: Drop unused argument to xics_kvm_has_broken_disconnect() 2020-12-14 15:50:55 +11:00
spapr_numa.c
spapr_nvdimm.c ppc/spapr: cleanup -machine pseries,nvdimm=X handling 2020-12-15 12:51:53 -05:00
spapr_ovec.c
spapr_pci_nvlink2.c
spapr_pci_vfio.c
spapr_pci.c spapr: Don't use qdev_get_machine() in spapr_msi_write() 2020-12-14 15:54:12 +11:00
spapr_rng.c
spapr_rtas_ddw.c
spapr_rtas.c
spapr_rtc.c
spapr_tpm_proxy.c
spapr_vio.c
spapr.c spapr: Fix DR properties of the root node 2021-01-06 11:09:59 +11:00
trace-events hw/ppc/spapr_tpm_proxy: Fix hexadecimal format string specifier 2020-12-14 15:54:12 +11:00
trace.h
virtex_ml507.c hw/ppc/virtex_ml507: Drop use of ppcuic_init() 2021-01-06 11:09:59 +11:00