Closed VVIsaev closed 3 years ago
In glibc we have mcontext with
__r30, __r58, __r59;
https://github.com/foss-for-synopsys-dwc-arc-processors/glibc/blob/9826b03b747b841f5fc6de2054bf1ef3f5c4bdf3/sysdeps/unix/sysv/linux/arc/sys/ucontext.h#L29 .
That is good as we have the right ABI in place.
When in kernel we don't have these registers in sigcontext: https://elixir.bootlin.com/linux/v5.13-rc5/source/arch/arc/include/uapi/asm/sigcontext.h#L19
Yes this could be an issue - we need to preserve these registers across signal handling - looks like when we added the ARCv2 regset, we missed adding it here.
https://elixir.bootlin.com/linux/v5.13-rc5/source/arch/arc/include/uapi/asm/ptrace.h#L34 .
This is likely not an issue (adding Sahahb to confirm). gdb ptrace infrastructure uses user_regs_struct and user_regs_arcv2 explicitly and not struct ucontext interface.
I don't think that it actually affects something, just observation that can be fixed or at least commented.
Well there are 2 potential issues here
gdb ptrace infrastructure uses user_regs_struct and user_regs_arcv2 explicitly and not struct ucontext interface.
Indeed! That is the reason of arc: Add support for ARC HS extra registers in core files commit in binutils.
Nevertheless, your 2 points in the end are correct.
Merged upstream for 5.13-rc7 inclusion 2021-06-08 96f1b00138cb ARCv2: save ABI registers across signal handling
In glibc we have mcontext with
__r30, __r58, __r59;
https://github.com/foss-for-synopsys-dwc-arc-processors/glibc/blob/9826b03b747b841f5fc6de2054bf1ef3f5c4bdf3/sysdeps/unix/sysv/linux/arc/sys/ucontext.h#L29 .When in kernel we don't have these registers in sigcontext: https://elixir.bootlin.com/linux/v5.13-rc5/source/arch/arc/include/uapi/asm/sigcontext.h#L19 https://elixir.bootlin.com/linux/v5.13-rc5/source/arch/arc/include/uapi/asm/ptrace.h#L34 .
I don't think that it actually affects something, just observation that can be fixed or at least commented.