* [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* Re: [PATCH urgent] MIPS: fix micro-assembly overflow in set_except_vector
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>
1 sibling, 0 replies; 4+ messages in thread
From: David Daney @ 2010-02-01 17:13 UTC (permalink / raw)
To: Florian Fainelli; +Cc: Ralf Baechle, linux-mips
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
> to jump_mask when jumping to the handler address.
>
> Reported-by: Maxime Bizon <mbizon@freebox.fr>
> Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: David Daney <ddaney@caviumnetworks.com>
> ---
> 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 [flat|nested] 4+ messages in thread[parent not found: <20100201103628.GA15661@alpha.franken.de>]
* Re: [PATCH urgent] MIPS: fix micro-assembly overflow in set_except_vector
[not found] ` <20100201103628.GA15661@alpha.franken.de>
@ 2010-02-02 9:06 ` Florian Fainelli
2010-02-03 14:36 ` Ralf Baechle
0 siblings, 1 reply; 4+ messages in thread
From: Florian Fainelli @ 2010-02-02 9:06 UTC (permalink / raw)
To: Thomas Bogendoerfer; +Cc: Ralf Baechle, linux-mips
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);
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH urgent] MIPS: fix micro-assembly overflow in set_except_vector
2010-02-02 9:06 ` Florian Fainelli
@ 2010-02-03 14:36 ` Ralf Baechle
0 siblings, 0 replies; 4+ messages in thread
From: Ralf Baechle @ 2010-02-03 14:36 UTC (permalink / raw)
To: Florian Fainelli; +Cc: Thomas Bogendoerfer, linux-mips
On Tue, Feb 02, 2010 at 10:06:35AM +0100, Florian Fainelli wrote:
> 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.
Folded into the existing -queue patch.
Thanks,
Ralf
^ permalink raw reply [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.