linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] arm64: Remove enable_daif macro and rename disable_daif
@ 2024-02-29 13:28 Jinjie Ruan
  2024-02-29 13:28 ` [PATCH 1/2] arm64: Remove enable_daif macro Jinjie Ruan
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jinjie Ruan @ 2024-02-29 13:28 UTC (permalink / raw)
  To: catalin.marinas, will, ardb, broonie, masahiroy, mark.rutland,
	robh, scott, joey.gouly, ndesaulniers, anshuman.khandual,
	linux-arm-kernel
  Cc: ruanjinjie

The enable_daif macro is not used anywhere, so remove it.

And the name of disable_daif can not represent its original intent, so
rename it.

Jinjie Ruan (2):
  arm64: Remove enable_daif macro
  arm64: Rename disable_daif to disable_all_int

 arch/arm64/include/asm/assembler.h | 6 +-----
 arch/arm64/kernel/entry.S          | 2 +-
 arch/arm64/mm/proc.S               | 2 +-
 3 files changed, 3 insertions(+), 7 deletions(-)

-- 
2.34.1


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] arm64: Remove enable_daif macro
  2024-02-29 13:28 [PATCH 0/2] arm64: Remove enable_daif macro and rename disable_daif Jinjie Ruan
@ 2024-02-29 13:28 ` Jinjie Ruan
  2024-02-29 13:35   ` Mark Brown
  2024-02-29 14:30   ` Mark Rutland
  2024-02-29 13:28 ` [PATCH 2/2] arm64: Rename disable_daif to disable_all_int Jinjie Ruan
  2024-03-01 18:29 ` (subset) [PATCH 0/2] arm64: Remove enable_daif macro and rename disable_daif Catalin Marinas
  2 siblings, 2 replies; 7+ messages in thread
From: Jinjie Ruan @ 2024-02-29 13:28 UTC (permalink / raw)
  To: catalin.marinas, will, ardb, broonie, masahiroy, mark.rutland,
	robh, scott, joey.gouly, ndesaulniers, anshuman.khandual,
	linux-arm-kernel
  Cc: ruanjinjie

Since commit bb8e93a287a5 ("arm64: entry: convert SError handlers to C"),
the enable_daif assembler macro is no longer used anywhere, so remove it.

Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
 arch/arm64/include/asm/assembler.h | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h
index ce7b95cd6e79..ab8b396428da 100644
--- a/arch/arm64/include/asm/assembler.h
+++ b/arch/arm64/include/asm/assembler.h
@@ -38,10 +38,6 @@
 	msr	daifset, #0xf
 	.endm
 
-	.macro enable_daif
-	msr	daifclr, #0xf
-	.endm
-
 /*
  * Save/restore interrupts.
  */
-- 
2.34.1


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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] arm64: Rename disable_daif to disable_all_int
  2024-02-29 13:28 [PATCH 0/2] arm64: Remove enable_daif macro and rename disable_daif Jinjie Ruan
  2024-02-29 13:28 ` [PATCH 1/2] arm64: Remove enable_daif macro Jinjie Ruan
@ 2024-02-29 13:28 ` Jinjie Ruan
  2024-02-29 14:24   ` Mark Rutland
  2024-03-01 18:29 ` (subset) [PATCH 0/2] arm64: Remove enable_daif macro and rename disable_daif Catalin Marinas
  2 siblings, 1 reply; 7+ messages in thread
From: Jinjie Ruan @ 2024-02-29 13:28 UTC (permalink / raw)
  To: catalin.marinas, will, ardb, broonie, masahiroy, mark.rutland,
	robh, scott, joey.gouly, ndesaulniers, anshuman.khandual,
	linux-arm-kernel
  Cc: ruanjinjie

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@huawei.com>
---
 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


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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] arm64: Remove enable_daif macro
  2024-02-29 13:28 ` [PATCH 1/2] arm64: Remove enable_daif macro Jinjie Ruan
@ 2024-02-29 13:35   ` Mark Brown
  2024-02-29 14:30   ` Mark Rutland
  1 sibling, 0 replies; 7+ messages in thread
From: Mark Brown @ 2024-02-29 13:35 UTC (permalink / raw)
  To: Jinjie Ruan
  Cc: catalin.marinas, will, ardb, masahiroy, mark.rutland, robh, scott,
	joey.gouly, ndesaulniers, anshuman.khandual, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 271 bytes --]

On Thu, Feb 29, 2024 at 09:28:01PM +0800, Jinjie Ruan wrote:
> Since commit bb8e93a287a5 ("arm64: entry: convert SError handlers to C"),
> the enable_daif assembler macro is no longer used anywhere, so remove it.

Good spot!

Reviewed-by: Mark Brown <broonie@kernel.org>

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] arm64: Rename disable_daif to disable_all_int
  2024-02-29 13:28 ` [PATCH 2/2] arm64: Rename disable_daif to disable_all_int Jinjie Ruan
