From: Helge Deller <deller@kernel.org>
To: qemu-devel@nongnu.org
Cc: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Yoshinori Sato <yoshinori.sato@nifty.com>,
Richard Henderson <richard.henderson@linaro.org>,
Helge Deller <deller@gmx.de>, Laurent Vivier <laurent@vivier.eu>
Subject: [PULL 2/8] linux-user/sh4: fix vdso CFA for rt_sigreturn frames
Date: Fri, 25 Sep 2026 11:38:38 +0200 [thread overview]
Message-ID: <20260925093844.5685-3-deller@kernel.org> (raw)
In-Reply-To: <20260925093844.5685-1-deller@kernel.org>
From: Matt Turner <mattst88@gmail.com>
The unwinder looks up a return address as IP - 1 (hence the nop before
sigreturn_region_start). For a frame returning to __kernel_rt_sigreturn
that is the last byte of __kernel_sigreturn, which still has the
sigreturn CFA, so the rt_sigreturn frame is unwound with the wrong
sigcontext offset. _Unwind_Backtrace() from an SA_SIGINFO handler stops
after three frames.
Add a nop after .cfi_def_cfa_offset, as linux-user/i386/vdso.S does.
Fixes: 975bd51a88 ("linux-user/sh4: add VDSO support for sh4 and sh4eb")
Cc: qemu-stable@nongnu.org
Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Helge Deller <deller@gmx.de>
Signed-off-by: Helge Deller <deller@gmx.de>
---
linux-user/sh4/vdso-be.so | Bin 2720 -> 2720 bytes
linux-user/sh4/vdso-le.so | Bin 2720 -> 2720 bytes
linux-user/sh4/vdso.S | 3 ++-
3 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/linux-user/sh4/vdso-be.so b/linux-user/sh4/vdso-be.so
index bc1fb37e1089b7aa5612da0039e24193b156b3d8..df9fa22efab46bffbb9957af078199639998ea43 100755
GIT binary patch
delta 94
zcmZ1=x<GWo6OqVuQt#KSJ9B!^(@jmb3bB#wuObyE{&>##V)FyW-As%sljpE_2{CX^
vW<4yRzzu^8YbPf%icjWeeZcr*@(0#@#ut+l*u2^Nd@N1<oHuV|d(R92IA0@3
delta 94
zcmZ1=x<GWo6Op!OLQF3#0+d8#l(nNCM8CN5&G7ofAI}+|ZGOPGn~70r@*EZ~p~<X=
u1r)epkYOzY=j232@yYzG4;a5q{=k~g_-t|ln>SlhXr*UW(&mk9@0kI)8X|`P
diff --git a/linux-user/sh4/vdso-le.so b/linux-user/sh4/vdso-le.so
index c1ff560cc165413d7b07aa873225bd92afb8569e..decd674202260f045b646b318ebb0b6daf416651 100755
GIT binary patch
delta 93
zcmZ1=x<GWo6Olh5saKn)T)*7)W8rK!`{(^j`F=Z0{PBeG#pb(=yO|hOCeLK?735@K
uoh)#eTLA{wPEKSLoy^1ffbqxVx2*Y$FDA#b`LUHn_<IEVZ{EoEo*4j_?<GY5
delta 93
zcmZ1=x<GWo6Op|ikGEYj60C8&_)xA>#wX*~i%pXz{&>RpZ1Y{l-As&1lV`H{3bIZX
uILxg8gKHT$CnqwBPUc~K!1!(QTh@HWXOm;u{Md{<Esc#+H*aKn&kO)kh$G_w
diff --git a/linux-user/sh4/vdso.S b/linux-user/sh4/vdso.S
index 1faa665774..290eb498ae 100644
--- a/linux-user/sh4/vdso.S
+++ b/linux-user/sh4/vdso.S
@@ -141,8 +141,9 @@ __kernel_sigreturn:
sigreturn_tramp __NR_sigreturn
endf __kernel_sigreturn
- /* Update CFA base for the rt_sigreturn frame layout. */
+ /* rt_sigreturn frame layout; nop for the same reason as above. */
.cfi_def_cfa_offset RT_SIGFRAME_SC_OFFSET
+ nop
__kernel_rt_sigreturn:
sigreturn_tramp __NR_rt_sigreturn
--
2.54.0
next prev parent reply other threads:[~2026-09-25 9:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-25 9:38 [PULL 0/8] Linux user next patches Helge Deller
2026-09-25 9:38 ` [PULL 1/8] linux-user/sh4: use the kernel's sigreturn trampoline sequence in the vdso Helge Deller
2026-09-25 9:38 ` Helge Deller [this message]
2026-09-25 9:38 ` [PULL 3/8] linux-user/sh4: align the vdso sigreturn trampolines Helge Deller
2026-09-25 9:38 ` [PULL 4/8] linux-user: report EBADF for setsockopt()/getsockopt() on a bad fd Helge Deller
2026-09-25 9:38 ` [PULL 5/8] linux-user: report EINVAL for a misaligned mincore() start Helge Deller
2026-09-25 9:38 ` [PULL 6/8] accel/tcg: Set CF_NOIRQ during cpu_exec_step_atomic Helge Deller
2026-09-25 9:38 ` [PULL 7/8] target/sh4: Replace TB_FLAG_GUSA_EXCLUSIVE with CF_STEP_ATOMIC Helge Deller
2026-09-25 9:38 ` [PULL 8/8] target/sh4: Drop use_exit_tb Helge Deller
2026-09-25 18:52 ` [PULL 0/8] Linux user next patches Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260925093844.5685-3-deller@kernel.org \
--to=deller@kernel.org \
--cc=deller@gmx.de \
--cc=laurent@vivier.eu \
--cc=pbonzini@redhat.com \
--cc=pierrick.bouvier@oss.qualcomm.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=yoshinori.sato@nifty.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.