Commit d64c0486 authored by Gary R Hook's avatar Gary R Hook Committed by Joerg Roedel

iommu/amd: Update the PASID information printed to the system log

Provide detailed data for each event, as appropriate.
Signed-off-by: default avatarGary R Hook <gary.hook@amd.com>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 6da6c0db
...@@ -545,7 +545,7 @@ static void amd_iommu_report_page_fault(u16 devid, u16 domain_id, ...@@ -545,7 +545,7 @@ static void amd_iommu_report_page_fault(u16 devid, u16 domain_id,
static void iommu_print_event(struct amd_iommu *iommu, void *__evt) static void iommu_print_event(struct amd_iommu *iommu, void *__evt)
{ {
struct device *dev = iommu->iommu.dev; struct device *dev = iommu->iommu.dev;
int type, devid, domid, flags; int type, devid, pasid, flags;
volatile u32 *event = __evt; volatile u32 *event = __evt;
int count = 0; int count = 0;
u64 address; u64 address;
...@@ -553,7 +553,7 @@ static void iommu_print_event(struct amd_iommu *iommu, void *__evt) ...@@ -553,7 +553,7 @@ static void iommu_print_event(struct amd_iommu *iommu, void *__evt)
retry: retry:
type = (event[1] >> EVENT_TYPE_SHIFT) & EVENT_TYPE_MASK; type = (event[1] >> EVENT_TYPE_SHIFT) & EVENT_TYPE_MASK;
devid = (event[0] >> EVENT_DEVID_SHIFT) & EVENT_DEVID_MASK; devid = (event[0] >> EVENT_DEVID_SHIFT) & EVENT_DEVID_MASK;
domid = (event[1] >> EVENT_DOMID_SHIFT) & EVENT_DOMID_MASK; pasid = PPR_PASID(*(u64 *)&event[0]);
flags = (event[1] >> EVENT_FLAGS_SHIFT) & EVENT_FLAGS_MASK; flags = (event[1] >> EVENT_FLAGS_SHIFT) & EVENT_FLAGS_MASK;
address = (u64)(((u64)event[3]) << 32) | event[2]; address = (u64)(((u64)event[3]) << 32) | event[2];
...@@ -568,7 +568,7 @@ static void iommu_print_event(struct amd_iommu *iommu, void *__evt) ...@@ -568,7 +568,7 @@ static void iommu_print_event(struct amd_iommu *iommu, void *__evt)
} }
if (type == EVENT_TYPE_IO_FAULT) { if (type == EVENT_TYPE_IO_FAULT) {
amd_iommu_report_page_fault(devid, domid, address, flags); amd_iommu_report_page_fault(devid, pasid, address, flags);
return; return;
} else { } else {
dev_err(dev, "AMD-Vi: Event logged ["); dev_err(dev, "AMD-Vi: Event logged [");
...@@ -576,10 +576,9 @@ static void iommu_print_event(struct amd_iommu *iommu, void *__evt) ...@@ -576,10 +576,9 @@ static void iommu_print_event(struct amd_iommu *iommu, void *__evt)
switch (type) { switch (type) {
case EVENT_TYPE_ILL_DEV: case EVENT_TYPE_ILL_DEV:
dev_err(dev, "ILLEGAL_DEV_TABLE_ENTRY device=%02x:%02x.%x " dev_err(dev, "ILLEGAL_DEV_TABLE_ENTRY device=%02x:%02x.%x pasid=0x%05x address=0x%016llx flags=0x%04x]\n",
"address=0x%016llx flags=0x%04x]\n",
PCI_BUS_NUM(devid), PCI_SLOT(devid), PCI_FUNC(devid), PCI_BUS_NUM(devid), PCI_SLOT(devid), PCI_FUNC(devid),
address, flags); pasid, address, flags);
dump_dte_entry(devid); dump_dte_entry(devid);
break; break;
case EVENT_TYPE_DEV_TAB_ERR: case EVENT_TYPE_DEV_TAB_ERR:
...@@ -589,34 +588,30 @@ static void iommu_print_event(struct amd_iommu *iommu, void *__evt) ...@@ -589,34 +588,30 @@ static void iommu_print_event(struct amd_iommu *iommu, void *__evt)
address, flags); address, flags);
break; break;
case EVENT_TYPE_PAGE_TAB_ERR: case EVENT_TYPE_PAGE_TAB_ERR:
dev_err(dev, "PAGE_TAB_HARDWARE_ERROR device=%02x:%02x.%x " dev_err(dev, "PAGE_TAB_HARDWARE_ERROR device=%02x:%02x.%x domain=0x%04x address=0x%016llx flags=0x%04x]\n",
"domain=0x%04x address=0x%016llx flags=0x%04x]\n",
PCI_BUS_NUM(devid), PCI_SLOT(devid), PCI_FUNC(devid), PCI_BUS_NUM(devid), PCI_SLOT(devid), PCI_FUNC(devid),
domid, address, flags); pasid, address, flags);
break; break;
case EVENT_TYPE_ILL_CMD: case EVENT_TYPE_ILL_CMD:
dev_err(dev, "ILLEGAL_COMMAND_ERROR address=0x%016llx]\n", address); dev_err(dev, "ILLEGAL_COMMAND_ERROR address=0x%016llx]\n", address);
dump_command(address); dump_command(address);
break; break;
case EVENT_TYPE_CMD_HARD_ERR: case EVENT_TYPE_CMD_HARD_ERR:
dev_err(dev, "COMMAND_HARDWARE_ERROR address=0x%016llx " dev_err(dev, "COMMAND_HARDWARE_ERROR address=0x%016llx flags=0x%04x]\n",
"flags=0x%04x]\n", address, flags); address, flags);
break; break;
case EVENT_TYPE_IOTLB_INV_TO: case EVENT_TYPE_IOTLB_INV_TO:
dev_err(dev, "IOTLB_INV_TIMEOUT device=%02x:%02x.%x " dev_err(dev, "IOTLB_INV_TIMEOUT device=%02x:%02x.%x address=0x%016llx]\n",
"address=0x%016llx]\n",
PCI_BUS_NUM(devid), PCI_SLOT(devid), PCI_FUNC(devid), PCI_BUS_NUM(devid), PCI_SLOT(devid), PCI_FUNC(devid),
address); address);
break; break;
case EVENT_TYPE_INV_DEV_REQ: case EVENT_TYPE_INV_DEV_REQ:
dev_err(dev, "INVALID_DEVICE_REQUEST device=%02x:%02x.%x " dev_err(dev, "INVALID_DEVICE_REQUEST device=%02x:%02x.%x pasid=0x%05x address=0x%016llx flags=0x%04x]\n",
"address=0x%016llx flags=0x%04x]\n",
PCI_BUS_NUM(devid), PCI_SLOT(devid), PCI_FUNC(devid), PCI_BUS_NUM(devid), PCI_SLOT(devid), PCI_FUNC(devid),
address, flags); pasid, address, flags);
break; break;
default: default:
dev_err(dev, KERN_ERR "UNKNOWN event[0]=0x%08x event[1]=0x%08x " dev_err(dev, "UNKNOWN event[0]=0x%08x event[1]=0x%08x event[2]=0x%08x event[3]=0x%08x\n",
"event[2]=0x%08x event[3]=0x%08x\n",
event[0], event[1], event[2], event[3]); event[0], event[1], event[2], event[3]);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment