diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2009-03-12 13:03:48 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-03-12 19:09:09 -0400 |
commit | 1522ac3ec95ff0230e7aa516f86b674fdf72866c (patch) | |
tree | 77444039536e70b3e9fbb38f686104cb5054aba3 /arch/arm/mm/init.c | |
parent | 305b07680f6c6a7e59f996c5bd85f009caff5bb1 (diff) |
[ARM] Fix virtual to physical translation macro corner cases
The current use of these macros works well when the conversion is
entirely linear. In this case, we can be assured that the following
holds true:
__va(p + s) - s = __va(p)
However, this is not always the case, especially when there is a
non-linear conversion (eg, when there is a 3.5GB hole in memory.)
In this case, if 's' is the size of the region (eg, PAGE_SIZE) and
'p' is the final page, the above is most definitely not true.
So, we must ensure that __va() and __pa() are only used with valid
kernel direct mapped RAM addresses. This patch tweaks the code
to achieve this.
Tested-by: Charles Moschel <fred99@carolina.rr.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/init.c')
-rw-r--r-- | arch/arm/mm/init.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 34df4d9d03a6..80fd3b69ae1f 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
@@ -382,7 +382,7 @@ void __init bootmem_init(void) | |||
382 | for_each_node(node) | 382 | for_each_node(node) |
383 | bootmem_free_node(node, mi); | 383 | bootmem_free_node(node, mi); |
384 | 384 | ||
385 | high_memory = __va(memend_pfn << PAGE_SHIFT); | 385 | high_memory = __va((memend_pfn << PAGE_SHIFT) - 1) + 1; |
386 | 386 | ||
387 | /* | 387 | /* |
388 | * This doesn't seem to be used by the Linux memory manager any | 388 | * This doesn't seem to be used by the Linux memory manager any |