Skip to content

s390x emulation support

Alexander Graf qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest17 patches 24 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/17Only build ivshmem when CONFIG_PCI && CONFIG_KVMMakefile.target+7 -12 replies
2/17virtio: use generic name when possibleblockdev.c hw/s390-virtio-bus.c hw/virtio-pci.c +1 more+9 -40 replies
3/17s390x: Enable disassembler for s390xdisas.c+6 -00 replies
4/17s390x: Enable nptl for s390xconfigure+1 -00 replies
5/17s390x: enable CPU_QuadUcpu-all.h+1 -12 replies
6/17s390x: s390x-linux-user supportlinux-user/elfload.c linux-user/main.c linux-user/s390x/syscall.h +8 more+1368 -80 replies
7/17linux-user: define a couple of syscalls for non-uid16 targetslinux-user/syscall.c+105 -200 replies
8/17s390x: Enable s390x-softmmu targetcpu-exec.c target-s390x/exec.h+28 -00 replies
9/17s390x: Dispatch interrupts to KVM or the real CPUhw/s390-virtio-bus.c+8 -20 replies
10/17s390x: Adjust GDB stubgdbstub.c+6 -22 replies
11/17s390x: virtio machine storage keyshw/s390-virtio.c+9 -120 replies
12/17s390x: Prepare cpu.h for emulationtarget-s390x/cpu.h+729 -302 replies
13/17s390x: helper functions for system emulationtarget-s390x/helper.c+571 -100 replies
14/17s390x: Implement opcode helperstarget-s390x/helpers.h target-s390x/op_helper.c+3040 -28 replies
15/17s390x: Adjust internal kvm codetarget-s390x/kvm.c+14 -460 replies
16/17s390x: translate engine for s390x CPUtarget-s390x/translate.c+5158 -37 replies
17/17s390x: build s390x by defaultconfigure default-configs/s390x-linux-user.mak+3 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 00/17] s390x emulation support

We've had support for running s390x guests with KVM for a while now. This patch set also enables support for running s390x guests in system as well as linux-user mode in emulation!

Within this scope, I again want to stress that this is _not_ supposed to replace Hercules - the s390 emulator - in any way. The only target supported by qemu is Linux. You can only run Linux applications with linux-user emulation and Linux guest OSs with the system emulation. All the device logic (and 24 bit mode) for running legacy stuff is missing. Use Hercules for those!

I have successfully run the following guest OSs:

- SUSE Linux Enterprise Server 11 SP1
- Debian Lenny

Both of which work just fine on x86_64 and ppc hosts. Other hosts should also work. The only thing that did not work for me is network. Somehow networking only works with KVM enabled, so there is probably some bug involved still.

Either way - rejoice! As with this patch set you can finally fulfill your mainframe desires on your local workstation. And - most importantly - finally test patches to virtio against s390!

For images, I'm hoping for Aurelien to provide Debian images that run in qemu. Other distributions only provide S390x target support in their enterprise variants, keeping me from redistributing images :(.

If you're trying to get things rolling yourself, make sure to use a recent kernel that has support for the virtio architecture and virtio console support - otherwise you won't see output.

The linux user mode emulation part only support 64bit binaries, so running Debian binaries with that one is out of question for now. Use the system emulation mode if you really need to run Debian binaries.

Alexander Graf (12):
Only build ivshmem when CONFIG_PCI && CONFIG_KVM
virtio: use generic name when possible
s390x: Enable s390x-softmmu target
s390x: Dispatch interrupts to KVM or the real CPU
s390x: Adjust GDB stub
s390x: virtio machine storage keys
s390x: Prepare cpu.h for emulation
s390x: helper functions for system emulation
s390x: Implement opcode helpers
s390x: Adjust internal kvm code
s390x: translate engine for s390x CPU
s390x: build s390x by default

Ulrich Hecht (5):
s390x: Enable disassembler for s390x
s390x: Enable nptl for s390x
s390x: enable CPU_QuadU
s390x: s390x-linux-user support
linux-user: define a couple of syscalls for non-uid16 targets

 Makefile.target                      |    8 +-
 blockdev.c                           |    2 +-
 configure                            |    3 +
 cpu-all.h                            |    2 +-
 cpu-exec.c                           |    8 +
 default-configs/s390x-linux-user.mak |    1 +
 disas.c                              |    6 +
 gdbstub.c                            |    8 +-
 hw/s390-virtio-bus.c                 |   12 +-
 hw/s390-virtio.c                     |   21 +-
 hw/virtio-pci.c                      |    3 +
 linux-user/elfload.c                 |   18 +
 linux-user/main.c                    |   89 +
 linux-user/s390x/syscall.h           |   25 +
 linux-user/s390x/syscall_nr.h        |  349 +++
 linux-user/s390x/target_signal.h     |   26 +
 linux-user/s390x/termbits.h          |  283 ++
 linux-user/signal.c                  |  314 +++
 linux-user/syscall.c                 |  143 +-
 linux-user/syscall_defs.h            |   56 +-
 s390x.ld                             |  194 ++
 scripts/qemu-binfmt-conf.sh          |    4 +-
 target-s390x/cpu.h                   |  759 +++++-
 target-s390x/exec.h                  |   20 +
 target-s390x/helper.c                |  581 ++++-
 target-s390x/helpers.h               |  151 +
 target-s390x/kvm.c                   |   60 +-
 target-s390x/op_helper.c             | 2891 +++++++++++++++++++-
 target-s390x/translate.c             | 5161 +++++++++++++++++++++++++++++++++-
 vl.c                                 |    6 +-
 30 files changed, 11063 insertions(+), 141 deletions(-)
 create mode 100644 default-configs/s390x-linux-user.mak
 create mode 100644 linux-user/s390x/syscall.h
 create mode 100644 linux-user/s390x/syscall_nr.h
 create mode 100644 linux-user/s390x/target_signal.h
 create mode 100644 linux-user/s390x/termbits.h
 create mode 100644 s390x.ld
 create mode 100644 target-s390x/helpers.h