From patchwork Thu Feb 20 11:17:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 25009 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f198.google.com (mail-ie0-f198.google.com [209.85.223.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B4D1A203BE for ; Thu, 20 Feb 2014 11:19:08 +0000 (UTC) Received: by mail-ie0-f198.google.com with SMTP id at1sf6736638iec.5 for ; Thu, 20 Feb 2014 03:19:07 -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=RTidJRyGtquovwgYPPtNtFszn3cEeOuzaDOy4JtLFSc=; b=fFHNMlIEn0hMzIbonA2UfLmL7SPscmW2ePAqw8MHZC6FjP/bQOLdmzKzWqayk3Qsm1 6ezmvCAq2FOxTl/EJAJhEk+206QwUYF6DWYoOoWbPna92yqAtZhGQCm2ZY0M/6wQiQkh BsCh9UMy3HkrqSWdw0Afb6EwgFE1iMAXwOVAhkhi58hybB/+DuOAMjfYnaT6WEdF8Jd6 FyBbw++8j8scaocThDzqfFVTq5Zp/dNM4h0iRkvtpxowyw+aULsojRoy9kMmNhgH56qy 5kbXI7Ly0BAXrQiYARG1gFKfXxFdAJJV10R5ytWfjmWaoeFkoi5de+/6ferrwTZ+WZKl CdeQ== X-Gm-Message-State: ALoCoQlFtkKnws7WQ2Ys4iL7jckAY4644Fec3bPMQjNOpCd439ekyoN/cqeHxEur6MeNGsbvvttW X-Received: by 10.182.129.129 with SMTP id nw1mr506727obb.34.1392895147836; Thu, 20 Feb 2014 03:19:07 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.33.200 with SMTP id j66ls452044qgj.80.gmail; Thu, 20 Feb 2014 03:19:07 -0800 (PST) X-Received: by 10.52.116.102 with SMTP id jv6mr563821vdb.94.1392895147733; Thu, 20 Feb 2014 03:19:07 -0800 (PST) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id l16si1333380vcl.51.2014.02.20.03.19.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Feb 2014 03:19:07 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.169; Received: by mail-ve0-f169.google.com with SMTP id oy12so1717388veb.0 for ; Thu, 20 Feb 2014 03:19:07 -0800 (PST) X-Received: by 10.52.23.68 with SMTP id k4mr599193vdf.24.1392895147657; Thu, 20 Feb 2014 03:19:07 -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.220.174.196 with SMTP id u4csp50110vcz; Thu, 20 Feb 2014 03:19:07 -0800 (PST) X-Received: by 10.236.27.49 with SMTP id d37mr2113691yha.128.1392895147155; Thu, 20 Feb 2014 03:19:07 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [208.118.235.17]) by mx.google.com with ESMTPS id m69si3889634yhb.85.2014.02.20.03.19.06 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 20 Feb 2014 03:19:07 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; Received: from localhost ([::1]:37533 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGRek-0003Pi-K0 for patch@linaro.org; Thu, 20 Feb 2014 06:19:06 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58564) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGRdk-0002NI-0w for qemu-devel@nongnu.org; Thu, 20 Feb 2014 06:18:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGRdi-0004mH-LU for qemu-devel@nongnu.org; Thu, 20 Feb 2014 06:18:03 -0500 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:46025) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGRdi-0004mA-Fk for qemu-devel@nongnu.org; Thu, 20 Feb 2014 06:18:02 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WGRdI-0003VW-Fl; Thu, 20 Feb 2014 11:17:36 +0000 From: Peter Maydell To: Anthony Liguori Date: Thu, 20 Feb 2014 11:17:34 +0000 Message-Id: <1392895054-13232-31-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1392895054-13232-1-git-send-email-peter.maydell@linaro.org> References: <1392895054-13232-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Cc: Blue Swirl , qemu-devel@nongnu.org, Aurelien Jarno Subject: [Qemu-devel] [PULL 30/30] linux-user: AArch64: Fix exclusive store of the zero register 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: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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: Janne Grunau Signed-off-by: Janne Grunau Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- linux-user/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index cabc9e1..9192977 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -953,7 +953,8 @@ static int do_strex_a64(CPUARMState *env) goto finish; } } - val = env->xregs[rt]; + /* handle the zero register */ + val = rt == 31 ? 0 : env->xregs[rt]; switch (size) { case 0: segv = put_user_u8(val, addr); @@ -972,7 +973,8 @@ static int do_strex_a64(CPUARMState *env) goto error; } if (is_pair) { - val = env->xregs[rt2]; + /* handle the zero register */ + val = rt2 == 31 ? 0 : env->xregs[rt2]; if (size == 2) { segv = put_user_u32(val, addr + 4); } else {