[POWERPC] Allocate the hash table under 1G on cell

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Wednesday, January 30, 2008 - 8:08 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=41d824...
Commit:     41d824bf61b507c001868861cddda25eaab23cd7
Parent:     1f62a1626e53e7b851e3e059cbd2fdc99cb85c05
Author:     Michael Ellerman <michael@ellerman.id.au>
AuthorDate: Wed Jan 30 01:13:59 2008 +1100
Committer:  Paul Mackerras <paulus@samba.org>
CommitDate: Thu Jan 31 12:11:09 2008 +1100

    [POWERPC] Allocate the hash table under 1G on cell
    
    In order to support the fixed IOMMU mapping (in a subsequent patch),
    we need the hash table to be inside the IOMMUs DMA window.  This is
    usually 2G, but let's make sure the hash table is under 1G as that
    will satisfy the IOMMU requirements and also means the hash table will
    be on node 0.
    
    Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
    Acked-by: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: Paul Mackerras <paulus@samba.org>
---
 arch/powerpc/mm/hash_utils_64.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index 7b4cacb..32f4161 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -471,7 +471,7 @@ void __init htab_initialize(void)
 	unsigned long table;
 	unsigned long pteg_count;
 	unsigned long mode_rw;
-	unsigned long base = 0, size = 0;
+	unsigned long base = 0, size = 0, limit;
 	int i;
 
 	extern unsigned long tce_alloc_start, tce_alloc_end;
@@ -505,9 +505,15 @@ void __init htab_initialize(void)
 		_SDR1 = 0; 
 	} else {
 		/* Find storage for the HPT.  Must be contiguous in
-		 * the absolute address space.
+		 * the absolute address space. On cell we want it to be
+		 * in the first 1 Gig.
 		 */
-		table = lmb_alloc(htab_size_bytes, htab_size_bytes);
+		if (machine_is(cell))
+			limit = 0x40000000;
+		else
+			limit = 0;
+
+		table = lmb_alloc_base(htab_size_bytes, htab_size_bytes, limit);
 
 		DBG("Hash table allocated at %lx, size: %lx\n", table,
 		    htab_size_bytes);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[POWERPC] Allocate the hash table under 1G on cell, Linux Kernel Mailing ..., (Wed Jan 30, 8:08 pm)