summaryrefslogtreecommitdiffstats
path: root/linux-user/aarch64
diff options
context:
space:
mode:
authorRichard Henderson2020-10-21 19:37:38 +0200
committerPeter Maydell2020-10-27 11:44:02 +0100
commit0b6a03c044b6b0b09ad590c0d8b1bc60f12b9612 (patch)
tree6b1b1b97d24003ecea6139dd11e2aca54461c4a3 /linux-user/aarch64
parentMerge remote-tracking branch 'remotes/ericb/tags/pull-bitmaps-2020-10-26' int... (diff)
downloadqemu-0b6a03c044b6b0b09ad590c0d8b1bc60f12b9612.tar.gz
qemu-0b6a03c044b6b0b09ad590c0d8b1bc60f12b9612.tar.xz
qemu-0b6a03c044b6b0b09ad590c0d8b1bc60f12b9612.zip
linux-user/aarch64: Reset btype for signals
The kernel sets btype for the signal handler as if for a call. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20201021173749.111103-2-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'linux-user/aarch64')
-rw-r--r--linux-user/aarch64/signal.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/linux-user/aarch64/signal.c b/linux-user/aarch64/signal.c
index d50c1ae583..b591790c22 100644
--- a/linux-user/aarch64/signal.c
+++ b/linux-user/aarch64/signal.c
@@ -506,10 +506,16 @@ static void target_setup_frame(int usig, struct target_sigaction *ka,
+ offsetof(struct target_rt_frame_record, tramp);
}
env->xregs[0] = usig;
- env->xregs[31] = frame_addr;
env->xregs[29] = frame_addr + fr_ofs;
- env->pc = ka->_sa_handler;
env->xregs[30] = return_addr;
+ env->xregs[31] = frame_addr;
+ env->pc = ka->_sa_handler;
+
+ /* Invoke the signal handler as if by indirect call. */
+ if (cpu_isar_feature(aa64_bti, env_archcpu(env))) {
+ env->btype = 2;
+ }
+
if (info) {
tswap_siginfo(&frame->info, info);
env->xregs[1] = frame_addr + offsetof(struct target_rt_sigframe, info);