[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 4/6] S390: Add virtio-blk boot
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PATCH 4/6] S390: Add virtio-blk boot |
Date: |
Mon, 6 May 2013 17:30:22 +0200 |
From: Dominik Dingel <address@hidden>
If no kernel IPL entry is specified, boot the bios and pass if available
device information for the first boot device (as given by the boot index).
The provided information will be used in the next commit from the BIOS.
Signed-off-by: Dominik Dingel <address@hidden>
Signed-off-by: Alexander Graf <address@hidden>
---
hw/s390x/ipl.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
index d14c548..0aeb003 100644
--- a/hw/s390x/ipl.c
+++ b/hw/s390x/ipl.c
@@ -16,6 +16,8 @@
#include "elf.h"
#include "hw/loader.h"
#include "hw/sysbus.h"
+#include "hw/s390x/virtio-ccw.h"
+#include "hw/s390x/css.h"
#define KERN_IMAGE_START 0x010000UL
#define KERN_PARM_AREA 0x010480UL
@@ -150,6 +152,22 @@ static void s390_ipl_reset(DeviceState *dev)
env->psw.addr = ipl->start_addr;
env->psw.mask = IPL_PSW_MASK;
+
+ if (!ipl->kernel) {
+ /* booting firmware, tell what device to boot from */
+ DeviceState *dev_st = get_boot_device(0);
+ VirtioCcwDevice *ccw_dev = (VirtioCcwDevice *) object_dynamic_cast(
+ OBJECT(&(dev_st->parent_obj)), "virtio-blk-ccw");
+
+ if (ccw_dev) {
+ env->regs[7] = ccw_dev->sch->cssid << 24 |
+ ccw_dev->sch->ssid << 16 |
+ ccw_dev->sch->devno;
+ } else {
+ env->regs[7] = -1;
+ }
+ }
+
s390_add_running_cpu(cpu);
}
--
1.6.0.2
- [Qemu-devel] [PULL 1.5 0/6] s390 patch queue 2013-05-06, Alexander Graf, 2013/05/06
- [Qemu-devel] [PATCH 1/6] S390: BIOS check for file, Alexander Graf, 2013/05/06
- [Qemu-devel] [PATCH 3/6] S390: Merging s390_ipl_cpu and s390_ipl_reset, Alexander Graf, 2013/05/06
- [Qemu-devel] [PATCH 4/6] S390: Add virtio-blk boot,
Alexander Graf <=
- [Qemu-devel] [PATCH 5/6] S390: BIOS boot from given device, Alexander Graf, 2013/05/06
- [Qemu-devel] [PATCH 2/6] S390: BIOS create link to src folder for .img file, Alexander Graf, 2013/05/06
- [Qemu-devel] [PATCH 6/6] s390: update s390-ccw.img, Alexander Graf, 2013/05/06
- Re: [Qemu-devel] [PULL 1.5 0/6] s390 patch queue 2013-05-06, Aurelien Jarno, 2013/05/06