MIPS: R2: Fix problem with code that incorrectly modifies ebase.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, March 26, 2009 - 11:59 am

Gitweb:     http://git.kernel.org/linus/9fb4c2b9e06c0a197d867b34865b113a47370bd5
Commit:     9fb4c2b9e06c0a197d867b34865b113a47370bd5
Parent:     89e18eb331cc83fb4923bbc9a93beb5cb53eca0a
Author:     Chris Dearman <chris@mips.com>
AuthorDate: Fri Mar 20 15:33:55 2009 -0700
Committer:  Ralf Baechle <ralf@linux-mips.org>
CommitDate: Mon Mar 23 23:38:05 2009 +0100

    MIPS: R2: Fix problem with code that incorrectly modifies ebase.
    
    Commit 566f74f6b2f8b85d5b8d6caaf97e5672cecd3e3e had a change that
    incorrectly modified ebase. This backs out the lines that modified
    ebase.
    In addition, the ebase exception vector is now allocated with correct
    alignment and the ebase register updated according to the architecture
    specification.
    
    Based on original patch by David VomLehn <dvomlehn@cisco.com>.
    
    Signed-off-by: David VomLehn <dvomlehn@cisco.com>
    Signed-off-by: Chris Dearman <chris@mips.com>
    Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
---
 arch/mips/kernel/traps.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index b2d7041..29fadac 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -1520,7 +1520,9 @@ void __cpuinit per_cpu_trap_init(void)
 #endif /* CONFIG_MIPS_MT_SMTC */
 
 	if (cpu_has_veic || cpu_has_vint) {
+		unsigned long sr = set_c0_status(ST0_BEV);
 		write_c0_ebase(ebase);
+		write_c0_status(sr);
 		/* Setting vector spacing enables EI/VI mode  */
 		change_c0_intctl(0x3e0, VECTORSPACING);
 	}
@@ -1602,8 +1604,6 @@ void __cpuinit set_uncached_handler(unsigned long offset, void *addr,
 #ifdef CONFIG_64BIT
 	unsigned long uncached_ebase = TO_UNCAC(ebase);
 #endif
-	if (cpu_has_mips_r2)
-		uncached_ebase += (read_c0_ebase() & 0x3ffff000);
 
 	if (!addr)
 		panic(panic_null_cerr);
@@ -1635,9 +1635,11 @@ void __init trap_init(void)
 		return;	/* Already done */
 #endif
 
-	if (cpu_has_veic || cpu_has_vint)
-		ebase = (unsigned long) alloc_bootmem_low_pages(0x200 + VECTORSPACING*64);
-	else {
+	if (cpu_has_veic || cpu_has_vint) {
+		unsigned long size = 0x200 + VECTORSPACING*64;
+		ebase = (unsigned long)
+			__alloc_bootmem(size, 1 << fls(size), 0);
+	} else {
 		ebase = CAC_BASE;
 		if (cpu_has_mips_r2)
 			ebase += (read_c0_ebase() & 0x3ffff000);
--
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:
MIPS: R2: Fix problem with code that incorrectly modifies ..., Linux Kernel Mailing ..., (Thu Mar 26, 11:59 am)