From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, alex.bennee@linaro.org, laurent@vivier.eu
Subject: [PATCH v9 1/5] linux-user/aarch64: Reset btype for signals
Date: Wed, 20 May 2020 10:27:56 -0700 [thread overview]
Message-ID: <20200520172800.8499-2-richard.henderson@linaro.org> (raw)
In-Reply-To: <20200520172800.8499-1-richard.henderson@linaro.org>
The kernel sets btype for the signal handler as if for a call.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
linux-user/aarch64/signal.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/linux-user/aarch64/signal.c b/linux-user/aarch64/signal.c
index cd521ee42d..2c596a7088 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);
--
2.20.1
next prev parent reply other threads:[~2020-05-20 17:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-20 17:27 [PATCH v9 0/5] linux-user: User support for AArch64 BTI Richard Henderson
2020-05-20 17:27 ` Richard Henderson [this message]
2020-07-06 11:02 ` [PATCH v9 1/5] linux-user/aarch64: Reset btype for signals Peter Maydell
2020-05-20 17:27 ` [PATCH v9 2/5] linux-user: Set PAGE_TARGET_1 for TARGET_PROT_BTI Richard Henderson
2020-07-06 11:09 ` Peter Maydell
2020-05-20 17:27 ` [PATCH v9 3/5] include/elf: Add defines related to GNU property notes for AArch64 Richard Henderson
2020-05-20 17:27 ` [PATCH v9 4/5] linux-user: Parse NT_GNU_PROPERTY_TYPE_0 notes Richard Henderson
2020-07-06 11:26 ` Peter Maydell
2020-05-20 17:28 ` [PATCH v9 5/5] tests/tcg/aarch64: Add bti smoke test Richard Henderson
2020-07-06 11:15 ` Peter Maydell
2020-06-27 18:39 ` [PATCH v9 0/5] linux-user: User support for AArch64 BTI 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=20200520172800.8499-2-richard.henderson@linaro.org \
--to=richard.henderson@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=laurent@vivier.eu \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).