Thorsten Glaser
2021-May-03 23:25 UTC
[klibc] Debian #943425: [s390x] setjmp/longjmp do not save/restore all registers in use (was Use of $v10 register (was Re: klibc: [s390x] SIGSEGV in mksh testcase funsub-2))
Dixi quod?>So, setjmp/longjmp in klibc save f1/f3/f5/f7 (as shown on Wikipedia >https://en.wikipedia.org/wiki/Calling_convention#IBM_System/360_and_successors >?the z/Architecture ABI,[11] used in Linux? a page down), while >glibc?s save f8?f15 instead.Jessica Clarke brought out docs saying f8?f15 must be saved, the other FPU registers not: https://refspecs.linuxfoundation.org/ELF/zSeries/lzsabi0_zSeries.html#AEN413 This matches what glibc does. Maybe an s390x porter wishes to fix Wikipedia?>https://share.confex.com/share/124/webprogram/Handout/Session16897/SHARE_Seattle_2015_SIMD.pdf >shows that the vector registers overlap and extend the FPU registers.>? is register v10 (vector extension) even supposed to be used?This needs to be answered, I guess, because?>? klibc does not really support the FPU anyway? GCC chooses to allocate an FPU register for a pointer value.>? the half of v10 that equals f10 just HAPPENS to be saved by > glibc, but what if the upper half, that is outside of the FPU, > is used?The question here is, does GCC only use the halves of the half of the vector registers that match the FPU registers? @klibc list: as indicated earlier, I can provide a patch if needed (though it should be obvious). bye, //mirabilos -- 22:20?<asarch> The crazy that persists in his craziness becomes a master 22:21?<asarch> And the distance between the craziness and geniality is only measured by the success 18:35?<asarch> "Psychotics are consistently inconsistent. The essence of sanity is to be inconsistently inconsistent
Debian Bug Tracking System
2021-May-03 23:33 UTC
[klibc] Bug#943425: Info received (Debian #943425: [s390x] setjmp/longjmp do not save/restore all registers in use (was Use of $v10 register (was Re: klibc: [s390x] SIGSEGV in mksh testcase funsub-2)))
Thank you for the additional information you have supplied regarding this Bug report. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): Debian Kernel Team <debian-kernel at lists.debian.org> If you wish to submit further information on this problem, please send it to 943425 at bugs.debian.org. Please do not send mail to owner at bugs.debian.org unless you wish to report a problem with the Bug-tracking system. -- 943425: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=943425 Debian Bug Tracking System Contact owner at bugs.debian.org with problems
Thorsten Glaser
2021-May-05 02:45 UTC
[klibc] Debian #943425: [s390x] setjmp/longjmp do not save/restore all registers in use
Dixi quod?>Jessica Clarke brought out docs saying f8?f15 must be saved, the >other FPU registers not:This needs to be fixed in klibc.>>? klibc does not really support the FPU anyway > >? GCC chooses to allocate an FPU register for a pointer value.This is a curiosity.>>? the half of v10 that equals f10 just HAPPENS to be saved by >> glibc, but what if the upper half, that is outside of the FPU, >> is used? > >The question here is, does GCC only use the halves of the half >of the vector registers that match the FPU registers?04:41??jrtc27:#debian-x32? hephaistor: re s390x vector registers, reading the gcc and llvm sources they're ? all call-clobbered by default, only the float parts are call-saved 04:41??jrtc27:#debian-x32? so that's why setjmp/longjmp don't need to save/restore them 04:42??jrtc27:#debian-x32? there *is* a vector calling convention, but it's not the default for the ABI, ? it's opt-in, and setjmp/longjmp won't be annotated as such So we indeed need to only save the registers glibc does.>@klibc list: as indicated earlier, I can provide a patch if needed >(though it should be obvious).bye, //mirabilos -- [00:02] <Vutral> gecko: benutzt du emacs ? [00:03] <gecko> n? [00:03] <gecko> nur n normalen mac [00:04] <Vutral> argl [00:04] <Vutral> ne den editor -- Vutral und gecko2 in #deutsch (NB: Editor? Betriebssystem.)