[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [RFC PATCH v3 02/24] spapr: Add DRC dt entries for CPUs
From: |
Bharata B Rao |
Subject: |
[Qemu-ppc] [RFC PATCH v3 02/24] spapr: Add DRC dt entries for CPUs |
Date: |
Fri, 24 Apr 2015 12:17:24 +0530 |
Advertise CPU DR-capability to the guest via device tree.
Signed-off-by: Bharata B Rao <address@hidden>
Signed-off-by: Michael Roth <address@hidden>
[spapr_drc_reset implementation]
---
hw/ppc/spapr.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 981814d..9ea3a38 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -807,6 +807,15 @@ static void spapr_finalize_fdt(sPAPREnvironment *spapr,
spapr_populate_chosen_stdout(fdt, spapr->vio_bus);
}
+ if (spapr->dr_cpu_enabled) {
+ int offset = fdt_path_offset(fdt, "/cpus");
+ ret = spapr_drc_populate_dt(fdt, offset, NULL,
+ SPAPR_DR_CONNECTOR_TYPE_CPU);
+ if (ret < 0) {
+ fprintf(stderr, "Couldn't set up CPU DR device tree properties\n");
+ }
+ }
+
_FDT((fdt_pack(fdt)));
if (fdt_totalsize(fdt) > FDT_MAX_SIZE) {
@@ -1393,6 +1402,16 @@ static SaveVMHandlers savevm_htab_handlers = {
.load_state = htab_load,
};
+static void spapr_drc_reset(void *opaque)
+{
+ sPAPRDRConnector *drc = opaque;
+ DeviceState *d = DEVICE(drc);
+
+ if (d) {
+ device_reset(d);
+ }
+}
+
/* pSeries LPAR / sPAPR hardware init */
static void ppc_spapr_init(MachineState *machine)
{
@@ -1418,6 +1437,7 @@ static void ppc_spapr_init(MachineState *machine)
long load_limit, fw_size;
bool kernel_le = false;
char *filename;
+ int smt = kvmppc_smt_threads();
msi_supported = true;
@@ -1482,6 +1502,15 @@ static void ppc_spapr_init(MachineState *machine)
spapr->dr_cpu_enabled = smc->dr_cpu_enabled;
spapr->dr_lmb_enabled = smc->dr_lmb_enabled;
+ if (spapr->dr_cpu_enabled) {
+ for (i = 0; i < max_cpus/smp_threads; i++) {
+ sPAPRDRConnector *drc =
+ spapr_dr_connector_new(OBJECT(machine),
+ SPAPR_DR_CONNECTOR_TYPE_CPU, i * smt);
+ qemu_register_reset(spapr_drc_reset, drc);
+ }
+ }
+
/* init CPUs */
if (cpu_model == NULL) {
cpu_model = kvm_enabled() ? "host" : "POWER7";
--
2.1.0
- [Qemu-ppc] [RFC PATCH v3 00/24] CPU and Memory hotplug for PowerPC sPAPR guests, Bharata B Rao, 2015/04/24
- [Qemu-ppc] [RFC PATCH v3 01/24] spapr: enable PHB/CPU/LMB hotplug for pseries-2.3, Bharata B Rao, 2015/04/24
- [Qemu-ppc] [RFC PATCH v3 02/24] spapr: Add DRC dt entries for CPUs,
Bharata B Rao <=
- [Qemu-ppc] [RFC PATCH v3 03/24] spapr: Consider max_cpus during xics initialization, Bharata B Rao, 2015/04/24
- [Qemu-ppc] [RFC PATCH v3 04/24] spapr: Support ibm, lrdr-capacity device tree property, Bharata B Rao, 2015/04/24
- [Qemu-ppc] [RFC PATCH v3 05/24] spapr: Reorganize CPU dt generation code, Bharata B Rao, 2015/04/24
- [Qemu-ppc] [RFC PATCH v3 06/24] spapr: Consolidate cpu init code into a routine, Bharata B Rao, 2015/04/24
- [Qemu-ppc] [RFC PATCH v3 07/24] cpu: Prepare Socket container type, Bharata B Rao, 2015/04/24
- [Qemu-ppc] [RFC PATCH v3 08/24] ppc: Prepare CPU socket/core abstraction, Bharata B Rao, 2015/04/24
- [Qemu-ppc] [RFC PATCH v3 09/24] spapr: Add CPU hotplug handler, Bharata B Rao, 2015/04/24
- [Qemu-ppc] [RFC PATCH v3 10/24] ppc: Update cpu_model in MachineState, Bharata B Rao, 2015/04/24