From: riku.voipio@linaro.org
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Riku Voipio <riku.voipio@linaro.org>
Subject: [Qemu-devel] [PULL 2/3] linux-user: Fix fault address truncation AArch64
Date: Mon, 3 Nov 2014 14:02:40 +0200 [thread overview]
Message-ID: <686581adcfead947b4726d82b1eaf7c25fa597e6.1415015510.git.riku.voipio@linaro.org> (raw)
In-Reply-To: <cover.1415015510.git.riku.voipio@linaro.org>
From: Riku Voipio <riku.voipio@linaro.org>
On AArch64 the si_addr field of siginfo_t is truncated to 32 bits
because the fault address passes through an uint32_t variable.
Follow Peters suggestion and drop the uint32_t variable
since its only used once in the Aarch64 loop.
Reported-by: Amanieu d'Antras <amanieu@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
linux-user/main.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/linux-user/main.c b/linux-user/main.c
index 5887022..5c14c1e 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -1006,7 +1006,6 @@ void cpu_loop(CPUARMState *env)
CPUState *cs = CPU(arm_env_get_cpu(env));
int trapnr, sig;
target_siginfo_t info;
- uint32_t addr;
for (;;) {
cpu_exec_start(cs);
@@ -1042,12 +1041,11 @@ void cpu_loop(CPUARMState *env)
/* fall through for segv */
case EXCP_PREFETCH_ABORT:
case EXCP_DATA_ABORT:
- addr = env->exception.vaddress;
info.si_signo = SIGSEGV;
info.si_errno = 0;
/* XXX: check env->error_code */
info.si_code = TARGET_SEGV_MAPERR;
- info._sifields._sigfault._addr = addr;
+ info._sifields._sigfault._addr = env->exception.vaddress;
queue_signal(env, info.si_signo, &info);
break;
case EXCP_DEBUG:
--
2.1.1
next prev parent reply other threads:[~2014-11-03 12:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-03 12:02 [Qemu-devel] [PULL 0/3] linux-user changes for 2.2 riku.voipio
2014-11-03 12:02 ` [Qemu-devel] [PULL 1/3] linux-user: Let user specify random seed riku.voipio
2014-11-03 12:02 ` riku.voipio [this message]
2014-11-03 12:02 ` [Qemu-devel] [PULL 3/3] elf: take phdr offset into account when calculating the program load address riku.voipio
2014-11-03 22:50 ` [Qemu-devel] [PULL 0/3] linux-user changes for 2.2 Peter Maydell
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=686581adcfead947b4726d82b1eaf7c25fa597e6.1415015510.git.riku.voipio@linaro.org \
--to=riku.voipio@linaro.org \
--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).