Received: by 10.192.165.148 with SMTP id m20csp359024imm; Thu, 3 May 2018 22:18:01 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqsz1fMwVJQyKNKndpY3eibY6obsiZYmmAUAXhTTB8lDqp2eopLf/b8zTFrOt21WoOQf66Z X-Received: by 2002:a63:ba05:: with SMTP id k5-v6mr21131559pgf.39.1525411081180; Thu, 03 May 2018 22:18:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525411081; cv=none; d=google.com; s=arc-20160816; b=Z03/k0HMPY18W69TET/XSjnd+SbkIWZkgYvRB2BftfL0kXF2i6vDUhQ+GLzgUjC487 7WdiQ5eANLRGSD2ABtECy0UCM1sKRz3c/Q+bOU+/OcC5HOmo3WkSSYfDdH11zK8410Wy gS/c1h2nA+SHnL2ecv3N+rTDwvaz/d/WC58DJ5NfK/JB2doWwBh0Zcsdo8wIAv16miQ8 ZjZi1CdrbGGsq+s76hxL7NVLsiGpEVb9qJ9sBN7t1idPv4CvKLf9hA3zAfYNkjxOHDRY Se8mUOrcNEVXOClrFN/zQ2ZpAJh2JPJQKFEkDvyYbuVzR7ghPSGxT/glT/NgA0IQBYJ9 nmLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=isnPOqmDZmnqK2s4/8wotK2DAiXJa8GZjcExwan3XKA=; b=TjBk/8/UuMXSSOj6gBifbudRCXoj6XgF5ng/AhUUuZ83Obx5CJUx9mR6Z9Qb8ixN7b oNSs6uM/QshmZ1/iNroSfOTM1K+p5iKSCvHKBNVjMzJGkad8oprFnXI7PPVxK2vDHUBS 207RsOBDDNfZJ48htDHl1yQ3z2gBjAvyoo3TvxWNiTB0AF72he3jJslryTAhNTBzdSF+ gSVyDrYIqVNK6RakFwtC2XuoFnWhTRjVd4SlSttcsetsLS2zLEZFRshEBjSHP/hJniXT 1jarQ6ZxddddbBxJCsM7o1AP9DPbwo+vn0n8C9tkxl8+ojNmplnBBeps4w6nkLsbOtZr MbzA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r12si15788075pfd.193.2018.05.03.22.17.47; Thu, 03 May 2018 22:18:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751455AbeEDFRX (ORCPT + 99 others); Fri, 4 May 2018 01:17:23 -0400 Received: from mga06.intel.com ([134.134.136.31]:30967 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751417AbeEDFRU (ORCPT ); Fri, 4 May 2018 01:17:20 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 May 2018 22:17:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,361,1520924400"; d="scan'208";a="48196466" Received: from allen-box.sh.intel.com ([10.239.48.172]) by orsmga003.jf.intel.com with ESMTP; 03 May 2018 22:17:18 -0700 From: Lu Baolu To: Joerg Roedel , David Woodhouse Cc: ashok.raj@intel.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH 3/4] iommu/vt-d: Clean up pasid quirk for pre-production devices Date: Fri, 4 May 2018 13:08:18 +0800 Message-Id: <1525410499-18632-4-git-send-email-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525410499-18632-1-git-send-email-baolu.lu@linux.intel.com> References: <1525410499-18632-1-git-send-email-baolu.lu@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The pasid28 quirk is needed only for some pre-production devices. Remove it to make the code concise. Signed-off-by: Ashok Raj Signed-off-by: Lu Baolu --- drivers/iommu/intel-iommu.c | 32 ++------------------------------ include/linux/intel-iommu.h | 1 - 2 files changed, 2 insertions(+), 31 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 9064607..10bce33 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c @@ -485,37 +485,14 @@ static int dmar_forcedac; static int intel_iommu_strict; static int intel_iommu_superpage = 1; static int intel_iommu_ecs = 1; -static int intel_iommu_pasid28; static int iommu_identity_mapping; #define IDENTMAP_ALL 1 #define IDENTMAP_GFX 2 #define IDENTMAP_AZALIA 4 -/* Broadwell and Skylake have broken ECS support — normal so-called "second - * level" translation of DMA requests-without-PASID doesn't actually happen - * unless you also set the NESTE bit in an extended context-entry. Which of - * course means that SVM doesn't work because it's trying to do nested - * translation of the physical addresses it finds in the process page tables, - * through the IOVA->phys mapping found in the "second level" page tables. - * - * The VT-d specification was retroactively changed to change the definition - * of the capability bits and pretend that Broadwell/Skylake never happened... - * but unfortunately the wrong bit was changed. It's ECS which is broken, but - * for some reason it was the PASID capability bit which was redefined (from - * bit 28 on BDW/SKL to bit 40 in future). - * - * So our test for ECS needs to eschew those implementations which set the old - * PASID capabiity bit 28, since those are the ones on which ECS is broken. - * Unless we are working around the 'pasid28' limitations, that is, by putting - * the device into passthrough mode for normal DMA and thus masking the bug. - */ -#define ecs_enabled(iommu) (intel_iommu_ecs && ecap_ecs(iommu->ecap) && \ - (intel_iommu_pasid28 || !ecap_broken_pasid(iommu->ecap))) -/* PASID support is thus enabled if ECS is enabled and *either* of the old - * or new capability bits are set. */ -#define pasid_enabled(iommu) (ecs_enabled(iommu) && \ - (ecap_pasid(iommu->ecap) || ecap_broken_pasid(iommu->ecap))) +#define ecs_enabled(iommu) (intel_iommu_ecs && ecap_ecs(iommu->ecap)) +#define pasid_enabled(iommu) (ecs_enabled(iommu) && ecap_pasid(iommu->ecap)) int intel_iommu_gfx_mapped; EXPORT_SYMBOL_GPL(intel_iommu_gfx_mapped); @@ -578,11 +555,6 @@ static int __init intel_iommu_setup(char *str) printk(KERN_INFO "Intel-IOMMU: disable extended context table support\n"); intel_iommu_ecs = 0; - } else if (!strncmp(str, "pasid28", 7)) { - printk(KERN_INFO - "Intel-IOMMU: enable pre-production PASID support\n"); - intel_iommu_pasid28 = 1; - iommu_identity_mapping |= IDENTMAP_GFX; } else if (!strncmp(str, "tboot_noforce", 13)) { printk(KERN_INFO "Intel-IOMMU: not forcing on after tboot. This could expose security risk for tboot\n"); diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h index ef169d6..1df9401 100644 --- a/include/linux/intel-iommu.h +++ b/include/linux/intel-iommu.h @@ -121,7 +121,6 @@ #define ecap_srs(e) ((e >> 31) & 0x1) #define ecap_ers(e) ((e >> 30) & 0x1) #define ecap_prs(e) ((e >> 29) & 0x1) -#define ecap_broken_pasid(e) ((e >> 28) & 0x1) #define ecap_dis(e) ((e >> 27) & 0x1) #define ecap_nest(e) ((e >> 26) & 0x1) #define ecap_mts(e) ((e >> 25) & 0x1) -- 2.7.4