diff options
author | Dave Kleikamp <shaggy@linux.vnet.ibm.com> | 2009-01-14 04:09:34 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-01-16 00:15:16 -0500 |
commit | 9ba0fdbfaed2e74005d87fab948c5522b86ff733 (patch) | |
tree | 723f6080b37a16e7b0a75e017c0886898c58b7d7 /arch/powerpc/mm/slice.c | |
parent | 5d9ee3ff3dbf815cd9ee18c166bb9b538e8057d2 (diff) |
powerpc: is_hugepage_only_range() must account for both 4kB and 64kB slices
powerpc: is_hugepage_only_range() must account for both 4kB and 64kB slices
The subpage_prot syscall fails on second and subsequent calls for a given
region, because is_hugepage_only_range() is mis-identifying the 4 kB
slices when the process has a 64 kB page size.
Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/mm/slice.c')
-rw-r--r-- | arch/powerpc/mm/slice.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c index db44e02e045b..ba5194817f8a 100644 --- a/arch/powerpc/mm/slice.c +++ b/arch/powerpc/mm/slice.c | |||
@@ -710,9 +710,18 @@ int is_hugepage_only_range(struct mm_struct *mm, unsigned long addr, | |||
710 | unsigned long len) | 710 | unsigned long len) |
711 | { | 711 | { |
712 | struct slice_mask mask, available; | 712 | struct slice_mask mask, available; |
713 | unsigned int psize = mm->context.user_psize; | ||
713 | 714 | ||
714 | mask = slice_range_to_mask(addr, len); | 715 | mask = slice_range_to_mask(addr, len); |
715 | available = slice_mask_for_size(mm, mm->context.user_psize); | 716 | available = slice_mask_for_size(mm, psize); |
717 | #ifdef CONFIG_PPC_64K_PAGES | ||
718 | /* We need to account for 4k slices too */ | ||
719 | if (psize == MMU_PAGE_64K) { | ||
720 | struct slice_mask compat_mask; | ||
721 | compat_mask = slice_mask_for_size(mm, MMU_PAGE_4K); | ||
722 | or_mask(available, compat_mask); | ||
723 | } | ||
724 | #endif | ||
716 | 725 | ||
717 | #if 0 /* too verbose */ | 726 | #if 0 /* too verbose */ |
718 | slice_dbg("is_hugepage_only_range(mm=%p, addr=%lx, len=%lx)\n", | 727 | slice_dbg("is_hugepage_only_range(mm=%p, addr=%lx, len=%lx)\n", |