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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5C425CA0FED for ; Tue, 9 Sep 2025 17:25:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jtzDzkUv14rqdip4Y1gi77GlegBrcKG8mB/h5fAG9DI=; b=bowAEuHufbFpO5/ytQCf2r4/SJ n8q3llrBNJSeURZo4tdEQxMXKss+dsV8opHwrbJtmUrjqufUYiAvDzA8Q8bagOZmqqDetUmW0I5Gy pDCnioJ7RgkgXlU/CNUBFhiPsYQ2jphWgngU3JB5OZFvS4Is1gNRULyd1Yr1DyEP7CqDhSWcOFMEG obDan+f+t36uiwUuRlGv2857r+vyI5P3V3nC1OkweVdaFIBzvkw+vV6oTnwsUH19jd8RnhDtaAcm0 4AkYaBL/ZPb2SI1beFD3YNB+jpjVLxoiwY4HhSjXC26zDNIhGNIJnA4oBafilX1JwBoT8UfuEVnQ+ 6C6TFPNg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uw26D-000000094Dr-0w3k; Tue, 09 Sep 2025 17:25:45 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uw0Y2-00000008Fqn-3C49 for linux-arm-kernel@bombadil.infradead.org; Tue, 09 Sep 2025 15:46:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=jtzDzkUv14rqdip4Y1gi77GlegBrcKG8mB/h5fAG9DI=; b=VThZbXUKswsPz3HRIP2Hx/iQTS sBu1P0KHqbEAyPa9wf2Jq/iXXQoCOLLvBVqPZDeaPEGQXyDaxenbIcidDSWVbnetdHfzk7d5GWv5T vGTxOjQPLtYUyAXOD0vEfvJ7pfbIakd4NNK92xeVpecykRzUUplMiTACBxQNu8TaADSHG3tIudyLT Vl3CQvgzI3Fw6s0i6jEDCbeT/SS49Az1/3Fo3/qHmvslPipVM9tv0e1KRKXdupebZ+sZU87iVN12h ZVBy4IxcgQ/iN87GkoblwLBgK7MPJOvGTvA8tnUZHeUb3frvCpW7lIB4yCzLNl/oV3HX8V15aRKZI a+dqiOeg==; Received: from linux.microsoft.com ([13.77.154.182]) by desiato.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uw0Xz-00000005PNw-1AT5 for linux-arm-kernel@lists.infradead.org; Tue, 09 Sep 2025 15:46:21 +0000 Received: from thinkpad-p16sg1.corp.microsoft.com (unknown [20.236.11.102]) by linux.microsoft.com (Postfix) with ESMTPSA id CB25E211AA0F; Tue, 9 Sep 2025 08:46:07 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com CB25E211AA0F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1757432768; bh=jtzDzkUv14rqdip4Y1gi77GlegBrcKG8mB/h5fAG9DI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rUgCjrMF9QQlMdbYFk8S6HEJ9YMMidqyd1MpKeSq2t53CdTLY9CXIIBtxDUa0nxIL N0FwYY9UQxX8NllwXScpVYsyfL6NneVprceN7kbS9/DpmKZHZdeozj0DGUGpWhiMcN dF1aNlaRRlwpqflEAX2VO5aAKQsBjgEBOuW7Nsgg= From: Shyam Saini To: thierry.reding@gmail.com, robin.murphy@arm.com, robh@kernel.org, joro@8bytes.org, jgg@ziepe.ca Cc: iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, virtualization@lists.linux.dev, will@kernel.org, jacob.pan@linux.microsoft.com, eric.auger@redhat.com, code@tyhicks.com, eahariha@linux.microsoft.com, vijayb@linux.microsoft.com, bboscaccy@linux.microsoft.com, saravanak@google.com, krzk+dt@kernel.org, conor+dt@kernel.org, lizhi.hou@amd.com, clement.leger@bootlin.com Subject: [PATCH v4 1/4] arm-smmu: move MSI_IOVA macro definitions Date: Tue, 9 Sep 2025 08:45:57 -0700 Message-Id: <20250909154600.910110-2-shyamsaini@linux.microsoft.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250909154600.910110-1-shyamsaini@linux.microsoft.com> References: <20250909154600.910110-1-shyamsaini@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250909_164619_802959_EF06BC36 X-CRM114-Status: GOOD ( 12.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org MSI_IOVA* are common among different iommu/smu drivers, so move them to common iommu.h header file. Suggested-by: Jacob Pan Signed-off-by: Shyam Saini --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 3 --- drivers/iommu/arm/arm-smmu/arm-smmu.c | 3 --- drivers/iommu/virtio-iommu.c | 2 -- include/linux/iommu.h | 3 +++ 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h index ae23aacc38402..16f5856b4c0e2 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h @@ -505,9 +505,6 @@ static inline unsigned int arm_smmu_cdtab_l2_idx(unsigned int ssid) #define ARM_SMMU_POLL_TIMEOUT_US 1000000 /* 1s! */ #define ARM_SMMU_POLL_SPIN_COUNT 10 -#define MSI_IOVA_BASE 0x8000000 -#define MSI_IOVA_LENGTH 0x100000 - enum pri_resp { PRI_RESP_DENY = 0, PRI_RESP_FAIL = 1, diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c index 4ced4b5bee4df..4a07650911991 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c @@ -50,9 +50,6 @@ */ #define QCOM_DUMMY_VAL -1 -#define MSI_IOVA_BASE 0x8000000 -#define MSI_IOVA_LENGTH 0x100000 - static int force_stage; module_param(force_stage, int, S_IRUGO); MODULE_PARM_DESC(force_stage, diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c index b39d6f134ab28..f3d830656cf29 100644 --- a/drivers/iommu/virtio-iommu.c +++ b/drivers/iommu/virtio-iommu.c @@ -24,8 +24,6 @@ #include "dma-iommu.h" -#define MSI_IOVA_BASE 0x8000000 -#define MSI_IOVA_LENGTH 0x100000 #define VIOMMU_REQUEST_VQ 0 #define VIOMMU_EVENT_VQ 1 diff --git a/include/linux/iommu.h b/include/linux/iommu.h index c30d12e16473d..09a35af5a545d 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -1554,6 +1554,9 @@ static inline void iommu_debugfs_setup(void) {} #endif #ifdef CONFIG_IOMMU_DMA +#define MSI_IOVA_BASE 0x8000000 +#define MSI_IOVA_LENGTH 0x100000 + int iommu_get_msi_cookie(struct iommu_domain *domain, dma_addr_t base); #else /* CONFIG_IOMMU_DMA */ static inline int iommu_get_msi_cookie(struct iommu_domain *domain, dma_addr_t base) -- 2.34.1