summaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc
diff options
context:
space:
mode:
authorDavid Gibson2005-11-23 22:37:45 +0100
committerLinus Torvalds2005-11-24 01:08:39 +0100
commit5e391dc9e3fec68922137ae317bf680a74656c1b (patch)
tree9b262b96fff2f28e85a7e58c9cd69631655b781b /include/asm-powerpc
parent[PATCH] Fix crash in unregister_console() (diff)
downloadkernel-qcow2-linux-5e391dc9e3fec68922137ae317bf680a74656c1b.tar.gz
kernel-qcow2-linux-5e391dc9e3fec68922137ae317bf680a74656c1b.tar.xz
kernel-qcow2-linux-5e391dc9e3fec68922137ae317bf680a74656c1b.zip
[PATCH] powerpc: fix for hugepage areas straddling 4GB boundary
Commit 7d24f0b8a53261709938ffabe3e00f88f6498df9 fixed bugs in the ppc64 SLB miss handler with respect to hugepage handling, and in the process tweaked the semantics of the hugepage address masks in mm_context_t. Unfortunately, it left out a couple of necessary changes to go with that change. First, the in_hugepage_area() macro was not updated to match, second prepare_hugepage_range() was not updated to correctly handle hugepages regions which straddled the 4GB point. The latter appears only to cause process-hangs when attempting to map such a region, but the former can cause oopses if a get_user_pages() is triggered at the wrong point. This patch addresses both bugs. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r--include/asm-powerpc/page_64.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/asm-powerpc/page_64.h b/include/asm-powerpc/page_64.h
index 1e6e7846824f..58a3dd9a79ec 100644
--- a/include/asm-powerpc/page_64.h
+++ b/include/asm-powerpc/page_64.h
@@ -135,9 +135,9 @@ extern unsigned int HPAGE_SHIFT;
#define in_hugepage_area(context, addr) \
(cpu_has_feature(CPU_FTR_16M_PAGE) && \
- ( ((1 << GET_HTLB_AREA(addr)) & (context).high_htlb_areas) || \
- ( ((addr) < 0x100000000L) && \
- ((1 << GET_ESID(addr)) & (context).low_htlb_areas) ) ) )
+ ( ( (addr) >= 0x100000000UL) \
+ ? ((1 << GET_HTLB_AREA(addr)) & (context).high_htlb_areas) \
+ : ((1 << GET_ESID(addr)) & (context).low_htlb_areas) ) )
#else /* !CONFIG_HUGETLB_PAGE */