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 A6728C31E45 for ; Thu, 13 Jun 2019 16:25:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 774DD21721 for ; Thu, 13 Jun 2019 16:25:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560443110; bh=Atz/PVqdX2JmNW5ZQGp5ovEwbyHfj5+/BdW0PF7Ct24=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ENCggW4t6L7ZtTVVGW0ZDUBHbzra1vVgFjZTgR6OcsBlyaIOb7j8zmAFSzv7YpRTA GG2fpz7AAe3FWV8PheHZmK4i1FoKmdLc43gybJvCQ0c6UM8fMcMA8xCvYIY6ZUU8Om 6UHyb4qWImhnKYvTKpAKS0zLsA0NX5DB0ZlmVURU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732817AbfFMQYv (ORCPT ); Thu, 13 Jun 2019 12:24:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:54400 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730984AbfFMIg6 (ORCPT ); Thu, 13 Jun 2019 04:36:58 -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 E4A282133D; Thu, 13 Jun 2019 08:36:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560415017; bh=Atz/PVqdX2JmNW5ZQGp5ovEwbyHfj5+/BdW0PF7Ct24=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HhXdZenD5Ov3Gdwx3K2BMkV2MImNjXBEtTdU7nH5fBnMVEmabRS5+i/Y4NDAgpueU Rvth8CDc8iScu1+cfxGa76A8Lj/xuM6Ov+sW754Hn0aXTZKiXJPLESsGShRC3pwi3B K7gTSDKlOKch0gYzxx7R1Mqeh85LA9s4pPG8Znz8= 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.14 38/81] iommu/vt-d: Set intel_iommu_gfx_mapped correctly Date: Thu, 13 Jun 2019 10:33:21 +0200 Message-Id: <20190613075652.152591981@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190613075649.074682929@linuxfoundation.org> References: <20190613075649.074682929@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 fe935293fa7b..baa4c58e2736 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c @@ -4019,9 +4019,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) @@ -4807,6 +4805,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