[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH v5 28/36] ppc/xics: introduce a icp_kvm_init() routine
From: |
Cédric Le Goater |
Subject: |
[Qemu-ppc] [PATCH v5 28/36] ppc/xics: introduce a icp_kvm_init() routine |
Date: |
Fri, 16 Nov 2018 11:57:21 +0100 |
This routine gathers all the KVM initialization of the XICS KVM
presenter. It will be useful when the initialization of the KVM XICS
device is moved to a global routine.
Signed-off-by: Cédric Le Goater <address@hidden>
---
hw/intc/xics_kvm.c | 29 +++++++++++++++++++----------
1 file changed, 19 insertions(+), 10 deletions(-)
diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c
index e8fa9a53aeba..efad1b19d821 100644
--- a/hw/intc/xics_kvm.c
+++ b/hw/intc/xics_kvm.c
@@ -123,11 +123,8 @@ static void icp_kvm_reset(DeviceState *dev)
icp_set_kvm_state(ICP(dev), 1);
}
-static void icp_kvm_realize(DeviceState *dev, Error **errp)
+static void icp_kvm_init(ICPState *icp, Error **errp)
{
- ICPState *icp = ICP(dev);
- ICPStateClass *icpc = ICP_GET_CLASS(icp);
- Error *local_err = NULL;
CPUState *cs;
KVMEnabledICP *enabled_icp;
unsigned long vcpu_id;
@@ -137,12 +134,6 @@ static void icp_kvm_realize(DeviceState *dev, Error **errp)
abort();
}
- icpc->parent_realize(dev, &local_err);
- if (local_err) {
- error_propagate(errp, local_err);
- return;
- }
-
cs = icp->cs;
vcpu_id = kvm_arch_vcpu_id(cs);
@@ -168,6 +159,24 @@ static void icp_kvm_realize(DeviceState *dev, Error **errp)
QLIST_INSERT_HEAD(&kvm_enabled_icps, enabled_icp, node);
}
+static void icp_kvm_realize(DeviceState *dev, Error **errp)
+{
+ ICPStateClass *icpc = ICP_GET_CLASS(dev);
+ Error *local_err = NULL;
+
+ icpc->parent_realize(dev, &local_err);
+ if (local_err) {
+ error_propagate(errp, local_err);
+ return;
+ }
+
+ icp_kvm_init(ICP(dev), &local_err);
+ if (local_err) {
+ error_propagate(errp, local_err);
+ return;
+ }
+}
+
static void icp_kvm_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
--
2.17.2
- Re: [Qemu-ppc] [PATCH v5 22/36] spapr/xive: add models for KVM support, (continued)
[Qemu-ppc] [PATCH v5 27/36] sysbus: add a sysbus_mmio_unmap() helper, Cédric Le Goater, 2018/11/16
[Qemu-ppc] [PATCH v5 25/36] spapr: set the interrupt presenter at reset, Cédric Le Goater, 2018/11/16
[Qemu-ppc] [PATCH v5 29/36] ppc/xics: remove abort() in icp_kvm_init(), Cédric Le Goater, 2018/11/16
[Qemu-ppc] [PATCH v5 28/36] ppc/xics: introduce a icp_kvm_init() routine,
Cédric Le Goater <=
[Qemu-ppc] [PATCH v5 32/36] spapr/rtas: modify spapr_rtas_register() to remove RTAS handlers, Cédric Le Goater, 2018/11/16
[Qemu-ppc] [PATCH v5 31/36] spapr/xive: export the spapr_xive_kvm_init() routine, Cédric Le Goater, 2018/11/16
[Qemu-ppc] [PATCH v5 34/36] spapr: add KVM support to the 'dual' machine, Cédric Le Goater, 2018/11/16