Subject: Re: [RFC PATCH 1/2] powerpc: Add a proper syscall for switching endianness

From: Michael Ellerman <[email-masked]>
Date: Tue, 10 Mar 2015 21:55:12 +1100

On Tue, 2015-03-10 at 20:34 +1100, Benjamin Herrenschmidt wrote:
> On Tue, 2015-03-10 at 18:36 +1100, Michael Ellerman wrote:
> > We currently have a "special" syscall for switching endianness. This is
> > syscall number 0x1ebe, which is handled explicitly in the 64-bit syscall
> > exception entry.
> > 
> > That has a few problems, firstly the syscall number is outside of the
> > usual range, which confuses various tools. For example strace doesn't
> > recognise the syscalls at all.
> > 
> > Secondly it's handled explicitly as a special case in the syscall
> > exception entry, which is complicated enough without it.
> > 
> > As a first step toward removing the special syscall, we need to add a
> > regular syscall that implements the same functionality.
> > 
> > The logic is simple, it simply toggles the MSR_LE bit in the userspace
> > MSR. This is the same as the special syscall, with the caveat that the
> > special syscall clobbers fewer registers.
> 
> You can set _TIF_RESTOREALL to force a restore of all the registers on
> the way back which should do the job.

Right, I'd forgotten we talked about that.

I'll try that tomorrow.

cheers