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

Anshuman Khandual anshuman.khandual at arm.com
Tue Jul 12 21:07:07 PDT 2022



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.



More information about the linux-arm-kernel mailing list