diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index d3026e1906f92aaa7d20390754c3755b6a364bbe..24e42cab8d58a07c62aedc5da3d5fa40f3e2f54f 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c @@ -42,13 +42,18 @@ int page_is_ram(unsigned long pagenr) */ if (e820.map[i].type != E820_RAM) continue; - /* - * !!!FIXME!!! Some BIOSen report areas as RAM that - * are not. Notably the 640->1Mb area. We need a sanity - * check here. - */ addr = (e820.map[i].addr + PAGE_SIZE-1) >> PAGE_SHIFT; end = (e820.map[i].addr + e820.map[i].size) >> PAGE_SHIFT; + + /* + * Sanity check: Some BIOSen report areas as RAM that + * are not. Notably the 640->1Mb area, which is the + * PCI BIOS area. + */ + if (addr >= (BIOS_BEGIN >> PAGE_SHIFT) && + end < (BIOS_END >> PAGE_SHIFT)) + continue; + if ((pagenr >= addr) && (pagenr < end)) return 1; } diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index 19f7f7a0b36f4e4c8ad658de1a317e0985c1fe35..fcd96125c5ae763c59126af96eb2e2018d008cf7 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c @@ -9,18 +9,13 @@ #include #include +#include #include #include #include #include #include -/* - * We must allow the BIOS range to be executable: - */ -#define BIOS_BEGIN 0x000a0000 -#define BIOS_END 0x00100000 - static inline int within(unsigned long addr, unsigned long start, unsigned long end) { diff --git a/include/asm-x86/e820.h b/include/asm-x86/e820.h index f96f1853bc417f527f77ae26e7825e8fd2706c47..7004251fc66bd7925a787bd09ccb675dc0714de8 100644 --- a/include/asm-x86/e820.h +++ b/include/asm-x86/e820.h @@ -25,6 +25,9 @@ struct e820map { #define ISA_START_ADDRESS 0xa0000 #define ISA_END_ADDRESS 0x100000 +#define BIOS_BEGIN 0x000a0000 +#define BIOS_END 0x00100000 + #ifdef __KERNEL__ #ifdef CONFIG_X86_32 # include "e820_32.h"