summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/x86/fsgsbase.c
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@kernel.org>2020-06-26 20:24:28 +0300
committerThomas Gleixner <tglx@linutronix.de>2020-07-01 16:27:20 +0300
commit8e259031c67a5ea0666428edb64c89e8c6ebd18e (patch)
tree379d458f8bf0e85e1bcbaeda683eca889fb97a17 /tools/testing/selftests/x86/fsgsbase.c
parent979c2c4247cafd8a91628a7306b6871efbd12fdb (diff)
downloadlinux-8e259031c67a5ea0666428edb64c89e8c6ebd18e.tar.xz
selftests/x86/fsgsbase: Add a missing memory constraint
The manual call to set_thread_area() via int $0x80 was missing any indication that the descriptor was a pointer, causing gcc to occasionally generate wrong code. Add the missing constraint. Signed-off-by: Andy Lutomirski <luto@kernel.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/432968af67259ca92d68b774a731aff468eae610.1593192140.git.luto@kernel.org
Diffstat (limited to 'tools/testing/selftests/x86/fsgsbase.c')
-rw-r--r--tools/testing/selftests/x86/fsgsbase.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/testing/selftests/x86/fsgsbase.c b/tools/testing/selftests/x86/fsgsbase.c
index f47495d2f070..998319553523 100644
--- a/tools/testing/selftests/x86/fsgsbase.c
+++ b/tools/testing/selftests/x86/fsgsbase.c
@@ -285,7 +285,8 @@ static unsigned short load_gs(void)
/* 32-bit set_thread_area */
long ret;
asm volatile ("int $0x80"
- : "=a" (ret) : "a" (243), "b" (low_desc)
+ : "=a" (ret), "+m" (*low_desc)
+ : "a" (243), "b" (low_desc)
: "r8", "r9", "r10", "r11");
memcpy(&desc, low_desc, sizeof(desc));
munmap(low_desc, sizeof(desc));