Commit 9f10e5bf authored by Joerg Roedel's avatar Joerg Roedel

iommu/vt-d: Cleanup log messages

Give them a common prefix that can be grepped for and
improve the wording here and there.
Tested-by: default avatarZhenHua Li <zhen-hual@hp.com>
Tested-by: default avatarBaoquan He <bhe@redhat.com>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 0f57d867
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
* These routines are used by both DMA-remapping and Interrupt-remapping * These routines are used by both DMA-remapping and Interrupt-remapping
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt /* has to precede printk.h */ #define pr_fmt(fmt) "DMAR: " fmt
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/dmar.h> #include <linux/dmar.h>
...@@ -555,7 +555,7 @@ static int dmar_walk_remapping_entries(struct acpi_dmar_header *start, ...@@ -555,7 +555,7 @@ static int dmar_walk_remapping_entries(struct acpi_dmar_header *start,
break; break;
} else if (next > end) { } else if (next > end) {
/* Avoid passing table end */ /* Avoid passing table end */
pr_warn(FW_BUG "record passes table end\n"); pr_warn(FW_BUG "Record passes table end\n");
ret = -EINVAL; ret = -EINVAL;
break; break;
} }
...@@ -802,7 +802,7 @@ int __init dmar_table_init(void) ...@@ -802,7 +802,7 @@ int __init dmar_table_init(void)
ret = parse_dmar_table(); ret = parse_dmar_table();
if (ret < 0) { if (ret < 0) {
if (ret != -ENODEV) if (ret != -ENODEV)
pr_info("parse DMAR table failure.\n"); pr_info("Parse DMAR table failure.\n");
} else if (list_empty(&dmar_drhd_units)) { } else if (list_empty(&dmar_drhd_units)) {
pr_info("No DMAR devices found\n"); pr_info("No DMAR devices found\n");
ret = -ENODEV; ret = -ENODEV;
...@@ -847,7 +847,7 @@ dmar_validate_one_drhd(struct acpi_dmar_header *entry, void *arg) ...@@ -847,7 +847,7 @@ dmar_validate_one_drhd(struct acpi_dmar_header *entry, void *arg)
else else
addr = early_ioremap(drhd->address, VTD_PAGE_SIZE); addr = early_ioremap(drhd->address, VTD_PAGE_SIZE);
if (!addr) { if (!addr) {
pr_warn("IOMMU: can't validate: %llx\n", drhd->address); pr_warn("Can't validate DRHD address: %llx\n", drhd->address);
return -EINVAL; return -EINVAL;
} }
...@@ -921,14 +921,14 @@ static int map_iommu(struct intel_iommu *iommu, u64 phys_addr) ...@@ -921,14 +921,14 @@ static int map_iommu(struct intel_iommu *iommu, u64 phys_addr)
iommu->reg_size = VTD_PAGE_SIZE; iommu->reg_size = VTD_PAGE_SIZE;
if (!request_mem_region(iommu->reg_phys, iommu->reg_size, iommu->name)) { if (!request_mem_region(iommu->reg_phys, iommu->reg_size, iommu->name)) {
pr_err("IOMMU: can't reserve memory\n"); pr_err("Can't reserve memory\n");
err = -EBUSY; err = -EBUSY;
goto out; goto out;
} }
iommu->reg = ioremap(iommu->reg_phys, iommu->reg_size); iommu->reg = ioremap(iommu->reg_phys, iommu->reg_size);
if (!iommu->reg) { if (!iommu->reg) {
pr_err("IOMMU: can't map the region\n"); pr_err("Can't map the region\n");
err = -ENOMEM; err = -ENOMEM;
goto release; goto release;
} }
...@@ -952,13 +952,13 @@ static int map_iommu(struct intel_iommu *iommu, u64 phys_addr) ...@@ -952,13 +952,13 @@ static int map_iommu(struct intel_iommu *iommu, u64 phys_addr)
iommu->reg_size = map_size; iommu->reg_size = map_size;
if (!request_mem_region(iommu->reg_phys, iommu->reg_size, if (!request_mem_region(iommu->reg_phys, iommu->reg_size,
iommu->name)) { iommu->name)) {
pr_err("IOMMU: can't reserve memory\n"); pr_err("Can't reserve memory\n");
err = -EBUSY; err = -EBUSY;
goto out; goto out;
} }
iommu->reg = ioremap(iommu->reg_phys, iommu->reg_size); iommu->reg = ioremap(iommu->reg_phys, iommu->reg_size);
if (!iommu->reg) { if (!iommu->reg) {
pr_err("IOMMU: can't map the region\n"); pr_err("Can't map the region\n");
err = -ENOMEM; err = -ENOMEM;
goto release; goto release;
} }
...@@ -1014,14 +1014,14 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd) ...@@ -1014,14 +1014,14 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd)
return -ENOMEM; return -ENOMEM;
if (dmar_alloc_seq_id(iommu) < 0) { if (dmar_alloc_seq_id(iommu) < 0) {
pr_err("IOMMU: failed to allocate seq_id\n"); pr_err("Failed to allocate seq_id\n");
err = -ENOSPC; err = -ENOSPC;
goto error; goto error;
} }
err = map_iommu(iommu, drhd->reg_base_addr); err = map_iommu(iommu, drhd->reg_base_addr);
if (err) { if (err) {
pr_err("IOMMU: failed to map %s\n", iommu->name); pr_err("Failed to map %s\n", iommu->name);
goto error_free_seq_id; goto error_free_seq_id;
} }
...@@ -1045,8 +1045,8 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd) ...@@ -1045,8 +1045,8 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd)
iommu->node = -1; iommu->node = -1;
ver = readl(iommu->reg + DMAR_VER_REG); ver = readl(iommu->reg + DMAR_VER_REG);
pr_info("IOMMU %d: reg_base_addr %llx ver %d:%d cap %llx ecap %llx\n", pr_info("%s: reg_base_addr %llx ver %d:%d cap %llx ecap %llx\n",
iommu->seq_id, iommu->name,
(unsigned long long)drhd->reg_base_addr, (unsigned long long)drhd->reg_base_addr,
DMAR_VER_MAJOR(ver), DMAR_VER_MINOR(ver), DMAR_VER_MAJOR(ver), DMAR_VER_MINOR(ver),
(unsigned long long)iommu->cap, (unsigned long long)iommu->cap,
...@@ -1644,7 +1644,7 @@ int dmar_set_interrupt(struct intel_iommu *iommu) ...@@ -1644,7 +1644,7 @@ int dmar_set_interrupt(struct intel_iommu *iommu)
irq = dmar_alloc_hwirq(); irq = dmar_alloc_hwirq();
if (irq <= 0) { if (irq <= 0) {
pr_err("IOMMU: no free vectors\n"); pr_err("No free IRQ vectors\n");
return -EINVAL; return -EINVAL;
} }
...@@ -1661,7 +1661,7 @@ int dmar_set_interrupt(struct intel_iommu *iommu) ...@@ -1661,7 +1661,7 @@ int dmar_set_interrupt(struct intel_iommu *iommu)
ret = request_irq(irq, dmar_fault, IRQF_NO_THREAD, iommu->name, iommu); ret = request_irq(irq, dmar_fault, IRQF_NO_THREAD, iommu->name, iommu);
if (ret) if (ret)
pr_err("IOMMU: can't request irq\n"); pr_err("Can't request irq\n");
return ret; return ret;
} }
......
This diff is collapsed.
#define pr_fmt(fmt) "DMAR-IR: " fmt
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/dmar.h> #include <linux/dmar.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
...@@ -100,8 +103,7 @@ static int alloc_irte(struct intel_iommu *iommu, int irq, u16 count) ...@@ -100,8 +103,7 @@ static int alloc_irte(struct intel_iommu *iommu, int irq, u16 count)
} }
if (mask > ecap_max_handle_mask(iommu->ecap)) { if (mask > ecap_max_handle_mask(iommu->ecap)) {
printk(KERN_ERR pr_err("Requested mask %x exceeds the max invalidation handle"
"Requested mask %x exceeds the max invalidation handle"
" mask value %Lx\n", mask, " mask value %Lx\n", mask,
ecap_max_handle_mask(iommu->ecap)); ecap_max_handle_mask(iommu->ecap));
return -1; return -1;
...@@ -333,7 +335,7 @@ static int set_ioapic_sid(struct irte *irte, int apic) ...@@ -333,7 +335,7 @@ static int set_ioapic_sid(struct irte *irte, int apic)
up_read(&dmar_global_lock); up_read(&dmar_global_lock);
if (sid == 0) { if (sid == 0) {
pr_warning("Failed to set source-id of IOAPIC (%d)\n", apic); pr_warn("Failed to set source-id of IOAPIC (%d)\n", apic);
return -1; return -1;
} }
...@@ -360,7 +362,7 @@ static int set_hpet_sid(struct irte *irte, u8 id) ...@@ -360,7 +362,7 @@ static int set_hpet_sid(struct irte *irte, u8 id)
up_read(&dmar_global_lock); up_read(&dmar_global_lock);
if (sid == 0) { if (sid == 0) {
pr_warning("Failed to set source-id of HPET block (%d)\n", id); pr_warn("Failed to set source-id of HPET block (%d)\n", id);
return -1; return -1;
} }
...@@ -589,8 +591,7 @@ static int __init intel_prepare_irq_remapping(void) ...@@ -589,8 +591,7 @@ static int __init intel_prepare_irq_remapping(void)
struct intel_iommu *iommu; struct intel_iommu *iommu;
if (irq_remap_broken) { if (irq_remap_broken) {
printk(KERN_WARNING pr_warn("This system BIOS has enabled interrupt remapping\n"
"This system BIOS has enabled interrupt remapping\n"
"on a chipset that contains an erratum making that\n" "on a chipset that contains an erratum making that\n"
"feature unstable. To maintain system stability\n" "feature unstable. To maintain system stability\n"
"interrupt remapping is being disabled. Please\n" "interrupt remapping is being disabled. Please\n"
...@@ -606,7 +607,7 @@ static int __init intel_prepare_irq_remapping(void) ...@@ -606,7 +607,7 @@ static int __init intel_prepare_irq_remapping(void)
return -ENODEV; return -ENODEV;
if (parse_ioapics_under_ir() != 1) { if (parse_ioapics_under_ir() != 1) {
printk(KERN_INFO "Not enabling interrupt remapping\n"); pr_info("Not enabling interrupt remapping\n");
goto error; goto error;
} }
...@@ -667,7 +668,7 @@ static int __init intel_enable_irq_remapping(void) ...@@ -667,7 +668,7 @@ static int __init intel_enable_irq_remapping(void)
*/ */
for_each_iommu(iommu, drhd) for_each_iommu(iommu, drhd)
if (eim && !ecap_eim_support(iommu->ecap)) { if (eim && !ecap_eim_support(iommu->ecap)) {
printk(KERN_INFO "DRHD %Lx: EIM not supported by DRHD, " pr_info("DRHD %Lx: EIM not supported by DRHD, "
" ecap %Lx\n", drhd->reg_base_addr, iommu->ecap); " ecap %Lx\n", drhd->reg_base_addr, iommu->ecap);
eim = 0; eim = 0;
} }
...@@ -682,7 +683,7 @@ static int __init intel_enable_irq_remapping(void) ...@@ -682,7 +683,7 @@ static int __init intel_enable_irq_remapping(void)
int ret = dmar_enable_qi(iommu); int ret = dmar_enable_qi(iommu);
if (ret) { if (ret) {
printk(KERN_ERR "DRHD %Lx: failed to enable queued, " pr_err("DRHD %Lx: failed to enable queued, "
" invalidation, ecap %Lx, ret %d\n", " invalidation, ecap %Lx, ret %d\n",
drhd->reg_base_addr, iommu->ecap, ret); drhd->reg_base_addr, iommu->ecap, ret);
goto error; goto error;
...@@ -1145,14 +1146,12 @@ static int intel_msi_alloc_irq(struct pci_dev *dev, int irq, int nvec) ...@@ -1145,14 +1146,12 @@ static int intel_msi_alloc_irq(struct pci_dev *dev, int irq, int nvec)
down_read(&dmar_global_lock); down_read(&dmar_global_lock);
iommu = map_dev_to_ir(dev); iommu = map_dev_to_ir(dev);
if (!iommu) { if (!iommu) {
printk(KERN_ERR pr_err("Unable to map PCI %s to iommu\n", pci_name(dev));
"Unable to map PCI %s to iommu\n", pci_name(dev));
index = -ENOENT; index = -ENOENT;
} else { } else {
index = alloc_irte(iommu, irq, nvec); index = alloc_irte(iommu, irq, nvec);
if (index < 0) { if (index < 0) {
printk(KERN_ERR pr_err("Unable to allocate %d IRTE for PCI %s\n",
"Unable to allocate %d IRTE for PCI %s\n",
nvec, pci_name(dev)); nvec, pci_name(dev));
index = -ENOSPC; index = -ENOSPC;
} }
......
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