[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 18/18] xics: add unrealize handler
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 18/18] xics: add unrealize handler |
Date: |
Thu, 25 May 2017 13:51:32 +1000 |
From: Greg Kurz <address@hidden>
Now that ICPState objects get finalized on CPU unplug, we should unregister
reset handlers as well to avoid a QEMU crash at machine reset time.
Signed-off-by: Greg Kurz <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/intc/xics.c | 5 +++++
hw/intc/xics_kvm.c | 6 ++++++
2 files changed, 11 insertions(+)
diff --git a/hw/intc/xics.c b/hw/intc/xics.c
index 292fffe..ea35167 100644
--- a/hw/intc/xics.c
+++ b/hw/intc/xics.c
@@ -357,6 +357,10 @@ static void icp_realize(DeviceState *dev, Error **errp)
qemu_register_reset(icp_reset, dev);
}
+static void icp_unrealize(DeviceState *dev, Error **errp)
+{
+ qemu_unregister_reset(icp_reset, dev);
+}
static void icp_class_init(ObjectClass *klass, void *data)
{
@@ -364,6 +368,7 @@ static void icp_class_init(ObjectClass *klass, void *data)
dc->vmsd = &vmstate_icp_server;
dc->realize = icp_realize;
+ dc->unrealize = icp_unrealize;
}
static const TypeInfo icp_info = {
diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c
index dd7f298..14b8f6f 100644
--- a/hw/intc/xics_kvm.c
+++ b/hw/intc/xics_kvm.c
@@ -164,12 +164,18 @@ static void icp_kvm_realize(DeviceState *dev, Error
**errp)
qemu_register_reset(icp_kvm_reset, dev);
}
+static void icp_kvm_unrealize(DeviceState *dev, Error **errp)
+{
+ qemu_unregister_reset(icp_kvm_reset, dev);
+}
+
static void icp_kvm_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
ICPStateClass *icpc = ICP_CLASS(klass);
dc->realize = icp_kvm_realize;
+ dc->unrealize = icp_kvm_unrealize;
icpc->pre_save = icp_get_kvm_state;
icpc->post_load = icp_set_kvm_state;
icpc->cpu_setup = icp_kvm_cpu_setup;
--
2.9.4
- [Qemu-ppc] [PULL 08/18] hw/ppc/spapr_events.c: removing 'exception' from sPAPREventLogEntry, (continued)
- [Qemu-ppc] [PULL 08/18] hw/ppc/spapr_events.c: removing 'exception' from sPAPREventLogEntry, David Gibson, 2017/05/24
- [Qemu-ppc] [PULL 07/18] spapr: ensure core_slot isn't NULL in spapr_core_unplug(), David Gibson, 2017/05/24
- [Qemu-ppc] [PULL 09/18] spapr_cpu_core: drop reference on ICP object during CPU realization, David Gibson, 2017/05/24
- [Qemu-ppc] [PULL 06/18] xics_kvm: cache already enabled vCPU ids, David Gibson, 2017/05/24
- [Qemu-ppc] [PULL 13/18] spapr: add pre_plug function for memory, David Gibson, 2017/05/24
- [Qemu-ppc] [PULL 11/18] pseries: Split CAS PVR negotiation out into a separate function, David Gibson, 2017/05/24
- [Qemu-ppc] [PULL 14/18] hw/ppc/spapr.c: adding pending_dimm_unplugs to sPAPRMachineState, David Gibson, 2017/05/24
- [Qemu-ppc] [PULL 03/18] spapr: sanitize error handling in spapr_ics_create(), David Gibson, 2017/05/24
- [Qemu-ppc] [PULL 05/18] spapr: Consolidate HPT freeing code into a routine, David Gibson, 2017/05/24
- [Qemu-ppc] [PULL 18/18] xics: add unrealize handler,
David Gibson <=
- [Qemu-ppc] [PULL 15/18] hw/ppc: removing drc->detach_cb and drc->detach_cb_opaque, David Gibson, 2017/05/24
- [Qemu-ppc] [PULL 12/18] pseries: Restore support for total vcpus not a multiple of threads-per-core for old machine types, David Gibson, 2017/05/24
- [Qemu-ppc] [PULL 17/18] hw/ppc/spapr.c: recover pending LMB unplug info in spapr_lmb_release, David Gibson, 2017/05/24
- [Qemu-ppc] [PULL 16/18] hw/ppc: migrating the DRC state of hotplugged devices, David Gibson, 2017/05/24
- Re: [Qemu-ppc] [Qemu-devel] [PULL 00/18] ppc-for-2.10 queue 20170525, Stefan Hajnoczi, 2017/05/30