linux-stable/arch/powerpc/mm
David Gibson 7d24f0b8a5 [PATCH] ppc64: Fix bug in SLB miss handler for hugepages
This patch, however, should be applied on top of the 64k-page-size patch to
fix some problems with hugepage (some pre-existing, another introduced by
this patch).

The patch fixes a bug in the SLB miss handler for hugepages on ppc64
introduced by the dynamic hugepage patch (commit id
c594adad56) due to a misunderstanding of the
srd instruction's behaviour (mea culpa).  The problem arises when a 64-bit
process maps some hugepages in the low 4GB of the address space (unusual).
In this case, as well as the 256M segment in question being marked for
hugepages, other segments at 32G intervals will be incorrectly marked for
hugepages.

In the process, this patch tweaks the semantics of the hugepage bitmaps to
be more sensible.  Previously, an address below 4G was marked for hugepages
if the appropriate segment bit in the "low areas" bitmask was set *or* if
the low bit in the "high areas" bitmap was set (which would mark all
addresses below 1TB for hugepage).  With this patch, any given address is
governed by a single bitmap.  Addresses below 4GB are marked for hugepage
if and only if their bit is set in the "low areas" bitmap (256M
granularity).  Addresses between 4GB and 1TB are marked for hugepage iff
the low bit in the "high areas" bitmap is set.  Higher addresses are marked
for hugepage iff their bit in the "high areas" bitmap is set (1TB
granularity).

To avoid conflicts, this patch must be applied on top of BenH's pending
patch for 64k base page size [0].  As such, this patch also addresses a
hugepage problem introduced by that patch.  That patch allows hugepages of
1MB in size on hardware which supports it, however, that won't work when
using 4k pages (4 level pagetable), because in that case hugepage PTEs are
stored at the PMD level, and each PMD entry maps 2MB.  This patch simply
disallows hugepages in that case (we can do something cleverer to re-enable
them some other day).

Built, booted, and a handful of hugepage related tests passed on POWER5
LPAR (both ARCH=powerpc and ARCH=ppc64).

[0] http://gate.crashing.org/~benh/ppc64-64k-pages.diff

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-07 07:53:23 -08:00
..
4xx_mmu.c powerpc: Merge enough to start building in arch/powerpc. 2005-09-26 16:04:21 +10:00
44x_mmu.c powerpc: Merge enough to start building in arch/powerpc. 2005-09-26 16:04:21 +10:00
fault.c [PATCH] powerpc: Fix warning related to do_dabr 2005-10-27 20:51:19 +10:00
fsl_booke_mmu.c powerpc: Merge enough to start building in arch/powerpc. 2005-09-26 16:04:21 +10:00
hash_low_32.S powerpc: Use reg.h instead of processor.h when we just want reg names 2005-10-10 22:20:10 +10:00
hash_low_64.S [PATCH] ppc64: support 64k pages 2005-11-06 16:56:47 -08:00
hash_native_64.c [PATCH] ppc64: support 64k pages 2005-11-06 16:56:47 -08:00
hash_utils_64.c [PATCH] ppc64: Fix bug in SLB miss handler for hugepages 2005-11-07 07:53:23 -08:00
hugetlbpage.c [PATCH] ppc64: Fix bug in SLB miss handler for hugepages 2005-11-07 07:53:23 -08:00
imalloc.c powerpc: apply recent changes to merged code 2005-10-31 13:57:01 +11:00
init_32.c [PATCH] powerpc: Purge bootinfo.h 2005-10-27 20:50:46 +10:00
init_64.c [PATCH] ppc64: support 64k pages 2005-11-06 16:56:47 -08:00
lmb.c powerpc: Merge lmb.c and make MM initialization use it. 2005-10-06 12:23:33 +10:00
Makefile [PATCH] powerpc: Some more fixes to allow building for a Book-E processor 2005-10-20 09:43:32 +10:00
mem.c [PATCH] ppc64: support 64k pages 2005-11-06 16:56:47 -08:00
mmap.c powerpc: Merge arch/ppc64/mm to arch/powerpc/mm 2005-10-10 21:58:35 +10:00
mmu_context_32.c powerpc: Rename files to have consistent _32/_64 suffixes 2005-10-10 21:52:43 +10:00
mmu_context_64.c powerpc: Rename files to have consistent _32/_64 suffixes 2005-10-10 21:52:43 +10:00
mmu_decl.h powerpc: Merge arch/ppc64/mm to arch/powerpc/mm 2005-10-10 21:58:35 +10:00
numa.c powerpc: Fix bug arising from having multiple memory_limit variables 2005-10-31 13:07:02 +11:00
pgtable_32.c powerpc: import a fix from arch/ppc/mm/pgtable.c 2005-10-31 14:40:03 +11:00
pgtable_64.c [PATCH] ppc64: support 64k pages 2005-11-06 16:56:47 -08:00
ppc_mmu_32.c [PATCH] ppc64: support 64k pages 2005-11-06 16:56:47 -08:00
slb.c [PATCH] ppc64: support 64k pages 2005-11-06 16:56:47 -08:00
slb_low.S [PATCH] ppc64: Fix bug in SLB miss handler for hugepages 2005-11-07 07:53:23 -08:00
stab.c [PATCH] ppc64: support 64k pages 2005-11-06 16:56:47 -08:00
tlb_32.c powerpc: Rename files to have consistent _32/_64 suffixes 2005-10-10 21:52:43 +10:00
tlb_64.c [PATCH] ppc64: support 64k pages 2005-11-06 16:56:47 -08:00