From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43450) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVFfz-0002sQ-4s for qemu-devel@nongnu.org; Tue, 10 Mar 2015 04:38:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVFfs-0000of-6j for qemu-devel@nongnu.org; Tue, 10 Mar 2015 04:38:07 -0400 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:52000) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVFfr-0000nz-V1 for qemu-devel@nongnu.org; Tue, 10 Mar 2015 04:38:00 -0400 Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 10 Mar 2015 08:37:59 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 9FE83219005E for ; Tue, 10 Mar 2015 08:37:47 +0000 (GMT) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t2A8buUZ64159882 for ; Tue, 10 Mar 2015 08:37:56 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t2A8buaa011321 for ; Tue, 10 Mar 2015 02:37:56 -0600 From: Christian Borntraeger Date: Tue, 10 Mar 2015 09:38:09 +0100 Message-Id: <1425976693-18087-17-git-send-email-borntraeger@de.ibm.com> In-Reply-To: <1425976693-18087-1-git-send-email-borntraeger@de.ibm.com> References: <1425976693-18087-1-git-send-email-borntraeger@de.ibm.com> Subject: [Qemu-devel] [PULL 16/20] s390-ccw.img: Allow bigger ramdisk sizes or offsets List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel , Alexander Graf , Christian Borntraeger , Jens Freimann , Cornelia Huck , Richard Henderson The s390-ccw bios creates the the virtqueue at 100MB. For big ramdisks or offsets (via zipl) this gets overwritten. As a quick band-aid, lets move the virtqueue into the bss section, which is at 0x7f00000. As the bios code (text) is at 0x7e00000 we can now handle ramdisk which are ~27MB bigger. Long term we want to make the s390-ccw bios position independent and load of at the end of memory. Reported-by: Alexander Graf Signed-off-by: Christian Borntraeger Acked-by: Cornelia Huck Message-Id: <1425310029-53396-2-git-send-email-borntraeger@de.ibm.com> --- pc-bios/s390-ccw/main.c | 1 + pc-bios/s390-ccw/s390-ccw.h | 1 + pc-bios/s390-ccw/virtio.c | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c index 6f707bb..584d4a2 100644 --- a/pc-bios/s390-ccw/main.c +++ b/pc-bios/s390-ccw/main.c @@ -12,6 +12,7 @@ #include "virtio.h" char stack[PAGE_SIZE * 8] __attribute__((__aligned__(PAGE_SIZE))); +char ring_area[PAGE_SIZE * 8] __attribute__((__aligned__(PAGE_SIZE))); uint64_t boot_value; static struct subchannel_id blk_schid = { .one = 1 }; diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h index ceb7418..9b3868b 100644 --- a/pc-bios/s390-ccw/s390-ccw.h +++ b/pc-bios/s390-ccw/s390-ccw.h @@ -52,6 +52,7 @@ void disabled_wait(void); void virtio_panic(const char *string); void write_subsystem_identification(void); extern char stack[PAGE_SIZE * 8] __attribute__((__aligned__(PAGE_SIZE))); +extern char ring_area[PAGE_SIZE * 8] __attribute__((__aligned__(PAGE_SIZE))); extern uint64_t boot_value; /* sclp-ascii.c */ diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c index 4dc91a7..76919f7 100644 --- a/pc-bios/s390-ccw/virtio.c +++ b/pc-bios/s390-ccw/virtio.c @@ -378,10 +378,10 @@ void virtio_setup_block(struct subchannel_id schid) if (run_ccw(schid, CCW_CMD_READ_CONF, &blk_cfg, sizeof(blk_cfg))) { virtio_panic("Could not get block device configuration\n"); } - vring_init(&block, config.num, (void *)(100 * 1024 * 1024), + vring_init(&block, config.num, ring_area, KVM_S390_VIRTIO_RING_ALIGN); - info.queue = (100ULL * 1024ULL* 1024ULL); + info.queue = (unsigned long long) ring_area; info.align = KVM_S390_VIRTIO_RING_ALIGN; info.index = 0; info.num = config.num; -- 2.3.0