Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp47152pxu; Tue, 24 Nov 2020 18:10:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJyrOhfpFph/q9bg99dSCT/aY9R8EnpJCwrQzD2spUSZ/paHXQWa9D0Yrr7BUawoNIwsGUof X-Received: by 2002:a05:6402:656:: with SMTP id u22mr1424243edx.199.1606270249229; Tue, 24 Nov 2020 18:10:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606270249; cv=none; d=google.com; s=arc-20160816; b=z+YhSmXL0dEGkIXvUvU/tl8bYnuGCyWiSroErc0tXEhrkPeeGK5+XRtshvrmBaJAX6 b3AXI0OdDYx2GxCWoLXO0WSowP8u5VbJMFwBLcjVPuuFwDzn1ru/ulgoBEeZHjiplQSf Ivtx+WW4euo6LFPJ1U/UG2bNoqmV9+uWQWPHgrQApyHDWdBQatHbbnEztBFjjBdIAIjq irECRGsKa3ZqxgXIC+oXrC5B+N+reJEFuW14U+yrAGkpmDG75jxN9flBkpwBGPIRvHjV /shVTo0PtnKlkbnZXw1DnFYeSu8XjkC26Mgpw8m5fJHoo0pKDM7l4P+OgfcxSPoSxdUD +X/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=cofDiaQokA1440F+wbgSSay2Ji/k5IcsqZPHA/ICWho=; b=c2cLtk9/oUNEX3mZjaXz4w3gIBI9hIsco2j4dVFG2YqBEUC+vEIZxUYYd439Rca5Nn KkxpEQksT8fmoPqJjXmA7/rfJNP1n5Zy6GsdDmlNrwdFu1F/EGDf2POke3xX1nxNfMG9 jwcdOA1V2PvKfNXTpkubYxZ0Ur7Ee8/Wjho0sERV7CQr53x0LtZPVQbrUDK8jgPi2On1 kH304LkRtMv33v2XtFQE/0yi0dYHbAASrOhEPtNDIpYTitAI/BYvlrs8STmHY/n7i236 wcwGXCpl0nJmwFtKsG4zhgREianA0TtLw+bSYyq7i+tKKmaJfgRpLSDis+2IfAbHLoVw KMJQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w9si454569ejj.45.2020.11.24.18.10.26; Tue, 24 Nov 2020 18:10:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726489AbgKYBsz (ORCPT + 99 others); Tue, 24 Nov 2020 20:48:55 -0500 Received: from mga05.intel.com ([192.55.52.43]:2112 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725320AbgKYBsy (ORCPT ); Tue, 24 Nov 2020 20:48:54 -0500 IronPort-SDR: anhyO9rGCMTUmEgAPkSrTfHIZYqJTOSDkekdu4/6Na6Xk53hBI8I1oOf7fNW3Q5EiKjqieI0aG y6hShEYYxKkQ== X-IronPort-AV: E=McAfee;i="6000,8403,9815"; a="256756524" X-IronPort-AV: E=Sophos;i="5.78,367,1599548400"; d="scan'208";a="256756524" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2020 17:48:53 -0800 IronPort-SDR: lLsI0hy9SsZX2QlnfXuv70HYqqiD3wE1AuChYo9GDZOlaJotK29qLJ3gTU5hLWAIPRKVFLktWB TimRb0p8obLw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,367,1599548400"; d="scan'208";a="536689747" Received: from allen-box.sh.intel.com ([10.239.159.28]) by fmsmga005.fm.intel.com with ESMTP; 24 Nov 2020 17:48:51 -0800 From: Lu Baolu To: Ning Sun , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Will Deacon , Joerg Roedel Cc: Ashok Raj , x86@kernel.org, tboot-devel@lists.sourceforge.net, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Lu Baolu , Adrian Huang Subject: [PATCH 1/1] x86/tboot: Don't disable swiotlb when iommu is forced on Date: Wed, 25 Nov 2020 09:41:24 +0800 Message-Id: <20201125014124.4070776-1-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After commit 327d5b2fee91c ("iommu/vt-d: Allow 32bit devices to uses DMA domain"), swiotbl could also be used for direct memory access if IOMMU is enabled but a device is configured to pass through the DMA translation. Keep swiotlb when IOMMU is forced on, otherwise, some devices won't work if "iommu=pt" kernel parameter is used. Fixes: 327d5b2fee91c ("iommu/vt-d: Allow 32bit devices to uses DMA domain") Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=210237 Reported-and-tested-by: Adrian Huang Signed-off-by: Lu Baolu --- arch/x86/kernel/tboot.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c index 420be871d9d4..ae64f98ec2ab 100644 --- a/arch/x86/kernel/tboot.c +++ b/arch/x86/kernel/tboot.c @@ -514,13 +514,10 @@ int tboot_force_iommu(void) if (!tboot_enabled()) return 0; - if (no_iommu || swiotlb || dmar_disabled) + if (no_iommu || dmar_disabled) pr_warn("Forcing Intel-IOMMU to enabled\n"); dmar_disabled = 0; -#ifdef CONFIG_SWIOTLB - swiotlb = 0; -#endif no_iommu = 0; return 1; -- 2.25.1