Skip to content

x86/iommu: Drop IOMMU support when cx16 isn't supported

Teddy Astie xen-devel 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest3 patches 6 repliesIn review
  2. v45 patches 1 replySuperseded
  3. v33 patches 3 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v23 patches4 repliesSuperseded
v13 patches2 repliesSuperseded

Changes in v5 from the cover letter

* Folded VT-d/AMD-Vi cx16 cleanup patches

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3x86/iommu: Disable IOMMU if cx16 isn't supportedxen/drivers/passthrough/amd/iommu_map.c xen/drivers/passthrough/amd/pci_amd_iommu.c xen/drivers/passthrough/vtd/iommu.c+45 -765 replies
2/3VT-d: Cleanup MAP_SINGLE_DEVICE and related codexen/drivers/passthrough/vtd/iommu.c xen/drivers/passthrough/vtd/vtd.h+5 -120 replies
3/3x86/iommu: Disable intrerrupt remapping if cx16 is not supportedxen/drivers/passthrough/amd/iommu_intr.c xen/drivers/passthrough/vtd/intremap.c xen/drivers/passthrough/vtd/iommu.c+27 -561 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.

Read the v5 thread

Cover letter [XEN PATCH v5 0/3] x86/iommu: Drop IOMMU support when cx16 isn't supported

All hardware that supports VT-d/AMD-Vi that exists also supports cx16 (aside specifically crafted virtual machines).

Some IOMMU code paths in Xen consider cases where VT-d/AMD-Vi is supported while cx16 isn't, those paths may be bugged and are barely tested, dead code in practice.

Disable IOMMU in case we have IOMMU hardware but no cx16, then cleanup no-cx16 handling logic from VT-d and AMD-Vi drivers. Also disable interrupt remapping that also relies on cx16.

Teddy

---

Changed in v2:

* Added cleanup no-cx16 code for x2APIC
* Fixed commit and code formatting
* Added missing Suggested-by note

Changed in v3:

* Use -ENODEV instead of -ENOSYS.

Changed in v4:

* Reworded "Disable IOMMU if cx16 isn't supported"
* Moved interrupt remapping cleanup in separate patches
* Check cx16 for interrupt remapping in driver's callbacks rather than
in x2apic_bsp_setup

Changed in v5:

* Folded VT-d/AMD-Vi cx16 cleanup patches

Teddy Astie (3):
x86/iommu: Disable IOMMU if cx16 isn't supported
VT-d: Cleanup MAP_SINGLE_DEVICE and related code x86/iommu: Disable intrerrupt remapping if cx16 is not supported

 xen/drivers/passthrough/amd/iommu_intr.c    |  6 ++
 xen/drivers/passthrough/amd/iommu_map.c     | 42 ++++------
 xen/drivers/passthrough/amd/pci_amd_iommu.c |  6 ++
 xen/drivers/passthrough/vtd/intremap.c      | 70 +++++-----------
 xen/drivers/passthrough/vtd/iommu.c         | 92 +++++++--------------
 xen/drivers/passthrough/vtd/vtd.h           |  5 +-
 6 files changed, 77 insertions(+), 144 deletions(-)
Signature · 9 lines
2.44.0



Teddy Astie | Vates XCP-ng Intern

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech