alistair23-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.h ARM: 8495/1: ATAGS: move save_atags() to arch/arm/include/asm/setup.h 2016-01-04 11:26:00 +00:00
atags_compat.c
atags_parse.c
atags_proc.c
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 Merge branch 'uaccess' into fixes 2015-09-11 19:18:28 +01:00
entry-ftrace.S
entry-header.S ARM: entry: provide uaccess assembly macro hooks 2015-08-26 20:27:02 +01:00
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 ARM: 8383/1: nommu: avoid deprecated source register on mov 2015-06-12 21:18:48 +01:00
head.S Merge branch 'uaccess' into fixes 2015-09-11 19:18:28 +01:00
hibernate.c ARM: use virt_to_idmap() for soft_restart() 2016-02-08 15:48:32 +00:00
hw_breakpoint.c ARM: 8436/1: hw_breakpoint: remove unnecessary header 2015-10-03 16:36:44 +01:00
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 jump_label: Rename JUMP_LABEL_{EN,DIS}ABLE to JUMP_LABEL_{JMP,NOP} 2015-08-03 11:34:12 +02:00
kgdb.c ARM: 8428/1: kgdb: Fix registers on sleeping tasks 2015-10-03 16:36:45 +01:00
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 arm: perf: factor arm_pmu core out to drivers 2015-07-31 15:01:14 +01:00
perf_event_v7.c ARM: perf: Set ARMv7 SDER SUNIDEN bit 2016-01-25 18:37:44 +00:00
perf_event_xscale.c arm: perf: factor arm_pmu core out to drivers 2015-07-31 15:01:14 +01:00
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 Merge branch 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm 2015-09-19 21:05:02 -07:00
sigreturn_codes.S
sleep.S ARM: fix new BSYM() usage introduced via for-arm-soc branch 2015-06-12 21:19:35 +01:00
smccc-call.S ARM: 8479/2: add implementation for arm-smccc 2016-01-04 16:24:34 +00:00
smp.c arch/hotplug: Call into idle with a proper state 2016-03-01 20:36:57 +01:00
smp_scu.c
smp_tlb.c
smp_twd.c ARM: clean up TWD after previous patch 2015-10-09 16:22:53 +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 ARM: 8388/1: tcm: Don't crash when TCM banks are protected by TrustZone 2015-06-06 10:37:28 +01:00
thumbee.c
time.c clocksource: cosmetic: Drop OF 'dependency' from symbols 2015-10-01 02:18:39 +02:00
topology.c ARM: 8497/1: initialize cpu_scale to its default 2016-01-26 23:49:02 +00:00
traps.c ARM: remove user cmpxchg syscall 2015-10-03 16:36:45 +01:00
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