diff mbox series

ARM: assembler: Drop obsolete VFP accessor fallback

Message ID 20240730094858.1070431-2-ardb+git@google.com (mailing list archive)
State New, archived
Headers show
Series ARM: assembler: Drop obsolete VFP accessor fallback | expand

Commit Message

Ard Biesheuvel July 30, 2024, 9:48 a.m. UTC
From: Ard Biesheuvel <ardb@kernel.org>

Now that the minimum supported binutils version is 2.25, we no longer
need a workaround for binutils older than 2.24 for accessing VFP control
registers from assembler.

Cc: Calvin Owens <calvin@wbinvd.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: clang-built-linux <clang-built-linux@googlegroups.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
Note: applies onto 9410/1

 arch/arm/Kconfig                 |  2 --
 arch/arm/Kconfig.assembler       |  6 ------
 arch/arm/include/asm/vfp.h       | 10 ---------
 arch/arm/include/asm/vfpmacros.h | 11 ----------
 arch/arm/vfp/vfpinstr.h          | 22 --------------------
 5 files changed, 51 deletions(-)

Comments

Linus Walleij July 31, 2024, 8:03 p.m. UTC | #1
On Tue, Jul 30, 2024 at 11:49 AM Ard Biesheuvel <ardb+git@google.com> wrote:

> From: Ard Biesheuvel <ardb@kernel.org>
>
> Now that the minimum supported binutils version is 2.25, we no longer
> need a workaround for binutils older than 2.24 for accessing VFP control
> registers from assembler.
>
> Cc: Calvin Owens <calvin@wbinvd.org>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Nathan Chancellor <nathan@kernel.org>
> Cc: clang-built-linux <clang-built-linux@googlegroups.com>
> Cc: Russell King <linux@armlinux.org.uk>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

Neat!
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
Nathan Chancellor Aug. 1, 2024, 12:46 a.m. UTC | #2
On Tue, Jul 30, 2024 at 11:48:59AM +0200, Ard Biesheuvel wrote:
> From: Ard Biesheuvel <ardb@kernel.org>
> 
> Now that the minimum supported binutils version is 2.25, we no longer
> need a workaround for binutils older than 2.24 for accessing VFP control
> registers from assembler.
> 
> Cc: Calvin Owens <calvin@wbinvd.org>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Nathan Chancellor <nathan@kernel.org>
> Cc: clang-built-linux <clang-built-linux@googlegroups.com>
> Cc: Russell King <linux@armlinux.org.uk>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

Very nice :)

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

