klibc-bot for mirabilos
2021-Dec-26 21:06 UTC
[klibc] [klibc:master] {set, long}jmp [s390x]: save/restore the correct registers
Commit-ID: 12db27ba0db4fabe1230d1d9b8be56453991e6a9 Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=12db27ba0db4fabe1230d1d9b8be56453991e6a9 Author: mirabilos <tg at debian.org> AuthorDate: Wed, 5 May 2021 21:26:33 +0200 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Sun, 26 Dec 2021 18:56:52 +0100 {set,long}jmp [s390x]: save/restore the correct registers The s390x ABI actually has FPU registers f8?f15, not f1/f3/f5/f7, to be saved. (Closes: Debian #943425) Signed-off-by: mirabilos <tg at debian.org> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/include/arch/s390/klibc/archsetjmp.h | 2 +- usr/klibc/arch/s390/setjmp.S | 24 ++++++++++++++++-------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/usr/include/arch/s390/klibc/archsetjmp.h b/usr/include/arch/s390/klibc/archsetjmp.h index 728780ad..1167c8b6 100644 --- a/usr/include/arch/s390/klibc/archsetjmp.h +++ b/usr/include/arch/s390/klibc/archsetjmp.h @@ -16,7 +16,7 @@ struct __jmp_buf { struct __jmp_buf { uint64_t __gregs[10]; /* general registers r6-r15 */ - uint64_t __fpregs[4]; /* fp registers f1, f3, f5, f7 */ + uint64_t __fpregs[8]; /* fp registers f8-f15 */ }; #endif /* __s390x__ */ diff --git a/usr/klibc/arch/s390/setjmp.S b/usr/klibc/arch/s390/setjmp.S index c36a0517..1386419a 100644 --- a/usr/klibc/arch/s390/setjmp.S +++ b/usr/klibc/arch/s390/setjmp.S @@ -38,10 +38,14 @@ longjmp: setjmp: stmg %r6,%r15,0(%r2) # save all general registers - std %f1,80(%r2) # save fp registers f4 and f6 - std %f3,88(%r2) - std %f5,96(%r2) - std %f7,104(%r2) + std %f8,80(%r2) # save fp registers f8 to f15 + std %f9,88(%r2) + std %f10,96(%r2) + std %f11,104(%r2) + std %f12,112(%r2) + std %f13,120(%r2) + std %f14,128(%r2) + std %f15,136(%r2) lghi %r2,0 # return 0 br %r14 @@ -54,10 +58,14 @@ setjmp: longjmp: lgr %r1,%r2 # jmp_buf lgr %r2,%r3 # return value - ld %f7,104(%r1) # restore all saved registers - ld %f5,96(%r1) - ld %f3,88(%r1) - ld %f1,80(%r1) + ld %f15,136(%r1) # restore all saved registers + ld %f14,128(%r1) + ld %f13,120(%r1) + ld %f12,112(%r1) + ld %f11,104(%r1) + ld %f10,96(%r1) + ld %f9,88(%r1) + ld %f8,80(%r1) lmg %r6,%r15,0(%r1) br %r14 # return to restored address