lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 26 Mar 2008 16:29:44 -0500
From:	Jon Tollefson <kniht@...ux.vnet.ibm.com>
To:	linux-kernel@...r.kernel.org,
	Linux Memory Management List <linux-mm@...ck.org>,
	linuxppc-dev <linuxppc-dev@...abs.org>
CC:	Adam Litke <agl@...ux.vnet.ibm.com>,
	Andi Kleen <andi@...stfloor.org>,
	Paul Mackerras <paulus@...ba.org>
Subject: [PATCH 4/4] powerpc: define page support for 16G pages

The huge page size is setup for 16G pages if that size is specified at boot-time.  The support for
multiple huge page sizes is not being utilized yet.  That will be in a future patch.


Signed-off-by: Jon Tollefson <kniht@...ux.vnet.ibm.com>
---

 hugetlbpage.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)


diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index 44d3d55..b6a02b7 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -26,6 +26,7 @@
 
 #define HPAGE_SHIFT_64K	16
 #define HPAGE_SHIFT_16M	24
+#define HPAGE_SHIFT_16G	34
 
 #define NUM_LOW_AREAS	(0x100000000UL >> SID_SHIFT)
 #define NUM_HIGH_AREAS	(PGTABLE_RANGE >> HTLB_AREA_SHIFT)
@@ -589,9 +590,11 @@ void set_huge_psize(int psize)
 {
 	/* Check that it is a page size supported by the hardware and
 	 * that it fits within pagetable limits. */
-	if (mmu_psize_defs[psize].shift && mmu_psize_defs[psize].shift < SID_SHIFT &&
+	if (mmu_psize_defs[psize].shift &&
+		mmu_psize_defs[psize].shift < SID_SHIFT_1T &&
 		(mmu_psize_defs[psize].shift > MIN_HUGEPTE_SHIFT ||
-			mmu_psize_defs[psize].shift == HPAGE_SHIFT_64K)) {
+		 mmu_psize_defs[psize].shift == HPAGE_SHIFT_64K ||
+		 mmu_psize_defs[psize].shift == HPAGE_SHIFT_16G)) {
 		HPAGE_SHIFT = mmu_psize_defs[psize].shift;
 		mmu_huge_psize = psize;
 #ifdef CONFIG_PPC_64K_PAGES
@@ -599,6 +602,8 @@ void set_huge_psize(int psize)
 #else
 		if (HPAGE_SHIFT == HPAGE_SHIFT_64K)
 			hugepte_shift = (PMD_SHIFT-HPAGE_SHIFT);
+		else if (HPAGE_SHIFT == HPAGE_SHIFT_16G)
+			hugepte_shift = (PGDIR_SHIFT-HPAGE_SHIFT);
 		else
 			hugepte_shift = (PUD_SHIFT-HPAGE_SHIFT);
 #endif
@@ -625,6 +630,9 @@ static int __init hugepage_setup_sz(char *str)
 	case HPAGE_SHIFT_16M:
 		mmu_psize = MMU_PAGE_16M;
 		break;
+	case HPAGE_SHIFT_16G:
+		mmu_psize = MMU_PAGE_16G;
+		break;
 	}
 
 	if (mmu_psize >=0 && mmu_psize_defs[mmu_psize].shift)



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