[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 07/13] ppc/xics: introduce a icp_kvm_connect() routine
From: |
Cédric Le Goater |
Subject: |
[Qemu-ppc] [PATCH 07/13] ppc/xics: introduce a icp_kvm_connect() routine |
Date: |
Mon, 7 Jan 2019 19:39:40 +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 ac94594b1919..2426e5b2f4ed 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.20.1
- [Qemu-ppc] [PATCH 00/13] spapr: add KVM support to the XIVE interrupt mode, Cédric Le Goater, 2019/01/07
- [Qemu-ppc] [PATCH 01/13] linux-headers: update to 5.0, Cédric Le Goater, 2019/01/07
- [Qemu-ppc] [PATCH 02/13] spapr/xive: add KVM support, Cédric Le Goater, 2019/01/07
- [Qemu-ppc] [PATCH 06/13] spapr/xive: fix migration of the XiveTCTX under TCG, Cédric Le Goater, 2019/01/07
- [Qemu-ppc] [PATCH 04/13] spapr/xive: introduce a VM state change handler, Cédric Le Goater, 2019/01/07
- [Qemu-ppc] [PATCH 03/13] spapr/xive: add state synchronization with KVM, Cédric Le Goater, 2019/01/07
- [Qemu-ppc] [PATCH 05/13] spapr/xive: add migration support for KVM, Cédric Le Goater, 2019/01/07
- [Qemu-ppc] [PATCH 07/13] ppc/xics: introduce a icp_kvm_connect() routine,
Cédric Le Goater <=
- [Qemu-ppc] [PATCH 08/13] spapr/rtas: modify spapr_rtas_register() to remove RTAS handlers, Cédric Le Goater, 2019/01/07
- [Qemu-ppc] [PATCH 09/13] sysbus: add a sysbus_mmio_unmap() helper, Cédric Le Goater, 2019/01/07
- [Qemu-ppc] [PATCH 12/13] spapr/xics: ignore the lower 4K in the IRQ number space, Cédric Le Goater, 2019/01/07
- [Qemu-ppc] [PATCH 11/13] spapr: check for the activation of the KVM IRQ device, Cédric Le Goater, 2019/01/07
- [Qemu-ppc] [PATCH 10/13] spapr: introduce routines to delete the KVM IRQ device, Cédric Le Goater, 2019/01/07
- [Qemu-ppc] [PATCH 13/13] spapr: add KVM support to the 'dual' machine, Cédric Le Goater, 2019/01/07