[{"id":1797837,"web_url":"http://patchwork.ozlabs.org/comment/1797837/","msgid":"<aa20fe35-6c76-3194-d633-cae8d2a6116f@linaro.org>","list_archive_url":null,"date":"2017-11-02T11:43:46","subject":"Re: [Qemu-devel] [PATCH v2] translate.c: Fix usermode big-endian\n\tAArch32 LDREXD and STREXD","submitter":{"id":72104,"url":"http://patchwork.ozlabs.org/api/people/72104/","name":"Richard Henderson","email":"richard.henderson@linaro.org"},"content":"On 11/02/2017 12:33 PM, Peter Maydell wrote:\n> For AArch32 LDREXD and STREXD, architecturally the 32-bit word at the\n> lowest address is always Rt and the one at addr+4 is Rt2, even if the\n> CPU is big-endian. Our implementation does these with a single\n> 64-bit store, so if we're big-endian then we need to put the two\n> 32-bit halves together in the opposite order to little-endian,\n> so that they end up in the right places. We were trying to do\n> this with the gen_aa32_frob64() function, but that is not correct\n> for the usermode emulator, because there there is a distinction\n> between \"load a 64 bit value\" (which does a BE 64-bit access\n> and doesn't need swapping) and \"load two 32 bit values as one\n> 64 bit access\" (where we still need to do the swapping, like\n> system mode BE32).\n> \n> Fixes: https://bugs.launchpad.net/qemu/+bug/1725267\n> Cc: qemu-stable@nongnu.org\n> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>\n> ---\n> Changes v1->v2:\n>  * use correct \"s->be_data == MO_BE\" check for bigendian\n>  * don't mangle the data from the atomic-cmpxchg before\n>    comparing against expected value\n>  * tcg_temp_free() the TCGv from gen_aa32_addr()\n>  * name that TCGv \"taddr\" rather than \"a\"...\n\nReviewed-by: Richard Henderson <richard.henderson@linaro.org>\n\n\nr~","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"LRY1i0nn\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3ySNXs0sQ6z9t2M\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  2 Nov 2017 22:44:29 +1100 (AEDT)","from localhost ([::1]:59759 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1eADv9-0001A9-92\n\tfor incoming@patchwork.ozlabs.org; Thu, 02 Nov 2017 07:44:27 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:48290)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <richard.henderson@linaro.org>) id 1eADud-00018c-4n\n\tfor qemu-devel@nongnu.org; Thu, 02 Nov 2017 07:43:56 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <richard.henderson@linaro.org>) id 1eADuZ-00049q-73\n\tfor qemu-devel@nongnu.org; Thu, 02 Nov 2017 07:43:55 -0400","from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:54486)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <richard.henderson@linaro.org>)\n\tid 1eADuZ-00048X-10\n\tfor qemu-devel@nongnu.org; Thu, 02 Nov 2017 07:43:51 -0400","by mail-wm0-x243.google.com with SMTP id r68so10732153wmr.3\n\tfor <qemu-devel@nongnu.org>; Thu, 02 Nov 2017 04:43:50 -0700 (PDT)","from cloudburst.twiddle.net (p5DCBCAA6.dip0.t-ipconnect.de.\n\t[93.203.202.166]) by smtp.gmail.com with ESMTPSA id\n\tj22sm3263653eda.96.2017.11.02.04.43.48\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tThu, 02 Nov 2017 04:43:48 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;\n\th=subject:to:cc:references:from:message-id:date:user-agent\n\t:mime-version:in-reply-to:content-language:content-transfer-encoding; \n\tbh=qPJ5ZNWR69F8MgLeEs4jbus2+i9UAPfc8fmYnoSFjyU=;\n\tb=LRY1i0nnnSuUE2F199ifC0tiMUb4WEwb77/6AA4M4eadqxUsKaf1oEGCH2dbxsT8+R\n\tS7rPmvIFeTjVlq978eckizI9l9pN81y5vvc/YtO5gJk1fpBWeeO7HVlCXXxWwnGfbhRc\n\t+cGqOoG84R7Wcrdxz0gIBCGHYQZE+CSzxMdHk=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:subject:to:cc:references:from:message-id:date\n\t:user-agent:mime-version:in-reply-to:content-language\n\t:content-transfer-encoding;\n\tbh=qPJ5ZNWR69F8MgLeEs4jbus2+i9UAPfc8fmYnoSFjyU=;\n\tb=uAZu7oVsmyENHQ8wwN9+9m/ZKyvgmVjZ3/WBJXWoOfb3Zj4wJgJb6Ou0dyxC575+cQ\n\t7SCPdUjzNRCD/kQxPDdh1Q6nKreUOHTm+GXTwhCprHPn84eF921lMQi/d+zB8l2sm1zH\n\tjLd0j2p5k3JBQTCKZPZQDyqwZF/LBOeTDpkSYXudxeizUvDG+VK6lfiC90YWTHhB+8dx\n\tqVGQilObIec1gbTwZdIhYuTCOOPBdQvEBjwQj5C7kjwomGvMqZGnwwANeWsQTclcDUm/\n\tDqlXCgqKEEy9yEEMGr/0Y4ALb/IhwPC7cbe54+kV32ZCBxWrl5m8yjzOq7KoN1tS4FHq\n\t+bDQ==","X-Gm-Message-State":"AMCzsaVDQci3XafGW/7lAPJJivpAG6qLs/wB3twFFVkbSCKRzTsAHn1X\n\t29LvshQFD4+nD2QaxdntDJL7cGHYUOg=","X-Google-Smtp-Source":"ABhQp+TJH0lw9oGFAMT87GTsP/SuxSBSLhoAEH7fYN0m96irgEvLuj89cVgIWHwji1r60umnK/ByfA==","X-Received":"by 10.80.174.193 with SMTP id f1mr4144050edd.207.1509623029601; \n\tThu, 02 Nov 2017 04:43:49 -0700 (PDT)","To":"Peter Maydell <peter.maydell@linaro.org>, qemu-arm@nongnu.org,\n\tqemu-devel@nongnu.org","References":"<1509622400-13351-1-git-send-email-peter.maydell@linaro.org>","From":"Richard Henderson <richard.henderson@linaro.org>","Message-ID":"<aa20fe35-6c76-3194-d633-cae8d2a6116f@linaro.org>","Date":"Thu, 2 Nov 2017 12:43:46 +0100","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.4.0","MIME-Version":"1.0","In-Reply-To":"<1509622400-13351-1-git-send-email-peter.maydell@linaro.org>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2a00:1450:400c:c09::243","Subject":"Re: [Qemu-devel] [PATCH v2] translate.c: Fix usermode big-endian\n\tAArch32 LDREXD and STREXD","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"christophe.lyon@linaro.org, patches@linaro.org","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]