Skip to content

Commit 89fe0a1

Browse files
amlutoIngo Molnar
authored andcommitted
x86/vdso: Remove "memory" clobbers in the vDSO syscall fallbacks
When a vDSO clock function falls back to the syscall, no special barriers or ordering is needed, and the syscall fallbacks don't clobber any memory that is not explicitly listed in the asm constraints. Remove the "memory" clobber. This causes minor changes to the generated code, but otherwise has no obvious performance impact. I think it's nice to have, though, since it may help the optimizer in the future. Signed-off-by: Andy Lutomirski <luto@kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/3a7438f5fb2422ed881683d2ccffd7f987b2dc44.1538689401.git.luto@kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 315f28f commit 89fe0a1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/entry/vdso/vclock_gettime.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ notrace static long vdso_fallback_gettime(long clock, struct timespec *ts)
4545
long ret;
4646
asm ("syscall" : "=a" (ret), "=m" (*ts) :
4747
"0" (__NR_clock_gettime), "D" (clock), "S" (ts) :
48-
"memory", "rcx", "r11");
48+
"rcx", "r11");
4949
return ret;
5050
}
5151

@@ -62,7 +62,7 @@ notrace static long vdso_fallback_gettime(long clock, struct timespec *ts)
6262
"mov %%edx, %%ebx \n"
6363
: "=a" (ret), "=m" (*ts)
6464
: "0" (__NR_clock_gettime), [clock] "g" (clock), "c" (ts)
65-
: "memory", "edx");
65+
: "edx");
6666
return ret;
6767
}
6868

0 commit comments

Comments
 (0)