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 3DD852361E7; Thu, 16 Jan 2025 23:23:15 +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=1737069796; cv=none; b=uLlDqQzgOVrqAjGcVXFsPCAtwY08ivlk08hoebZjBDiiW9vcAlqGYfTt7qKqZoDFKRBOTO+eyyW8Yd3FnzoYkQUz6fJqm/ayCMirld7Vh6h8YrSJ8zmNo9YeC5Xbjwyh9b1++RejvnKfXUaXyy8ybSJNwurp8HgxZZA+dSSeljY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737069796; c=relaxed/simple; bh=OVAvyrQ2Hi9aky12+e8xtryMlBUSvpeHlMI7fo8WbsQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gjQVyQCyxN9zlKUGsMpl3iiy7TqD9Zg3YKPriKS4YEWr6prUL3J+OfSk1+Jbdi0CJEKqZPxakOou3e0RG6CAtB/pAHvehDE/olv/CfQsicW7ZyFpnJEKh8xSbJBIzysEzTVoMuj7bjVApCLsj6pXK3PvU6zAwxH8EWtRjXK4AS0= 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=ENqnNakS; 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="ENqnNakS" Received: from thinkpad-p16sg1.corp.microsoft.com (unknown [20.236.10.66]) by linux.microsoft.com (Postfix) with ESMTPSA id A6B9620591AA; Thu, 16 Jan 2025 15:23:14 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com A6B9620591AA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1737069794; bh=P4jWpJL3m1B1x7U4cIHota00Kj8/WCnEujqgPgEJRxo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ENqnNakSMHsmOehkMhdCS86XVVsyp0OqocXw//ub6IESyVXTwFgTXnVwkrObPMfqe ddnrIOQI27nypt9wuBDgIzGjNWBpQLwdczEJfRH+XqGHgmfklza1bVLj2r4duK9tJE 8YtDQmTf6hhwW52FrQB9WbAayAuV27zb5/mL0Bwc= From: Shyam Saini To: iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, virtualization@lists.linux.dev Cc: will@kernel.org, jacob.pan@linux.microsoft.com, eric.auger@redhat.com, code@tyhicks.com, eahariha@linux.microsoft.com, vijayb@linux.microsoft.com Subject: [PATCH 2/3] iommu: consolidate MSI_IOVA macro definitions Date: Thu, 16 Jan 2025 15:23:06 -0800 Message-Id: <20250116232307.1436693-3-shyamsaini@linux.microsoft.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250116232307.1436693-1-shyamsaini@linux.microsoft.com> References: <20250116232307.1436693-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 MSI_IOVA* macros are common among different iommu/smu drivers, so move them to common iommu.h header file. This doesn't change anything wrt functionality of the IOMMU subsystem. 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 bd9d7c85576a2..d1713f6bbe6d1 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h @@ -502,9 +502,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 79afc92e1d8b9..287f8e8d25890 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c @@ -49,9 +49,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 b85ce6310ddbd..8c8783c8b31be 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 38c65e92ecd09..2a26d3e18b24e 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -1505,6 +1505,9 @@ static inline void iommu_debugfs_setup(void) {} #ifdef CONFIG_IOMMU_DMA #include +#define MSI_IOVA_BASE 0x8000000 +#define MSI_IOVA_LENGTH 0x100000 + int iommu_get_msi_cookie(struct iommu_domain *domain, dma_addr_t base); int iommu_dma_prepare_msi(struct msi_desc *desc, phys_addr_t msi_addr); -- 2.34.1