From patchwork Thu Oct 23 11:55:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 39359 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8C72024022 for ; Thu, 23 Oct 2014 11:56:16 +0000 (UTC) Received: by mail-la0-f70.google.com with SMTP id ge10sf498467lab.9 for ; Thu, 23 Oct 2014 04:56:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list; bh=pEm0ycnExgRr6Wux6wxWaPpn5hjI+L6VCJ04o9K5tfM=; b=dYKZMqqmD4YRBUzsK5cGzzVz3yihaRmRSgw/MRThXDIJMokpkYzO9p1aWozqmFh769 KLgwJjvDN4HWc4dnsBLRUr1j80kKCSGS9l3GafLGTyFQpkmcM9Njl4IRfdhIzECLlXL4 5Yzwl1vb9uQe3Es5kJHEMOgH/Rj3gjqZhs/AQycWOKTW+DGaqFfIZkVHUqLnDKxKAhxu E+sp4OQSzRnpnE101hYh9+WvaXnGA3Ow+QWOVlpkY/pPQtswxeD9s5jk0skjE4fQ/obv KAKR5w5/KBSuC+k0Xdi4Gm/o6NtXJYeqf9BXZVVIimezURny0K0NhC16OyZ5uBpuwAEl 3N+g== X-Gm-Message-State: ALoCoQk+6spo8z/w+dX0XpjNd1m1B3df/RBeFvt6DyfnkINR+6j1oJQgSPGUT1XLI7FnbiKt8gcm X-Received: by 10.112.163.229 with SMTP id yl5mr25581lbb.23.1414065375320; Thu, 23 Oct 2014 04:56:15 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.44.169 with SMTP id f9ls309900lam.11.gmail; Thu, 23 Oct 2014 04:56:15 -0700 (PDT) X-Received: by 10.152.198.204 with SMTP id je12mr4515481lac.61.1414065375044; Thu, 23 Oct 2014 04:56:15 -0700 (PDT) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id l8si2273430lam.40.2014.10.23.04.56.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 Oct 2014 04:56:14 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id w7so679691lbi.36 for ; Thu, 23 Oct 2014 04:56:14 -0700 (PDT) X-Received: by 10.112.189.10 with SMTP id ge10mr4460974lbc.23.1414065374705; Thu, 23 Oct 2014 04:56:14 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp240955lbz; Thu, 23 Oct 2014 04:56:13 -0700 (PDT) X-Received: by 10.224.97.10 with SMTP id j10mr6518459qan.103.1414065373369; Thu, 23 Oct 2014 04:56:13 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id i2si2538677qaz.37.2014.10.23.04.56.12 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 23 Oct 2014 04:56:13 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:38815 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XhH00-0002NZ-Lu for patch@linaro.org; Thu, 23 Oct 2014 07:56:12 -0400 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 Received: from afflict.kos.to (afflict [92.243.29.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by afflict.kos.to (Postfix) with ESMTPSA id ACF4A264C5; Thu, 23 Oct 2014 13:55:33 +0200 (CEST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Thu, 23 Oct 2014 14:55:29 +0300 Message-Id: <1414065329-7357-1-git-send-email-riku.voipio@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 92.243.29.197 Cc: Peter Maydell , Riku Voipio , Amanieu , Claudio Fontana Subject: [Qemu-devel] [PATCH] linux-user: Fix fault address truncation AArch64 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: riku.voipio@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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 Reviewed-by: Peter Maydell --- 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: