linux/tools/testing/selftests/rseq
Mathieu Desnoyers fe22983d92 rseq/selftests: x86: Work-around bogus gcc-8 optimisation
gcc-8 version 8.1.0, 8.2.0, and 8.3.0 generate broken assembler with asm
goto that have a thread-local storage "m" input operand on both x86-32
and x86-64. For instance:

__thread int var;

static int fct(void)
{
        asm goto (      "jmp %l[testlabel]\n\t"
                        : : [var] "m" (var) : : testlabel);
        return 0;
testlabel:
        return 1;
}

int main()
{
        return fct();
}

% gcc-8 -O2 -o test-asm-goto test-asm-goto.c
/tmp/ccAdHJbe.o: In function `main':
test-asm-goto.c:(.text.startup+0x1): undefined reference to `.L2'
collect2: error: ld returned 1 exit status

% gcc-8 -m32 -O2 -o test-asm-goto test-asm-goto.c
/tmp/ccREsVXA.o: In function `main':
test-asm-goto.c:(.text.startup+0x1): undefined reference to `.L2'
collect2: error: ld returned 1 exit status

Work-around this compiler bug in the rseq-x86.h header by passing the
address of the __rseq_abi TLS as a register operand rather than using
the "m" input operand.

Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90193
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
CC: Ingo Molnar <mingo@redhat.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>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2019-05-07 15:30:14 -06:00
..
.gitignore rseq/selftests: Provide Makefile, scripts, gitignore 2018-06-06 11:58:35 +02:00
basic_percpu_ops_test.c rseq/selftests: Provide basic percpu ops test 2018-06-06 11:58:35 +02:00
basic_test.c
Makefile rseq/selftests: Provide Makefile, scripts, gitignore 2018-06-06 11:58:35 +02:00
param_test.c rseq/selftests: fix parametrized test with -fpie 2018-09-27 12:59:19 -06:00
rseq-arm64.h rseq/selftests: Add support for arm64 2018-07-23 16:01:50 +01:00
rseq-arm.h rseq/selftests/arm: Align 'struct rseq_cs' on 32 bytes 2018-06-21 12:40:13 +02:00
rseq-mips.h rseq/selftests: Implement MIPS support 2018-06-19 21:14:19 -07:00
rseq-ppc.h
rseq-s390.h rseq/selftests: add s390 support 2018-08-09 07:59:05 +02:00
rseq-skip.h
rseq-x86.h rseq/selftests: x86: Work-around bogus gcc-8 optimisation 2019-05-07 15:30:14 -06:00
rseq.c
rseq.h selftest/rseq: Remove duplicate header 2019-04-08 16:18:21 -06:00
run_param_test.sh rseq/selftests: Adapt number of threads to the number of detected cpus 2019-04-08 16:44:21 -06:00