All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH urgent] MIPS: fix micro-assembly overflow in set_except_vector
@ 2010-02-01  9:27 Florian Fainelli
  2010-02-01 17:13 ` David Daney
       [not found] ` <20100201103628.GA15661@alpha.franken.de>
  0 siblings, 2 replies; 4+ messages in thread
From: Florian Fainelli @ 2010-02-01  9:27 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-mips

Commit 24a6d9866c5f15ba7e5b14dc17be4b6edba21d0e broke
the installation of handlers for boards which have their
handlers above a 1 << 26 address. Fix this by making sure that
jump_mask does not excess 0xfc000000 and add the missing ~ operator
to jump_mask when jumping to the handler address.

Reported-by: Maxime Bizon <mbizon@freebox.fr>
Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 7693929..40d94c3 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -1279,11 +1279,11 @@ void __init *set_except_vector(int n, void *addr)
 
 	exception_handlers[n] = handler;
 	if (n == 0 && cpu_has_divec) {
-		unsigned long jump_mask = ~((1 << 28) - 1);
+		unsigned long jump_mask = ~((1 << 26) - 1);
 		u32 *buf = (u32 *)(ebase + 0x200);
 		unsigned int k0 = 26;
 		if ((handler & jump_mask) == ((ebase + 0x200) & jump_mask)) {
-			uasm_i_j(&buf, handler & jump_mask);
+			uasm_i_j(&buf, handler & ~jump_mask);
 			uasm_i_nop(&buf);
 		} else {
 			UASM_i_LA(&buf, k0, handler);

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

end of thread, other threads:[~2010-02-03 14:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-01  9:27 [PATCH urgent] MIPS: fix micro-assembly overflow in set_except_vector Florian Fainelli
2010-02-01 17:13 ` David Daney
     [not found] ` <20100201103628.GA15661@alpha.franken.de>
2010-02-02  9:06   ` Florian Fainelli
2010-02-03 14:36     ` Ralf Baechle

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.