aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2009-05-20 06:21:42 -0400
committerJoerg Roedel <joerg.roedel@amd.com>2009-05-28 11:49:56 -0400
commitfefda117ddb324b872312f1f061230e627c9f5ee (patch)
treee0c82c666562a4d285b8a87bbf260b68518651d8 /arch
parent41fb454ebe6024f5c1e3b3cbc0abc0da762e7b51 (diff)
amd-iommu: add amd_iommu_dump parameter
This kernel parameter will be useful to get some AMD IOMMU related information in dmesg that is not necessary for the default user but may be helpful in debug situations. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/amd_iommu_types.h6
-rw-r--r--arch/x86/kernel/amd_iommu_init.c10
2 files changed, 16 insertions, 0 deletions
diff --git a/arch/x86/include/asm/amd_iommu_types.h b/arch/x86/include/asm/amd_iommu_types.h
index 95c8cd9d22b5..89dfb3793edd 100644
--- a/arch/x86/include/asm/amd_iommu_types.h
+++ b/arch/x86/include/asm/amd_iommu_types.h
@@ -194,6 +194,12 @@
194#define PD_DMA_OPS_MASK (1UL << 0) /* domain used for dma_ops */ 194#define PD_DMA_OPS_MASK (1UL << 0) /* domain used for dma_ops */
195#define PD_DEFAULT_MASK (1UL << 1) /* domain is a default dma_ops 195#define PD_DEFAULT_MASK (1UL << 1) /* domain is a default dma_ops
196 domain for an IOMMU */ 196 domain for an IOMMU */
197extern bool amd_iommu_dump;
198#define DUMP_printk(format, arg...) \
199 do { \
200 if (amd_iommu_dump) \
201 printk(KERN_INFO "AMD IOMMU: " format, ## arg); \
202 } while(0);
197 203
198/* 204/*
199 * This structure contains generic data for IOMMU protection domains 205 * This structure contains generic data for IOMMU protection domains
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c
index 8c0be0902dac..57fb7a7cb6e8 100644
--- a/arch/x86/kernel/amd_iommu_init.c
+++ b/arch/x86/kernel/amd_iommu_init.c
@@ -115,6 +115,8 @@ struct ivmd_header {
115 u64 range_length; 115 u64 range_length;
116} __attribute__((packed)); 116} __attribute__((packed));
117 117
118bool amd_iommu_dump;
119
118static int __initdata amd_iommu_detected; 120static int __initdata amd_iommu_detected;
119 121
120u16 amd_iommu_last_bdf; /* largest PCI device id we have 122u16 amd_iommu_last_bdf; /* largest PCI device id we have
@@ -1211,6 +1213,13 @@ void __init amd_iommu_detect(void)
1211 * 1213 *
1212 ****************************************************************************/ 1214 ****************************************************************************/
1213 1215
1216static int __init parse_amd_iommu_dump(char *str)
1217{
1218 amd_iommu_dump = true;
1219
1220 return 1;
1221}
1222
1214static int __init parse_amd_iommu_options(char *str) 1223static int __init parse_amd_iommu_options(char *str)
1215{ 1224{
1216 for (; *str; ++str) { 1225 for (; *str; ++str) {
@@ -1235,5 +1244,6 @@ static int __init parse_amd_iommu_size_options(char *str)
1235 return 1; 1244 return 1;
1236} 1245}
1237 1246
1247__setup("amd_iommu_dump", parse_amd_iommu_dump);
1238__setup("amd_iommu=", parse_amd_iommu_options); 1248__setup("amd_iommu=", parse_amd_iommu_options);
1239__setup("amd_iommu_size=", parse_amd_iommu_size_options); 1249__setup("amd_iommu_size=", parse_amd_iommu_size_options);