android_kernel_xiaomi_sm8350/arch
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
..
alpha [PATCH] jiffies_64 cleanup 2005-10-30 17:37:25 -08:00
arm [ARM] Fix /proc/cpuinfo format for ARM SMP 2005-11-06 21:41:08 +00:00
arm26 [PATCH] jiffies_64 cleanup 2005-10-30 17:37:25 -08:00
cris [PATCH] fix missing includes 2005-10-30 17:37:32 -08:00
frv [PATCH] jiffies_64 cleanup 2005-10-30 17:37:25 -08:00
h8300 [PATCH] jiffies_64 cleanup 2005-10-30 17:37:25 -08:00
i386 [PATCH] reset tss->io_bitmap_owner in sys_ioperm() 2005-11-05 16:31:36 -08:00
ia64 manual update from upstream: 2005-10-31 10:51:57 -08:00
m32r Merge master.kernel.org:/home/rmk/linux-2.6-drvmodel 2005-10-31 07:32:56 -08:00
m68k [PATCH] jiffies_64 cleanup 2005-10-30 17:37:25 -08:00
m68knommu [PATCH] m68knommu: updated defconfig 2005-11-01 21:41:19 -08:00
mips Merge master.kernel.org:/home/rmk/linux-2.6-drvmodel 2005-10-31 07:32:56 -08:00
parisc [PATCH] jiffies_64 cleanup 2005-10-30 17:37:25 -08:00
powerpc [PATCH] ppc64: Fix bug in SLB miss handler for hugepages 2005-11-07 07:53:23 -08:00
ppc powerpc: Merge smp.c and smp.h 2005-11-05 10:33:55 +11:00
ppc64 [PATCH] ppc64: support 64k pages 2005-11-06 16:56:47 -08:00
s390 [PATCH] jiffies_64 cleanup 2005-10-30 17:37:25 -08:00
sh Merge master.kernel.org:/home/rmk/linux-2.6-drvmodel 2005-10-31 07:32:56 -08:00
sh64 [PATCH] jiffies_64 cleanup 2005-10-30 17:37:25 -08:00
sparc [PATCH] jiffies_64 cleanup 2005-10-30 17:37:25 -08:00
sparc64 [PATCH] jiffies_64 cleanup 2005-10-30 17:37:25 -08:00
um [PATCH] missing platform_device.h includes 2005-11-01 21:50:01 -08:00
v850 [PATCH] jiffies_64 cleanup 2005-10-30 17:37:25 -08:00
x86_64 [PATCH] x86-64: bitops fix for -Os 2005-11-02 19:41:32 -08:00
xtensa Merge master.kernel.org:/home/rmk/linux-2.6-drvmodel 2005-10-31 07:32:56 -08:00