Subject: Re: [PATCH v3 2/2] selftests/powerpc: Add a test of the switch_endian() syscall

From: Anshuman Khandual <[email-masked]>
Date: Mon, 16 Mar 2015 16:30:44 +0530

On 03/16/2015 12:27 PM, Michael Ellerman wrote:
> This adds a test of the switch_endian() syscall we added in the previous
> commit.
> 
> We test it by calling the endian switch syscall, and then executing some
> code in the other endian to check everything went as expected. That code
> checks registers we expect to be maintained are, and then writes to
> stdout. If the endian switch failed to happen that code sequence will be
> illegal and cause the test to abort.
> 
> We then switch back to the original endian, do the same checks and
> finally write a success message and exit(0).
> 
> Signed-off-by: Michael Ellerman <[email-masked]>

Hey Michael,

Did a quick test, passes on LE but seems like failing on BE.

On LE:

Hello wrong-endian world
Hello right-endian world
success: switch_endian_test

on BE:

Hello wrong-endian world (returns 176)

The previous version of the test was passing both on LE
and BE (after applying the compiler trick in the assembly)