Skip to content

Commit e2d9c63

Browse files
committed
ppc476: Enable a linker work around for IBM errata torvalds#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 torvalds#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>
1 parent b76701e commit e2d9c63

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

arch/powerpc/Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ CHECKFLAGS += -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)
158158

159159
KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
160160

161+
ifeq ($(CONFIG_476FPE_ERR46),y)
162+
KBUILD_LDFLAGS_MODULE += --ppc476-workaround \
163+
-T $(srctree)/arch/powerpc/platforms/44x/ppc476_modules.lds
164+
endif
165+
161166
# No AltiVec or VSX instructions when building kernel
162167
KBUILD_CFLAGS += $(call cc-option,-mno-altivec)
163168
KBUILD_CFLAGS += $(call cc-option,-mno-vsx)

arch/powerpc/platforms/44x/Kconfig

+14
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,20 @@ config APM821xx
352352
select IBM_EMAC_EMAC4
353353
select IBM_EMAC_TAH
354354

355+
config 476FPE_ERR46
356+
depends on 476FPE
357+
bool "Enable linker work around for PPC476FPE errata #46"
358+
help
359+
This option enables a work around for an icache bug on 476
360+
that can cause execution of stale instructions when falling
361+
through pages (IBM errata #46). It requires a recent version
362+
of binutils which supports the --ppc476-workaround option.
363+
364+
The work around enables the appropriate linker options and
365+
ensures that all module output sections are aligned to 4K
366+
page boundaries. The work around is only required when
367+
building modules.
368+
355369
# 44x errata/workaround config symbols, selected by the CPU models above
356370
config IBM440EP_ERR42
357371
bool
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
}

0 commit comments

Comments
 (0)