linux/arch/arm/kernel
Nicolas Pitre 208fae5c3b ARM: 8550/1: protect idiv patching against undefined gcc behavior
It was reported that a kernel with CONFIG_ARM_PATCH_IDIV=y stopped
booting when compiled with the upcoming gcc 6.  Turns out that turning
a function address into a writable array is undefined and gcc 6 decided
it was OK to omit the store to the first word of the function while
still preserving the store to the second word.

Even though gcc 6 is now fixed to behave more coherently, it is a
mystery that gcc 4 and gcc 5 actually produce wanted code in the kernel.
And in fact the reduced test case to illustrate the issue does indeed
break with gcc < 6 as well.

In any case, let's guard the kernel against undefined compiler behavior
by hiding the nature of the array location as suggested by gcc
developers.

Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70128

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Reported-by: Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: stable@vger.kernel.org # v4.5
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2016-04-07 21:57:02 +01:00
..
.gitignore
arch_timer.c
armksyms.c ARM: 8479/2: add implementation for arm-smccc 2016-01-04 16:24:34 +00:00
asm-offsets.c ARM: KVM: Remove unused hyp_pc field 2016-02-29 18:34:15 +00:00
atags_compat.c
atags_parse.c
atags_proc.c
atags.h ARM: 8495/1: ATAGS: move save_atags() to arch/arm/include/asm/setup.h 2016-01-04 11:26:00 +00:00
bios32.c ARM/PCI: Move align_resource function pointer to pci_host_bridge structure 2015-11-25 13:23:38 -06:00
calls.S ARM: wire up preadv2 and pwritev2 syscalls 2016-04-07 21:57:02 +01:00
cpuidle.c ARM: 8485/1: cpuidle: remove cpu parameter from the cpuidle_ops suspend hook 2015-12-22 12:09:43 +00:00
crash_dump.c
debug.S
devtree.c ARM: make default platform work for NOMMU 2015-12-17 17:45:47 +01:00
dma-isa.c
dma.c
early_printk.c
efi.c ARM: wire up UEFI init and runtime support 2015-12-13 19:18:30 +01:00
elf.c
entry-armv.S ARM: 8515/2: move .vectors and .stubs sections back into the kernel VMA 2016-02-11 15:33:39 +00:00
entry-common.S
entry-ftrace.S
entry-header.S
entry-v7m.S ARM: 8450/1: v7-M: Use ret_to_user_from_irq in PendSV handler 2015-11-16 18:34:37 +00:00
fiq.c
fiqasm.S
ftrace.c
head-common.S
head-nommu.S
head.S
hibernate.c ARM: use virt_to_idmap() for soft_restart() 2016-02-08 15:48:32 +00:00
hw_breakpoint.c
hyp-stub.S ARM: 8527/1: virt: enable GICv3 system registers 2016-02-16 16:33:02 +00:00
insn.c
io.c
irq.c ARM: 8499/1: irq: l2c: do not print error in case of missing l2c from 2016-01-26 23:49:02 +00:00
isa.c
iwmmxt.S
jump_label.c
kgdb.c
machine_kexec.c ARM: use virt_to_idmap() for soft_restart() 2016-02-08 15:48:32 +00:00
Makefile ARM: 8534/1: virt: fix hyp-stub build for pre-ARMv7 CPUs 2016-02-22 11:39:41 +00:00
module-plts.c module: use a structure to encapsulate layout. 2015-12-04 22:46:25 +01:00
module.c ARM: 8518/1: Use correct symbols for XIP_KERNEL 2016-02-11 15:43:14 +00:00
module.lds
opcodes.c
paravirt.c arm: introduce CONFIG_PARAVIRT, PARAVIRT_TIME_ACCOUNTING and pv_time_ops 2015-12-21 14:40:54 +00:00
patch.c
perf_callchain.c
perf_event_v6.c
perf_event_v7.c ARM: perf: Set ARMv7 SDER SUNIDEN bit 2016-01-25 18:37:44 +00:00
perf_event_xscale.c
perf_regs.c
pj4-cp0.c ARM: 8452/3: PJ4: make coprocessor access sequences buildable in Thumb2 mode 2016-01-04 11:12:10 +00:00
process.c ARM: report proper DACR value in oops dumps 2015-12-04 19:20:48 +00:00
psci_smp.c ARM: use const and __initconst for smp_operations 2015-12-01 22:17:45 +01:00
ptrace.c
reboot.c ARM: make virt_to_idmap() return unsigned long 2016-02-08 15:47:28 +00:00
reboot.h
relocate_kernel.S
return_address.c
setup.c ARM: 8550/1: protect idiv patching against undefined gcc behavior 2016-04-07 21:57:02 +01:00
signal.c
sigreturn_codes.S
sleep.S
smccc-call.S ARM: 8479/2: add implementation for arm-smccc 2016-01-04 16:24:34 +00:00
smp_scu.c
smp_tlb.c
smp_twd.c
smp.c arch/hotplug: Call into idle with a proper state 2016-03-01 20:36:57 +01:00
stacktrace.c
suspend.c
swp_emulate.c ARM: 8475/1: SWP emulation: Restore original *data when failed 2015-12-15 11:51:42 +00:00
sys_arm.c
sys_oabi-compat.c [PATCH] arm: fix handling of F_OFD_... in oabi_fcntl64() 2015-12-29 13:04:21 -05:00
tcm.c
thumbee.c
time.c
topology.c ARM: 8497/1: initialize cpu_scale to its default 2016-01-26 23:49:02 +00:00
traps.c
unwind.c
v7m.c
vdso.c ARM: 8476/1: VDSO: use PTR_ERR_OR_ZERO for vma check 2015-12-17 10:29:01 +00:00
vmlinux-xip.lds.S ARM: 8537/1: drop unused DEBUG_RODATA from XIP_KERNEL 2016-02-22 11:39:43 +00:00
vmlinux.lds.S arch, ftrace: for KASAN put hard/soft IRQ entries into separate sections 2016-03-25 16:37:42 -07:00
xscale-cp0.c ARM: make xscale iwmmxt code multiplatform aware 2015-12-01 21:44:24 +01:00