Commit fefda117 authored by Joerg Roedel's avatar Joerg Roedel

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: default avatarJoerg Roedel <joerg.roedel@amd.com>
parent 41fb454e
...@@ -194,6 +194,12 @@ ...@@ -194,6 +194,12 @@
#define PD_DMA_OPS_MASK (1UL << 0) /* domain used for dma_ops */ #define PD_DMA_OPS_MASK (1UL << 0) /* domain used for dma_ops */
#define PD_DEFAULT_MASK (1UL << 1) /* domain is a default dma_ops #define PD_DEFAULT_MASK (1UL << 1) /* domain is a default dma_ops
domain for an IOMMU */ domain for an IOMMU */
extern bool amd_iommu_dump;
#define DUMP_printk(format, arg...) \
do { \
if (amd_iommu_dump) \
printk(KERN_INFO "AMD IOMMU: " format, ## arg); \
} while(0);
/* /*
* This structure contains generic data for IOMMU protection domains * This structure contains generic data for IOMMU protection domains
......
...@@ -115,6 +115,8 @@ struct ivmd_header { ...@@ -115,6 +115,8 @@ struct ivmd_header {
u64 range_length; u64 range_length;
} __attribute__((packed)); } __attribute__((packed));
bool amd_iommu_dump;
static int __initdata amd_iommu_detected; static int __initdata amd_iommu_detected;
u16 amd_iommu_last_bdf; /* largest PCI device id we have u16 amd_iommu_last_bdf; /* largest PCI device id we have
...@@ -1211,6 +1213,13 @@ void __init amd_iommu_detect(void) ...@@ -1211,6 +1213,13 @@ void __init amd_iommu_detect(void)
* *
****************************************************************************/ ****************************************************************************/
static int __init parse_amd_iommu_dump(char *str)
{
amd_iommu_dump = true;
return 1;
}
static int __init parse_amd_iommu_options(char *str) static int __init parse_amd_iommu_options(char *str)
{ {
for (; *str; ++str) { for (; *str; ++str) {
...@@ -1235,5 +1244,6 @@ static int __init parse_amd_iommu_size_options(char *str) ...@@ -1235,5 +1244,6 @@ static int __init parse_amd_iommu_size_options(char *str)
return 1; return 1;
} }
__setup("amd_iommu_dump", parse_amd_iommu_dump);
__setup("amd_iommu=", parse_amd_iommu_options); __setup("amd_iommu=", parse_amd_iommu_options);
__setup("amd_iommu_size=", parse_amd_iommu_size_options); __setup("amd_iommu_size=", parse_amd_iommu_size_options);
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