selftests/x86: Test SYSCALL and SYSENTER manually with TF set
authorAndy Lutomirski <luto@kernel.org>
Tue, 2 Jul 2019 03:43:19 +0000 (20:43 -0700)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 2 Jul 2019 06:45:20 +0000 (08:45 +0200)
commit9402eaf4c11f0b892eda7b2bcb4654ab34ce34f9
tree5b392bddeac59062107c2e2adacaf80fc514bc66
parentfd329f276ecaad7a371d6f91b9bbea031d0c3440
selftests/x86: Test SYSCALL and SYSENTER manually with TF set

Make sure that both variants of the nasty TF-in-compat-syscall are
exercised regardless of what vendor's CPU is running the tests.

Also change the intentional signal after SYSCALL to use ud2, which
is a lot more comprehensible.

This crashes the kernel due to an FSGSBASE bug right now.

This test *also* detects a bug in KVM when run on an Intel host.  KVM
people, feel free to use it to help debug.  There's a bunch of code in this
test to warn instead of going into an infinite looping when the bug gets
triggered.

Reported-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: "BaeChang Seok" <chang.seok.bae@intel.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org
Cc: "Bae, Chang Seok" <chang.seok.bae@intel.com>
Link: https://lkml.kernel.org/r/5f5de10441ab2e3005538b4c33be9b1965d1bb63.1562035429.git.luto@kernel.org
tools/testing/selftests/x86/Makefile
tools/testing/selftests/x86/syscall_arg_fault.c