All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MIPS: Calculate proper ebase value for 64-bit kernels
@ 2010-04-06 20:29 David Daney
  2010-04-07 15:39 ` Ralf Baechle
  2010-04-13  5:03 ` Wu Zhangjin
  0 siblings, 2 replies; 14+ messages in thread
From: David Daney @ 2010-04-06 20:29 UTC (permalink / raw)
  To: linux-mips, ralf; +Cc: David Daney

The ebase is relative to CKSEG0 not CAC_BASE.  On a 32-bit kernel they
are the same thing, for a 64-bit kernel they are not.

It happens to kind of work on a 64-bit kernel as they both reference
the same physical memory.  However since the CPU uses the CKSEG0 base,
determining if a J instruction will reach always gives the wrong
result unless we use the same number the CPU uses.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
---
 arch/mips/kernel/traps.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 7ce84bb..b122f76 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -1706,7 +1706,7 @@ void __init trap_init(void)
 		ebase = (unsigned long)
 			__alloc_bootmem(size, 1 << fls(size), 0);
 	} else {
-		ebase = CAC_BASE;
+		ebase = CKSEG0;
 		if (cpu_has_mips_r2)
 			ebase += (read_c0_ebase() & 0x3ffff000);
 	}
-- 
1.6.6.1

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

end of thread, other threads:[~2010-04-27 23:06 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <Pine.LNX.4.21.1004270049440.1248-100000@Mobile0.Peter>
2010-04-27  0:22 ` [PATCH] MIPS: Calculate proper ebase value for 64-bit kernels David Daney
2010-04-27  4:05   ` Wu Zhangjin
2010-04-06 20:29 David Daney
2010-04-07 15:39 ` Ralf Baechle
2010-04-13  5:03 ` Wu Zhangjin
2010-04-13  7:34   ` Thomas Bogendoerfer
2010-04-13 17:16     ` Ralf Baechle
2010-04-13 18:15       ` Thomas Bogendoerfer
2010-04-14  8:03       ` Wu Zhangjin
2010-04-14 11:24         ` Thomas Bogendoerfer
2010-04-26 12:13           ` Wu Zhangjin
2010-04-26 17:19         ` David Daney
2010-04-27  2:53           ` Wu Zhangjin
2010-04-27 23:06           ` Maciej W. Rozycki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.