Commit d4bae497 authored by Alan Cox's avatar Alan Cox Committed by Jens Axboe

[PATCH] Add printk levels to mtrr, also clarify

The big thing here is actually turning
'Your bios sucks'
into
'Your bios sucks, but we fixed it and life is good, don't panic'

Which with a vendor hat on is important.  Its currently hard to tell
whether some Linux errors are things to worry about or merely spanking
the manufacturer.  I'd urge people writing error messages to think about
that btw - does it tell the user if the problem is fixed ?
parent 8e14bc0b
...@@ -83,15 +83,13 @@ void __init mtrr_state_warn(void) ...@@ -83,15 +83,13 @@ void __init mtrr_state_warn(void)
if (!mask) if (!mask)
return; return;
if (mask & MTRR_CHANGE_MASK_FIXED) if (mask & MTRR_CHANGE_MASK_FIXED)
printk printk(KERN_WARNING "mtrr: your CPUs had inconsistent fixed MTRR settings\n");
("mtrr: your CPUs had inconsistent fixed MTRR settings\n");
if (mask & MTRR_CHANGE_MASK_VARIABLE) if (mask & MTRR_CHANGE_MASK_VARIABLE)
printk printk(KERN_WARNING "mtrr: your CPUs had inconsistent variable MTRR settings\n");
("mtrr: your CPUs had inconsistent variable MTRR settings\n");
if (mask & MTRR_CHANGE_MASK_DEFTYPE) if (mask & MTRR_CHANGE_MASK_DEFTYPE)
printk printk(KERN_WARNING "mtrr: your CPUs had inconsistent MTRRdefType settings\n");
("mtrr: your CPUs had inconsistent MTRRdefType settings\n"); printk(KERN_INFO "mtrr: probably your BIOS does not setup all CPUs.\n");
printk("mtrr: probably your BIOS does not setup all CPUs\n"); printk(KERN_INFO "mtrr: corrected configuration.\n");
} }
...@@ -338,23 +336,19 @@ int generic_validate_add_page(unsigned long base, unsigned long size, unsigned i ...@@ -338,23 +336,19 @@ int generic_validate_add_page(unsigned long base, unsigned long size, unsigned i
boot_cpu_data.x86_model == 1 && boot_cpu_data.x86_model == 1 &&
boot_cpu_data.x86_mask <= 7) { boot_cpu_data.x86_mask <= 7) {
if (base & ((1 << (22 - PAGE_SHIFT)) - 1)) { if (base & ((1 << (22 - PAGE_SHIFT)) - 1)) {
printk(KERN_WARNING printk(KERN_WARNING "mtrr: base(0x%lx000) is not 4 MiB aligned\n", base);
"mtrr: base(0x%lx000) is not 4 MiB aligned\n",
base);
return -EINVAL; return -EINVAL;
} }
if (!(base + size < 0x70000000 || base > 0x7003FFFF) && if (!(base + size < 0x70000000 || base > 0x7003FFFF) &&
(type == MTRR_TYPE_WRCOMB (type == MTRR_TYPE_WRCOMB
|| type == MTRR_TYPE_WRBACK)) { || type == MTRR_TYPE_WRBACK)) {
printk(KERN_WARNING printk(KERN_WARNING "mtrr: writable mtrr between 0x70000000 and 0x7003FFFF may hang the CPU.\n");
"mtrr: writable mtrr between 0x70000000 and 0x7003FFFF may hang the CPU.\n");
return -EINVAL; return -EINVAL;
} }
} }
if (base + size < 0x100) { if (base + size < 0x100) {
printk(KERN_WARNING printk(KERN_WARNING "mtrr: cannot set region below 1 MiB (0x%lx000,0x%lx000)\n",
"mtrr: cannot set region below 1 MiB (0x%lx000,0x%lx000)\n",
base, size); base, size);
return -EINVAL; return -EINVAL;
} }
...@@ -364,8 +358,7 @@ int generic_validate_add_page(unsigned long base, unsigned long size, unsigned i ...@@ -364,8 +358,7 @@ int generic_validate_add_page(unsigned long base, unsigned long size, unsigned i
for (lbase = base; !(lbase & 1) && (last & 1); for (lbase = base; !(lbase & 1) && (last & 1);
lbase = lbase >> 1, last = last >> 1) ; lbase = lbase >> 1, last = last >> 1) ;
if (lbase != last) { if (lbase != last) {
printk(KERN_WARNING printk(KERN_WARNING "mtrr: base(0x%lx000) is not aligned on a size(0x%lx000) boundary\n",
"mtrr: base(0x%lx000) is not aligned on a size(0x%lx000) boundary\n",
base, size); base, size);
return -EINVAL; return -EINVAL;
} }
......
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