ebdb6f2377
The AArch32 instruction sets prior to Armv7 do not define the ISB and DSB instructions that are needed to form a speculation barrier. While I do not know of any instances of cores based on those instruction sets being vulnerable to speculative side channel attacks it is possible to run code built for those ISAs on more recent hardware where they would become vulnerable. This patch works around this by using a library call added to libgcc. That code can then take any platform-specific actions necessary to ensure safety. For the moment I've only handled two cases: the library code being built for armv7 or later anyway and running on Linux. On Linux we can handle this by calling the kernel function that will flush a small amount of cache. Such a sequence ends with a ISB+DSB sequence if running on an Armv7 or later CPU. gcc: PR target/86951 * config/arm/arm-protos.h (arm_emit_speculation_barrier): New prototype. * config/arm/arm.c (speculation_barrier_libfunc): New static variable. (arm_init_libfuncs): Initialize it. (arm_emit_speculation_barrier): New function. * config/arm/arm.md (speculation_barrier): Call arm_emit_speculation_barrier for architectures that do not have DSB or ISB. (speculation_barrier_insn): Only match on Armv7 or later. libgcc: PR target/86951 * config/arm/lib1funcs.asm (speculation_barrier): New function. * config/arm/t-arm (LIB1ASMFUNCS): Add it to list of functions to build. From-SVN: r263806 |
||
---|---|---|
.. | ||
config | ||
soft-fp | ||
ChangeLog | ||
config.host | ||
config.in | ||
configure | ||
configure.ac | ||
crtstuff.c | ||
dfp-bit.c | ||
dfp-bit.h | ||
divmod.c | ||
empty.mk | ||
emutls.c | ||
enable-execute-stack-empty.c | ||
enable-execute-stack-mprotect.c | ||
find-symver.awk | ||
fixed-bit.c | ||
fixed-bit.h | ||
fixed-obj.mk | ||
floatunsidf.c | ||
floatunsisf.c | ||
floatunsitf.c | ||
floatunsixf.c | ||
fp-bit.c | ||
fp-bit.h | ||
gbl-ctors.h | ||
gcov.h | ||
gen-fixed.sh | ||
generic-morestack-thread.c | ||
generic-morestack.c | ||
generic-morestack.h | ||
gstdint.h | ||
gthr-posix.h | ||
gthr-single.h | ||
gthr.h | ||
libgcc2.c | ||
libgcc2.h | ||
libgcc-std.ver.in | ||
libgcov-driver-system.c | ||
libgcov-driver.c | ||
libgcov-interface.c | ||
libgcov-merge.c | ||
libgcov-profiler.c | ||
libgcov-util.c | ||
libgcov.h | ||
Makefile.in | ||
memcmp.c | ||
memcpy.c | ||
memmove.c | ||
memset.c | ||
mkheader.sh | ||
mkmap-flat.awk | ||
mkmap-symver.awk | ||
offloadstuff.c | ||
shared-object.mk | ||
siditi-object.mk | ||
static-object.mk | ||
sync.c | ||
udivmod.c | ||
udivmodsi4.c | ||
unwind-arm-common.inc | ||
unwind-c.c | ||
unwind-compat.c | ||
unwind-compat.h | ||
unwind-dw2-fde-compat.c | ||
unwind-dw2-fde-dip.c | ||
unwind-dw2-fde.c | ||
unwind-dw2-fde.h | ||
unwind-dw2.c | ||
unwind-dw2.h | ||
unwind-generic.h | ||
unwind-pe.h | ||
unwind-seh.c | ||
unwind-sjlj.c | ||
unwind.inc | ||
vtv_end_preinit.c | ||
vtv_end.c | ||
vtv_start_preinit.c | ||
vtv_start.c |