[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 02/41] intel_iommu: allow migration
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 02/41] intel_iommu: allow migration |
Date: |
Tue, 10 Jan 2017 07:39:21 +0200 |
From: Peter Xu <address@hidden>
IOMMU needs to be migrated before all the PCI devices (in case there are
devices that will request for address translation). So marking it with a
priority higher than the default (which PCI devices and other belong).
Migration framework handled the rest.
Signed-off-by: Peter Xu <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
include/migration/vmstate.h | 1 +
hw/i386/intel_iommu.c | 22 +++++++++++++++++++++-
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index 1a22887..2125829 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -188,6 +188,7 @@ enum VMStateFlags {
typedef enum {
MIG_PRI_DEFAULT = 0,
+ MIG_PRI_IOMMU, /* Must happen before PCI devices */
MIG_PRI_MAX,
} MigrationPriority;
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 5f3e351..119217b 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -1996,7 +1996,27 @@ static void vtd_iommu_notify_flag_changed(MemoryRegion
*iommu,
static const VMStateDescription vtd_vmstate = {
.name = "iommu-intel",
- .unmigratable = 1,
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .priority = MIG_PRI_IOMMU,
+ .fields = (VMStateField[]) {
+ VMSTATE_UINT64(root, IntelIOMMUState),
+ VMSTATE_UINT64(intr_root, IntelIOMMUState),
+ VMSTATE_UINT64(iq, IntelIOMMUState),
+ VMSTATE_UINT32(intr_size, IntelIOMMUState),
+ VMSTATE_UINT16(iq_head, IntelIOMMUState),
+ VMSTATE_UINT16(iq_tail, IntelIOMMUState),
+ VMSTATE_UINT16(iq_size, IntelIOMMUState),
+ VMSTATE_UINT16(next_frcd_reg, IntelIOMMUState),
+ VMSTATE_UINT8_ARRAY(csr, IntelIOMMUState, DMAR_REG_SIZE),
+ VMSTATE_UINT8(iq_last_desc_type, IntelIOMMUState),
+ VMSTATE_BOOL(root_extended, IntelIOMMUState),
+ VMSTATE_BOOL(dmar_enabled, IntelIOMMUState),
+ VMSTATE_BOOL(qi_enabled, IntelIOMMUState),
+ VMSTATE_BOOL(intr_enabled, IntelIOMMUState),
+ VMSTATE_BOOL(intr_eime, IntelIOMMUState),
+ VMSTATE_END_OF_LIST()
+ }
};
static const MemoryRegionOps vtd_mem_ops = {
--
MST
- [Qemu-devel] [PULL 00/41] virtio, vhost, pc: fixes, features, Michael S. Tsirkin, 2017/01/10
- [Qemu-devel] [PULL 01/41] migration: allow to prioritize save state entries, Michael S. Tsirkin, 2017/01/10
- [Qemu-devel] [PULL 02/41] intel_iommu: allow migration,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 03/41] virtio-crypto: fix possible integer and heap overflow, Michael S. Tsirkin, 2017/01/10
- [Qemu-devel] [PULL 05/41] intel_iommu: name vtd address space with devfn, Michael S. Tsirkin, 2017/01/10
- [Qemu-devel] [PULL 06/41] intel_iommu: allocate new key when creating new address space, Michael S. Tsirkin, 2017/01/10
- [Qemu-devel] [PULL 04/41] virtio: convert to use DMA api, Michael S. Tsirkin, 2017/01/10
- [Qemu-devel] [PULL 07/41] exec: introduce address_space_get_iotlb_entry(), Michael S. Tsirkin, 2017/01/10
- [Qemu-devel] [PULL 08/41] intel_iommu: support device iotlb descriptor, Michael S. Tsirkin, 2017/01/10