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=-8.7 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 45012C31E45 for ; Thu, 13 Jun 2019 16:17:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 155652147A for ; Thu, 13 Jun 2019 16:17:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560442676; bh=UYMijLp0zxBkHqK1JsYG5jw946VoxxgiJ5vh7NL4dnA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=WZgoDaGOCDlFyBlRWokBai70fbL8qvfSJM/MKVAt8MmofaROBAzBMpIl/p7IHJ8mf ecpa4ye6UHKeEq5Lka4Tz48O4uuBygIpq8abpitCLQllyNPFeximiYWL0Nbb/Cn75w HpZOCiTpYjSVtCEn4relWr0pURddAdUDL3XcVdfc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731439AbfFMQRj (ORCPT ); Thu, 13 Jun 2019 12:17:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:58174 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731131AbfFMIkr (ORCPT ); Thu, 13 Jun 2019 04:40:47 -0400 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 B6EA220851; Thu, 13 Jun 2019 08:40:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560415247; bh=UYMijLp0zxBkHqK1JsYG5jw946VoxxgiJ5vh7NL4dnA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=soksqMRTmqlEtJ3+ASiuqhYNrbhvIN0FZUoqhA4q43To5UctwpiHFacPFiq19bOjr i1sLeLnZ6iQDRQTDJVRzEKCQ0f+rU8enRw31prhbzDnzntsv4w2aW7LqhKHxLFnS2m GyniGRbl46bwsq4+wHdopHbybqeFuPjzqXbjk6K0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ashok Raj , Jacob Pan , Kevin Tian , Zhenyu Wang , Lu Baolu , Joerg Roedel , Sasha Levin Subject: [PATCH 4.19 056/118] iommu/vt-d: Set intel_iommu_gfx_mapped correctly Date: Thu, 13 Jun 2019 10:33:14 +0200 Message-Id: <20190613075647.025932755@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190613075643.642092651@linuxfoundation.org> References: <20190613075643.642092651@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org [ Upstream commit cf1ec4539a50bdfe688caad4615ca47646884316 ] The intel_iommu_gfx_mapped flag is exported by the Intel IOMMU driver to indicate whether an IOMMU is used for the graphic device. In a virtualized IOMMU environment (e.g. QEMU), an include-all IOMMU is used for graphic device. This flag is found to be clear even the IOMMU is used. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Reported-by: Zhenyu Wang Fixes: c0771df8d5297 ("intel-iommu: Export a flag indicating that the IOMMU is used for iGFX.") Suggested-by: Kevin Tian Signed-off-by: Lu Baolu Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin --- drivers/iommu/intel-iommu.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 603bf5233a99..c1439019dd12 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c @@ -4033,9 +4033,7 @@ static void __init init_no_remapping_devices(void) /* This IOMMU has *only* gfx devices. Either bypass it or set the gfx_mapped flag, as appropriate */ - if (dmar_map_gfx) { - intel_iommu_gfx_mapped = 1; - } else { + if (!dmar_map_gfx) { drhd->ignored = 1; for_each_active_dev_scope(drhd->devices, drhd->devices_cnt, i, dev) @@ -4831,6 +4829,9 @@ int __init intel_iommu_init(void) goto out_free_reserved_range; } + if (dmar_map_gfx) + intel_iommu_gfx_mapped = 1; + init_no_remapping_devices(); ret = init_dmars(); -- 2.20.1