> ---
> Note: applies onto 9410/1
> 
>  arch/arm/Kconfig                 |  2 --
>  arch/arm/Kconfig.assembler       |  6 ------
>  arch/arm/include/asm/vfp.h       | 10 ---------
>  arch/arm/include/asm/vfpmacros.h | 11 ----------
>  arch/arm/vfp/vfpinstr.h          | 22 --------------------
>  5 files changed, 51 deletions(-)
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 54b2bb817a7f..854a12d89471 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -1747,5 +1747,3 @@ config ARCH_HIBERNATION_POSSIBLE
>  	default y if ARCH_SUSPEND_POSSIBLE
>  
>  endmenu
> -
> -source "arch/arm/Kconfig.assembler"
> diff --git a/arch/arm/Kconfig.assembler b/arch/arm/Kconfig.assembler
> deleted file mode 100644
> index 5cb31aae1188..000000000000
> --- a/arch/arm/Kconfig.assembler
> +++ /dev/null
> @@ -1,6 +0,0 @@
> -# SPDX-License-Identifier: GPL-2.0
> -
> -config AS_VFP_VMRS_FPINST
> -	def_bool $(as-instr,.fpu vfpv2\nvmrs r0$(comma)FPINST)
> -	help
> -	  Supported by binutils >= 2.24 and LLVM integrated assembler.
> diff --git a/arch/arm/include/asm/vfp.h b/arch/arm/include/asm/vfp.h
> index 157ea3426158..85ccc422d4d0 100644
> --- a/arch/arm/include/asm/vfp.h
> +++ b/arch/arm/include/asm/vfp.h
> @@ -9,16 +9,6 @@
>  #ifndef __ASM_VFP_H
>  #define __ASM_VFP_H
>  
> -#ifndef CONFIG_AS_VFP_VMRS_FPINST
> -#define FPSID			cr0
> -#define FPSCR			cr1
> -#define MVFR1			cr6
> -#define MVFR0			cr7
> -#define FPEXC			cr8
> -#define FPINST			cr9
> -#define FPINST2			cr10
> -#endif
> -
>  /* FPSID bits */
>  #define FPSID_IMPLEMENTER_BIT	(24)
>  #define FPSID_IMPLEMENTER_MASK	(0xff << FPSID_IMPLEMENTER_BIT)
> diff --git a/arch/arm/include/asm/vfpmacros.h b/arch/arm/include/asm/vfpmacros.h
> index ba0d4cb5377e..e2e1d5a3727a 100644
> --- a/arch/arm/include/asm/vfpmacros.h
> +++ b/arch/arm/include/asm/vfpmacros.h
> @@ -8,7 +8,6 @@
>  
>  #include <asm/vfp.h>
>  
> -#ifdef CONFIG_AS_VFP_VMRS_FPINST
>  	.macro	VFPFMRX, rd, sysreg, cond
>  	vmrs\cond	\rd, \sysreg
>  	.endm
> @@ -16,16 +15,6 @@
>  	.macro	VFPFMXR, sysreg, rd, cond
>  	vmsr\cond	\sysreg, \rd
>  	.endm
> -#else
> -	@ Macros to allow building with old toolkits (with no VFP support)
> -	.macro	VFPFMRX, rd, sysreg, cond
> -	MRC\cond	p10, 7, \rd, \sysreg, cr0, 0	@ FMRX	\rd, \sysreg
> -	.endm
> -
> -	.macro	VFPFMXR, sysreg, rd, cond
> -	MCR\cond	p10, 7, \rd, \sysreg, cr0, 0	@ FMXR	\sysreg, \rd
> -	.endm
> -#endif
>  
>  	@ read all the working registers back into the VFP
>  	.macro	VFPFLDMIA, base, tmp
> diff --git a/arch/arm/vfp/vfpinstr.h b/arch/arm/vfp/vfpinstr.h
> index 32090b0fb250..a2f0c47e0ce7 100644
> --- a/arch/arm/vfp/vfpinstr.h
> +++ b/arch/arm/vfp/vfpinstr.h
> @@ -62,8 +62,6 @@
>  #define FPSCR_C (1 << 29)
>  #define FPSCR_V	(1 << 28)
>  
> -#ifdef CONFIG_AS_VFP_VMRS_FPINST
> -
>  #define fmrx(_vfp_) ({				\
>  	u32 __v;				\
>  	asm volatile (".fpu	vfpv2\n"	\
> @@ -78,26 +76,6 @@
>  		     : : "r" (_var_) : "cc");	\
>  })
>  
> -#else
> -
> -#define vfpreg(_vfp_) #_vfp_
> -
> -#define fmrx(_vfp_) ({						\
> -	u32 __v;						\
> -	asm volatile ("mrc p10, 7, %0, " vfpreg(_vfp_) ","	\
> -		      "cr0, 0 @ fmrx	%0, " #_vfp_		\
> -		     : "=r" (__v) : : "cc");			\
> -	__v;							\
> -})
> -
> -#define fmxr(_vfp_, _var_) ({					\
> -	asm volatile ("mcr p10, 7, %0, " vfpreg(_vfp_) ","	\
> -		      "cr0, 0 @ fmxr	" #_vfp_ ", %0"		\
> -		     : : "r" (_var_) : "cc");			\
> -})
> -
> -#endif
> -
>  u32 vfp_single_cpdo(u32 inst, u32 fpscr);
>  u32 vfp_single_cprt(u32 inst, u32 fpscr, struct pt_regs *regs);
>  
> -- 
> 2.46.0.rc1.232.g9752f9e123-goog
>
diff mbox series

Patch

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 54b2bb817a7f..854a12d89471 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1747,5 +1747,3 @@  config ARCH_HIBERNATION_POSSIBLE
 	default y if ARCH_SUSPEND_POSSIBLE
 
 endmenu
