]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
x86/vdso: Abstract out vdso system call internals
authorH. Peter Anvin <hpa@zytor.com>
Tue, 16 Dec 2025 21:26:02 +0000 (13:26 -0800)
committerDave Hansen <dave.hansen@linux.intel.com>
Wed, 14 Jan 2026 00:37:58 +0000 (16:37 -0800)
commita0636d4c3ad0da0cd6069eb6fef5d2b7d3449378
tree8c17a0d669b6064c0933ef0e0cfda866866950e3
parent8717b02b8c030dc0c4b55781b59e88def0a1a92f
x86/vdso: Abstract out vdso system call internals

Abstract out the calling of true system calls from the vdso into
macros.

It has been a very long time since gcc did not allow %ebx or %ebp in
inline asm in 32-bit PIC mode; remove the corresponding hacks.

Remove the use of memory output constraints in gettimeofday.h in favor
of "memory" clobbers. The resulting code is identical for the current
use cases, as the system call is usually a terminal fallback anyway,
and it merely complicates the macroization.

This patch adds only a handful of more lines of code than it removes,
and in fact could be made substantially smaller by removing the macros
for the argument counts that aren't currently used, however, it seems
better to be general from the start.

[ v3: remove stray comment from prototyping; remove VDSO_SYSCALL6()
      since it would require special handling on 32 bits and is
      currently unused. (Uros Biszjak)

      Indent nested preprocessor directives. ]

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Acked-by: Uros Bizjak <ubizjak@gmail.com>
Link: https://patch.msgid.link/20251216212606.1325678-9-hpa@zytor.com
arch/x86/include/asm/vdso/gettimeofday.h
arch/x86/include/asm/vdso/sys_call.h [new file with mode: 0644]