Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ppc476: Enable a linker work around for IBM errata #46

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>

authored by

Alistair Popple and committed by
Benjamin Herrenschmidt
d5b35cff e2c37d90

+34
+5
arch/powerpc/Makefile
··· 159 159 160 160 KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o 161 161 162 + ifeq ($(CONFIG_476FPE_ERR46),y) 163 + KBUILD_LDFLAGS_MODULE += --ppc476-workaround \ 164 + -T $(srctree)/arch/powerpc/platforms/44x/ppc476_modules.lds 165 + endif 166 + 162 167 # No AltiVec or VSX instructions when building kernel 163 168 KBUILD_CFLAGS += $(call cc-option,-mno-altivec) 164 169 KBUILD_CFLAGS += $(call cc-option,-mno-vsx)
+14
arch/powerpc/platforms/44x/Kconfig
··· 351 351 select IBM_EMAC_EMAC4 352 352 select IBM_EMAC_TAH 353 353 354 + config 476FPE_ERR46 355 + depends on 476FPE 356 + bool "Enable linker work around for PPC476FPE errata #46" 357 + help 358 + This option enables a work around for an icache bug on 476 359 + that can cause execution of stale instructions when falling 360 + through pages (IBM errata #46). It requires a recent version 361 + of binutils which supports the --ppc476-workaround option. 362 + 363 + The work around enables the appropriate linker options and 364 + ensures that all module output sections are aligned to 4K 365 + page boundaries. The work around is only required when 366 + building modules. 367 + 354 368 # 44x errata/workaround config symbols, selected by the CPU models above 355 369 config IBM440EP_ERR42 356 370 bool
+15
arch/powerpc/platforms/44x/ppc476_modules.lds
··· 1 + SECTIONS 2 + { 3 + .text : ALIGN(4096) 4 + { 5 + *(.text .text.* .fixup) 6 + } 7 + .init.text : ALIGN(4096) 8 + { 9 + *(.init.text .init.text.*) 10 + } 11 + .exit.text : ALIGN(4096) 12 + { 13 + *(.exit.text .exit.text.*) 14 + } 15 + }