Skip to content

Fix DMA failure when there is domain switch in guest

Zhenzhong Duan qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 3 repliesIn review
  2. v23 patches 5 repliesSuperseded
  3. v13 patches 4 repliesSuperseded

Changes in v3 from the cover letter

- compare pasid entry with pasid cache before as switch and sync (Liuyi)

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3intel_iommu: Handle PASID cache invalidationhw/i386/intel_iommu.c hw/i386/intel_iommu_internal.h hw/i386/trace-events +1 more+157 -100 replies
2/3intel_iommu: Reset pasid cache when system level resethw/i386/intel_iommu.c hw/i386/trace-events+17 -01 reply
3/3intel_iommu: Fix DMA failure when guest switches IOMMU domainhw/i386/intel_iommu.c+27 -22 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchYi Liu
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/3] Fix DMA failure when there is domain switch in guest

Hi,

This fixes an DMA failure issue in guest when user switch domain manually. E.g., echo [DMA|identity] > /sys/kernel/iommu_groups/6/type

First two patches come from [PATCH v6 00/22] intel_iommu: Enable first stage translation for passthrough device which added basic support for pasid cache invalidation, the 3rd patch
add a fix.

Test:
both vhost network card and VFIO device,
guest config with and without iommu=pt,
switch domain with echo [DMA|identity] > /sys/kernel/iommu_groups/6/type, ping test under different domain

Thanks
Zhenzhong

Changelog:
v3:
- compare pasid entry with pasid cache before as switch and sync (Liuyi)

v2:
- drop extract64 usage in patch1 (Liuyi)
- update DID check logic (Liuyi)
- refactor comments (Liuyi)
- rewrite patch2 with simpler code
- bypass vtd_address_space_sync() when pasid entry is invalid

Zhenzhong Duan (3):
intel_iommu: Handle PASID cache invalidation
intel_iommu: Reset pasid cache when system level reset
intel_iommu: Fix DMA failure when guest switches IOMMU domain

 hw/i386/intel_iommu_internal.h |  17 +++
 include/hw/i386/intel_iommu.h  |   6 ++
 hw/i386/intel_iommu.c          | 182 +++++++++++++++++++++++++++++++--
 hw/i386/trace-events           |   4 +
 4 files changed, 199 insertions(+), 10 deletions(-)
Signature · 1 line
2.47.1