All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: errata: Pass --fix-cortex-a53-843419 to ld if workaround enabled
@ 2016-08-22 13:48 Will Deacon
  2016-08-22 13:53 ` Ard Biesheuvel
  0 siblings, 1 reply; 3+ messages in thread
From: Will Deacon @ 2016-08-22 13:48 UTC (permalink / raw)
  To: linux-arm-kernel

Cortex-A53 erratum 843419 is worked around by the linker, although it is
a configure-time option to GCC as to whether ld is actually asked to
apply the workaround or not.

This patch ensures that we pass --fix-cortex-a53-843419 to the linker
when both CONFIG_ARM64_ERRATUM_843419=y and the linker supports the
option.

Signed-off-by: Will Deacon <will.deacon@arm.com>
---
 arch/arm64/Kconfig  | 15 +++++----------
 arch/arm64/Makefile |  9 +++++++++
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index bc3f00f586f1..e4b7d10e8e1c 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -415,18 +415,13 @@ config ARM64_ERRATUM_845719
 
 config ARM64_ERRATUM_843419
 	bool "Cortex-A53: 843419: A load or store might access an incorrect address"
-	depends on MODULES
 	default y
-	select ARM64_MODULE_CMODEL_LARGE
+	select ARM64_MODULE_CMODEL_LARGE if MODULES
 	help
-	  This option builds kernel modules using the large memory model in
-	  order to avoid the use of the ADRP instruction, which can cause
-	  a subsequent memory access to use an incorrect address on Cortex-A53
-	  parts up to r0p4.
-
-	  Note that the kernel itself must be linked with a version of ld
-	  which fixes potentially affected ADRP instructions through the
-	  use of veneers.
+	  This option links the kernel with '--fix-cortex-a53-843419' and
+	  builds modules using the large memory model in order to avoid the use
+	  of the ADRP instruction, which can cause a subsequent memory access
+	  to use an incorrect address on Cortex-A53 parts up to r0p4.
 
 	  If unsure, say Y.
 
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index 5b54f8c021d8..c5ad4957e7ee 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -18,6 +18,15 @@ ifneq ($(CONFIG_RELOCATABLE),)
 LDFLAGS_vmlinux		+= -pie -Bsymbolic
 endif
 
+ifeq ($(CONFIG_ARM64_ERRATUM_843419),y)
+ld-843419-workaround := $(call ld-option, --fix-cortex-a53-843419)
+  ifeq ($(ld-843419-workaround),)
+$(warning ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum)
+  else
+LDFLAGS_vmlinux	+= --fix-cortex-a53-843419
+  endif
+endif
+
 KBUILD_DEFCONFIG := defconfig
 
 # Check for binutils support for specific extensions
-- 
2.1.4

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

* [PATCH] arm64: errata: Pass --fix-cortex-a53-843419 to ld if workaround enabled
  2016-08-22 13:48 [PATCH] arm64: errata: Pass --fix-cortex-a53-843419 to ld if workaround enabled Will Deacon
@ 2016-08-22 13:53 ` Ard Biesheuvel
  2016-08-23  1:47   ` Jisheng Zhang
  0 siblings, 1 reply; 3+ messages in thread
From: Ard Biesheuvel @ 2016-08-22 13:53 UTC (permalink / raw)
  To: linux-arm-kernel

On 22 August 2016 at 15:48, Will Deacon <will.deacon@arm.com> wrote:
> Cortex-A53 erratum 843419 is worked around by the linker, although it is
> a configure-time option to GCC as to whether ld is actually asked to
> apply the workaround or not.
>
> This patch ensures that we pass --fix-cortex-a53-843419 to the linker
> when both CONFIG_ARM64_ERRATUM_843419=y and the linker supports the
> option.
>
> Signed-off-by: Will Deacon <will.deacon@arm.com>

Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> ---
>  arch/arm64/Kconfig  | 15 +++++----------
>  arch/arm64/Makefile |  9 +++++++++
>  2 files changed, 14 insertions(+), 10 deletions(-)
>
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index bc3f00f586f1..e4b7d10e8e1c 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -415,18 +415,13 @@ config ARM64_ERRATUM_845719
>
>  config ARM64_ERRATUM_843419
>         bool "Cortex-A53: 843419: A load or store might access an incorrect address"
> -       depends on MODULES
>         default y
> -       select ARM64_MODULE_CMODEL_LARGE
> +       select ARM64_MODULE_CMODEL_LARGE if MODULES
>         help
> -         This option builds kernel modules using the large memory model in
> -         order to avoid the use of the ADRP instruction, which can cause
> -         a subsequent memory access to use an incorrect address on Cortex-A53
> -         parts up to r0p4.
> -
> -         Note that the kernel itself must be linked with a version of ld
> -         which fixes potentially affected ADRP instructions through the
> -         use of veneers.
> +         This option links the kernel with '--fix-cortex-a53-843419' and
> +         builds modules using the large memory model in order to avoid the use
> +         of the ADRP instruction, which can cause a subsequent memory access
> +         to use an incorrect address on Cortex-A53 parts up to r0p4.
>
>           If unsure, say Y.
>
> diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
> index 5b54f8c021d8..c5ad4957e7ee 100644
> --- a/arch/arm64/Makefile
> +++ b/arch/arm64/Makefile
> @@ -18,6 +18,15 @@ ifneq ($(CONFIG_RELOCATABLE),)
>  LDFLAGS_vmlinux                += -pie -Bsymbolic
>  endif
>
> +ifeq ($(CONFIG_ARM64_ERRATUM_843419),y)
> +ld-843419-workaround := $(call ld-option, --fix-cortex-a53-843419)
> +  ifeq ($(ld-843419-workaround),)
> +$(warning ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum)
> +  else
> +LDFLAGS_vmlinux        += --fix-cortex-a53-843419
> +  endif
> +endif
> +
>  KBUILD_DEFCONFIG := defconfig
>
>  # Check for binutils support for specific extensions
> --
> 2.1.4
>

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

* [PATCH] arm64: errata: Pass --fix-cortex-a53-843419 to ld if workaround enabled
  2016-08-22 13:53 ` Ard Biesheuvel
