From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8733121D3E9; Wed, 6 Aug 2025 21:55:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754517350; cv=none; b=nKtLWIkQ/xEYQxvH4y5AOiq6QKrm+R7vYUZynCv8eBqVMzmlnOAzNlgwGrqLLwMT0XcA4/a6yVXba/JzjjqSecn7ZUyoCxsy4FXCimVquPKNDXtjcrkKu+boRx6p0QGMQKyF2jYKSttMseow2ZX8ZBlqImyga0bExh+gXsuRh4Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754517350; c=relaxed/simple; bh=MFOsyzoQ5EgQD+pRBVwFgyjX2lsuIqKClk9V/ps+F68=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=iOns8RxB6maqUTwjX5BB1f51+PAy7+txXzr17KwL10hn19QmLcQf342NEjNr1WbC46kFkc6rIpdMVKOh6k6zHXLRk6DriLns6IClkNcqJFytI2L1om2BFZLkBAaqP+6Xcnu28wUzC1upOAcoYq8Z8Gs0pbbz+VSJv1IucLxZF1g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=s0B5TsGc; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="s0B5TsGc" Received: from thinkpad-p16sg1.corp.microsoft.com (unknown [40.65.108.177]) by linux.microsoft.com (Postfix) with ESMTPSA id E3DE4201BC8C; Wed, 6 Aug 2025 14:55:48 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com E3DE4201BC8C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1754517349; bh=EMBDT2zYRzRMO1qYEwatd0iuKmtiwimyn6wYon4+bTE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s0B5TsGcwACdQKAFaHdhC7vvERX2B/PzH3VHd+0ealVxsDHeWfeLoGngkc1e8N2Co vIsT4H6bUQe7CnrQS9+M8X7xOhp2+/PNA25jQsFuyl537BlziC689mZldl/J/Z1xYU Z7K/MJqMUCorjkvH6xomiVt6SAZYB35+LoGlQMp0= From: Shyam Saini To: iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, virtualization@lists.linux.dev Cc: jgg@ziepe.ca, 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 Subject: [PATCH v3 1/3] arm-smmu: move MSI_IOVA macro definitions Date: Wed, 6 Aug 2025 14:55:37 -0700 Message-Id: <20250806215539.1240561-2-shyamsaini@linux.microsoft.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250806215539.1240561-1-shyamsaini@linux.microsoft.com> References: <20250806215539.1240561-1-shyamsaini@linux.microsoft.com> Precedence: bulk X-Mailing-List: iommu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Level: ** 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 ea41d790463ed..4db5714a50f1e 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h @@ -503,9 +503,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 532db1de201ba..6b72776f17716 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 7073be1d88415..517f908296436 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -1508,6 +1508,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