From nobody Sun Jun 14 17:43:25 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E7AFC433EF for ; Sat, 14 May 2022 02:59:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231165AbiENC7L (ORCPT ); Fri, 13 May 2022 22:59:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230419AbiENC6B (ORCPT ); Fri, 13 May 2022 22:58:01 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86E852DD1EB for ; Fri, 13 May 2022 18:46:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652492802; x=1684028802; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VEv3FSPSgIXzTD6OswoTPktFlXlfBLKoUGoPMD7VvYY=; b=OxBFZvLXwcrTcCVwe3hDaOI034nE76ZJcJIiqLaLwL4jVLTg3zrLwAeB in9CYpEsZDxw+C2zNU3lrWGlp7zIFlzZi2Bon9L5tH9k0rGkwMU6BbdnD Gqug2SmuvRkanq+UfcbEuE07rqgLMt+RqX7zbFlpbDowcUqgFjhvrgLwk OnAxwqeNbE/cKauFJ+vWyF35yc+3d6OBfLqNCJkeDWKpgr/Lmb0AF5y3T OYCvJgTjaUHTkq25VkngieOO77JguNgZ5wrwlpGGr8RnInWnIAg85DLzi wuhTz53XOp7UfpVXMjpqQDz44rlZLkvGYK6mycKd518Wh+dQoKYMHCpCJ A==; X-IronPort-AV: E=McAfee;i="6400,9594,10346"; a="250977523" X-IronPort-AV: E=Sophos;i="5.91,223,1647327600"; d="scan'208";a="250977523" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2022 18:46:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,223,1647327600"; d="scan'208";a="712630770" Received: from allen-box.sh.intel.com ([10.239.159.48]) by fmsmga001.fm.intel.com with ESMTP; 13 May 2022 18:46:36 -0700 From: Lu Baolu To: Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Paolo Bonzini , David Airlie , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Daniel Vetter , Kevin Tian , Ashok Raj , Liu Yi L , Jacob Pan , Ning Sun Cc: Will Deacon , Robin Murphy , Jason Gunthorpe , Christoph Hellwig , Steve Wahl , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH 1/7] iommu/vt-d: Move trace/events/intel_iommu.h under iommu Date: Sat, 14 May 2022 09:43:16 +0800 Message-Id: <20220514014322.2927339-2-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220514014322.2927339-1-baolu.lu@linux.intel.com> References: <20220514014322.2927339-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This header file is private to the Intel IOMMU driver. Move it to the driver folder. Signed-off-by: Lu Baolu Reviewed-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Reviewed-by: Steve Wahl --- .../trace/events/intel_iommu.h =3D> drivers/iommu/intel/trace.h | 4 ++++ drivers/iommu/intel/dmar.c | 2 +- drivers/iommu/intel/svm.c | 2 +- drivers/iommu/intel/trace.c | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) rename include/trace/events/intel_iommu.h =3D> drivers/iommu/intel/trace.h= (94%) diff --git a/include/trace/events/intel_iommu.h b/drivers/iommu/intel/trace= .h similarity index 94% rename from include/trace/events/intel_iommu.h rename to drivers/iommu/intel/trace.h index e5c1ca6d16ee..25cb7f88e1a2 100644 --- a/include/trace/events/intel_iommu.h +++ b/drivers/iommu/intel/trace.h @@ -91,4 +91,8 @@ TRACE_EVENT(prq_report, #endif /* _TRACE_INTEL_IOMMU_H */ =20 /* This part must be outside protection */ +#undef TRACE_INCLUDE_PATH +#undef TRACE_INCLUDE_FILE +#define TRACE_INCLUDE_PATH ../../drivers/iommu/intel/ +#define TRACE_INCLUDE_FILE trace #include diff --git a/drivers/iommu/intel/dmar.c b/drivers/iommu/intel/dmar.c index 4de960834a1b..b02d72097a8c 100644 --- a/drivers/iommu/intel/dmar.c +++ b/drivers/iommu/intel/dmar.c @@ -31,10 +31,10 @@ #include #include #include -#include =20 #include "../irq_remapping.h" #include "perf.h" +#include "trace.h" =20 typedef int (*dmar_res_handler_t)(struct acpi_dmar_header *, void *); struct dmar_res_callback { diff --git a/drivers/iommu/intel/svm.c b/drivers/iommu/intel/svm.c index 7ee37d996e15..70b40d007a52 100644 --- a/drivers/iommu/intel/svm.c +++ b/drivers/iommu/intel/svm.c @@ -21,11 +21,11 @@ #include #include #include -#include =20 #include "pasid.h" #include "perf.h" #include "../iommu-sva-lib.h" +#include "trace.h" =20 static irqreturn_t prq_event_thread(int irq, void *d); static void intel_svm_drain_prq(struct device *dev, u32 pasid); diff --git a/drivers/iommu/intel/trace.c b/drivers/iommu/intel/trace.c index bfb6a6e37a88..117e626e3ea9 100644 --- a/drivers/iommu/intel/trace.c +++ b/drivers/iommu/intel/trace.c @@ -11,4 +11,4 @@ #include =20 #define CREATE_TRACE_POINTS -#include +#include "trace.h" --=20 2.25.1 From nobody Sun Jun 14 17:43:25 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA267C433FE for ; Sat, 14 May 2022 02:59:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230375AbiENC7A (ORCPT ); Fri, 13 May 2022 22:59:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231226AbiENC6C (ORCPT ); Fri, 13 May 2022 22:58:02 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D88DC199492 for ; Fri, 13 May 2022 18:46:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652492807; x=1684028807; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wuco7zHOI8upW/toCZeZhBQ9k0tR0YA88Idt0JHdMVY=; b=LvVuezdvRNL14aeBxlRTemOXZfCJemHdEPDGreXaBwBWCGBEM3J3uEnp mBmSidITX+nPmpD8HkXbbqD9dCY0XfZ/s/lXDE9M5D8oP7JFaWkDxOyEf lFy69cp1j9d6K4pBiQJ34nopQVyDcX1Np+uC/wMupQmMbAqdjVXl24PiD UyXy95N7K8Wa4/fm25Av+LEdP4YO8/yAImJDZcv7rgPUiwKLEAUOwam1k GGEA03ZQkzs3PKCO/tAhcViAiF3hiBRaDaRMKEGxx2ygw4Ew2cwGD3+UP zK+/hu7TuiqWEiFs+B51j1nygiqL3ptX9wzI3pDgO/J+9sJkZUNxdlGq1 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10346"; a="270581939" X-IronPort-AV: E=Sophos;i="5.91,223,1647327600"; d="scan'208";a="270581939" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2022 18:46:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,223,1647327600"; d="scan'208";a="712630780" Received: from allen-box.sh.intel.com ([10.239.159.48]) by fmsmga001.fm.intel.com with ESMTP; 13 May 2022 18:46:42 -0700 From: Lu Baolu To: Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Paolo Bonzini , David Airlie , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Daniel Vetter , Kevin Tian , Ashok Raj , Liu Yi L , Jacob Pan , Ning Sun Cc: Will Deacon , Robin Murphy , Jason Gunthorpe , Christoph Hellwig , Steve Wahl , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH 2/7] agp/intel: Use per device iommu check Date: Sat, 14 May 2022 09:43:17 +0800 Message-Id: <20220514014322.2927339-3-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220514014322.2927339-1-baolu.lu@linux.intel.com> References: <20220514014322.2927339-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The IOMMU subsystem has already provided an interface to query whether the IOMMU hardware is enabled for a specific device. This changes the check from Intel specific intel_iommu_gfx_mapped (globally exported by the Intel IOMMU driver) to probing the presence of IOMMU on a specific device using the generic device_iommu_mapped(). This follows commit cca084692394a ("drm/i915: Use per device iommu check") which converted drm/i915 driver to use device_iommu_mapped(). Signed-off-by: Lu Baolu Reviewed-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Reviewed-by: Steve Wahl --- drivers/char/agp/intel-gtt.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c index 79a1b65527c2..cfcb450e9b59 100644 --- a/drivers/char/agp/intel-gtt.c +++ b/drivers/char/agp/intel-gtt.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include "agp.h" @@ -573,18 +573,15 @@ static void intel_gtt_cleanup(void) */ static inline int needs_ilk_vtd_wa(void) { -#ifdef CONFIG_INTEL_IOMMU const unsigned short gpu_devid =3D intel_private.pcidev->device; =20 - /* Query intel_iommu to see if we need the workaround. Presumably that - * was loaded first. + /* + * Query iommu subsystem to see if we need the workaround. Presumably + * that was loaded first. */ - if ((gpu_devid =3D=3D PCI_DEVICE_ID_INTEL_IRONLAKE_D_IG || - gpu_devid =3D=3D PCI_DEVICE_ID_INTEL_IRONLAKE_M_IG) && - intel_iommu_gfx_mapped) - return 1; -#endif - return 0; + return ((gpu_devid =3D=3D PCI_DEVICE_ID_INTEL_IRONLAKE_D_IG || + gpu_devid =3D=3D PCI_DEVICE_ID_INTEL_IRONLAKE_M_IG) && + device_iommu_mapped(&intel_private.pcidev->dev)); } =20 static bool intel_gtt_can_wc(void) --=20 2.25.1 From nobody Sun Jun 14 17:43:25 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1965C433F5 for ; Sat, 14 May 2022 02:58:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231363AbiENC6W (ORCPT ); Fri, 13 May 2022 22:58:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231351AbiENC5B (ORCPT ); Fri, 13 May 2022 22:57:01 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4FD52FB3C1 for ; Fri, 13 May 2022 18:46:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652492813; x=1684028813; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GVIFpAO5j7ORaurQGDRjDYzb8qL8hcHPBhy8miD32r0=; b=hznMXTRvVcBO+iuQ7uN6+XOIPcAcVvBZZWFOKBGzlbcOtKbyM/aWx7KH UZOqIY4i3xNf4FF98ZZkPSkUJqmtbyfZjBdOHM5Z9WaopG+wh6ngnBz70 aIY/kthA5+b2UfFH1BZfCX8k/sxI6fH8UUKhWiLxyLhF98tckFWaOw8bO yH25B+An0cE/mcw/QVhZ7qXLHMzhZSEs2T8/H0A+SuJsfk6LYJV0flG1R vHAoYdEjWxMPdbwIUagWWvl+gi2d+MMgyzYSLF/OG0ieXkNNL/9CBdB7B F2HwXdzHKFXZVq/SgV/tA4r0PKS7Kd/f2zDf1yIU3K37GfhWUlcY2YAU6 Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10346"; a="250358171" X-IronPort-AV: E=Sophos;i="5.91,223,1647327600"; d="scan'208";a="250358171" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2022 18:46:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,223,1647327600"; d="scan'208";a="712630795" Received: from allen-box.sh.intel.com ([10.239.159.48]) by fmsmga001.fm.intel.com with ESMTP; 13 May 2022 18:46:47 -0700 From: Lu Baolu To: Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Paolo Bonzini , David Airlie , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Daniel Vetter , Kevin Tian , Ashok Raj , Liu Yi L , Jacob Pan , Ning Sun Cc: Will Deacon , Robin Murphy , Jason Gunthorpe , Christoph Hellwig , Steve Wahl , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH 3/7] iommu/vt-d: Remove unnecessary exported symbol Date: Sat, 14 May 2022 09:43:18 +0800 Message-Id: <20220514014322.2927339-4-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220514014322.2927339-1-baolu.lu@linux.intel.com> References: <20220514014322.2927339-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The exported symbol intel_iommu_gfx_mapped is not used anywhere in the tree. Remove it to avoid dead code. Signed-off-by: Lu Baolu Reviewed-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Reviewed-by: Steve Wahl --- include/linux/intel-iommu.h | 1 - drivers/iommu/intel/iommu.c | 6 ------ 2 files changed, 7 deletions(-) diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h index 4f29139bbfc3..0f9df5a19ef7 100644 --- a/include/linux/intel-iommu.h +++ b/include/linux/intel-iommu.h @@ -790,7 +790,6 @@ extern int iommu_calculate_agaw(struct intel_iommu *iom= mu); extern int iommu_calculate_max_sagaw(struct intel_iommu *iommu); extern int dmar_disabled; extern int intel_iommu_enabled; -extern int intel_iommu_gfx_mapped; #else static inline int iommu_calculate_agaw(struct intel_iommu *iommu) { diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c index e56b3a4b6998..744af407d0da 100644 --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -314,9 +314,6 @@ static int iommu_skip_te_disable; #define IDENTMAP_GFX 2 #define IDENTMAP_AZALIA 4 =20 -int intel_iommu_gfx_mapped; -EXPORT_SYMBOL_GPL(intel_iommu_gfx_mapped); - DEFINE_SPINLOCK(device_domain_lock); static LIST_HEAD(device_domain_list); =20 @@ -4117,9 +4114,6 @@ int __init intel_iommu_init(void) if (list_empty(&dmar_satc_units)) pr_info("No SATC found\n"); =20 - if (dmar_map_gfx) - intel_iommu_gfx_mapped =3D 1; - init_no_remapping_devices(); =20 ret =3D init_dmars(); --=20 2.25.1 From nobody Sun Jun 14 17:43:25 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB902C433F5 for ; Sat, 14 May 2022 02:58:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231312AbiENC6N (ORCPT ); Fri, 13 May 2022 22:58:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231614AbiENC5B (ORCPT ); Fri, 13 May 2022 22:57:01 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 598EF2FCF32 for ; Fri, 13 May 2022 18:46:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652492819; x=1684028819; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KozZnrzYJ+0UFKmzjAu1U8Z4jZPTgTst8scozy/7ge4=; b=TmghDWk5tOHj020pqWxmaQ6uZU3iYV6Hd521KYNRC5XUaDY+R2AjxQ2Q jiA/h0WWzlHiM++m82pNel9w95az0D4+hf8EPv45K1gjXT83PMijxIdYP n2uJ1BY4cwYnK3Jl73dRBU1mOpKeGiBqjG1zx2AvgdoO8Ey294zlh0Tt+ NW3xswwxvphR5gFzT9A8WLY5uhvDwqt5ZVuo9IAA2wzby9vmpHVu1tJXb vO6dpKEcocCkH1PHvOaEPrq0G4m674Xpmz9VFHAx9DkgogwfllvxD1yUp L9bhrcB/lLX9lmYVTg65KBVYxl55owLbrMSjl36/pkJizOO47UgzVYoZy A==; X-IronPort-AV: E=McAfee;i="6400,9594,10346"; a="270126964" X-IronPort-AV: E=Sophos;i="5.91,223,1647327600"; d="scan'208";a="270126964" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2022 18:46:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,223,1647327600"; d="scan'208";a="712630801" Received: from allen-box.sh.intel.com ([10.239.159.48]) by fmsmga001.fm.intel.com with ESMTP; 13 May 2022 18:46:53 -0700 From: Lu Baolu To: Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Paolo Bonzini , David Airlie , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Daniel Vetter , Kevin Tian , Ashok Raj , Liu Yi L , Jacob Pan , Ning Sun Cc: Will Deacon , Robin Murphy , Jason Gunthorpe , Christoph Hellwig , Steve Wahl , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH 4/7] drm/i915: Remove unnecessary include Date: Sat, 14 May 2022 09:43:19 +0800 Message-Id: <20220514014322.2927339-5-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220514014322.2927339-1-baolu.lu@linux.intel.com> References: <20220514014322.2927339-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org intel-iommu.h is not needed in drm/i915 anymore. Remove its include. Signed-off-by: Lu Baolu Acked-by: Jani Nikula Reviewed-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Reviewed-by: Steve Wahl --- drivers/gpu/drm/i915/i915_drv.h | 1 - drivers/gpu/drm/i915/display/intel_display.c | 1 - drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 1 - 3 files changed, 3 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_dr= v.h index fa14da84362e..f2a6982c3bef 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -36,7 +36,6 @@ =20 #include #include -#include #include =20 #include diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm= /i915/display/intel_display.c index 7dfeb458aa65..686ddbeebadc 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/d= rm/i915/gem/i915_gem_execbuffer.c index d42f437149c9..c9823528ea94 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c @@ -4,7 +4,6 @@ * Copyright =C2=A9 2008,2010 Intel Corporation */ =20 -#include #include #include #include --=20 2.25.1 From nobody Sun Jun 14 17:43:25 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 120D4C433F5 for ; Sat, 14 May 2022 02:58:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230135AbiENC6H (ORCPT ); Fri, 13 May 2022 22:58:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231622AbiENC5B (ORCPT ); Fri, 13 May 2022 22:57:01 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37EC6300EE4 for ; Fri, 13 May 2022 18:47:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652492824; x=1684028824; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XbwqW8vSlHbl+VRBpjcHQ0sS7eNwoXn7JqpMKEUCRQ8=; b=Lyd3KiEc30gC9qTFaah9sF9FJjZ8NKm7CpwKtqrj928E3ujAVpG5BcsV C+nNqQ6z1whMa0JCGg0I/EO2eUj1cj5sMB1obNeWwUpNqCPBtvEbfn0n+ 6WPG5joEKBjkQlJ1BKXwTdqifk0DJKaEdIpplX3s1hr/Qr3RVTU9g2aLa KW9eNThy7lOwc830hXxxa47F1TEC2JrcUWpsf/jW29kjxSZc7T0CLzZEO yKH2Pk3T5qdhLPkKmxrTjYAfHyFZ03pjvWX4ev7+eALhws690lWglvgSh zpvdNmhV+JTqdtEM7htC6pqyHTh0PLKUUbR3fPPwv8fw2oyoqbB3JMGSz Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10346"; a="270126976" X-IronPort-AV: E=Sophos;i="5.91,223,1647327600"; d="scan'208";a="270126976" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2022 18:47:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,223,1647327600"; d="scan'208";a="712630812" Received: from allen-box.sh.intel.com ([10.239.159.48]) by fmsmga001.fm.intel.com with ESMTP; 13 May 2022 18:46:58 -0700 From: Lu Baolu To: Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Paolo Bonzini , David Airlie , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Daniel Vetter , Kevin Tian , Ashok Raj , Liu Yi L , Jacob Pan , Ning Sun Cc: Will Deacon , Robin Murphy , Jason Gunthorpe , Christoph Hellwig , Steve Wahl , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH 5/7] KVM: x86: Remove unnecessary include Date: Sat, 14 May 2022 09:43:20 +0800 Message-Id: <20220514014322.2927339-6-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220514014322.2927339-1-baolu.lu@linux.intel.com> References: <20220514014322.2927339-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" intel-iommu.h is not needed in kvm/x86 anymore. Remove its include. Signed-off-by: Lu Baolu Reviewed-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Reviewed-by: Steve Wahl --- arch/x86/kvm/x86.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 4790f0d7d40b..fdf6ce5855d9 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include --=20 2.25.1 From nobody Sun Jun 14 17:43:25 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72E4DC433EF for ; Sat, 14 May 2022 02:58:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230184AbiENC6d (ORCPT ); Fri, 13 May 2022 22:58:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231616AbiENC5B (ORCPT ); Fri, 13 May 2022 22:57:01 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2D6E3A2539 for ; Fri, 13 May 2022 18:47:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652492829; x=1684028829; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=v3kPt++FiQ9ARnwZa6X+VCG2cZHcHXHj7nyunngZA8s=; b=gVV2fmw7+XSUAA+RPpZUTwqXiqCfx28egKZIWy7WX+aHtqrVHLBEzeI1 G7EPLf8BWZsvND16aNehslH7+rD9UKVtasrK4YoKqlIhY9KzkfmKo3NZg pF9dtFcte8QINLbobVbDqdBAv6a4EB+nXYghThwEbLJq5Hcses+aKgvjy Pz2kISGI8Hctj4XCiAfiNxo0YlhMnM3K/aXrMpLOHlGHFDzuIjvbuJTF1 UnuilzoQks66zT1WSow783wEpIkqgLfnCjU02iK7czBKOcy7oYTfTPfoO ByhdmSJcehXCHo4zvBzyU9QKVG5O1fndmWGxPisOAShReD2VypTNk21Cy Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10346"; a="270388075" X-IronPort-AV: E=Sophos;i="5.91,223,1647327600"; d="scan'208";a="270388075" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2022 18:47:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,223,1647327600"; d="scan'208";a="712630826" Received: from allen-box.sh.intel.com ([10.239.159.48]) by fmsmga001.fm.intel.com with ESMTP; 13 May 2022 18:47:04 -0700 From: Lu Baolu To: Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Paolo Bonzini , David Airlie , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Daniel Vetter , Kevin Tian , Ashok Raj , Liu Yi L , Jacob Pan , Ning Sun Cc: Will Deacon , Robin Murphy , Jason Gunthorpe , Christoph Hellwig , Steve Wahl , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH 6/7] x86/boot/tboot: Move tboot_force_iommu() to Intel IOMMU Date: Sat, 14 May 2022 09:43:21 +0800 Message-Id: <20220514014322.2927339-7-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220514014322.2927339-1-baolu.lu@linux.intel.com> References: <20220514014322.2927339-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" tboot_force_iommu() is only called by the Intel IOMMU driver. Move the helper into that driver. No functional change intended. Signed-off-by: Lu Baolu Reviewed-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Reviewed-by: Steve Wahl --- include/linux/tboot.h | 2 -- arch/x86/kernel/tboot.c | 15 --------------- drivers/iommu/intel/iommu.c | 14 ++++++++++++++ 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/include/linux/tboot.h b/include/linux/tboot.h index 5146d2574e85..d2279160ef39 100644 --- a/include/linux/tboot.h +++ b/include/linux/tboot.h @@ -126,7 +126,6 @@ extern void tboot_probe(void); extern void tboot_shutdown(u32 shutdown_type); extern struct acpi_table_header *tboot_get_dmar_table( struct acpi_table_header *dmar_tbl); -extern int tboot_force_iommu(void); =20 #else =20 @@ -136,7 +135,6 @@ extern int tboot_force_iommu(void); #define tboot_sleep(sleep_state, pm1a_control, pm1b_control) \ do { } while (0) #define tboot_get_dmar_table(dmar_tbl) (dmar_tbl) -#define tboot_force_iommu() 0 =20 #endif /* !CONFIG_INTEL_TXT */ =20 diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c index f9af561c3cd4..6eb9c4146f17 100644 --- a/arch/x86/kernel/tboot.c +++ b/arch/x86/kernel/tboot.c @@ -6,7 +6,6 @@ * Copyright (c) 2006-2009, Intel Corporation */ =20 -#include #include #include #include @@ -517,17 +516,3 @@ struct acpi_table_header *tboot_get_dmar_table(struct = acpi_table_header *dmar_tb =20 return dmar_tbl; } - -int tboot_force_iommu(void) -{ - if (!tboot_enabled()) - return 0; - - if (no_iommu || dmar_disabled) - pr_warn("Forcing Intel-IOMMU to enabled\n"); - - dmar_disabled =3D 0; - no_iommu =3D 0; - - return 1; -} diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c index 744af407d0da..ea1c3bcd38d5 100644 --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -4043,6 +4043,20 @@ static int __init probe_acpi_namespace_devices(void) return 0; } =20 +static __init int tboot_force_iommu(void) +{ + if (!tboot_enabled()) + return 0; + + if (no_iommu || dmar_disabled) + pr_warn("Forcing Intel-IOMMU to enabled\n"); + + dmar_disabled =3D 0; + no_iommu =3D 0; + + return 1; +} + int __init intel_iommu_init(void) { int ret =3D -ENODEV; --=20 2.25.1 From nobody Sun Jun 14 17:43:25 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73EC5C433EF for ; Sat, 14 May 2022 02:58:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231429AbiENC6r (ORCPT ); Fri, 13 May 2022 22:58:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230229AbiENC52 (ORCPT ); Fri, 13 May 2022 22:57:28 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F8A53A253C for ; Fri, 13 May 2022 18:47:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652492836; x=1684028836; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=h9H5Br/N5inR8hBGkTrWQLfQT0kDOku9gguSP1OEsxA=; b=IhVnR980ayc/Cr3b86axBshi7VWW/0hqvbekTAC4ICQRhwKg7U8cU147 27iViuIGAAjj7zeg+ZJsjaiwXgD1CtcQKrNUC208V8pTp6oJks8HqdWfU 4/8siVttweixv+lwpTwKWSrIHXo+b+hWLfMu1bg0RKx+P5Y0XVOVxvDgx 9Abw7QmFAeSdMTdNb1bKRmZ4JWifNegRU9oo/uR3u6gHkXyzkVgnuDq/7 4oZB3+9EJBTP0Ud46hnhh3Z+KhUyEbmPG1tYjVjYCwYhunTyw6BApQ7RL Ols79Ak6rFzOY8QmTHPaXvU0SLKWl7Zzjx/wqhxfFfnYq8THCLOjcmp9Z g==; X-IronPort-AV: E=McAfee;i="6400,9594,10346"; a="258005813" X-IronPort-AV: E=Sophos;i="5.91,223,1647327600"; d="scan'208";a="258005813" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2022 18:47:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,223,1647327600"; d="scan'208";a="712630839" Received: from allen-box.sh.intel.com ([10.239.159.48]) by fmsmga001.fm.intel.com with ESMTP; 13 May 2022 18:47:09 -0700 From: Lu Baolu To: Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Paolo Bonzini , David Airlie , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Daniel Vetter , Kevin Tian , Ashok Raj , Liu Yi L , Jacob Pan , Ning Sun Cc: Will Deacon , Robin Murphy , Jason Gunthorpe , Christoph Hellwig , Steve Wahl , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH 7/7] iommu/vt-d: Move include/linux/intel_iommu.h under iommu Date: Sat, 14 May 2022 09:43:22 +0800 Message-Id: <20220514014322.2927339-8-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220514014322.2927339-1-baolu.lu@linux.intel.com> References: <20220514014322.2927339-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This header file is private to the Intel IOMMU driver. Move it to the driver folder. Signed-off-by: Lu Baolu Reviewed-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Reviewed-by: Steve Wahl --- include/linux/intel-iommu.h =3D> drivers/iommu/intel/iommu.h | 0 drivers/iommu/intel/trace.h | 3 ++- drivers/iommu/intel/cap_audit.c | 2 +- drivers/iommu/intel/debugfs.c | 2 +- drivers/iommu/intel/dmar.c | 2 +- drivers/iommu/intel/iommu.c | 2 +- drivers/iommu/intel/irq_remapping.c | 2 +- drivers/iommu/intel/pasid.c | 2 +- drivers/iommu/intel/perf.c | 2 +- drivers/iommu/intel/svm.c | 2 +- MAINTAINERS | 1 - 11 files changed, 10 insertions(+), 10 deletions(-) rename include/linux/intel-iommu.h =3D> drivers/iommu/intel/iommu.h (100%) diff --git a/include/linux/intel-iommu.h b/drivers/iommu/intel/iommu.h similarity index 100% rename from include/linux/intel-iommu.h rename to drivers/iommu/intel/iommu.h diff --git a/drivers/iommu/intel/trace.h b/drivers/iommu/intel/trace.h index 25cb7f88e1a2..93d96f93a89b 100644 --- a/drivers/iommu/intel/trace.h +++ b/drivers/iommu/intel/trace.h @@ -13,7 +13,8 @@ #define _TRACE_INTEL_IOMMU_H =20 #include -#include + +#include "iommu.h" =20 #define MSG_MAX 256 =20 diff --git a/drivers/iommu/intel/cap_audit.c b/drivers/iommu/intel/cap_audi= t.c index 71596fc62822..3ee68393122f 100644 --- a/drivers/iommu/intel/cap_audit.c +++ b/drivers/iommu/intel/cap_audit.c @@ -10,7 +10,7 @@ =20 #define pr_fmt(fmt) "DMAR: " fmt =20 -#include +#include "iommu.h" #include "cap_audit.h" =20 static u64 intel_iommu_cap_sanity; diff --git a/drivers/iommu/intel/debugfs.c b/drivers/iommu/intel/debugfs.c index ed796eea4581..d927ef10641b 100644 --- a/drivers/iommu/intel/debugfs.c +++ b/drivers/iommu/intel/debugfs.c @@ -10,11 +10,11 @@ =20 #include #include -#include #include =20 #include =20 +#include "iommu.h" #include "pasid.h" #include "perf.h" =20 diff --git a/drivers/iommu/intel/dmar.c b/drivers/iommu/intel/dmar.c index b02d72097a8c..059af0ef2a9d 100644 --- a/drivers/iommu/intel/dmar.c +++ b/drivers/iommu/intel/dmar.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -32,6 +31,7 @@ #include #include =20 +#include "iommu.h" #include "../irq_remapping.h" #include "perf.h" #include "trace.h" diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c index ea1c3bcd38d5..1af4b6562266 100644 --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include @@ -26,6 +25,7 @@ #include #include =20 +#include "iommu.h" #include "../irq_remapping.h" #include "../iommu-sva-lib.h" #include "pasid.h" diff --git a/drivers/iommu/intel/irq_remapping.c b/drivers/iommu/intel/irq_= remapping.c index a67319597884..2e9683e970f8 100644 --- a/drivers/iommu/intel/irq_remapping.c +++ b/drivers/iommu/intel/irq_remapping.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -21,6 +20,7 @@ #include #include =20 +#include "iommu.h" #include "../irq_remapping.h" #include "cap_audit.h" =20 diff --git a/drivers/iommu/intel/pasid.c b/drivers/iommu/intel/pasid.c index cb4c1d0cf25c..b2ac5869286f 100644 --- a/drivers/iommu/intel/pasid.c +++ b/drivers/iommu/intel/pasid.c @@ -12,13 +12,13 @@ #include #include #include -#include #include #include #include #include #include =20 +#include "iommu.h" #include "pasid.h" =20 /* diff --git a/drivers/iommu/intel/perf.c b/drivers/iommu/intel/perf.c index 0e8e03252d92..94ee70ac38e3 100644 --- a/drivers/iommu/intel/perf.c +++ b/drivers/iommu/intel/perf.c @@ -9,8 +9,8 @@ */ =20 #include -#include =20 +#include "iommu.h" #include "perf.h" =20 static DEFINE_SPINLOCK(latency_lock); diff --git a/drivers/iommu/intel/svm.c b/drivers/iommu/intel/svm.c index 70b40d007a52..580713aa9e07 100644 --- a/drivers/iommu/intel/svm.c +++ b/drivers/iommu/intel/svm.c @@ -5,7 +5,6 @@ * Authors: David Woodhouse */ =20 -#include #include #include #include @@ -22,6 +21,7 @@ #include #include =20 +#include "iommu.h" #include "pasid.h" #include "perf.h" #include "../iommu-sva-lib.h" diff --git a/MAINTAINERS b/MAINTAINERS index a2095c832d84..81458c7f9a32 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -9870,7 +9870,6 @@ L: iommu@lists.linux-foundation.org S: Supported T: git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git F: drivers/iommu/intel/ -F: include/linux/intel-iommu.h F: include/linux/intel-svm.h =20 INTEL IOP-ADMA DMA DRIVER --=20 2.25.1