intel_iommu: Reset vIOMMU after all the rest of devices
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest4 patches 16 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | reset: qemu_register_reset_one()hw/ | +10 | 1 reply | |
| 2/4 | reset: Allow multiple stages of system resetshw/ include/ | +49 | 6 replies | |
| 3/4 | intel_iommu: Tear down address spaces before IOMMU resethw/ | +1 | 2 replies | |
| 4/4 | intel_iommu: Reset vIOMMU at the last stage of system resethw/ | +52 | 1 reply |
Reviews trailers per patch
1 of 4 patches has a Reviewed-by or Acked-by.
| Patch | Alex Williamson | Eric Auger |
|---|---|---|
| 1/4 | R-b | |
| 2/4 | ||
| 3/4 | ||
| 4/4 | Analyzed-by |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/4] intel_iommu: Reset vIOMMU after all the rest of devices
From: Peter Xu <[email protected]>
There're issue reported that when syetem_reset the VM with an intel iommu device and MT2892 PF(mlx5_core driver), the host kernel throws DMAR error.
https://issues.redhat.com/browse/RHEL-7188
Alex quickly spot a possible issue on ordering of device resets.
It's verified by our QE team then that it is indeed the root cause of the problem. Consider when vIOMMU is reset before a VFIO device in a system
reset: the device can be doing DMAs even if the vIOMMU is gone; in this specific context it means the shadow mapping can already be completely destroyed. Host will see these DMAs as malicious and report.
To fix it, we'll need to make sure all devices under the vIOMMU device hierachy will be reset before the vIOMMU itself. There's plenty of trick inside, one can get those by reading the last patch.
I didn't check other vIOMMUs, but this series should fix the issue for VT-d as of now. The solution can be slightly ugly, but a beautiful one can be very non-trivial.
Review comments welcomed, thanks.
Peter Xu (4):
reset: qemu_register_reset_one()
reset: Allow multiple stages of system resets
intel_iommu: Tear down address spaces before IOMMU reset
intel_iommu: Reset vIOMMU at the last stage of system reset
include/sysemu/reset.h | 5 ++++ hw/core/reset.c | 67 ++++++++++++++++++++++++++++++------------ hw/i386/intel_iommu.c | 56 +++++++++++++++++++++++++++++++++-- 3 files changed, 107 insertions(+), 21 deletions(-)
Signature · 1 line
2.43.0