AMD/IOMMU: Render IO_PAGE_FAULT errors in a more useful manner
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 26 Nov 2019 14:37:27 +0000 (14:37 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 29 Nov 2019 18:57:32 +0000 (18:57 +0000)
commit680d18763aef6a0b9cb90dcff8e59a6a91fbfb77
tree087e86e851c9538ab7c9a75515da054101e48c61
parentb0282a69f42209f18e21be7dbfb4d8c1c6c7b902
AMD/IOMMU: Render IO_PAGE_FAULT errors in a more useful manner

Print the PCI coordinates in its common format and use d%u notation for the
domain.  As well as printing flags, decode them.  IO_PAGE_FAULT is used for
interrupt remapping errors as well as DMA remapping errors.

Before:
  (XEN) AMD-Vi: IO_PAGE_FAULT: domain = 0, device id = 0xa1, fault address = 0xbf695000, flags = 0x10
  (XEN) AMD-Vi: IO_PAGE_FAULT: domain = 0, device id = 0xa1, fault address = 0xbf695040, flags = 0x10
  (XEN) AMD-Vi: IO_PAGE_FAULT: domain = 0, device id = 0xa1, fault address = 0xfffffff0, flags = 0x30
  (XEN) AMD-Vi: IO_PAGE_FAULT: domain = 0, device id = 0xa1, fault address = 0x100000000, flags = 0x30
  (XEN) AMD-Vi: IO_PAGE_FAULT: domain = 0, device id = 0xa1, fault address = 0x100000040, flags = 0x30

After:
  (XEN) AMD-Vi: IO_PAGE_FAULT: 0000:00:14.1 d0 addr 00000000bf5fc000 flags 0x10 PR
  (XEN) AMD-Vi: IO_PAGE_FAULT: 0000:00:14.1 d0 addr 00000000bf5fc040 flags 0x10 PR
  (XEN) AMD-Vi: IO_PAGE_FAULT: 0000:00:14.1 d0 addr 00000000fffffff0 flags 0x30 RW PR
  (XEN) AMD-Vi: IO_PAGE_FAULT: 0000:00:14.1 d0 addr 0000000100000000 flags 0x30 RW PR
  (XEN) AMD-Vi: IO_PAGE_FAULT: 0000:00:14.1 d0 addr 0000000100000040 flags 0x30 RW PR

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/drivers/passthrough/amd/iommu_init.c
xen/include/asm-x86/hvm/svm/amd-iommu-proto.h