* [Qemu-devel] [PATCH 01/10] Common: Add a default bootindex for all applicable devices
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 ` Dominik Dingel
2013-04-26 15:19 ` Alexander Graf
2013-04-26 16:36 ` Anthony Liguori
2013-04-26 12:12 ` [Qemu-devel] [PATCH 02/10] Common: Add quick access to first boot device Dominik Dingel
` (9 subsequent siblings)
10 siblings, 2 replies; 52+ messages in thread
From: Dominik Dingel @ 2013-04-26 12:12 UTC (permalink / raw)
To: qemu-devel; +Cc: Christian Borntraeger, Alexander Graf, Dominik Dingel
Currently only devices with a positive boot index will be pushed in the
fw_boot_order queue, so if no boot index at all will be specified,
the queue ends up empty.
Instead we push exactly as docs/bootindex.txt says the devices with
the lowest possible boot priority at the tail of the queue,
because we give them the highest available boot index.
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
diff --git a/vl.c b/vl.c
index 6caa5f4..84d7031 100644
--- a/vl.c
+++ b/vl.c
@@ -248,7 +248,7 @@ struct FWBootEntry {
char *suffix;
};
-static QTAILQ_HEAD(, FWBootEntry) fw_boot_order =
+static QTAILQ_HEAD(FWBootOrder, FWBootEntry) fw_boot_order =
QTAILQ_HEAD_INITIALIZER(fw_boot_order);
int nb_numa_nodes;
@@ -1213,10 +1213,21 @@ void add_boot_device_path(int32_t bootindex, DeviceState *dev,
FWBootEntry *node, *i;
if (bootindex < 0) {
- return;
+ bootindex = INT32_MAX;
+ if (!QTAILQ_EMPTY(&fw_boot_order) &&
+ (QTAILQ_LAST(&fw_boot_order, FWBootOrder)->bootindex == INT32_MAX)) {
+ /* there is a device at the end of the queue, so we need to walk
+ the queue reverse to get the next free bootindex */
+ QTAILQ_FOREACH_REVERSE(i, &fw_boot_order, FWBootOrder, link) {
+ if (i->bootindex != bootindex) {
+ break;
+ }
+ bootindex--;
+ }
+ }
}
- assert(dev != NULL || suffix != NULL);
+ assert(dev != NULL || suffix != NULL || bootindex >= 0);
node = g_malloc0(sizeof(FWBootEntry));
node->bootindex = bootindex;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 01/10] Common: Add a default bootindex for all applicable devices
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
1 sibling, 0 replies; 52+ messages in thread
From: Alexander Graf @ 2013-04-26 15:19 UTC (permalink / raw)
To: Dominik Dingel
Cc: Christian Borntraeger, Anthony Liguori,
qemu-devel@nongnu.org qemu-devel
On 26.04.2013, at 14:12, Dominik Dingel wrote:
> Currently only devices with a positive boot index will be pushed in the
> fw_boot_order queue, so if no boot index at all will be specified,
> the queue ends up empty.
>
> Instead we push exactly as docs/bootindex.txt says the devices with
> the lowest possible boot priority at the tail of the queue,
> because we give them the highest available boot index.
>
> Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
Anthony, I'd like to have an ack/nack from you on this one.
Alex
>
> diff --git a/vl.c b/vl.c
> index 6caa5f4..84d7031 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -248,7 +248,7 @@ struct FWBootEntry {
> char *suffix;
> };
>
> -static QTAILQ_HEAD(, FWBootEntry) fw_boot_order =
> +static QTAILQ_HEAD(FWBootOrder, FWBootEntry) fw_boot_order =
> QTAILQ_HEAD_INITIALIZER(fw_boot_order);
>
> int nb_numa_nodes;
> @@ -1213,10 +1213,21 @@ void add_boot_device_path(int32_t bootindex, DeviceState *dev,
> FWBootEntry *node, *i;
>
> if (bootindex < 0) {
> - return;
> + bootindex = INT32_MAX;
> + if (!QTAILQ_EMPTY(&fw_boot_order) &&
> + (QTAILQ_LAST(&fw_boot_order, FWBootOrder)->bootindex == INT32_MAX)) {
> + /* there is a device at the end of the queue, so we need to walk
> + the queue reverse to get the next free bootindex */
> + QTAILQ_FOREACH_REVERSE(i, &fw_boot_order, FWBootOrder, link) {
> + if (i->bootindex != bootindex) {
> + break;
> + }
> + bootindex--;
> + }
> + }
> }
>
> - assert(dev != NULL || suffix != NULL);
> + assert(dev != NULL || suffix != NULL || bootindex >= 0);
>
> node = g_malloc0(sizeof(FWBootEntry));
> node->bootindex = bootindex;
> --
> 1.7.9.5
>
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 01/10] Common: Add a default bootindex for all applicable devices
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
1 sibling, 1 reply; 52+ messages in thread
From: Anthony Liguori @ 2013-04-26 16:36 UTC (permalink / raw)
To: Dominik Dingel, qemu-devel; +Cc: Christian Borntraeger, Alexander Graf
Dominik Dingel <dingel@linux.vnet.ibm.com> writes:
> Currently only devices with a positive boot index will be pushed in the
> fw_boot_order queue, so if no boot index at all will be specified,
> the queue ends up empty.
>
> Instead we push exactly as docs/bootindex.txt says the devices with
> the lowest possible boot priority at the tail of the queue,
> because we give them the highest available boot index.
>
> Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
Wouldn't this break the ability to say: "don't every try to boot from
this device?"
As an example, some people want to force PXE boot to not be tried on
certain networks.
Regards,
Anthony Liguori
>
> diff --git a/vl.c b/vl.c
> index 6caa5f4..84d7031 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -248,7 +248,7 @@ struct FWBootEntry {
> char *suffix;
> };
>
> -static QTAILQ_HEAD(, FWBootEntry) fw_boot_order =
> +static QTAILQ_HEAD(FWBootOrder, FWBootEntry) fw_boot_order =
> QTAILQ_HEAD_INITIALIZER(fw_boot_order);
>
> int nb_numa_nodes;
> @@ -1213,10 +1213,21 @@ void add_boot_device_path(int32_t bootindex, DeviceState *dev,
> FWBootEntry *node, *i;
>
> if (bootindex < 0) {
> - return;
> + bootindex = INT32_MAX;
> + if (!QTAILQ_EMPTY(&fw_boot_order) &&
> + (QTAILQ_LAST(&fw_boot_order, FWBootOrder)->bootindex == INT32_MAX)) {
> + /* there is a device at the end of the queue, so we need to walk
> + the queue reverse to get the next free bootindex */
> + QTAILQ_FOREACH_REVERSE(i, &fw_boot_order, FWBootOrder, link) {
> + if (i->bootindex != bootindex) {
> + break;
> + }
> + bootindex--;
> + }
> + }
> }
>
> - assert(dev != NULL || suffix != NULL);
> + assert(dev != NULL || suffix != NULL || bootindex >= 0);
>
> node = g_malloc0(sizeof(FWBootEntry));
> node->bootindex = bootindex;
> --
> 1.7.9.5
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 01/10] Common: Add a default bootindex for all applicable devices
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:38 ` Christian Borntraeger
0 siblings, 2 replies; 52+ messages in thread
From: Dominik Dingel @ 2013-04-26 18:01 UTC (permalink / raw)
To: Anthony Liguori; +Cc: Christian Borntraeger, qemu-devel, Alexander Graf
On Fri, 26 Apr 2013 11:36:11 -0500
Anthony Liguori <anthony@codemonkey.ws> wrote:
> Dominik Dingel <dingel@linux.vnet.ibm.com> writes:
>
> > Currently only devices with a positive boot index will be pushed in the
> > fw_boot_order queue, so if no boot index at all will be specified,
> > the queue ends up empty.
> >
> > Instead we push exactly as docs/bootindex.txt says the devices with
> > the lowest possible boot priority at the tail of the queue,
> > because we give them the highest available boot index.
> >
> > Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
>
> Wouldn't this break the ability to say: "don't every try to boot from
> this device?"
>
> As an example, some people want to force PXE boot to not be tried on
> certain networks.
>
> Regards,
>
> Anthony Liguori
That is correct, hmm. The thing is, if we don't submit a bootindex, we will assign -1 in virtio-blk and virtio-net. This would forbid that the device would be booted from.
Where docs/bootindex.txt says: if a device got no bootindex, it gets the lowest possibly priority...
One way to fix this, would be to change the behaviour for virtio-blk and virtio-net, if there is no boot value assigned to, give it the possible highest number.
Would be this okay for you Anthony?
Dominik
> >
> > diff --git a/vl.c b/vl.c
> > index 6caa5f4..84d7031 100644
> > --- a/vl.c
> > +++ b/vl.c
> > @@ -248,7 +248,7 @@ struct FWBootEntry {
> > char *suffix;
> > };
> >
> > -static QTAILQ_HEAD(, FWBootEntry) fw_boot_order =
> > +static QTAILQ_HEAD(FWBootOrder, FWBootEntry) fw_boot_order =
> > QTAILQ_HEAD_INITIALIZER(fw_boot_order);
> >
> > int nb_numa_nodes;
> > @@ -1213,10 +1213,21 @@ void add_boot_device_path(int32_t bootindex, DeviceState *dev,
> > FWBootEntry *node, *i;
> >
> > if (bootindex < 0) {
> > - return;
> > + bootindex = INT32_MAX;
> > + if (!QTAILQ_EMPTY(&fw_boot_order) &&
> > + (QTAILQ_LAST(&fw_boot_order, FWBootOrder)->bootindex == INT32_MAX)) {
> > + /* there is a device at the end of the queue, so we need to walk
> > + the queue reverse to get the next free bootindex */
> > + QTAILQ_FOREACH_REVERSE(i, &fw_boot_order, FWBootOrder, link) {
> > + if (i->bootindex != bootindex) {
> > + break;
> > + }
> > + bootindex--;
> > + }
> > + }
> > }
> >
> > - assert(dev != NULL || suffix != NULL);
> > + assert(dev != NULL || suffix != NULL || bootindex >= 0);
> >
> > node = g_malloc0(sizeof(FWBootEntry));
> > node->bootindex = bootindex;
> > --
> > 1.7.9.5
>
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 01/10] Common: Add a default bootindex for all applicable devices
2013-04-26 18:01 ` Dominik Dingel
@ 2013-04-26 18:55 ` Anthony Liguori
2013-04-26 19:13 ` Gleb Natapov
2013-04-26 19:38 ` Christian Borntraeger
1 sibling, 1 reply; 52+ messages in thread
From: Anthony Liguori @ 2013-04-26 18:55 UTC (permalink / raw)
To: Dominik Dingel
Cc: Christian Borntraeger, qemu-devel, Gleb Natapov, Alexander Graf
Dominik Dingel <dingel@linux.vnet.ibm.com> writes:
> On Fri, 26 Apr 2013 11:36:11 -0500
> Anthony Liguori <anthony@codemonkey.ws> wrote:
>
>> Dominik Dingel <dingel@linux.vnet.ibm.com> writes:
>>
>> > Currently only devices with a positive boot index will be pushed in the
>> > fw_boot_order queue, so if no boot index at all will be specified,
>> > the queue ends up empty.
>> >
>> > Instead we push exactly as docs/bootindex.txt says the devices with
>> > the lowest possible boot priority at the tail of the queue,
>> > because we give them the highest available boot index.
>> >
>> > Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
>>
>> Wouldn't this break the ability to say: "don't every try to boot from
>> this device?"
>>
>> As an example, some people want to force PXE boot to not be tried on
>> certain networks.
>>
>> Regards,
>>
>> Anthony Liguori
>
> That is correct, hmm. The thing is, if we don't submit a bootindex, we
> will assign -1 in virtio-blk and virtio-net. This would forbid that
> the device would be booted from.
> Where docs/bootindex.txt says: if a device got no bootindex, it gets
> the lowest possibly priority...
>
> One way to fix this, would be to change the behaviour for virtio-blk
> and virtio-net, if there is no boot value assigned to, give it the
> possible highest number.
>
> Would be this okay for you Anthony?
CC'ing Gleb since he introduced bootindex.
The challenge here is we have two mechanisms on x86.
If there are no devices specified by boot index, then we follow the CMOS
bits that include "boot from first hard disk". The firmware can
enumerate hard disks on its own (including virtio-blk devices) and the
user can reorder this list within the firmware.
So we don't need to explicitly set bootindex on x86 to get the behavior
your trying to replicate on s390 (boot from first hard disk). We get it
through our CMOS fallback.
I think defaulting all bootable devices to something other than -1 (for
instance, UINT_MAX) would be okay provided that we used globals to use
the old behavior with older machine types.
Regards,
Anthony Liguori
>
> Dominik
>
>> >
>> > diff --git a/vl.c b/vl.c
>> > index 6caa5f4..84d7031 100644
>> > --- a/vl.c
>> > +++ b/vl.c
>> > @@ -248,7 +248,7 @@ struct FWBootEntry {
>> > char *suffix;
>> > };
>> >
>> > -static QTAILQ_HEAD(, FWBootEntry) fw_boot_order =
>> > +static QTAILQ_HEAD(FWBootOrder, FWBootEntry) fw_boot_order =
>> > QTAILQ_HEAD_INITIALIZER(fw_boot_order);
>> >
>> > int nb_numa_nodes;
>> > @@ -1213,10 +1213,21 @@ void add_boot_device_path(int32_t bootindex, DeviceState *dev,
>> > FWBootEntry *node, *i;
>> >
>> > if (bootindex < 0) {
>> > - return;
>> > + bootindex = INT32_MAX;
>> > + if (!QTAILQ_EMPTY(&fw_boot_order) &&
>> > + (QTAILQ_LAST(&fw_boot_order, FWBootOrder)->bootindex == INT32_MAX)) {
>> > + /* there is a device at the end of the queue, so we need to walk
>> > + the queue reverse to get the next free bootindex */
>> > + QTAILQ_FOREACH_REVERSE(i, &fw_boot_order, FWBootOrder, link) {
>> > + if (i->bootindex != bootindex) {
>> > + break;
>> > + }
>> > + bootindex--;
>> > + }
>> > + }
>> > }
>> >
>> > - assert(dev != NULL || suffix != NULL);
>> > + assert(dev != NULL || suffix != NULL || bootindex >= 0);
>> >
>> > node = g_malloc0(sizeof(FWBootEntry));
>> > node->bootindex = bootindex;
>> > --
>> > 1.7.9.5
>>
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 01/10] Common: Add a default bootindex for all applicable devices
2013-04-26 18:55 ` Anthony Liguori
@ 2013-04-26 19:13 ` Gleb Natapov
2013-04-26 21:34 ` Dominik Dingel
0 siblings, 1 reply; 52+ messages in thread
From: Gleb Natapov @ 2013-04-26 19:13 UTC (permalink / raw)
To: Anthony Liguori
Cc: Christian Borntraeger, qemu-devel, Dominik Dingel, Alexander Graf
On Fri, Apr 26, 2013 at 01:55:23PM -0500, Anthony Liguori wrote:
> Dominik Dingel <dingel@linux.vnet.ibm.com> writes:
>
> > On Fri, 26 Apr 2013 11:36:11 -0500
> > Anthony Liguori <anthony@codemonkey.ws> wrote:
> >
> >> Dominik Dingel <dingel@linux.vnet.ibm.com> writes:
> >>
> >> > Currently only devices with a positive boot index will be pushed in the
> >> > fw_boot_order queue, so if no boot index at all will be specified,
> >> > the queue ends up empty.
> >> >
> >> > Instead we push exactly as docs/bootindex.txt says the devices with
> >> > the lowest possible boot priority at the tail of the queue,
> >> > because we give them the highest available boot index.
> >> >
> >> > Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
> >>
> >> Wouldn't this break the ability to say: "don't every try to boot from
> >> this device?"
> >>
> >> As an example, some people want to force PXE boot to not be tried on
> >> certain networks.
> >>
> >> Regards,
> >>
> >> Anthony Liguori
> >
> > That is correct, hmm. The thing is, if we don't submit a bootindex, we
> > will assign -1 in virtio-blk and virtio-net. This would forbid that
> > the device would be booted from.
> > Where docs/bootindex.txt says: if a device got no bootindex, it gets
> > the lowest possibly priority...
> >
> > One way to fix this, would be to change the behaviour for virtio-blk
> > and virtio-net, if there is no boot value assigned to, give it the
> > possible highest number.
> >
> > Would be this okay for you Anthony?
>
> CC'ing Gleb since he introduced bootindex.
>
This will break "strict" boot option. It makes firmware boot only
from a device with specified boot priority.
What problem the patch is trying to fix?
> The challenge here is we have two mechanisms on x86.
>
> If there are no devices specified by boot index, then we follow the CMOS
> bits that include "boot from first hard disk". The firmware can
> enumerate hard disks on its own (including virtio-blk devices) and the
> user can reorder this list within the firmware.
>
> So we don't need to explicitly set bootindex on x86 to get the behavior
> your trying to replicate on s390 (boot from first hard disk). We get it
> through our CMOS fallback.
IIRC even if CMOS will not specify the boot order Seabios will use its
own defaults. Firmware enumerates bootable devices anyway and may have
its own logic to find the one to boot from. For instance the first
bootable device that is found.
>
> I think defaulting all bootable devices to something other than -1 (for
> instance, UINT_MAX) would be okay provided that we used globals to use
> the old behavior with older machine types.
>
> Regards,
>
> Anthony Liguori
>
> >
> > Dominik
> >
> >> >
> >> > diff --git a/vl.c b/vl.c
> >> > index 6caa5f4..84d7031 100644
> >> > --- a/vl.c
> >> > +++ b/vl.c
> >> > @@ -248,7 +248,7 @@ struct FWBootEntry {
> >> > char *suffix;
> >> > };
> >> >
> >> > -static QTAILQ_HEAD(, FWBootEntry) fw_boot_order =
> >> > +static QTAILQ_HEAD(FWBootOrder, FWBootEntry) fw_boot_order =
> >> > QTAILQ_HEAD_INITIALIZER(fw_boot_order);
> >> >
> >> > int nb_numa_nodes;
> >> > @@ -1213,10 +1213,21 @@ void add_boot_device_path(int32_t bootindex, DeviceState *dev,
> >> > FWBootEntry *node, *i;
> >> >
> >> > if (bootindex < 0) {
> >> > - return;
> >> > + bootindex = INT32_MAX;
> >> > + if (!QTAILQ_EMPTY(&fw_boot_order) &&
> >> > + (QTAILQ_LAST(&fw_boot_order, FWBootOrder)->bootindex == INT32_MAX)) {
> >> > + /* there is a device at the end of the queue, so we need to walk
> >> > + the queue reverse to get the next free bootindex */
> >> > + QTAILQ_FOREACH_REVERSE(i, &fw_boot_order, FWBootOrder, link) {
> >> > + if (i->bootindex != bootindex) {
> >> > + break;
> >> > + }
> >> > + bootindex--;
> >> > + }
> >> > + }
> >> > }
> >> >
> >> > - assert(dev != NULL || suffix != NULL);
> >> > + assert(dev != NULL || suffix != NULL || bootindex >= 0);
> >> >
> >> > node = g_malloc0(sizeof(FWBootEntry));
> >> > node->bootindex = bootindex;
> >> > --
> >> > 1.7.9.5
> >>
--
Gleb.
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 01/10] Common: Add a default bootindex for all applicable devices
2013-04-26 19:13 ` Gleb Natapov
@ 2013-04-26 21:34 ` Dominik Dingel
2013-04-27 5:44 ` Gleb Natapov
0 siblings, 1 reply; 52+ messages in thread
From: Dominik Dingel @ 2013-04-26 21:34 UTC (permalink / raw)
To: Gleb Natapov
Cc: Christian Borntraeger, qemu-devel, Anthony Liguori,
Alexander Graf
On Fri, 26 Apr 2013 22:13:14 +0300
Gleb Natapov <gleb@redhat.com> wrote:
> On Fri, Apr 26, 2013 at 01:55:23PM -0500, Anthony Liguori wrote:
> > Dominik Dingel <dingel@linux.vnet.ibm.com> writes:
> >
> > > On Fri, 26 Apr 2013 11:36:11 -0500
> > > Anthony Liguori <anthony@codemonkey.ws> wrote:
> > >
> > >> Dominik Dingel <dingel@linux.vnet.ibm.com> writes:
> > >>
> > >> > Currently only devices with a positive boot index will be pushed in the
> > >> > fw_boot_order queue, so if no boot index at all will be specified,
> > >> > the queue ends up empty.
> > >> >
> > >> > Instead we push exactly as docs/bootindex.txt says the devices with
> > >> > the lowest possible boot priority at the tail of the queue,
> > >> > because we give them the highest available boot index.
> > >> >
> > >> > Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
> > >>
> > >> Wouldn't this break the ability to say: "don't every try to boot from
> > >> this device?"
> > >>
> > >> As an example, some people want to force PXE boot to not be tried on
> > >> certain networks.
> > >>
> > >> Regards,
> > >>
> > >> Anthony Liguori
> > >
> > > That is correct, hmm. The thing is, if we don't submit a bootindex, we
> > > will assign -1 in virtio-blk and virtio-net. This would forbid that
> > > the device would be booted from.
> > > Where docs/bootindex.txt says: if a device got no bootindex, it gets
> > > the lowest possibly priority...
> > >
> > > One way to fix this, would be to change the behaviour for virtio-blk
> > > and virtio-net, if there is no boot value assigned to, give it the
> > > possible highest number.
> > >
> > > Would be this okay for you Anthony?
> >
> > CC'ing Gleb since he introduced bootindex.
> >
> This will break "strict" boot option. It makes firmware boot only
> from a device with specified boot priority.
>
> What problem the patch is trying to fix?
virtio-blk and virtio-net devices will be excluded from the boot order if they don't get a boot index on commandline, which is exactly the opposite of what docs/bootindex.txt describes.
> > The challenge here is we have two mechanisms on x86.
> >
> > If there are no devices specified by boot index, then we follow the CMOS
> > bits that include "boot from first hard disk". The firmware can
> > enumerate hard disks on its own (including virtio-blk devices) and the
> > user can reorder this list within the firmware.
> >
> > So we don't need to explicitly set bootindex on x86 to get the behavior
> > your trying to replicate on s390 (boot from first hard disk). We get it
> > through our CMOS fallback.
> IIRC even if CMOS will not specify the boot order Seabios will use its
> own defaults. Firmware enumerates bootable devices anyway and may have
> its own logic to find the one to boot from. For instance the first
> bootable device that is found.
But wouldn't that prevent any kind of boot protection for like pxe boot? If the network would be the first boot device?
Maybe someone should check if docs/bootindex.txt is up to date? With all the changes in the code flow.
If I see it correctly we have three cases for a boot device:
- boot index <= 0, should mean from 0 to x this is your position in the boot ordering
- boot index > 0, should mean don't you dare to try to boot from this device
- no boot index at all, the doc says: boot, but with no priority
code says: don't boot
Both ways are fine, but should be in sync. This is currently a complete focus on s390 as for x and p I'm not quite sure what the firmware can do after all happend.
Dominik
> >
> > I think defaulting all bootable devices to something other than -1 (for
> > instance, UINT_MAX) would be okay provided that we used globals to use
> > the old behavior with older machine types.
> >
> > Regards,
> >
> > Anthony Liguori
> >
> > >
> > > Dominik
> > >
> > >> >
> > >> > diff --git a/vl.c b/vl.c
> > >> > index 6caa5f4..84d7031 100644
> > >> > --- a/vl.c
> > >> > +++ b/vl.c
> > >> > @@ -248,7 +248,7 @@ struct FWBootEntry {
> > >> > char *suffix;
> > >> > };
> > >> >
> > >> > -static QTAILQ_HEAD(, FWBootEntry) fw_boot_order =
> > >> > +static QTAILQ_HEAD(FWBootOrder, FWBootEntry) fw_boot_order =
> > >> > QTAILQ_HEAD_INITIALIZER(fw_boot_order);
> > >> >
> > >> > int nb_numa_nodes;
> > >> > @@ -1213,10 +1213,21 @@ void add_boot_device_path(int32_t bootindex, DeviceState *dev,
> > >> > FWBootEntry *node, *i;
> > >> >
> > >> > if (bootindex < 0) {
> > >> > - return;
> > >> > + bootindex = INT32_MAX;
> > >> > + if (!QTAILQ_EMPTY(&fw_boot_order) &&
> > >> > + (QTAILQ_LAST(&fw_boot_order, FWBootOrder)->bootindex == INT32_MAX)) {
> > >> > + /* there is a device at the end of the queue, so we need to walk
> > >> > + the queue reverse to get the next free bootindex */
> > >> > + QTAILQ_FOREACH_REVERSE(i, &fw_boot_order, FWBootOrder, link) {
> > >> > + if (i->bootindex != bootindex) {
> > >> > + break;
> > >> > + }
> > >> > + bootindex--;
> > >> > + }
> > >> > + }
> > >> > }
> > >> >
> > >> > - assert(dev != NULL || suffix != NULL);
> > >> > + assert(dev != NULL || suffix != NULL || bootindex >= 0);
> > >> >
> > >> > node = g_malloc0(sizeof(FWBootEntry));
> > >> > node->bootindex = bootindex;
> > >> > --
> > >> > 1.7.9.5
> > >>
>
> --
> Gleb.
>
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 01/10] Common: Add a default bootindex for all applicable devices
2013-04-26 21:34 ` Dominik Dingel
@ 2013-04-27 5:44 ` Gleb Natapov
0 siblings, 0 replies; 52+ messages in thread
From: Gleb Natapov @ 2013-04-27 5:44 UTC (permalink / raw)
To: Dominik Dingel
Cc: Christian Borntraeger, qemu-devel, Anthony Liguori,
Alexander Graf
On Fri, Apr 26, 2013 at 11:34:24PM +0200, Dominik Dingel wrote:
> On Fri, 26 Apr 2013 22:13:14 +0300
> Gleb Natapov <gleb@redhat.com> wrote:
>
> > On Fri, Apr 26, 2013 at 01:55:23PM -0500, Anthony Liguori wrote:
> > > Dominik Dingel <dingel@linux.vnet.ibm.com> writes:
> > >
> > > > On Fri, 26 Apr 2013 11:36:11 -0500
> > > > Anthony Liguori <anthony@codemonkey.ws> wrote:
> > > >
> > > >> Dominik Dingel <dingel@linux.vnet.ibm.com> writes:
> > > >>
> > > >> > Currently only devices with a positive boot index will be pushed in the
> > > >> > fw_boot_order queue, so if no boot index at all will be specified,
> > > >> > the queue ends up empty.
> > > >> >
> > > >> > Instead we push exactly as docs/bootindex.txt says the devices with
> > > >> > the lowest possible boot priority at the tail of the queue,
> > > >> > because we give them the highest available boot index.
> > > >> >
> > > >> > Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
> > > >>
> > > >> Wouldn't this break the ability to say: "don't every try to boot from
> > > >> this device?"
> > > >>
> > > >> As an example, some people want to force PXE boot to not be tried on
> > > >> certain networks.
> > > >>
> > > >> Regards,
> > > >>
> > > >> Anthony Liguori
> > > >
> > > > That is correct, hmm. The thing is, if we don't submit a bootindex, we
> > > > will assign -1 in virtio-blk and virtio-net. This would forbid that
> > > > the device would be booted from.
> > > > Where docs/bootindex.txt says: if a device got no bootindex, it gets
> > > > the lowest possibly priority...
> > > >
> > > > One way to fix this, would be to change the behaviour for virtio-blk
> > > > and virtio-net, if there is no boot value assigned to, give it the
> > > > possible highest number.
> > > >
> > > > Would be this okay for you Anthony?
> > >
> > > CC'ing Gleb since he introduced bootindex.
> > >
> > This will break "strict" boot option. It makes firmware boot only
> > from a device with specified boot priority.
> >
> > What problem the patch is trying to fix?
>
> virtio-blk and virtio-net devices will be excluded from the boot order if they don't get a boot index on commandline, which is exactly the opposite of what docs/bootindex.txt describes.
>
That is up to firmware whether to exclude something from boot order or
not is "strict" boot option is not set. If "strict" is used excluding
devices without bootindex is a desirable behaviour. If docs/bootindex.txt
does not makes it clear (and I agree, it does not) it should be fixed.
> > > The challenge here is we have two mechanisms on x86.
> > >
> > > If there are no devices specified by boot index, then we follow the CMOS
> > > bits that include "boot from first hard disk". The firmware can
> > > enumerate hard disks on its own (including virtio-blk devices) and the
> > > user can reorder this list within the firmware.
> > >
> > > So we don't need to explicitly set bootindex on x86 to get the behavior
> > > your trying to replicate on s390 (boot from first hard disk). We get it
> > > through our CMOS fallback.
> > IIRC even if CMOS will not specify the boot order Seabios will use its
> > own defaults. Firmware enumerates bootable devices anyway and may have
> > its own logic to find the one to boot from. For instance the first
> > bootable device that is found.
>
> But wouldn't that prevent any kind of boot protection for like pxe boot? If the network would be the first boot device?
>
You can implement whatever logic you like. Seabios default boot order is floppy,cdrom,disk,net.
> Maybe someone should check if docs/bootindex.txt is up to date? With all the changes in the code flow.
Definitely.
>
> If I see it correctly we have three cases for a boot device:
> - boot index <= 0, should mean from 0 to x this is your position in the boot ordering
> - boot index > 0, should mean don't you dare to try to boot from this device
>
> - no boot index at all, the doc says: boot, but with no priority
> code says: don't boot
>
No. This is not how it is now.
All devices with non negative bootindex are tries first in order of
bootindex. If strict option is specified boot process stops here, otherwise
firmware tries to boot from remaining bootable devices in whatever order
firmware deems best.
> Both ways are fine, but should be in sync. This is currently a complete focus on s390 as for x and p I'm not quite sure what the firmware can do after all happend.
>
> Dominik
>
> > >
> > > I think defaulting all bootable devices to something other than -1 (for
> > > instance, UINT_MAX) would be okay provided that we used globals to use
> > > the old behavior with older machine types.
> > >
> > > Regards,
> > >
> > > Anthony Liguori
> > >
> > > >
> > > > Dominik
> > > >
> > > >> >
> > > >> > diff --git a/vl.c b/vl.c
> > > >> > index 6caa5f4..84d7031 100644
> > > >> > --- a/vl.c
> > > >> > +++ b/vl.c
> > > >> > @@ -248,7 +248,7 @@ struct FWBootEntry {
> > > >> > char *suffix;
> > > >> > };
> > > >> >
> > > >> > -static QTAILQ_HEAD(, FWBootEntry) fw_boot_order =
> > > >> > +static QTAILQ_HEAD(FWBootOrder, FWBootEntry) fw_boot_order =
> > > >> > QTAILQ_HEAD_INITIALIZER(fw_boot_order);
> > > >> >
> > > >> > int nb_numa_nodes;
> > > >> > @@ -1213,10 +1213,21 @@ void add_boot_device_path(int32_t bootindex, DeviceState *dev,
> > > >> > FWBootEntry *node, *i;
> > > >> >
> > > >> > if (bootindex < 0) {
> > > >> > - return;
> > > >> > + bootindex = INT32_MAX;
> > > >> > + if (!QTAILQ_EMPTY(&fw_boot_order) &&
> > > >> > + (QTAILQ_LAST(&fw_boot_order, FWBootOrder)->bootindex == INT32_MAX)) {
> > > >> > + /* there is a device at the end of the queue, so we need to walk
> > > >> > + the queue reverse to get the next free bootindex */
> > > >> > + QTAILQ_FOREACH_REVERSE(i, &fw_boot_order, FWBootOrder, link) {
> > > >> > + if (i->bootindex != bootindex) {
> > > >> > + break;
> > > >> > + }
> > > >> > + bootindex--;
> > > >> > + }
> > > >> > + }
> > > >> > }
> > > >> >
> > > >> > - assert(dev != NULL || suffix != NULL);
> > > >> > + assert(dev != NULL || suffix != NULL || bootindex >= 0);
> > > >> >
> > > >> > node = g_malloc0(sizeof(FWBootEntry));
> > > >> > node->bootindex = bootindex;
> > > >> > --
> > > >> > 1.7.9.5
> > > >>
> >
> > --
> > Gleb.
> >
--
Gleb.
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 01/10] Common: Add a default bootindex for all applicable devices
2013-04-26 18:01 ` Dominik Dingel
2013-04-26 18:55 ` Anthony Liguori
@ 2013-04-26 19:38 ` Christian Borntraeger
1 sibling, 0 replies; 52+ messages in thread
From: Christian Borntraeger @ 2013-04-26 19:38 UTC (permalink / raw)
To: Dominik Dingel; +Cc: qemu-devel, Anthony Liguori, Alexander Graf
On 26/04/13 20:01, Dominik Dingel wrote:
> On Fri, 26 Apr 2013 11:36:11 -0500
> Anthony Liguori <anthony@codemonkey.ws> wrote:
>
>> Dominik Dingel <dingel@linux.vnet.ibm.com> writes:
>>
>>> Currently only devices with a positive boot index will be pushed in the
>>> fw_boot_order queue, so if no boot index at all will be specified,
>>> the queue ends up empty.
>>>
>>> Instead we push exactly as docs/bootindex.txt says the devices with
>>> the lowest possible boot priority at the tail of the queue,
>>> because we give them the highest available boot index.
>>>
>>> Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
>>
>> Wouldn't this break the ability to say: "don't every try to boot from
>> this device?"
>>
>> As an example, some people want to force PXE boot to not be tried on
>> certain networks.
>>
>> Regards,
>>
>> Anthony Liguori
>
> That is correct, hmm. The thing is, if we don't submit a bootindex, we will assign -1 in virtio-blk and virtio-net. This would forbid that the device would be booted from.
> Where docs/bootindex.txt says: if a device got no bootindex, it gets the lowest possibly priority...
Hmm, reading all this, I changed my mind :-)
I think we should just leave out patch 1 for now. Anthony brought up a
valid point, we want to be able to specify for a device "never boot from it".
>From an s390 point of view, it would even make sense to say
"If the user does not provide a boot index, then the system wont boot.
We leave the system in stopped state." Predictability is more important
than clever guessing in this environment.
Christian
^ permalink raw reply [flat|nested] 52+ messages in thread
* [Qemu-devel] [PATCH 02/10] Common: Add quick access to first boot device
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 12:12 ` 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
` (8 subsequent siblings)
10 siblings, 1 reply; 52+ messages in thread
From: Dominik Dingel @ 2013-04-26 12:12 UTC (permalink / raw)
To: qemu-devel; +Cc: Christian Borntraeger, Alexander Graf, Dominik Dingel
Instead of manually parsing the boot_list as character stream,
we can access the nth boot device, specified by the position in the
boot order.
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 6578782..43b961c 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -181,6 +181,8 @@ void add_boot_device_path(int32_t bootindex, DeviceState *dev,
const char *suffix);
char *get_boot_devices_list(size_t *size);
+DeviceState *get_boot_device(uint32_t position);
+
bool usb_enabled(bool default_usb);
extern QemuOptsList qemu_drive_opts;
diff --git a/vl.c b/vl.c
index 84d7031..429e6ea 100644
--- a/vl.c
+++ b/vl.c
@@ -1247,6 +1247,24 @@ void add_boot_device_path(int32_t bootindex, DeviceState *dev,
QTAILQ_INSERT_TAIL(&fw_boot_order, node, link);
}
+DeviceState *get_boot_device(uint32_t position)
+{
+ uint32_t counter = 0;
+ FWBootEntry *i = NULL;
+ DeviceState *res = NULL;
+
+ if (!QTAILQ_EMPTY(&fw_boot_order)) {
+ QTAILQ_FOREACH(i, &fw_boot_order, link) {
+ if (counter == position) {
+ res = i->dev;
+ break;
+ }
+ counter++;
+ }
+ }
+ return res;
+}
+
/*
* This function returns null terminated string that consist of new line
* separated device paths.
--
1.7.9.5
^ permalink raw reply related [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 02/10] Common: Add quick access to first boot device
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
0 siblings, 0 replies; 52+ messages in thread
From: Anthony Liguori @ 2013-04-26 16:37 UTC (permalink / raw)
To: Dominik Dingel, qemu-devel; +Cc: Christian Borntraeger, Alexander Graf
Dominik Dingel <dingel@linux.vnet.ibm.com> writes:
> Instead of manually parsing the boot_list as character stream,
> we can access the nth boot device, specified by the position in the
> boot order.
>
> Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Regards,
Anthony Liguori
> diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
> index 6578782..43b961c 100644
> --- a/include/sysemu/sysemu.h
> +++ b/include/sysemu/sysemu.h
> @@ -181,6 +181,8 @@ void add_boot_device_path(int32_t bootindex, DeviceState *dev,
> const char *suffix);
> char *get_boot_devices_list(size_t *size);
>
> +DeviceState *get_boot_device(uint32_t position);
> +
> bool usb_enabled(bool default_usb);
>
> extern QemuOptsList qemu_drive_opts;
> diff --git a/vl.c b/vl.c
> index 84d7031..429e6ea 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -1247,6 +1247,24 @@ void add_boot_device_path(int32_t bootindex, DeviceState *dev,
> QTAILQ_INSERT_TAIL(&fw_boot_order, node, link);
> }
>
> +DeviceState *get_boot_device(uint32_t position)
> +{
> + uint32_t counter = 0;
> + FWBootEntry *i = NULL;
> + DeviceState *res = NULL;
> +
> + if (!QTAILQ_EMPTY(&fw_boot_order)) {
> + QTAILQ_FOREACH(i, &fw_boot_order, link) {
> + if (counter == position) {
> + res = i->dev;
> + break;
> + }
> + counter++;
> + }
> + }
> + return res;
> +}
> +
> /*
> * This function returns null terminated string that consist of new line
> * separated device paths.
> --
> 1.7.9.5
^ permalink raw reply [flat|nested] 52+ messages in thread
* [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type
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 12:12 ` [Qemu-devel] [PATCH 02/10] Common: Add quick access to first boot device Dominik Dingel
@ 2013-04-26 12:12 ` Dominik Dingel
2013-04-26 15:22 ` 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
` (7 subsequent siblings)
10 siblings, 2 replies; 52+ messages in thread
From: Dominik Dingel @ 2013-04-26 12:12 UTC (permalink / raw)
To: qemu-devel
Cc: Christian Paro, Christian Borntraeger, Alexander Graf,
Dominik Dingel
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]
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
^ permalink raw reply related [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type
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
2013-04-26 16:50 ` Alexander Graf
1 sibling, 2 replies; 52+ messages in thread
From: Alexander Graf @ 2013-04-26 15:22 UTC (permalink / raw)
To: Dominik Dingel; +Cc: Christian Paro, Christian Borntraeger, qemu-devel
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
>
> 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
>
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type
2013-04-26 15:22 ` Alexander Graf
@ 2013-04-26 15:36 ` Dominik Dingel
2013-04-26 15:42 ` Christian Borntraeger
1 sibling, 0 replies; 52+ messages in thread
From: Dominik Dingel @ 2013-04-26 15:36 UTC (permalink / raw)
To: Alexander Graf; +Cc: Christian Paro, Christian Borntraeger, qemu-devel
On Fri, 26 Apr 2013 17:22:08 +0200
Alexander Graf <agraf@suse.de> 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
The current changes allow us to boot what we want (device and boot program selection).
Later on we can think of fallback handling.
I'm currently thinking about something like a hypercall to communicate to the host that we can not boot from the supplied device.
Then the host could decide based on a policy if it tries the next device or stops or something like that.
But that is a change we should discuss.
Dominik
>
> >
> > 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
> >
>
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type
2013-04-26 15:22 ` Alexander Graf
2013-04-26 15:36 ` Dominik Dingel
@ 2013-04-26 15:42 ` Christian Borntraeger
2013-04-26 15:48 ` Alexander Graf
1 sibling, 1 reply; 52+ messages in thread
From: Christian Borntraeger @ 2013-04-26 15:42 UTC (permalink / raw)
To: Alexander Graf; +Cc: Christian Paro, qemu-devel, Dominik Dingel
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
>>
>
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type
2013-04-26 15:42 ` Christian Borntraeger
@ 2013-04-26 15:48 ` Alexander Graf
2013-04-26 16:01 ` Christian Borntraeger
2013-04-26 16:04 ` Dominik Dingel
0 siblings, 2 replies; 52+ messages in thread
From: Alexander Graf @ 2013-04-26 15:48 UTC (permalink / raw)
To: Christian Borntraeger; +Cc: Christian Paro, qemu-devel, Dominik Dingel
On 26.04.2013, at 17:42, Christian Borntraeger wrote:
> 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?
I don't see how having "first device we find" is any better than a rushed interface we need to agree on right before 1.5 hard freeze. Let's just release 1.5 with the very simple one and then go for something awesome in the next version.
Alex
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type
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:04 ` Dominik Dingel
1 sibling, 1 reply; 52+ messages in thread
From: Christian Borntraeger @ 2013-04-26 16:01 UTC (permalink / raw)
To: Alexander Graf; +Cc: Christian Paro, qemu-devel, Dominik Dingel
On 26/04/13 17:48, Alexander Graf wrote:
>> So I suggest to go with this patch and implement later on what we
>> agree upon?
>
> I don't see how having "first device we find" is any better than a
> rushed interface we need to agree on right before 1.5 hard freeze.
Exactly, find first device isnt better ;-)
See, the current code chooses the first subchannel that matches. This
boils down to "a random disk" as soon as you have more than one.
With this patch the user can at least specify the devno of the disk.It
even works out of the box with libvirt.
Let's just release 1.5 with the very simple one and then go for something
awesome in the next version.
Exactly - and having a list is more in the awesome area. Beiing able to
specify the first disk and pass that in a register to the bios is of
course not a full-features interface, but it works and can be changed.
Just to double check: do you agree that we can change the interface between
ipl device and bios at any time?
Christian
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type
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:11 ` Christian Borntraeger
0 siblings, 2 replies; 52+ messages in thread
From: Alexander Graf @ 2013-04-26 16:05 UTC (permalink / raw)
To: Christian Borntraeger; +Cc: Christian Paro, qemu-devel, Dominik Dingel
On 26.04.2013, at 18:01, Christian Borntraeger wrote:
> On 26/04/13 17:48, Alexander Graf wrote:
>
>>> So I suggest to go with this patch and implement later on what we
>>> agree upon?
>>
>> I don't see how having "first device we find" is any better than a
>> rushed interface we need to agree on right before 1.5 hard freeze.
>
> Exactly, find first device isnt better ;-)
> See, the current code chooses the first subchannel that matches. This
> boils down to "a random disk" as soon as you have more than one.
>
> With this patch the user can at least specify the devno of the disk.It
> even works out of the box with libvirt.
>
> Let's just release 1.5 with the very simple one and then go for something
> awesome in the next version.
>
> Exactly - and having a list is more in the awesome area. Beiing able to
> specify the first disk and pass that in a register to the bios is of
> course not a full-features interface, but it works and can be changed.
My main concern is backwards compatibility. If we introduce a command line interface now, we have to support it forever. I'd rather only support one interface, rather than 2 out of which one is only legacy for 1.5 compatibility.
> Just to double check: do you agree that we can change the interface between
> ipl device and bios at any time?
I think that's a fair thing to do, though I wouldn't encourage it.
Alex
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type
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
1 sibling, 1 reply; 52+ messages in thread
From: Dominik Dingel @ 2013-04-26 16:10 UTC (permalink / raw)
To: Alexander Graf; +Cc: Christian Paro, Christian Borntraeger, qemu-devel
On Fri, 26 Apr 2013 18:05:02 +0200
Alexander Graf <agraf@suse.de> wrote:
>
> On 26.04.2013, at 18:01, Christian Borntraeger wrote:
>
> > On 26/04/13 17:48, Alexander Graf wrote:
> >
> >>> So I suggest to go with this patch and implement later on what we
> >>> agree upon?
> >>
> >> I don't see how having "first device we find" is any better than a
> >> rushed interface we need to agree on right before 1.5 hard freeze.
> >
> > Exactly, find first device isnt better ;-)
> > See, the current code chooses the first subchannel that matches. This
> > boils down to "a random disk" as soon as you have more than one.
> >
> > With this patch the user can at least specify the devno of the disk.It
> > even works out of the box with libvirt.
> >
> > Let's just release 1.5 with the very simple one and then go for something
> > awesome in the next version.
> >
> > Exactly - and having a list is more in the awesome area. Beiing able to
> > specify the first disk and pass that in a register to the bios is of
> > course not a full-features interface, but it works and can be changed.
>
> My main concern is backwards compatibility. If we introduce a command line interface now, we have to support it forever. I'd rather only support one interface, rather than 2 out of which one is only legacy for 1.5 compatibility.
We only enable, don't introduce the existing command line interface for bootindex. The loadparm thing is already kind of list, as the loadparm is stored with every device.
But as I wrote in the cover letter, we also could just for the start only implement the bootindex.
>
> > Just to double check: do you agree that we can change the interface between
> > ipl device and bios at any time?
>
> I think that's a fair thing to do, though I wouldn't encourage it.
>
>
> Alex
>
Dominik
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type
2013-04-26 16:10 ` Dominik Dingel
@ 2013-04-26 16:13 ` Alexander Graf
0 siblings, 0 replies; 52+ messages in thread
From: Alexander Graf @ 2013-04-26 16:13 UTC (permalink / raw)
To: Dominik Dingel; +Cc: Christian Paro, Christian Borntraeger, qemu-devel
On 26.04.2013, at 18:10, Dominik Dingel wrote:
> On Fri, 26 Apr 2013 18:05:02 +0200
> Alexander Graf <agraf@suse.de> wrote:
>
>>
>> On 26.04.2013, at 18:01, Christian Borntraeger wrote:
>>
>>> On 26/04/13 17:48, Alexander Graf wrote:
>>>
>>>>> So I suggest to go with this patch and implement later on what we
>>>>> agree upon?
>>>>
>>>> I don't see how having "first device we find" is any better than a
>>>> rushed interface we need to agree on right before 1.5 hard freeze.
>>>
>>> Exactly, find first device isnt better ;-)
>>> See, the current code chooses the first subchannel that matches. This
>>> boils down to "a random disk" as soon as you have more than one.
>>>
>>> With this patch the user can at least specify the devno of the disk.It
>>> even works out of the box with libvirt.
>>>
>>> Let's just release 1.5 with the very simple one and then go for something
>>> awesome in the next version.
>>>
>>> Exactly - and having a list is more in the awesome area. Beiing able to
>>> specify the first disk and pass that in a register to the bios is of
>>> course not a full-features interface, but it works and can be changed.
>>
>> My main concern is backwards compatibility. If we introduce a command line interface now, we have to support it forever. I'd rather only support one interface, rather than 2 out of which one is only legacy for 1.5 compatibility.
>
> We only enable, don't introduce the existing command line interface for bootindex. The loadparm thing is already kind of list, as the loadparm is stored with every device.
> But as I wrote in the cover letter, we also could just for the start only implement the bootindex.
The bootindex is the part that I'm reluctant about. I think it's the right way forward, but it touches generic code and generic infrastructure a few days before hard freeze. I don't think it's important enough to justify this.
Alex
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type
2013-04-26 16:05 ` Alexander Graf
2013-04-26 16:10 ` Dominik Dingel
@ 2013-04-26 16:11 ` Christian Borntraeger
2013-04-26 16:13 ` Alexander Graf
1 sibling, 1 reply; 52+ messages in thread
From: Christian Borntraeger @ 2013-04-26 16:11 UTC (permalink / raw)
To: Alexander Graf; +Cc: Christian Paro, qemu-devel, Dominik Dingel
On 26/04/13 18:05, Alexander Graf wrote:
>
> On 26.04.2013, at 18:01, Christian Borntraeger wrote:
>
>> On 26/04/13 17:48, Alexander Graf wrote:
>>
>>>> So I suggest to go with this patch and implement later on what we
>>>> agree upon?
>>>
>>> I don't see how having "first device we find" is any better than a
>>> rushed interface we need to agree on right before 1.5 hard freeze.
>>
>> Exactly, find first device isnt better ;-)
>> See, the current code chooses the first subchannel that matches. This
>> boils down to "a random disk" as soon as you have more than one.
>>
>> With this patch the user can at least specify the devno of the disk.It
>> even works out of the box with libvirt.
>>
>> Let's just release 1.5 with the very simple one and then go for something
>> awesome in the next version.
>>
>> Exactly - and having a list is more in the awesome area. Beiing able to
>> specify the first disk and pass that in a register to the bios is of
>> course not a full-features interface, but it works and can be changed.
>
> My main concern is backwards compatibility. If we introduce a command line
> interface now, we have to support it forever. I'd rather only support one
> interface, rather than 2 out of which one is only legacy for 1.5 compatibility.
The cool thing is, that we dont introduce a command line interface in this patch.
We just use the existing bootindex.
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type
2013-04-26 16:11 ` Christian Borntraeger
@ 2013-04-26 16:13 ` Alexander Graf
2013-04-26 16:45 ` Anthony Liguori
0 siblings, 1 reply; 52+ messages in thread
From: Alexander Graf @ 2013-04-26 16:13 UTC (permalink / raw)
To: Christian Borntraeger; +Cc: Christian Paro, qemu-devel, Dominik Dingel
On 26.04.2013, at 18:11, Christian Borntraeger wrote:
> On 26/04/13 18:05, Alexander Graf wrote:
>>
>> On 26.04.2013, at 18:01, Christian Borntraeger wrote:
>>
>>> On 26/04/13 17:48, Alexander Graf wrote:
>>>
>>>>> So I suggest to go with this patch and implement later on what we
>>>>> agree upon?
>>>>
>>>> I don't see how having "first device we find" is any better than a
>>>> rushed interface we need to agree on right before 1.5 hard freeze.
>>>
>>> Exactly, find first device isnt better ;-)
>>> See, the current code chooses the first subchannel that matches. This
>>> boils down to "a random disk" as soon as you have more than one.
>>>
>>> With this patch the user can at least specify the devno of the disk.It
>>> even works out of the box with libvirt.
>>>
>>> Let's just release 1.5 with the very simple one and then go for something
>>> awesome in the next version.
>>>
>>> Exactly - and having a list is more in the awesome area. Beiing able to
>>> specify the first disk and pass that in a register to the bios is of
>>> course not a full-features interface, but it works and can be changed.
>>
>> My main concern is backwards compatibility. If we introduce a command line
>> interface now, we have to support it forever. I'd rather only support one
>> interface, rather than 2 out of which one is only legacy for 1.5 compatibility.
>
> The cool thing is, that we dont introduce a command line interface in this patch.
> We just use the existing bootindex.
Get an ack from Anthony on the bootindex thing and I'm fine with pulling that in.
Alex
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type
2013-04-26 16:13 ` Alexander Graf
@ 2013-04-26 16:45 ` Anthony Liguori
0 siblings, 0 replies; 52+ messages in thread
From: Anthony Liguori @ 2013-04-26 16:45 UTC (permalink / raw)
To: Alexander Graf, Christian Borntraeger
Cc: Christian Paro, qemu-devel, Dominik Dingel
Alexander Graf <agraf@suse.de> writes:
> On 26.04.2013, at 18:11, Christian Borntraeger wrote:
>
>> On 26/04/13 18:05, Alexander Graf wrote:
>>>
>>> On 26.04.2013, at 18:01, Christian Borntraeger wrote:
>>>
>>>> On 26/04/13 17:48, Alexander Graf wrote:
>>>>
>>>>>> So I suggest to go with this patch and implement later on what we
>>>>>> agree upon?
>>>>>
>>>>> I don't see how having "first device we find" is any better than a
>>>>> rushed interface we need to agree on right before 1.5 hard freeze.
>>>>
>>>> Exactly, find first device isnt better ;-)
>>>> See, the current code chooses the first subchannel that matches. This
>>>> boils down to "a random disk" as soon as you have more than one.
>>>>
>>>> With this patch the user can at least specify the devno of the disk.It
>>>> even works out of the box with libvirt.
>>>>
>>>> Let's just release 1.5 with the very simple one and then go for something
>>>> awesome in the next version.
>>>>
>>>> Exactly - and having a list is more in the awesome area. Beiing able to
>>>> specify the first disk and pass that in a register to the bios is of
>>>> course not a full-features interface, but it works and can be changed.
>>>
>>> My main concern is backwards compatibility. If we introduce a command line
>>> interface now, we have to support it forever. I'd rather only support one
>>> interface, rather than 2 out of which one is only legacy for 1.5 compatibility.
>>
>> The cool thing is, that we dont introduce a command line interface in this patch.
>> We just use the existing bootindex.
>
> Get an ack from Anthony on the bootindex thing and I'm fine with
> pulling that in.
So I don't see a problem with the no-fallback behavior (nor with it
changing down the road), but the bootindex change would cause a
regression on x86.
Regards,
Anthony Liguori
>
>
> Alex
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type
2013-04-26 15:48 ` Alexander Graf
2013-04-26 16:01 ` Christian Borntraeger
@ 2013-04-26 16:04 ` Dominik Dingel
2013-04-26 16:07 ` Alexander Graf
1 sibling, 1 reply; 52+ messages in thread
From: Dominik Dingel @ 2013-04-26 16:04 UTC (permalink / raw)
To: Alexander Graf; +Cc: Christian Paro, Christian Borntraeger, qemu-devel
On Fri, 26 Apr 2013 17:48:37 +0200
Alexander Graf <agraf@suse.de> wrote:
>
> On 26.04.2013, at 17:42, Christian Borntraeger wrote:
>
> > 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?
>
> I don't see how having "first device we find" is any better than a rushed interface we need to agree on right before 1.5 hard freeze. Let's just release 1.5 with the very simple one and then go for something awesome in the next version.
>
>
> Alex
Okay, I like more the evolution over the revolution kind of approach. So this patchset does include a few improvements over the :"boot the first blk device we see" system.
We can specify explicitly with the boot index the device to boot and with loadparm even the boot entry.
And I also see it like Christian that this is not really an interface, as it should be never exposed to the outside. We only enable the outside to use boot index, which is clearly stated in docs/bootindex.txt and in a later addition we will enable fallbacks.
Dominik
Dominik
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type
2013-04-26 16:04 ` Dominik Dingel
@ 2013-04-26 16:07 ` Alexander Graf
0 siblings, 0 replies; 52+ messages in thread
From: Alexander Graf @ 2013-04-26 16:07 UTC (permalink / raw)
To: Dominik Dingel; +Cc: Christian Paro, Christian Borntraeger, qemu-devel
On 26.04.2013, at 18:04, Dominik Dingel wrote:
> On Fri, 26 Apr 2013 17:48:37 +0200
> Alexander Graf <agraf@suse.de> wrote:
>
>>
>> On 26.04.2013, at 17:42, Christian Borntraeger wrote:
>>
>>> 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?
>>
>> I don't see how having "first device we find" is any better than a rushed interface we need to agree on right before 1.5 hard freeze. Let's just release 1.5 with the very simple one and then go for something awesome in the next version.
>>
>>
>> Alex
>
> Okay, I like more the evolution over the revolution kind of approach. So this patchset does include a few improvements over the :"boot the first blk device we see" system.
> We can specify explicitly with the boot index the device to boot and with loadparm even the boot entry.
>
> And I also see it like Christian that this is not really an interface, as it should be never exposed to the outside. We only enable the outside to use boot index, which is clearly stated in docs/bootindex.txt and in a later addition we will enable fallbacks.
Is there any particular reason this can't wait a few weeks, go in early in the 1.6 development cycle and then we see where it carries us?
Alex
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type
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 16:50 ` Alexander Graf
1 sibling, 0 replies; 52+ messages in thread
From: Alexander Graf @ 2013-04-26 16:50 UTC (permalink / raw)
To: Dominik Dingel; +Cc: Christian Paro, Christian Borntraeger, qemu-devel
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]
>
> 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);
The kernel/bootloader split is too high level. Please reuse more code. The flow should be something like
if (ipl_from_disk) {
regs[7] = devno;
}
env->psw.addr = pswaddr;
mask = IPL_PSW_MASK;
add_running_cpu();
Whether you split any of these into functions is your thing, but I don't want to have the PSW reset logic duplicated.
Alex
> + }
> +
> + 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
>
^ permalink raw reply [flat|nested] 52+ messages in thread
* [Qemu-devel] [PATCH 04/10] S390: check if BIOS is available and create links
2013-04-26 12:12 [Qemu-devel] [PATCH 00/10] S390: Enhance s390 BIOS to enable bootdevice selection Dominik Dingel
` (2 preceding siblings ...)
2013-04-26 12:12 ` [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type Dominik Dingel
@ 2013-04-26 12:12 ` Dominik Dingel
2013-04-26 15:23 ` Alexander Graf
2013-04-26 12:12 ` [Qemu-devel] [PATCH 05/10] s390-ccw.img: Detect devices with stsch Dominik Dingel
` (6 subsequent siblings)
10 siblings, 1 reply; 52+ messages in thread
From: Dominik Dingel @ 2013-04-26 12:12 UTC (permalink / raw)
To: qemu-devel; +Cc: Christian Borntraeger, Alexander Graf, Dominik Dingel
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
Check if the BIOS is available before loading it into the memory.
Create the needed Links for build.
Add a if the BIOS is available, also add the needed links for the build
process.
diff --git a/configure b/configure
index 19777de..2bbbd54 100755
--- a/configure
+++ b/configure
@@ -4541,6 +4541,7 @@ for bios_file in \
$source_path/pc-bios/*.aml \
$source_path/pc-bios/*.rom \
$source_path/pc-bios/*.dtb \
+ $source_path/pc-bios/*.img \
$source_path/pc-bios/openbios-* \
$source_path/pc-bios/palcode-*
do
diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
index 9758529..36daa67 100644
--- a/hw/s390x/ipl.c
+++ b/hw/s390x/ipl.c
@@ -95,6 +95,10 @@ static int s390_ipl_init(SysBusDevice *dev)
}
bios_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
+ if (bios_filename == NULL) {
+ hw_error("could not find stage1 bootloader\n");
+ }
+
bios_size = load_elf(bios_filename, NULL, NULL, &ipl->start_addr, NULL,
NULL, 1, ELF_MACHINE, 0);
if (bios_size == -1UL) {
diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile
index ad55a14..1e6ab1e 100644
--- a/pc-bios/s390-ccw/Makefile
+++ b/pc-bios/s390-ccw/Makefile
@@ -21,6 +21,7 @@ s390-ccw.elf: $(OBJECTS)
s390-ccw.img: s390-ccw.elf
$(call quiet-command,strip $< -o $@," Stripping $(TARGET_DIR)$@")
+ ln -s -f `pwd`/$@ ../$@
clean:
rm -f *.o *.d *.img *.elf *~
--
1.7.9.5
^ permalink raw reply related [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 04/10] S390: check if BIOS is available and create links
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
0 siblings, 1 reply; 52+ messages in thread
From: Alexander Graf @ 2013-04-26 15:23 UTC (permalink / raw)
To: Dominik Dingel; +Cc: Christian Borntraeger, qemu-devel
On 26.04.2013, at 14:12, Dominik Dingel wrote:
> Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
>
> Check if the BIOS is available before loading it into the memory.
> Create the needed Links for build.
>
> Add a if the BIOS is available, also add the needed links for the build
> process.
>
> diff --git a/configure b/configure
> index 19777de..2bbbd54 100755
> --- a/configure
> +++ b/configure
> @@ -4541,6 +4541,7 @@ for bios_file in \
> $source_path/pc-bios/*.aml \
> $source_path/pc-bios/*.rom \
> $source_path/pc-bios/*.dtb \
> + $source_path/pc-bios/*.img \
> $source_path/pc-bios/openbios-* \
> $source_path/pc-bios/palcode-*
> do
> diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
> index 9758529..36daa67 100644
> --- a/hw/s390x/ipl.c
> +++ b/hw/s390x/ipl.c
> @@ -95,6 +95,10 @@ static int s390_ipl_init(SysBusDevice *dev)
> }
>
> bios_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
> + if (bios_filename == NULL) {
> + hw_error("could not find stage1 bootloader\n");
> + }
> +
> bios_size = load_elf(bios_filename, NULL, NULL, &ipl->start_addr, NULL,
> NULL, 1, ELF_MACHINE, 0);
> if (bios_size == -1UL) {
> diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile
> index ad55a14..1e6ab1e 100644
> --- a/pc-bios/s390-ccw/Makefile
> +++ b/pc-bios/s390-ccw/Makefile
> @@ -21,6 +21,7 @@ s390-ccw.elf: $(OBJECTS)
>
> s390-ccw.img: s390-ccw.elf
> $(call quiet-command,strip $< -o $@," Stripping $(TARGET_DIR)$@")
> + ln -s -f `pwd`/$@ ../$@
I don't think we do this for any other blobs, so why should we here?
Alex
>
> clean:
> rm -f *.o *.d *.img *.elf *~
> --
> 1.7.9.5
>
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 04/10] S390: check if BIOS is available and create links
2013-04-26 15:23 ` Alexander Graf
@ 2013-04-26 15:48 ` Dominik Dingel
2013-04-26 15:57 ` Alexander Graf
0 siblings, 1 reply; 52+ messages in thread
From: Dominik Dingel @ 2013-04-26 15:48 UTC (permalink / raw)
To: Alexander Graf; +Cc: Christian Borntraeger, qemu-devel
On Fri, 26 Apr 2013 17:23:18 +0200
Alexander Graf <agraf@suse.de> wrote:
>
> On 26.04.2013, at 14:12, Dominik Dingel wrote:
>
> > Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
> >
> > Check if the BIOS is available before loading it into the memory.
> > Create the needed Links for build.
> >
> > Add a if the BIOS is available, also add the needed links for the build
> > process.
> >
> > diff --git a/configure b/configure
> > index 19777de..2bbbd54 100755
> > --- a/configure
> > +++ b/configure
> > @@ -4541,6 +4541,7 @@ for bios_file in \
> > $source_path/pc-bios/*.aml \
> > $source_path/pc-bios/*.rom \
> > $source_path/pc-bios/*.dtb \
> > + $source_path/pc-bios/*.img \
> > $source_path/pc-bios/openbios-* \
> > $source_path/pc-bios/palcode-*
> > do
> > diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
> > index 9758529..36daa67 100644
> > --- a/hw/s390x/ipl.c
> > +++ b/hw/s390x/ipl.c
> > @@ -95,6 +95,10 @@ static int s390_ipl_init(SysBusDevice *dev)
> > }
> >
> > bios_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
> > + if (bios_filename == NULL) {
> > + hw_error("could not find stage1 bootloader\n");
> > + }
> > +
> > bios_size = load_elf(bios_filename, NULL, NULL, &ipl->start_addr, NULL,
> > NULL, 1, ELF_MACHINE, 0);
> > if (bios_size == -1UL) {
> > diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile
> > index ad55a14..1e6ab1e 100644
> > --- a/pc-bios/s390-ccw/Makefile
> > +++ b/pc-bios/s390-ccw/Makefile
> > @@ -21,6 +21,7 @@ s390-ccw.elf: $(OBJECTS)
> >
> > s390-ccw.img: s390-ccw.elf
> > $(call quiet-command,strip $< -o $@," Stripping $(TARGET_DIR)$@")
> > + ln -s -f `pwd`/$@ ../$@
>
> I don't think we do this for any other blobs, so why should we here?
>
> Alex
In case we are not running on the s390 platform we need the link to the shipped binary.
But if we are running on the s390 platform we like to build the rom in the s390-ccw build folder. After that we either copy or link it to the pc-bios location.
I personally preferred the link version.
Dominik
> >
> > clean:
> > rm -f *.o *.d *.img *.elf *~
> > --
> > 1.7.9.5
> >
>
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 04/10] S390: check if BIOS is available and create links
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:38 ` Anthony Liguori
0 siblings, 2 replies; 52+ messages in thread
From: Alexander Graf @ 2013-04-26 15:57 UTC (permalink / raw)
To: Dominik Dingel; +Cc: Christian Borntraeger, qemu-devel
On 26.04.2013, at 17:48, Dominik Dingel wrote:
> On Fri, 26 Apr 2013 17:23:18 +0200
> Alexander Graf <agraf@suse.de> wrote:
>
>>
>> On 26.04.2013, at 14:12, Dominik Dingel wrote:
>>
>>> Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
>>>
>>> Check if the BIOS is available before loading it into the memory.
>>> Create the needed Links for build.
>>>
>>> Add a if the BIOS is available, also add the needed links for the build
>>> process.
>>>
>>> diff --git a/configure b/configure
>>> index 19777de..2bbbd54 100755
>>> --- a/configure
>>> +++ b/configure
>>> @@ -4541,6 +4541,7 @@ for bios_file in \
>>> $source_path/pc-bios/*.aml \
>>> $source_path/pc-bios/*.rom \
>>> $source_path/pc-bios/*.dtb \
>>> + $source_path/pc-bios/*.img \
>>> $source_path/pc-bios/openbios-* \
>>> $source_path/pc-bios/palcode-*
>>> do
>>> diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
>>> index 9758529..36daa67 100644
>>> --- a/hw/s390x/ipl.c
>>> +++ b/hw/s390x/ipl.c
>>> @@ -95,6 +95,10 @@ static int s390_ipl_init(SysBusDevice *dev)
>>> }
>>>
>>> bios_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
>>> + if (bios_filename == NULL) {
>>> + hw_error("could not find stage1 bootloader\n");
>>> + }
>>> +
>>> bios_size = load_elf(bios_filename, NULL, NULL, &ipl->start_addr, NULL,
>>> NULL, 1, ELF_MACHINE, 0);
>>> if (bios_size == -1UL) {
>>> diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile
>>> index ad55a14..1e6ab1e 100644
>>> --- a/pc-bios/s390-ccw/Makefile
>>> +++ b/pc-bios/s390-ccw/Makefile
>>> @@ -21,6 +21,7 @@ s390-ccw.elf: $(OBJECTS)
>>>
>>> s390-ccw.img: s390-ccw.elf
>>> $(call quiet-command,strip $< -o $@," Stripping $(TARGET_DIR)$@")
>>> + ln -s -f `pwd`/$@ ../$@
>>
>> I don't think we do this for any other blobs, so why should we here?
>>
>> Alex
>
> In case we are not running on the s390 platform we need the link to the shipped binary.
> But if we are running on the s390 platform we like to build the rom in the s390-ccw build folder. After that we either copy or link it to the pc-bios location.
> I personally preferred the link version.
It's not what users expect when they compile code inside of pc-bios. Please stick to whatever behavior other blobs that we compile on demand have.
Alex
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 04/10] S390: check if BIOS is available and create links
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
1 sibling, 1 reply; 52+ messages in thread
From: Dominik Dingel @ 2013-04-26 16:20 UTC (permalink / raw)
To: Alexander Graf; +Cc: Christian Borntraeger, qemu-devel
On Fri, 26 Apr 2013 17:57:44 +0200
Alexander Graf <agraf@suse.de> wrote:
>
> On 26.04.2013, at 17:48, Dominik Dingel wrote:
>
> > On Fri, 26 Apr 2013 17:23:18 +0200
> > Alexander Graf <agraf@suse.de> wrote:
> >
> >>
> >> On 26.04.2013, at 14:12, Dominik Dingel wrote:
> >>
> >>> Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
> >>>
> >>> Check if the BIOS is available before loading it into the memory.
> >>> Create the needed Links for build.
> >>>
> >>> Add a if the BIOS is available, also add the needed links for the build
> >>> process.
> >>>
> >>> diff --git a/configure b/configure
> >>> index 19777de..2bbbd54 100755
> >>> --- a/configure
> >>> +++ b/configure
> >>> @@ -4541,6 +4541,7 @@ for bios_file in \
> >>> $source_path/pc-bios/*.aml \
> >>> $source_path/pc-bios/*.rom \
> >>> $source_path/pc-bios/*.dtb \
> >>> + $source_path/pc-bios/*.img \
> >>> $source_path/pc-bios/openbios-* \
> >>> $source_path/pc-bios/palcode-*
> >>> do
> >>> diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
> >>> index 9758529..36daa67 100644
> >>> --- a/hw/s390x/ipl.c
> >>> +++ b/hw/s390x/ipl.c
> >>> @@ -95,6 +95,10 @@ static int s390_ipl_init(SysBusDevice *dev)
> >>> }
> >>>
> >>> bios_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
> >>> + if (bios_filename == NULL) {
> >>> + hw_error("could not find stage1 bootloader\n");
> >>> + }
> >>> +
> >>> bios_size = load_elf(bios_filename, NULL, NULL, &ipl->start_addr, NULL,
> >>> NULL, 1, ELF_MACHINE, 0);
> >>> if (bios_size == -1UL) {
> >>> diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile
> >>> index ad55a14..1e6ab1e 100644
> >>> --- a/pc-bios/s390-ccw/Makefile
> >>> +++ b/pc-bios/s390-ccw/Makefile
> >>> @@ -21,6 +21,7 @@ s390-ccw.elf: $(OBJECTS)
> >>>
> >>> s390-ccw.img: s390-ccw.elf
> >>> $(call quiet-command,strip $< -o $@," Stripping $(TARGET_DIR)$@")
> >>> + ln -s -f `pwd`/$@ ../$@
> >>
> >> I don't think we do this for any other blobs, so why should we here?
> >>
> >> Alex
> >
> > In case we are not running on the s390 platform we need the link to the shipped binary.
> > But if we are running on the s390 platform we like to build the rom in the s390-ccw build folder. After that we either copy or link it to the pc-bios location.
> > I personally preferred the link version.
>
> It's not what users expect when they compile code inside of pc-bios. Please stick to whatever behavior other blobs that we compile on demand have.
>
>
> Alex
>
I checked on my current laptop, the thing is, if we build the blob, we also want to use it. If we don't overwrite it the link, we will continue to use the old shipped blob.
The linuxboot.img is imho wrong in it's way. As we build it, but the link still points to the qemu shipped one.
So you change linuxboot.S. If you know rebuild qemu, do you want to use the chaned version of linuxboot.img or the shipped one?
build/pc-bios$ diff ./optionrom/linuxboot.img ../../qemu/pc-bios/linuxboot.bin
Binary files ./optionrom/linuxboot.img and ../../qemu/pc-bios/linuxboot.bin differ
Dominik
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 04/10] S390: check if BIOS is available and create links
2013-04-26 16:20 ` Dominik Dingel
@ 2013-04-26 16:22 ` Alexander Graf
0 siblings, 0 replies; 52+ messages in thread
From: Alexander Graf @ 2013-04-26 16:22 UTC (permalink / raw)
To: Dominik Dingel; +Cc: Christian Borntraeger, qemu-devel
On 26.04.2013, at 18:20, Dominik Dingel wrote:
> On Fri, 26 Apr 2013 17:57:44 +0200
> Alexander Graf <agraf@suse.de> wrote:
>
>>
>> On 26.04.2013, at 17:48, Dominik Dingel wrote:
>>
>>> On Fri, 26 Apr 2013 17:23:18 +0200
>>> Alexander Graf <agraf@suse.de> wrote:
>>>
>>>>
>>>> On 26.04.2013, at 14:12, Dominik Dingel wrote:
>>>>
>>>>> Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
>>>>>
>>>>> Check if the BIOS is available before loading it into the memory.
>>>>> Create the needed Links for build.
>>>>>
>>>>> Add a if the BIOS is available, also add the needed links for the build
>>>>> process.
>>>>>
>>>>> diff --git a/configure b/configure
>>>>> index 19777de..2bbbd54 100755
>>>>> --- a/configure
>>>>> +++ b/configure
>>>>> @@ -4541,6 +4541,7 @@ for bios_file in \
>>>>> $source_path/pc-bios/*.aml \
>>>>> $source_path/pc-bios/*.rom \
>>>>> $source_path/pc-bios/*.dtb \
>>>>> + $source_path/pc-bios/*.img \
>>>>> $source_path/pc-bios/openbios-* \
>>>>> $source_path/pc-bios/palcode-*
>>>>> do
>>>>> diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
>>>>> index 9758529..36daa67 100644
>>>>> --- a/hw/s390x/ipl.c
>>>>> +++ b/hw/s390x/ipl.c
>>>>> @@ -95,6 +95,10 @@ static int s390_ipl_init(SysBusDevice *dev)
>>>>> }
>>>>>
>>>>> bios_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
>>>>> + if (bios_filename == NULL) {
>>>>> + hw_error("could not find stage1 bootloader\n");
>>>>> + }
>>>>> +
>>>>> bios_size = load_elf(bios_filename, NULL, NULL, &ipl->start_addr, NULL,
>>>>> NULL, 1, ELF_MACHINE, 0);
>>>>> if (bios_size == -1UL) {
>>>>> diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile
>>>>> index ad55a14..1e6ab1e 100644
>>>>> --- a/pc-bios/s390-ccw/Makefile
>>>>> +++ b/pc-bios/s390-ccw/Makefile
>>>>> @@ -21,6 +21,7 @@ s390-ccw.elf: $(OBJECTS)
>>>>>
>>>>> s390-ccw.img: s390-ccw.elf
>>>>> $(call quiet-command,strip $< -o $@," Stripping $(TARGET_DIR)$@")
>>>>> + ln -s -f `pwd`/$@ ../$@
>>>>
>>>> I don't think we do this for any other blobs, so why should we here?
>>>>
>>>> Alex
>>>
>>> In case we are not running on the s390 platform we need the link to the shipped binary.
>>> But if we are running on the s390 platform we like to build the rom in the s390-ccw build folder. After that we either copy or link it to the pc-bios location.
>>> I personally preferred the link version.
>>
>> It's not what users expect when they compile code inside of pc-bios. Please stick to whatever behavior other blobs that we compile on demand have.
>>
>>
>> Alex
>>
>
> I checked on my current laptop, the thing is, if we build the blob, we also want to use it. If we don't overwrite it the link, we will continue to use the old shipped blob.
>
> The linuxboot.img is imho wrong in it's way. As we build it, but the link still points to the qemu shipped one.
>
> So you change linuxboot.S. If you know rebuild qemu, do you want to use the chaned version of linuxboot.img or the shipped one?
>
> build/pc-bios$ diff ./optionrom/linuxboot.img ../../qemu/pc-bios/linuxboot.bin
> Binary files ./optionrom/linuxboot.img and ../../qemu/pc-bios/linuxboot.bin differ
Then change the behavior for _all_ blobs. But I prefer consistency over my personal opinion on whether one thing is more convenient or the other :)
Alex
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 04/10] S390: check if BIOS is available and create links
2013-04-26 15:57 ` Alexander Graf
2013-04-26 16:20 ` Dominik Dingel
@ 2013-04-26 16:38 ` Anthony Liguori
2013-04-26 18:03 ` Dominik Dingel
1 sibling, 1 reply; 52+ messages in thread
From: Anthony Liguori @ 2013-04-26 16:38 UTC (permalink / raw)
To: Alexander Graf, Dominik Dingel; +Cc: Christian Borntraeger, qemu-devel
Alexander Graf <agraf@suse.de> writes:
> On 26.04.2013, at 17:48, Dominik Dingel wrote:
>
>> On Fri, 26 Apr 2013 17:23:18 +0200
>> Alexander Graf <agraf@suse.de> wrote:
>>
>>>
>>> On 26.04.2013, at 14:12, Dominik Dingel wrote:
>>>
>>>> Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
>>>>
>>>> Check if the BIOS is available before loading it into the memory.
>>>> Create the needed Links for build.
>>>>
>>>> Add a if the BIOS is available, also add the needed links for the build
>>>> process.
>>>>
>>>> diff --git a/configure b/configure
>>>> index 19777de..2bbbd54 100755
>>>> --- a/configure
>>>> +++ b/configure
>>>> @@ -4541,6 +4541,7 @@ for bios_file in \
>>>> $source_path/pc-bios/*.aml \
>>>> $source_path/pc-bios/*.rom \
>>>> $source_path/pc-bios/*.dtb \
>>>> + $source_path/pc-bios/*.img \
>>>> $source_path/pc-bios/openbios-* \
>>>> $source_path/pc-bios/palcode-*
>>>> do
>>>> diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
>>>> index 9758529..36daa67 100644
>>>> --- a/hw/s390x/ipl.c
>>>> +++ b/hw/s390x/ipl.c
>>>> @@ -95,6 +95,10 @@ static int s390_ipl_init(SysBusDevice *dev)
>>>> }
>>>>
>>>> bios_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
>>>> + if (bios_filename == NULL) {
>>>> + hw_error("could not find stage1 bootloader\n");
>>>> + }
>>>> +
>>>> bios_size = load_elf(bios_filename, NULL, NULL, &ipl->start_addr, NULL,
>>>> NULL, 1, ELF_MACHINE, 0);
>>>> if (bios_size == -1UL) {
>>>> diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile
>>>> index ad55a14..1e6ab1e 100644
>>>> --- a/pc-bios/s390-ccw/Makefile
>>>> +++ b/pc-bios/s390-ccw/Makefile
>>>> @@ -21,6 +21,7 @@ s390-ccw.elf: $(OBJECTS)
>>>>
>>>> s390-ccw.img: s390-ccw.elf
>>>> $(call quiet-command,strip $< -o $@," Stripping $(TARGET_DIR)$@")
>>>> + ln -s -f `pwd`/$@ ../$@
>>>
>>> I don't think we do this for any other blobs, so why should we here?
>>>
>>> Alex
>>
>> In case we are not running on the s390 platform we need the link to the shipped binary.
>> But if we are running on the s390 platform we like to build the rom in the s390-ccw build folder. After that we either copy or link it to the pc-bios location.
>> I personally preferred the link version.
>
> It's not what users expect when they compile code inside of pc-bios. Please stick to whatever behavior other blobs that we compile on demand have.
Ack.
Regards,
Anthony Liguori
>
>
> Alex
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 04/10] S390: check if BIOS is available and create links
2013-04-26 16:38 ` Anthony Liguori
@ 2013-04-26 18:03 ` Dominik Dingel
2013-04-26 18:04 ` Alexander Graf
0 siblings, 1 reply; 52+ messages in thread
From: Dominik Dingel @ 2013-04-26 18:03 UTC (permalink / raw)
To: Anthony Liguori; +Cc: Christian Borntraeger, Alexander Graf, qemu-devel
On Fri, 26 Apr 2013 11:38:00 -0500
Anthony Liguori <anthony@codemonkey.ws> wrote:
> Alexander Graf <agraf@suse.de> writes:
>
> > On 26.04.2013, at 17:48, Dominik Dingel wrote:
> >
> >> On Fri, 26 Apr 2013 17:23:18 +0200
> >> Alexander Graf <agraf@suse.de> wrote:
> >>
> >>>
> >>> On 26.04.2013, at 14:12, Dominik Dingel wrote:
> >>>
> >>>> Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
> >>>>
> >>>> Check if the BIOS is available before loading it into the memory.
> >>>> Create the needed Links for build.
> >>>>
> >>>> Add a if the BIOS is available, also add the needed links for the build
> >>>> process.
> >>>>
> >>>> diff --git a/configure b/configure
> >>>> index 19777de..2bbbd54 100755
> >>>> --- a/configure
> >>>> +++ b/configure
> >>>> @@ -4541,6 +4541,7 @@ for bios_file in \
> >>>> $source_path/pc-bios/*.aml \
> >>>> $source_path/pc-bios/*.rom \
> >>>> $source_path/pc-bios/*.dtb \
> >>>> + $source_path/pc-bios/*.img \
> >>>> $source_path/pc-bios/openbios-* \
> >>>> $source_path/pc-bios/palcode-*
> >>>> do
> >>>> diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
> >>>> index 9758529..36daa67 100644
> >>>> --- a/hw/s390x/ipl.c
> >>>> +++ b/hw/s390x/ipl.c
> >>>> @@ -95,6 +95,10 @@ static int s390_ipl_init(SysBusDevice *dev)
> >>>> }
> >>>>
> >>>> bios_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
> >>>> + if (bios_filename == NULL) {
> >>>> + hw_error("could not find stage1 bootloader\n");
> >>>> + }
> >>>> +
> >>>> bios_size = load_elf(bios_filename, NULL, NULL, &ipl->start_addr, NULL,
> >>>> NULL, 1, ELF_MACHINE, 0);
> >>>> if (bios_size == -1UL) {
> >>>> diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile
> >>>> index ad55a14..1e6ab1e 100644
> >>>> --- a/pc-bios/s390-ccw/Makefile
> >>>> +++ b/pc-bios/s390-ccw/Makefile
> >>>> @@ -21,6 +21,7 @@ s390-ccw.elf: $(OBJECTS)
> >>>>
> >>>> s390-ccw.img: s390-ccw.elf
> >>>> $(call quiet-command,strip $< -o $@," Stripping $(TARGET_DIR)$@")
> >>>> + ln -s -f `pwd`/$@ ../$@
> >>>
> >>> I don't think we do this for any other blobs, so why should we here?
> >>>
> >>> Alex
> >>
> >> In case we are not running on the s390 platform we need the link to the shipped binary.
> >> But if we are running on the s390 platform we like to build the rom in the s390-ccw build folder. After that we either copy or link it to the pc-bios location.
> >> I personally preferred the link version.
> >
> > It's not what users expect when they compile code inside of pc-bios. Please stick to whatever behavior other blobs that we compile on demand have.
>
> Ack.
>
> Regards,
>
> Anthony Liguori
Would be a link for all blobs okay? Otherwise it is a magic box full with bugs and frustration for developers, as they need to copy explicitly the freshly build blob over to the source folder.
Dominik
> >
> >
> > Alex
>
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 04/10] S390: check if BIOS is available and create links
2013-04-26 18:03 ` Dominik Dingel
@ 2013-04-26 18:04 ` Alexander Graf
0 siblings, 0 replies; 52+ messages in thread
From: Alexander Graf @ 2013-04-26 18:04 UTC (permalink / raw)
To: Dominik Dingel; +Cc: Christian Borntraeger, qemu-devel, Anthony Liguori
On 26.04.2013, at 20:03, Dominik Dingel wrote:
> On Fri, 26 Apr 2013 11:38:00 -0500
> Anthony Liguori <anthony@codemonkey.ws> wrote:
>
>> Alexander Graf <agraf@suse.de> writes:
>>
>>> On 26.04.2013, at 17:48, Dominik Dingel wrote:
>>>
>>>> On Fri, 26 Apr 2013 17:23:18 +0200
>>>> Alexander Graf <agraf@suse.de> wrote:
>>>>
>>>>>
>>>>> On 26.04.2013, at 14:12, Dominik Dingel wrote:
>>>>>
>>>>>> Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
>>>>>>
>>>>>> Check if the BIOS is available before loading it into the memory.
>>>>>> Create the needed Links for build.
>>>>>>
>>>>>> Add a if the BIOS is available, also add the needed links for the build
>>>>>> process.
>>>>>>
>>>>>> diff --git a/configure b/configure
>>>>>> index 19777de..2bbbd54 100755
>>>>>> --- a/configure
>>>>>> +++ b/configure
>>>>>> @@ -4541,6 +4541,7 @@ for bios_file in \
>>>>>> $source_path/pc-bios/*.aml \
>>>>>> $source_path/pc-bios/*.rom \
>>>>>> $source_path/pc-bios/*.dtb \
>>>>>> + $source_path/pc-bios/*.img \
>>>>>> $source_path/pc-bios/openbios-* \
>>>>>> $source_path/pc-bios/palcode-*
>>>>>> do
>>>>>> diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
>>>>>> index 9758529..36daa67 100644
>>>>>> --- a/hw/s390x/ipl.c
>>>>>> +++ b/hw/s390x/ipl.c
>>>>>> @@ -95,6 +95,10 @@ static int s390_ipl_init(SysBusDevice *dev)
>>>>>> }
>>>>>>
>>>>>> bios_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
>>>>>> + if (bios_filename == NULL) {
>>>>>> + hw_error("could not find stage1 bootloader\n");
>>>>>> + }
>>>>>> +
>>>>>> bios_size = load_elf(bios_filename, NULL, NULL, &ipl->start_addr, NULL,
>>>>>> NULL, 1, ELF_MACHINE, 0);
>>>>>> if (bios_size == -1UL) {
>>>>>> diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile
>>>>>> index ad55a14..1e6ab1e 100644
>>>>>> --- a/pc-bios/s390-ccw/Makefile
>>>>>> +++ b/pc-bios/s390-ccw/Makefile
>>>>>> @@ -21,6 +21,7 @@ s390-ccw.elf: $(OBJECTS)
>>>>>>
>>>>>> s390-ccw.img: s390-ccw.elf
>>>>>> $(call quiet-command,strip $< -o $@," Stripping $(TARGET_DIR)$@")
>>>>>> + ln -s -f `pwd`/$@ ../$@
>>>>>
>>>>> I don't think we do this for any other blobs, so why should we here?
>>>>>
>>>>> Alex
>>>>
>>>> In case we are not running on the s390 platform we need the link to the shipped binary.
>>>> But if we are running on the s390 platform we like to build the rom in the s390-ccw build folder. After that we either copy or link it to the pc-bios location.
>>>> I personally preferred the link version.
>>>
>>> It's not what users expect when they compile code inside of pc-bios. Please stick to whatever behavior other blobs that we compile on demand have.
>>
>> Ack.
>>
>> Regards,
>>
>> Anthony Liguori
>
> Would be a link for all blobs okay? Otherwise it is a magic box full with bugs and frustration for developers, as they need to copy explicitly the freshly build blob over to the source folder.
Not this late in the development cycle.
Alex
^ permalink raw reply [flat|nested] 52+ messages in thread
* [Qemu-devel] [PATCH 05/10] s390-ccw.img: Detect devices with stsch.
2013-04-26 12:12 [Qemu-devel] [PATCH 00/10] S390: Enhance s390 BIOS to enable bootdevice selection Dominik Dingel
` (3 preceding siblings ...)
2013-04-26 12:12 ` [Qemu-devel] [PATCH 04/10] S390: check if BIOS is available and create links Dominik Dingel
@ 2013-04-26 12:12 ` Dominik Dingel
2013-04-26 12:12 ` [Qemu-devel] [PATCH 06/10] s390-ccw.img: Enhance drain_irqs() Dominik Dingel
` (5 subsequent siblings)
10 siblings, 0 replies; 52+ messages in thread
From: Dominik Dingel @ 2013-04-26 12:12 UTC (permalink / raw)
To: qemu-devel; +Cc: Cornelia Huck, Christian Borntraeger, Alexander Graf
From: Cornelia Huck <cornelia.huck@de.ibm.com>
stsch is the canonical way to detect devices. As a bonus, we can
abort the loop if we get cc 3, and we need to check only the valid
devices (dnv set).
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
index 67f4987..fd40fa5 100644
--- a/pc-bios/s390-ccw/main.c
+++ b/pc-bios/s390-ccw/main.c
@@ -22,7 +22,7 @@ void virtio_panic(const char *string)
static void virtio_setup(void)
{
- struct irb irb;
+ struct schib schib;
int i;
int r;
bool found = false;
@@ -31,8 +31,11 @@ static void virtio_setup(void)
for (i = 0; i < 0x10000; i++) {
blk_schid.sch_no = i;
- r = tsch(blk_schid, &irb);
- if (r != 3) {
+ r = stsch_err(blk_schid, &schib);
+ if (r == 3) {
+ break;
+ }
+ if (schib.pmcw.dnv) {
if (virtio_is_blk(blk_schid)) {
found = true;
break;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [Qemu-devel] [PATCH 06/10] s390-ccw.img: Enhance drain_irqs().
2013-04-26 12:12 [Qemu-devel] [PATCH 00/10] S390: Enhance s390 BIOS to enable bootdevice selection Dominik Dingel
` (4 preceding siblings ...)
2013-04-26 12:12 ` [Qemu-devel] [PATCH 05/10] s390-ccw.img: Detect devices with stsch Dominik Dingel
@ 2013-04-26 12:12 ` Dominik Dingel
2013-04-26 12:12 ` [Qemu-devel] [PATCH 07/10] s390-ccw.img: Rudimentary error checking Dominik Dingel
` (4 subsequent siblings)
10 siblings, 0 replies; 52+ messages in thread
From: Dominik Dingel @ 2013-04-26 12:12 UTC (permalink / raw)
To: qemu-devel; +Cc: Cornelia Huck, Christian Borntraeger, Alexander Graf
From: Cornelia Huck <cornelia.huck@de.ibm.com>
- Use tpi + tsch to get interrupts.
- Return an error if the irb indicates problems.
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c
index 1968fc6..1bd17d4 100644
--- a/pc-bios/s390-ccw/virtio.c
+++ b/pc-bios/s390-ccw/virtio.c
@@ -38,12 +38,21 @@ static void virtio_notify(struct subchannel_id schid)
* Virtio functions *
***********************************************/
-static void drain_irqs(struct subchannel_id schid)
+static int drain_irqs(struct subchannel_id schid)
{
struct irb irb = {};
+ int r = 0;
+
while (1) {
+ /* FIXME: make use of TPI, for that enable subchannel and isc */
if (tsch(schid, &irb)) {
- return;
+ /* Might want to differentiate error codes later on. */
+ if (irb.scsw.cstat) {
+ r = -EIO;
+ } else if (irb.scsw.dstat != 0xc) {
+ r = -EIO;
+ }
+ return r;
}
}
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [Qemu-devel] [PATCH 07/10] s390-ccw.img: Rudimentary error checking.
2013-04-26 12:12 [Qemu-devel] [PATCH 00/10] S390: Enhance s390 BIOS to enable bootdevice selection Dominik Dingel
` (5 preceding siblings ...)
2013-04-26 12:12 ` [Qemu-devel] [PATCH 06/10] s390-ccw.img: Enhance drain_irqs() Dominik Dingel
@ 2013-04-26 12:12 ` Dominik Dingel
2013-04-26 12:12 ` [Qemu-devel] [PATCH 08/10] s390-ccw.img: Get queue config from host Dominik Dingel
` (3 subsequent siblings)
10 siblings, 0 replies; 52+ messages in thread
From: Dominik Dingel @ 2013-04-26 12:12 UTC (permalink / raw)
To: qemu-devel; +Cc: Cornelia Huck, Christian Borntraeger, Alexander Graf
From: Cornelia Huck <cornelia.huck@de.ibm.com>
Try to handle at least some of the errors that may happen.
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c
index 1bd17d4..e0cede5 100644
--- a/pc-bios/s390-ccw/virtio.c
+++ b/pc-bios/s390-ccw/virtio.c
@@ -84,7 +84,9 @@ static int run_ccw(struct subchannel_id schid, int cmd, void *ptr, int len)
* assume that a simple tsch will have finished the CCW processing,
* but the architecture allows for asynchronous operation
*/
- drain_irqs(schid);
+ if (!r) {
+ r = drain_irqs(schid);
+ }
return r;
}
@@ -92,7 +94,9 @@ static void virtio_set_status(struct subchannel_id schid,
unsigned long dev_addr)
{
unsigned char status = dev_addr;
- run_ccw(schid, CCW_CMD_WRITE_STATUS, &status, sizeof(status));
+ if (run_ccw(schid, CCW_CMD_WRITE_STATUS, &status, sizeof(status))) {
+ virtio_panic("Could not write status to host!\n");
+ }
}
static void virtio_reset(struct subchannel_id schid)
@@ -193,6 +197,7 @@ static int virtio_read_many(ulong sector, void *load_addr, int sec_num)
{
struct virtio_blk_outhdr out_hdr;
u8 status;
+ int r;
/* Tell the host we want to read */
out_hdr.type = VIRTIO_BLK_T_IN;
@@ -213,8 +218,11 @@ static int virtio_read_many(ulong sector, void *load_addr, int sec_num)
/* Now we can tell the host to read */
vring_wait_reply(&block, 0);
- drain_irqs(block.schid);
-
+ r = drain_irqs(block.schid);
+ if (r) {
+ /* Well, whatever status is supposed to contain... */
+ status = 1;
+ }
return status;
}
@@ -262,8 +270,9 @@ void virtio_setup_block(struct subchannel_id schid)
info.num = 128;
block.schid = schid;
- run_ccw(schid, CCW_CMD_SET_VQ, &info, sizeof(info));
- virtio_set_status(schid, VIRTIO_CONFIG_S_DRIVER_OK);
+ if (!run_ccw(schid, CCW_CMD_SET_VQ, &info, sizeof(info))) {
+ virtio_set_status(schid, VIRTIO_CONFIG_S_DRIVER_OK);
+ }
}
bool virtio_is_blk(struct subchannel_id schid)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [Qemu-devel] [PATCH 08/10] s390-ccw.img: Get queue config from host.
2013-04-26 12:12 [Qemu-devel] [PATCH 00/10] S390: Enhance s390 BIOS to enable bootdevice selection Dominik Dingel
` (6 preceding siblings ...)
2013-04-26 12:12 ` [Qemu-devel] [PATCH 07/10] s390-ccw.img: Rudimentary error checking Dominik Dingel
@ 2013-04-26 12:12 ` 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
` (2 subsequent siblings)
10 siblings, 0 replies; 52+ messages in thread
From: Dominik Dingel @ 2013-04-26 12:12 UTC (permalink / raw)
To: qemu-devel; +Cc: Cornelia Huck, Christian Borntraeger, Alexander Graf
From: Cornelia Huck <cornelia.huck@de.ibm.com>
Ask the host about the configuration instead of guessing it.
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c
index e0cede5..5b9e1dc 100644
--- a/pc-bios/s390-ccw/virtio.c
+++ b/pc-bios/s390-ccw/virtio.c
@@ -257,17 +257,21 @@ int virtio_read(ulong sector, void *load_addr)
void virtio_setup_block(struct subchannel_id schid)
{
struct vq_info_block info;
+ struct vq_config_block config = {};
virtio_reset(schid);
- /* XXX need to fetch the 128 from host */
- vring_init(&block, 128, (void*)(100 * 1024 * 1024),
+ config.index = 0;
+ if (run_ccw(schid, CCW_CMD_READ_VQ_CONF, &config, sizeof(config))) {
+ virtio_panic("Could not get block device configuration\n");
+ }
+ vring_init(&block, config.num, (void*)(100 * 1024 * 1024),
KVM_S390_VIRTIO_RING_ALIGN);
info.queue = (100ULL * 1024ULL* 1024ULL);
info.align = KVM_S390_VIRTIO_RING_ALIGN;
info.index = 0;
- info.num = 128;
+ info.num = config.num;
block.schid = schid;
if (!run_ccw(schid, CCW_CMD_SET_VQ, &info, sizeof(info))) {
diff --git a/pc-bios/s390-ccw/virtio.h b/pc-bios/s390-ccw/virtio.h
index a33199d..86fdd57 100644
--- a/pc-bios/s390-ccw/virtio.h
+++ b/pc-bios/s390-ccw/virtio.h
@@ -53,6 +53,11 @@ struct vq_info_block {
u16 num;
} __attribute__((packed));
+struct vq_config_block {
+ u16 index;
+ u16 num;
+} __attribute__((packed));
+
struct virtio_dev {
struct virtio_dev_header *header;
struct virtio_vqconfig *vqconfig;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [Qemu-devel] [PATCH 09/10] S390: Pass per-device loadparm values for CCW blk and net devs.
2013-04-26 12:12 [Qemu-devel] [PATCH 00/10] S390: Enhance s390 BIOS to enable bootdevice selection Dominik Dingel
` (7 preceding siblings ...)
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 ` Dominik Dingel
2013-04-26 16:52 ` Alexander Graf
2013-04-26 12:12 ` [Qemu-devel] [PATCH 10/10] S390: Enabling device and program selection Dominik Dingel
2013-04-26 16:19 ` [Qemu-devel] [PATCH 00/10] S390: Enhance s390 BIOS to enable bootdevice selection Alexander Graf
10 siblings, 1 reply; 52+ messages in thread
From: Dominik Dingel @ 2013-04-26 12:12 UTC (permalink / raw)
To: qemu-devel; +Cc: Christian Paro, Christian Borntraeger, Alexander Graf
From: Christian Paro <cparo@us.ibm.com>
Provide a loadparm property which can be used to pass IPL load
parameters on a per-device basis for VirtioCcwDevice instances
representing block and network devices.
Signed-off-by: Christian Paro <cparo@us.ibm.com>
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index 56539d3..23d042f 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -791,6 +791,7 @@ static const VirtIOBindings virtio_ccw_bindings = {
static Property virtio_ccw_net_properties[] = {
DEFINE_PROP_STRING("devno", VirtioCcwDevice, bus_id),
+ DEFINE_PROP_UINT32("loadparm", VirtioCcwDevice, loadparm, 0),
DEFINE_VIRTIO_NET_FEATURES(VirtioCcwDevice, host_features[0]),
DEFINE_VIRTIO_NET_PROPERTIES(VirtIONetCcw, vdev.net_conf),
DEFINE_NIC_PROPERTIES(VirtIONetCcw, vdev.nic_conf),
@@ -818,6 +819,7 @@ static const TypeInfo virtio_ccw_net = {
static Property virtio_ccw_blk_properties[] = {
DEFINE_PROP_STRING("devno", VirtioCcwDevice, bus_id),
+ DEFINE_PROP_UINT32("loadparm", VirtioCcwDevice, loadparm, 0),
DEFINE_VIRTIO_BLK_FEATURES(VirtioCcwDevice, host_features[0]),
DEFINE_VIRTIO_BLK_PROPERTIES(VirtIOBlkCcw, blk),
DEFINE_PROP_END_OF_LIST(),
diff --git a/hw/s390x/virtio-ccw.h b/hw/s390x/virtio-ccw.h
index 84055e7..a3f706a 100644
--- a/hw/s390x/virtio-ccw.h
+++ b/hw/s390x/virtio-ccw.h
@@ -76,6 +76,7 @@ struct VirtioCcwDevice {
SubchDev *sch;
VirtIODevice *vdev;
char *bus_id;
+ uint32_t loadparm;
uint32_t host_features[VIRTIO_CCW_FEATURE_SIZE];
VirtIORNGConf rng;
VirtioBusState bus;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 09/10] S390: Pass per-device loadparm values for CCW blk and net devs.
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
0 siblings, 1 reply; 52+ messages in thread
From: Alexander Graf @ 2013-04-26 16:52 UTC (permalink / raw)
To: Dominik Dingel; +Cc: Christian Paro, Christian Borntraeger, qemu-devel
On 26.04.2013, at 14:12, Dominik Dingel wrote:
> From: Christian Paro <cparo@us.ibm.com>
>
> Provide a loadparm property which can be used to pass IPL load
> parameters on a per-device basis for VirtioCcwDevice instances
> representing block and network devices.
>
> Signed-off-by: Christian Paro <cparo@us.ibm.com>
>
> diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
> index 56539d3..23d042f 100644
> --- a/hw/s390x/virtio-ccw.c
> +++ b/hw/s390x/virtio-ccw.c
> @@ -791,6 +791,7 @@ static const VirtIOBindings virtio_ccw_bindings = {
>
> static Property virtio_ccw_net_properties[] = {
> DEFINE_PROP_STRING("devno", VirtioCcwDevice, bus_id),
> + DEFINE_PROP_UINT32("loadparm", VirtioCcwDevice, loadparm, 0),
We don't support netboot yet, right? Also is "loadparm" an architected name? Wouldn't "bootmap_id" or something that actually tells the user what's going on fit better?
Alex
> DEFINE_VIRTIO_NET_FEATURES(VirtioCcwDevice, host_features[0]),
> DEFINE_VIRTIO_NET_PROPERTIES(VirtIONetCcw, vdev.net_conf),
> DEFINE_NIC_PROPERTIES(VirtIONetCcw, vdev.nic_conf),
> @@ -818,6 +819,7 @@ static const TypeInfo virtio_ccw_net = {
>
> static Property virtio_ccw_blk_properties[] = {
> DEFINE_PROP_STRING("devno", VirtioCcwDevice, bus_id),
> + DEFINE_PROP_UINT32("loadparm", VirtioCcwDevice, loadparm, 0),
> DEFINE_VIRTIO_BLK_FEATURES(VirtioCcwDevice, host_features[0]),
> DEFINE_VIRTIO_BLK_PROPERTIES(VirtIOBlkCcw, blk),
> DEFINE_PROP_END_OF_LIST(),
> diff --git a/hw/s390x/virtio-ccw.h b/hw/s390x/virtio-ccw.h
> index 84055e7..a3f706a 100644
> --- a/hw/s390x/virtio-ccw.h
> +++ b/hw/s390x/virtio-ccw.h
> @@ -76,6 +76,7 @@ struct VirtioCcwDevice {
> SubchDev *sch;
> VirtIODevice *vdev;
> char *bus_id;
> + uint32_t loadparm;
> uint32_t host_features[VIRTIO_CCW_FEATURE_SIZE];
> VirtIORNGConf rng;
> VirtioBusState bus;
> --
> 1.7.9.5
>
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 09/10] S390: Pass per-device loadparm values for CCW blk and net devs.
2013-04-26 16:52 ` Alexander Graf
@ 2013-04-26 18:08 ` Dominik Dingel
2013-04-26 18:14 ` Alexander Graf
0 siblings, 1 reply; 52+ messages in thread
From: Dominik Dingel @ 2013-04-26 18:08 UTC (permalink / raw)
To: Alexander Graf; +Cc: Christian Paro, Christian Borntraeger, qemu-devel
On Fri, 26 Apr 2013 18:52:48 +0200
Alexander Graf <agraf@suse.de> wrote:
>
> On 26.04.2013, at 14:12, Dominik Dingel wrote:
>
> > From: Christian Paro <cparo@us.ibm.com>
> >
> > Provide a loadparm property which can be used to pass IPL load
> > parameters on a per-device basis for VirtioCcwDevice instances
> > representing block and network devices.
> >
> > Signed-off-by: Christian Paro <cparo@us.ibm.com>
> >
> > diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
> > index 56539d3..23d042f 100644
> > --- a/hw/s390x/virtio-ccw.c
> > +++ b/hw/s390x/virtio-ccw.c
> > @@ -791,6 +791,7 @@ static const VirtIOBindings virtio_ccw_bindings = {
> >
> > static Property virtio_ccw_net_properties[] = {
> > DEFINE_PROP_STRING("devno", VirtioCcwDevice, bus_id),
> > + DEFINE_PROP_UINT32("loadparm", VirtioCcwDevice, loadparm, 0),
>
> We don't support netboot yet, right? Also is "loadparm" an architected name? Wouldn't "bootmap_id" or something that actually tells the user what's going on fit better?
>
>
> Alex
Christian had the idea to name it subindex, but I don't know, to be honest, I like the general open solution more, especially for the commandline interface. What if we later on want to change the behaviour, loadparm, or better biosparameter is so general... where bootmap_id is narrowed down.
Dominik
> > DEFINE_VIRTIO_NET_FEATURES(VirtioCcwDevice, host_features[0]),
> > DEFINE_VIRTIO_NET_PROPERTIES(VirtIONetCcw, vdev.net_conf),
> > DEFINE_NIC_PROPERTIES(VirtIONetCcw, vdev.nic_conf),
> > @@ -818,6 +819,7 @@ static const TypeInfo virtio_ccw_net = {
> >
> > static Property virtio_ccw_blk_properties[] = {
> > DEFINE_PROP_STRING("devno", VirtioCcwDevice, bus_id),
> > + DEFINE_PROP_UINT32("loadparm", VirtioCcwDevice, loadparm, 0),
> > DEFINE_VIRTIO_BLK_FEATURES(VirtioCcwDevice, host_features[0]),
> > DEFINE_VIRTIO_BLK_PROPERTIES(VirtIOBlkCcw, blk),
> > DEFINE_PROP_END_OF_LIST(),
> > diff --git a/hw/s390x/virtio-ccw.h b/hw/s390x/virtio-ccw.h
> > index 84055e7..a3f706a 100644
> > --- a/hw/s390x/virtio-ccw.h
> > +++ b/hw/s390x/virtio-ccw.h
> > @@ -76,6 +76,7 @@ struct VirtioCcwDevice {
> > SubchDev *sch;
> > VirtIODevice *vdev;
> > char *bus_id;
> > + uint32_t loadparm;
> > uint32_t host_features[VIRTIO_CCW_FEATURE_SIZE];
> > VirtIORNGConf rng;
> > VirtioBusState bus;
> > --
> > 1.7.9.5
> >
>
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 09/10] S390: Pass per-device loadparm values for CCW blk and net devs.
2013-04-26 18:08 ` Dominik Dingel
@ 2013-04-26 18:14 ` Alexander Graf
2013-04-26 19:54 ` Christian Borntraeger
0 siblings, 1 reply; 52+ messages in thread
From: Alexander Graf @ 2013-04-26 18:14 UTC (permalink / raw)
To: Dominik Dingel; +Cc: Christian Paro, Christian Borntraeger, qemu-devel
On 26.04.2013, at 20:08, Dominik Dingel wrote:
> On Fri, 26 Apr 2013 18:52:48 +0200
> Alexander Graf <agraf@suse.de> wrote:
>
>>
>> On 26.04.2013, at 14:12, Dominik Dingel wrote:
>>
>>> From: Christian Paro <cparo@us.ibm.com>
>>>
>>> Provide a loadparm property which can be used to pass IPL load
>>> parameters on a per-device basis for VirtioCcwDevice instances
>>> representing block and network devices.
>>>
>>> Signed-off-by: Christian Paro <cparo@us.ibm.com>
>>>
>>> diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
>>> index 56539d3..23d042f 100644
>>> --- a/hw/s390x/virtio-ccw.c
>>> +++ b/hw/s390x/virtio-ccw.c
>>> @@ -791,6 +791,7 @@ static const VirtIOBindings virtio_ccw_bindings = {
>>>
>>> static Property virtio_ccw_net_properties[] = {
>>> DEFINE_PROP_STRING("devno", VirtioCcwDevice, bus_id),
>>> + DEFINE_PROP_UINT32("loadparm", VirtioCcwDevice, loadparm, 0),
>>
>> We don't support netboot yet, right? Also is "loadparm" an architected name? Wouldn't "bootmap_id" or something that actually tells the user what's going on fit better?
>>
>>
>> Alex
>
> Christian had the idea to name it subindex, but I don't know, to be honest, I like the general open solution more, especially for the commandline interface. What if we later on want to change the behaviour, loadparm, or better biosparameter is so general... where bootmap_id is narrowed down.
How about you guys make up your mind first what you really want to describe and which use cases you want to cover? :)
Alex
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 09/10] S390: Pass per-device loadparm values for CCW blk and net devs.
2013-04-26 18:14 ` Alexander Graf
@ 2013-04-26 19:54 ` Christian Borntraeger
0 siblings, 0 replies; 52+ messages in thread
From: Christian Borntraeger @ 2013-04-26 19:54 UTC (permalink / raw)
To: Alexander Graf; +Cc: Christian Paro, qemu-devel, Dominik Dingel
On 26/04/13 20:14, Alexander Graf wrote:
>
> On 26.04.2013, at 20:08, Dominik Dingel wrote:
>
>> On Fri, 26 Apr 2013 18:52:48 +0200
>> Alexander Graf <agraf@suse.de> wrote:
>>
>>>
>>> On 26.04.2013, at 14:12, Dominik Dingel wrote:
>>>
>>>> From: Christian Paro <cparo@us.ibm.com>
>>>>
>>>> Provide a loadparm property which can be used to pass IPL load
>>>> parameters on a per-device basis for VirtioCcwDevice instances
>>>> representing block and network devices.
>>>>
>>>> Signed-off-by: Christian Paro <cparo@us.ibm.com>
>>>>
>>>> diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
>>>> index 56539d3..23d042f 100644
>>>> --- a/hw/s390x/virtio-ccw.c
>>>> +++ b/hw/s390x/virtio-ccw.c
>>>> @@ -791,6 +791,7 @@ static const VirtIOBindings virtio_ccw_bindings = {
>>>>
>>>> static Property virtio_ccw_net_properties[] = {
>>>> DEFINE_PROP_STRING("devno", VirtioCcwDevice, bus_id),
>>>> + DEFINE_PROP_UINT32("loadparm", VirtioCcwDevice, loadparm, 0),
>>>
>>> We don't support netboot yet, right? Also is "loadparm" an architected name? Wouldn't "bootmap_id" or something that actually tells the user what's going on fit better?
>>>
>>>
>>> Alex
>>
>> Christian had the idea to name it subindex, but I don't know, to be honest, I like the general open solution more, especially for the commandline interface. What if we later on want to change the behaviour, loadparm, or better biosparameter is so general... where bootmap_id is narrowed down.
You should probably specify the Christian.. ;-)
My vote was for loadparm, because thats how the parameter is called in HMC and in
z/VM as well as under /sys/firmware/reipl/ccw/loadparm etc. On the other hand
its only loadparm for ccw disk devices. fcp has wwpn,lun etc.
Its getting late in the cycle, so lets focus on the bootindex and defer this
after 1.5.
^ permalink raw reply [flat|nested] 52+ messages in thread
* [Qemu-devel] [PATCH 10/10] S390: Enabling device and program selection
2013-04-26 12:12 [Qemu-devel] [PATCH 00/10] S390: Enhance s390 BIOS to enable bootdevice selection Dominik Dingel
` (8 preceding siblings ...)
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 12:12 ` Dominik Dingel
2013-04-26 15:29 ` Alexander Graf
2013-04-26 16:56 ` Alexander Graf
2013-04-26 16:19 ` [Qemu-devel] [PATCH 00/10] S390: Enhance s390 BIOS to enable bootdevice selection Alexander Graf
10 siblings, 2 replies; 52+ messages in thread
From: Dominik Dingel @ 2013-04-26 12:12 UTC (permalink / raw)
To: qemu-devel; +Cc: Christian Borntraeger, Alexander Graf, Dominik Dingel
Pass the eboot device info and the loadparm in register 7 and 8.
Use this values in the BIOS to directly boot the respective
operating system.
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
index 36daa67..960ba71 100644
--- a/hw/s390x/ipl.c
+++ b/hw/s390x/ipl.c
@@ -77,6 +77,10 @@ static void s390_ipl_from_disk(VirtIOBlkCcw *dev, uint64_t pswaddr)
env->psw.addr = pswaddr;
env->psw.mask = IPL_PSW_MASK;
env->regs[7] = ccw_dev->sch->devno;
+ env->regs[7] = (env->regs[7] << 16) | (ccw_dev->sch->schid);
+ env->regs[7] = (env->regs[7] << 8) | (ccw_dev->sch->cssid);
+ env->regs[7] = (env->regs[7] << 8) | (ccw_dev->sch->ssid);
+ env->regs[8] = ccw_dev->loadparm;
s390_add_running_cpu(cpu);
}
diff --git a/pc-bios/s390-ccw.img b/pc-bios/s390-ccw.img
index b549a86e55194bbf54e25f839e52b490ac308260..fe8d2c6b9f5d937ea156084f7eb248b17e1fa89c 100644
GIT binary patch
literal 17528
zcmeHPe^4CPeSf=ma0fzoCCl<ja_q%s671OcKscqgr#T5skVlb;qNFHJA|oA$8zZ2{
zNl`RzOKNqh)=J{>*s0UWAIubT8V_k#gf!5h<)+ni=tN0Kq8Yo5XG-T}M>V#EE$mVo
z@%s6G-`l(06N>SSJJUaIXSlcT?f3Vu_kDXe{P9D(TTIgsxyuxranB2(xrn<QQ#U&s
zd5nohQ7U4hOoTBf*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E5@lM8;>(A#2rD_6`ed~W5IUZe<9l;@P(lll|k#}_`<c%o^d
zxwoYd^u|~|$4$LR=b2*myZ%SMuf=Zg2HB6Fa8oY^nwdgAULy}l<qfX`Sg>4hGgFi;
zsJw=ExC8z;Q<N8bpRE3b1N&NtnR+qAzH#|kjs4!1ca`U`qp5Moz3GWjv6olqbugy&
zaZ@iYIOnmnXpNo68i88{10III+IP627aRV{6a{feZ0Bk2fd4L2lnd9`>1%nj27mVd
z0t@Ly{Y9oI4^-rVjanM>*zRR+=*4g|Q<SGaW4Cr+J&F2f9f3Lmbp+}Nd{G2A5%V1t
z+<w=6v^aD8yJt?^c=sLOzuexqvNJsYLg$t3x8J@=th(pEd$x(b%*c^rt3^+&JJuua
zKR7V3wr5}W+Wp!7k%1wR#k0>?W^_cX+pvD)SG&JOyT%Uh*-jK28yd@HbN%}%mK!{l
zquBnjF^Y|h<_2R2M~=kyAIS`-*Jjcb%Z{e|bNv(>9NKpv+ka?q-%vXHX^&z9qlfrO
zsoIFKPqAIed&j;g2CUzN>OW?vD_$>xqY9pjR0;d{Sfx+ZOAL%9sQfI%MO~+O-l`N)
zp@q25@u+WC_4t1<{^hT((ecXvOz?F?zM>bcP@mM!k9W(e|4JYC>7*wZsZj5E!dC|M
z{bklVRDb;yeeZuKMBe{UFrH(<no>LeZQy@KzY))PTyCh)fd3rkv9FyU??zSqxG&(*
zj<c0M-tDd_{(MaDM)muj)qk&|Re5x)+VJI>a;<p`s>-0z@nNMmSj$D**Qfsi-qmcN
diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c
index 53a460d..9cd3edf 100644
--- a/pc-bios/s390-ccw/bootmap.c
+++ b/pc-bios/s390-ccw/bootmap.c
@@ -173,7 +173,7 @@ fail:
return -1;
}
-int zipl_load(void)
+int zipl_load(uint64_t load_parm)
{
struct mbr *mbr = (void*)sec;
uint8_t *ns, *ns_end;
@@ -223,7 +223,7 @@ int zipl_load(void)
/* Run the default entry */
- prog_table_entry = (struct scsi_blockptr *)(sec + pte_len);
+ prog_table_entry = (struct scsi_blockptr *)(sec + (pte_len *(1+load_parm)));
return zipl_run(prog_table_entry);
diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
index fd40fa5..0c1c11c 100644
--- a/pc-bios/s390-ccw/main.c
+++ b/pc-bios/s390-ccw/main.c
@@ -20,7 +20,7 @@ void virtio_panic(const char *string)
while (1) { }
}
-static void virtio_setup(void)
+static void virtio_setup(uint16_t dev_no)
{
struct schib schib;
int i;
@@ -35,7 +35,7 @@ static void virtio_setup(void)
if (r == 3) {
break;
}
- if (schib.pmcw.dnv) {
+ if (schib.pmcw.dnv && (schib.pmcw.dev == dev_no)) {
if (virtio_is_blk(blk_schid)) {
found = true;
break;
@@ -52,10 +52,24 @@ static void virtio_setup(void)
int main(void)
{
+ uint64_t boot_value;
+ uint64_t load_parm;
+ register uint64_t reg7 asm("7");
+ register uint64_t reg8 asm("8");
+
+ asm volatile(
+ " stg %2, %0\n"
+ " stg %3, %1\n"
+ : "=m" (boot_value), "=m" (load_parm)
+ : "d" (reg7), "d" (reg8)
+ : "cc");
+
sclp_setup();
- virtio_setup();
- if (zipl_load() < 0)
+ virtio_setup(boot_value >> 32);
+
+ if (zipl_load(load_parm) < 0) {
sclp_print("Failed to load OS from hard disk\n");
+ }
disabled_wait();
while (1) { }
}
diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h
index 8241b0a..2851995 100644
--- a/pc-bios/s390-ccw/s390-ccw.h
+++ b/pc-bios/s390-ccw/s390-ccw.h
@@ -63,7 +63,7 @@ void virtio_setup_block(struct subchannel_id schid);
int virtio_read(ulong sector, void *load_addr);
/* bootmap.c */
-int zipl_load(void);
+int zipl_load(uint64_t load_parm);
static inline void *memset(void *s, int c, size_t n)
{
--
1.7.9.5
^ permalink raw reply related [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 10/10] S390: Enabling device and program selection
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
1 sibling, 0 replies; 52+ messages in thread
From: Alexander Graf @ 2013-04-26 15:29 UTC (permalink / raw)
To: Dominik Dingel; +Cc: Christian Borntraeger, qemu-devel
On 26.04.2013, at 14:12, Dominik Dingel wrote:
> Pass the eboot device info and the loadparm in register 7 and 8.
> Use this values in the BIOS to directly boot the respective
> operating system.
>
> Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
>
> diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
> index 36daa67..960ba71 100644
> --- a/hw/s390x/ipl.c
> +++ b/hw/s390x/ipl.c
> @@ -77,6 +77,10 @@ static void s390_ipl_from_disk(VirtIOBlkCcw *dev, uint64_t pswaddr)
> env->psw.addr = pswaddr;
> env->psw.mask = IPL_PSW_MASK;
> env->regs[7] = ccw_dev->sch->devno;
> + env->regs[7] = (env->regs[7] << 16) | (ccw_dev->sch->schid);
> + env->regs[7] = (env->regs[7] << 8) | (ccw_dev->sch->cssid);
> + env->regs[7] = (env->regs[7] << 8) | (ccw_dev->sch->ssid);
> + env->regs[8] = ccw_dev->loadparm;
No, we want a list.
> s390_add_running_cpu(cpu);
> }
>
> diff --git a/pc-bios/s390-ccw.img b/pc-bios/s390-ccw.img
Please do blob patches at the end of the series in a separate patch.
Alex
> index b549a86e55194bbf54e25f839e52b490ac308260..fe8d2c6b9f5d937ea156084f7eb248b17e1fa89c 100644
> GIT binary patch
> literal 17528
> zcmeHPe^4CPeSf=ma0fzoCCl<ja_q%s671OcKscqgr#T5skVlb;qNFHJA|oA$8zZ2{
> zNl`RzOKNqh)=J{>*s0UWAIubT8V_k#gf!5h<)+ni=tN0Kq8Yo5XG-T}M>V#EE$mVo
> z@%s6G-`l(06N>SSJJUaIXSlcT?f3Vu_kDXe{P9D(TTIgsxyuxranB2(xrn<QQ#U&s
> zd5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+++ b/pc-bios/s390-ccw/bootmap.c
> @@ -173,7 +173,7 @@ fail:
> return -1;
> }
>
> -int zipl_load(void)
> +int zipl_load(uint64_t load_parm)
> {
> struct mbr *mbr = (void*)sec;
> uint8_t *ns, *ns_end;
> @@ -223,7 +223,7 @@ int zipl_load(void)
>
> /* Run the default entry */
>
> - prog_table_entry = (struct scsi_blockptr *)(sec + pte_len);
> + prog_table_entry = (struct scsi_blockptr *)(sec + (pte_len *(1+load_parm)));
>
> return zipl_run(prog_table_entry);
>
> diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
> index fd40fa5..0c1c11c 100644
> --- a/pc-bios/s390-ccw/main.c
> +++ b/pc-bios/s390-ccw/main.c
> @@ -20,7 +20,7 @@ void virtio_panic(const char *string)
> while (1) { }
> }
>
> -static void virtio_setup(void)
> +static void virtio_setup(uint16_t dev_no)
> {
> struct schib schib;
> int i;
> @@ -35,7 +35,7 @@ static void virtio_setup(void)
> if (r == 3) {
> break;
> }
> - if (schib.pmcw.dnv) {
> + if (schib.pmcw.dnv && (schib.pmcw.dev == dev_no)) {
> if (virtio_is_blk(blk_schid)) {
> found = true;
> break;
> @@ -52,10 +52,24 @@ static void virtio_setup(void)
>
> int main(void)
> {
> + uint64_t boot_value;
> + uint64_t load_parm;
> + register uint64_t reg7 asm("7");
> + register uint64_t reg8 asm("8");
> +
> + asm volatile(
> + " stg %2, %0\n"
> + " stg %3, %1\n"
> + : "=m" (boot_value), "=m" (load_parm)
> + : "d" (reg7), "d" (reg8)
> + : "cc");
> +
> sclp_setup();
> - virtio_setup();
> - if (zipl_load() < 0)
> + virtio_setup(boot_value >> 32);
> +
> + if (zipl_load(load_parm) < 0) {
> sclp_print("Failed to load OS from hard disk\n");
> + }
> disabled_wait();
> while (1) { }
> }
> diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h
> index 8241b0a..2851995 100644
> --- a/pc-bios/s390-ccw/s390-ccw.h
> +++ b/pc-bios/s390-ccw/s390-ccw.h
> @@ -63,7 +63,7 @@ void virtio_setup_block(struct subchannel_id schid);
> int virtio_read(ulong sector, void *load_addr);
>
> /* bootmap.c */
> -int zipl_load(void);
> +int zipl_load(uint64_t load_parm);
>
> static inline void *memset(void *s, int c, size_t n)
> {
> --
> 1.7.9.5
>
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 10/10] S390: Enabling device and program selection
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
1 sibling, 1 reply; 52+ messages in thread
From: Alexander Graf @ 2013-04-26 16:56 UTC (permalink / raw)
To: Dominik Dingel; +Cc: Christian Borntraeger, qemu-devel
On 26.04.2013, at 14:12, Dominik Dingel wrote:
> Pass the eboot device info and the loadparm in register 7 and 8.
> Use this values in the BIOS to directly boot the respective
> operating system.
>
> Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
>
> diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
> index 36daa67..960ba71 100644
> --- a/hw/s390x/ipl.c
> +++ b/hw/s390x/ipl.c
> @@ -77,6 +77,10 @@ static void s390_ipl_from_disk(VirtIOBlkCcw *dev, uint64_t pswaddr)
> env->psw.addr = pswaddr;
> env->psw.mask = IPL_PSW_MASK;
> env->regs[7] = ccw_dev->sch->devno;
> + env->regs[7] = (env->regs[7] << 16) | (ccw_dev->sch->schid);
> + env->regs[7] = (env->regs[7] << 8) | (ccw_dev->sch->cssid);
> + env->regs[7] = (env->regs[7] << 8) | (ccw_dev->sch->ssid);
> + env->regs[8] = ccw_dev->loadparm;
> s390_add_running_cpu(cpu);
> }
>
> diff --git a/pc-bios/s390-ccw.img b/pc-bios/s390-ccw.img
> index b549a86e55194bbf54e25f839e52b490ac308260..fe8d2c6b9f5d937ea156084f7eb248b17e1fa89c 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z{bklVRDb;yeeZuKMBe{UFrH(<no>LeZQy@KzY))PTyCh)fd3rkv9FyU??zSqxG&(*
> zj<c0M-tDd_{(MaDM)muj)qk&|Re5x)+VJI>a;<p`s>-0z@nNMmSj$D**Qfsi-qmcN
>
> diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c
> index 53a460d..9cd3edf 100644
> --- a/pc-bios/s390-ccw/bootmap.c
> +++ b/pc-bios/s390-ccw/bootmap.c
> @@ -173,7 +173,7 @@ fail:
> return -1;
> }
>
> -int zipl_load(void)
> +int zipl_load(uint64_t load_parm)
> {
> struct mbr *mbr = (void*)sec;
> uint8_t *ns, *ns_end;
> @@ -223,7 +223,7 @@ int zipl_load(void)
>
> /* Run the default entry */
>
> - prog_table_entry = (struct scsi_blockptr *)(sec + pte_len);
> + prog_table_entry = (struct scsi_blockptr *)(sec + (pte_len *(1+load_parm)));
>
> return zipl_run(prog_table_entry);
>
> diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
> index fd40fa5..0c1c11c 100644
> --- a/pc-bios/s390-ccw/main.c
> +++ b/pc-bios/s390-ccw/main.c
> @@ -20,7 +20,7 @@ void virtio_panic(const char *string)
> while (1) { }
> }
>
> -static void virtio_setup(void)
> +static void virtio_setup(uint16_t dev_no)
> {
> struct schib schib;
> int i;
> @@ -35,7 +35,7 @@ static void virtio_setup(void)
> if (r == 3) {
> break;
> }
> - if (schib.pmcw.dnv) {
> + if (schib.pmcw.dnv && (schib.pmcw.dev == dev_no)) {
What if I have no dev_no passed in? We need to support the mode where the user doesn't specify any device he wants to boot from.
> if (virtio_is_blk(blk_schid)) {
> found = true;
> break;
> @@ -52,10 +52,24 @@ static void virtio_setup(void)
>
> int main(void)
> {
> + uint64_t boot_value;
> + uint64_t load_parm;
> + register uint64_t reg7 asm("7");
> + register uint64_t reg8 asm("8");
> +
> + asm volatile(
> + " stg %2, %0\n"
> + " stg %3, %1\n"
> + : "=m" (boot_value), "=m" (load_parm)
> + : "d" (reg7), "d" (reg8)
> + : "cc");
What is this for? If you have a local register variable, won't that value get saved automatically?
Alex
> +
> sclp_setup();
> - virtio_setup();
> - if (zipl_load() < 0)
> + virtio_setup(boot_value >> 32);
> +
> + if (zipl_load(load_parm) < 0) {
> sclp_print("Failed to load OS from hard disk\n");
> + }
> disabled_wait();
> while (1) { }
> }
> diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h
> index 8241b0a..2851995 100644
> --- a/pc-bios/s390-ccw/s390-ccw.h
> +++ b/pc-bios/s390-ccw/s390-ccw.h
> @@ -63,7 +63,7 @@ void virtio_setup_block(struct subchannel_id schid);
> int virtio_read(ulong sector, void *load_addr);
>
> /* bootmap.c */
> -int zipl_load(void);
> +int zipl_load(uint64_t load_parm);
>
> static inline void *memset(void *s, int c, size_t n)
> {
> --
> 1.7.9.5
>
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 10/10] S390: Enabling device and program selection
2013-04-26 16:56 ` Alexander Graf
@ 2013-04-26 17:55 ` Dominik Dingel
2013-04-26 17:56 ` Alexander Graf
0 siblings, 1 reply; 52+ messages in thread
From: Dominik Dingel @ 2013-04-26 17:55 UTC (permalink / raw)
To: Alexander Graf; +Cc: Christian Borntraeger, qemu-devel
On Fri, 26 Apr 2013 18:56:44 +0200
Alexander Graf <agraf@suse.de> wrote:
>
> On 26.04.2013, at 14:12, Dominik Dingel wrote:
>
> > Pass the eboot device info and the loadparm in register 7 and 8.
> > Use this values in the BIOS to directly boot the respective
> > operating system.
> >
> > Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
> >
> > diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
> > index 36daa67..960ba71 100644
> > --- a/hw/s390x/ipl.c
> > +++ b/hw/s390x/ipl.c
> > @@ -77,6 +77,10 @@ static void s390_ipl_from_disk(VirtIOBlkCcw *dev, uint64_t pswaddr)
> > env->psw.addr = pswaddr;
> > env->psw.mask = IPL_PSW_MASK;
> > env->regs[7] = ccw_dev->sch->devno;
> > + env->regs[7] = (env->regs[7] << 16) | (ccw_dev->sch->schid);
> > + env->regs[7] = (env->regs[7] << 8) | (ccw_dev->sch->cssid);
> > + env->regs[7] = (env->regs[7] << 8) | (ccw_dev->sch->ssid);
> > + env->regs[8] = ccw_dev->loadparm;
> > s390_add_running_cpu(cpu);
> > }
> >
> > diff --git a/pc-bios/s390-ccw.img b/pc-bios/s390-ccw.img
> > index b549a86e55194bbf54e25f839e52b490ac308260..fe8d2c6b9f5d937ea156084f7eb248b17e1fa89c 100644
> > GIT binary patch
> > literal 17528
> > zcmeHPe^4CPeSf=ma0fzoCCl<ja_q%s671OcKscqgr#T5skVlb;qNFHJA|oA$8zZ2{
> > zNl`RzOKNqh)=J{>*s0UWAIubT8V_k#gf!5h<)+ni=tN0Kq8Yo5XG-T}M>V#EE$mVo
> > z@%s6G-`l(06N>SSJJUaIXSlcT?f3Vu_kDXe{P9D(TTIgsxyuxranB2(xrn<QQ#U&s
> > zd5nohQ7U4hOoTBf*b?>J;vqDrX6`7&?Rv!>8IJHu6=aNu(1Mz|qngp@P*mOL@PcZ-
> > z<7pZPh2a~qRIQ%7BjXXyhr|=Xc<Pn5Jl<VQC^Wa#H^KzXik~|&-si9uQtNB}BzqRG
> > zq6LZ;C|aOsfuaS97ARVvXn~>yiWVqZplE@j1wL{M%ug@0i|XuxY?Xg785GlPwlkWI
> > zIzytm-Ev0LHBw?_JR8GGkk^Cln2$9?#n|n_K4ptr=s94=CpU==piq^KovjhU`RTKk
> > z2!<AO^xGBvtWC7}Gnjb=2l5sATz4+LD1?H|%wqm)NEA^Rpt&(-Ip0s?Wkj3hT+CP^
> > z{7Aapw#3L?!f3;&pS%nj`yk27kt&9HE@oS1#s>7$ps_8zO`K`BZGro`%qvpLKPAeb
> > zI0u}$^sOS0J}Dl|TFw~}+-J>(@fX~<0c+LywMf;-$AxHxG$VLRvZX4W5;rlg10)Y?
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P627aRV{6a{feZ0Bk2fd4L2lnd9`>1%nj27mVd
> > z0t@Ly{Y9oI4^-rVjanM>*zRR+=*4g|Q<SGaW4Cr+J&F2f9f3Lmbp+}Nd{G2A5%V1t
> > z+<w=6v^aD8yJt?^c=sLOzuexqvNJsYLg$t3x8J@=th(pEd$x(b%*c^rt3^+&JJuua
> > zKR7V3wr5}W+Wp!7k%1wR#k0>?W^_cX+pvD)SG&JOyT%Uh*-jK28yd@HbN%}%mK!{l
> > zquBnjF^Y|h<_2R2M~=kyAIS`-*Jjcb%Z{e|bNv(>9NKpv+ka?q-%vXHX^&z9qlfrO
> > zsoIFKPqAIed&j;g2CUzN>OW?vD_$>xqY9pjR0;d{Sfx+ZOAL%9sQfI%MO~+O-l`N)
> > zp@q25@u+WC_4t1<{^hT((ecXvOz?F?zM>bcP@mM!k9W(e|4JYC>7*wZsZj5E!dC|M
> > z{bklVRDb;yeeZuKMBe{UFrH(<no>LeZQy@KzY))PTyCh)fd3rkv9FyU??zSqxG&(*
> > zj<c0M-tDd_{(MaDM)muj)qk&|Re5x)+VJI>a;<p`s>-0z@nNMmSj$D**Qfsi-qmcN
> >
> > diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c
> > index 53a460d..9cd3edf 100644
> > --- a/pc-bios/s390-ccw/bootmap.c
> > +++ b/pc-bios/s390-ccw/bootmap.c
> > @@ -173,7 +173,7 @@ fail:
> > return -1;
> > }
> >
> > -int zipl_load(void)
> > +int zipl_load(uint64_t load_parm)
> > {
> > struct mbr *mbr = (void*)sec;
> > uint8_t *ns, *ns_end;
> > @@ -223,7 +223,7 @@ int zipl_load(void)
> >
> > /* Run the default entry */
> >
> > - prog_table_entry = (struct scsi_blockptr *)(sec + pte_len);
> > + prog_table_entry = (struct scsi_blockptr *)(sec + (pte_len *(1+load_parm)));
> >
> > return zipl_run(prog_table_entry);
> >
> > diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
> > index fd40fa5..0c1c11c 100644
> > --- a/pc-bios/s390-ccw/main.c
> > +++ b/pc-bios/s390-ccw/main.c
> > @@ -20,7 +20,7 @@ void virtio_panic(const char *string)
> > while (1) { }
> > }
> >
> > -static void virtio_setup(void)
> > +static void virtio_setup(uint16_t dev_no)
> > {
> > struct schib schib;
> > int i;
> > @@ -35,7 +35,7 @@ static void virtio_setup(void)
> > if (r == 3) {
> > break;
> > }
> > - if (schib.pmcw.dnv) {
> > + if (schib.pmcw.dnv && (schib.pmcw.dev == dev_no)) {
>
> What if I have no dev_no passed in? We need to support the mode where the user doesn't specify any device he wants to boot from.
There is actually no code path where you would boot the BIOS and at the sametime have no device passed in.
>
> > if (virtio_is_blk(blk_schid)) {
> > found = true;
> > break;
> > @@ -52,10 +52,24 @@ static void virtio_setup(void)
> >
> > int main(void)
> > {
> > + uint64_t boot_value;
> > + uint64_t load_parm;
> > + register uint64_t reg7 asm("7");
> > + register uint64_t reg8 asm("8");
> > +
> > + asm volatile(
> > + " stg %2, %0\n"
> > + " stg %3, %1\n"
> > + : "=m" (boot_value), "=m" (load_parm)
> > + : "d" (reg7), "d" (reg8)
> > + : "cc");
>
> What is this for? If you have a local register variable, won't that value get saved automatically?
It's a real verbose way to say here in this register we have the boot parameter stored in... And my confidence in understanding local register variables is not so that I would hope to get it perfectly right.
>
> Alex
>
> > +
> > sclp_setup();
> > - virtio_setup();
> > - if (zipl_load() < 0)
> > + virtio_setup(boot_value >> 32);
> > +
> > + if (zipl_load(load_parm) < 0) {
> > sclp_print("Failed to load OS from hard disk\n");
> > + }
> > disabled_wait();
> > while (1) { }
> > }
> > diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h
> > index 8241b0a..2851995 100644
> > --- a/pc-bios/s390-ccw/s390-ccw.h
> > +++ b/pc-bios/s390-ccw/s390-ccw.h
> > @@ -63,7 +63,7 @@ void virtio_setup_block(struct subchannel_id schid);
> > int virtio_read(ulong sector, void *load_addr);
> >
> > /* bootmap.c */
> > -int zipl_load(void);
> > +int zipl_load(uint64_t load_parm);
> >
> > static inline void *memset(void *s, int c, size_t n)
> > {
> > --
> > 1.7.9.5
> >
>
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 10/10] S390: Enabling device and program selection
2013-04-26 17:55 ` Dominik Dingel
@ 2013-04-26 17:56 ` Alexander Graf
0 siblings, 0 replies; 52+ messages in thread
From: Alexander Graf @ 2013-04-26 17:56 UTC (permalink / raw)
To: Dominik Dingel; +Cc: Christian Borntraeger, qemu-devel
On 26.04.2013, at 19:55, Dominik Dingel wrote:
> On Fri, 26 Apr 2013 18:56:44 +0200
> Alexander Graf <agraf@suse.de> wrote:
>
>>
>> On 26.04.2013, at 14:12, Dominik Dingel wrote:
>>
>>> Pass the eboot device info and the loadparm in register 7 and 8.
>>> Use this values in the BIOS to directly boot the respective
>>> operating system.
>>>
>>> Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
>>>
>>> diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
>>> index 36daa67..960ba71 100644
>>> --- a/hw/s390x/ipl.c
>>> +++ b/hw/s390x/ipl.c
>>> @@ -77,6 +77,10 @@ static void s390_ipl_from_disk(VirtIOBlkCcw *dev, uint64_t pswaddr)
>>> env->psw.addr = pswaddr;
>>> env->psw.mask = IPL_PSW_MASK;
>>> env->regs[7] = ccw_dev->sch->devno;
>>> + env->regs[7] = (env->regs[7] << 16) | (ccw_dev->sch->schid);
>>> + env->regs[7] = (env->regs[7] << 8) | (ccw_dev->sch->cssid);
>>> + env->regs[7] = (env->regs[7] << 8) | (ccw_dev->sch->ssid);
>>> + env->regs[8] = ccw_dev->loadparm;
>>> s390_add_running_cpu(cpu);
>>> }
>>>
>>> diff --git a/pc-bios/s390-ccw.img b/pc-bios/s390-ccw.img
>>> index b549a86e55194bbf54e25f839e52b490ac308260..fe8d2c6b9f5d937ea156084f7eb248b17e1fa89c 100644
>>> GIT binary patch
>>> literal 17528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#k0>?W^_cX+pvD)SG&JOyT%Uh*-jK28yd@HbN%}%mK!{l
>>> zquBnjF^Y|h<_2R2M~=kyAIS`-*Jjcb%Z{e|bNv(>9NKpv+ka?q-%vXHX^&z9qlfrO
>>> zsoIFKPqAIed&j;g2CUzN>OW?vD_$>xqY9pjR0;d{Sfx+ZOAL%9sQfI%MO~+O-l`N)
>>> zp@q25@u+WC_4t1<{^hT((ecXvOz?F?zM>bcP@mM!k9W(e|4JYC>7*wZsZj5E!dC|M
>>> z{bklVRDb;yeeZuKMBe{UFrH(<no>LeZQy@KzY))PTyCh)fd3rkv9FyU??zSqxG&(*
>>> zj<c0M-tDd_{(MaDM)muj)qk&|Re5x)+VJI>a;<p`s>-0z@nNMmSj$D**Qfsi-qmcN
>>>
>>> diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c
>>> index 53a460d..9cd3edf 100644
>>> --- a/pc-bios/s390-ccw/bootmap.c
>>> +++ b/pc-bios/s390-ccw/bootmap.c
>>> @@ -173,7 +173,7 @@ fail:
>>> return -1;
>>> }
>>>
>>> -int zipl_load(void)
>>> +int zipl_load(uint64_t load_parm)
>>> {
>>> struct mbr *mbr = (void*)sec;
>>> uint8_t *ns, *ns_end;
>>> @@ -223,7 +223,7 @@ int zipl_load(void)
>>>
>>> /* Run the default entry */
>>>
>>> - prog_table_entry = (struct scsi_blockptr *)(sec + pte_len);
>>> + prog_table_entry = (struct scsi_blockptr *)(sec + (pte_len *(1+load_parm)));
>>>
>>> return zipl_run(prog_table_entry);
>>>
>>> diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
>>> index fd40fa5..0c1c11c 100644
>>> --- a/pc-bios/s390-ccw/main.c
>>> +++ b/pc-bios/s390-ccw/main.c
>>> @@ -20,7 +20,7 @@ void virtio_panic(const char *string)
>>> while (1) { }
>>> }
>>>
>>> -static void virtio_setup(void)
>>> +static void virtio_setup(uint16_t dev_no)
>>> {
>>> struct schib schib;
>>> int i;
>>> @@ -35,7 +35,7 @@ static void virtio_setup(void)
>>> if (r == 3) {
>>> break;
>>> }
>>> - if (schib.pmcw.dnv) {
>>> + if (schib.pmcw.dnv && (schib.pmcw.dev == dev_no)) {
>>
>> What if I have no dev_no passed in? We need to support the mode where the user doesn't specify any device he wants to boot from.
>
> There is actually no code path where you would boot the BIOS and at the sametime have no device passed in.
If we drop patch 1 there is will be.
>
>>
>>> if (virtio_is_blk(blk_schid)) {
>>> found = true;
>>> break;
>>> @@ -52,10 +52,24 @@ static void virtio_setup(void)
>>>
>>> int main(void)
>>> {
>>> + uint64_t boot_value;
>>> + uint64_t load_parm;
>>> + register uint64_t reg7 asm("7");
>>> + register uint64_t reg8 asm("8");
>>> +
>>> + asm volatile(
>>> + " stg %2, %0\n"
>>> + " stg %3, %1\n"
>>> + : "=m" (boot_value), "=m" (load_parm)
>>> + : "d" (reg7), "d" (reg8)
>>> + : "cc");
>>
>> What is this for? If you have a local register variable, won't that value get saved automatically?
>
> It's a real verbose way to say here in this register we have the boot parameter stored in... And my confidence in understanding local register variables is not so that I would hope to get it perfectly right.
Then grab yourself someone who knows :).
Alex
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 00/10] S390: Enhance s390 BIOS to enable bootdevice selection
2013-04-26 12:12 [Qemu-devel] [PATCH 00/10] S390: Enhance s390 BIOS to enable bootdevice selection Dominik Dingel
` (9 preceding siblings ...)
2013-04-26 12:12 ` [Qemu-devel] [PATCH 10/10] S390: Enabling device and program selection Dominik Dingel
@ 2013-04-26 16:19 ` Alexander Graf
2013-04-26 16:22 ` Dominik Dingel
10 siblings, 1 reply; 52+ messages in thread
From: Alexander Graf @ 2013-04-26 16:19 UTC (permalink / raw)
To: Dominik Dingel; +Cc: Christian Borntraeger, qemu-devel
On 26.04.2013, at 14:12, Dominik Dingel wrote:
> Ths patchset enhance the common code to assign every device a bootindex,
> and provide a function to return the device.
> The device will be then used in the ipl code to provide the s390-ccw bios
> explicit information from which device the user wants to boot from.
> It will also return a load_parm to specify which boot entry it should use.
> It also includes the working s390-ccw.img fixes from Cornelia.
>
> In case there is some hesitation against the program selection code,
> I can provide a patchset excluding this function.
>
> Christian Paro (1):
> S390: Pass per-device loadparm values for CCW blk and net devs.
>
> Cornelia Huck (4):
> s390-ccw.img: Detect devices with stsch.
> s390-ccw.img: Enhance drain_irqs().
> s390-ccw.img: Rudimentary error checking.
> s390-ccw.img: Get queue config from host.
I've applied Connie's patches out of this patch set meanwhile.
Alex
>
> Dominik Dingel (5):
> Common: Add a default bootindex for all applicable devices
> Common: Add quick access to first boot device
> S390: Check Bootdevice Type
> S390: check if BIOS is available and create links
> S390: Enabling device and program selection
>
> configure | 1 +
> hw/s390x/ipl.c | 36 +++++++++++++++++++++++++++++++++--
> hw/s390x/virtio-ccw.c | 2 ++
> hw/s390x/virtio-ccw.h | 1 +
> include/sysemu/sysemu.h | 2 ++
> pc-bios/s390-ccw.img | Bin 9432 -> 17528 bytes
> pc-bios/s390-ccw/Makefile | 1 +
> pc-bios/s390-ccw/bootmap.c | 4 ++--
> pc-bios/s390-ccw/main.c | 29 ++++++++++++++++++++++------
> pc-bios/s390-ccw/s390-ccw.h | 2 +-
> pc-bios/s390-ccw/virtio.c | 44 ++++++++++++++++++++++++++++++++-----------
> pc-bios/s390-ccw/virtio.h | 5 +++++
> vl.c | 35 +++++++++++++++++++++++++++++++---
> 13 files changed, 137 insertions(+), 25 deletions(-)
>
> --
> 1.7.9.5
>
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [Qemu-devel] [PATCH 00/10] S390: Enhance s390 BIOS to enable bootdevice selection
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
0 siblings, 0 replies; 52+ messages in thread
From: Dominik Dingel @ 2013-04-26 16:22 UTC (permalink / raw)
To: Alexander Graf; +Cc: Christian Borntraeger, qemu-devel
On Fri, 26 Apr 2013 18:19:29 +0200
Alexander Graf <agraf@suse.de> wrote:
>
> On 26.04.2013, at 14:12, Dominik Dingel wrote:
>
> > Ths patchset enhance the common code to assign every device a bootindex,
> > and provide a function to return the device.
> > The device will be then used in the ipl code to provide the s390-ccw bios
> > explicit information from which device the user wants to boot from.
> > It will also return a load_parm to specify which boot entry it should use.
> > It also includes the working s390-ccw.img fixes from Cornelia.
> >
> > In case there is some hesitation against the program selection code,
> > I can provide a patchset excluding this function.
> >
> > Christian Paro (1):
> > S390: Pass per-device loadparm values for CCW blk and net devs.
> >
> > Cornelia Huck (4):
> > s390-ccw.img: Detect devices with stsch.
> > s390-ccw.img: Enhance drain_irqs().
> > s390-ccw.img: Rudimentary error checking.
> > s390-ccw.img: Get queue config from host.
>
> I've applied Connie's patches out of this patch set meanwhile.
>
>
> Alex
Thanks :).
>
> >
> > Dominik Dingel (5):
> > Common: Add a default bootindex for all applicable devices
> > Common: Add quick access to first boot device
> > S390: Check Bootdevice Type
> > S390: check if BIOS is available and create links
> > S390: Enabling device and program selection
> >
> > configure | 1 +
> > hw/s390x/ipl.c | 36 +++++++++++++++++++++++++++++++++--
> > hw/s390x/virtio-ccw.c | 2 ++
> > hw/s390x/virtio-ccw.h | 1 +
> > include/sysemu/sysemu.h | 2 ++
> > pc-bios/s390-ccw.img | Bin 9432 -> 17528 bytes
> > pc-bios/s390-ccw/Makefile | 1 +
> > pc-bios/s390-ccw/bootmap.c | 4 ++--
> > pc-bios/s390-ccw/main.c | 29 ++++++++++++++++++++++------
> > pc-bios/s390-ccw/s390-ccw.h | 2 +-
> > pc-bios/s390-ccw/virtio.c | 44 ++++++++++++++++++++++++++++++++-----------
> > pc-bios/s390-ccw/virtio.h | 5 +++++
> > vl.c | 35 +++++++++++++++++++++++++++++++---
> > 13 files changed, 137 insertions(+), 25 deletions(-)
> >
> > --
> > 1.7.9.5
> >
>
^ permalink raw reply [flat|nested] 52+ messages in thread