From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 600CDC33CB3 for ; Thu, 16 Jan 2020 17:54:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3C8632469F for ; Thu, 16 Jan 2020 17:54:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579197266; bh=z1Lm0m6hZt5Ni8VOOKt1Tc2c5NPYc2/KfoYNtSoyMb0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ZRssUcvZjbANlH+4K5pxX4s2ntqpNrswGNSzxDe3YeDRIuGf243DyF35gaI/eA4Ho 2J5gIHW80JJstO1Ipt3Kq7tW7P4iw2Ws/lxKDv0lQvFhCvDZvSTpJYYKv+XHdutZOA ftZ67fVjh2ksaITLsOQ06YcFj3hnpNsldFBy7e4E= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405989AbgAPRyV (ORCPT ); Thu, 16 Jan 2020 12:54:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:35966 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405975AbgAPRou (ORCPT ); Thu, 16 Jan 2020 12:44:50 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 698BE24748; Thu, 16 Jan 2020 17:44:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579196689; bh=z1Lm0m6hZt5Ni8VOOKt1Tc2c5NPYc2/KfoYNtSoyMb0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vr49aP7XD5GquUNkHF+d8Po03Y7MIEMNHoMgSJ5UO040a8q/KA1Ph+12AvAWjYJu3 Se/QtUrlGDAUIoCwpgynr6LMGkGsYU4/vX4rclrD9zzcQLKkCgatAHGcaowzXweuFC uD5JUDN56S0Q9kY+7Db5WQpuOy2j2egBjIpWRss8= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Lu Baolu , Ashok Raj , Jacob Pan , Kevin Tian , Zhenyu Wang , Joerg Roedel , Sasha Levin , iommu@lists.linux-foundation.org Subject: [PATCH AUTOSEL 4.4 085/174] iommu/vt-d: Make kernel parameter igfx_off work with vIOMMU Date: Thu, 16 Jan 2020 12:41:22 -0500 Message-Id: <20200116174251.24326-85-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200116174251.24326-1-sashal@kernel.org> References: <20200116174251.24326-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Lu Baolu [ Upstream commit 5daab58043ee2bca861068e2595564828f3bc663 ] The kernel parameter igfx_off is used by users to disable DMA remapping for the Intel integrated graphic device. It was designed for bare metal cases where a dedicated IOMMU is used for graphic. This doesn't apply to virtual IOMMU case where an include-all IOMMU is used. This makes the kernel parameter work with virtual IOMMU as well. Cc: Ashok Raj Cc: Jacob Pan Suggested-by: Kevin Tian Fixes: c0771df8d5297 ("intel-iommu: Export a flag indicating that the IOMMU is used for iGFX.") Signed-off-by: Lu Baolu Tested-by: Zhenyu Wang Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin --- drivers/iommu/intel-iommu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index b965561a4162..a2005b82ec8f 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c @@ -3259,9 +3259,12 @@ static int __init init_dmars(void) iommu_identity_mapping |= IDENTMAP_ALL; #ifdef CONFIG_INTEL_IOMMU_BROKEN_GFX_WA - iommu_identity_mapping |= IDENTMAP_GFX; + dmar_map_gfx = 0; #endif + if (!dmar_map_gfx) + iommu_identity_mapping |= IDENTMAP_GFX; + check_tylersburg_isoch(); if (iommu_identity_mapping) { -- 2.20.1