Skip to content

Commit 950865c

Browse files
sarunkodjoergroedel
authored andcommitted
iommu/amd: Rename DTE_INTTABLEN* and MAX_IRQS_PER_TABLE macro
AMD iommu can support both 512 and 2K interrupts on newer platform. Hence add suffix "512" to the existing macros. Signed-off-by: Sairaj Kodilkar <[email protected]> Reviewed-by: Vasant Hegde <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent eaf717f commit 950865c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

drivers/iommu/amd/amd_iommu_types.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,10 @@
313313
* AMD IOMMU hardware only support 512 IRTEs despite
314314
* the architectural limitation of 2048 entries.
315315
*/
316-
#define DTE_INTTABLEN_VALUE 9ULL
317-
#define DTE_INTTABLEN (DTE_INTTABLEN_VALUE << 1)
318316
#define DTE_INTTABLEN_MASK (0xfULL << 1)
319-
#define MAX_IRQS_PER_TABLE (1 << DTE_INTTABLEN_VALUE)
317+
#define DTE_INTTABLEN_VALUE_512 9ULL
318+
#define DTE_INTTABLEN_512 (DTE_INTTABLEN_VALUE_512 << 1)
319+
#define MAX_IRQS_PER_TABLE_512 BIT(DTE_INTTABLEN_VALUE_512)
320320

321321
#define PAGE_MODE_NONE 0x00
322322
#define PAGE_MODE_1_LEVEL 0x01

drivers/iommu/amd/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ static bool __copy_device_table(struct amd_iommu *iommu)
10601060
int_tab_len = old_devtb[devid].data[2] & DTE_INTTABLEN_MASK;
10611061
if (irq_v && (int_ctl || int_tab_len)) {
10621062
if ((int_ctl != DTE_IRQ_REMAP_INTCTL) ||
1063-
(int_tab_len != DTE_INTTABLEN)) {
1063+
(int_tab_len != DTE_INTTABLEN_512)) {
10641064
pr_err("Wrong old irq remapping flag: %#x\n", devid);
10651065
memunmap(old_devtb);
10661066
return false;

drivers/iommu/amd/iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3090,7 +3090,7 @@ static void set_dte_irq_entry(struct amd_iommu *iommu, u16 devid,
30903090
new &= ~DTE_IRQ_PHYS_ADDR_MASK;
30913091
new |= iommu_virt_to_phys(table->table);
30923092
new |= DTE_IRQ_REMAP_INTCTL;
3093-
new |= DTE_INTTABLEN;
3093+
new |= DTE_INTTABLEN_512;
30943094
new |= DTE_IRQ_REMAP_ENABLE;
30953095
WRITE_ONCE(dte->data[2], new);
30963096

0 commit comments

Comments
 (0)