[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 25/50] xics: XICS should not be a SysBusDevice
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 25/50] xics: XICS should not be a SysBusDevice |
Date: |
Wed, 1 Mar 2017 15:43:40 +1100 |
Currently xics - the component of the IBM POWER interrupt controller
representing the overall interrupt fabric / architecture is
represented as a descendent of SysBusDevice. However, this is not
really correct - the xics presents nothing in MMIO space so it should
be an "unattached" device in the current QOM model.
Since this device will always be created by the machine type, not created
specifically from the command line, and because it has no migrated state
it should be safe to move it around the device composition tree.
Therefore this patch changes it to a descendent of TYPE_DEVICE, and
makes it an unattached device. So that its reset handler still gets
called correctly, we add a qdev_set_parent_bus() to attach it to
sysbus. It's not really clear that's correct (instead of using
register_reset()) but it appears to a common technique.
Signed-off-by: David Gibson <address@hidden>
[clg corrected problems with reset]
Signed-off-by: Cédric Le Goater <address@hidden>
[dwg folded together and updated commit message]
Signed-off-by: David Gibson <address@hidden>
---
hw/intc/xics.c | 2 +-
hw/ppc/spapr.c | 3 ++-
include/hw/ppc/xics.h | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/hw/intc/xics.c b/hw/intc/xics.c
index 095c16a..372b831 100644
--- a/hw/intc/xics.c
+++ b/hw/intc/xics.c
@@ -260,7 +260,7 @@ static void xics_common_class_init(ObjectClass *oc, void
*data)
static const TypeInfo xics_common_info = {
.name = TYPE_XICS_COMMON,
- .parent = TYPE_SYS_BUS_DEVICE,
+ .parent = TYPE_DEVICE,
.instance_size = sizeof(XICSState),
.class_size = sizeof(XICSStateClass),
.instance_init = xics_common_initfn,
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index e0bb9bc..0c475f4 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -101,9 +101,10 @@ static XICSState *try_create_xics(const char *type, int
nr_servers,
Error *err = NULL;
DeviceState *dev;
- dev = qdev_create(NULL, type);
+ dev = DEVICE(object_new(type));
qdev_prop_set_uint32(dev, "nr_servers", nr_servers);
qdev_prop_set_uint32(dev, "nr_irqs", nr_irqs);
+ qdev_set_parent_bus(dev, sysbus_get_default());
object_property_set_bool(OBJECT(dev), true, "realized", &err);
if (err) {
error_propagate(errp, err);
diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h
index 3f0c316..1aefd3d 100644
--- a/include/hw/ppc/xics.h
+++ b/include/hw/ppc/xics.h
@@ -80,7 +80,7 @@ struct XICSStateClass {
struct XICSState {
/*< private >*/
- SysBusDevice parent_obj;
+ DeviceState parent_obj;
/*< public >*/
uint32_t nr_servers;
uint32_t nr_irqs;
--
2.9.3
- [Qemu-ppc] [PULL 49/50] ppc/xics: rename 'ICPState *' variables to 'icp', (continued)
- [Qemu-ppc] [PULL 49/50] ppc/xics: rename 'ICPState *' variables to 'icp', David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 21/50] target/ppc: add ov32 flag for multiply low insns, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 39/50] ppc/xics: simplify the cpu_setup() handler, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 08/50] pseries: Minor cleanups to HPT management hypercalls, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 12/50] target/ppc: Eliminate htab_base and htab_mask variables, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 43/50] ppc/xics: register the reset handler of ICP objects, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 37/50] ppc/xics: extend the QOM interface to handle ICPs, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 30/50] ppc/xics: introduce a XICSFabric QOM interface to handle ICSs, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 23/50] target/ppc: add mcrxrx instruction, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 11/50] target/ppc: Cleanup HPTE accessors for 64-bit hash MMU, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 25/50] xics: XICS should not be a SysBusDevice,
David Gibson <=
- [Qemu-ppc] [PULL 32/50] ppc/xics: use the QOM interface to get irqs, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 31/50] ppc/xics: use the QOM interface under the sPAPR machine, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 29/50] ppc/xics: add an InterruptStatsProvider interface to ICS and ICP objects, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 28/50] ppc/xics: store the ICS object under the sPAPR machine, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 44/50] ppc/xics: move the ICP array under the sPAPR machine, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 38/50] ppc/xics: move kernel_xics_fd out of KVMXICSState, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 36/50] ppc/xics: remove the XICS list of ICS, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 40/50] ppc/xics: move the cpu_setup() handler under the ICPState class, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 48/50] ppc/xics: move InterruptStatsProvider to the sPAPR machine, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 13/50] target/ppc: Manage external HPT via virtual hypervisor, David Gibson, 2017/02/28