[PATCH 2/2] arm64: Rename disable_daif to disable_all_int

Mark Rutland mark.rutland at arm.com
Thu Feb 29 06:24:43 PST 2024


On Thu, Feb 29, 2024 at 09:28:02PM +0800, Jinjie Ruan wrote:
> As commit 0fbeb3187548 ("arm64: explicitly mask all exceptions") said,
> the disable_daif macro is used to make it clear to 'mask all
> exceptions'. However, if ALLINT is introduced by FEAT_NMI, DAIF and
> ALLINT should be set to mask IRQs and NMIs, the disable_daif name
> is not appropriate, so rename it to disable_all_int in all places.
> 
> Signed-off-by: Jinjie Ruan <ruanjinjie at huawei.com>

These macros only touch DAIF, and don't touch ALLINT, so the name *is*
appropriate.

Please leave these as-is for now; as and when we manipulate ALLINT these will
need a more substantial rework.

Mark.

> ---
>  arch/arm64/include/asm/assembler.h | 2 +-
>  arch/arm64/kernel/entry.S          | 2 +-
>  arch/arm64/mm/proc.S               | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h
> index ab8b396428da..b93916594e8a 100644
> --- a/arch/arm64/include/asm/assembler.h
> +++ b/arch/arm64/include/asm/assembler.h
> @@ -34,7 +34,7 @@
>  	wx\n	.req	w\n
>  	.endr
>  
> -	.macro disable_daif
> +	.macro disable_all_int
>  	msr	daifset, #0xf
>  	.endm
>  
> diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
> index 7ef0e127b149..cb12003120ef 100644
> --- a/arch/arm64/kernel/entry.S
> +++ b/arch/arm64/kernel/entry.S
> @@ -334,7 +334,7 @@ alternative_else_nop_endif
>  
>  	.macro	kernel_exit, el
>  	.if	\el != 0
> -	disable_daif
> +	disable_all_int
>  	.endif
>  
>  #ifdef CONFIG_ARM64_PSEUDO_NMI
> diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S
> index bfd2ad896108..4cd5558c5957 100644
> --- a/arch/arm64/mm/proc.S
> +++ b/arch/arm64/mm/proc.S
> @@ -142,7 +142,7 @@ SYM_FUNC_START(cpu_do_resume)
>  	 * exception. Mask them until local_daif_restore() in cpu_suspend()
>  	 * resets them.
>  	 */
> -	disable_daif
> +	disable_all_int
>  	msr	mdscr_el1, x10
>  
>  	msr	sctlr_el1, x12
> -- 
> 2.34.1
> 



More information about the linux-arm-kernel mailing list