]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
x86/entry/vdso: Refactor the vdso build
authorH. Peter Anvin <hpa@zytor.com>
Tue, 16 Dec 2025 21:25:57 +0000 (13:25 -0800)
committerDave Hansen <dave.hansen@linux.intel.com>
Tue, 13 Jan 2026 23:35:09 +0000 (15:35 -0800)
commit693c819fedcdcabfda7488e2d5e355a84c2fd1b0
tree3a9b318ccebcf2513d27b50cb54d574fcf141a70
parenta76108d05ee13cddb72b620752a80b2c3e87aee1
x86/entry/vdso: Refactor the vdso build

- Separate out the vdso sources into common, vdso32, and vdso64
  directories.
- Build the 32- and 64-bit vdsos in their respective subdirectories;
  this greatly simplifies the build flags handling.
- Unify the mangling of Makefile flags between the 32- and 64-bit
  vdso code as much as possible; all common rules are put in
  arch/x86/entry/vdso/common/Makefile.include. The remaining
  is very simple for 32 bits; the 64-bit one is only slightly more
  complicated because it contains the x32 generation rule.
- Define __DISABLE_EXPORTS when building the vdso. This need seems to
  have been masked by different ordering compile flags before.
- Change CONFIG_X86_64 to BUILD_VDSO32_64 in vdso32/system_call.S,
  to make it compatible with including fake_32bit_build.h.
- The -fcf-protection= option was "leaking" from the kernel build,
  for reasons that was not clear to me. Furthermore, several
  distributions ship with it set to a default value other than
  "-fcf-protection=none". Make it match the configuration options
  for *user space*.

Note that this patch may seem large, but the vast majority of it is
simply code movement.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Link: https://patch.msgid.link/20251216212606.1325678-4-hpa@zytor.com
21 files changed:
arch/x86/entry/vdso/Makefile
arch/x86/entry/vdso/common/Makefile.include [new file with mode: 0644]
arch/x86/entry/vdso/common/note.S [moved from arch/x86/entry/vdso/vdso-note.S with 62% similarity]
arch/x86/entry/vdso/common/vclock_gettime.c [moved from arch/x86/entry/vdso/vclock_gettime.c with 100% similarity]
arch/x86/entry/vdso/common/vdso-layout.lds.S [moved from arch/x86/entry/vdso/vdso-layout.lds.S with 100% similarity]
arch/x86/entry/vdso/common/vgetcpu.c [moved from arch/x86/entry/vdso/vgetcpu.c with 100% similarity]
arch/x86/entry/vdso/vdso32/Makefile [new file with mode: 0644]
arch/x86/entry/vdso/vdso32/note.S
arch/x86/entry/vdso/vdso32/system_call.S
arch/x86/entry/vdso/vdso32/vclock_gettime.c
arch/x86/entry/vdso/vdso32/vdso32.lds.S
arch/x86/entry/vdso/vdso32/vgetcpu.c
arch/x86/entry/vdso/vdso64/Makefile [new file with mode: 0644]
arch/x86/entry/vdso/vdso64/note.S [new file with mode: 0644]
arch/x86/entry/vdso/vdso64/vclock_gettime.c [new file with mode: 0644]
arch/x86/entry/vdso/vdso64/vdso64.lds.S [moved from arch/x86/entry/vdso/vdso.lds.S with 94% similarity]
arch/x86/entry/vdso/vdso64/vdsox32.lds.S [moved from arch/x86/entry/vdso/vdsox32.lds.S with 92% similarity]
arch/x86/entry/vdso/vdso64/vgetcpu.c [new file with mode: 0644]
arch/x86/entry/vdso/vdso64/vgetrandom-chacha.S [moved from arch/x86/entry/vdso/vgetrandom-chacha.S with 100% similarity]
arch/x86/entry/vdso/vdso64/vgetrandom.c [moved from arch/x86/entry/vdso/vgetrandom.c with 91% similarity]
arch/x86/entry/vdso/vdso64/vsgx.S [moved from arch/x86/entry/vdso/vsgx.S with 100% similarity]