From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53777) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XhGzW-00022l-Jm for qemu-devel@nongnu.org; Thu, 23 Oct 2014 07:55:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XhGzQ-00018a-OR for qemu-devel@nongnu.org; Thu, 23 Oct 2014 07:55:41 -0400 Received: from afflict.kos.to ([92.243.29.197]:54868) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XhGzQ-00018A-21 for qemu-devel@nongnu.org; Thu, 23 Oct 2014 07:55:36 -0400 From: riku.voipio@linaro.org Date: Thu, 23 Oct 2014 14:55:29 +0300 Message-Id: <1414065329-7357-1-git-send-email-riku.voipio@linaro.org> Subject: [Qemu-devel] [PATCH] linux-user: Fix fault address truncation AArch64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Riku Voipio , Amanieu , Claudio Fontana From: Riku Voipio On AArch64 the si_addr field of siginfo_t is truncated to 32 bits because the fault address passes through an uint32_t variable. This is fixed by changing the variable to uint64_t. v2 by Riku - follow Peters suggestion and drop the addr variable since its only used once in the Aarch64 loop. Reported-by: Amanieu d'Antras Signed-off-by: Riku Voipio --- 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