aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
authorLu Baolu <baolu.lu@linux.intel.com>2018-05-04 01:08:18 -0400
committerJoerg Roedel <jroedel@suse.de>2018-05-15 10:34:52 -0400
commitab96746aaa344fb720a198245a837e266fad3b62 (patch)
treecfac39a79c489a44eb7a7016bb4352fd9caf199e /drivers/iommu
parentfcc35c634255a5874793228492c74566aed166ac (diff)
iommu/vt-d: Clean up pasid quirk for pre-production devices
The pasid28 quirk is needed only for some pre-production devices. Remove it to make the code concise. Signed-off-by: Ashok Raj <ashok.raj@intel.com> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/intel-iommu.c32
1 files changed, 2 insertions, 30 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index fd5cfd85c166..d79e3ebbe437 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -485,37 +485,14 @@ static int dmar_forcedac;
485static int intel_iommu_strict; 485static int intel_iommu_strict;
486static int intel_iommu_superpage = 1; 486static int intel_iommu_superpage = 1;
487static int intel_iommu_ecs = 1; 487static int intel_iommu_ecs = 1;
488static int intel_iommu_pasid28;
489static int iommu_identity_mapping; 488static int iommu_identity_mapping;
490 489
491#define IDENTMAP_ALL 1 490#define IDENTMAP_ALL 1
492#define IDENTMAP_GFX 2 491#define IDENTMAP_GFX 2
493#define IDENTMAP_AZALIA 4 492#define IDENTMAP_AZALIA 4
494 493
495/* Broadwell and Skylake have broken ECS support — normal so-called "second 494#define ecs_enabled(iommu) (intel_iommu_ecs && ecap_ecs(iommu->ecap))
496 * level" translation of DMA requests-without-PASID doesn't actually happen 495#define pasid_enabled(iommu) (ecs_enabled(iommu) && ecap_pasid(iommu->ecap))
497 * unless you also set the NESTE bit in an extended context-entry. Which of
498 * course means that SVM doesn't work because it's trying to do nested
499 * translation of the physical addresses it finds in the process page tables,
500 * through the IOVA->phys mapping found in the "second level" page tables.
501 *
502 * The VT-d specification was retroactively changed to change the definition
503 * of the capability bits and pretend that Broadwell/Skylake never happened...
504 * but unfortunately the wrong bit was changed. It's ECS which is broken, but
505 * for some reason it was the PASID capability bit which was redefined (from
506 * bit 28 on BDW/SKL to bit 40 in future).
507 *
508 * So our test for ECS needs to eschew those implementations which set the old
509 * PASID capabiity bit 28, since those are the ones on which ECS is broken.
510 * Unless we are working around the 'pasid28' limitations, that is, by putting
511 * the device into passthrough mode for normal DMA and thus masking the bug.
512 */
513#define ecs_enabled(iommu) (intel_iommu_ecs && ecap_ecs(iommu->ecap) && \
514 (intel_iommu_pasid28 || !ecap_broken_pasid(iommu->ecap)))
515/* PASID support is thus enabled if ECS is enabled and *either* of the old
516 * or new capability bits are set. */
517#define pasid_enabled(iommu) (ecs_enabled(iommu) && \
518 (ecap_pasid(iommu->ecap) || ecap_broken_pasid(iommu->ecap)))
519 496
520int intel_iommu_gfx_mapped; 497int intel_iommu_gfx_mapped;
521EXPORT_SYMBOL_GPL(intel_iommu_gfx_mapped); 498EXPORT_SYMBOL_GPL(intel_iommu_gfx_mapped);
@@ -578,11 +555,6 @@ static int __init intel_iommu_setup(char *str)
578 printk(KERN_INFO 555 printk(KERN_INFO
579 "Intel-IOMMU: disable extended context table support\n"); 556 "Intel-IOMMU: disable extended context table support\n");
580 intel_iommu_ecs = 0; 557 intel_iommu_ecs = 0;
581 } else if (!strncmp(str, "pasid28", 7)) {
582 printk(KERN_INFO
583 "Intel-IOMMU: enable pre-production PASID support\n");
584 intel_iommu_pasid28 = 1;
585 iommu_identity_mapping |= IDENTMAP_GFX;
586 } else if (!strncmp(str, "tboot_noforce", 13)) { 558 } else if (!strncmp(str, "tboot_noforce", 13)) {
587 printk(KERN_INFO 559 printk(KERN_INFO
588 "Intel-IOMMU: not forcing on after tboot. This could expose security risk for tboot\n"); 560 "Intel-IOMMU: not forcing on after tboot. This could expose security risk for tboot\n");