From nobody Mon Feb 9 02:13:33 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513805653084708.8459863593994; Wed, 20 Dec 2017 13:34:13 -0800 (PST) Received: from localhost ([::1]:42429 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRm07-0008Di-0q for importer@patchew.org; Wed, 20 Dec 2017 16:34:07 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56170) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRlx2-0006Gz-J0 for qemu-devel@nongnu.org; Wed, 20 Dec 2017 16:30:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRlx1-0006k2-KB for qemu-devel@nongnu.org; Wed, 20 Dec 2017 16:30:56 -0500 Received: from heinz.dinsnail.net ([2a01:238:43b4:3200:9392:5dcc:2f0e:a960]:49796) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRlx1-0006eJ-Cl for qemu-devel@nongnu.org; Wed, 20 Dec 2017 16:30:55 -0500 Received: from heinz.dinsnail.net ([IPv6:::1]) by heinz.dinsnail.net (8.14.9/8.14.9) with ESMTP id vBKLUAO4029347; Wed, 20 Dec 2017 22:30:10 +0100 Received: from eldalonde.UUCP (uucp@localhost) by heinz.dinsnail.net (8.14.9/8.14.9/Submit) with bsmtp id vBKLUA5n029346; Wed, 20 Dec 2017 22:30:10 +0100 Received: from rivendell.weiser.dinsnail.net (rivendell.weiser.dinsnail.net [IPv6:fdbc:1bbf:5341::1:8]) by eldalonde.weiser.dinsnail.net (8.14.9/8.14.9) with ESMTP id vBKLNFZC018653; Wed, 20 Dec 2017 22:23:15 +0100 Received: (from michael@localhost) by rivendell.weiser.dinsnail.net (8.14.9/8.14.3/Submit) id vBKLNFYi012713; Wed, 20 Dec 2017 22:23:15 +0100 From: Michael Weiser To: qemu-devel@nongnu.org Date: Wed, 20 Dec 2017 22:23:02 +0100 Message-Id: <20171220212308.12614-2-michael.weiser@gmx.de> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171220212308.12614-1-michael.weiser@gmx.de> References: <20171220212308.12614-1-michael.weiser@gmx.de> X-dinsnail-net-MailScanner-Information: Please contact the ISP for more information X-dinsnail-net-MailScanner-ID: vBKLUAO4029347 X-dinsnail-net-MailScanner: Found to be clean X-dinsnail-net-MailScanner-From: michael@rivendell.weiser.dinsnail.net X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a01:238:43b4:3200:9392:5dcc:2f0e:a960 Subject: [Qemu-devel] [PATCH v3 1/7] linux-user: Add support for big-endian aarch64 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: Riku Voipio , Michael Weiser , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Enable big-endian mode for data accesses on aarch64 for big-endian linux user mode. Activate it for all exception levels as documented by ARM: Set the SCTLR EE bit for ELs 1 through 3. Additionally set bit E0E in EL1 to enable it in EL0 as well. Signed-off-by: Michael Weiser Reviewed-by: Richard Henderson --- linux-user/main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/linux-user/main.c b/linux-user/main.c index 71696ed33d..7a4dd0c9c3 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -4622,6 +4622,12 @@ int main(int argc, char **argv, char **envp) } env->pc =3D regs->pc; env->xregs[31] =3D regs->sp; +#ifdef TARGET_WORDS_BIGENDIAN + env->cp15.sctlr_el[1] |=3D SCTLR_E0E; + for (i =3D 1; i < 4; ++i) { + env->cp15.sctlr_el[i] |=3D SCTLR_EE; + } +#endif } #elif defined(TARGET_ARM) { --=20 2.15.1