aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2019-09-24 11:34:12 +1000
committerDavid Gibson <david@gibson.dropbear.id.au>2019-10-04 19:08:22 +1000
commitfe9b61b2468a6de170ae0e9afe92fa1daa7ab48b (patch)
treeef13241f6da1c7238b05a863bc481269256338ee /hw
parentad8de98636e7cadeb1be4efa997cfe2a60bd5c30 (diff)
downloadqemu-fe9b61b2468a6de170ae0e9afe92fa1daa7ab48b.zip
qemu-fe9b61b2468a6de170ae0e9afe92fa1daa7ab48b.tar.gz
qemu-fe9b61b2468a6de170ae0e9afe92fa1daa7ab48b.tar.bz2
spapr: Eliminate nr_irqs parameter to SpaprIrq::init
The only reason this parameter was needed was to work around the inconsistent meaning of nr_irqs between xics and xive. Now that we've fixed that, we can consistently use the number directly in the SpaprIrq configuration. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Cédric Le Goater <clg@kaod.org> Reviewed-by: Greg Kurz <groug@kaod.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/ppc/spapr_irq.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c
index 3207b6b..cded3a0 100644
--- a/hw/ppc/spapr_irq.c
+++ b/hw/ppc/spapr_irq.c
@@ -92,8 +92,7 @@ static void spapr_irq_init_kvm(SpaprMachineState *spapr,
* XICS IRQ backend.
*/
-static void spapr_irq_init_xics(SpaprMachineState *spapr, int nr_xirqs,
- Error **errp)
+static void spapr_irq_init_xics(SpaprMachineState *spapr, Error **errp)
{
Object *obj;
Error *local_err = NULL;
@@ -102,7 +101,8 @@ static void spapr_irq_init_xics(SpaprMachineState *spapr, int nr_xirqs,
object_property_add_child(OBJECT(spapr), "ics", obj, &error_abort);
object_property_add_const_link(obj, ICS_PROP_XICS, OBJECT(spapr),
&error_fatal);
- object_property_set_int(obj, nr_xirqs, "nr-irqs", &error_fatal);
+ object_property_set_int(obj, spapr->irq->nr_xirqs,
+ "nr-irqs", &error_fatal);
object_property_set_bool(obj, true, "realized", &local_err);
if (local_err) {
error_propagate(errp, local_err);
@@ -256,15 +256,15 @@ SpaprIrq spapr_irq_xics = {
/*
* XIVE IRQ backend.
*/
-static void spapr_irq_init_xive(SpaprMachineState *spapr, int nr_xirqs,
- Error **errp)
+static void spapr_irq_init_xive(SpaprMachineState *spapr, Error **errp)
{
uint32_t nr_servers = spapr_max_server_number(spapr);
DeviceState *dev;
int i;
dev = qdev_create(NULL, TYPE_SPAPR_XIVE);
- qdev_prop_set_uint32(dev, "nr-irqs", nr_xirqs + SPAPR_XIRQ_BASE);
+ qdev_prop_set_uint32(dev, "nr-irqs",
+ spapr->irq->nr_xirqs + SPAPR_XIRQ_BASE);
/*
* 8 XIVE END structures per CPU. One for each available priority
*/
@@ -438,18 +438,17 @@ static SpaprIrq *spapr_irq_current(SpaprMachineState *spapr)
&spapr_irq_xive : &spapr_irq_xics;
}
-static void spapr_irq_init_dual(SpaprMachineState *spapr, int nr_xirqs,
- Error **errp)
+static void spapr_irq_init_dual(SpaprMachineState *spapr, Error **errp)
{
Error *local_err = NULL;
- spapr_irq_xics.init(spapr, spapr_irq_xics.nr_xirqs, &local_err);
+ spapr_irq_xics.init(spapr, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
}
- spapr_irq_xive.init(spapr, spapr_irq_xive.nr_xirqs, &local_err);
+ spapr_irq_xive.init(spapr, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -678,7 +677,7 @@ void spapr_irq_init(SpaprMachineState *spapr, Error **errp)
spapr_irq_msi_init(spapr, spapr->irq->nr_msis);
}
- spapr->irq->init(spapr, spapr->irq->nr_xirqs, errp);
+ spapr->irq->init(spapr, errp);
spapr->qirqs = qemu_allocate_irqs(spapr->irq->set_irq, spapr,
spapr->irq->nr_xirqs + SPAPR_XIRQ_BASE);