summaryrefslogtreecommitdiffstats
path: root/linux-user
diff options
context:
space:
mode:
authorRiku Voipio <riku.voipio@linaro.org>2014-10-23 11:27:40 +0300
committerRiku Voipio <riku.voipio@linaro.org>2014-11-03 11:03:34 +0200
commit686581adcfead947b4726d82b1eaf7c25fa597e6 (patch)
tree6a2d83093c66b81a33b7f2c8b2d00136c48dc089 /linux-user
parentc5e4a5a95e6de549fdf131c77c0f8d25b6ee7f30 (diff)
downloadhqemu-686581adcfead947b4726d82b1eaf7c25fa597e6.zip
hqemu-686581adcfead947b4726d82b1eaf7c25fa597e6.tar.gz
linux-user: Fix fault address truncation AArch64
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>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/main.c4
1 files changed, 1 insertions, 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:
OpenPOWER on IntegriCloud