Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp483767ybl; Tue, 28 Jan 2020 06:40:17 -0800 (PST) X-Google-Smtp-Source: APXvYqzpk8SbdywRke4zOJOO0vssubOaUDrI5KwdrRmi3pmJMJhzgS7oM6jLgRFcLbvUTie9gU/2 X-Received: by 2002:a9d:6a90:: with SMTP id l16mr9290604otq.353.1580222417672; Tue, 28 Jan 2020 06:40:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580222417; cv=none; d=google.com; s=arc-20160816; b=IvFfFdAoNk5quqehAisjJ+5uLP1bObVRCcD7+rjd9dHF0ngJst+mgXFFhQ+hhT6RBG rYa7iPNx9563HBfEpHNU5XNlkRTmHr94ZGWy32Lfr/zQm+z4+NHTKZTStTFYKeDex3TN /L02c60qiqfuqh6uZBsGuu7fl31fIVJt1QNnqHMA/gXzBPq+zC0VVwq50vEw2vJSLApy T5vQcox2suvu2LgZsOntg9JlB6anrEEhORZomqYYSKcRsnEe/TSCq0i6QRTw/Yo/ypOi DdrxHqykj0sjsTWsdb1AB+kELLXiIiSXmcRcrNiZtFIxNb8HdawzSxeNakio4uctVl5O 8WJA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5OuQDgPNPDbQkqMgdicmgcprurS6VeM3giSQCgS9+qc=; b=SqCZCwJbNzaRDT9QzZ+RXEda4o03kJ7ddg/KiKif+pZlqn6apWSCkR+k4AIA7rLmQ1 qphEMxiLBQ2UkE+PM3ROeGmDTGuYvSKyBBs7j5WjgtomydI3aN3oQmYDRYqKyk71PDa8 VTqwrAzbkBdNwriVkrx83CIwW8AQ6elA4QykCgZfifzMUXi2XCJkp4dVj7oTFA/FsPwZ ytOfgaMaIfmV9B6XzRXjUL3mBt4TFyw5pGbjSmHYXkkLZ0oyHTFKHci9WP8RmqS0TExn 6bqbAcb3AUNUx7l2sO2z865uQRtEfP2gqsHROD9gl9sN7Q3LReZwevG+UFUAgAL9qFZI 8KkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UXBI2FeT; 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 16si7132489oth.99.2020.01.28.06.40.06; Tue, 28 Jan 2020 06:40:17 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=UXBI2FeT; 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 S1730785AbgA1OUF (ORCPT + 99 others); Tue, 28 Jan 2020 09:20:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:44596 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730977AbgA1OT7 (ORCPT ); Tue, 28 Jan 2020 09:19:59 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 4BB5C2071E; Tue, 28 Jan 2020 14:19:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580221198; bh=nSP8sb8U6UsTtSCBrxZasHOtuaL9If0F0xYS33SxkBE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UXBI2FeTYxfpyM6ozK+u16T/nyBPlgNrNj01l+kBvnGsfREVToHj2YATT8OXOFF2N Vh445j4HeLAaEAEWJnA37xKcyeFy3JWnJoc4QtErRb9XkK6ihjnKVicYr/+7XMm7LV /jA3+NzRDaTV8FaGKmHNjN1HaQqoK+4UFFHSuNBM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ashok Raj , Jacob Pan , Kevin Tian , Lu Baolu , Zhenyu Wang , Joerg Roedel , Sasha Levin Subject: [PATCH 4.9 128/271] iommu/vt-d: Make kernel parameter igfx_off work with vIOMMU Date: Tue, 28 Jan 2020 15:04:37 +0100 Message-Id: <20200128135902.127906391@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135852.449088278@linuxfoundation.org> References: <20200128135852.449088278@linuxfoundation.org> User-Agent: quilt/0.66 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 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 25cc6ae87039d..5c6e0a9fd2f36 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c @@ -3345,9 +3345,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