diff mbox series

[4/8] selftests: x86: fsgsbase_restore: fix asm directive from =rm to =r

Message ID 20240501122918.3831734-5-usama.anjum@collabora.com
State New
Headers show
Series selftests: x86: build suite with clang | expand

Commit Message

Muhammad Usama Anjum May 1, 2024, 12:29 p.m. UTC
The clang gives unknown use of instruction mnemonic error. Fix it by
specifying =r only. The operand would be placed in register only.

fsgsbase_restore.c:45:16: error: unknown use of instruction mnemonic without a size suffix
   45 |         asm volatile ("mov %" SEG ":(0), %0" : "=rm" (ret));
      |                       ^
<inline asm>:1:2: note: instantiated into assembly here
    1 |         mov %fs:(0), 20(%esp)
      |         ^
fsgsbase_restore.c:45:16: error: unknown use of instruction mnemonic without a size suffix
   45 |         asm volatile ("mov %" SEG ":(0), %0" : "=rm" (ret));
      |                       ^
<inline asm>:1:2: note: instantiated into assembly here
    1 |         mov %fs:(0), 20(%esp)
      |         ^

Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
---
 tools/testing/selftests/x86/fsgsbase_restore.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/tools/testing/selftests/x86/fsgsbase_restore.c b/tools/testing/selftests/x86/fsgsbase_restore.c
index 6fffadc515791..12871b482185b 100644
--- a/tools/testing/selftests/x86/fsgsbase_restore.c
+++ b/tools/testing/selftests/x86/fsgsbase_restore.c
@@ -42,7 +42,7 @@ 
 static unsigned int dereference_seg_base(void)
 {
 	int ret;
-	asm volatile ("mov %" SEG ":(0), %0" : "=rm" (ret));
+	asm volatile ("mov %" SEG ":(0), %0" : "=r" (ret));
 	return ret;
 }