diff options
author | Hendrik Brueckner <brueckner@linux.vnet.ibm.com> | 2017-11-20 11:46:13 +0100 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2017-12-13 10:51:36 +0100 |
commit | 7bceec4e58ee23be653c0dd366479d6cb64ae686 (patch) | |
tree | cd285499f296c534522f812c6d4af6febd7aa8a2 /arch/s390/kernel/vdso64/gettimeofday.S | |
parent | bc3703f21cec8a2ac6a64f6fb3686fbcb1ba1513 (diff) |
s390/vdso: revise CFI annotations of vDSO functions
Revise and add CFI CFA and register rule annotations to the vDSO
functions for proper stack unwinding and debugging.
Because glibc might call the vDSO in special ways, the vDSO code
does not rely on a stack frame created by the caller. The TOD clock
value can be therefore not stored in the pre-allocated stack area
and additional stack space is required.
To correctly annotate these situations with CFI, the .cfi_val_offset
directive is required to create relative offsets on the value of the
stack register %r15. Because the .cfi_val_offset directive is
available with recent GNU assembler versions only, additional checks
are necessary.
Note that if the vDSO is assembled with an older assembler version,
stack unwinding and debugging from within the vDSO code might not
be possible.
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/vdso64/gettimeofday.S')
-rw-r--r-- | arch/s390/kernel/vdso64/gettimeofday.S | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/s390/kernel/vdso64/gettimeofday.S b/arch/s390/kernel/vdso64/gettimeofday.S index 964afb1de06d..6e1f0b421695 100644 --- a/arch/s390/kernel/vdso64/gettimeofday.S +++ b/arch/s390/kernel/vdso64/gettimeofday.S @@ -16,8 +16,10 @@ .globl __kernel_gettimeofday .type __kernel_gettimeofday,@function __kernel_gettimeofday: - .cfi_startproc + CFI_STARTPROC aghi %r15,-16 + CFI_ADJUST_CFA_OFFSET 16 + CFI_VAL_OFFSET 15, -160 larl %r5,_vdso_data 0: ltgr %r3,%r3 /* check if tz is NULL */ je 1f @@ -59,8 +61,10 @@ __kernel_gettimeofday: stg %r0,8(%r2) /* store tv->tv_usec */ 4: lghi %r2,0 aghi %r15,16 + CFI_ADJUST_CFA_OFFSET -16 + CFI_RESTORE 15 br %r14 + CFI_ENDPROC 5: .quad 1000000000 .long 274877907 - .cfi_endproc .size __kernel_gettimeofday,.-__kernel_gettimeofday |