Skip to content

handle init errors more gracefully in amd_iommu

Kevin Mitchell via iommu linux-iommu 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3iommu/amd: make iommu_disable saferdrivers/iommu/amd_iommu_init.c+3 -00 replies
2/3iommu/amd: move gart fallback to amd_iommu_initdrivers/iommu/amd_iommu_init.c+10 -90 replies
3/3iommu/amd: only free resources once on init errordrivers/iommu/amd_iommu_init.c+13 -140 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/3] handle init errors more gracefully in amd_iommu

This series makes error handling more robust in the amd_iommu init code. It was initially motivated by problematic firmware that does not set up the physical address of the iommu. This led to a NULL dereference panic when iommu_disable was called during cleanup.

While the first patch is sufficient to avoid the panic, the subsequent two move the cleanup closer to the actual error and avoid calling the cleanup code twice when amd_iommu=off is specified on the command line.

I have tested this series on a variety of AMD CPUs with firmware exhibiting the issue. I have additionally tested on platforms where the firmware has been fixed. I tried both with and without amd_iommu=off. I have also tested on older CPUs where no IOMMU is detected and even one where the GART driver ends up running.

Thanks,

Kevin

Kevin Mitchell (3):
iommu/amd: make iommu_disable safer iommu/amd: move gart fallback to amd_iommu_init iommu/amd: only free resources once on init error

 drivers/iommu/amd_iommu_init.c | 45 ++++++++++++++++++----------------
 1 file changed, 24 insertions(+), 21 deletions(-)
Signature · 1 line
2.20.1