aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2008-02-18 12:58:45 -0500
committerIngo Molnar <mingo@elte.hu>2008-02-19 10:18:34 -0500
commit156fbc3fbe4ab640297b1ae2092821363840aeb6 (patch)
tree285b14753f41e02e7641d96a8e5c23ae0c71c690
parentd8a9e6a51ec58486f850e3606e3fcb86b5b7da41 (diff)
x86: fix page_is_ram() thinko
page_is_ram() has a special case for the 640k-1M bios area, however due to a thinko the special case checks the e820 table entry and not the memory the user has asked for. This patch fixes the bug. [ mingo@elte.hu: this too is better solved in the e820 space, but those fixes are too intrusive for v2.6.25. ] Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--arch/x86/mm/ioremap.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index 7fb6eff644b3..f4c95aec5acb 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -50,6 +50,13 @@ int page_is_ram(unsigned long pagenr)
50 if (pagenr == 0) 50 if (pagenr == 0)
51 return 0; 51 return 0;
52 52
53 /*
54 * Second special case: Some BIOSen report the PC BIOS
55 * area (640->1Mb) as ram even though it is not.
56 */
57 if (pagenr >= (BIOS_BEGIN >> PAGE_SHIFT) &&
58 pagenr < (BIOS_END >> PAGE_SHIFT))
59 return 0;
53 60
54 for (i = 0; i < e820.nr_map; i++) { 61 for (i = 0; i < e820.nr_map; i++) {
55 /* 62 /*
@@ -60,14 +67,6 @@ int page_is_ram(unsigned long pagenr)
60 addr = (e820.map[i].addr + PAGE_SIZE-1) >> PAGE_SHIFT; 67 addr = (e820.map[i].addr + PAGE_SIZE-1) >> PAGE_SHIFT;
61 end = (e820.map[i].addr + e820.map[i].size) >> PAGE_SHIFT; 68 end = (e820.map[i].addr + e820.map[i].size) >> PAGE_SHIFT;
62 69
63 /*
64 * Sanity check: Some BIOSen report areas as RAM that
65 * are not. Notably the 640->1Mb area, which is the
66 * PCI BIOS area.
67 */
68 if (addr >= (BIOS_BEGIN >> PAGE_SHIFT) &&
69 end < (BIOS_END >> PAGE_SHIFT))
70 continue;
71 70
72 if ((pagenr >= addr) && (pagenr < end)) 71 if ((pagenr >= addr) && (pagenr < end))
73 return 1; 72 return 1;