Re: [Qemu-devel] [PATCH v3 04/11] linux-user: arm: set CPSR.E correctly for BE8 mode

2015-06-24 Thread Paolo Bonzini
On 24/06/2015 12:48, Peter Maydell wrote: > > > I didn't think SETEND existed at all in AArch64? > > > > No, but the kernel traps it and flips SCTLR.E0E. > > Traps what? There is no encoding in A64, unless I'm missing something... Ah, it's the A64 kernel executing A32 code. So no problem. Paol

Re: [Qemu-devel] [PATCH v3 04/11] linux-user: arm: set CPSR.E correctly for BE8 mode

2015-06-24 Thread Peter Maydell
On 24 June 2015 at 11:34, Paolo Bonzini wrote: > > > On 24/06/2015 12:21, Peter Maydell wrote: >> > 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 d

Re: [Qemu-devel] [PATCH v3 04/11] linux-user: arm: set CPSR.E correctly for BE8 mode

2015-06-24 Thread Paolo Bonzini
On 24/06/2015 12:21, Peter Maydell wrote: > > 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 i

Re: [Qemu-devel] [PATCH v3 04/11] linux-user: arm: set CPSR.E correctly for BE8 mode

2015-06-24 Thread Peter Maydell
On 24 June 2015 at 11:09, Paolo Bonzini wrote: > > > 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;

Re: [Qemu-devel] [PATCH v3 04/11] linux-user: arm: set CPSR.E correctly for BE8 mode

2015-06-24 Thread Paolo Bonzini
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

Re: [Qemu-devel] [PATCH v3 04/11] linux-user: arm: set CPSR.E correctly for BE8 mode

2015-06-23 Thread Peter Maydell
On 23 June 2015 at 21:30, Peter Crosthwaite wrote: > On Tue, Jun 23, 2015 at 11:54 AM, Peter Maydell > wrote: >> On 23 June 2015 at 19:43, 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 wit

Re: [Qemu-devel] [PATCH v3 04/11] linux-user: arm: set CPSR.E correctly for BE8 mode

2015-06-23 Thread Peter Crosthwaite
On Tue, Jun 23, 2015 at 11:54 AM, Peter Maydell wrote: > On 23 June 2015 at 19:43, Peter Crosthwaite > wrote: >> On Tue, Jun 23, 2015 at 1:04 AM, Peter Maydell >> wrote: >>> The Linux userland ABI says: >>> (1) the ELF file defines whether an executable is BE8 or not >>> (2) this setting affe

Re: [Qemu-devel] [PATCH v3 04/11] linux-user: arm: set CPSR.E correctly for BE8 mode

2015-06-23 Thread Peter Maydell
On 23 June 2015 at 19:43, Peter Crosthwaite wrote: > On Tue, Jun 23, 2015 at 1:04 AM, Peter Maydell > wrote: >> The Linux userland ABI says: >> (1) the ELF file defines whether an executable is BE8 or not >> (2) this setting affects: >> (a) whether we start at the process entry point in BE

Re: [Qemu-devel] [PATCH v3 04/11] linux-user: arm: set CPSR.E correctly for BE8 mode

2015-06-23 Thread Peter Crosthwaite
On Tue, Jun 23, 2015 at 1:04 AM, Peter Maydell wrote: > On 22 June 2015 at 23:48, Peter Crosthwaite > wrote: >> On Thu, Jun 26, 2014 at 7:18 AM, Paolo Bonzini wrote: >>> Il 26/06/2014 16:15, Peter Maydell ha scritto: (There is code for handling CPSR_E in the kernel's start_thread() >>>

Re: [Qemu-devel] [PATCH v3 04/11] linux-user: arm: set CPSR.E correctly for BE8 mode

2015-06-23 Thread Peter Maydell
On 22 June 2015 at 23:48, Peter Crosthwaite wrote: > On Thu, Jun 26, 2014 at 7:18 AM, Paolo Bonzini wrote: >> Il 26/06/2014 16:15, Peter Maydell ha scritto: >>> >>> (There is code for handling CPSR_E in the kernel's start_thread() >>> macro but that is actually only called for starting new >>> pr

Re: [Qemu-devel] [PATCH v3 04/11] linux-user: arm: set CPSR.E correctly for BE8 mode

2015-06-22 Thread Peter Crosthwaite
On Thu, Jun 26, 2014 at 7:18 AM, Paolo Bonzini wrote: > Il 26/06/2014 16:15, Peter Maydell ha scritto: >> >> (There is code for handling CPSR_E in the kernel's start_thread() >> macro but that is actually only called for starting new >> processes, AFAICT.) > > > Yes, you're right. > So I am strug

Re: [Qemu-devel] [PATCH v3 04/11] linux-user: arm: set CPSR.E correctly for BE8 mode

2014-06-26 Thread Paolo Bonzini
Il 26/06/2014 16:15, Peter Maydell ha scritto: (There is code for handling CPSR_E in the kernel's start_thread() macro but that is actually only called for starting new processes, AFAICT.) Yes, you're right. Paolo

Re: [Qemu-devel] [PATCH v3 04/11] linux-user: arm: set CPSR.E correctly for BE8 mode

2014-06-26 Thread Peter Maydell
On 21 June 2014 13:58, Paolo Bonzini wrote: > Set it on startup, in signal handler frames and in new threads. > > Signed-off-by: Paolo Bonzini > --- > linux-user/arm/target_cpu.h | 2 ++ > linux-user/main.c | 3 ++- > linux-user/signal.c | 2 ++ > target-arm/cpu.h|

[Qemu-devel] [PATCH v3 04/11] linux-user: arm: set CPSR.E correctly for BE8 mode

2014-06-21 Thread Paolo Bonzini
Set it on startup, in signal handler frames and in new threads. Signed-off-by: Paolo Bonzini --- linux-user/arm/target_cpu.h | 2 ++ linux-user/main.c | 3 ++- linux-user/signal.c | 2 ++ target-arm/cpu.h| 3 +++ 4 files changed, 9 insertions(+), 1 deletions(-) dif