[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH v6 32/37] ppc/xics: introduce a icp_kvm_connect() rout
From: |
Cédric Le Goater |
Subject: |
[Qemu-ppc] [PATCH v6 32/37] ppc/xics: introduce a icp_kvm_connect() routine |
Date: |
Thu, 6 Dec 2018 00:22:46 +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, 20 insertions(+), 9 deletions(-)
diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c
index e8fa9a53aeba..de86e1d0b1ab 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_connect(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;
@@ -135,11 +132,6 @@ static void icp_kvm_realize(DeviceState *dev, Error **errp)
if (kernel_xics_fd == -1) {
abort();
- }
-
- icpc->parent_realize(dev, &local_err);
- if (local_err) {
- error_propagate(errp, local_err);
return;
}
@@ -168,6 +160,25 @@ 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;
+ }
+
+ /* Connect the presenter to the VCPU (required for CPU hotplug) */
+ icp_kvm_connect(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
- [Qemu-ppc] [PATCH v6 22/37] spapr: add a 'pseries-3.1-xive' machine type, (continued)
- [Qemu-ppc] [PATCH v6 22/37] spapr: add a 'pseries-3.1-xive' machine type, Cédric Le Goater, 2018/12/05
- [Qemu-ppc] [PATCH v6 28/37] spapr/xive: fix migration of the XiveTCTX under TCG, Cédric Le Goater, 2018/12/05
- [Qemu-ppc] [PATCH v6 23/37] linux-headers: update to 4.20-rc5, Cédric Le Goater, 2018/12/05
- [Qemu-ppc] [PATCH v6 25/37] spapr/xive: add state synchronization with KVM, Cédric Le Goater, 2018/12/05
- [Qemu-ppc] [PATCH v6 29/37] spapr: set the interrupt presenter at reset, Cédric Le Goater, 2018/12/05
- [Qemu-ppc] [PATCH v6 30/37] spapr/xive: enable XIVE MMIOs at reset, Cédric Le Goater, 2018/12/05
- [Qemu-ppc] [PATCH v6 27/37] spapr/xive: add migration support for KVM, Cédric Le Goater, 2018/12/05
- [Qemu-ppc] [PATCH v6 26/37] spapr/xive: introduce a VM state change handler, Cédric Le Goater, 2018/12/05
- [Qemu-ppc] [PATCH v6 24/37] spapr/xive: add KVM support, Cédric Le Goater, 2018/12/05
- [Qemu-ppc] [PATCH v6 31/37] spapr: add a 'pseries-3.1-dual' machine type, Cédric Le Goater, 2018/12/05
- [Qemu-ppc] [PATCH v6 32/37] ppc/xics: introduce a icp_kvm_connect() routine,
Cédric Le Goater <=
- [Qemu-ppc] [PATCH v6 33/37] spapr/rtas: modify spapr_rtas_register() to remove RTAS handlers, Cédric Le Goater, 2018/12/05
- [Qemu-ppc] [PATCH v6 34/37] sysbus: add a sysbus_mmio_unmap() helper, Cédric Le Goater, 2018/12/05
- [Qemu-ppc] [PATCH v6 35/37] spapr: introduce routines to delete the KVM IRQ device, Cédric Le Goater, 2018/12/05
- [Qemu-ppc] [PATCH v6 37/37] spapr: add KVM support to the 'dual' machine, Cédric Le Goater, 2018/12/05
- [Qemu-ppc] [PATCH v6 36/37] spapr: check for KVM IRQ device activation, Cédric Le Goater, 2018/12/05
- Re: [Qemu-ppc] [Qemu-devel] [PATCH v6 00/37] ppc: support for the XIVE interrupt controller (POWER9), no-reply, 2018/12/05