linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Dave Martin <Dave.Martin@arm.com>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: linus.walleij@linaro.org, arnd@arndb.de, linux@armlinux.org.uk,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] ARM: drop Thumb-2 workaround for ancient binutils
Date: Wed, 13 May 2020 17:15:49 +0100	[thread overview]
Message-ID: <20200513161548.GU21779@arm.com> (raw)
In-Reply-To: <20200507093349.25313-1-ardb@kernel.org>

On Thu, May 07, 2020 at 11:33:49AM +0200, Ard Biesheuvel wrote:
> The CONFIG_THUMB2_AVOID_R_ARM_THM_JUMP11 workaround addresses an issue
> which was fixed before the oldest supported binutils (2.23 at this time)
> were released. So we can remove it now.

Acked-by: Dave Martin <Dave.Martin@arm.com>

If we don't need this nasty fix any more, that's good for me.  I wonder
if anyone still builds Thumb-2 kernels for real?  Maybe uclinux needs
it?

(I'll trust you on the version number)

Cheers
---Dave

> Cc: Dave Martin <Dave.Martin@arm.com>
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
> ---
>  arch/arm/Kconfig  | 31 -------------------------------
>  arch/arm/Makefile |  4 ----
>  2 files changed, 35 deletions(-)
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 165987aa5bcd..9a4d4c14fbde 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -1425,37 +1425,6 @@ config THUMB2_KERNEL
>  
>  	  If unsure, say N.
>  
> -config THUMB2_AVOID_R_ARM_THM_JUMP11
> -	bool "Work around buggy Thumb-2 short branch relocations in gas"
> -	depends on THUMB2_KERNEL && MODULES
> -	default y
> -	help
> -	  Various binutils versions can resolve Thumb-2 branches to
> -	  locally-defined, preemptible global symbols as short-range "b.n"
> -	  branch instructions.
> -
> -	  This is a problem, because there's no guarantee the final
> -	  destination of the symbol, or any candidate locations for a
> -	  trampoline, are within range of the branch.  For this reason, the
> -	  kernel does not support fixing up the R_ARM_THM_JUMP11 (102)
> -	  relocation in modules at all, and it makes little sense to add
> -	  support.
> -
> -	  The symptom is that the kernel fails with an "unsupported
> -	  relocation" error when loading some modules.
> -
> -	  Until fixed tools are available, passing
> -	  -fno-optimize-sibling-calls to gcc should prevent gcc generating
> -	  code which hits this problem, at the cost of a bit of extra runtime
> -	  stack usage in some cases.
> -
> -	  The problem is described in more detail at:
> -	      https://bugs.launchpad.net/binutils-linaro/+bug/725126
> -
> -	  Only Thumb-2 kernels are affected.
> -
> -	  Unless you are sure your tools don't have this problem, say Y.
> -
>  config ARM_PATCH_IDIV
>  	bool "Runtime patch udiv/sdiv instructions into __aeabi_{u}idiv()"
>  	depends on CPU_32v7 && !XIP_KERNEL
> diff --git a/arch/arm/Makefile b/arch/arm/Makefile
> index 7d5cd0f85461..ba65205ab609 100644
> --- a/arch/arm/Makefile
> +++ b/arch/arm/Makefile
> @@ -125,10 +125,6 @@ AFLAGS_NOWARN	:=$(call as-option,-Wa$(comma)-mno-warn-deprecated,-Wa$(comma)-W)
>  ifeq ($(CONFIG_THUMB2_KERNEL),y)
>  CFLAGS_ISA	:=-mthumb -Wa,-mimplicit-it=always $(AFLAGS_NOWARN)
>  AFLAGS_ISA	:=$(CFLAGS_ISA) -Wa$(comma)-mthumb
> -# Work around buggy relocation from gas if requested:
> -ifeq ($(CONFIG_THUMB2_AVOID_R_ARM_THM_JUMP11),y)
> -KBUILD_CFLAGS_MODULE	+=-fno-optimize-sibling-calls
> -endif
>  else
>  CFLAGS_ISA	:=$(call cc-option,-marm,) $(AFLAGS_NOWARN)
>  AFLAGS_ISA	:=$(CFLAGS_ISA)
> -- 
> 2.17.1
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

  reply	other threads:[~2020-05-13 16:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-07  9:33 [PATCH] ARM: drop Thumb-2 workaround for ancient binutils Ard Biesheuvel
2020-05-13 16:15 ` Dave Martin [this message]
2020-05-14 14:13 ` Linus Walleij

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=20200513161548.GU21779@arm.com \
    --to=dave.martin@arm.com \
    --cc=ardb@kernel.org \
    --cc=arnd@arndb.de \
    --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;
as well as URLs for NNTP newsgroup(s).