]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ppc476: Enable a linker work around for IBM errata #46
authorAlistair Popple <alistair@popple.id.au>
Mon, 24 Feb 2014 07:00:56 +0000 (18:00 +1100)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 30 Apr 2014 22:26:34 +0000 (08:26 +1000)
This patch adds an option to enable a work around for an icache bug on
476 that can cause execution of stale instructions when falling
through pages (IBM errata #46). It requires a recent version of
binutils which supports the --ppc476-workaround option.

The work around enables the appropriate linker options and ensures
that all module output sections are aligned to 4K page boundaries. The
work around is only required when building modules.

Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/Makefile
arch/powerpc/platforms/44x/Kconfig
arch/powerpc/platforms/44x/ppc476_modules.lds [new file with mode: 0644]

index 4c0cedf4e2c7dda768378223deb024c03a94b7c9..31b96942c0a79c081a4e383a9cf41821898a3105 100644 (file)
@@ -159,6 +159,11 @@ CHECKFLAGS += -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)
 
 KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
 
+ifeq ($(CONFIG_476FPE_ERR46),y)
+       KBUILD_LDFLAGS_MODULE += --ppc476-workaround \
+               -T $(srctree)/arch/powerpc/platforms/44x/ppc476_modules.lds
+endif
+
 # No AltiVec or VSX instructions when building kernel
 KBUILD_CFLAGS += $(call cc-option,-mno-altivec)
 KBUILD_CFLAGS += $(call cc-option,-mno-vsx)
index 8beec7d00cac34f5dcbad9fb38c999230002018d..4d88f6a19058cc253dcd885eec86e077f7441295 100644 (file)
@@ -351,6 +351,20 @@ config APM821xx
        select IBM_EMAC_EMAC4
        select IBM_EMAC_TAH
 
+config 476FPE_ERR46
+       depends on 476FPE
+       bool "Enable linker work around for PPC476FPE errata #46"
+       help
+         This option enables a work around for an icache bug on 476
+         that can cause execution of stale instructions when falling
+         through pages (IBM errata #46). It requires a recent version
+         of binutils which supports the --ppc476-workaround option.
+
+         The work around enables the appropriate linker options and
+         ensures that all module output sections are aligned to 4K
+         page boundaries. The work around is only required when
+         building modules.
+
 # 44x errata/workaround config symbols, selected by the CPU models above
 config IBM440EP_ERR42
        bool
diff --git a/arch/powerpc/platforms/44x/ppc476_modules.lds b/arch/powerpc/platforms/44x/ppc476_modules.lds
new file mode 100644 (file)
index 0000000..9fec5d3
--- /dev/null
@@ -0,0 +1,15 @@
+SECTIONS
+{
+       .text : ALIGN(4096)
+       {
+               *(.text .text.* .fixup)
+       }
+       .init.text : ALIGN(4096)
+       {
+               *(.init.text .init.text.*)
+       }
+       .exit.text : ALIGN(4096)
+       {
+               *(.exit.text .exit.text.*)
+       }
+}