aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/cpu/mtrr/main.c
diff options
context:
space:
mode:
authorAndreas Mohr <andi@rhlx01.fht-esslingen.de>2006-12-06 20:14:00 -0500
committerAndi Kleen <andi@basil.nowhere.org>2006-12-06 20:14:00 -0500
commit9b483417527f2e47985856867c5716df013227c7 (patch)
tree35c6e2b73ebbb9c4a97ad5d9a6f7520fab1796ef /arch/i386/kernel/cpu/mtrr/main.c
parentdc3d1742543fffc79dc4d680ab64d2059e97d809 (diff)
[PATCH] i386: fix buggy MTRR address checks
Fix checks that failed to realize that values are 4-kB-unit-sized (note the format strings in this same diff context which *do* realize the unit size, via appended "000"!). Also fix an incorrect below-1MB area check (as gathered from Jan Beulich's unapplied patch at http://www.ussg.iu.edu/hypermail/linux/kernel/0411.1/1378.html ) Update mtrr_add_page() docu to make 4-kB-sized calculation more obvious. Given several further items mentioned in Jan's patch mail, all in all MTRR code seems surprisingly buggy, for a surprisingly long period of time (many years). Further work/investigation would be useful. TBD Note that my patch is pretty much UNTESTED, since I can only verify that it TBD successfully boots my machine, but I cannot test against actual buggy TBD hardware which would require these (formerly broken) checks. Long -mm TBD simmering would make sense, especially since these now-working checks might TBD turn out to have adverse effects on unaffected hardware. Signed-off-by: Andreas Mohr <andi@lisas.de> Signed-off-by: Andi Kleen <ak@suse.de> Acked-by: Jan Beulich <jbeulich@novell.com> Cc: Andi Kleen <ak@muc.de> Signed-off-by: Andrew Morton <akpm@osdl.org>
Diffstat (limited to 'arch/i386/kernel/cpu/mtrr/main.c')
-rw-r--r--arch/i386/kernel/cpu/mtrr/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/i386/kernel/cpu/mtrr/main.c b/arch/i386/kernel/cpu/mtrr/main.c
index fff90bda4733..2b8b0b361ccb 100644
--- a/arch/i386/kernel/cpu/mtrr/main.c
+++ b/arch/i386/kernel/cpu/mtrr/main.c
@@ -263,8 +263,8 @@ static void set_mtrr(unsigned int reg, unsigned long base,
263 263
264/** 264/**
265 * mtrr_add_page - Add a memory type region 265 * mtrr_add_page - Add a memory type region
266 * @base: Physical base address of region in pages (4 KB) 266 * @base: Physical base address of region in pages (in units of 4 kB!)
267 * @size: Physical size of region in pages (4 KB) 267 * @size: Physical size of region in pages (4 kB)
268 * @type: Type of MTRR desired 268 * @type: Type of MTRR desired
269 * @increment: If this is true do usage counting on the region 269 * @increment: If this is true do usage counting on the region
270 * 270 *