From nobody Mon Feb 9 11:30:07 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 1513698316413207.31345472047894; Tue, 19 Dec 2017 07:45:16 -0800 (PST) Received: from localhost ([::1]:50643 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRK4s-0008S2-3j for importer@patchew.org; Tue, 19 Dec 2017 10:45:10 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42626) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJsm-0005XH-Jw for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:33:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRJrW-0001c4-BW for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:32:40 -0500 Received: from heinz.dinsnail.net ([2a01:238:43b4:3200:9392:5dcc:2f0e:a960]:46414) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRJrR-0001Wu-K1 for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:31:18 -0500 Received: from heinz.dinsnail.net ([IPv6:::1]) by heinz.dinsnail.net (8.14.9/8.14.9) with ESMTP id vBJFU9pk009348; Tue, 19 Dec 2017 16:30:09 +0100 Received: from eldalonde.UUCP (uucp@localhost) by heinz.dinsnail.net (8.14.9/8.14.9/Submit) with bsmtp id vBJFU9T7009347; Tue, 19 Dec 2017 16:30:09 +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 vBJFHD7G009009; Tue, 19 Dec 2017 16:17:13 +0100 Received: (from michael@localhost) by rivendell.weiser.dinsnail.net (8.14.9/8.14.3/Submit) id vBJFHDDd005213; Tue, 19 Dec 2017 16:17:13 +0100 From: Michael Weiser To: qemu-devel@nongnu.org Date: Tue, 19 Dec 2017 16:16:33 +0100 Message-Id: <20171219151636.5162-2-michael.weiser@gmx.de> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171219151636.5162-1-michael.weiser@gmx.de> References: <20171219151636.5162-1-michael.weiser@gmx.de> X-dinsnail-net-MailScanner-Information: Please contact the ISP for more information X-dinsnail-net-MailScanner-ID: vBJFU9pk009348 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 X-Mailman-Approved-At: Tue, 19 Dec 2017 10:38:10 -0500 Subject: [Qemu-devel] [PATCH 1/4] 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 execution 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 --- linux-user/main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/linux-user/main.c b/linux-user/main.c index 2fd2a143ed..7ea863260d 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -4611,6 +4611,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