linux/include/asm-ppc64
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
..
abs_addr.h powerpc: move iSeries/iSeries_pci.h to platforms/iseries 2005-10-14 14:51:42 +10:00
btext.h ppc64: Rearrange btext initialization for consistency with ppc32 2005-10-22 15:36:52 +10:00
cache.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
cacheflush.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
compat.h [PATCH] compat: be more consistent about [ug]id_t 2005-09-07 16:57:19 -07:00
current.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
delay.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
dma-mapping.h [PATCH] gfp flags annotations - part 1 2005-10-08 15:00:57 -07:00
eeh.h [PATCH] basic iomem annotations (ppc64) 2005-09-09 10:31:57 -07:00
floppy.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
hvcall.h [PATCH] ppc64: Add ptrace data breakpoint support 2005-09-12 17:19:12 +10:00
hvconsole.h [PATCH] hvc_console: Register ops when setting up hvc_console 2005-07-07 18:23:39 -07:00
hvcserver.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
ide.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
imalloc.h [PATCH] Four level pagetables for ppc64 2005-08-29 10:53:31 +10:00
io.h merge filename and modify references to iseries/iseries_io.h 2005-11-02 15:07:51 +11:00
lppaca.h [PATCH] ppc64: Add VMX save flag to VPA 2005-09-05 00:06:01 -07:00
mmu.h [PATCH] ppc64: support 64k pages 2005-11-06 16:56:47 -08:00
mmu_context.h [PATCH] ppc64: support 64k pages 2005-11-06 16:56:47 -08:00
mmzone.h [PATCH] memory hotplug prep: kill local_mapnr 2005-10-29 21:40:44 -07:00
nvram.h [PATCH] powerpc: Rename BPA to Cell 2005-11-01 21:02:44 +11:00
paca.h [PATCH] ppc64: support 64k pages 2005-11-06 16:56:47 -08:00
page.h [PATCH] ppc64: support 64k pages 2005-11-06 16:56:47 -08:00
pci-bridge.h ppc64: Add a `primary' argument to pci_process_bridge_OF_ranges 2005-10-22 15:03:21 +10:00
pci.h [PATCH] ppc: make phys_mem_access_prot() work with pfns instead of addresses 2005-10-29 14:25:49 +10:00
pgalloc.h [PATCH] ppc64: support 64k pages 2005-11-06 16:56:47 -08:00
pgtable-4k.h [PATCH] ppc64: Fix bug in SLB miss handler for hugepages 2005-11-07 07:53:23 -08:00
pgtable-64k.h [PATCH] ppc64: Fix bug in SLB miss handler for hugepages 2005-11-07 07:53:23 -08:00
pgtable.h [PATCH] ppc64: support 64k pages 2005-11-06 16:56:47 -08:00
ppcdebug.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
prom.h [PATCH] ppc64: support 64k pages 2005-11-06 16:56:47 -08:00
ptrace-common.h [PATCH] ppc64: Add ptrace data breakpoint support 2005-09-12 17:19:12 +10:00
serial.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
signal.h [PATCH] asm/signal.h unification 2005-05-04 07:33:15 -07:00
spinlock.h merge filename and modify references to iseries/hv_call.h 2005-11-01 16:59:20 +11:00
system.h [PATCH] ppc64: support 64k pages 2005-11-06 16:56:47 -08:00
systemcfg.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
tce.h [PATCH] ppc64: Updated Olof iommu updates 2/3 2005-09-21 19:21:07 +10:00
udbg.h powerpc: Merge in 64-bit powermac support. 2005-10-22 16:02:39 +10:00
vdso.h [PATCH] ppc64: Improve mapping of vDSO 2005-04-16 15:24:35 -07:00