[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH for-2.12 v2 06/12] spapr: store a reference IRQ bitmap
From: |
Cédric Le Goater |
Subject: |
[Qemu-ppc] [PATCH for-2.12 v2 06/12] spapr: store a reference IRQ bitmap |
Date: |
Thu, 9 Nov 2017 11:14:33 +0100 |
To save some state when the guest is migrated, we capture the IRQ
bitmap after all devices have been reseted and store it as a reference
for the machine.
Signed-off-by: Cédric Le Goater <address@hidden>
---
hw/ppc/spapr.c | 5 ++++-
include/hw/ppc/spapr.h | 1 +
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 70f6a96ec909..d4d0a36cc5bf 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1437,6 +1437,9 @@ static void ppc_spapr_reset(void)
qemu_devices_reset();
spapr_clear_pending_events(spapr);
+ spapr->irq_map_ref = bitmap_new(spapr->nr_irqs);
+ bitmap_copy(spapr->irq_map_ref, spapr->irq_map, spapr->nr_irqs);
+
/*
* We place the device tree and RTAS just below either the top of the RMA,
* or just below 2GB, whichever is lowere, so that it can be
@@ -1706,7 +1709,7 @@ static bool spapr_irq_map_needed(void *opaque)
return false;
}
- return true;
+ return !bitmap_equal(spapr->irq_map, spapr->irq_map_ref, spapr->nr_irqs);
}
static const VMStateDescription vmstate_spapr_irq_map = {
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index 71faeff17a40..090eda962ccb 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -82,6 +82,7 @@ struct sPAPRMachineState {
struct sPAPRNVRAM *nvram;
int32_t nr_irqs;
unsigned long *irq_map;
+ unsigned long *irq_map_ref;
ICSState *ics;
sPAPRRTCState rtc;
--
2.13.6
- [Qemu-ppc] [PATCH for-2.12 v2 00/12] spapr: introduce an IRQ allocator at the machine level, Cédric Le Goater, 2017/11/09
- [Qemu-ppc] [PATCH for-2.12 v2 01/12] spapr: add pseries 2.12 machine type, Cédric Le Goater, 2017/11/09
- [Qemu-ppc] [PATCH for-2.12 v2 02/12] ppc/xics: remove useless if condition, Cédric Le Goater, 2017/11/09
- [Qemu-ppc] [PATCH for-2.12 v2 03/12] spapr: introduce new XICSFabric operations for an IRQ allocator, Cédric Le Goater, 2017/11/09
- [Qemu-ppc] [PATCH for-2.12 v2 04/12] spapr: move current IRQ allocation under the machine, Cédric Le Goater, 2017/11/09
- [Qemu-ppc] [PATCH for-2.12 v2 05/12] spapr: introduce an IRQ allocator using a bitmap, Cédric Le Goater, 2017/11/09
- [Qemu-ppc] [PATCH for-2.12 v2 06/12] spapr: store a reference IRQ bitmap,
Cédric Le Goater <=
- [Qemu-ppc] [PATCH for-2.12 v2 07/12] spapr: introduce an 'irq_base' number, Cédric Le Goater, 2017/11/09
- [Qemu-ppc] [PATCH for-2.12 v2 08/12] spapr: remove the use of ics_valid_irq(), Cédric Le Goater, 2017/11/09
- [Qemu-ppc] [PATCH for-2.12 v2 09/12] spapr: introduce a XICSFabric irq_is_lsi() operation, Cédric Le Goater, 2017/11/09
- [Qemu-ppc] [PATCH for-2.12 v2 10/12] spapr: split the IRQ number space for LSI interrupts, Cédric Le Goater, 2017/11/09
- [Qemu-ppc] [PATCH for-2.12 v2 11/12] sparp: merge ics_set_irq_type() in irq_alloc_block() operation, Cédric Le Goater, 2017/11/09
- [Qemu-ppc] [PATCH for-2.12 v2 12/12] spapr: use sPAPRMachineState in spapr_ics_ prototypes, Cédric Le Goater, 2017/11/09
- Re: [Qemu-ppc] [PATCH for-2.12 v2 00/12] spapr: introduce an IRQ allocator at the machine level, Cédric Le Goater, 2017/11/09