# Re: \[PATCH v2 01/19\] arm64: remove redundant local\_daif\_mask() in bad\_mode()

- From: Joey Gouly \<joey.gouly@arm.com\>
- Date: 2021-05-21 10:42:04 
- List: linux-arm-kernel
- Page: https://ratatoskr.run/linux-arm-kernel/2021/05/8807417
- Thread: https://ratatoskr.run/linux-arm-kernel/2021/05/8807285/t.md

```text
On Wed, May 19, 2021 at 01:38:44PM +0100, Mark Rutland wrote:
> Upon taking an exception, the CPU sets all the DAIF bits. We never
> clear any of these bits prior to calling bad_mode(), and bad_mode()
> itself never clears any of these bits, so there's no need to call
> local_daif_mask().
> 
> This patch removes the redundant call.
> 
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: James Morse <james.morse@arm.com>
> Cc: Marc Zyngier <maz@kernel.org>
> Cc: Will Deacon <will@kernel.org>
> ---
>  arch/arm64/kernel/traps.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
> index a05d34f0e82a..41f0aa92022a 100644
> --- a/arch/arm64/kernel/traps.c
> +++ b/arch/arm64/kernel/traps.c
> @@ -765,7 +765,6 @@ asmlinkage void notrace bad_mode(struct pt_regs *regs, int reason, unsigned int
>  		esr_get_class_string(esr));
>  
>  	__show_regs(regs);
> -	local_daif_mask();
>  	panic("bad mode");
>  }
>  

Reviewed-by Joey Gouly [ref]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
```
