public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Ard Biesheuvel <ardb+git@google.com>
Cc: linux-arm-kernel@lists.infradead.org,
	Ard Biesheuvel <ardb@kernel.org>,
	Calvin Owens <calvin@wbinvd.org>, Arnd Bergmann <arnd@arndb.de>,
	clang-built-linux <clang-built-linux@googlegroups.com>,
	Russell King <linux@armlinux.org.uk>,
	Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH] ARM: assembler: Drop obsolete VFP accessor fallback
Date: Wed, 31 Jul 2024 17:46:09 -0700	[thread overview]
Message-ID: <20240801004609.GA1614495@thelio-3990X> (raw)
In-Reply-To: <20240730094858.1070431-2-ardb+git@google.com>

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
> 


      parent reply	other threads:[~2024-08-01  0:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-30  9:48 [PATCH] ARM: assembler: Drop obsolete VFP accessor fallback Ard Biesheuvel
2024-07-31 20:03 ` Linus Walleij
2024-08-01  0:46 ` Nathan Chancellor [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240801004609.GA1614495@thelio-3990X \
    --to=nathan@kernel.org \
    --cc=ardb+git@google.com \
    --cc=ardb@kernel.org \
    --cc=arnd@arndb.de \
    --cc=calvin@wbinvd.org \
    --cc=clang-built-linux@googlegroups.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox