Re: [PATCH v3 03/21] powerpc/8xx: exception InstructionAccess does not exist on MPC8xx

From: Scott Wood
Date: Thu Sep 18 2014 - 14:56:54 EST


On Thu, 2014-09-18 at 20:52 +0200, christophe leroy wrote:
> Le 18/09/2014 18:42, leroy christophe a Ãcrit :
> >
> > Le 18/09/2014 17:15, Joakim Tjernlund a Ãcrit :
> >> Christophe Leroy <christophe.leroy@xxxxxx> wrote on 2014/09/17 18:36:57:
> >>> Exception InstructionAccess does not exist on MPC8xx. No need to branch
> >> there from somewhere else.
> >>> Handling can be done directly in InstructionTLBError Exception.
> >>>
> >>> Signed-off-by: Christophe Leroy <christophe.leroy@xxxxxx>
> >>>
> >>> ---
> >>> Changes in v2:
> >>> - None
> >>>
> >>> Changes in v3:
> >>> - arch/powerpc/mm/fault.c uses the vector number, so make sure it
> >> understand
> >>> the new ones.
> >>>
> >>> arch/powerpc/kernel/head_8xx.S | 17 +++++++----------
> >>> arch/powerpc/mm/fault.c | 1 +
> >>> 2 files changed, 8 insertions(+), 10 deletions(-)
> [...]
> >>> Still don't like that you change the vector number, every other ppc
> >>> uses
> >> the
> >> standard number.
> >>
> >> Can you not just lie here(EXC_XFER_LITE(0x400, handle_page_fault))?
> >> Move the code to InstructionAccess too and let TLBError branch there.
> > My issue was that if I do EXC_XFER_LITE(0x400, handle_page_fault), I
> > can't leave the
> > EXCEPTION(0x400, InstructionAccess, unknown_exception,
> > EXC_XFER_STD) at address .400
> > Otherwise, I get twice the same label.
> >
> > What about the following patch then ? Would this be acceptable ?
> I don't like what I propose two hours ago indeed.
> Is it really worth trying to implement code for vectors 0x300 and 0x400
> which are clearly stated in the Reference Manual as never being
> generated by the HW ?.
> If I just don't put anything at 0x300 and 0x400 is that OK ?
> Otherwise I have to put some code that will branch to TLBerror code, but
> writing dead code doesn't enchant me.

No, just have the one set of exception handlers that hardware will
generate, and use the exception codes that Linux expects. E.g.
exception codes are a giant lie on booke as well.

It would be nice if we documented what linux wanted, though, instead of
using magic numbers, and assuming it's the same as classic -- which
especially fails when it's an exception type that doesn't exist on
classic or book3s.

-Scott


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/