All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Fainelli <florian@openwrt.org>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org
Subject: Re: [PATCH urgent] MIPS: fix micro-assembly overflow in set_except_vector
Date: Tue, 2 Feb 2010 10:06:35 +0100	[thread overview]
Message-ID: <201002021006.35731.florian@openwrt.org> (raw)
In-Reply-To: <20100201103628.GA15661@alpha.franken.de>

Hi Thomas,

On Monday 01 February 2010 11:36:28 Thomas Bogendoerfer wrote:
> On Mon, Feb 01, 2010 at 10:27:37AM +0100, Florian Fainelli wrote:
> > 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
> 
> j can handle 28 bit jump targets (26 bit in instruction plus two 0 bits
> for 32bit aligment), so 0xf000000 was IMHO fine.

Corrected version below, thanks.
---
From: Florian Fainelli <florian@openwrt.org>
Subject: [PATCH urgent] MIPS: fix micro-assembly overflow in set_except_vector

Commit 24a6d9866c5f15ba7e5b14dc17be4b6edba21d0e broke
the installation of handlers for boards which have their
handlers above 0xf0000000. Fix this by adding the missing
~ operator to jump_mask when loading the handler target
address into buf.

Reported-by: Maxime Bizon <mbizon@freebox.fr>
Acked-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 7693929..af176b8 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -1283,7 +1283,7 @@ void __init *set_except_vector(int n, void *addr)
 		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);

  parent reply	other threads:[~2010-02-02  9:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2010-02-03 14:36     ` Ralf Baechle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201002021006.35731.florian@openwrt.org \
    --to=florian@openwrt.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    --cc=tsbogend@alpha.franken.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.