Skip to content

Commit 558d2bb

Browse files
hegdevasantjoergroedel
authored andcommitted
iommu/amd: Log IOMMU control register in event log path
Useful for debugging ILLEGAL_DEV_TABLE_ENTRY events as some of the DTE settings depends on Control register settings. Signed-off-by: Vasant Hegde <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 0ad2507 commit 558d2bb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/iommu/amd/iommu.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ static void iommu_print_event(struct amd_iommu *iommu, void *__evt)
868868
int type, devid, flags, tag;
869869
volatile u32 *event = __evt;
870870
int count = 0;
871-
u64 address;
871+
u64 address, ctrl;
872872
u32 pasid;
873873

874874
retry:
@@ -878,6 +878,7 @@ static void iommu_print_event(struct amd_iommu *iommu, void *__evt)
878878
(event[1] & EVENT_DOMID_MASK_LO);
879879
flags = (event[1] >> EVENT_FLAGS_SHIFT) & EVENT_FLAGS_MASK;
880880
address = (u64)(((u64)event[3]) << 32) | event[2];
881+
ctrl = readq(iommu->mmio_base + MMIO_CONTROL_OFFSET);
881882

882883
if (type == 0) {
883884
/* Did we hit the erratum? */
@@ -899,6 +900,7 @@ static void iommu_print_event(struct amd_iommu *iommu, void *__evt)
899900
dev_err(dev, "Event logged [ILLEGAL_DEV_TABLE_ENTRY device=%04x:%02x:%02x.%x pasid=0x%05x address=0x%llx flags=0x%04x]\n",
900901
iommu->pci_seg->id, PCI_BUS_NUM(devid), PCI_SLOT(devid), PCI_FUNC(devid),
901902
pasid, address, flags);
903+
dev_err(dev, "Control Reg : 0x%llx\n", ctrl);
902904
dump_dte_entry(iommu, devid);
903905
break;
904906
case EVENT_TYPE_DEV_TAB_ERR:

0 commit comments

Comments
 (0)