summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/x86/fsgsbase_restore.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/selftests/x86/fsgsbase_restore.c')
-rw-r--r--tools/testing/selftests/x86/fsgsbase_restore.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/tools/testing/selftests/x86/fsgsbase_restore.c b/tools/testing/selftests/x86/fsgsbase_restore.c
index 6fffadc51579..224058c1e4b2 100644
--- a/tools/testing/selftests/x86/fsgsbase_restore.c
+++ b/tools/testing/selftests/x86/fsgsbase_restore.c
@@ -39,12 +39,11 @@
# define SEG "%fs"
#endif
-static unsigned int dereference_seg_base(void)
-{
- int ret;
- asm volatile ("mov %" SEG ":(0), %0" : "=rm" (ret));
- return ret;
-}
+/*
+ * Defined in clang_helpers_[32|64].S, because unlike gcc, clang inline asm does
+ * not support segmentation prefixes.
+ */
+unsigned int dereference_seg_base(void);
static void init_seg(void)
{