* [PATCH] PPC 85xx failure with odd memory sizes and CONFIG_HIGHMEM
@ 2007-10-03 19:01 Dale Farnsworth
2007-10-03 19:34 ` Rune Torgersen
0 siblings, 1 reply; 6+ messages in thread
From: Dale Farnsworth @ 2007-10-03 19:01 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-embedded
From: Dale Farnsworth <dale@farnsworth.org>
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 <dale@farnsworth.org>
---
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;
}
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] PPC 85xx failure with odd memory sizes and CONFIG_HIGHMEM
2007-10-03 19:01 [PATCH] PPC 85xx failure with odd memory sizes and CONFIG_HIGHMEM Dale Farnsworth
@ 2007-10-03 19:34 ` Rune Torgersen
2007-10-03 19:51 ` Dale Farnsworth
2007-10-03 20:49 ` Kumar Gala
0 siblings, 2 replies; 6+ messages in thread
From: Rune Torgersen @ 2007-10-03 19:34 UTC (permalink / raw)
To: Dale Farnsworth, Kumar Gala; +Cc: linuxppc-embedded
> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] PPC 85xx failure with odd memory sizes and CONFIG_HIGHMEM
2007-10-03 19:34 ` Rune Torgersen
@ 2007-10-03 19:51 ` Dale Farnsworth
2007-10-03 20:49 ` Kumar Gala
1 sibling, 0 replies; 6+ messages in thread
From: Dale Farnsworth @ 2007-10-03 19:51 UTC (permalink / raw)
To: Rune Torgersen; +Cc: linuxppc-embedded
On Wed, Oct 03, 2007 at 02:34:42PM -0500, Rune Torgersen wrote:
> > 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] PPC 85xx failure with odd memory sizes and CONFIG_HIGHMEM
2007-10-03 19:34 ` Rune Torgersen
2007-10-03 19:51 ` Dale Farnsworth
@ 2007-10-03 20:49 ` Kumar Gala
2007-10-03 21:45 ` Rune Torgersen
1 sibling, 1 reply; 6+ messages in thread
From: Kumar Gala @ 2007-10-03 20:49 UTC (permalink / raw)
To: Rune Torgersen; +Cc: linuxppc-embedded
On Oct 3, 2007, at 2:34 PM, Rune Torgersen wrote:
>> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] PPC 85xx failure with odd memory sizes and CONFIG_HIGHMEM
2007-10-03 20:49 ` Kumar Gala
@ 2007-10-03 21:45 ` Rune Torgersen
2007-10-03 22:48 ` Kumar Gala
0 siblings, 1 reply; 6+ messages in thread
From: Rune Torgersen @ 2007-10-03 21:45 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-embedded
> 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).
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] PPC 85xx failure with odd memory sizes and CONFIG_HIGHMEM
2007-10-03 21:45 ` Rune Torgersen
@ 2007-10-03 22:48 ` Kumar Gala
0 siblings, 0 replies; 6+ messages in thread
From: Kumar Gala @ 2007-10-03 22:48 UTC (permalink / raw)
To: Rune Torgersen; +Cc: linuxppc-embedded
On Oct 3, 2007, at 4:45 PM, Rune Torgersen wrote:
>> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-10-03 22:48 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-03 19:01 [PATCH] PPC 85xx failure with odd memory sizes and CONFIG_HIGHMEM Dale Farnsworth
2007-10-03 19:34 ` Rune Torgersen
2007-10-03 19:51 ` Dale Farnsworth
2007-10-03 20:49 ` Kumar Gala
2007-10-03 21:45 ` Rune Torgersen
2007-10-03 22:48 ` Kumar Gala
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).