summaryrefslogtreecommitdiffstats
path: root/include/asm-x86/amd_iommu_types.h
diff options
context:
space:
mode:
authorJoerg Roedel2008-09-09 16:41:05 +0200
committerIngo Molnar2008-09-19 12:59:16 +0200
commit90008ee4b811c944455752dcb72b291a5ba81b53 (patch)
tree2c54f65efbabd7d9decbff49e12199eed00082b7 /include/asm-x86/amd_iommu_types.h
parentAMD IOMMU: add MSI interrupt support (diff)
downloadkernel-qcow2-linux-90008ee4b811c944455752dcb72b291a5ba81b53.tar.gz
kernel-qcow2-linux-90008ee4b811c944455752dcb72b291a5ba81b53.tar.xz
kernel-qcow2-linux-90008ee4b811c944455752dcb72b291a5ba81b53.zip
AMD IOMMU: add event handling code
This patch adds code for polling and printing out events generated by the AMD IOMMU. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-x86/amd_iommu_types.h')
-rw-r--r--include/asm-x86/amd_iommu_types.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/asm-x86/amd_iommu_types.h b/include/asm-x86/amd_iommu_types.h
index 8533f09b34b7..d8c5a6c69955 100644
--- a/include/asm-x86/amd_iommu_types.h
+++ b/include/asm-x86/amd_iommu_types.h
@@ -71,6 +71,25 @@
/* MMIO status bits */
#define MMIO_STATUS_COM_WAIT_INT_MASK 0x04
+/* event logging constants */
+#define EVENT_ENTRY_SIZE 0x10
+#define EVENT_TYPE_SHIFT 28
+#define EVENT_TYPE_MASK 0xf
+#define EVENT_TYPE_ILL_DEV 0x1
+#define EVENT_TYPE_IO_FAULT 0x2
+#define EVENT_TYPE_DEV_TAB_ERR 0x3
+#define EVENT_TYPE_PAGE_TAB_ERR 0x4
+#define EVENT_TYPE_ILL_CMD 0x5
+#define EVENT_TYPE_CMD_HARD_ERR 0x6
+#define EVENT_TYPE_IOTLB_INV_TO 0x7
+#define EVENT_TYPE_INV_DEV_REQ 0x8
+#define EVENT_DEVID_MASK 0xffff
+#define EVENT_DEVID_SHIFT 0
+#define EVENT_DOMID_MASK 0xffff
+#define EVENT_DOMID_SHIFT 0
+#define EVENT_FLAGS_MASK 0xfff
+#define EVENT_FLAGS_SHIFT 0x10
+
/* feature control bits */
#define CONTROL_IOMMU_EN 0x00ULL
#define CONTROL_HT_TUN_EN 0x01ULL
@@ -165,6 +184,9 @@
#define MAX_DOMAIN_ID 65536
+/* FIXME: move this macro to <linux/pci.h> */
+#define PCI_BUS(x) (((x) >> 8) & 0xff)
+
/*
* This structure contains generic data for IOMMU protection domains
* independent of their use.