s390x/kvm: Features and fixes for 2.3
Peter,
here is the 2nd version (only one patch changed) that hopefully compiles fine on 32 bit hosts.
I only added that patch as followup mail.
The following changes since commit 277263e1b320d759a760ba6c5ea75ec268f929e5:
Merge remote-tracking branch 'remotes/agraf/tags/signed-ppc-for-upstream' into staging (2015-03-09 14:04:14 +0000)
are available in the git repository at:
git://github.com/borntraeger/qemu.git tags/s390x-20150310
for you to fetch changes up to 2d5eeef1c0be68c30ccd60fd7267690d523f702a:
s390-ccw: rebuild BIOS (2015-03-11 11:15:45 +0100)
----------------------------------------------------------------
s390x/kvm: Features and fixes for 2.3
- an extension to the elf loader to allow relocations
- make the ccw bios relocatable. This allows for bigger ramdisks or smaller guests
- Handle all slow SIGPs in QEMU (instead of kernel) for better compliance and correctness
- tell the KVM module the maximum guest size. This allows KVM to reduce the number or page table levels
- Several fixes/cleanups
----------------------------------------------------------------
Christian Borntraeger (4):
synchronize Linux headers to 4.0-rc3 s390-ccw.img: Allow bigger ramdisk sizes or offsets s390-ccw.img: Reinitialize guessing on reboot
s390-ccw: rebuild BIOS
David Hildenbrand (10):
s390x: introduce defines for SIGP condition codes
s390x/kvm: more details for SIGP handler with one destination vcpu
s390x/kvm: pass the SIGP instruction parameter to the SIGP handler
s390x/kvm: helper to set the SIGP status in SigpInfo
s390x/kvm: trace all SIGP orders
s390x/kvm: implement handling of new SIGP orders
s390x/kvm: SIGP START is only applicable when STOPPED
s390x: add function to deliver restart irqs
s390x/kvm: deliver SIGP RESTART directly if stopped
s390x/kvm: enable the new SIGP handling in user spaceDominik Dingel (1):
s390x/kvm: passing max memory size to accelerator
Markus Armbruster (3):
virtio-s390: s390_virtio_device_init() can't fail, simplify
virtio-s390: Convert to realize()
virtio-ccw: Convert to realize()
Thomas Huth (2):
elf-loader: Provide the possibility to relocate s390 ELF files s390/bios: Make the s390-ccw.img relocatable
hw/core/loader.c | 2 + hw/s390x/ipl.c | 24 +- hw/s390x/s390-virtio-bus.c | 97 ++++--- hw/s390x/s390-virtio-bus.h | 2 +- hw/s390x/s390-virtio-ccw.c | 10 + hw/s390x/virtio-ccw.c | 134 +++++---- hw/s390x/virtio-ccw.h | 2 +- include/elf.h | 2 + include/hw/elf_ops.h | 78 ++++++ include/standard-headers/linux/virtio_net.h | 54 ++-- linux-headers/asm-arm/kvm.h | 2 + linux-headers/asm-arm64/kvm.h | 9 + linux-headers/asm-s390/kvm.h | 37 +++ linux-headers/asm-x86/hyperv.h | 11 + linux-headers/linux/kvm.h | 20 +- pc-bios/s390-ccw.img | Bin 17752 -> 13616 bytes pc-bios/s390-ccw/Makefile | 11 +- pc-bios/s390-ccw/main.c | 1 + pc-bios/s390-ccw/s390-ccw.h | 1 + pc-bios/s390-ccw/virtio.c | 5 +- target-s390x/cpu.c | 2 + target-s390x/cpu.h | 40 ++- target-s390x/helper.c | 35 ++- target-s390x/kvm.c | 416 ++++++++++++++++++++++++---- target-s390x/machine.c | 5 +- target-s390x/misc_helper.c | 4 +- trace-events | 1 + 27 files changed, 780 insertions(+), 225 deletions(-)
PATCH 19/20 s390/bios: Make the s390-ccw.img relocatable
From: Thomas Huth <[email protected]>
The current bios sits at location 0x7e00000 in the guest RAM and thus prevents loading of bigger ramdisks. By making the image relocatable we can move it to the end of the RAM so that it is getting out of the way.
Message-Id: <[email protected]>
--- hw/s390x/ipl.c | 24 +++++++++++++++++++++--- pc-bios/s390-ccw/Makefile | 11 ++++++----- 2 files changed, 27 insertions(+), 8 deletions(-)
hw/s390x/ipl.c +21 -3
@@ -14,6 +14,7 @@#include "sysemu/sysemu.h" #include "cpu.h" #include "elf.h" +#include "exec/ram_addr.h" #include "hw/loader.h" #include "hw/sysbus.h" #include "hw/s390x/virtio-ccw.h"
@@ -95,6 +96,16 @@ static const VMStateDescription vmstate_ipl = { } }; +static uint64_t bios_translate_addr (void *opaque,uint64_t srcaddr) +{ +uint64_t dstaddr = *(uint64_t *) opaque; +/* +* Assuming that our s390-ccw.img was linked for starting at address 0, +* we can simply add the destination address for the final location +*/ +return srcaddr + dstaddr; +} +static int s390_ipl_init (SysBusDevice *dev) {S390IPLState *ipl =S390_IPL (dev);
@@ -109,6 +120,8 @@ static int s390_ipl_init(SysBusDevice *dev)* even if an external kernel has been defined. */ if (!ipl->kernel || ipl->enforce_bios) { +uint64_t fwbase = (MIN (ram_size,0x80000000U ) -0x200000 ) & ~0xffffUL ; +if (bios_name ==NULL ) { bios_name = ipl->firmware; }
@@ -118,9 +131,14 @@ static int s390_ipl_init(SysBusDevice *dev)hw_error ("could not find stage1 bootloader\n" ); } - bios_size =load_elf (bios_filename,NULL ,NULL , &ipl->bios_start_addr, -NULL ,NULL ,1 ,ELF_MACHINE ,0 ); -if (bios_size <0 ) { + bios_size =load_elf (bios_filename, bios_translate_addr, &fwbase, + &ipl->bios_start_addr,NULL ,NULL ,1 , +ELF_MACHINE ,0 ); +if (bios_size >0 ) { +/* Adjust ELF start address to final location */ + ipl->bios_start_addr += fwbase; + }else { +/* Try to load non-ELF file (e.g. s390-zipl.rom) */ bios_size =load_image_targphys (bios_filename,ZIPL_IMAGE_START ,4096 ); ipl->bios_start_addr =ZIPL_IMAGE_START ;
pc-bios/s390-ccw/Makefile +6 -5
@@ -9,10 +9,9 @@ $(call set-vpath, $(SRC_PATH)/pc-bios/s390-ccw) .PHONY : all clean build-all -OBJECTS=main.o bootmap.o sclp-ascii.o virtio.o start.o -CFLAGS += -fno-stack-protector -# XXX find a more clever to locate the bootloader -LDFLAGS += -Wl,-Ttext,0x7e00000,-Tbss,0x7f00000 -nostdlib +OBJECTS = start.o main.o bootmap.o sclp-ascii.o virtio.o +CFLAGS += -fPIE -fno-stack-protector -ffreestanding +LDFLAGS += -Wl,-pie -nostdlib build-all: s390-ccw.img
@@ -20,7 +19,9 @@ s390-ccw.elf: $(OBJECTS) $(call quiet-command,$(CC) $(LDFLAGS) -o $@ $(OBJECTS)," Building $(TARGET_DIR)$@") s390-ccw.img: s390-ccw.elf - $(call quiet-command,strip $< -o $@," Stripping $(TARGET_DIR)$@") + $(call quiet-command,strip --strip-unneeded $< -o $@," Stripping $(TARGET_DIR)$@") + +$(OBJECTS): Makefile clean: rm -f *.o *.d *.img *.elf *~
Signature · 1 line
2.3.0
Peter Maydell
AppliedQuoted 6 lines · Christian Borntraeger
Peter,
here is the 2nd version (only one patch changed) that hopefully compiles fine on 32 bit hosts.
I only added that patch as followup mail.
Applied, thanks.
-- PMM