Skip to contentSkip to conversation

KVM compile fails on s390x

DISCUSSION Robin Atwood 3 participants 7 messages Jul 31, 2008 – Aug 4, 2008 KVM

lore
Share & tools
lore
#0 lore raw

I guess I am doing something very dumb, but when I try to compile kvm-72 on z900 architecture (actually Hercules) I immediately get a compile error:

zgentoo kvm-72 # ./configure --disable-gfx-check --disable-sdl

Install prefix    /usr/local
BIOS directory    /usr/local/share/qemu
binary directory  /usr/local/bin
Manual directory  /usr/local/share/man
ELF interp prefix /usr/gnemul/qemu-%M
Source path       /usr/tmp/kvm-72/qemu
C compiler        gcc
Host C compiler   gcc
ARCH_CFLAGS       -march=z900
make              make
install           install
host CPU          s390
host big endian   yes
target list       i386-softmmu x86_64-softmmu arm-softmmu cris-softmmu 

m68k-softmmu mips-softmmu mipsel-softmmu mips64-softmmu mips64el-softmmu ppc-softmmu ppcemb-softmmu ppc64-softmmu sh4-softmmu sh4eb-softmmu sparc-softmmu i386-linux-user x86_64-linux-user alpha-linux-user arm-linux-user armeb-linux-user cris-linux-user m68k-linux-user mips-linux-user mipsel-linux-user ppc-linux-user ppc64-linux-user ppc64abi32-linux-user sh4-linux-user sh4eb-linux-user sparc-linux-user sparc64-linux-user sparc32plus-linux-user

gprof enabled     no
profiler          no
static build      no
-Werror enabled   no
SDL support       no
curses support    yes
mingw32 support   no
Audio drivers     oss
Extra audio cards
Mixer emulation   no
VNC TLS support   no
kqemu support     no
kvm support       no
CPU emulation     yes
brlapi support    no
Documentation     yes
NPTL support      yes
vde support       no

