linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc 8xx: Loading kernels over 8Mbytes without CONFIG_PIN_TLB
@ 2013-11-27 11:04 Christophe Leroy
  2013-12-06 19:09 ` Scott Wood
  0 siblings, 1 reply; 4+ messages in thread
From: Christophe Leroy @ 2013-11-27 11:04 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Paul Mackerras, scottwood
  Cc: linuxppc-dev, linux-kernel

Today, the only way to load kernels whose size is greater than 8Mbytes is to
activate CONFIG_PIN_TLB. Otherwise, the physical memory initially mapped is
limited to 8Mbytes. This patch sets up 24 Mbytes of initial memory regardless
of whether CONFIG_PIN_TLB is active or not. It allows to load "big" kernels
(for instance when activating CONFIG_LOCKDEP_SUPPORT) without having
to activate CONFIG_PIN_TLB.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

diff -ur a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
--- a/arch/powerpc/kernel/head_8xx.S
+++ b/arch/powerpc/kernel/head_8xx.S
@@ -841,11 +841,12 @@
 	ori	r8, r8, MI_BOOTINIT|0x2 /* Inhibit cache -- Cort */
 	mtspr	SPRN_MD_RPN, r8
 
-#ifdef CONFIG_PIN_TLB
 	/* Map two more 8M kernel data pages.
 	*/
+#ifdef CONFIG_PIN_TLB
 	addi	r10, r10, 0x0100
 	mtspr	SPRN_MD_CTR, r10
+#endif
 
 	lis	r8, KERNELBASE@h	/* Create vaddr for TLB */
 	addis	r8, r8, 0x0080		/* Add 8M */
@@ -858,15 +859,16 @@
 	addis	r11, r11, 0x0080	/* Add 8M */
 	mtspr	SPRN_MD_RPN, r11
 
+#ifdef CONFIG_PIN_TLB
 	addi	r10, r10, 0x0100
 	mtspr	SPRN_MD_CTR, r10
+#endif
 
 	addis	r8, r8, 0x0080		/* Add 8M */
 	mtspr	SPRN_MD_EPN, r8
 	mtspr	SPRN_MD_TWC, r9
 	addis	r11, r11, 0x0080	/* Add 8M */
 	mtspr	SPRN_MD_RPN, r11
-#endif
 
 	/* Since the cache is enabled according to the information we
 	 * just loaded into the TLB, invalidate and enable the caches here.
diff -ur a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c
--- a/arch/powerpc/mm/init_32.c
+++ b/arch/powerpc/mm/init_32.c
@@ -213,12 +213,7 @@
 	 */
 	BUG_ON(first_memblock_base != 0);
 
-#ifdef CONFIG_PIN_TLB
 	/* 8xx can only access 24MB at the moment */
 	memblock_set_current_limit(min_t(u64, first_memblock_size, 0x01800000));
-#else
-	/* 8xx can only access 8MB at the moment */
-	memblock_set_current_limit(min_t(u64, first_memblock_size, 0x00800000));
-#endif
 }
 #endif /* CONFIG_8xx */

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc 8xx: Loading kernels over 8Mbytes without CONFIG_PIN_TLB
  2013-11-27 11:04 [PATCH] powerpc 8xx: Loading kernels over 8Mbytes without CONFIG_PIN_TLB Christophe Leroy
@ 2013-12-06 19:09 ` Scott Wood
  2013-12-07  9:39   ` christophe leroy
  0 siblings, 1 reply; 4+ messages in thread
From: Scott Wood @ 2013-12-06 19:09 UTC (permalink / raw)
  To: Christophe Leroy; +Cc: linuxppc-dev, Paul Mackerras, linux-kernel

On Wed, 2013-11-27 at 12:04 +0100, Christophe Leroy wrote:
> Today, the only way to load kernels whose size is greater than 8Mbytes is to
> activate CONFIG_PIN_TLB. Otherwise, the physical memory initially mapped is
> limited to 8Mbytes. This patch sets up 24 Mbytes of initial memory regardless
> of whether CONFIG_PIN_TLB is active or not. It allows to load "big" kernels
> (for instance when activating CONFIG_LOCKDEP_SUPPORT) without having
> to activate CONFIG_PIN_TLB.

So, what happens on boards with less than 24M memory present?  Even if
you avoid explicitly referencing those addresses, what if there is a
speculative access -- or does 8xx not do that?

-Scott

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc 8xx: Loading kernels over 8Mbytes without CONFIG_PIN_TLB
  2013-12-06 19:09 ` Scott Wood
@ 2013-12-07  9:39   ` christophe leroy
  2013-12-07 20:58     ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 4+ messages in thread
From: christophe leroy @ 2013-12-07  9:39 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev, Paul Mackerras, linux-kernel


Le 06/12/2013 20:09, Scott Wood a écrit :
> On Wed, 2013-11-27 at 12:04 +0100, Christophe Leroy wrote:
>> Today, the only way to load kernels whose size is greater than 8Mbytes is to
>> activate CONFIG_PIN_TLB. Otherwise, the physical memory initially mapped is
>> limited to 8Mbytes. This patch sets up 24 Mbytes of initial memory regardless
>> of whether CONFIG_PIN_TLB is active or not. It allows to load "big" kernels
>> (for instance when activating CONFIG_LOCKDEP_SUPPORT) without having
>> to activate CONFIG_PIN_TLB.
> So, what happens on boards with less than 24M memory present?  Even if
> you avoid explicitly referencing those addresses, what if there is a
> speculative access -- or does 8xx not do that?
>
> -Scott
>

Function setup_initial_memory_limit() in mm/init_32.c defines the limits 
based on the parameters given by the bootloader.
As far as I know, the 8xx doesn't do speculative access just because an 
area is loaded in a TLB Entry.

Christophe

---
Ce courrier électronique ne contient aucun virus ou logiciel malveillant parce que la protection avast! Antivirus est active.
http://www.avast.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc 8xx: Loading kernels over 8Mbytes without CONFIG_PIN_TLB
  2013-12-07  9:39   ` christophe leroy
@ 2013-12-07 20:58     ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2013-12-07 20:58 UTC (permalink / raw)
  To: christophe leroy; +Cc: Scott Wood, linuxppc-dev, Paul Mackerras, linux-kernel

On Sat, 2013-12-07 at 10:39 +0100, christophe leroy wrote:
> Function setup_initial_memory_limit() in mm/init_32.c defines the
> limits 
> based on the parameters given by the bootloader.
> As far as I know, the 8xx doesn't do speculative access just because
> an area is loaded in a TLB Entry.

Speculative accesses are ... speculative :-) The address used for such
an access can be anything really. So yes, architecturally, powerpc
processors can access *anything* speculatively just because there's a
valid non-garded translation.

Whether the 8xx does it at all, I don't know. 44x originally did but
that was so buggy that we had to force G on all mappings (until later
versions of the core just burned the feature out). Pretty much all other
powerpc's do it.

Cheers,
Ben.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-12-07 20:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-27 11:04 [PATCH] powerpc 8xx: Loading kernels over 8Mbytes without CONFIG_PIN_TLB Christophe Leroy
2013-12-06 19:09 ` Scott Wood
2013-12-07  9:39   ` christophe leroy
2013-12-07 20:58     ` Benjamin Herrenschmidt

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).