From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50408) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7hcm-0000eu-Ia for qemu-devel@nongnu.org; Wed, 24 Jun 2015 06:09:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7hcf-0003dC-4J for qemu-devel@nongnu.org; Wed, 24 Jun 2015 06:09:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44480) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7hce-0003cI-Vw for qemu-devel@nongnu.org; Wed, 24 Jun 2015 06:09:37 -0400 Message-ID: <558A81DC.5090402@redhat.com> Date: Wed, 24 Jun 2015 12:09:32 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1403355502-12288-1-git-send-email-pbonzini@redhat.com> <1403355502-12288-5-git-send-email-pbonzini@redhat.com> <53AC2B9B.40801@redhat.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 04/11] linux-user: arm: set CPSR.E correctly for BE8 mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite , Peter Maydell Cc: QEMU Developers On 23/06/2015 22:30, Peter Crosthwaite wrote: > > I'm confused. arm_cpu_is_big_endian() tells you whether the CPU > > is *currently* big-endian or not. That doesn't help you with > > answering the question "I'm about to run a signal handler; what > > should I set the CPSR.E bit to?" in linux-user mode. That's > > what signal_cpsr_e does. > > arm_cpu_is_bigendian is the consumer of this information. We still > need some state for signal_cpsr_e, just the question is what state > does that set. If we reuse arm_cpu_is_big_endian, then signal_cpsr_e > (or its rename) needs to drive CPSR.E as well as SCTLR.E0E. I think signal_cpsr_e is exactly what you want for AArch32. It sets CPSR.E in main and setup_return for AArch32. For AArch64 you don't need anything because, even though the kernel does trap setend and tweak SCTLR.E0E in response to it, setup_return doesn't try to restore the native endianness. Paolo