@ 2024-02-29 14:24   ` Mark Rutland
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Rutland @ 2024-02-29 14:24 UTC (permalink / raw)
  To: Jinjie Ruan
  Cc: catalin.marinas, will, ardb, broonie, masahiroy, robh, scott,
	joey.gouly, ndesaulniers, anshuman.khandual, linux-arm-kernel

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@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
> 

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] arm64: Remove enable_daif macro
  2024-02-29 13:28 ` [PATCH 1/2] arm64: Remove enable_daif macro Jinjie Ruan
  2024-02-29 13:35   ` Mark Brown
@ 2024-02-29 14:30   ` Mark Rutland
  1 sibling, 0 replies; 7+ messages in thread
From: Mark Rutland @ 2024-02-29 14:30 UTC (permalink / raw)
  To: Jinjie Ruan
  Cc: catalin.marinas, will, ardb, broonie, masahiroy, robh, scott,
	joey.gouly, ndesaulniers, anshuman.khandual, linux-arm-kernel

On Thu, Feb 29, 2024 at 09:28:01PM +0800, Jinjie Ruan wrote:
> Since commit bb8e93a287a5 ("arm64: entry: convert SError handlers to C"),
> the enable_daif assembler macro is no longer used anywhere, so remove it.
> 
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
> ---
>  arch/arm64/include/asm/assembler.h | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h
> index ce7b95cd6e79..ab8b396428da 100644
> --- a/arch/arm64/include/asm/assembler.h
> +++ b/arch/arm64/include/asm/assembler.h
> @@ -38,10 +38,6 @@
>  	msr	daifset, #0xf
>  	.endm
>  
> -	.macro enable_daif
> -	msr	daifclr, #0xf
> -	.endm
> -

I have no strong feelings either way on this; I had been waiting to remove this
along with disable_daif, but removing the latter requires some more substantial
work.

FWIW, for this as-is:

Acked-by: Mark Rutland <mark.rutland@arm.com>

Mark.

>  /*
>   * Save/restore interrupts.
>   */
> -- 
> 2.34.1
> 

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: (subset) [PATCH 0/2] arm64: Remove enable_daif macro and rename disable_daif
  2024-02-29 13:28 [PATCH 0/2] arm64: Remove enable_daif macro and rename disable_daif Jinjie Ruan
  2024-02-29 13:28 ` [PATCH 1/2] arm64: Remove enable_daif macro Jinjie Ruan
  2024-02-29 13:28 ` [PATCH 2/2] arm64: Rename disable_daif to disable_all_int Jinjie Ruan
@ 2024-03-01 18:29 ` Catalin Marinas
  2 siblings, 0 replies; 7+ messages in thread
From: Catalin Marinas @ 2024-03-01 18:29 UTC (permalink / raw)
  To: will, ardb, broonie, masahiroy, mark.rutland, robh, scott,
	joey.gouly, ndesaulniers, anshuman.khandual, linux-arm-kernel,
	Jinjie Ruan

On Thu, 29 Feb 2024 21:28:00 +0800, Jinjie Ruan wrote:
> The enable_daif macro is not used anywhere, so remove it.
> 
> And the name of disable_daif can not represent its original intent, so
> rename it.
> 
> Jinjie Ruan (2):
>   arm64: Remove enable_daif macro
>   arm64: Rename disable_daif to disable_all_int
> 
> [...]

Applied to arm64 (for-next/misc), thanks!

[1/2] arm64: Remove enable_daif macro
      https://git.kernel.org/arm64/c/527db67a4d85

-- 
Catalin


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-03-01 18:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-29 13:28 [PATCH 0/2] arm64: Remove enable_daif macro and rename disable_daif Jinjie Ruan
2024-02-29 13:28 ` [PATCH 1/2] arm64: Remove enable_daif macro Jinjie Ruan
2024-02-29 13:35   ` Mark Brown
2024-02-29 14:30   ` Mark Rutland
2024-02-29 13:28 ` [PATCH 2/2] arm64: Rename disable_daif to disable_all_int Jinjie Ruan
2024-02-29 14:24   ` Mark Rutland
2024-03-01 18:29 ` (subset) [PATCH 0/2] arm64: Remove enable_daif macro and rename disable_daif Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).