OSDN Git Service

intel_iommu: fix migration breakage on mr switch
authorPeter Xu <peterx@redhat.com>
Fri, 30 Jun 2017 07:24:38 +0000 (15:24 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 3 Jul 2017 19:29:49 +0000 (22:29 +0300)
commit552a1e01a41d7c24397a83947cca94d8d66e5f49
tree04ab0b3358700e3d9edd3f843e3dea1b7fd3a989
parent4d7e7f2702912f1abd81162342df547436810a5f
intel_iommu: fix migration breakage on mr switch

Migration is broken after the vfio integration work:

qemu-kvm: AHCI: Failed to start FIS receive engine: bad FIS receive buffer address
qemu-kvm: Failed to load ich9_ahci:ahci
qemu-kvm: error while loading state for instance 0x0 of device '0000:00:1f.2/ich9_ahci'
qemu-kvm: load of migration failed: Operation not permitted

The problem is that vfio work introduced dynamic memory region
switching (actually it is also used for future PT mode), and this memory
region layout is not properly delivered to destination when migration
happens. Solution is to rebuild the layout in post_load.

Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1459906
Fixes: 558e0024 ("intel_iommu: allow dynamic switch of IOMMU region")
Reviewed-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/i386/intel_iommu.c