[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 49/73] spapr: improve ibm, architecture-vec-5 property
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 49/73] spapr: improve ibm, architecture-vec-5 property handling |
Date: |
Fri, 28 Oct 2016 12:37:50 +1100 |
From: Michael Roth <address@hidden>
ibm,architecture-vec-5 is supposed to encode all option vector 5 bits
negotiated between platform/guest. Currently we hardcode this property
in the boot-time device tree to advertise a single negotiated
capability, "Form 1" NUMA Affinity, regardless of whether or not CAS
has been invoked or that capability has actually been negotiated.
Improve this by generating ibm,architecture-vec-5 based on the full
set of option vector 5 capabilities negotiated via CAS.
Signed-off-by: Michael Roth <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/spapr.c | 23 +++++++++++++++++------
include/hw/ppc/spapr_ovec.h | 1 +
2 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index aa6a070..0b3820b 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -659,14 +659,28 @@ static int spapr_dt_cas_updates(sPAPRMachineState *spapr,
void *fdt,
sPAPROptionVector *ov5_updates)
{
sPAPRMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
- int ret = 0;
+ int ret = 0, offset;
/* Generate ibm,dynamic-reconfiguration-memory node if required */
if (spapr_ovec_test(ov5_updates, OV5_DRCONF_MEMORY)) {
g_assert(smc->dr_lmb_enabled);
ret = spapr_populate_drconf_memory(spapr, fdt);
+ if (ret) {
+ goto out;
+ }
}
+ offset = fdt_path_offset(fdt, "/chosen");
+ if (offset < 0) {
+ offset = fdt_add_subnode(fdt, 0, "chosen");
+ if (offset < 0) {
+ return offset;
+ }
+ }
+ ret = spapr_ovec_populate_dt(fdt, offset, spapr->ov5_cas,
+ "ibm,architecture-vec-5");
+
+out:
return ret;
}
@@ -792,14 +806,9 @@ static void spapr_dt_chosen(sPAPRMachineState *spapr, void
*fdt)
char *stdout_path = spapr_vio_stdout_path(spapr->vio_bus);
size_t cb = 0;
char *bootlist = get_boot_devices_list(&cb, true);
- unsigned char vec5[] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x80};
_FDT(chosen = fdt_add_subnode(fdt, 0, "chosen"));
- /* Set Form1_affinity */
- _FDT(fdt_setprop(fdt, chosen, "ibm,architecture-vec-5",
- vec5, sizeof(vec5)));
-
_FDT(fdt_setprop_string(fdt, chosen, "bootargs", machine->kernel_cmdline));
_FDT(fdt_setprop_cell(fdt, chosen, "linux,initrd-start",
spapr->initrd_base));
@@ -1778,6 +1787,8 @@ static void ppc_spapr_init(MachineState *machine)
spapr_validate_node_memory(machine, &error_fatal);
}
+ spapr_ovec_set(spapr->ov5, OV5_FORM1_AFFINITY);
+
/* init CPUs */
if (machine->cpu_model == NULL) {
machine->cpu_model = kvm_enabled() ? "host" : smc->tcg_default_cpu;
diff --git a/include/hw/ppc/spapr_ovec.h b/include/hw/ppc/spapr_ovec.h
index a9a3f3a..81cdd14 100644
--- a/include/hw/ppc/spapr_ovec.h
+++ b/include/hw/ppc/spapr_ovec.h
@@ -44,6 +44,7 @@ typedef struct sPAPROptionVector sPAPROptionVector;
/* option vector 5 */
#define OV5_DRCONF_MEMORY OV_BIT(2, 2)
+#define OV5_FORM1_AFFINITY OV_BIT(5, 0)
/* interfaces */
sPAPROptionVector *spapr_ovec_new(void);
--
2.7.4
- [Qemu-ppc] [PULL 33/73] target-ppc: add vmul10[u, eu, cu, ecu]q instructions, (continued)
- [Qemu-ppc] [PULL 33/73] target-ppc: add vmul10[u, eu, cu, ecu]q instructions, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 65/73] target-ppc: add xscmp[eq, gt, ge, ne]dp instructions, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 55/73] tests: Adjust tco-test to use qpci_legacy_iomap(), David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 71/73] spapr: use count+index for memory hotplug, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 58/73] tests: Clean up IO handling in ide-test, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 64/73] tests: Add pseries machine to the prom-env-test, too, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 66/73] target-ppc: Add xvcmpnesp, xvcmpnedp instructions, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 52/73] libqos: Handle PCI IO de-multiplexing in common code, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 56/73] libqos: Add streaming accessors for PCI MMIO, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 69/73] spapr: add hotplug interrupt machine options, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 49/73] spapr: improve ibm, architecture-vec-5 property handling,
David Gibson <=
- [Qemu-ppc] [PULL 47/73] spapr_hcall: use spapr_ovec_* interfaces for CAS options, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 48/73] spapr: add option vector handling in CAS-generated resets, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 70/73] spapr: Add DRC count indexed hotplug identifier type, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 53/73] libqos: Move BAR assignment to common code, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 54/73] libqos: Better handling of PCI legacy IO, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 51/73] libqos: Give qvirtio_config_read*() consistent semantics, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 62/73] libqos: Change PCI accessors to take opaque BAR handle, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 59/73] libqos: Add 64-bit PCI IO accessors, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 61/73] tests: Don't assume structure of PCI IO base in ahci-test, David Gibson, 2016/10/27
- [Qemu-ppc] [PULL 67/73] spapr: update spapr hotplug documentation, David Gibson, 2016/10/27