[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 13/15] pseries: savevm support for PAPR TCE tables
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PATCH 13/15] pseries: savevm support for PAPR TCE tables |
Date: |
Mon, 15 Oct 2012 10:24:40 +1000 |
This patch adds the necessary VMStateDescription information to save the
state of PAPR TCE tables (that is, the PAPR specified IOMMU).
Signed-off-by: David Gibson <address@hidden>
---
hw/spapr_iommu.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/hw/spapr_iommu.c b/hw/spapr_iommu.c
index 38034c0..29e76eb 100644
--- a/hw/spapr_iommu.c
+++ b/hw/spapr_iommu.c
@@ -115,6 +115,26 @@ static int spapr_tce_translate(DMAContext *dma,
return 0;
}
+static const VMStateDescription vmstate_spapr_tce_table = {
+ .name = "spapr_iommu",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .minimum_version_id_old = 1,
+ .fields = (VMStateField []) {
+ /* Sanity check */
+ VMSTATE_UINT32_EQUAL(liobn, sPAPRTCETable),
+ VMSTATE_UINT32_EQUAL(window_size, sPAPRTCETable),
+
+ /* IOMMU state */
+ VMSTATE_BOOL(bypass, sPAPRTCETable),
+ VMSTATE_VBUFFER_DIVIDE(table, sPAPRTCETable, 0, NULL, 0, window_size,
+ SPAPR_TCE_PAGE_SIZE / sizeof(sPAPRTCE)),
+
+ VMSTATE_END_OF_LIST()
+ },
+};
+
+
DMAContext *spapr_tce_new_dma_context(uint32_t liobn, size_t window_size)
{
sPAPRTCETable *tcet;
@@ -148,6 +168,8 @@ DMAContext *spapr_tce_new_dma_context(uint32_t liobn,
size_t window_size)
QLIST_INSERT_HEAD(&spapr_tce_tables, tcet, list);
+ vmstate_register(NULL, tcet->liobn, &vmstate_spapr_tce_table, tcet);
+
return &tcet->dma;
}
@@ -157,6 +179,8 @@ void spapr_tce_free(DMAContext *dma)
if (dma) {
sPAPRTCETable *tcet = DO_UPCAST(sPAPRTCETable, dma, dma);
+ vmstate_unregister(NULL, &vmstate_spapr_tce_table, tcet);
+
QLIST_REMOVE(tcet, list);
if (!kvm_enabled() ||
--
1.7.10.4
- [Qemu-ppc] RFC: savevm/migration support for pseries, David Gibson, 2012/10/14
- [Qemu-ppc] [PATCH 06/15] savevm: Add VMSTATE_STRUCT_VARRAY_POINTER_UINT32, David Gibson, 2012/10/14
- [Qemu-ppc] [PATCH 13/15] pseries: savevm support for PAPR TCE tables,
David Gibson <=
- [Qemu-ppc] [PATCH 10/15] pseries: savevm support for XICS interrupt controller, David Gibson, 2012/10/14
- [Qemu-ppc] [PATCH 11/15] pseries: savevm support for VIO devices, David Gibson, 2012/10/14
- [Qemu-ppc] [PATCH 05/15] savevm: Add VMSTATE_FLOAT64 helpers, David Gibson, 2012/10/14
- [Qemu-ppc] [PATCH 12/15] pseries: savevm support for PAPR VIO logical lan, David Gibson, 2012/10/14
- [Qemu-ppc] [PATCH 03/15] savevm: Add VMSTATE_UINT64_EQUAL helpers, David Gibson, 2012/10/14
- [Qemu-ppc] [PATCH 04/15] savevm: Add VMSTATE_UINTTL_EQUAL helper, David Gibson, 2012/10/14
- [Qemu-ppc] [PATCH 09/15] target-ppc: Convert ppc cpu savevm to VMStateDescription, David Gibson, 2012/10/14
- [Qemu-ppc] [PATCH 14/15] pseries: savevm support for PAPR virtual SCSI, David Gibson, 2012/10/14
- [Qemu-ppc] [PATCH 01/15] pseries: Split xics irq configuration from state information, David Gibson, 2012/10/14
- [Qemu-ppc] [PATCH 02/15] target-pcc: Convert ppcemb_tlb_t to use fixed 64-bit RPN, David Gibson, 2012/10/14