Commit 0cc880d1 authored by Dave Hansen's avatar Dave Hansen Committed by Linus Torvalds

[PATCH] make highmem_start access only valid addresses (i386)

When CONFIG_HIGHMEM=y, but ZONE_NORMAL isn't quite full, there is, of
course, no actual memory at *high_memory.  This isn't a problem with normal
virt<->phys translations because it's never dereferenced, but
CONFIG_NONLINEAR is a bit more finicky.  So, don't do __va() in
non-existent addresses.
Signed-off-by: default avatarDave Hansen <haveblue@us.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 8a59ebd4
......@@ -589,9 +589,9 @@ void __init mem_init(void)
set_max_mapnr_init();
#ifdef CONFIG_HIGHMEM
high_memory = (void *) __va(highstart_pfn * PAGE_SIZE);
high_memory = (void *) __va(highstart_pfn * PAGE_SIZE - 1) + 1;
#else
high_memory = (void *) __va(max_low_pfn * PAGE_SIZE);
high_memory = (void *) __va(max_low_pfn * PAGE_SIZE - 1) + 1;
#endif
/* this will put all low memory onto the freelists */
......
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