From: Anshuman Khandual <khandual@linux.vnet.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@ozlabs.org, linuxram@us.ibm.com,
Jeremy Kerr <jk@ozlabs.org>
Subject: Re: [PATCH v3 2/2] selftests/powerpc: Add a test of the switch_endian() syscall
Date: Tue, 17 Mar 2015 11:35:43 +0530 [thread overview]
Message-ID: <5507C437.3020203@linux.vnet.ibm.com> (raw)
In-Reply-To: <1426547040.31646.2.camel@ellerman.id.au>
On 03/17/2015 04:34 AM, Michael Ellerman wrote:
> On Mon, 2015-03-16 at 16:30 +0530, Anshuman Khandual wrote:
>> 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 <mpe@ellerman.id.au>
>>
>> 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)
>
> Hmm, odd. Works for me:
>
> $ uname -a
> Linux bebuntu 4.0.0-rc3-00002-g9dd2601a490a #1 SMP Fri Mar 13 15:52:11 AEDT 2015 ppc64 ppc64 ppc64 GNU/Linux
> $ make
> cc -O2 -Wall -g -nostdlib -m64 -c -o check.o check.S
> objcopy -j .text --reverse-bytes=4 -O binary check.o check-reversed.o
> hexdump -v -e '/1 ".byte 0x%02X\n"' check-reversed.o > check-reversed.S
> cc -O2 -Wall -g -nostdlib -m64 switch_endian_test.S check-reversed.S -o switch_endian_test
> $ ./switch_endian_test
> Hello wrong-endian world
> Hello right-endian world
> success: switch_endian_test
>
>
> What are you seeing exactly?
I am running on a BE PKVM guest but compiling the test case on
a different BE machine which has newer version of the compiler.
cc (GCC) 4.8.3 20140624
cc -O2 -Wall -g -nostdlib -m64 -c -o check.o check.S
objcopy -j .text --reverse-bytes=4 -O binary check.o check-reversed.o
hexdump -v -e '/1 ".byte 0x%02X\n"' check-reversed.o > check-reversed.S
cc -O2 -Wall -g -nostdlib -m64 switch_endian_test.S check-reversed.S -o switch_endian_test
which looks very similar to the details you have provided above.
Running on guest or host should not make any difference.
BTW, we need to add one .gitignore file to this new test directory.
next prev parent reply other threads:[~2015-03-17 6:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-16 6:57 [PATCH v3 1/2] powerpc: Add a proper syscall for switching endianness Michael Ellerman
2015-03-16 6:57 ` [PATCH v3 2/2] selftests/powerpc: Add a test of the switch_endian() syscall Michael Ellerman
2015-03-16 11:00 ` Anshuman Khandual
2015-03-16 23:04 ` Michael Ellerman
2015-03-17 6:05 ` Anshuman Khandual [this message]
2015-03-18 5:04 ` Michael Ellerman
2015-03-25 5:28 ` Michael Ellerman
2015-03-25 11:32 ` Anshuman Khandual
2015-03-26 0:36 ` Michael Ellerman
2015-03-26 6:24 ` Anshuman Khandual
2015-03-28 2:34 ` Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5507C437.3020203@linux.vnet.ibm.com \
--to=khandual@linux.vnet.ibm.com \
--cc=jk@ozlabs.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=linuxram@us.ibm.com \
--cc=mpe@ellerman.id.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).