iommu/amd: Cleanup and fixes
Subsystems (2)
Vasant Hegde
maintainercover iommu/amd: Cleanup and fixes
This series contains few trivial cleanup (like removing redundant checks, unsed macros, etc,) and fixes.
Vasant Hegde (4):
iommu/amd: Make iommu_sva_set_dev_pasid as static iommu/amd: Remove redundant check in irq_remapping_select() iommu/amd: Remove redundant checks from interrupt handler path iommu/amd: Remove unused macro
drivers/iommu/amd/amd_iommu.h | 3 --- drivers/iommu/amd/amd_iommu_types.h | 16 ---------------- drivers/iommu/amd/init.c | 2 +- drivers/iommu/amd/iommu.c | 6 ------ drivers/iommu/amd/pasid.c | 6 +++--- drivers/iommu/amd/ppr.c | 3 --- 6 files changed, 4 insertions(+), 32 deletions(-)
Signature · 1 line
2.31.1
Vasant Hegde
maintainerPATCH 1/4 iommu/amd: Make iommu_sva_set_dev_pasid as static
Its used inside pasid.c only.
No functional changes.
--- drivers/iommu/amd/amd_iommu.h | 3 --- drivers/iommu/amd/pasid.c | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-)
drivers/iommu/amd/amd_iommu.h +0 -3
@@ -54,9 +54,6 @@ struct protection_domain *protection_domain_alloc(void);struct iommu_domain *amd_iommu_domain_alloc_sva (struct device *dev,struct mm_struct *mm);void amd_iommu_domain_free (struct iommu_domain *dom); -int iommu_sva_set_dev_pasid (struct iommu_domain *domain, -struct device *dev,ioasid_t pasid, -struct iommu_domain *old);void amd_iommu_remove_dev_pasid (struct device *dev,ioasid_t pasid,struct iommu_domain *domain);
drivers/iommu/amd/pasid.c +3 -3
@@ -99,9 +99,9 @@ static const struct mmu_notifier_ops sva_mn = { .release = sva_mn_release, }; -int iommu_sva_set_dev_pasid (struct iommu_domain *domain, -struct device *dev,ioasid_t pasid, -struct iommu_domain *old) +static int iommu_sva_set_dev_pasid (struct iommu_domain *domain, +struct device *dev,ioasid_t pasid, +struct iommu_domain *old) {struct pdom_dev_data *pdom_dev_data;struct protection_domain *sva_pdom =to_pdomain (domain);
Signature · 1 line
2.31.1
Vasant Hegde
maintainerPATCH 2/4 iommu/amd: Remove redundant check in irq_remapping_select()
In reply to Vasant HegdeThe amd_iommu_irq_remap flag is already validated during irq remapping domain creation (before calling amd_iommu_create_irq_domain()). The duplicate check in irq_remapping_select() is unnecessary and can be removed.
Additionally, mark amd_iommu_irq_remap as static.
No functional changes.
--- drivers/iommu/amd/amd_iommu_types.h | 3 --- drivers/iommu/amd/init.c | 2 +- drivers/iommu/amd/iommu.c | 3 --- 3 files changed, 1 insertion(+), 7 deletions(-)
drivers/iommu/amd/amd_iommu_types.h +0 -3
@@ -434,9 +434,6 @@ struct irq_remap_table {u32 *table; }; -/* Interrupt remapping feature used? */ -extern bool amd_iommu_irq_remap; -extern const struct iommu_ops amd_iommu_ops;/* IVRS indicates that pre-boot remapping was enabled */
drivers/iommu/amd/init.c +1 -1
@@ -152,7 +152,7 @@ struct ivmd_header { } __attribute__((packed));bool amd_iommu_dump; -bool amd_iommu_irq_remap__read_mostly ; +static bool amd_iommu_irq_remap__read_mostly ;enum protection_domain_mode amd_iommu_pgtable =PD_MODE_V1 ;/* Virtual address size */
drivers/iommu/amd/iommu.c +0 -3
@@ -3977,9 +3977,6 @@ static int irq_remapping_select(struct irq_domain *d, struct irq_fwspec *fwspec,struct amd_iommu *iommu;int devid =-1 ; -if (!amd_iommu_irq_remap) -return 0 ; -if (x86_fwspec_is_ioapic (fwspec)) devid =get_ioapic_devid (fwspec->param[0 ]);else if (x86_fwspec_is_hpet (fwspec))
Signature · 1 line
2.31.1
Vasant Hegde
maintainerPATCH 3/4 iommu/amd: Remove redundant checks from interrupt handler path
In reply to Vasant HegdePPR and GAlog interrupt is enabled only if buffer is allocated. (See amd_iommu_enable_ppr_log() and iommu_ga_log_enable()).
The duplicate check in interrupt hanlder path is unnecessary and can be removed.
No functional changes.
--- drivers/iommu/amd/iommu.c | 3 --- drivers/iommu/amd/ppr.c | 3 --- 2 files changed, 6 deletions(-)
drivers/iommu/amd/iommu.c +0 -3
@@ -1076,9 +1076,6 @@ static void iommu_poll_ga_log(struct amd_iommu *iommu) {u32 head, tail; -if (iommu->ga_log ==NULL ) -return ; - head =readl (iommu->mmio_base +MMIO_GA_HEAD_OFFSET ); tail =readl (iommu->mmio_base +MMIO_GA_TAIL_OFFSET );
drivers/iommu/amd/ppr.c +0 -3
@@ -165,9 +165,6 @@ void amd_iommu_poll_ppr_log(struct amd_iommu *iommu) {u32 head, tail; -if (iommu->ppr_log ==NULL ) -return ; - head =readl (iommu->mmio_base +MMIO_PPR_HEAD_OFFSET ); tail =readl (iommu->mmio_base +MMIO_PPR_TAIL_OFFSET );
Signature · 1 line
2.31.1
Vasant Hegde
maintainerPATCH 4/4 iommu/amd: Remove unused macro
In reply to Vasant HegdeRemove unsed device range capability related macros.
No functional changes.
--- drivers/iommu/amd/amd_iommu_types.h | 13 ------------- 1 file changed, 13 deletions(-)
drivers/iommu/amd/amd_iommu_types.h +0 -13
@@ -39,18 +39,6 @@#define MMIO_RANGE_OFFSET 0x0c#define MMIO_MISC_OFFSET 0x10 -/* Masks, shifts and macros to parse the device range capability */ -#define MMIO_RANGE_LD_MASK 0xff000000 -#define MMIO_RANGE_FD_MASK 0x00ff0000 -#define MMIO_RANGE_BUS_MASK 0x0000ff00 -#define MMIO_RANGE_LD_SHIFT 24 -#define MMIO_RANGE_FD_SHIFT 16 -#define MMIO_RANGE_BUS_SHIFT 8 -#define MMIO_GET_LD (x) (((x) & MMIO_RANGE_LD_MASK) >> MMIO_RANGE_LD_SHIFT) -#define MMIO_GET_FD (x) (((x) & MMIO_RANGE_FD_MASK) >> MMIO_RANGE_FD_SHIFT) -#define MMIO_GET_BUS (x) (((x) & MMIO_RANGE_BUS_MASK) >> MMIO_RANGE_BUS_SHIFT) -#define MMIO_MSI_NUM (x) ((x) & 0x1f) -/* Used offsets into the MMIO space */ #define MMIO_DEV_TABLE_OFFSET 0x0000#define MMIO_CMD_BUF_OFFSET 0x0008
@@ -247,7 +235,6 @@/* constants to configure the command buffer */ #define CMD_BUFFER_SIZE 8192 -#define CMD_BUFFER_UNINITIALIZED 1#define CMD_BUFFER_ENTRIES 512#define MMIO_CMD_SIZE_SHIFT 56#define MMIO_CMD_SIZE_512 (0x9ULL << MMIO_CMD_SIZE_SHIFT)
Signature · 1 line
2.31.1
Vasant Hegde
maintainerQuoted 2 lines · Vasant Hegde
This series contains few trivial cleanup (like removing redundant checks, unsed macros, etc,) and fixes.
Forgot to mention, this patch is based on top of iommu/fixes branch (Commit adbd8a08208dc6).
-Vasant
Jörg Rödel
maintainerQuoted 8 lines · Vasant Hegde
This series contains few trivial cleanup (like removing redundant checks, unsed macros, etc,) and fixes.
Vasant Hegde (4):
iommu/amd: Makeiommu_sva_set_dev_pasidas static iommu/amd: Remove redundant check inirq_remapping_select()iommu/amd: Remove redundant checks from interrupt handler path iommu/amd: Remove unused macro
Applied and on their way to Linus, thanks Vasant.