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=ham 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 63125C31E45 for ; Thu, 13 Jun 2019 16:01:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3930E20851 for ; Thu, 13 Jun 2019 16:01:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560441704; bh=afCK5zGqqQpwxMEyM0aoB+zKHWuGKOMX0iofDcLVGJQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=J5m1B0XFbEBn+ueyZXwuZCBzcF96CSvksgtmCa3zzXUvHvEni+LruluQCyeH3o2ly 0t8JsUd6Y2LDp+EH6eITZQTEDBJ/IZyuQmxVeDY42GHezjg0HVN9BP1NVZTPprHR1H jRIgpwKPOCguVTdZHS7dHG6/6UOycVdhil5/pJPw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390851AbfFMQBm (ORCPT ); Thu, 13 Jun 2019 12:01:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:36322 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731422AbfFMIsX (ORCPT ); Thu, 13 Jun 2019 04:48:23 -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 4E73121473; Thu, 13 Jun 2019 08:48:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560415702; bh=afCK5zGqqQpwxMEyM0aoB+zKHWuGKOMX0iofDcLVGJQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zHv5+45D7uAf8RrMuxRiHfro3YG2ZUv3D0MTMS+vFz0rGMLacsnNSdBKqnch2z9T6 fxvgRIvNjTulIzngYa32oYUyJLqV/mzDTzgj99KKOk797fYsmvzU1n8gPJ7HKpPgGR wVNuweEHHmuavrPZXbmRa4BbxYNVur9+Xqmew1Ng= 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 5.1 071/155] iommu/vt-d: Set intel_iommu_gfx_mapped correctly Date: Thu, 13 Jun 2019 10:33:03 +0200 Message-Id: <20190613075656.952056366@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190613075652.691765927@linuxfoundation.org> References: <20190613075652.691765927@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 [ 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 28cb713d728c..10a45092d062 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c @@ -4055,9 +4055,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) @@ -4896,6 +4894,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