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.8 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 6526CC48BE3 for ; Thu, 20 Jun 2019 18:33:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 365162082C for ; Thu, 20 Jun 2019 18:33:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561055581; bh=qD7rRMlMkGFzEViLQsXquczuXA6clGsZX22a62qL9EI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=qPPdXWq4HDAtSEcguuXkmQN7rzHFoSDnF029xO2G5Fwij0p2uWl9DVcr1XkStjBQZ 5BCLJEcORtQBJNIs+Tovm4R2jgiGao+QJAzkmqWB5OGmc8TzcdvDQk0BJHI7bhwWTr Zkph9y9I/AUcKpGOlu3DWjFXJ0WhJBsVoMfwWL9E= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726134AbfFTR6e (ORCPT ); Thu, 20 Jun 2019 13:58:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:45318 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726127AbfFTR6e (ORCPT ); Thu, 20 Jun 2019 13:58:34 -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 245F32147A; Thu, 20 Jun 2019 17:58:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561053513; bh=qD7rRMlMkGFzEViLQsXquczuXA6clGsZX22a62qL9EI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LB9vppZjcCB6qbEf5zhK5gVFgKwikr/xp7joiAI/ytwL/b/eRdray5HPj6lRjPDyo qYBK065GYFiD4dNm+ThXHrKxKYKkbK3rcE5BTH90CJZ+zbjJhW3dCSncUIxgsWlsf6 j0T2Zn7U/w31+eTBxKU6/Ic1FTQR+nYg882wZfDs= 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.4 15/84] iommu/vt-d: Set intel_iommu_gfx_mapped correctly Date: Thu, 20 Jun 2019 19:56:12 +0200 Message-Id: <20190620174339.749730162@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190620174337.538228162@linuxfoundation.org> References: <20190620174337.538228162@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 3e97c4b2ebed..b965561a4162 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c @@ -3983,9 +3983,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) @@ -4694,6 +4692,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