linux-mips
[Top] [All Lists]

Re: [PATCH] [MIPS] Fix order of BRK_BUG in case

To: Ralf Baechle <ralf@linux-mips.org>
Subject: Re: [PATCH] [MIPS] Fix order of BRK_BUG in case
From: "Ilpo Järvinen" <ilpo.jarvinen@helsinki.fi>
Date: Sun, 20 Apr 2008 21:38:28 +0300 (EEST)
Cc: linux-mips@linux-mips.org
In-reply-to: <20080420112417.GA21078@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <Pine.LNX.4.64.0804192310460.20623@wrl-59.cs.helsinki.fi> <20080420112417.GA21078@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
On Sun, 20 Apr 2008, Ralf Baechle wrote:

> On Sat, Apr 19, 2008 at 11:16:36PM +0300, Ilpo Järvinen wrote:
> 
> > diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
> > index 984c0d0..4dfcd61 100644
> > --- a/arch/mips/kernel/traps.c
> > +++ b/arch/mips/kernel/traps.c
> > @@ -694,7 +694,7 @@ asmlinkage void do_bp(struct pt_regs *regs)
> >             info.si_addr = (void __user *) regs->cp0_epc;
> >             force_sig_info(SIGFPE, &info, current);
> >             break;
> > -   case BRK_BUG:
> > +   case BRK_BUG << 10:
> >             die("Kernel bug detected", regs);
>                 ^^^
> 
> Now what will be happening if with your patch applied a "break BRK_BUG"
> instruction is executed in userspace?

I suppose you know better, I can only guess :-). Like I said, I have no 
idea about mips code, maybe one would want die_if_kernel() kernel 
instead...? My main point was that the conversion made by commit 63dc68a8 
here seems questionable (resulted in dead code and would that not have 
been dead code the question you asked would apply to that code fragment), 
what is the right thing to do, you sure know better than I do :-).

-- 
 i.
<Prev in Thread] Current Thread [Next in Thread>