[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 25/43] spapr/irq: Use the "simple" ICS class for KVM
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 25/43] spapr/irq: Use the "simple" ICS class for KVM |
Date: |
Tue, 19 Feb 2019 01:30:31 +1100 |
From: Greg Kurz <address@hidden>
The "simple" ICS class knows how to interract with KVM. Adapt sPAPR to use
it instead of the ICS KVM class.
Signed-off-by: Greg Kurz <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/spapr_irq.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c
index 9f43b7b3bf..4aa8165307 100644
--- a/hw/ppc/spapr_irq.c
+++ b/hw/ppc/spapr_irq.c
@@ -67,13 +67,12 @@ void spapr_irq_msi_reset(sPAPRMachineState *spapr)
*/
static ICSState *spapr_ics_create(sPAPRMachineState *spapr,
- const char *type_ics,
int nr_irqs, Error **errp)
{
Error *local_err = NULL;
Object *obj;
- obj = object_new(type_ics);
+ obj = object_new(TYPE_ICS_SIMPLE);
object_property_add_child(OBJECT(spapr), "ics", obj, &error_abort);
object_property_add_const_link(obj, ICS_PROP_XICS, OBJECT(spapr),
&error_abort);
@@ -98,14 +97,14 @@ static void spapr_irq_init_xics(sPAPRMachineState *spapr,
int nr_irqs,
{
MachineState *machine = MACHINE(spapr);
Error *local_err = NULL;
+ bool xics_kvm = false;
if (kvm_enabled()) {
if (machine_kernel_irqchip_allowed(machine) &&
!xics_kvm_init(spapr, &local_err)) {
- spapr->ics = spapr_ics_create(spapr, TYPE_ICS_KVM, nr_irqs,
- &local_err);
+ xics_kvm = true;
}
- if (machine_kernel_irqchip_required(machine) && !spapr->ics) {
+ if (machine_kernel_irqchip_required(machine) && !xics_kvm) {
error_prepend(&local_err,
"kernel_irqchip requested but unavailable: ");
goto error;
@@ -114,12 +113,12 @@ static void spapr_irq_init_xics(sPAPRMachineState *spapr,
int nr_irqs,
local_err = NULL;
}
- if (!spapr->ics) {
+ if (!xics_kvm) {
xics_spapr_init(spapr);
- spapr->ics = spapr_ics_create(spapr, TYPE_ICS_SIMPLE, nr_irqs,
- &local_err);
}
+ spapr->ics = spapr_ics_create(spapr, nr_irqs, &local_err);
+
error:
error_propagate(errp, local_err);
}
--
2.20.1
- [Qemu-ppc] [PULL 12/43] qdev: pass an Object * to qbus_set_hotplug_handler(), (continued)
- [Qemu-ppc] [PULL 12/43] qdev: pass an Object * to qbus_set_hotplug_handler(), David Gibson, 2019/02/18
- [Qemu-ppc] [PULL 15/43] spapr/irq: add an 'nr_irq' parameter to initialize the backend., David Gibson, 2019/02/18
- [Qemu-ppc] [PULL 14/43] spapr: fix out of bounds write in spapr_populate_drmem_v2, David Gibson, 2019/02/18
- [Qemu-ppc] [PULL 23/43] xics: Handle KVM ICS reset from the "simple" ICS code, David Gibson, 2019/02/18
- [Qemu-ppc] [PULL 18/43] xics: Handle KVM ICP reset from the common code, David Gibson, 2019/02/18
- [Qemu-ppc] [PULL 22/43] xics: Explicitely call KVM ICS methods from the common code, David Gibson, 2019/02/18
- [Qemu-ppc] [PULL 27/43] target/ppc: convert VMX logical instructions to use vector operations, David Gibson, 2019/02/18
- [Qemu-ppc] [PULL 21/43] xics: Drop the KVM ICP class, David Gibson, 2019/02/18
- [Qemu-ppc] [PULL 20/43] spapr/irq: Use the base ICP class for KVM, David Gibson, 2019/02/18
- [Qemu-ppc] [PULL 31/43] target/ppc: convert VSX logical operations to vector operations, David Gibson, 2019/02/18
- [Qemu-ppc] [PULL 25/43] spapr/irq: Use the "simple" ICS class for KVM,
David Gibson <=
- [Qemu-ppc] [PULL 29/43] target/ppc: convert vspltis[bhw] to use vector operations, David Gibson, 2019/02/18
- [Qemu-ppc] [PULL 36/43] target/ppc: Use helper_mtvscr for reset and gdb, David Gibson, 2019/02/18
- [Qemu-ppc] [PULL 28/43] target/ppc: convert vaddu[b, h, w, d] and vsubu[b, h, w, d] over to use vector operations, David Gibson, 2019/02/18
- [Qemu-ppc] [PULL 26/43] xics: Drop the KVM ICS class, David Gibson, 2019/02/18
- [Qemu-ppc] [PULL 24/43] xics: Handle KVM interrupt presentation from "simple" ICS code, David Gibson, 2019/02/18
- [Qemu-ppc] [PULL 33/43] target/ppc: convert xxspltw to vector operations, David Gibson, 2019/02/18
- [Qemu-ppc] [PULL 39/43] target/ppc: Use mtvscr/mfvscr for vmstate, David Gibson, 2019/02/18
- [Qemu-ppc] [PULL 30/43] target/ppc: convert vsplt[bhw] to use vector operations, David Gibson, 2019/02/18
- [Qemu-ppc] [PULL 32/43] target/ppc: convert xxspltib to vector operations, David Gibson, 2019/02/18
- [Qemu-ppc] [PULL 37/43] target/ppc: Remove vscr_nj and vscr_sat, David Gibson, 2019/02/18