zgentoo kvm-72 # make
make -C libkvm
make[1]: Entering directory `/var/tmp/kvm-72/libkvm'
gcc -MMD -MF ./.libkvm.d -g -fomit-frame-pointer -Wall -fno-stack-protector -I /var/tmp/kvm-72/kernel/include -c -o
libkvm.o libkvm.c
libkvm.c: In function 'kvm_run':
libkvm.c:1003: warning: label 'more' defined but not used
gcc -MMD -MF ./.libkvm-s390.d -g -fomit-frame-pointer -Wall -fno-stack-protector -I /var/tmp/kvm-72/kernel/include -c -o
libkvm-s390.o libkvm-s390.c
libkvm-s390.c: In function 'kvm_show_regs':
libkvm-s390.c:63: error: 'struct kvm_regs' has no member named 'gprs' libkvm-s390.c:64: error: 'struct kvm_regs' has no member named 'gprs' libkvm-s390.c:65: error: 'struct kvm_regs' has no member named 'gprs' .... <snip> ....

Obviously some s390-specific equates are missing but I can't find any options to enable them and the arch seems correctly detected. The kernel is 2.6.26.

TIA
-Robin

Signature · 7 lines
----------------------------------------------------------------------
Robin Atwood.

"Ship me somewheres east of Suez, where the best is like the worst,
 Where there ain't no Ten Commandments an' a man can raise a thirst"
         from "Mandalay" by Rudyard Kipling
----------------------------------------------------------------------
#1 lore raw

Am Donnerstag, 31. Juli 2008 schrieb Robin Atwood:

Quoted 4 lines

I guess I am doing something very dumb, but when I try to compile kvm-72 on z900 architecture (actually Hercules) I immediately get a compile error:

zgentoo kvm-72 # ./configure --disable-gfx-check --disable-sdl

Your userspace headers dont have all the necessary pieces...
You want to add --with-patched-kernel, that should trigger an headers_sync to get the header files from the kernel.

Anyway, that wont give you anything useful by now, as we only have kvmlib done in the userspace. Until we ported the rest of our userspace part over to kvm-userspace, you can use our prototype code found on

http://www-128.ibm.com/developerworks/linux/linux390/kuli.html

It supports a subset of the qemu syntax, e.g. somethin like
kuli -drive file=disks/root -megs 128 -n tap,ifname=tap0 -smp=2 works.
You might need "tunctl" and "screen" for better results. If you want to stay at 2.6.26 there are some kernel patches in the kuli package. They add virtio console support as well as a fix for the z900. 2.6.27-rc1 should work out of the box.

Christian

#2 lore raw
Quoted 14 lines · Christian Borntraeger

Am Donnerstag, 31. Juli 2008 schrieb Robin Atwood:

Quoted 4 lines

I guess I am doing something very dumb, but when I try to compile kvm-72 on z900 architecture (actually Hercules) I immediately get a compile error:

zgentoo kvm-72 # ./configure --disable-gfx-check --disable-sdl

Your userspace headers dont have all the necessary pieces...
You want to add --with-patched-kernel, that should trigger an headers_sync to get the header files from the kernel.

Anyway, that wont give you anything useful by now, as we only have kvmlib done in the userspace. Until we ported the rest of our userspace part over to kvm-userspace, you can use our prototype code found on

Quoted 5 lines

http://www-128.ibm.com/developerworks/linux/linux390/kuli.html

It supports a subset of the qemu syntax, e.g. somethin like kuli -drive file=disks/root -megs 128 -n tap,ifname=tap0 -smp=2 works.

What are your intentions for this part longer term. Are you planning to create a QEMU target for s390 so we can use real QEMU binaries instead of emulating a subset of its features. If s390 userspace were QEMU based them you'd be able to use libvirt as a management API in same way as the other architectures.

Experiance with the 'xenner' work has shown that trying to write a tool that behaves like qemu is a non-trivial, never ending task. As soon as libvirt makes use of some new feature of QEMU's CLI or monitor console, we find Xenner doesn't cope and have to duplicate yet more code. Hence xenner is slowly switching over to use QEMU fully, rather than emulating its CLI syntax

Regards,
Daniel

Signature · 4 lines
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
#3 lore raw

Am Freitag, 1. August 2008 schrieb Daniel P. Berrange:

Quoted 5 lines

What are your intentions for this part longer term. Are you planning to create a QEMU target for s390 so we can use real QEMU binaries instead of emulating a subset of its features. If s390 userspace were QEMU based them you'd be able to use libvirt as a management API in same way as the other architectures.

Yes, the goal is to move towards qemu. kuli is not intended as a long term solution. Consider it a proof of concept/testing code to show that the kernel part is working.

You can also look at our KVM Forum presentation:
http://kvm.qumranet.com/kvmwiki/KvmForum2008?action=AttachFile&do=get&target=kdf2008_17.pdf
The slide "Next step" contains the merge into common kvm userspace.

I dont think we will see a full s390 backend just to make kvm work. We are considering Anthonys proposal for an kvm backend in qemu instead.

Christian

#4 lore raw
Quoted 6 lines · Christian Borntraeger

Am Freitag, 1. August 2008 schrieb Daniel P. Berrange:

Quoted 5 lines

What are your intentions for this part longer term. Are you planning to create a QEMU target for s390 so we can use real QEMU binaries instead of emulating a subset of its features. If s390 userspace were QEMU based them you'd be able to use libvirt as a management API in same way as the other architectures.

Christian, Daniel,
Thanks for the response. I was simply intrigued by the possibility of using KVM to virtualise zLinux and avoid having to use z/VM.

Quoted 8 lines

Yes, the goal is to move towards qemu. kuli is not intended as a long term solution. Consider it a proof of concept/testing code to show that the kernel part is working.

You can also look at our KVM Forum presentation:
http://kvm.qumranet.com/kvmwiki/KvmForum2008?action=AttachFile&do=get&targe
t=kdf2008_17.pdf The slide "Next step" contains the merge into common kvm userspace.

That would have been my next question: now the kernel modules is build, how do I IPL a guest machine?!

Quoted 2 lines

I dont think we will see a full s390 backend just to make kvm work. We are considering Anthonys proposal for an kvm backend in qemu instead.

I have used Qemu for some years and It has always seemed to me since the inception of KVM that the code bases should be merged to avoid duplication of effort and to make things easier for the users.

I will follow up your links, thanks very much for the pointers.

Cheers...
-Robin

Signature · 7 lines
----------------------------------------------------------------------
Robin Atwood.

"Ship me somewheres east of Suez, where the best is like the worst,
 Where there ain't no Ten Commandments an' a man can raise a thirst"
         from "Mandalay" by Rudyard Kipling
----------------------------------------------------------------------
#5 lore raw
In reply to Christian Borntraeger
Quoted 10 lines · Christian Borntraeger

Am Donnerstag, 31. Juli 2008 schrieb Robin Atwood:

Quoted 5 lines

I guess I am doing something very dumb, but when I try to compile kvm-72 on z900 architecture (actually Hercules) I immediately get a compile error:

zgentoo kvm-72 # ./configure --disable-gfx-check --disable-sdl

Your userspace headers dont have all the necessary pieces... You want to add --with-patched-kernel, that should trigger an headers_sync to get the header files from the kernel.

The correct headers are now found but later into the compile I get:

In file included
from /var/tmp/portage/app-emulation/kvm-72/work/kvm-72/qemu/exec.c:41:
/var/tmp/portage/app-emulation/kvm-72/work/kvm-72/qemu/tcg/tcg.h:24:24: error:
tcg-target.h: No such file or directory /var/tmp/portage/app-emulation/kvm-72/work/kvm-72/qemu/tcg/tcg.h:37:2: error:
#error unsupported
<snip>
make[2]: *** [exec.o] Error 1
make[2]: Leaving directory `/var/tmp/portage/app-emulation/kvm-72/work/kvm-72/qemu/i386-softmmu' make[1]: *** [subdir-i386-softmmu] Error 2
make[1]: Leaving directory `/var/tmp/portage/app-emulation/kvm-72/work/kvm-72/qemu'
make: *** [qemu] Error 2

There is no tcg-target.h for the s390 arch but why is i386-softmmu being compiled?

TIA
-Robin

Signature · 7 lines
----------------------------------------------------------------------
Robin Atwood.

"Ship me somewheres east of Suez, where the best is like the worst,
 Where there ain't no Ten Commandments an' a man can raise a thirst"
         from "Mandalay" by Rudyard Kipling
----------------------------------------------------------------------
#6 lore raw

Am Samstag, 2. August 2008 schrieb Robin Atwood:

Quoted 12 lines · Christian Borntraeger
Quoted 10 lines

Am Donnerstag, 31. Juli 2008 schrieb Robin Atwood:

Quoted 5 lines

I guess I am doing something very dumb, but when I try to compile kvm-72 on z900 architecture (actually Hercules) I immediately get a compile error:

zgentoo kvm-72 # ./configure --disable-gfx-check --disable-sdl

Your userspace headers dont have all the necessary pieces... You want to add --with-patched-kernel, that should trigger an headers_sync to get the header files from the kernel.

Quoted 5 lines

The correct headers are now found but later into the compile I get:

In file included
from /var/tmp/portage/app-emulation/kvm-72/work/kvm-72/qemu/exec.c:41:
/var/tmp/portage/app-emulation/kvm-72/work/kvm-72/qemu/tcg/tcg.h:24:24:

error:

Quoted 2 lines

tcg-target.h: No such file or directory /var/tmp/portage/app-emulation/kvm-72/work/kvm-72/qemu/tcg/tcg.h:37:2:

error:

Quoted 10 lines

#error unsupported
<snip>
make[2]: *** [exec.o] Error 1
make[2]: Leaving directory `/var/tmp/portage/app-emulation/kvm-72/work/kvm-72/qemu/i386-softmmu' make[1]: *** [subdir-i386-softmmu] Error 2
make[1]: Leaving directory `/var/tmp/portage/app-emulation/kvm-72/work/kvm-72/qemu'
make: *** [qemu] Error 2

Quoted 2 lines

There is no tcg-target.h for the s390 arch but why is i386-softmmu being compiled?

Yes. Expect further breakage in kvm-userspace on s390. At the moment libkvm is the only part of kvm-userspace that is finished. Anything else is not yet done.

At the moment you have to use kuli to start a guest.

If you start kuli with:

# kuli -k <yourguestkernel> -a "noinitrd"
you will get a booting kernel until the no device found panic message

you can use a file, disk or partition as a root device. If you have a copy of your distribution on lets say /dev/dasdb1 you can boot with:

# kuli -k /boot/image-<xxx> -a "initrd root=/dev/vda" \
-d file=/dev/dasdb1 -i /boot/initrd-<xxx>

Make sure to adopt the guest fstab to /dev/vda and so on.

Christian