* [PATCH 1/6] iommu/amd: Remove unused PPR_* macros
2024-01-18 9:00 [PATCH 0/6] iommu/amd: Misc cleanup Vasant Hegde
@ 2024-01-18 9:01 ` Vasant Hegde
2024-01-18 9:01 ` [PATCH 2/6] iommu/amd: Remove unused IOVA_* macro Vasant Hegde
` (7 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: Vasant Hegde @ 2024-01-18 9:01 UTC (permalink / raw)
To: iommu, joro; +Cc: suravee.suthikulpanit, Vasant Hegde
Commit 5a0b11a180a ("iommu/amd: Remove iommu_v2 module") missed to
remove PPR_* macros. Remove these macros as its not used anymore.
No functional change intended.
Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
---
drivers/iommu/amd/amd_iommu.h | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/iommu/amd/amd_iommu.h b/drivers/iommu/amd/amd_iommu.h
index 3008503513df..db983b8e572b 100644
--- a/drivers/iommu/amd/amd_iommu.h
+++ b/drivers/iommu/amd/amd_iommu.h
@@ -122,10 +122,6 @@ static inline int amd_iommu_create_irq_domain(struct amd_iommu *iommu)
}
#endif
-#define PPR_SUCCESS 0x0
-#define PPR_INVALID 0x1
-#define PPR_FAILURE 0xf
-
static inline bool is_rd890_iommu(struct pci_dev *pdev)
{
return (pdev->vendor == PCI_VENDOR_ID_ATI) &&
--
2.31.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 2/6] iommu/amd: Remove unused IOVA_* macro
2024-01-18 9:00 [PATCH 0/6] iommu/amd: Misc cleanup Vasant Hegde
2024-01-18 9:01 ` [PATCH 1/6] iommu/amd: Remove unused PPR_* macros Vasant Hegde
@ 2024-01-18 9:01 ` Vasant Hegde
2024-01-18 9:01 ` [PATCH 3/6] iommu/amd: Remove unused APERTURE_* macros Vasant Hegde
` (6 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: Vasant Hegde @ 2024-01-18 9:01 UTC (permalink / raw)
To: iommu, joro; +Cc: suravee.suthikulpanit, Vasant Hegde, Lu Baolu
These macros are not used after commit ac6d704679d343 ("iommu/dma: Pass
address limit rather than size to iommu_setup_dma_ops()").
No functional change intended.
Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Cc: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
---
@Lu Baolu,
We have similar unused macro (IOVA_START_PFN) in intel driver as well.
If you want I can remove that macro as part of this series.
-Vasant
drivers/iommu/amd/iommu.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
index 4280d97fa6ba..6bb4f2dc5194 100644
--- a/drivers/iommu/amd/iommu.c
+++ b/drivers/iommu/amd/iommu.c
@@ -45,10 +45,6 @@
#define CMD_SET_TYPE(cmd, t) ((cmd)->data[1] |= ((t) << 28))
-/* IO virtual address start page frame number */
-#define IOVA_START_PFN (1)
-#define IOVA_PFN(addr) ((addr) >> PAGE_SHIFT)
-
/* Reserved IOVA ranges */
#define MSI_RANGE_START (0xfee00000)
#define MSI_RANGE_END (0xfeefffff)
--
2.31.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 3/6] iommu/amd: Remove unused APERTURE_* macros
2024-01-18 9:00 [PATCH 0/6] iommu/amd: Misc cleanup Vasant Hegde
2024-01-18 9:01 ` [PATCH 1/6] iommu/amd: Remove unused PPR_* macros Vasant Hegde
2024-01-18 9:01 ` [PATCH 2/6] iommu/amd: Remove unused IOVA_* macro Vasant Hegde
@ 2024-01-18 9:01 ` Vasant Hegde
2024-01-18 9:01 ` [PATCH 4/6] iommu/amd: Remove duplicate function declarations from amd_iommu.h Vasant Hegde
` (5 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: Vasant Hegde @ 2024-01-18 9:01 UTC (permalink / raw)
To: iommu, joro; +Cc: suravee.suthikulpanit, Vasant Hegde
These macros are not used after commit 518d9b450387 ("iommu/amd: Remove
special mapping code for dma_ops path").
No functional change intended.
Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
---
drivers/iommu/amd/amd_iommu_types.h | 7 -------
1 file changed, 7 deletions(-)
diff --git a/drivers/iommu/amd/amd_iommu_types.h b/drivers/iommu/amd/amd_iommu_types.h
index 722120f95647..9bef7aa54992 100644
--- a/drivers/iommu/amd/amd_iommu_types.h
+++ b/drivers/iommu/amd/amd_iommu_types.h
@@ -519,13 +519,6 @@ extern struct kmem_cache *amd_iommu_irq_cache;
#define for_each_pdom_dev_data_safe(pdom_dev_data, next, pdom) \
list_for_each_entry_safe((pdom_dev_data), (next), &pdom->dev_data_list, list)
-#define APERTURE_RANGE_SHIFT 27 /* 128 MB */
-#define APERTURE_RANGE_SIZE (1ULL << APERTURE_RANGE_SHIFT)
-#define APERTURE_RANGE_PAGES (APERTURE_RANGE_SIZE >> PAGE_SHIFT)
-#define APERTURE_MAX_RANGES 32 /* allows 4GB of DMA address space */
-#define APERTURE_RANGE_INDEX(a) ((a) >> APERTURE_RANGE_SHIFT)
-#define APERTURE_PAGE_INDEX(a) (((a) >> 21) & 0x3fULL)
-
struct amd_iommu;
struct iommu_domain;
--
2.31.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 4/6] iommu/amd: Remove duplicate function declarations from amd_iommu.h
2024-01-18 9:00 [PATCH 0/6] iommu/amd: Misc cleanup Vasant Hegde
` (2 preceding siblings ...)
2024-01-18 9:01 ` [PATCH 3/6] iommu/amd: Remove unused APERTURE_* macros Vasant Hegde
@ 2024-01-18 9:01 ` Vasant Hegde
2024-01-18 9:01 ` [PATCH 5/6] iommu/amd: Remove redundant error check in amd_iommu_probe_device() Vasant Hegde
` (4 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: Vasant Hegde @ 2024-01-18 9:01 UTC (permalink / raw)
To: iommu, joro; +Cc: suravee.suthikulpanit, Vasant Hegde
Perf counter related functions are defined in amd-iommu.h as well.
Hence remove duplicate declarations.
No functional change intended.
Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
---
drivers/iommu/amd/amd_iommu.h | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/drivers/iommu/amd/amd_iommu.h b/drivers/iommu/amd/amd_iommu.h
index db983b8e572b..c2ab07d364dd 100644
--- a/drivers/iommu/amd/amd_iommu.h
+++ b/drivers/iommu/amd/amd_iommu.h
@@ -70,15 +70,6 @@ int amd_iommu_page_response(struct device *dev,
int amd_iommu_iopf_enable_device(struct device *dev);
int amd_iommu_iopf_disable_device(struct device *dev);
-struct amd_iommu *get_amd_iommu(unsigned int idx);
-u8 amd_iommu_pc_get_max_banks(unsigned int idx);
-bool amd_iommu_pc_supported(void);
-u8 amd_iommu_pc_get_max_counters(unsigned int idx);
-int amd_iommu_pc_get_reg(struct amd_iommu *iommu, u8 bank, u8 cntr,
- u8 fxn, u64 *value);
-int amd_iommu_pc_set_reg(struct amd_iommu *iommu, u8 bank, u8 cntr,
- u8 fxn, u64 *value);
-
/* Device capabilities */
int amd_iommu_pdev_enable_cap_pri(struct pci_dev *pdev);
void amd_iommu_pdev_disable_cap_pri(struct pci_dev *pdev);
--
2.31.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 5/6] iommu/amd: Remove redundant error check in amd_iommu_probe_device()
2024-01-18 9:00 [PATCH 0/6] iommu/amd: Misc cleanup Vasant Hegde
` (3 preceding siblings ...)
2024-01-18 9:01 ` [PATCH 4/6] iommu/amd: Remove duplicate function declarations from amd_iommu.h Vasant Hegde
@ 2024-01-18 9:01 ` Vasant Hegde
2024-01-18 9:01 ` [PATCH 6/6] iommu/amd: Remove EXPORT_SYMBOL for perf counter related functions Vasant Hegde
` (3 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: Vasant Hegde @ 2024-01-18 9:01 UTC (permalink / raw)
To: iommu, joro; +Cc: suravee.suthikulpanit, Vasant Hegde
iommu_init_device() is not returning -ENOTSUPP since commit 61289cbaf6c8
("iommu/amd: Remove old alias handling code").
No functional change intended.
Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
---
drivers/iommu/amd/iommu.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
index 6bb4f2dc5194..431febbb0fab 100644
--- a/drivers/iommu/amd/iommu.c
+++ b/drivers/iommu/amd/iommu.c
@@ -2175,8 +2175,7 @@ static struct iommu_device *amd_iommu_probe_device(struct device *dev)
ret = iommu_init_device(iommu, dev);
if (ret) {
- if (ret != -ENOTSUPP)
- dev_err(dev, "Failed to initialize - trying to proceed anyway\n");
+ dev_err(dev, "Failed to initialize - trying to proceed anyway\n");
iommu_dev = ERR_PTR(ret);
iommu_ignore_device(iommu, dev);
} else {
--
2.31.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 6/6] iommu/amd: Remove EXPORT_SYMBOL for perf counter related functions
2024-01-18 9:00 [PATCH 0/6] iommu/amd: Misc cleanup Vasant Hegde
` (4 preceding siblings ...)
2024-01-18 9:01 ` [PATCH 5/6] iommu/amd: Remove redundant error check in amd_iommu_probe_device() Vasant Hegde
@ 2024-01-18 9:01 ` Vasant Hegde
2024-01-19 19:37 ` [PATCH 0/6] iommu/amd: Misc cleanup Alejandro Jimenez
` (2 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: Vasant Hegde @ 2024-01-18 9:01 UTC (permalink / raw)
To: iommu, joro; +Cc: suravee.suthikulpanit, Vasant Hegde
.. as IOMMU perf counters are always built as part of kernel.
No functional change intended.
Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
---
drivers/iommu/amd/init.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c
index 426db9ea3718..2b64cb08f795 100644
--- a/drivers/iommu/amd/init.c
+++ b/drivers/iommu/amd/init.c
@@ -3653,13 +3653,11 @@ u8 amd_iommu_pc_get_max_banks(unsigned int idx)
return 0;
}
-EXPORT_SYMBOL(amd_iommu_pc_get_max_banks);
bool amd_iommu_pc_supported(void)
{
return amd_iommu_pc_present;
}
-EXPORT_SYMBOL(amd_iommu_pc_supported);
u8 amd_iommu_pc_get_max_counters(unsigned int idx)
{
@@ -3670,7 +3668,6 @@ u8 amd_iommu_pc_get_max_counters(unsigned int idx)
return 0;
}
-EXPORT_SYMBOL(amd_iommu_pc_get_max_counters);
static int iommu_pc_get_set_reg(struct amd_iommu *iommu, u8 bank, u8 cntr,
u8 fxn, u64 *value, bool is_write)
--
2.31.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH 0/6] iommu/amd: Misc cleanup
2024-01-18 9:00 [PATCH 0/6] iommu/amd: Misc cleanup Vasant Hegde
` (5 preceding siblings ...)
2024-01-18 9:01 ` [PATCH 6/6] iommu/amd: Remove EXPORT_SYMBOL for perf counter related functions Vasant Hegde
@ 2024-01-19 19:37 ` Alejandro Jimenez
2024-01-22 3:49 ` Vasant Hegde
2024-02-06 12:58 ` Jason Gunthorpe
2024-02-09 10:41 ` Joerg Roedel
8 siblings, 1 reply; 11+ messages in thread
From: Alejandro Jimenez @ 2024-01-19 19:37 UTC (permalink / raw)
To: Vasant Hegde, iommu, joro; +Cc: suravee.suthikulpanit
Hi Vasant,
I had issues applying the series to the topic branch, and realized it is based on top of your SVA Support patchset. If these patches are merged before the SVA changes, the minor conflicts are simple enough to resolve I suppose..
On 1/18/24 04:00, Vasant Hegde wrote:
> This patch series removes unused macros, redundant check and
> unncessary EXPORT_SYMBOLS. No major functional changes intended.
For the series:
Reviewed-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
>
> Thanks,
> Vasant
>
> Vasant Hegde (6):
> iommu/amd: Remove unused PPR_* macros
> iommu/amd: Remove unused IOVA_* macro
> iommu/amd: Remove unused APERTURE_* macros
> iommu/amd: Remove duplicate function declarations from amd_iommu.h
> iommu/amd: Remove redundant error check in amd_iommu_probe_device()
> iommu/amd: Remove EXPORT_SYMBOL for perf counter related functions
>
> drivers/iommu/amd/amd_iommu.h | 13 -------------
> drivers/iommu/amd/amd_iommu_types.h | 7 -------
> drivers/iommu/amd/init.c | 3 ---
> drivers/iommu/amd/iommu.c | 7 +------
> 4 files changed, 1 insertion(+), 29 deletions(-)
>
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH 0/6] iommu/amd: Misc cleanup
2024-01-19 19:37 ` [PATCH 0/6] iommu/amd: Misc cleanup Alejandro Jimenez
@ 2024-01-22 3:49 ` Vasant Hegde
0 siblings, 0 replies; 11+ messages in thread
From: Vasant Hegde @ 2024-01-22 3:49 UTC (permalink / raw)
To: Alejandro Jimenez, iommu, joro; +Cc: suravee.suthikulpanit
Hi Alejandro,
On 1/20/2024 1:07 AM, Alejandro Jimenez wrote:
> Hi Vasant,
>
> I had issues applying the series to the topic branch, and realized it is based
> on top of your SVA Support patchset. If these patches are merged before the SVA
> changes, the minor conflicts are simple enough to resolve I suppose..
Sorry for the trouble. I forgot to update the cover letter.
You are right. This series is based on top of SVA Part 4 V5 [1].
[5]
https://lore.kernel.org/linux-iommu/20240116165335.6043-1-vasant.hegde@amd.com/T/#t
>
> On 1/18/24 04:00, Vasant Hegde wrote:
>> This patch series removes unused macros, redundant check and
>> unncessary EXPORT_SYMBOLS. No major functional changes intended.
>
> For the series:
>
> Reviewed-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
Thanks for the review.
-Vasant
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 0/6] iommu/amd: Misc cleanup
2024-01-18 9:00 [PATCH 0/6] iommu/amd: Misc cleanup Vasant Hegde
` (6 preceding siblings ...)
2024-01-19 19:37 ` [PATCH 0/6] iommu/amd: Misc cleanup Alejandro Jimenez
@ 2024-02-06 12:58 ` Jason Gunthorpe
2024-02-09 10:41 ` Joerg Roedel
8 siblings, 0 replies; 11+ messages in thread
From: Jason Gunthorpe @ 2024-02-06 12:58 UTC (permalink / raw)
To: Vasant Hegde; +Cc: iommu, joro, suravee.suthikulpanit
On Thu, Jan 18, 2024 at 09:00:59AM +0000, Vasant Hegde wrote:
> This patch series removes unused macros, redundant check and
> unncessary EXPORT_SYMBOLS. No major functional changes intended.
>
> Thanks,
> Vasant
>
> Vasant Hegde (6):
> iommu/amd: Remove unused PPR_* macros
> iommu/amd: Remove unused IOVA_* macro
> iommu/amd: Remove unused APERTURE_* macros
> iommu/amd: Remove duplicate function declarations from amd_iommu.h
> iommu/amd: Remove redundant error check in amd_iommu_probe_device()
> iommu/amd: Remove EXPORT_SYMBOL for perf counter related functions
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Jason
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH 0/6] iommu/amd: Misc cleanup
2024-01-18 9:00 [PATCH 0/6] iommu/amd: Misc cleanup Vasant Hegde
` (7 preceding siblings ...)
2024-02-06 12:58 ` Jason Gunthorpe
@ 2024-02-09 10:41 ` Joerg Roedel
8 siblings, 0 replies; 11+ messages in thread
From: Joerg Roedel @ 2024-02-09 10:41 UTC (permalink / raw)
To: Vasant Hegde; +Cc: iommu, suravee.suthikulpanit
On Thu, Jan 18, 2024 at 09:00:59AM +0000, Vasant Hegde wrote:
> Vasant Hegde (6):
> iommu/amd: Remove unused PPR_* macros
> iommu/amd: Remove unused IOVA_* macro
> iommu/amd: Remove unused APERTURE_* macros
> iommu/amd: Remove duplicate function declarations from amd_iommu.h
> iommu/amd: Remove redundant error check in amd_iommu_probe_device()
> iommu/amd: Remove EXPORT_SYMBOL for perf counter related functions
>
> drivers/iommu/amd/amd_iommu.h | 13 -------------
> drivers/iommu/amd/amd_iommu_types.h | 7 -------
> drivers/iommu/amd/init.c | 3 ---
> drivers/iommu/amd/iommu.c | 7 +------
> 4 files changed, 1 insertion(+), 29 deletions(-)
Applied, thanks.
^ permalink raw reply [flat|nested] 11+ messages in thread