[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 19/20] xics: drop ICPStateClass::cpu_setup() handler
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 19/20] xics: drop ICPStateClass::cpu_setup() handler |
Date: |
Fri, 9 Jun 2017 15:26:51 +1000 |
From: Greg Kurz <address@hidden>
The cpu_setup() handler is only implemented by xics_kvm, where it really
does a typical "realize" job. Moreover, the realize() handler is called
shortly after cpu_setup(), on the same path.
This patch converts xics_kvm to implement realize() instead of cpu_setup().
Signed-off-by: Greg Kurz <address@hidden>
Reviewed-by: Cédric Le Goater <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/intc/xics.c | 4 ----
hw/intc/xics_kvm.c | 12 ++++++------
include/hw/ppc/xics.h | 1 -
3 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/hw/intc/xics.c b/hw/intc/xics.c
index fdbfddf..7ccfb53 100644
--- a/hw/intc/xics.c
+++ b/hw/intc/xics.c
@@ -324,10 +324,6 @@ static void icp_realize(DeviceState *dev, Error **errp)
cpu->intc = OBJECT(icp);
icp->cs = CPU(obj);
- if (icpc->cpu_setup) {
- icpc->cpu_setup(icp, cpu);
- }
-
env = &cpu->env;
switch (PPC_INPUT(env)) {
case PPC_FLAGS_INPUT_POWER7:
diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c
index 41c5b94..3091ad3 100644
--- a/hw/intc/xics_kvm.c
+++ b/hw/intc/xics_kvm.c
@@ -115,9 +115,9 @@ static void icp_kvm_reset(ICPState *icp)
icp_set_kvm_state(icp, 1);
}
-static void icp_kvm_cpu_setup(ICPState *icp, PowerPCCPU *cpu)
+static void icp_kvm_realize(ICPState *icp, Error **errp)
{
- CPUState *cs = CPU(cpu);
+ CPUState *cs = icp->cs;
KVMEnabledICP *enabled_icp;
unsigned long vcpu_id = kvm_arch_vcpu_id(cs);
int ret;
@@ -139,9 +139,9 @@ static void icp_kvm_cpu_setup(ICPState *icp, PowerPCCPU
*cpu)
ret = kvm_vcpu_enable_cap(cs, KVM_CAP_IRQ_XICS, 0, kernel_xics_fd,
vcpu_id);
if (ret < 0) {
- error_report("Unable to connect CPU%ld to kernel XICS: %s", vcpu_id,
- strerror(errno));
- exit(1);
+ error_setg(errp, "Unable to connect CPU%ld to kernel XICS: %s",
vcpu_id,
+ strerror(errno));
+ return;
}
enabled_icp = g_malloc(sizeof(*enabled_icp));
enabled_icp->vcpu_id = vcpu_id;
@@ -154,7 +154,7 @@ static void icp_kvm_class_init(ObjectClass *klass, void
*data)
icpc->pre_save = icp_get_kvm_state;
icpc->post_load = icp_set_kvm_state;
- icpc->cpu_setup = icp_kvm_cpu_setup;
+ icpc->realize = icp_kvm_realize;
icpc->reset = icp_kvm_reset;
}
diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h
index 37b8fb1..28d248a 100644
--- a/include/hw/ppc/xics.h
+++ b/include/hw/ppc/xics.h
@@ -68,7 +68,6 @@ struct ICPStateClass {
void (*realize)(ICPState *icp, Error **errp);
void (*pre_save)(ICPState *icp);
int (*post_load)(ICPState *icp, int version_id);
- void (*cpu_setup)(ICPState *icp, PowerPCCPU *cpu);
void (*reset)(ICPState *icp);
};
--
2.9.4
- [Qemu-ppc] [PULL 00/20] ppc-for-2.10 queue 20170609, David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 02/20] target/ppc: fix memory leak in kvmppc_is_mem_backend_page_size_ok(), David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 03/20] spapr: fix memory leak in spapr_memory_pre_plug(), David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 06/20] spapr: Don't misuse DR-indicator in spapr_recover_pending_dimm_state(), David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 10/20] spapr: Fold spapr_phb_{add, remove}_pci_device() into their only callers, David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 01/20] target/ppc: pass const string to kvmppc_is_mem_backend_page_size_ok(), David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 14/20] hw/ppc/spapr: Adjust firmware name for PCI bridges, David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 04/20] pseries: Correct panic behaviour for pseries machine type, David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 07/20] spapr: Clean up RTAS set-indicator, David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 19/20] xics: drop ICPStateClass::cpu_setup() handler,
David Gibson <=
- [Qemu-ppc] [PULL 11/20] spapr: Rework DRC name handling, David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 15/20] hw/cpu: core.c can be compiled as common object, David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 08/20] spapr: Clean up handling of DR-indicator, David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 09/20] spapr: Change DRC attach & detach methods to functions, David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 17/20] xics: pass appropriate types to realize() handlers., David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 12/20] pnv_core: drop reference on ICPState object during CPU realization, David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 13/20] xics: add reset() handler to ICPStateClass, David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 20/20] Revert "spapr: fix memory hot-unplugging", David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 18/20] xics: setup cpu at realize time, David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 05/20] spapr: Clean up DR entity sense handling, David Gibson, 2017/06/09