[PATCH] PPC 85xx failure with odd memory sizes and CONFIG_HIGHMEM

STALE6919d

6 messages, 3 authors, 2007-10-03 · open the first message on its own page

[PATCH] PPC 85xx failure with odd memory sizes and CONFIG_HIGHMEM

From: Dale Farnsworth <hidden>
Date: 2007-10-03 19:01:43

From: Dale Farnsworth <redacted>

The CONFIG_FSL_BOOKE mmu setup code fails when CONFIG_HIGHMEM=y
and the 3 fixed TLB entries cannot exactly map the lowmem size.
Each TLB entry can map 4MB, 16MB, 64MB or 256MB, so the failure
is observed when the kernel lowmem size is not equal to the
sum of up to 3 of those values.

Normally, memory is sized in nice numbers, but I observed this
problem while testing a crash dump kernel.  The failure can
also be observed by artificially reducing the kernel's main
memory via the mem= kernel command line parameter.

This commit fixes the problem by setting __initial_memory_limit
in adjust_total_lowmem().

Signed-off-by: Dale Farnsworth <redacted>

---
 arch/powerpc/mm/fsl_booke_mmu.c |    2 ++
 1 file changed, 2 insertions(+)

Index: linux-2.6.21/arch/powerpc/mm/fsl_booke_mmu.c
===================================================================
--- linux-2.6.21.orig/arch/powerpc/mm/fsl_booke_mmu.c	2007-10-02 01:18:10.000000000 +0000
+++ linux-2.6.21/arch/powerpc/mm/fsl_booke_mmu.c	2007-10-03 16:40:24.000000000 +0000
@@ -60,6 +60,7 @@ unsigned int num_tlbcam_entries;
 static unsigned long __cam0, __cam1, __cam2;
 extern unsigned long total_lowmem;
 extern unsigned long __max_low_memory;
+extern unsigned long __initial_memory_limit;
 #define MAX_LOW_MEM	CONFIG_LOWMEM_SIZE
 
 #define NUM_TLBCAMS	(16)
@@ -233,4 +234,5 @@ adjust_total_lowmem(void)
 			__cam0 >> 20, __cam1 >> 20, __cam2 >> 20,
 			(total_lowmem - __cam0 - __cam1 - __cam2) >> 20);
 	__max_low_memory = max_low_mem = __cam0 + __cam1 + __cam2;
+	__initial_memory_limit = __max_low_memory;
 }

RE: [PATCH] PPC 85xx failure with odd memory sizes and CONFIG_HIGHMEM

From: Rune Torgersen <hidden>
Date: 2007-10-03 19:34:46

From: Dale Farnsworth
=20
The CONFIG_FSL_BOOKE mmu setup code fails when CONFIG_HIGHMEM=3Dy
and the 3 fixed TLB entries cannot exactly map the lowmem size.
Each TLB entry can map 4MB, 16MB, 64MB or 256MB, so the failure
is observed when the kernel lowmem size is not equal to the
sum of up to 3 of those values.
Does this mean you cannot run 1G of lowmem on a 85xx?

On 82xx I run 1G of lowmem, and when we finaly upgrade our product to a
85xx something, Iw was planning on doing the same.

(For those interested:
To run 1G lowmwm on 82xx (at least under arch/ppc)
CONFIG_ADVANCED_OPTIONS=3Dy
CONFIG_HIGHMEM_START=3D0xfe000000
CONFIG_LOWMEM_SIZE_BOOL=3Dy
CONFIG_LOWMEM_SIZE=3D0x40000000
CONFIG_KERNEL_START_BOOL=3Dy
CONFIG_KERNEL_START=3D0xa0000000

Re: [PATCH] PPC 85xx failure with odd memory sizes and CONFIG_HIGHMEM

From: Dale Farnsworth <hidden>
Date: 2007-10-03 19:51:29

On Wed, Oct 03, 2007 at 02:34:42PM -0500, Rune Torgersen wrote:
quoted
From: Dale Farnsworth

The CONFIG_FSL_BOOKE mmu setup code fails when CONFIG_HIGHMEM=y
and the 3 fixed TLB entries cannot exactly map the lowmem size.
Each TLB entry can map 4MB, 16MB, 64MB or 256MB, so the failure
is observed when the kernel lowmem size is not equal to the
sum of up to 3 of those values.
Does this mean you cannot run 1G of lowmem on a 85xx?
I think you can, and maybe I should have added 1GB to my list of
sizes above.  But, my 85xx system only has 256MB, so I can't test
it.

-Dale

Re: [PATCH] PPC 85xx failure with odd memory sizes and CONFIG_HIGHMEM

From: Kumar Gala <hidden>
Date: 2007-10-03 20:50:03

On Oct 3, 2007, at 2:34 PM, Rune Torgersen wrote:
quoted
From: Dale Farnsworth

The CONFIG_FSL_BOOKE mmu setup code fails when CONFIG_HIGHMEM=y
and the 3 fixed TLB entries cannot exactly map the lowmem size.
Each TLB entry can map 4MB, 16MB, 64MB or 256MB, so the failure
is observed when the kernel lowmem size is not equal to the
sum of up to 3 of those values.
Does this mean you cannot run 1G of lowmem on a 85xx?

On 82xx I run 1G of lowmem, and when we finaly upgrade our product  
to a
85xx something, Iw was planning on doing the same.
The code would have to change to allow for 1G of lowmem.

Max lowmem with KERNELBASE @ 0xc000_0000 is 768M.

- k

RE: [PATCH] PPC 85xx failure with odd memory sizes and CONFIG_HIGHMEM

From: Rune Torgersen <hidden>
Date: 2007-10-03 21:45:05

From: Kumar Gala
The code would have to change to allow for 1G of lowmem.
Max lowmem with KERNELBASE @ 0xc000_0000 is 768M.
Which is why I asked. On 82xx it is supported without a codechange by
setting KERNELBASE to 0xa000_0000 in Kconfig menu (and also changing
start of virtual mem, also done by config option).

Re: [PATCH] PPC 85xx failure with odd memory sizes and CONFIG_HIGHMEM

From: Kumar Gala <hidden>
Date: 2007-10-03 22:48:34

On Oct 3, 2007, at 4:45 PM, Rune Torgersen wrote:
quoted
From: Kumar Gala
The code would have to change to allow for 1G of lowmem.
Max lowmem with KERNELBASE @ 0xc000_0000 is 768M.
Which is why I asked. On 82xx it is supported without a codechange by
setting KERNELBASE to 0xa000_0000 in Kconfig menu (and also changing
start of virtual mem, also done by config option).
we could make this work.  Its just no one's griped about needing it  
to date.

Its a bit of testing to make sure we respect the kernel config  
changes and a slight be of code to handle using up to 1G TLB sizes on  
e500v2 or greater.

- k
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help