[PATCH v7 0/6] x86/vdso: VDSO updates and fixes for sframes

Jens Remus posted 6 patches 3 days, 22 hours ago
There is a newer version of this series
arch/Kconfig                                  |  7 +++
arch/x86/entry/vdso/common/vdso-layout.lds.S  | 13 ++++-
arch/x86/entry/vdso/vdso32/system_call.S      | 10 +---
arch/x86/entry/vdso/vdso64/Makefile           |  1 +
.../x86/entry/vdso/vdso64/vgetrandom-chacha.S |  3 +-
arch/x86/entry/vdso/vdso64/vsgx.S             | 19 +++----
arch/x86/include/asm/dwarf2.h                 | 54 +++++++++++++------
arch/x86/include/asm/linkage.h                | 33 +++++++++---
arch/x86/include/asm/vdso.h                   |  1 -
9 files changed, 95 insertions(+), 46 deletions(-)
[PATCH v7 0/6] x86/vdso: VDSO updates and fixes for sframes
Posted by Jens Remus 3 days, 22 hours ago
This enables generation of SFrame V3 stack trace information for VDSO on
x86-64.  It's a continuation of Josh's and Steve's work:

   https://lore.kernel.org/all/cover.1737511963.git.jpoimboe@kernel.org/
   https://lore.kernel.org/all/20250422183439.895236512@goodmis.org/

This series focuses only on the VDSO code. They are helpful fixes
and updates that doesn't rely on sframes (although the last patch
is sframe related).

This series applies on top of tip:x86/entry:

  git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git  x86/entry

Like the unwind user sframe series [1] it depends on the upcoming
binutils 2.46 release to be used to build the VDSO with SFrame V3
stack trace information (using the assembler option --gsframe-3).

[1]: [PATCH v13 00/18] unwind_deferred: Implement sframe handling,
    https://lore.kernel.org/all/20260127150554.2760964-1-jremus@linux.ibm.com/


Changes in v7 (see individual patch notes):
- Rebase on H. Peter Anvin's vDSO changes on tip:x86/entry. (Peter)
- Simplify adding assembler option -Wa,--gsframe-3.  Add for vdso64
  only.
- Align to .eh_frame and mark .sframe as KEEP in vDSO linker script.
  Note that GNU linker 2.46 will mark .sframe as KEEP in its default
  linker script as well.

Changes in v6:
- SFrame V3 support (SFrame V2 is not supported).
- Prevent GNU_SFRAME program table entry to empty .sframe section.
- Integrate v5 review feedback. (Josh)

Regards,
Jens


Josh Poimboeuf (6):
  x86/vdso: Fix DWARF generation for getrandom()
  x86/asm: Avoid emitting DWARF CFI for non-VDSO
  x86/asm: Simplify VDSO DWARF generation
  x86/vdso: Use SYM_FUNC_{START,END} in __kernel_vsyscall()
  x86/vdso: Use CFI macros in __vdso_sgx_enter_enclave()
  x86/vdso: Enable sframe generation in VDSO

 arch/Kconfig                                  |  7 +++
 arch/x86/entry/vdso/common/vdso-layout.lds.S  | 13 ++++-
 arch/x86/entry/vdso/vdso32/system_call.S      | 10 +---
 arch/x86/entry/vdso/vdso64/Makefile           |  1 +
 .../x86/entry/vdso/vdso64/vgetrandom-chacha.S |  3 +-
 arch/x86/entry/vdso/vdso64/vsgx.S             | 19 +++----
 arch/x86/include/asm/dwarf2.h                 | 54 +++++++++++++------
 arch/x86/include/asm/linkage.h                | 33 +++++++++---
 arch/x86/include/asm/vdso.h                   |  1 -
 9 files changed, 95 insertions(+), 46 deletions(-)

-- 
2.51.0
Re: [PATCH v7 0/6] x86/vdso: VDSO updates and fixes for sframes
Posted by Jens Remus 1 day ago
On 2/3/2026 6:19 PM, Jens Remus wrote:
> This enables generation of SFrame V3 stack trace information for VDSO on
> x86-64.  It's a continuation of Josh's and Steve's work:
> 
>    https://lore.kernel.org/all/cover.1737511963.git.jpoimboe@kernel.org/
>    https://lore.kernel.org/all/20250422183439.895236512@goodmis.org/

Above is the link to Steven's v5 of the series on which I based my v6:
https://lore.kernel.org/all/20260129112726.892340-1-jremus@linux.ibm.com/

I just realized that Steven's latest version actually was v6:
https://lore.kernel.org/all/20250425023750.669174660@goodmis.org/

That is why I also messed up the series' versioning and erroneously sent
mine as v6 as well.  Sorry for that!

I'll incorporate all of the missing original v6 changes and review
feedback into v8.  Following is an excerpt from the range-diff between
Steven's v6 and my v6 showing the only missing change in commit subject
of patch 3:

3:  6ce4adda138b ! 3:  9b59e14424b0 x86/asm: Use CFI_* macros in SYM_FUNC_* macros so they can be added to VDSO
    @@ Metadata
     Author: Josh Poimboeuf <jpoimboe@kernel.org>

      ## Commit message ##
    -    x86/asm: Use CFI_* macros in SYM_FUNC_* macros so they can be added to VDSO
    +    x86/asm: Simplify VDSO DWARF generation

         Add CFI_STARTPROC and CFI_ENDPROC annotations to the SYM_FUNC_* macros
         so the VDSO asm functions don't need to add them manually.  Note this
         only affects VDSO, the CFI_* macros are empty for the kernel proper.

    +    [ Jens Remus: Reword commit subject and message as suggested by Josh. ]
    +
         Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
    -    [ Fixed rebased issues. ]
         Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
    +    Signed-off-by: Jens Remus <jremus@linux.ibm.com>

      ## arch/x86/entry/vdso/vdso-layout.lds.S ##
     @@

Regards,
Jens
-- 
Jens Remus
Linux on Z Development (D3303)
jremus@de.ibm.com / jremus@linux.ibm.com

IBM Deutschland Research & Development GmbH; Vorsitzender des Aufsichtsrats: Wolfgang Wendt; Geschäftsführung: David Faller; Sitz der Gesellschaft: Ehningen; Registergericht: Amtsgericht Stuttgart, HRB 243294
IBM Data Privacy Statement: https://www.ibm.com/privacy/