]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
x86/amd-iommu: Add flag to indicate IOTLB support
authorJoerg Roedel <joerg.roedel@amd.com>
Tue, 5 Apr 2011 10:50:24 +0000 (12:50 +0200)
committerJoerg Roedel <joerg.roedel@amd.com>
Mon, 11 Apr 2011 07:04:03 +0000 (09:04 +0200)
This patch adds a flag to the AMD IOMMU driver to indicate
that all IOMMUs present in the system support device IOTLBs.

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

index f5d184e7d5be0394554978941e926e3eb76b730d..cb811c965548598b579a40cc2f9a23e9cfcb8c32 100644 (file)
@@ -250,6 +250,8 @@ extern bool amd_iommu_dump;
 
 /* global flag if IOMMUs cache non-present entries */
 extern bool amd_iommu_np_cache;
+/* Only true if all IOMMUs support device IOTLBs */
+extern bool amd_iommu_iotlb_sup;
 
 /*
  * Make iterating over all IOMMUs easier
index 8848dda808e21ba1a3487c61ab2e873e2291f2f4..b6c634f3dc07e917de7d2670b9b953c8ac600899 100644 (file)
@@ -137,6 +137,7 @@ int amd_iommus_present;
 
 /* IOMMUs have a non-present cache? */
 bool amd_iommu_np_cache __read_mostly;
+bool amd_iommu_iotlb_sup __read_mostly = true;
 
 /*
  * The ACPI table parsing functions set this variable on an error
@@ -673,6 +674,9 @@ static void __init init_iommu_from_pci(struct amd_iommu *iommu)
                                        MMIO_GET_LD(range));
        iommu->evt_msi_num = MMIO_MSI_NUM(misc);
 
+       if (!(iommu->cap & (1 << IOMMU_CAP_IOTLB)))
+               amd_iommu_iotlb_sup = false;
+
        if (!is_rd890_iommu(iommu->dev))
                return;