Skip to content

Commit f20a6e3

Browse files
ssuthiku-amdjoergroedel
authored andcommitted
iommu/amd: Misc ACPI IVRS debug info clean up
* Remove redundant AMD-Vi prefix. * Print IVHD device entry settings field using hex value. * Print root device of IVHD ACPI device entry using hex value. Signed-off-by: Suravee Suthikulpanit <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 78d4f34 commit f20a6e3

File tree

2 files changed

+16
-21
lines changed

2 files changed

+16
-21
lines changed

drivers/iommu/amd/amd_iommu_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ extern bool amd_iommu_dump;
468468
#define DUMP_printk(format, arg...) \
469469
do { \
470470
if (amd_iommu_dump) \
471-
pr_info("AMD-Vi: " format, ## arg); \
471+
pr_info(format, ## arg); \
472472
} while(0);
473473

474474
/* global flag if IOMMUs cache non-present entries */

drivers/iommu/amd/init.c

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,7 +1239,7 @@ static int __init add_acpi_hid_device(u8 *hid, u8 *uid, u32 *devid,
12391239
entry->cmd_line = cmd_line;
12401240
entry->root_devid = (entry->devid & (~0x7));
12411241

1242-
pr_info("%s, add hid:%s, uid:%s, rdevid:%d\n",
1242+
pr_info("%s, add hid:%s, uid:%s, rdevid:%#x\n",
12431243
entry->cmd_line ? "cmd" : "ivrs",
12441244
entry->hid, entry->uid, entry->root_devid);
12451245

@@ -1331,15 +1331,14 @@ static int __init init_iommu_from_acpi(struct amd_iommu *iommu,
13311331
switch (e->type) {
13321332
case IVHD_DEV_ALL:
13331333

1334-
DUMP_printk(" DEV_ALL\t\t\tflags: %02x\n", e->flags);
1334+
DUMP_printk(" DEV_ALL\t\t\tsetting: %#02x\n", e->flags);
13351335

13361336
for (dev_i = 0; dev_i <= pci_seg->last_bdf; ++dev_i)
13371337
set_dev_entry_from_acpi(iommu, dev_i, e->flags, 0);
13381338
break;
13391339
case IVHD_DEV_SELECT:
13401340

1341-
DUMP_printk(" DEV_SELECT\t\t\t devid: %04x:%02x:%02x.%x "
1342-
"flags: %02x\n",
1341+
DUMP_printk(" DEV_SELECT\t\t\tdevid: %04x:%02x:%02x.%x flags: %#02x\n",
13431342
seg_id, PCI_BUS_NUM(e->devid),
13441343
PCI_SLOT(e->devid),
13451344
PCI_FUNC(e->devid),
@@ -1350,8 +1349,7 @@ static int __init init_iommu_from_acpi(struct amd_iommu *iommu,
13501349
break;
13511350
case IVHD_DEV_SELECT_RANGE_START:
13521351

1353-
DUMP_printk(" DEV_SELECT_RANGE_START\t "
1354-
"devid: %04x:%02x:%02x.%x flags: %02x\n",
1352+
DUMP_printk(" DEV_SELECT_RANGE_START\tdevid: %04x:%02x:%02x.%x flags: %#02x\n",
13551353
seg_id, PCI_BUS_NUM(e->devid),
13561354
PCI_SLOT(e->devid),
13571355
PCI_FUNC(e->devid),
@@ -1364,8 +1362,7 @@ static int __init init_iommu_from_acpi(struct amd_iommu *iommu,
13641362
break;
13651363
case IVHD_DEV_ALIAS:
13661364

1367-
DUMP_printk(" DEV_ALIAS\t\t\t devid: %04x:%02x:%02x.%x "
1368-
"flags: %02x devid_to: %02x:%02x.%x\n",
1365+
DUMP_printk(" DEV_ALIAS\t\t\tdevid: %04x:%02x:%02x.%x flags: %#02x devid_to: %02x:%02x.%x\n",
13691366
seg_id, PCI_BUS_NUM(e->devid),
13701367
PCI_SLOT(e->devid),
13711368
PCI_FUNC(e->devid),
@@ -1382,9 +1379,7 @@ static int __init init_iommu_from_acpi(struct amd_iommu *iommu,
13821379
break;
13831380
case IVHD_DEV_ALIAS_RANGE:
13841381

1385-
DUMP_printk(" DEV_ALIAS_RANGE\t\t "
1386-
"devid: %04x:%02x:%02x.%x flags: %02x "
1387-
"devid_to: %04x:%02x:%02x.%x\n",
1382+
DUMP_printk(" DEV_ALIAS_RANGE\t\tdevid: %04x:%02x:%02x.%x flags: %#02x devid_to: %04x:%02x:%02x.%x\n",
13881383
seg_id, PCI_BUS_NUM(e->devid),
13891384
PCI_SLOT(e->devid),
13901385
PCI_FUNC(e->devid),
@@ -1401,8 +1396,7 @@ static int __init init_iommu_from_acpi(struct amd_iommu *iommu,
14011396
break;
14021397
case IVHD_DEV_EXT_SELECT:
14031398

1404-
DUMP_printk(" DEV_EXT_SELECT\t\t devid: %04x:%02x:%02x.%x "
1405-
"flags: %02x ext: %08x\n",
1399+
DUMP_printk(" DEV_EXT_SELECT\t\tdevid: %04x:%02x:%02x.%x flags: %#02x ext: %08x\n",
14061400
seg_id, PCI_BUS_NUM(e->devid),
14071401
PCI_SLOT(e->devid),
14081402
PCI_FUNC(e->devid),
@@ -1414,8 +1408,7 @@ static int __init init_iommu_from_acpi(struct amd_iommu *iommu,
14141408
break;
14151409
case IVHD_DEV_EXT_SELECT_RANGE:
14161410

1417-
DUMP_printk(" DEV_EXT_SELECT_RANGE\t devid: "
1418-
"%04x:%02x:%02x.%x flags: %02x ext: %08x\n",
1411+
DUMP_printk(" DEV_EXT_SELECT_RANGE\tdevid: %04x:%02x:%02x.%x flags: %#02x ext: %08x\n",
14191412
seg_id, PCI_BUS_NUM(e->devid),
14201413
PCI_SLOT(e->devid),
14211414
PCI_FUNC(e->devid),
@@ -1428,7 +1421,7 @@ static int __init init_iommu_from_acpi(struct amd_iommu *iommu,
14281421
break;
14291422
case IVHD_DEV_RANGE_END:
14301423

1431-
DUMP_printk(" DEV_RANGE_END\t\t devid: %04x:%02x:%02x.%x\n",
1424+
DUMP_printk(" DEV_RANGE_END\t\tdevid: %04x:%02x:%02x.%x\n",
14321425
seg_id, PCI_BUS_NUM(e->devid),
14331426
PCI_SLOT(e->devid),
14341427
PCI_FUNC(e->devid));
@@ -1461,11 +1454,12 @@ static int __init init_iommu_from_acpi(struct amd_iommu *iommu,
14611454
else
14621455
var = "UNKNOWN";
14631456

1464-
DUMP_printk(" DEV_SPECIAL(%s[%d])\t\tdevid: %04x:%02x:%02x.%x\n",
1457+
DUMP_printk(" DEV_SPECIAL(%s[%d])\t\tdevid: %04x:%02x:%02x.%x, flags: %#02x\n",
14651458
var, (int)handle,
14661459
seg_id, PCI_BUS_NUM(devid),
14671460
PCI_SLOT(devid),
1468-
PCI_FUNC(devid));
1461+
PCI_FUNC(devid),
1462+
e->flags);
14691463

14701464
ret = add_special_device(type, handle, &devid, false);
14711465
if (ret)
@@ -1525,11 +1519,12 @@ static int __init init_iommu_from_acpi(struct amd_iommu *iommu,
15251519
}
15261520

15271521
devid = PCI_SEG_DEVID_TO_SBDF(seg_id, e->devid);
1528-
DUMP_printk(" DEV_ACPI_HID(%s[%s])\t\tdevid: %04x:%02x:%02x.%x\n",
1522+
DUMP_printk(" DEV_ACPI_HID(%s[%s])\t\tdevid: %04x:%02x:%02x.%x, flags: %#02x\n",
15291523
hid, uid, seg_id,
15301524
PCI_BUS_NUM(devid),
15311525
PCI_SLOT(devid),
1532-
PCI_FUNC(devid));
1526+
PCI_FUNC(devid),
1527+
e->flags);
15331528

15341529
flags = e->flags;
15351530

0 commit comments

Comments
 (0)