From patchwork Thu Feb 14 19:05:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 158431 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1754163jaa; Thu, 14 Feb 2019 11:14:43 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib2VXXwSLU5tTvAcmuk8UZg3zS93EX1vX/k59j93Ss0/xcbX44LX31JFsKy/ybObMIWg4iz X-Received: by 2002:a25:3243:: with SMTP id y64mr4843971yby.106.1550171683446; Thu, 14 Feb 2019 11:14:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550171683; cv=none; d=google.com; s=arc-20160816; b=mQg3x0nF0frWDENvbNshtzoWB0w3CRSgOOIMHG7D2DlMfRfOaXbn0ZXOY/7fPVa1Qs cF2H+nQ5OnR6OVwPAVdTpvl+yh4eDKdvOn9p1sAHbt4e0s8FXrPnmab8fgC3VvhrJ1jp Jen3gLatTDlmlnwTkPp4Wsoquugf2B7eDFM2ZVpYS61IefjNbiuzFWk6KevLBCvd6a5Z TZ4cP8r71FYI2JRTOZd08LHQmAjoYzSIY/2ZwPL5W0vPqnzO5I61lVlF3RmvXgkZ6SHM IxdMjwMNnL8SSfLmRXbbD9uD/zEnF4DStGVk1E2FSEhNQzB8+5wsPItOlK6J0XGRm/+O sCbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=uswL4c0TTMXFNz1N3f9daDRaiHb4sJ9+vjiHGwN6Hj0=; b=nqgKrzyM7Ir7CZMGAbsQYcII6OfJ8lAi5fbjXuGLj6sTJUlChYr8jher/pH5r1TJS5 /0tu6LRP/dZ07BTMZgoGXdmLm3gsk1kXdkNkzhlymMnU8Kp/KZvqu/memKo3JeKIahf7 fIho+AGrub03bqD5+ZB6rEfA3LrhuJLpktG7DgE1NKZd6mzBdPagVTFP15UpDscwf2Ab FvYEDNGv17+eptZ3IkW1u/SjKrFsEXrEBMrr1b5na6xCbV/WNrfN4WcSifVY2ajgKTpw 680uPtWZ04HRv5vLPTv+O8SXYCm5lpDlpLfkn3OVM0VJclaxCVtPPcSD7jCVotY1oXPA wSPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=FIHFKlEA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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. [209.51.188.17]) by mx.google.com with ESMTPS id g12si2014490ybk.465.2019.02.14.11.14.43 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 14 Feb 2019 11:14:43 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=FIHFKlEA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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 ([127.0.0.1]:53604 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guMT4-00057e-Tm for patch@linaro.org; Thu, 14 Feb 2019 14:14:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guMKp-0007i2-Ey for qemu-devel@nongnu.org; Thu, 14 Feb 2019 14:06:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guMKo-0004dS-IU for qemu-devel@nongnu.org; Thu, 14 Feb 2019 14:06:11 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:40083) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1guMKo-0004cs-CO for qemu-devel@nongnu.org; Thu, 14 Feb 2019 14:06:10 -0500 Received: by mail-wr1-x433.google.com with SMTP id q1so7704181wrp.7 for ; Thu, 14 Feb 2019 11:06:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=uswL4c0TTMXFNz1N3f9daDRaiHb4sJ9+vjiHGwN6Hj0=; b=FIHFKlEAq/Xg5zCvveQcKvJLaecc9XPTatCZP/bBBRWbQPAkGDAvxa91fAECx4VM9+ qM3rCFOiTN/NreazFL2J6EZm7VE+fplK2UC6DIC9Sz71Z2gzwjbtMGWBN8EzukQzX4hu ka9xefpDWPSZmR09JsJfvRwzqcPJr0cFIU6/nO5SNvcpBD1OzhqgQlxYlh9cmCatPlLd oca9sHxkdwCM5qmb6nrPutyNHfXFZ7T4CFKhWOQx/jH1kVrI3Eb4QlABU96K4Jt1bciQ tDCAJkxmqwct0s+av8eQnaD9KGRjtRgVo01Tns5n8JrJkcaWcRInX/IIpslbHsGGnwrd /eMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uswL4c0TTMXFNz1N3f9daDRaiHb4sJ9+vjiHGwN6Hj0=; b=NeoCQGSOH+Sw4PpVXA72tvNlN67fFBk8DmdJgxLsAajlffRGlXR7aw6/t77RrzjmP1 rgFgThO8o4zbos2HI7Q62NLeFb09p0CBvDWJ2i8q107OO2nBfezbKa5siv8Ta4b4VrQz UA/+iobLziG0W5Ao0ZsZBwx2W91TNgB4ZIR+SgvdXUADwh7tcULbKOAqDYD68KtgoUex g7JWY8gcCOYBPWiRHZDLWJN46rLN+Mn8rlV6Qr5bx+9Elw8tB6lIzCF2LfggQSCGTEfv 16JJHm/ZnSM88J60va3LDwONnrcp1X+2ZVbH8UX4idzCaNzpQNEF5yy9uQeA59gh0jkR Ak0Q== X-Gm-Message-State: AHQUAubXfahwbBZy0BARGe21EXbASySSaNeQWjjJoFUGoJuvsRaVsGOz XQvB16QkP4xmcxJdItx3UA8Cg46XC2r/kw== X-Received: by 2002:a5d:4fc5:: with SMTP id h5mr3901676wrw.84.1550171169133; Thu, 14 Feb 2019 11:06:09 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id n184sm7798471wmf.5.2019.02.14.11.06.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Feb 2019 11:06:08 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 14 Feb 2019 19:05:39 +0000 Message-Id: <20190214190603.25030-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190214190603.25030-1-peter.maydell@linaro.org> References: <20190214190603.25030-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::433 Subject: [Qemu-devel] [PULL 03/27] target/arm: Fix int128_make128 lo, hi order in paired_cmpxchg64_be 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Catherine Ho The lo,hi order is different from the comments. And in commit 1ec182c33379 ("target/arm: Convert to HAVE_CMPXCHG128"), it changes the original code logic. So just restore the old code logic before this commit: do_paired_cmpxchg64_be(): cmpv = int128_make128(env->exclusive_high, env->exclusive_val); newv = int128_make128(new_hi, new_lo); This fixes a bug that would only be visible for big-endian AArch64 guest code. Fixes: 1ec182c33379 ("target/arm: Convert to HAVE_CMPXCHG128") Signed-off-by: Catherine Ho Reviewed-by: Richard Henderson Message-id: 1548985244-24523-1-git-send-email-catherine.hecx@gmail.com [PMM: added note that bug only affects BE guests] Signed-off-by: Peter Maydell --- target/arm/helper-a64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/target/arm/helper-a64.c b/target/arm/helper-a64.c index 101fa6d3eaa..70850e564d3 100644 --- a/target/arm/helper-a64.c +++ b/target/arm/helper-a64.c @@ -583,8 +583,8 @@ uint64_t HELPER(paired_cmpxchg64_be)(CPUARMState *env, uint64_t addr, * High and low need to be switched here because this is not actually a * 128bit store but two doublewords stored consecutively */ - Int128 cmpv = int128_make128(env->exclusive_val, env->exclusive_high); - Int128 newv = int128_make128(new_lo, new_hi); + Int128 cmpv = int128_make128(env->exclusive_high, env->exclusive_val); + Int128 newv = int128_make128(new_hi, new_lo); Int128 oldv; uintptr_t ra = GETPC(); uint64_t o0, o1;