summaryrefslogtreecommitdiffstats
path: root/arch/ppc64/mm/slb_low.S
diff options
context:
space:
mode:
authorDavid Gibson2005-08-11 08:55:21 +0200
committerPaul Mackerras2005-08-29 02:53:38 +0200
commitc594adad5653491813959277fb87a2fef54c4e05 (patch)
treebaefdce10a0b490017b0a5acbe9dbeb8cb14c003 /arch/ppc64/mm/slb_low.S
parent[PATCH] ppc64: Check of_chosen in check_for_initrd() (diff)
downloadkernel-qcow2-linux-c594adad5653491813959277fb87a2fef54c4e05.tar.gz
kernel-qcow2-linux-c594adad5653491813959277fb87a2fef54c4e05.tar.xz
kernel-qcow2-linux-c594adad5653491813959277fb87a2fef54c4e05.zip
[PATCH] Dynamic hugepage addresses for ppc64
Paulus, I think this is now a reasonable candidate for the post-2.6.13 queue. Relax address restrictions for hugepages on ppc64 Presently, 64-bit applications on ppc64 may only use hugepages in the address region from 1-1.5T. Furthermore, if hugepages are enabled in the kernel config, they may only use hugepages and never normal pages in this area. This patch relaxes this restriction, allowing any address to be used with hugepages, but with a 1TB granularity. That is if you map a hugepage anywhere in the region 1TB-2TB, that entire area will be reserved exclusively for hugepages for the remainder of the process's lifetime. This works analagously to hugepages in 32-bit applications, where hugepages can be mapped anywhere, but with 256MB (mmu segment) granularity. This patch applies on top of the four level pagetable patch (http://patchwork.ozlabs.org/linuxppc64/patch?id=1936). Signed-off-by: David Gibson <dwg@au1.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/ppc64/mm/slb_low.S')
-rw-r--r--arch/ppc64/mm/slb_low.S23
1 files changed, 12 insertions, 11 deletions
diff --git a/arch/ppc64/mm/slb_low.S b/arch/ppc64/mm/slb_low.S
index f20fc52483a7..bab255889c58 100644
--- a/arch/ppc64/mm/slb_low.S
+++ b/arch/ppc64/mm/slb_low.S
@@ -89,28 +89,29 @@ END_FTR_SECTION_IFSET(CPU_FTR_16M_PAGE)
b 9f
0: /* user address: proto-VSID = context<<15 | ESID */
- li r11,SLB_VSID_USER
-
srdi. r9,r3,USER_ESID_BITS
bne- 8f /* invalid ea bits set */
#ifdef CONFIG_HUGETLB_PAGE
BEGIN_FTR_SECTION
- /* check against the hugepage ranges */
- cmpldi r3,(TASK_HPAGE_END>>SID_SHIFT)
- bge 6f /* >= TASK_HPAGE_END */
- cmpldi r3,(TASK_HPAGE_BASE>>SID_SHIFT)
- bge 5f /* TASK_HPAGE_BASE..TASK_HPAGE_END */
+ lhz r9,PACAHIGHHTLBAREAS(r13)
+ srdi r11,r3,(HTLB_AREA_SHIFT-SID_SHIFT)
+ srd r9,r9,r11
+ andi. r9,r9,1
+ bne 5f
+
+ li r11,SLB_VSID_USER
+
cmpldi r3,16
- bge 6f /* 4GB..TASK_HPAGE_BASE */
+ bge 6f
- lhz r9,PACAHTLBSEGS(r13)
+ lhz r9,PACALOWHTLBAREAS(r13)
srd r9,r9,r3
andi. r9,r9,1
+
beq 6f
-5: /* this is a hugepage user address */
- li r11,(SLB_VSID_USER|SLB_VSID_L)
+5: li r11,SLB_VSID_USER|SLB_VSID_L
END_FTR_SECTION_IFSET(CPU_FTR_16M_PAGE)
#endif /* CONFIG_HUGETLB_PAGE */