summaryrefslogtreecommitdiffstats
path: root/arch/x86_64/kernel/e820.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2006-08-30 19:37:12 +0200
committerLinus Torvalds <torvalds@g5.osdl.org>2006-08-31 01:05:15 +0200
commitceee88223047749ad683d397b19904c3dfb6adeb (patch)
tree0ffd471277ba53299690c444e669ea343cba145f /arch/x86_64/kernel/e820.c
parent[PATCH] x86: Make backtracer fallback logic more bullet-proof (diff)
downloadlinux-ceee88223047749ad683d397b19904c3dfb6adeb.tar.xz
linux-ceee88223047749ad683d397b19904c3dfb6adeb.zip
[PATCH] x86_64: Recover 1MB of kernel memory
Noticed by Jan Beulich. When the kernel was moved from 1MB to 2MB in 2.6.17 the kernel reservation code wasn't adjusted and it still reserved starting with 1MB. This means 1MB always were lost. This patch fixes this by reserving only starting with _text. Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64/kernel/e820.c')
-rw-r--r--arch/x86_64/kernel/e820.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/x86_64/kernel/e820.c b/arch/x86_64/kernel/e820.c
index d81e3d6dd241..764bf23c7103 100644
--- a/arch/x86_64/kernel/e820.c
+++ b/arch/x86_64/kernel/e820.c
@@ -71,7 +71,11 @@ static inline int bad_addr(unsigned long *addrp, unsigned long size)
#endif
/* kernel code + 640k memory hole (later should not be needed, but
be paranoid for now) */
- if (last >= 640*1024 && addr < __pa_symbol(&_end)) {
+ if (last >= 640*1024 && addr < 1024*1024) {
+ *addrp = 1024*1024;
+ return 1;
+ }
+ if (last >= __pa_symbol(&_text) && last < __pa_symbol(&_end)) {
*addrp = __pa_symbol(&_end);
return 1;
}