From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Alexander Graf <agraf@suse.de>
Cc: Christian Paro <cparo@us.ibm.com>,
qemu-devel@nongnu.org, Dominik Dingel <dingel@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type
Date: Fri, 26 Apr 2013 17:42:17 +0200 [thread overview]
Message-ID: <517AA059.4000400@de.ibm.com> (raw)
In-Reply-To: <5AAF60BF-6909-45E4-8D61-B9B8B21CA95F@suse.de>
On 26/04/13 17:22, Alexander Graf wrote:
>
> On 26.04.2013, at 14:12, Dominik Dingel wrote:
>
>> Check for a kernel IPL entry and load kernel image if one was
>> specified.
>> If no kernel image was supplied and the first boot device
>> is not a virtio-ccw-blk device, print error message and exit.
>>
>> In case it is a virtio-ccw-blk device store the dev_no in reg[7]
>
> I thought we want a boot order, not a singular device to boot off of?
>
> Alex
First of all we want to be able to choose a boot device as a first step.
With this patch the user is able to use libvirt and friends to choose the
disk to boot from.
The nice approach with this bios/ipl device is that we can update both
in lock-step so this reg7 interface is not an ABI.
So in a future version we actually could:
a: implement diag 308 subcode 5/6, which would enable /sys/devices/firmware/[ipl|reipl]
just like on z/VM or LPAR (this allows to reboot from a different device).
b: implement a list.
b looks nice, but I actually prefer a for two reasons:
1. be closer to the real hw
2. predictability
but we can certainly discuss this.
So I suggest to go with this patch and implement later on what we
agree upon?
Christian
>
>>
>> Signed-off-by: Christian Paro <cparo@us.ibm.com>
>> Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
>>
>> diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
>> index ace5ff5..9758529 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
>> @@ -56,14 +58,25 @@ typedef struct S390IPLState {
>> char *firmware;
>> } S390IPLState;
>>
>> +static void s390_ipl_kernel(uint64_t pswaddr)
>> +{
>> + S390CPU *cpu = S390_CPU(qemu_get_cpu(0));
>> + CPUS390XState *env = &cpu->env;
>> +
>> + env->psw.addr = pswaddr;
>> + env->psw.mask = IPL_PSW_MASK;
>> + s390_add_running_cpu(cpu);
>> +}
>>
>> -static void s390_ipl_cpu(uint64_t pswaddr)
>> +static void s390_ipl_from_disk(VirtIOBlkCcw *dev, uint64_t pswaddr)
>> {
>> S390CPU *cpu = S390_CPU(qemu_get_cpu(0));
>> CPUS390XState *env = &cpu->env;
>> + VirtioCcwDevice *ccw_dev = &(dev->parent_obj);
>>
>> env->psw.addr = pswaddr;
>> env->psw.mask = IPL_PSW_MASK;
>> + env->regs[7] = ccw_dev->sch->devno;
>> s390_add_running_cpu(cpu);
>> }
>>
>> @@ -152,7 +165,18 @@ static void s390_ipl_reset(DeviceState *dev)
>> {
>> S390IPLState *ipl = S390_IPL(dev);
>>
>> - s390_ipl_cpu(ipl->start_addr);
>> + if (ipl->kernel) {
>> + return s390_ipl_kernel(ipl->start_addr);
>> + }
>> +
>> + DeviceState *boot_device = get_boot_device(0);
>> + if (object_dynamic_cast(OBJECT(boot_device), TYPE_VIRTIO_BLK) != NULL) {
>> + s390_ipl_from_disk(VIRTIO_BLK_CCW(boot_device->parent_obj.parent),
>> + ipl->start_addr);
>> + } else {
>> + fprintf(stderr, "qemu: s390x only supports boot from virtio-ccw-blk\n");
>> + exit(1);
>> + }
>> }
>>
>> static void s390_ipl_class_init(ObjectClass *klass, void *data)
>> --
>> 1.7.9.5
>>
>
next prev parent reply other threads:[~2013-04-26 15:42 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-26 12:12 [Qemu-devel] [PATCH 00/10] S390: Enhance s390 BIOS to enable bootdevice selection Dominik Dingel
2013-04-26 12:12 ` [Qemu-devel] [PATCH 01/10] Common: Add a default bootindex for all applicable devices Dominik Dingel
2013-04-26 15:19 ` Alexander Graf
2013-04-26 16:36 ` Anthony Liguori
2013-04-26 18:01 ` Dominik Dingel
2013-04-26 18:55 ` Anthony Liguori
2013-04-26 19:13 ` Gleb Natapov
2013-04-26 21:34 ` Dominik Dingel
2013-04-27 5:44 ` Gleb Natapov
2013-04-26 19:38 ` Christian Borntraeger
2013-04-26 12:12 ` [Qemu-devel] [PATCH 02/10] Common: Add quick access to first boot device Dominik Dingel
2013-04-26 16:37 ` Anthony Liguori
2013-04-26 12:12 ` [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type Dominik Dingel
2013-04-26 15:22 ` Alexander Graf
2013-04-26 15:36 ` Dominik Dingel
2013-04-26 15:42 ` Christian Borntraeger [this message]
2013-04-26 15:48 ` Alexander Graf
2013-04-26 16:01 ` Christian Borntraeger
2013-04-26 16:05 ` Alexander Graf
2013-04-26 16:10 ` Dominik Dingel
2013-04-26 16:13 ` Alexander Graf
2013-04-26 16:11 ` Christian Borntraeger
2013-04-26 16:13 ` Alexander Graf
2013-04-26 16:45 ` Anthony Liguori
2013-04-26 16:04 ` Dominik Dingel
2013-04-26 16:07 ` Alexander Graf
2013-04-26 16:50 ` Alexander Graf
2013-04-26 12:12 ` [Qemu-devel] [PATCH 04/10] S390: check if BIOS is available and create links Dominik Dingel
2013-04-26 15:23 ` Alexander Graf
2013-04-26 15:48 ` Dominik Dingel
2013-04-26 15:57 ` Alexander Graf
2013-04-26 16:20 ` Dominik Dingel
2013-04-26 16:22 ` Alexander Graf
2013-04-26 16:38 ` Anthony Liguori
2013-04-26 18:03 ` Dominik Dingel
2013-04-26 18:04 ` Alexander Graf
2013-04-26 12:12 ` [Qemu-devel] [PATCH 05/10] s390-ccw.img: Detect devices with stsch Dominik Dingel
2013-04-26 12:12 ` [Qemu-devel] [PATCH 06/10] s390-ccw.img: Enhance drain_irqs() Dominik Dingel
2013-04-26 12:12 ` [Qemu-devel] [PATCH 07/10] s390-ccw.img: Rudimentary error checking Dominik Dingel
2013-04-26 12:12 ` [Qemu-devel] [PATCH 08/10] s390-ccw.img: Get queue config from host Dominik Dingel
2013-04-26 12:12 ` [Qemu-devel] [PATCH 09/10] S390: Pass per-device loadparm values for CCW blk and net devs Dominik Dingel
2013-04-26 16:52 ` Alexander Graf
2013-04-26 18:08 ` Dominik Dingel
2013-04-26 18:14 ` Alexander Graf
2013-04-26 19:54 ` Christian Borntraeger
2013-04-26 12:12 ` [Qemu-devel] [PATCH 10/10] S390: Enabling device and program selection Dominik Dingel
2013-04-26 15:29 ` Alexander Graf
2013-04-26 16:56 ` Alexander Graf
2013-04-26 17:55 ` Dominik Dingel
2013-04-26 17:56 ` Alexander Graf
2013-04-26 16:19 ` [Qemu-devel] [PATCH 00/10] S390: Enhance s390 BIOS to enable bootdevice selection Alexander Graf
2013-04-26 16:22 ` Dominik Dingel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=517AA059.4000400@de.ibm.com \
--to=borntraeger@de.ibm.com \
--cc=agraf@suse.de \
--cc=cparo@us.ibm.com \
--cc=dingel@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.