@ 2016-08-23  1:47   ` Jisheng Zhang
  0 siblings, 0 replies; 3+ messages in thread
From: Jisheng Zhang @ 2016-08-23  1:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 22 Aug 2016 15:53:07 +0200 Ard Biesheuvel  wrote:

> On 22 August 2016 at 15:48, Will Deacon wrote:
> > Cortex-A53 erratum 843419 is worked around by the linker, although it is
> > a configure-time option to GCC as to whether ld is actually asked to
> > apply the workaround or not.
> >
> > This patch ensures that we pass --fix-cortex-a53-843419 to the linker
> > when both CONFIG_ARM64_ERRATUM_843419=y and the linker supports the
> > option.
> >
> > Signed-off-by: Will Deacon <will.deacon@arm.com>  
> 
> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Thanks for this patch. I also suspected the errata isn't really work arounded
before and queried this in June ;)

http://lists.infradead.org/pipermail/linux-arm-kernel/2016-June/434057.html

Thanks,
Jisheng

> 
> > ---
> >  arch/arm64/Kconfig  | 15 +++++----------
> >  arch/arm64/Makefile |  9 +++++++++
> >  2 files changed, 14 insertions(+), 10 deletions(-)
> >
> > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> > index bc3f00f586f1..e4b7d10e8e1c 100644
> > --- a/arch/arm64/Kconfig
> > +++ b/arch/arm64/Kconfig
> > @@ -415,18 +415,13 @@ config ARM64_ERRATUM_845719
> >
> >  config ARM64_ERRATUM_843419
> >         bool "Cortex-A53: 843419: A load or store might access an incorrect address"
> > -       depends on MODULES
> >         default y
> > -       select ARM64_MODULE_CMODEL_LARGE
> > +       select ARM64_MODULE_CMODEL_LARGE if MODULES
> >         help
> > -         This option builds kernel modules using the large memory model in
> > -         order to avoid the use of the ADRP instruction, which can cause
> > -         a subsequent memory access to use an incorrect address on Cortex-A53
> > -         parts up to r0p4.
> > -
> > -         Note that the kernel itself must be linked with a version of ld
> > -         which fixes potentially affected ADRP instructions through the
> > -         use of veneers.
> > +         This option links the kernel with '--fix-cortex-a53-843419' and
> > +         builds modules using the large memory model in order to avoid the use
> > +         of the ADRP instruction, which can cause a subsequent memory access
> > +         to use an incorrect address on Cortex-A53 parts up to r0p4.
> >
> >           If unsure, say Y.
> >
> > diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
> > index 5b54f8c021d8..c5ad4957e7ee 100644
> > --- a/arch/arm64/Makefile
> > +++ b/arch/arm64/Makefile
> > @@ -18,6 +18,15 @@ ifneq ($(CONFIG_RELOCATABLE),)
> >  LDFLAGS_vmlinux                += -pie -Bsymbolic
> >  endif
> >
> > +ifeq ($(CONFIG_ARM64_ERRATUM_843419),y)
> > +ld-843419-workaround := $(call ld-option, --fix-cortex-a53-843419)
> > +  ifeq ($(ld-843419-workaround),)
> > +$(warning ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum)
> > +  else
> > +LDFLAGS_vmlinux        += --fix-cortex-a53-843419
> > +  endif
> > +endif
> > +
> >  KBUILD_DEFCONFIG := defconfig
> >
> >  # Check for binutils support for specific extensions
> > --
> > 2.1.4
> >  
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2016-08-23  1:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-22 13:48 [PATCH] arm64: errata: Pass --fix-cortex-a53-843419 to ld if workaround enabled Will Deacon
2016-08-22 13:53 ` Ard Biesheuvel
2016-08-23  1:47   ` Jisheng Zhang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.