[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-discuss] s390x user-mode working example

From: Alex Kashchenko
Subject: Re: [Qemu-discuss] s390x user-mode working example
Date: Fri, 24 Nov 2017 11:19:49 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

On 11/24/2017 05:57 AM, Thomas Huth wrote:
On 23.11.2017 22:00, Alex Kashchenko wrote:

I am trying to build qemu-s390x-user static binary to run a hello-world
program cross-compiled with gcc-s390x-linux-gnu on linux_x86_64.

I am building qemu with:

./configure --static --disable-werror --target-list=s390x-linux-user

and running example with:

QEMU_STRACE=1 ./s390x-linux-user/qemu-s390x path/to/s390x-hello

I tried latest git and a number of v2.x releases without success. Can
see either hang (on first brk call) or various errors for newer versions
and "Illegal instruction" for older ones. Tried on ubuntu 16.04 and
17.10 without success.

The same steps worked for me for ppc64le hello-world.

Any help on this is highly appreciated.

How did you cross-compile your s390x binary? QEMU's CPU emulation only
fully supports the z900 so far (more support is being worked on), so you
should make sure that your program has been compiled for that CPU
architecture, i.e. add "-m64 -march=z900" to your CFLAGS. Does that help?

Thanks for suggestion! I was cross-compiling the example using s390x-linux-gnu-gcc without additional flags, but it seems that march=z900 is a default for this gcc build. I was able to run simple example successfully (with git master build) after deleting /etc/ld.so.cache .

My ultimate goal was to cross-compile OpenJDK for s390x and run it locally with QEMU-user to be able to smoke-test s390x OpenJDK builds for fedora (I am using ubuntu for experiments because of very convenient multiarch support in it).

Unfortunately, I just found that OpenJDK's JIT requires newer instruction set than z900:

$ ./s390x-linux-user/qemu-s390x ~/jdk9/build/linux-s390x-normal-server-release/images/jdk/bin/java -version
# A fatal error has been detected by the Java Runtime Environment:
#  Internal Error (vm_version_s390.hpp:367), pid=26037, tid=26039
# guarantee((_features[0] & GnrlInstrExtFacilityMask) == GnrlInstrExtFacilityMask) failed: We no more support older than z10.
# JRE version:  (9.0) (build )
# Java VM: OpenJDK 64-Bit Server VM (9-internal+0-adhoc.u1804.jdk9, mixed mode, tiered, compressed oops, g1 gc, linux-s390x)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]