aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu/intel-iommu.c
diff options
context:
space:
mode:
authorMike Travis <travis@sgi.com>2012-03-05 18:05:16 -0500
committerIngo Molnar <mingo@elte.hu>2012-03-06 03:00:01 -0500
commiteae460b6590bb924d4e528d6cc7ccd4d993ff8dd (patch)
tree0f20d7cae6e32d19062f49fe67c683998f2849ab /drivers/iommu/intel-iommu.c
parent550cf00dbc8ee402bef71628cb71246493dd4500 (diff)
x86/iommu/intel: Fix identity mapping for sandy bridge
With SandyBridge, Intel has changed these Socket PCI devices to have a class type of "System Peripheral" & "Performance counter", rather than "HostBridge". So instead of using a "special" case to detect which devices will not be doing DMA, use the fact that a device that is not associated with an IOMMU, will not need an identity map. Signed-off-by: Mike Travis <travis@sgi.com> Signed-off-by: Mike Habeck <habeck@sgi.com> Cc: Jack Steiner <steiner@sgi.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Chris Wright <chrisw@sous-sol.org> Cc: Daniel Rahn <drahn@suse.com> Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Cc: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Link: http://lkml.kernel.org/n/tip-018fywmjs3lmzfyzjlktg8dx@git.kernel.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/iommu/intel-iommu.c')
-rw-r--r--drivers/iommu/intel-iommu.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index c9c6053198d..8aa580dc303 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -48,8 +48,6 @@
48#define ROOT_SIZE VTD_PAGE_SIZE 48#define ROOT_SIZE VTD_PAGE_SIZE
49#define CONTEXT_SIZE VTD_PAGE_SIZE 49#define CONTEXT_SIZE VTD_PAGE_SIZE
50 50
51#define IS_BRIDGE_HOST_DEVICE(pdev) \
52 ((pdev->class >> 8) == PCI_CLASS_BRIDGE_HOST)
53#define IS_GFX_DEVICE(pdev) ((pdev->class >> 16) == PCI_BASE_CLASS_DISPLAY) 51#define IS_GFX_DEVICE(pdev) ((pdev->class >> 16) == PCI_BASE_CLASS_DISPLAY)
54#define IS_ISA_DEVICE(pdev) ((pdev->class >> 8) == PCI_CLASS_BRIDGE_ISA) 52#define IS_ISA_DEVICE(pdev) ((pdev->class >> 8) == PCI_CLASS_BRIDGE_ISA)
55#define IS_AZALIA(pdev) ((pdev)->vendor == 0x8086 && (pdev)->device == 0x3a3e) 53#define IS_AZALIA(pdev) ((pdev)->vendor == 0x8086 && (pdev)->device == 0x3a3e)
@@ -2369,18 +2367,18 @@ static int __init iommu_prepare_static_identity_mapping(int hw)
2369 return -EFAULT; 2367 return -EFAULT;
2370 2368
2371 for_each_pci_dev(pdev) { 2369 for_each_pci_dev(pdev) {
2372 /* Skip Host/PCI Bridge devices */
2373 if (IS_BRIDGE_HOST_DEVICE(pdev))
2374 continue;
2375 if (iommu_should_identity_map(pdev, 1)) { 2370 if (iommu_should_identity_map(pdev, 1)) {
2376 printk(KERN_INFO "IOMMU: %s identity mapping for device %s\n",
2377 hw ? "hardware" : "software", pci_name(pdev));
2378
2379 ret = domain_add_dev_info(si_domain, pdev, 2371 ret = domain_add_dev_info(si_domain, pdev,
2380 hw ? CONTEXT_TT_PASS_THROUGH : 2372 hw ? CONTEXT_TT_PASS_THROUGH :
2381 CONTEXT_TT_MULTI_LEVEL); 2373 CONTEXT_TT_MULTI_LEVEL);
2382 if (ret) 2374 if (ret) {
2375 /* device not associated with an iommu */
2376 if (ret == -ENODEV)
2377 continue;
2383 return ret; 2378 return ret;
2379 }
2380 pr_info("IOMMU: %s identity mapping for device %s\n",
2381 hw ? "hardware" : "software", pci_name(pdev));
2384 } 2382 }
2385 } 2383 }
2386 2384