x86/amd-iommu: Initialize passthrough mode when requested
authorJoerg Roedel <joerg.roedel@amd.com>
Tue, 1 Sep 2009 13:53:54 +0000 (15:53 +0200)
committerJoerg Roedel <joerg.roedel@amd.com>
Thu, 3 Sep 2009 14:15:46 +0000 (16:15 +0200)
This patch enables the passthrough mode for AMD IOMMU by
running the initialization function when iommu=pt is passed
on the kernel command line.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
arch/x86/kernel/amd_iommu_init.c

index c1b17e9..f00f489 100644 (file)
@@ -1242,12 +1242,18 @@ int __init amd_iommu_init(void)
        if (ret)
                goto free;
 
-       ret = amd_iommu_init_dma_ops();
+       if (iommu_pass_through)
+               ret = amd_iommu_init_passthrough();
+       else
+               ret = amd_iommu_init_dma_ops();
        if (ret)
                goto free;
 
        enable_iommus();
 
+       if (iommu_pass_through)
+               goto out;
+
        printk(KERN_INFO "AMD IOMMU: device isolation ");
        if (amd_iommu_isolate)
                printk("enabled\n");