-
-source "arch/arm/Kconfig.assembler"
diff --git a/arch/arm/Kconfig.assembler b/arch/arm/Kconfig.assembler
deleted file mode 100644
index 5cb31aae1188..000000000000
--- a/arch/arm/Kconfig.assembler
+++ /dev/null
@@ -1,6 +0,0 @@ 
-# SPDX-License-Identifier: GPL-2.0
-
-config AS_VFP_VMRS_FPINST
-	def_bool $(as-instr,.fpu vfpv2\nvmrs r0$(comma)FPINST)
-	help
-	  Supported by binutils >= 2.24 and LLVM integrated assembler.
diff --git a/arch/arm/include/asm/vfp.h b/arch/arm/include/asm/vfp.h
index 157ea3426158..85ccc422d4d0 100644
--- a/arch/arm/include/asm/vfp.h
+++ b/arch/arm/include/asm/vfp.h
@@ -9,16 +9,6 @@ 
 #ifndef __ASM_VFP_H
 #define __ASM_VFP_H
 
-#ifndef CONFIG_AS_VFP_VMRS_FPINST
-#define FPSID			cr0
-#define FPSCR			cr1
-#define MVFR1			cr6
-#define MVFR0			cr7
-#define FPEXC			cr8
-#define FPINST			cr9
-#define FPINST2			cr10
-#endif
-
 /* FPSID bits */
 #define FPSID_IMPLEMENTER_BIT	(24)
 #define FPSID_IMPLEMENTER_MASK	(0xff << FPSID_IMPLEMENTER_BIT)
diff --git a/arch/arm/include/asm/vfpmacros.h b/arch/arm/include/asm/vfpmacros.h
index ba0d4cb5377e..e2e1d5a3727a 100644
--- a/arch/arm/include/asm/vfpmacros.h
+++ b/arch/arm/include/asm/vfpmacros.h
@@ -8,7 +8,6 @@ 
 
 #include <asm/vfp.h>
 
-#ifdef CONFIG_AS_VFP_VMRS_FPINST
 	.macro	VFPFMRX, rd, sysreg, cond
 	vmrs\cond	\rd, \sysreg
 	.endm
@@ -16,16 +15,6 @@ 
 	.macro	VFPFMXR, sysreg, rd, cond
 	vmsr\cond	\sysreg, \rd
 	.endm
-#else
-	@ Macros to allow building with old toolkits (with no VFP support)
-	.macro	VFPFMRX, rd, sysreg, cond
-	MRC\cond	p10, 7, \rd, \sysreg, cr0, 0	@ FMRX	\rd, \sysreg
-	.endm
-
-	.macro	VFPFMXR, sysreg, rd, cond
-	MCR\cond	p10, 7, \rd, \sysreg, cr0, 0	@ FMXR	\sysreg, \rd
-	.endm
-#endif
 
 	@ read all the working registers back into the VFP
 	.macro	VFPFLDMIA, base, tmp
diff --git a/arch/arm/vfp/vfpinstr.h b/arch/arm/vfp/vfpinstr.h
index 32090b0fb250..a2f0c47e0ce7 100644
--- a/arch/arm/vfp/vfpinstr.h
+++ b/arch/arm/vfp/vfpinstr.h
@@ -62,8 +62,6 @@ 
 #define FPSCR_C (1 << 29)
 #define FPSCR_V	(1 << 28)
 
-#ifdef CONFIG_AS_VFP_VMRS_FPINST
-
 #define fmrx(_vfp_) ({				\
 	u32 __v;				\
 	asm volatile (".fpu	vfpv2\n"	\
@@ -78,26 +76,6 @@ 
 		     : : "r" (_var_) : "cc");	\
 })
 
-#else
-
-#define vfpreg(_vfp_) #_vfp_
-
-#define fmrx(_vfp_) ({						\
-	u32 __v;						\
-	asm volatile ("mrc p10, 7, %0, " vfpreg(_vfp_) ","	\
-		      "cr0, 0 @ fmrx	%0, " #_vfp_		\
-		     : "=r" (__v) : : "cc");			\
-	__v;							\
-})
-
-#define fmxr(_vfp_, _var_) ({					\
-	asm volatile ("mcr p10, 7, %0, " vfpreg(_vfp_) ","	\
-		      "cr0, 0 @ fmxr	" #_vfp_ ", %0"		\
-		     : : "r" (_var_) : "cc");			\
-})
-
-#endif
-
 u32 vfp_single_cpdo(u32 inst, u32 fpscr);
 u32 vfp_single_cprt(u32 inst, u32 fpscr, struct pt_regs *regs);