Skip to contentSkip to conversation

iommu/amd: Fix missing iommu_shutdown initialization in passthrough mode

RFC PATCH In review Shuah Khan 2 participants 2 messages Jun 6, 2012 – Jun 7, 2012 IOMMU

lore
Share & tools
lore

Shuah Khan

author
#0 lore raw

RFC PATCH 1/1 iommu/amd: Fix missing iommu_shutdown initialization in passthrough mode

Change AMD iommu driver to call disable iommus in pass-through mode. AMD iommu driver's amd_iommu_init() routine doesn't initialize iommu_shutdown in pass-through mode. As a result iommu disable via a call to disable_iommus() doesn't happen at shutdown. Enable and disable of iommus is inconsistent in pass-through mode. IOMMU is enabled, but not disabled. IOMMU disable is called from error legs in amd_iommu_init() in pass-through mode.

Requesting for comments as I don't have access to AMD system that supports IOMMU. I tested the change on AMD platforms with GART IOMMU which is not sufficient.

---
 drivers/iommu/amd_iommu_init.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iommu/amd_iommu_init.c +2 -2
index c567903..1d8ab7f 100644
@@ -1644,6 +1644,8 @@ static int __init amd_iommu_init(void)
 
 	amd_iommu_init_api();
 
+	x86_platform.iommu_shutdown = disable_iommus;
+
 	if (iommu_pass_through)
 		goto out;
 
@@ -1652,8 +1654,6 @@ static int __init amd_iommu_init(void)
 	else
 		printk(KERN_INFO "AMD-Vi: Lazy IO/TLB flushing enabled\n");
 
-	x86_platform.iommu_shutdown = disable_iommus;
-
 out:
 	return ret;
 
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 7 lines · Shuah Khan

Change AMD iommu driver to call disable iommus in pass-through mode. AMD iommu driver's amd_iommu_init() routine doesn't initialize iommu_shutdown in pass-through mode. As a result iommu disable via a call to disable_iommus() doesn't happen at shutdown. Enable and disable of iommus is inconsistent in pass-through mode. IOMMU is enabled, but not disabled. IOMMU disable is called from error legs in amd_iommu_init() in pass-through mode.

Quoted 5 lines

Requesting for comments as I don't have access to AMD system that supports IOMMU. I tested the change on AMD platforms with GART IOMMU which is not sufficient.

The patch is fine. Thanks, applied to iommu/fixes.

Signature · 5 lines
AMD Operating System Research Center

Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach
General Managers: Alberto Bozzo
Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632