aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLu Baolu <baolu.lu@linux.intel.com>2018-07-08 02:23:21 -0400
committerJoerg Roedel <jroedel@suse.de>2018-07-20 07:55:56 -0400
commit2db1581e1f432ac6b4efe152c57fdfb4de85c154 (patch)
treed7aa82dfc20fbca20f96c5fc8c4ff35b74523af3 /drivers
parent9d3cce1e8b8561fed5f383d22a4d6949db4eadbe (diff)
Revert "iommu/vt-d: Clean up pasid quirk for pre-production devices"
This reverts commit ab96746aaa344fb720a198245a837e266fad3b62. The commit ab96746aaa34 ("iommu/vt-d: Clean up pasid quirk for pre-production devices") triggers ECS mode on some platforms which have broken ECS support. As the result, graphic device will be inoperable on boot. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107017 Cc: 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')
-rw-r--r--drivers/iommu/intel-iommu.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index b344a883f116..115ff26e9ced 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -484,14 +484,37 @@ static int dmar_forcedac;
484static int intel_iommu_strict; 484static int intel_iommu_strict;
485static int intel_iommu_superpage = 1; 485static int intel_iommu_superpage = 1;
486static int intel_iommu_ecs = 1; 486static int intel_iommu_ecs = 1;
487static int intel_iommu_pasid28;
487static int iommu_identity_mapping; 488static int iommu_identity_mapping;
488 489
489#define IDENTMAP_ALL 1 490#define IDENTMAP_ALL 1
490#define IDENTMAP_GFX 2 491#define IDENTMAP_GFX 2
491#define IDENTMAP_AZALIA 4 492#define IDENTMAP_AZALIA 4
492 493
493#define ecs_enabled(iommu) (intel_iommu_ecs && ecap_ecs(iommu->ecap)) 494/* Broadwell and Skylake have broken ECS support — normal so-called "second
494#define pasid_enabled(iommu) (ecs_enabled(iommu) && ecap_pasid(iommu->ecap)) 495 * level" translation of DMA requests-without-PASID doesn't actually happen
496 * unless you also set the NESTE bit in an extended context-entry. Which of
497 * course means that SVM doesn't work because it's trying to do nested
498 * translation of the physical addresses it finds in the process page tables,
499 * through the IOVA->phys mapping found in the "second level" page tables.
500 *
501 * The VT-d specification was retroactively changed to change the definition
502 * of the capability bits and pretend that Broadwell/Skylake never happened...
503 * but unfortunately the wrong bit was changed. It's ECS which is broken, but
504 * for some reason it was the PASID capability bit which was redefined (from
505 * bit 28 on BDW/SKL to bit 40 in future).
506 *
507 * So our test for ECS needs to eschew those implementations which set the old
508 * PASID capabiity bit 28, since those are the ones on which ECS is broken.
509 * Unless we are working around the 'pasid28' limitations, that is, by putting
510 * the device into passthrough mode for normal DMA and thus masking the bug.
511 */
512#define ecs_enabled(iommu) (intel_iommu_ecs && ecap_ecs(iommu->ecap) && \
513 (intel_iommu_pasid28 || !ecap_broken_pasid(iommu->ecap)))
514/* PASID support is thus enabled if ECS is enabled and *either* of the old
515 * or new capability bits are set. */
516#define pasid_enabled(iommu) (ecs_enabled(iommu) && \
517 (ecap_pasid(iommu->ecap) || ecap_broken_pasid(iommu->ecap)))
495 518
496int intel_iommu_gfx_mapped; 519int intel_iommu_gfx_mapped;
497EXPORT_SYMBOL_GPL(intel_iommu_gfx_mapped); 520EXPORT_SYMBOL_GPL(intel_iommu_gfx_mapped);
@@ -554,6 +577,11 @@ static int __init intel_iommu_setup(char *str)
554 printk(KERN_INFO 577 printk(KERN_INFO
555 "Intel-IOMMU: disable extended context table support\n"); 578 "Intel-IOMMU: disable extended context table support\n");
556 intel_iommu_ecs = 0; 579 intel_iommu_ecs = 0;
580 } else if (!strncmp(str, "pasid28", 7)) {
581 printk(KERN_INFO
582 "Intel-IOMMU: enable pre-production PASID support\n");
583 intel_iommu_pasid28 = 1;
584 iommu_identity_mapping |= IDENTMAP_GFX;
557 } else if (!strncmp(str, "tboot_noforce", 13)) { 585 } else if (!strncmp(str, "tboot_noforce", 13)) {
558 printk(KERN_INFO 586 printk(KERN_INFO
559 "Intel-IOMMU: not forcing on after tboot. This could expose security risk for tboot\n"); 587 "Intel-IOMMU: not forcing on after tboot. This could expose security risk for tboot\n");