Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp406027pxu; Tue, 1 Dec 2020 14:27:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJyzbCLwQHPnK381CrPGHCMi98eNWP0SWEdxHvntXFCQ3rg7LKJjtt9zuDeIIvdfoGg6oEwy X-Received: by 2002:a17:906:edc4:: with SMTP id sb4mr3169172ejb.21.1606861641909; Tue, 01 Dec 2020 14:27:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606861641; cv=none; d=google.com; s=arc-20160816; b=BVX2aLAS3pJB1Ir0GGyP5SIi5TYMcHW/EFYgltn5fg+X6wr+6gMmSHAybgiXcL0lqc NNEazJbY/4Ahz++UHwGq0ufAevxr0RAzYjL8gNPA+Kj0N2dVHESkmTIVaGIXxfinfyM5 tRc6g5iT2wY2UrtU7MN26TVcnl4khGxIiohiS79+rcOW4RG0c9ukGwm/QwjPyoyR3/kb SqjSY72SprMCew1kHD3EU+aFhKi+zzYwghIMgxtv7aFIjmvWN6KMJxNOmhdWCCJGdFz5 sg762MeC6/nktxPebAXp24KPfDqC7it1HmAi0WNtgA8/hJ5dTPkAiffcKQVVqvuYHgvo a2fA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=78YTRHwkfESdT0PUkIA8X9mAj1PryAxHZd1D41Esa9I=; b=OBd/NVNmwWiy94HVi9wra9MOfz5DWitPQTvDbxYEJi4U2Y8RFXS8nwgZgEr5urX+GG sTSzjl34aYlAMmW53ua7z8Xsfr6UpkMpCf+nJARzX/lVbO0rePQYtVSwUdQNGwh/a9GC n6KXMwYzL0OjtcAEh/zB32a2dhioW0YV60RzRFg9SuVyeF4MyMZEzlZ6VrgdTPknN8x5 uXk5G/FAGljOSTSaSje7dtYqk6JsQyz3Anwd+iR9Mh2+qn7QTcb3tFuq0chNqndjg3fK 0PFnOK+oS0x1wb3apL0JPL2ed61ZxOGdfj3NsGDg8eSWMkPF4fmmYhFLUQPTqbBMsLXK hObg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RPv8+Vx9; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u22si755788edx.500.2020.12.01.14.26.59; Tue, 01 Dec 2020 14:27:21 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RPv8+Vx9; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390027AbgLAJM4 (ORCPT + 99 others); Tue, 1 Dec 2020 04:12:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:50318 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390022AbgLAJMx (ORCPT ); Tue, 1 Dec 2020 04:12:53 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 31C5420770; Tue, 1 Dec 2020 09:12:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606813957; bh=M+XAIcM5levjL+hXw4vdea57kjm6p9vwSMf2RP4oqpk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RPv8+Vx9xmrnhIxiuiJoXGfaBjj28Emp3IU67/tslv/NIJ7djNweZQPBXgk5PJVcU SLsQlmdCRCNL1ECNRrtrVl+8YI1RqXsEdnJm3c3SgG08Mz1ZJbZ5FYPJA5jr1l+8rB 04wmqrK/rCo6BHdctuayeBKTQK4llZVm++TnV0os= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lu Baolu , Will Deacon , Sasha Levin , Adrian Huang Subject: [PATCH 5.9 118/152] x86/tboot: Dont disable swiotlb when iommu is forced on Date: Tue, 1 Dec 2020 09:53:53 +0100 Message-Id: <20201201084727.257311425@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201201084711.707195422@linuxfoundation.org> References: <20201201084711.707195422@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lu Baolu [ Upstream commit e2be2a833ab5338fa5b8b99ba622b911d96f1795 ] After commit 327d5b2fee91c ("iommu/vt-d: Allow 32bit devices to uses DMA domain"), swiotlb 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: 327d5b2fee91 ("iommu/vt-d: Allow 32bit devices to uses DMA domain") Reported-and-tested-by: Adrian Huang Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20201125014124.4070776-1-baolu.lu@linux.intel.com Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=210237 Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- 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 420be871d9d45..ae64f98ec2ab6 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.27.0