From patchwork Mon Nov 3 12:02:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 40021 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f69.google.com (mail-ee0-f69.google.com [74.125.83.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D029921894 for ; Mon, 3 Nov 2014 12:28:18 +0000 (UTC) Received: by mail-ee0-f69.google.com with SMTP id c41sf2774897eek.4 for ; Mon, 03 Nov 2014 04:28:18 -0800 (PST) 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:in-reply-to:references: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=HJnxjzckkQh+JLxxrhsxbvMF+nryrxnDU//Jl10F61w=; b=E1Hq9dj5Zm5gqpf7foDIM0whfBzMY9TxlZTU0iAXliehQ7yCubO56GTcgvfO3nVVx0 QTRBLaUQZn7aWC1zIHUNq7MEFkgMAm40KHfvVAomJnHkgjdzNtxJqzIMS9LzJ8UY+hTM mMJki7md63mfaNBI4nUzQROi/J7KJUbL77lqP7oI28JSCF3ANgphYH4ZAGClw2fOvioX Lz8rxrugAWb5LJa4IgorCcYcyOZ1dSQ4EaTcI6UTAr2izgLKI8qC3tX5LFsXjPCkSWrd LXPhS+IWwws8vjEZt4cFj+RXrSnOTXLBLA24J2PElnhx94n3INQ5YyZXY++r5epAVf46 Y7Ag== X-Gm-Message-State: ALoCoQk+8zaXa+wp/nSXNpX0fHDOK7ysT1lmn+jnGFmeqzWlv+zXjE1DemWBCkYb0bn0X+cDtxJ/ X-Received: by 10.112.142.36 with SMTP id rt4mr7250799lbb.3.1415017698049; Mon, 03 Nov 2014 04:28:18 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.7.66 with SMTP id h2ls586670laa.58.gmail; Mon, 03 Nov 2014 04:28:17 -0800 (PST) X-Received: by 10.112.125.33 with SMTP id mn1mr12195912lbb.99.1415017697900; Mon, 03 Nov 2014 04:28:17 -0800 (PST) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id w2si18341608law.68.2014.11.03.04.28.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Nov 2014 04:28:17 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by mail-la0-f53.google.com with SMTP id mc6so9206961lab.40 for ; Mon, 03 Nov 2014 04:28:17 -0800 (PST) X-Received: by 10.112.218.101 with SMTP id pf5mr14277004lbc.46.1415017697733; Mon, 03 Nov 2014 04:28:17 -0800 (PST) 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 c5csp225771lbz; Mon, 3 Nov 2014 04:28:17 -0800 (PST) X-Received: by 10.224.1.200 with SMTP id 8mr61576211qag.54.1415017696463; Mon, 03 Nov 2014 04:28:16 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id r10si29354933qck.17.2014.11.03.04.28.15 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 03 Nov 2014 04:28:16 -0800 (PST) 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]:34098 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlGk3-0005zf-K3 for patch@linaro.org; Mon, 03 Nov 2014 07:28:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41019) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlGLQ-0007GO-OH for qemu-devel@nongnu.org; Mon, 03 Nov 2014 07:02:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XlGLL-00046c-TY for qemu-devel@nongnu.org; Mon, 03 Nov 2014 07:02:48 -0500 Received: from afflict.kos.to ([92.243.29.197]:59749) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlGLL-00046N-OC for qemu-devel@nongnu.org; Mon, 03 Nov 2014 07:02:43 -0500 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 7B206264ED; Mon, 3 Nov 2014 13:02:42 +0100 (CET) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Mon, 3 Nov 2014 14:02:40 +0200 Message-Id: <686581adcfead947b4726d82b1eaf7c25fa597e6.1415015510.git.riku.voipio@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 92.243.29.197 Cc: Peter Maydell , Riku Voipio Subject: [Qemu-devel] [PULL 2/3] 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.215.53 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. Follow Peters suggestion and drop the uint32_t variable since its only used once in the Aarch64 loop. Reported-by: Amanieu d'Antras Reviewed-by: Peter Maydell 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: