Skip to content

Commit 8e25903

Browse files
amlutoKAGA-KOKO
authored andcommitted
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
1 parent 979c2c4 commit 8e25903

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/testing/selftests/x86/fsgsbase.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,8 @@ static unsigned short load_gs(void)
285285
/* 32-bit set_thread_area */
286286
long ret;
287287
asm volatile ("int $0x80"
288-
: "=a" (ret) : "a" (243), "b" (low_desc)
288+
: "=a" (ret), "+m" (*low_desc)
289+
: "a" (243), "b" (low_desc)
289290
: "r8", "r9", "r10", "r11");
290291
memcpy(&desc, low_desc, sizeof(desc));
291292
munmap(low_desc, sizeof(desc));

0 commit comments

Comments
 (0)