From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56756) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcYRG-000125-Ie for qemu-devel@nongnu.org; Fri, 10 Oct 2014 07:32:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XcYRA-0007l8-E7 for qemu-devel@nongnu.org; Fri, 10 Oct 2014 07:32:50 -0400 Received: from mail-la0-f45.google.com ([209.85.215.45]:50229) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcYRA-0007l1-7E for qemu-devel@nongnu.org; Fri, 10 Oct 2014 07:32:44 -0400 Received: by mail-la0-f45.google.com with SMTP id q1so3037661lam.18 for ; Fri, 10 Oct 2014 04:32:41 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1412914976-15800-1-git-send-email-amanieu@gmail.com> References: <1412914976-15800-1-git-send-email-amanieu@gmail.com> From: Peter Maydell Date: Fri, 10 Oct 2014 12:32:21 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH] linux-user: Fix fault address truncation AArch64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amanieu d'Antras Cc: Riku Voipio , QEMU Developers On 10 October 2014 05:22, Amanieu d'Antras wrote: > 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. > > Signed-off-by: Amanieu d'Antras > --- > linux-user/main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/linux-user/main.c b/linux-user/main.c > index 483eb3f..d63e093 100644 > --- a/linux-user/main.c > +++ b/linux-user/main.c > @@ -1006,7 +1006,7 @@ void cpu_loop(CPUARMState *env) > CPUState *cs = CPU(arm_env_get_cpu(env)); > int trapnr, sig; > target_siginfo_t info; > - uint32_t addr; > + uint64_t addr; > > for (;;) { > cpu_exec_start(cs); Thanks for catching this. Better to fix it by dropping the unnecessary local variable completely and just setting info._sifields._sigfault._addr = env->exception.vaddress; at the only point where we currently use 'addr', though, I think. -- PMM