Fix S390x target v2
PATCH 2/3 S390: Tell user why VM creation failed
In reply to Alexander GrafThe KVM kernel module on S390 refuses to create a VM when the switch_amode kernel parameter is not used.
Since that is not exactly obvious, let's give the user a nice warning.
--- kvm-all.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
kvm-all.c +6 -1
@@ -609,8 +609,13 @@ int kvm_init(int smp_cpus) } s->vmfd =kvm_ioctl (s,KVM_CREATE_VM ,0 ); -if (s->vmfd <0 ) +if (s->vmfd <0 ) { +#ifdef TARGET_S390X +fprintf (stderr,"Please add the 'switch_amode' kernel parameter to " +"your host kernel command line\n" ); +#endif goto err; + }/* initially, KVM allocated its own memory and we had to jump through * hooks to make phys_ram_base point to this. Modern versions of KVM
Signature · 1 line
1.6.0.2
PATCH 3/3 S390: Don't compile in virtio-pci
In reply to Alexander GrafAs soon as virtio-pci.c gets compiled and used on S390 the internal qdev magic gets confused and tries to give us PCI devices instead of S390 virtio devices.
Since we don't have PCI on S390, we can safely not compile virtio-pci at all.
In order to do this I added a new config option "CONFIG_VIRTIO_PCI" that I enabled for every platform except S390. Thanks to this the change should be a complete nop for every other platform.
---
v1 -> v2:
- change option to CONFIG_VIRTIO_CPI
--- Makefile.objs | 3 ++- default-configs/arm-softmmu.mak | 1 + default-configs/cris-softmmu.mak | 1 + default-configs/i386-softmmu.mak | 1 + default-configs/m68k-softmmu.mak | 1 + default-configs/microblaze-softmmu.mak | 1 + default-configs/mips-softmmu.mak | 1 + default-configs/mips64-softmmu.mak | 1 + default-configs/mips64el-softmmu.mak | 1 + default-configs/mipsel-softmmu.mak | 1 + default-configs/ppc-softmmu.mak | 1 + default-configs/ppc64-softmmu.mak | 1 + default-configs/ppcemb-softmmu.mak | 1 + default-configs/sh4-softmmu.mak | 1 + default-configs/sh4eb-softmmu.mak | 1 + default-configs/sparc-softmmu.mak | 1 + default-configs/sparc64-softmmu.mak | 1 + default-configs/x86_64-softmmu.mak | 1 + 18 files changed, 19 insertions(+), 1 deletions(-)
Makefile.objs +2 -1
@@ -128,7 +128,8 @@ user-obj-y += cutils.o cache-utils.o hw-obj-y = hw-obj-y += loader.o -hw-obj-y += virtio.o virtio-console.o virtio-pci.o +hw-obj-y += virtio.o virtio-console.o +hw-obj-$(CONFIG_VIRTIO_PCI) += virtio-pci.o hw-obj-y += fw_cfg.o pci.o pci_host.o pcie_host.o hw-obj-y += watchdog.o hw-obj-$(CONFIG_ISA_MMIO) += isa_mmio.o
default-configs/arm-softmmu.mak +1 -0
@@ -24,3 +24,4 @@ CONFIG_SSI_SD=y CONFIG_LAN9118=y CONFIG_SMC91C111=y CONFIG_DS1338=y +CONFIG_VIRTIO_PCI=y
default-configs/cris-softmmu.mak +1 -0
@@ -2,3 +2,4 @@ CONFIG_NAND=y CONFIG_PTIMER=y +CONFIG_VIRTIO_PCI=y
default-configs/i386-softmmu.mak +1 -0
@@ -16,3 +16,4 @@ CONFIG_IDE_PIIX=y CONFIG_NE2000_ISA=y CONFIG_PIIX_PCI=y CONFIG_SOUND=y +CONFIG_VIRTIO_PCI=y
default-configs/m68k-softmmu.mak +1 -0
@@ -2,3 +2,4 @@ CONFIG_GDBSTUB_XML=y CONFIG_PTIMER=y +CONFIG_VIRTIO_PCI=y
default-configs/microblaze-softmmu.mak +1 -0
@@ -1,3 +1,4 @@ # Default configuration for microblaze-softmmu CONFIG_PTIMER=y +CONFIG_VIRTIO_PCI=y
default-configs/mips-softmmu.mak +1 -0
@@ -16,3 +16,4 @@ CONFIG_IDE_ISA=y CONFIG_IDE_PIIX=y CONFIG_NE2000_ISA=y CONFIG_SOUND=y +CONFIG_VIRTIO_PCI=y
default-configs/mips64-softmmu.mak +1 -0
@@ -16,3 +16,4 @@ CONFIG_IDE_ISA=y CONFIG_IDE_PIIX=y CONFIG_NE2000_ISA=y CONFIG_SOUND=y +CONFIG_VIRTIO_PCI=y
default-configs/mips64el-softmmu.mak +1 -0
@@ -16,3 +16,4 @@ CONFIG_IDE_ISA=y CONFIG_IDE_PIIX=y CONFIG_NE2000_ISA=y CONFIG_SOUND=y +CONFIG_VIRTIO_PCI=y
default-configs/mipsel-softmmu.mak +1 -0
@@ -16,3 +16,4 @@ CONFIG_IDE_ISA=y CONFIG_IDE_PIIX=y CONFIG_NE2000_ISA=y CONFIG_SOUND=y +CONFIG_VIRTIO_PCI=y
default-configs/ppc-softmmu.mak +1 -0
@@ -15,3 +15,4 @@ CONFIG_IDE_ISA=y CONFIG_IDE_CMD646=y CONFIG_NE2000_ISA=y CONFIG_SOUND=y +CONFIG_VIRTIO_PCI=y
default-configs/ppc64-softmmu.mak +1 -0
@@ -15,3 +15,4 @@ CONFIG_IDE_ISA=y CONFIG_IDE_CMD646=y CONFIG_NE2000_ISA=y CONFIG_SOUND=y +CONFIG_VIRTIO_PCI=y
default-configs/ppcemb-softmmu.mak +1 -0
@@ -15,3 +15,4 @@ CONFIG_IDE_ISA=y CONFIG_IDE_CMD646=y CONFIG_NE2000_ISA=y CONFIG_SOUND=y +CONFIG_VIRTIO_PCI=y
default-configs/sh4-softmmu.mak +1 -0
@@ -3,3 +3,4 @@ CONFIG_USB_OHCI=y CONFIG_SERIAL=y CONFIG_PTIMER=y +CONFIG_VIRTIO_PCI=y
default-configs/sh4eb-softmmu.mak +1 -0
@@ -3,3 +3,4 @@ CONFIG_USB_OHCI=y CONFIG_SERIAL=y CONFIG_PTIMER=y +CONFIG_VIRTIO_PCI=y
default-configs/sparc-softmmu.mak +1 -0
@@ -7,3 +7,4 @@ CONFIG_ESCC=y CONFIG_M48T59=y CONFIG_PTIMER=y CONFIG_FDC=y +CONFIG_VIRTIO_PCI=y
default-configs/sparc64-softmmu.mak +1 -0
@@ -11,3 +11,4 @@ CONFIG_IDE_QDEV=y CONFIG_IDE_PCI=y CONFIG_IDE_ISA=y CONFIG_IDE_CMD646=y +CONFIG_VIRTIO_PCI=y
default-configs/x86_64-softmmu.mak +1 -0
@@ -16,3 +16,4 @@ CONFIG_IDE_PIIX=y CONFIG_NE2000_ISA=y CONFIG_PIIX_PCI=y CONFIG_SOUND=y +CONFIG_VIRTIO_PCI=y
Signature · 1 line
1.6.0.2
PATCH 1/3 S390: Add stub for cpu_get_phys_page_debug
In reply to Alexander GrafWe don't implement any virtual memory in the S390 target so far, so let's add a stub for this now mandatory function.
Fixes building of S390 target.
--- target-s390x/helper.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
target-s390x/helper.c +5 -0
@@ -58,6 +58,11 @@ void cpu_reset(CPUS390XState *env)tlb_flush (env,1 ); } +target_phys_addr_t cpu_get_phys_page_debug (CPUState *env,target_ulong addr) +{ +return 0 ; +} +#ifndef CONFIG_USER_ONLY int cpu_s390x_handle_mmu_fault (CPUState *env, target_ulong address, int rw,
Signature · 1 line
1.6.0.2
cover Fix S390x target v2
We're in a bad situation with the S390 qemu target. It only works with KVM, so people can't test it when they don't have access to a real S390 machine.
While trying to build and use s390x-softmmu again I stumbled across a couple of issues, all addressed in this patch set. The patches should all not affect non-s390 targets at all.
v1 -> v2:
- change CONFIG_PCI to CONFIG_VIRTIO_PCI
Alexander Graf (3):
S390: Add stub for cpu_get_phys_page_debug
S390: Tell user why VM creation failed
S390: Don't compile in virtio-pci
Makefile.objs | 3 ++- default-configs/arm-softmmu.mak | 1 + default-configs/cris-softmmu.mak | 1 + default-configs/i386-softmmu.mak | 1 + default-configs/m68k-softmmu.mak | 1 + default-configs/microblaze-softmmu.mak | 1 + default-configs/mips-softmmu.mak | 1 + default-configs/mips64-softmmu.mak | 1 + default-configs/mips64el-softmmu.mak | 1 + default-configs/mipsel-softmmu.mak | 1 + default-configs/ppc-softmmu.mak | 1 + default-configs/ppc64-softmmu.mak | 1 + default-configs/ppcemb-softmmu.mak | 1 + default-configs/sh4-softmmu.mak | 1 + default-configs/sh4eb-softmmu.mak | 1 + default-configs/sparc-softmmu.mak | 1 + default-configs/sparc64-softmmu.mak | 1 + default-configs/x86_64-softmmu.mak | 1 + kvm-all.c | 7 ++++++- target-s390x/helper.c | 5 +++++ 20 files changed, 30 insertions(+), 2 deletions(-)
Quoted 11 lines · Alexander Graf
We're in a bad situation with the S390 qemu target. It only works with KVM, so people can't test it when they don't have access to a real S390 machine.
While trying to build and use s390x-softmmu again I stumbled across a couple of issues, all addressed in this patch set. The patches should all not affect non-s390 targets at all.
v1 -> v2:
- change
CONFIG_PCItoCONFIG_VIRTIO_PCI
Thanks, all applied.
Quoted 30 lines
Alexander Graf (3):
S390: Add stub forcpu_get_phys_page_debug
S390: Tell user why VM creation failed
S390: Don't compile in virtio-pciMakefile.objs | 3 ++- default-configs/arm-softmmu.mak | 1 + default-configs/cris-softmmu.mak | 1 + default-configs/i386-softmmu.mak | 1 + default-configs/m68k-softmmu.mak | 1 + default-configs/microblaze-softmmu.mak | 1 + default-configs/mips-softmmu.mak | 1 + default-configs/mips64-softmmu.mak | 1 + default-configs/mips64el-softmmu.mak | 1 + default-configs/mipsel-softmmu.mak | 1 + default-configs/ppc-softmmu.mak | 1 + default-configs/ppc64-softmmu.mak | 1 + default-configs/ppcemb-softmmu.mak | 1 + default-configs/sh4-softmmu.mak | 1 + default-configs/sh4eb-softmmu.mak | 1 + default-configs/sparc-softmmu.mak | 1 + default-configs/sparc64-softmmu.mak | 1 + default-configs/x86_64-softmmu.mak | 1 + kvm-all.c | 7 ++++++- target-s390x/helper.c | 5 +++++ 20 files changed, 30 insertions(+), 2 deletions(-)
Signature · 2 lines
Aurelien Jarno GPG: 1024D/F1BCDB73 [email protected] http://www.aurel32.net
Quoted 10 lines · Aurelien Jarno
Quoted 8 lines · Alexander Graf
We're in a bad situation with the S390 qemu target. It only works with KVM, so people can't test it when they don't have access to a real S390 machine.
While trying to build and use s390x-softmmu again I stumbled across a couple of issues, all addressed in this patch set. The patches should all not affect non-s390 targets at all.
Quoted 7 lines
Quoted 4 lines
v1 -> v2:
- change
CONFIG_PCItoCONFIG_VIRTIO_PCIThanks, all applied.
Are you sure? I only see patch 3 applied. Either way, following up with another patch set that includes 1/3 and 2/3.
Alex