riscv-qemu
riscv-qemu copied to clipboard
riscv linux-user should align stack to 16-byte boundary
+static abi_ulong get_sigframe(struct target_sigaction *ka,
CPURISCVState *regs, size_t framesize)
+{
- abi_ulong sp = regs->gpr[xSP];
- int onsigstack = on_sig_stack(sp);
- /* redzone */
- /* This is the X/Open sanctioned signal stack switching. */
- if ((ka->sa_flags & TARGET_SA_ONSTACK) != 0 && !onsigstack) {
sp = target_sigaltstack_used.ss_sp + target_sigaltstack_used.ss_size;
- }
- sp -= framesize;
- sp &= ~3UL; /* align sp on 4-byte boundary */
kernel aligns using 0xf.
Also:
1- check for signal stack overflow 2- check for X/Open sanctioned signal stack switching
http://lists.nongnu.org/archive/html/qemu-devel/2018-04/msg00338.html