alistair23-linux/tools/testing/selftests
Mathieu Desnoyers ee8a84c60b rseq/selftests: Fix Thumb mode build failure on arm32
Using ".arm .inst" for the arm signature introduces build issues for
programs compiled in Thumb mode because the assembler stays in the
arm mode for the rest of the inline assembly. Revert to using a ".word"
to express the signature as data instead.

The choice of signature is a valid trap instruction on arm32 little
endian, where both code and data are little endian.

ARMv6+ big endian (BE8) generates mixed endianness code vs data:
little-endian code and big-endian data. The data value of the signature
needs to have its byte order reversed to generate the trap instruction.

Prior to ARMv6, -mbig-endian generates big-endian code and data
(which match), so the endianness of the data representation of the
signature should not be reversed. However, the choice between BE32
and BE8 is done by the linker, so we cannot know whether code and
data endianness will be mixed before the linker is invoked. So rather
than try to play tricks with the linker, the rseq signature is simply
data (not a trap instruction) prior to ARMv6 on big endian. This is
why the signature is expressed as data (.word) rather than as
instruction (.inst) in assembler.

Because a ".word" is used to emit the signature, it will be interpreted
as a literal pool by a disassembler, not as an actual instruction.
Considering that the signature is not meant to be executed except in
scenarios where the program execution is completely bogus, this should
not be an issue.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Acked-by: Will Deacon <will.deacon@arm.com>
CC: Peter Zijlstra <peterz@infradead.org>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: Joel Fernandes <joelaf@google.com>
CC: Catalin Marinas <catalin.marinas@arm.com>
CC: Dave Watson <davejwatson@fb.com>
CC: Will Deacon <will.deacon@arm.com>
CC: Shuah Khan <shuah@kernel.org>
CC: Andi Kleen <andi@firstfloor.org>
CC: linux-kselftest@vger.kernel.org
CC: "H . Peter Anvin" <hpa@zytor.com>
CC: Chris Lameter <cl@linux.com>
CC: Russell King <linux@arm.linux.org.uk>
CC: Michael Kerrisk <mtk.manpages@gmail.com>
CC: "Paul E . McKenney" <paulmck@linux.vnet.ibm.com>
CC: Paul Turner <pjt@google.com>
CC: Boqun Feng <boqun.feng@gmail.com>
CC: Josh Triplett <josh@joshtriplett.org>
CC: Steven Rostedt <rostedt@goodmis.org>
CC: Ben Maurer <bmaurer@fb.com>
CC: linux-api@vger.kernel.org
CC: Andy Lutomirski <luto@amacapital.net>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Linus Torvalds <torvalds@linux-foundation.org>
CC: Carlos O'Donell <carlos@redhat.com>
CC: Florian Weimer <fweimer@redhat.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2019-07-08 13:00:41 -06:00
..
android treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00
bpf bpf: fix div64 overflow tests to properly detect errors 2019-06-13 23:07:00 +02:00
breakpoints treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00
capabilities selftests: Add test plan API to kselftest.h and adjust callers 2019-04-25 13:15:46 -06:00
cgroup kselftests: cgroup: remove duplicated include from test_freezer.c 2019-07-02 13:29:43 -06:00
cpu-hotplug
cpufreq
drivers selftests: dma-buf: Adding kernel config fragment CONFIG_UDMABUF=y 2019-06-28 14:30:41 -06:00
efivarfs treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
exec treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 166 2019-05-30 11:26:39 -07:00
filesystems
firmware treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
ftrace treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 472 2019-06-19 17:09:11 +02:00
futex treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
gpio treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
ia64 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
intel_pstate
ipc selftests/ipc: Fix msgque compiler warnings 2019-04-19 17:18:00 -06:00
ir media updates for v5.1-rc1 2019-03-09 14:45:54 -08:00
kcmp treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
kexec treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
kmod treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
kselftest selftests: Remove forced unbuffering for test running 2019-05-21 09:24:30 -06:00
kvm SPDX update for 5.2-rc6 2019-06-21 09:58:42 -07:00
lib treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
livepatch selftests/livepatch: Add functions.sh to TEST_PROGS_EXTENDED 2019-04-15 10:43:21 +02:00
locking
media_tests media: selftests: media_dev_allocator api test 2019-04-22 11:23:14 -04:00
membarrier treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
memfd selftests/memfd: add tests for F_SEAL_FUTURE_WRITE seal 2019-03-05 21:07:19 -08:00
memory-hotplug
mount
mqueue
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-06-17 15:55:34 -07:00
netfilter Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf 2019-05-23 14:45:36 -07:00
networking/timestamping selftests: timestamping: Fix SIOCGSTAMP undeclared build failure 2019-06-28 14:31:12 -06:00
nsfs treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
ntb treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 25 2019-05-21 11:52:39 +02:00
pidfd tests: fix pidfd-test compilation 2019-06-05 15:06:32 +02:00
powerpc treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
prctl
proc treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
pstore treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 472 2019-06-19 17:09:11 +02:00
ptp SPDX update for 5.2-rc2, round 2 2019-05-24 14:31:58 -07:00
ptrace treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
rcutorture for-5.2/block-20190507 2019-05-07 18:14:36 -07:00
rseq rseq/selftests: Fix Thumb mode build failure on arm32 2019-07-08 13:00:41 -06:00
rtc SPDX update for 5.2-rc3, round 1 2019-05-31 08:34:32 -07:00
safesetid
seccomp treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 481 2019-06-19 17:09:51 +02:00
sigaltstack treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
size treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 166 2019-05-30 11:26:39 -07:00
sparc64
splice
static_keys treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
sync selftests: Add test plan API to kselftest.h and adjust callers 2019-04-25 13:15:46 -06:00
sysctl treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
tc-testing net: sched: flower: use correct ht function to prevent duplicates 2019-04-11 11:33:06 -07:00
timers treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 295 2019-06-05 17:36:38 +02:00
tmpfs treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
tpm2 selftests/tpm2: Open tpm dev in unbuffered mode 2019-04-08 15:58:55 -07:00
uevent
user treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
vDSO treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 180 2019-05-30 11:29:20 -07:00
vm treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 499 2019-06-19 17:09:53 +02:00
watchdog
x86 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 444 2019-06-05 17:37:17 +02:00
zram treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 25 2019-05-21 11:52:39 +02:00
.gitignore selftests: Extract single-test shell logic from lib.mk 2019-04-25 13:14:13 -06:00
gen_kselftest_tar.sh
kselftest.h selftests: Add test plan API to kselftest.h and adjust callers 2019-04-25 13:15:46 -06:00
kselftest_harness.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 481 2019-06-19 17:09:51 +02:00
kselftest_install.sh
kselftest_module.h kselftest: Add test module framework header 2019-04-08 16:44:20 -06:00
kselftest_module.sh kselftest: Add test runner creation script 2019-04-08 16:44:11 -06:00
lib.mk selftests: fix bpf build/test workflow regression when KBUILD_OUTPUT is set 2019-05-13 10:19:43 -06:00
Makefile selftests: avoid KBUILD_OUTPUT dir cluttering with selftest objects 2019-05-14 17:37:41 -06:00