[PATCH 1/5] arm64: report EL1 UNDEFs better

Mark Rutland mark.rutland at arm.com
Wed Jul 13 05:39:07 PDT 2022


On Wed, Jul 13, 2022 at 09:37:07AM +0530, Anshuman Khandual wrote:
> 
> 
> On 7/12/22 21:44, Mark Rutland wrote:
> > diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
> > index b7fed33981f7..eac4f7a83175 100644
> > --- a/arch/arm64/kernel/traps.c
> > +++ b/arch/arm64/kernel/traps.c
> > @@ -494,7 +494,9 @@ void do_undefinstr(struct pt_regs *regs)
> >  	if (call_undef_hook(regs) == 0)
> >  		return;
> >  
> > -	BUG_ON(!user_mode(regs));
> > +	if (!user_mode(regs))
> > +		die("Oops - Undefined instruction", regs, 0);
> 
> Should not die() here also take 'esr' as the last argument just for
> consistency ? Although this would require do_undefinstr() take 'esr'
> as an argument as well.

I've modified patch 3 for that, as that's where the other ESR reporting changes
are made.

Mark.



More information about the linux-arm-kernel mailing list