From patchwork Tue Nov 14 12:53:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 118874 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3007793qgn; Tue, 14 Nov 2017 04:55:41 -0800 (PST) X-Google-Smtp-Source: AGs4zMZ9e0TChBsJ/mn4vByPO0SzcGqXn1toZjiUx01HlgZY8a5lS4/5GbzqWaH+dTnFPL2HDp+O X-Received: by 10.129.173.94 with SMTP id l30mr453006ywk.5.1510664141940; Tue, 14 Nov 2017 04:55:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510664141; cv=none; d=google.com; s=arc-20160816; b=V6hIjilHcdzUXUG96tNCnSmUAsQw7ZKUZMAcNthfocZH3au8FG2GcNq+wVsVZWjp4b 1ypYgm2zY+ofbCE3CAVjDK/jlvxCDtszGOTqDHqOzxTfkk5S8tmXlZ+OpeSQt8IXnSk/ eEN93BYSrZGeydSinNg4StQI8trc5wc2FJrLuTeNXwLx0obUT40Ef/lJg75inAeSErc/ 58VdNv/AF0qIbv8KdSuvD+Ui8aVXStg+DooW3WCiaDz0I0BirR7A2rboI+N9HgmC2i7+ 5b/GmohxuZ6fI8XfacTk0pfsqCUxaLP+X+Md2HAaJMP4NWmHBucDVgubV1ox1RFgRxSA CZjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=wKRxKghRYX66bnj0i5LS3QaZCXhWXU21G1WwQjVQFMA=; b=ho+KmS95gI2TPWeAd0FLivSG/s4Lqt/HH1YzaUW+XB73rleGtzfSkjjWK0Cud3uifK sjw+HDbxfI8A33+3IneP5DeQOepbinrTCCVDbQ010jDQEL0FS0kDrsu46VxSRUcvz6Pb 32ihh9QeOrw+R2QSX86crumTn1ZJ+eu8/651/5tPcIGmNdc8vV6ky5jw3ghC4K+qZsz1 5ysuynP/Ct4OQItIUJ+l3EAHet+QEKTdIxlyhgqnPtWY3G1f7Soahmkp/346UoESt/nQ CC3YSm5q0o9ZW0Qur9PuhkaMq9Enzb0WpNdkjfY7boYzNdxmWTeKPtduLzNLPmHnebRb OqFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=GU6n6op4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 22si1811469ywb.327.2017.11.14.04.55.41 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 14 Nov 2017 04:55:41 -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; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=GU6n6op4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59303 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eEake-0001Md-PJ for patch@linaro.org; Tue, 14 Nov 2017 07:55:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42187) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eEakE-0001H6-FK for qemu-devel@nongnu.org; Tue, 14 Nov 2017 07:55:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eEak9-0006C4-Gg for qemu-devel@nongnu.org; Tue, 14 Nov 2017 07:55:14 -0500 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:35045) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eEak9-0006Ab-63 for qemu-devel@nongnu.org; Tue, 14 Nov 2017 07:55:09 -0500 Received: by mail-wm0-x243.google.com with SMTP id y80so21058254wmd.0 for ; Tue, 14 Nov 2017 04:55:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=wKRxKghRYX66bnj0i5LS3QaZCXhWXU21G1WwQjVQFMA=; b=GU6n6op4ZMig107uIZ/vv4Kulx97X/mMhe6lDL7DnaPy5J5U79PPKfYatFdLzah0zR bE6OkPMByCGAmIxFVOhNfIV9lY/xduq1vwrmtVDl/Eh3hNmoAFDPhJLCS7qxg1LMTiKZ UUWfISPhPiR89gdqOX6yeFNC1UrJeOA8XQUFQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wKRxKghRYX66bnj0i5LS3QaZCXhWXU21G1WwQjVQFMA=; b=lIU1pKNqIkUYF/hs08Oo7edDQfz4Bw6VnXlQHMtJrdVgJ0Pyetz26BqULygoS6oTVu sSeFHrUEL0jVXj88hBRoq/h+YZoC6M004KuItVmKGzu61LSVYJskJgF6mzkPqyPOvzwt GNIPR+9+4xaP1BAG2gDSWMsx7GabXOTAV5b4Y0e41CN/UTI6p6jRqtvTvZyG+Z1PWEQ8 lwIzauzcvPvJVDJCEuo6vR2ewjosSjnDhCpghbKUwtMl8t4GzpCRLggHHKcFP/8Dx4Yu JLjzAvcExjnZc2vbG56DiruUY4ImS8qPt9OYqXLlDC4/p1Wpo6EvF/XWWuKitvcTQeyz EIYg== X-Gm-Message-State: AJaThX41DqkKcUbpuj7hd3Me8JgJAMARFZFe7ODq3CMLHz2IvAumGiH4 fWLoHvA4a0Dkz3dqs2kouzJMLIa6ueU= X-Received: by 10.28.194.139 with SMTP id s133mr6167828wmf.14.1510664107535; Tue, 14 Nov 2017 04:55:07 -0800 (PST) Received: from cloudburst.twiddle.net (176.red-213-99-135.dynamicip.rima-tde.net. [213.99.135.176]) by smtp.gmail.com with ESMTPSA id f10sm16898208wrg.20.2017.11.14.04.55.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 Nov 2017 04:55:06 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 14 Nov 2017 13:53:04 +0100 Message-Id: <20171114125304.854-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171114094203.28030-1-richard.henderson@linaro.org> References: <20171114094203.28030-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::243 Subject: [Qemu-devel] [PATCH 2/1] target/arm: Use helper_retaddr in stxp helpers X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We use raw memory primitives along the !parallel_cpus paths in order to simplify the endianness handling. Because of that, we did not benefit from the generic changes to cpu_ldst_user_only_template.h. The simplest fix is to manipulate helper_retaddr here. Signed-off-by: Richard Henderson --- target/arm/helper-a64.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.12.0 Reviewed-by: Alex Bennée diff --git a/target/arm/helper-a64.c b/target/arm/helper-a64.c index d0e435ca4b..96a3ecf707 100644 --- a/target/arm/helper-a64.c +++ b/target/arm/helper-a64.c @@ -456,6 +456,8 @@ static uint64_t do_paired_cmpxchg64_le(CPUARMState *env, uint64_t addr, #ifdef CONFIG_USER_ONLY /* ??? Enforce alignment. */ uint64_t *haddr = g2h(addr); + + helper_retaddr = ra; o0 = ldq_le_p(haddr + 0); o1 = ldq_le_p(haddr + 1); oldv = int128_make128(o0, o1); @@ -465,6 +467,7 @@ static uint64_t do_paired_cmpxchg64_le(CPUARMState *env, uint64_t addr, stq_le_p(haddr + 0, int128_getlo(newv)); stq_le_p(haddr + 1, int128_gethi(newv)); } + helper_retaddr = 0; #else int mem_idx = cpu_mmu_index(env, false); TCGMemOpIdx oi0 = make_memop_idx(MO_LEQ | MO_ALIGN_16, mem_idx); @@ -523,6 +526,8 @@ static uint64_t do_paired_cmpxchg64_be(CPUARMState *env, uint64_t addr, #ifdef CONFIG_USER_ONLY /* ??? Enforce alignment. */ uint64_t *haddr = g2h(addr); + + helper_retaddr = ra; o1 = ldq_be_p(haddr + 0); o0 = ldq_be_p(haddr + 1); oldv = int128_make128(o0, o1); @@ -532,6 +537,7 @@ static uint64_t do_paired_cmpxchg64_be(CPUARMState *env, uint64_t addr, stq_be_p(haddr + 0, int128_gethi(newv)); stq_be_p(haddr + 1, int128_getlo(newv)); } + helper_retaddr = 0; #else int mem_idx = cpu_mmu_index(env, false); TCGMemOpIdx oi0 = make_memop_idx(MO_BEQ | MO_ALIGN_16, mem_idx);