iommu/amd: Fix init teardown and IOMMU interrupt setup
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest5 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | iommu/amd: Destroy protection domain IDs after the domains are freeddrivers/ | +1 | 0 replies | |
| 2/5 | iommu/amd: Unregister the IOMMUs before disabling them on init failuredrivers/ | +13 | 0 replies | |
| 3/5 | iommu/amd: Select XT mode only when the kernel supports x2APICdrivers/ | +8 | 0 replies | |
| 4/5 | iommu/amd: Log error message when IOMMU interrupt setup faileddrivers/ | +11 | 0 replies | |
| 5/5 | iommu/amd: Remove the shared INTCAPXT domain only after its IRQs are freeddrivers/ drivers/ | +58 | 0 replies |
Reviews trailers per patch
2 of 5 patches have a Reviewed-by or Acked-by.
| Patch | Dheeraj Kumar Srivastava |
|---|---|
| 1/5 | R-b T-b |
| 2/5 | R-b T-b |
| 3/5 | |
| 4/5 | |
| 5/5 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/5] iommu/amd: Fix init teardown and IOMMU interrupt setup
Init failure tears the IOMMUs down in an order the hardware and the protection-domain IDA cannot survive, and interrupt setup can select XT mode or drop the shared INTCAPXT domain while IRQs are still mapped.
- free_dma_resources() destroyed the protection-domain IDA before the group default domains were freed, so ida_free() warned for every domain released during init failure. Destroy the IDA after the domains have released their IDs.
- The failure path disabled the IOMMUs and then unregistered them. Clearing a DTE queues a completion wait, and the command processor was already off, so every wait timed out. Unregister first, while the IOMMUs still accept commands, then disable the hardware.
- IVHD XTSup was treated as the mode to run in, so CONTROL_XT_EN and INTCAPXT were enabled even when the kernel cannot use x2APIC. Stay in xAPIC mode and use MSI unless x2apic_supported() is true. iommu_init_irq() logs the missing MSI capability and the errno when interrupt allocation fails.
- The INTCAPXT irq domain is shared by every IOMMU and by the event, PPR, and GA interrupts. Removing it when one request failed tripped the revmap warning and left iommu_irqdomain pointing at a freed domain. Free only the failed IRQ, and remove the domain once its
Full series is available at :
https://github.com/AMDESE/linux-iommu/tree/iommu_code_audit_7.4_v1
Vasant Hegde (5):
iommu/amd: Destroy protection domain IDs after the domains are freed iommu/amd: Unregister the IOMMUs before disabling them on init failure iommu/amd: Select XT mode only when the kernel supports x2APIC iommu/amd: Log error message when IOMMU interrupt setup failed iommu/amd: Remove the shared INTCAPXT domain only after its IRQs are freed
drivers/iommu/amd/amd_iommu_types.h | 3 + drivers/iommu/amd/init.c | 108 ++++++++++++++++++++++------ 2 files changed, 91 insertions(+), 20 deletions(-)
Signature · 1 line
2.31.1