S390: Enhance s390 BIOS to enable bootdevice selection
cover S390: Enhance s390 BIOS to enable bootdevice selection
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.
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(-)
Signature · 1 line
1.7.9.5
PATCH 1/10 Common: Add a default bootindex for all applicable devices
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.
vl.c +14 -3
@@ -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;
Signature · 1 line
1.7.9.5
Re: [Qemu-devel] [PATCH 01/10] Common: Add a default bootindex for all applicable devices
Quoted 9 lines · Dominik Dingel
Currently only devices with a positive boot index will be pushed in the
fw_boot_orderqueue, so if no boot index at all will be specified, the queue ends up empty.Instead we push exactly as
docs/bootindex.txtsays 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 <[email protected]>
Anthony, I'd like to have an ack/nack from you on this one.
Alex
Quoted 41 lines
vl.c +14
-3@@ -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;Signature · 1 line
1.7.9.5
Re: [Qemu-devel] [PATCH 01/10] Common: Add a default bootindex for all applicable devices
In reply to Dominik DingelQuoted 9 lines · Dominik Dingel
Currently only devices with a positive boot index will be pushed in the
fw_boot_orderqueue, so if no boot index at all will be specified, the queue ends up empty.Instead we push exactly as
docs/bootindex.txtsays 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 <[email protected]>
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
Quoted 40 lines
vl.c +14
-3@@ -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;Signature · 1 line
1.7.9.5
Re: [Qemu-devel] [PATCH 01/10] Common: Add a default bootindex for all applicable devices
Quoted 15 lines · On Fri, 26 Apr 2013 11:36:11 -0500 Anthony Liguori <[email protected]>…
Quoted 9 lines · Dominik Dingel
Currently only devices with a positive boot index will be pushed in the
fw_boot_orderqueue, so if no boot index at all will be specified, the queue ends up empty.Instead we push exactly as
docs/bootindex.txtsays 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 <[email protected]>Wouldn't this break the ability to say: "don't every try to boot from this device?"
Quoted 6 lines
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
Quoted 41 lines
Quoted 40 lines
vl.c +14
-3@@ -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;Signature · 1 line
1.7.9.5
Re: [Qemu-devel] [PATCH 01/10] Common: Add a default bootindex for all applicable devices
Quoted 31 lines · Dominik Dingel
Quoted 15 lines · On Fri, 26 Apr 2013 11:36:11 -0500 Anthony Liguori <[email protected]>…
Quoted 9 lines · Dominik Dingel
Currently only devices with a positive boot index will be pushed in the
fw_boot_orderqueue, so if no boot index at all will be specified, the queue ends up empty.Instead we push exactly as
docs/bootindex.txtsays 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 <[email protected]>Wouldn't this break the ability to say: "don't every try to boot from this device?"
Quoted 6 lines
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.
Wheredocs/bootindex.txtsays: if a device got no bootindex, it gets the lowest possibly priority...
Quoted 5 lines
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
Quoted 44 lines
Dominik
Quoted 41 lines
Quoted 40 lines
vl.c +14
-3@@ -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;Signature · 1 line
1.7.9.5
Re: [Qemu-devel] [PATCH 01/10] Common: Add a default bootindex for all applicable devices
Quoted 33 lines · Anthony Liguori
Quoted 31 lines · Dominik Dingel
Quoted 15 lines · On Fri, 26 Apr 2013 11:36:11 -0500 Anthony Liguori <[email protected]>…
Quoted 9 lines · Dominik Dingel
Currently only devices with a positive boot index will be pushed in the
fw_boot_orderqueue, so if no boot index at all will be specified, the queue ends up empty.Instead we push exactly as
docs/bootindex.txtsays 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 <[email protected]>Wouldn't this break the ability to say: "don't every try to boot from this device?"
Quoted 6 lines
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.
Wheredocs/bootindex.txtsays: if a device got no bootindex, it gets the lowest possibly priority...
Quoted 8 lines
Quoted 5 lines
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?
Quoted 10 lines
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.
Quoted 53 lines
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
Quoted 44 lines
Dominik
Quoted 41 lines
Quoted 40 lines
vl.c +14
-3@@ -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;Signature · 1 line
1.7.9.5
--
Gleb.
Re: [Qemu-devel] [PATCH 01/10] Common: Add a default bootindex for all applicable devices
Quoted 38 lines · On Fri, 26 Apr 2013 22:13:14 +0300 Gleb Natapov <[email protected]> wrote:
Quoted 37 lines · Anthony Liguori
Quoted 35 lines · Dominik Dingel
Quoted 15 lines · On Fri, 26 Apr 2013 11:36:11 -0500 Anthony Liguori <[email protected]>…
Quoted 9 lines · Dominik Dingel
Currently only devices with a positive boot index will be pushed in the
fw_boot_orderqueue, so if no boot index at all will be specified, the queue ends up empty.Instead we push exactly as
docs/bootindex.txtsays 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 <[email protected]>Wouldn't this break the ability to say: "don't every try to boot from this device?"
Quoted 6 lines
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.
Wheredocs/bootindex.txtsays: 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.
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
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.
Quoted 7 lines
Quoted 7 lines
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.
Quoted 7 lines
Quoted 3 lines
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
Quoted 57 lines
Quoted 53 lines
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
Quoted 44 lines
Dominik
Quoted 41 lines
Quoted 40 lines
vl.c +14
-3@@ -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;Signature · 1 line
1.7.9.5--
Gleb.
Re: [Qemu-devel] [PATCH 01/10] Common: Add a default bootindex for all applicable devices
Quoted 43 lines · Dominik Dingel
Quoted 40 lines · On Fri, 26 Apr 2013 22:13:14 +0300 Gleb Natapov <[email protected]> wrote:
Quoted 39 lines · Anthony Liguori
Quoted 36 lines · Dominik Dingel
Quoted 15 lines · On Fri, 26 Apr 2013 11:36:11 -0500 Anthony Liguori <[email protected]>…
Quoted 9 lines · Dominik Dingel
Currently only devices with a positive boot index will be pushed in the
fw_boot_orderqueue, so if no boot index at all will be specified, the queue ends up empty.Instead we push exactly as
docs/bootindex.txtsays 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 <[email protected]>Wouldn't this break the ability to say: "don't every try to boot from this device?"
Quoted 6 lines
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.
Wheredocs/bootindex.txtsays: 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?
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
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.txtdescribes.
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.
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
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.
Quoted 7 lines
Quoted 4 lines
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.
Quoted 1 line
Maybe someone should check if
docs/bootindex.txtis up to date? With all the changes in the code flow.
Definitely.
Quoted 8 lines
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.
Quoted 61 lines
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
Quoted 57 lines
Quoted 53 lines
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
Quoted 44 lines
Dominik
Quoted 41 lines
Quoted 40 lines
vl.c +14
-3@@ -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;Signature · 1 line
1.7.9.5--
Gleb.
--
Gleb.
Re: [Qemu-devel] [PATCH 01/10] Common: Add a default bootindex for all applicable devices
In reply to Dominik DingelQuoted 21 lines · Dominik Dingel
Quoted 18 lines · On Fri, 26 Apr 2013 11:36:11 -0500 Anthony Liguori <[email protected]>…
Quoted 9 lines · Dominik Dingel
Currently only devices with a positive boot index will be pushed in the
fw_boot_orderqueue, so if no boot index at all will be specified, the queue ends up empty.Instead we push exactly as
docs/bootindex.txtsays 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 <[email protected]>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.
Quoted 6 lines
Quoted 3 lines
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.txtsays: 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".
Quoted 1 line
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
PATCH 2/10 Common: Add quick access to first boot device
In reply to Dominik DingelInstead of manually parsing the boot_list as character stream, we can access the nth boot device, specified by the position in the boot order.
include/sysemu/sysemu.h +2 -0
@@ -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;
vl.c +18 -0
@@ -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.
Signature · 1 line
1.7.9.5
Re: [Qemu-devel] [PATCH 02/10] Common: Add quick access to first boot device
Quoted 6 lines · Dominik Dingel
Instead of manually parsing the
boot_listas character stream, we can access the nth boot device, specified by the position in the boot order.Signed-off-by Dominik Dingel <[email protected]>
Regards,
Anthony Liguori
Quoted 44 lines
include/sysemu/sysemu.h +2
-0@@ -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;vl.c +18
-0@@ -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. Signature · 1 line
1.7.9.5
PATCH 3/10 S390: Check Bootdevice Type
In reply to Dominik DingelCheck 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]
hw/s390x/ipl.c +26 -2
@@ -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)
Signature · 1 line
1.7.9.5
Re: [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type
Quoted 6 lines · 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_noin reg[7]
I thought we want a boot order, not a singular device to boot off of?
Alex
Quoted 67 lines
Signed-off-by Christian Paro <[email protected]>Signed-off-by Dominik Dingel <[email protected]>hw/s390x/ipl.c +26
-2@@ -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)Signature · 1 line
1.7.9.5
Re: [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type
Quoted 8 lines · Alexander Graf
Quoted 5 lines · 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.
Quoted 5 lines
Quoted 1 line
In case it is a virtio-ccw-blk device store the
dev_noin 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
Quoted 69 lines
Quoted 68 lines
Signed-off-by Christian Paro <[email protected]>Signed-off-by Dominik Dingel <[email protected]>hw/s390x/ipl.c +26
-2@@ -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)Signature · 1 line
1.7.9.5
Re: [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type
Quoted 27 lines · Christian Borntraeger
Quoted 8 lines · Alexander Graf
Quoted 5 lines · 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.Quoted 5 lines
Quoted 1 line
In case it is a virtio-ccw-blk device store the
dev_noin 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.
Quoted 7 lines
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
Re: [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type
Quoted 5 lines · Alexander Graf
Quoted 2 lines
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
Re: [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type
Quoted 15 lines · Christian Borntraeger
Quoted 5 lines · Alexander Graf
Quoted 2 lines
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.
Quoted 6 lines
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.
Quoted 2 lines
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
Re: [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type
Quoted 18 lines · On Fri, 26 Apr 2013 18:05:02 +0200 Alexander Graf <[email protected]> wrote:
Quoted 15 lines · Christian Borntraeger
Quoted 5 lines · Alexander Graf
Quoted 2 lines
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.
Quoted 8 lines
Quoted 6 lines
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.
Quoted 9 lines
Quoted 3 lines
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
Re: [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type
Quoted 24 lines · Dominik Dingel
Quoted 21 lines · On Fri, 26 Apr 2013 18:05:02 +0200 Alexander Graf <[email protected]> wrote:
Quoted 18 lines · Christian Borntraeger
Quoted 5 lines · Alexander Graf
Quoted 2 lines
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.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
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
Re: [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type
In reply to Alexander GrafQuoted 21 lines · Alexander Graf
Quoted 18 lines · Christian Borntraeger
Quoted 5 lines · Alexander Graf
Quoted 2 lines
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.
Quoted 7 lines
Quoted 3 lines
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.
Re: [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type
Quoted 26 lines · Christian Borntraeger
Quoted 25 lines · Alexander Graf
Quoted 21 lines · Christian Borntraeger
Quoted 5 lines · Alexander Graf
Quoted 2 lines
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.
Quoted 6 lines
Quoted 3 lines
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
Re: [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type
Quoted 32 lines · Alexander Graf
Quoted 30 lines · Christian Borntraeger
Quoted 28 lines · Alexander Graf
Quoted 15 lines · Christian Borntraeger
Quoted 5 lines · Alexander Graf
Quoted 2 lines
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.
Quoted 6 lines
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.
Quoted 5 lines
Quoted 2 lines
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
Quoted 3 lines
Alex
Re: [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type
In reply to Alexander GrafQuoted 35 lines · On Fri, 26 Apr 2013 17:48:37 +0200 Alexander Graf <[email protected]> wrote:
Quoted 32 lines · Christian Borntraeger
Quoted 8 lines · Alexander Graf
Quoted 5 lines · 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.Quoted 5 lines
Quoted 1 line
In case it is a virtio-ccw-blk device store the
dev_noin 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.
Quoted 7 lines
Quoted 2 lines
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
Re: [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type
Quoted 44 lines · Dominik Dingel
Quoted 41 lines · On Fri, 26 Apr 2013 17:48:37 +0200 Alexander Graf <[email protected]> wrote:
Quoted 27 lines · Christian Borntraeger
Quoted 8 lines · Alexander Graf
Quoted 5 lines · 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.Quoted 5 lines
Quoted 1 line
In case it is a virtio-ccw-blk device store the
dev_noin 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.Quoted 7 lines
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.
Quoted 6 lines
Quoted 1 line
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.txtand 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
Re: [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type
In reply to Alexander GrafQuoted 8 lines · On Fri, 26 Apr 2013 17:22:08 +0200 Alexander Graf <[email protected]> wrote:
Quoted 5 lines · 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.
Quoted 5 lines
Quoted 1 line
In case it is a virtio-ccw-blk device store the
dev_noin 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
Quoted 69 lines
Quoted 68 lines
Signed-off-by Christian Paro <[email protected]>Signed-off-by Dominik Dingel <[email protected]>hw/s390x/ipl.c +26
-2@@ -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)Signature · 1 line
1.7.9.5
Re: [Qemu-devel] [PATCH 03/10] S390: Check Bootdevice Type
In reply to Dominik DingelQuoted 51 lines · 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_noin reg[7]Signed-off-by Christian Paro <[email protected]>Signed-off-by Dominik Dingel <[email protected]>hw/s390x/ipl.c +14
-1@@ -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); }
hw/s390x/ipl.c static void s390_ipl_reset(DeviceState *dev) · line 169
Quoted 6 lines
hw/s390x/ipl.c +2
-1@@ -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
Quoted 16 lines
hw/s390x/ipl.c +10
-0+ } + +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)Signature · 1 line
1.7.9.5
PATCH 4/10 S390: check if BIOS is available and create links
In reply to Dominik DingelCheck 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.
configure +1 -0
@@ -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
hw/s390x/ipl.c +4 -0
@@ -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 ) {
pc-bios/s390-ccw/Makefile +1 -0
@@ -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 *~
Signature · 1 line
1.7.9.5
Re: [Qemu-devel] [PATCH 04/10] S390: check if BIOS is available and create links
Quoted 43 lines · Dominik Dingel
Signed-off-by Dominik Dingel <[email protected]>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.
configure +1
-0@@ -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
hw/s390x/ipl.c +4
-0@@ -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 ) {pc-bios/s390-ccw/Makefile +0
-0@@ -21,6 +21,7 @@ s390-ccw.elf: $(OBJECTS)s390-ccw.img: s390-ccw.elf
$(call quiet-command,strip $< -o $@," Stripping $(TARGET_DIR)$@")
pc-bios/s390-ccw/Makefile s390-ccw.elf: $(OBJECTS) · line 24
Quoted 1 line
pc-bios/s390-ccw/Makefile +1
-0+ ln -s -f `pwd`/$@ ../$@
I don't think we do this for any other blobs, so why should we here?
Alex
Quoted 6 lines
clean:
rm -f *.o *.d *.img *.elf *~Signature · 1 line
1.7.9.5
Re: [Qemu-devel] [PATCH 04/10] S390: check if BIOS is available and create links
Quoted 44 lines · On Fri, 26 Apr 2013 17:23:18 +0200 Alexander Graf <[email protected]> wrote:
Quoted 41 lines · Dominik Dingel
Signed-off-by Dominik Dingel <[email protected]>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.
configure +1
-0@@ -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
hw/s390x/ipl.c +4
-0@@ -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 ) {pc-bios/s390-ccw/Makefile +0
-0@@ -21,6 +21,7 @@ s390-ccw.elf: $(OBJECTS)
Quoted 7 lines
pc-bios/s390-ccw/Makefile s390-ccw.elf: $(OBJECTS) · line 24
Quoted 3 lines
s390-ccw.img: s390-ccw.elf
$(call quiet-command,strip $< -o $@," Stripping $(TARGET_DIR)$@")pc-bios/s390-ccw/Makefile +1
-0+ 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
Quoted 7 lines
Quoted 6 lines
clean:
rm -f *.o *.d *.img *.elf *~Signature · 1 line
1.7.9.5
Re: [Qemu-devel] [PATCH 04/10] S390: check if BIOS is available and create links
Quoted 53 lines · Dominik Dingel
Quoted 50 lines · On Fri, 26 Apr 2013 17:23:18 +0200 Alexander Graf <[email protected]> wrote:
Quoted 43 lines · Dominik Dingel
Signed-off-by Dominik Dingel <[email protected]>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.
configure +1
-0@@ -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
hw/s390x/ipl.c +4
-0@@ -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 ) {pc-bios/s390-ccw/Makefile +0
-0@@ -21,6 +21,7 @@ s390-ccw.elf: $(OBJECTS)s390-ccw.img: s390-ccw.elf
$(call quiet-command,strip $< -o $@," Stripping $(TARGET_DIR)$@")pc-bios/s390-ccw/Makefile s390-ccw.elf: $(OBJECTS) · line 24
Quoted 1 line
pc-bios/s390-ccw/Makefile +1
-0+ ln -s -f `pwd`/$@ ../$@I don't think we do this for any other blobs, so why should we here?
Quoted 5 lines
Quoted 1 line
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
Re: [Qemu-devel] [PATCH 04/10] S390: check if BIOS is available and create links
Quoted 58 lines · On Fri, 26 Apr 2013 17:57:44 +0200 Alexander Graf <[email protected]> wrote:
Quoted 55 lines · Dominik Dingel
Quoted 51 lines · On Fri, 26 Apr 2013 17:23:18 +0200 Alexander Graf <[email protected]> wrote:
Quoted 43 lines · Dominik Dingel
Signed-off-by Dominik Dingel <[email protected]>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.
configure +1
-0@@ -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
hw/s390x/ipl.c +4
-0@@ -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 ) {pc-bios/s390-ccw/Makefile +0
-0@@ -21,6 +21,7 @@ s390-ccw.elf: $(OBJECTS)s390-ccw.img: s390-ccw.elf
$(call quiet-command,strip $< -o $@," Stripping $(TARGET_DIR)$@")pc-bios/s390-ccw/Makefile s390-ccw.elf: $(OBJECTS) · line 24
Quoted 1 line
pc-bios/s390-ccw/Makefile +1
-0+ ln -s -f `pwd`/$@ ../$@I don't think we do this for any other blobs, so why should we here?
Alex
Quoted 9 lines
Quoted 3 lines
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
Re: [Qemu-devel] [PATCH 04/10] S390: check if BIOS is available and create links
Quoted 71 lines · Dominik Dingel
Quoted 58 lines · On Fri, 26 Apr 2013 17:57:44 +0200 Alexander Graf <[email protected]> wrote:
Quoted 55 lines · Dominik Dingel
Quoted 51 lines · On Fri, 26 Apr 2013 17:23:18 +0200 Alexander Graf <[email protected]> wrote:
Quoted 43 lines · Dominik Dingel
Signed-off-by Dominik Dingel <[email protected]>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.
configure +1
-0@@ -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
hw/s390x/ipl.c +4
-0@@ -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 ) {pc-bios/s390-ccw/Makefile +0
-0@@ -21,6 +21,7 @@ s390-ccw.elf: $(OBJECTS)s390-ccw.img: s390-ccw.elf
$(call quiet-command,strip $< -o $@," Stripping $(TARGET_DIR)$@")pc-bios/s390-ccw/Makefile s390-ccw.elf: $(OBJECTS) · line 24
Quoted 1 line
pc-bios/s390-ccw/Makefile +1
-0+ ln -s -f `pwd`/$@ ../$@I don't think we do this for any other blobs, so why should we here?
Alex
Quoted 9 lines
Quoted 3 lines
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
Quoted 8 lines
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
Re: [Qemu-devel] [PATCH 04/10] S390: check if BIOS is available and create links
In reply to Alexander GrafQuoted 55 lines · Alexander Graf
Quoted 53 lines · Dominik Dingel
Quoted 50 lines · On Fri, 26 Apr 2013 17:23:18 +0200 Alexander Graf <[email protected]> wrote:
Quoted 43 lines · Dominik Dingel
Signed-off-by Dominik Dingel <[email protected]>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.
configure +1
-0@@ -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
hw/s390x/ipl.c +4
-0@@ -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 ) {pc-bios/s390-ccw/Makefile +0
-0@@ -21,6 +21,7 @@ s390-ccw.elf: $(OBJECTS)s390-ccw.img: s390-ccw.elf
$(call quiet-command,strip $< -o $@," Stripping $(TARGET_DIR)$@")pc-bios/s390-ccw/Makefile s390-ccw.elf: $(OBJECTS) · line 24
Quoted 1 line
pc-bios/s390-ccw/Makefile +1
-0+ ln -s -f `pwd`/$@ ../$@I don't think we do this for any other blobs, so why should we here?
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
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
Quoted 3 lines
Alex
Re: [Qemu-devel] [PATCH 04/10] S390: check if BIOS is available and create links
Quoted 63 lines · On Fri, 26 Apr 2013 11:38:00 -0500 Anthony Liguori <[email protected]>…
Quoted 61 lines · Alexander Graf
Quoted 58 lines · Dominik Dingel
Quoted 44 lines · On Fri, 26 Apr 2013 17:23:18 +0200 Alexander Graf <[email protected]> wrote:
Quoted 41 lines · Dominik Dingel
Signed-off-by Dominik Dingel <[email protected]>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.
configure +1
-0@@ -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
hw/s390x/ipl.c +4
-0@@ -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 ) {pc-bios/s390-ccw/Makefile +0
-0@@ -21,6 +21,7 @@ s390-ccw.elf: $(OBJECTS)Quoted 7 lines
pc-bios/s390-ccw/Makefile s390-ccw.elf: $(OBJECTS) · line 24
Quoted 3 lines
s390-ccw.img: s390-ccw.elf
$(call quiet-command,strip $< -o $@," Stripping $(TARGET_DIR)$@")pc-bios/s390-ccw/Makefile +1
-0+ 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.
Quoted 7 lines
Quoted 1 line
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
Quoted 4 lines
Quoted 3 lines
Alex
Re: [Qemu-devel] [PATCH 04/10] S390: check if BIOS is available and create links
Quoted 68 lines · Dominik Dingel
Quoted 65 lines · On Fri, 26 Apr 2013 11:38:00 -0500 Anthony Liguori <[email protected]>…
Quoted 62 lines · Alexander Graf
Quoted 53 lines · Dominik Dingel
Quoted 50 lines · On Fri, 26 Apr 2013 17:23:18 +0200 Alexander Graf <[email protected]> wrote:
Quoted 43 lines · Dominik Dingel
Signed-off-by Dominik Dingel <[email protected]>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.
configure +1
-0@@ -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
hw/s390x/ipl.c +4
-0@@ -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 ) {pc-bios/s390-ccw/Makefile +0
-0@@ -21,6 +21,7 @@ s390-ccw.elf: $(OBJECTS)s390-ccw.img: s390-ccw.elf
$(call quiet-command,strip $< -o $@," Stripping $(TARGET_DIR)$@")pc-bios/s390-ccw/Makefile s390-ccw.elf: $(OBJECTS) · line 24
Quoted 1 line
pc-bios/s390-ccw/Makefile +1
-0+ ln -s -f `pwd`/$@ ../$@I don't think we do this for any other blobs, so why should we here?
Quoted 5 lines
Quoted 1 line
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.
Quoted 7 lines
Quoted 5 lines
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
PATCH 5/10 s390-ccw.img: Detect devices with stsch.
In reply to Dominik DingelFrom: Cornelia Huck <[email protected]>
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).
pc-bios/s390-ccw/main.c +6 -3
@@ -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 ;
Signature · 1 line
1.7.9.5
PATCH 6/10 s390-ccw.img: Enhance drain_irqs().
In reply to Dominik DingelFrom: Cornelia Huck <[email protected]>
- Use tpi + tsch to get interrupts.
- Return an error if the irb indicates problems.
pc-bios/s390-ccw/virtio.c +11 -2
@@ -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; } } }
Signature · 1 line
1.7.9.5
PATCH 7/10 s390-ccw.img: Rudimentary error checking.
In reply to Dominik DingelFrom: Cornelia Huck <[email protected]>
Try to handle at least some of the errors that may happen.
pc-bios/s390-ccw/virtio.c +15 -6
@@ -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)
Signature · 1 line
1.7.9.5
PATCH 8/10 s390-ccw.img: Get queue config from host.
In reply to Dominik DingelFrom: Cornelia Huck <[email protected]>
Ask the host about the configuration instead of guessing it.
pc-bios/s390-ccw/virtio.c +7 -3
@@ -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))) {
pc-bios/s390-ccw/virtio.h +5 -0
@@ -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;
Signature · 1 line
1.7.9.5
PATCH 9/10 S390: Pass per-device loadparm values for CCW blk and net devs.
In reply to Dominik DingelFrom: Christian Paro <[email protected]>
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.
hw/s390x/virtio-ccw.c +2 -0
@@ -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 (),
hw/s390x/virtio-ccw.h +1 -0
@@ -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;
Signature · 1 line
1.7.9.5
Re: [Qemu-devel] [PATCH 09/10] S390: Pass per-device loadparm values for CCW blk and net devs.
Quoted 13 lines · Dominik Dingel
From: Christian Paro <[email protected]>
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 <[email protected]>hw/s390x/virtio-ccw.c +0
-0
hw/s390x/virtio-ccw.c static const VirtIOBindings virtio_ccw_bindings = { · line 794
Quoted 4 lines
hw/s390x/virtio-ccw.c +1
-0@@ -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
Quoted 26 lines
hw/s390x/virtio-ccw.c +1
-0DEFINE_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 (),hw/s390x/virtio-ccw.h +1
-0@@ -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;Signature · 1 line
1.7.9.5
Re: [Qemu-devel] [PATCH 09/10] S390: Pass per-device loadparm values for CCW blk and net devs.
Quoted 17 lines · On Fri, 26 Apr 2013 18:52:48 +0200 Alexander Graf <[email protected]> wrote:
Quoted 14 lines · Dominik Dingel
From: Christian Paro <[email protected]>
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 <[email protected]>hw/s390x/virtio-ccw.c +0
-0@@ -791,6 +791,7 @@ static const VirtIOBindings virtio_ccw_bindings = {
Quoted 8 lines
hw/s390x/virtio-ccw.c static const VirtIOBindings virtio_ccw_bindings = { · line 794
Quoted 3 lines
hw/s390x/virtio-ccw.c +1
-0static 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
Quoted 27 lines
Quoted 26 lines
hw/s390x/virtio-ccw.c +1
-0DEFINE_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 (),hw/s390x/virtio-ccw.h +1
-0@@ -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;Signature · 1 line
1.7.9.5
Re: [Qemu-devel] [PATCH 09/10] S390: Pass per-device loadparm values for CCW blk and net devs.
Quoted 27 lines · Dominik Dingel
Quoted 24 lines · On Fri, 26 Apr 2013 18:52:48 +0200 Alexander Graf <[email protected]> wrote:
Quoted 13 lines · Dominik Dingel
From: Christian Paro <[email protected]>
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 <[email protected]>hw/s390x/virtio-ccw.c +0
-0hw/s390x/virtio-ccw.c static const VirtIOBindings virtio_ccw_bindings = { · line 794
Quoted 4 lines
hw/s390x/virtio-ccw.c +1
-0@@ -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?
Quoted 3 lines
Quoted 1 line
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_idis 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
Re: [Qemu-devel] [PATCH 09/10] S390: Pass per-device loadparm values for CCW blk and net devs.
Quoted 30 lines · Alexander Graf
Quoted 27 lines · Dominik Dingel
Quoted 24 lines · On Fri, 26 Apr 2013 18:52:48 +0200 Alexander Graf <[email protected]> wrote:
Quoted 13 lines · Dominik Dingel
From: Christian Paro <[email protected]>
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 <[email protected]>hw/s390x/virtio-ccw.c +0
-0hw/s390x/virtio-ccw.c static const VirtIOBindings virtio_ccw_bindings = { · line 794
Quoted 4 lines
hw/s390x/virtio-ccw.c +1
-0@@ -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?
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
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_idis 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.
PATCH 10/10 S390: Enabling device and program selection
In reply to Dominik DingelPass 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.
hw/s390x/ipl.c +4 -0
@@ -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); }
pc-bios/s390-ccw.img binary +0 -0
pc-bios/s390-ccw/bootmap.c +2 -2
@@ -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);
pc-bios/s390-ccw/main.c +18 -4
@@ -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; + registeruint64_t reg7 asm("7" ); + registeruint64_t reg8 asm("8" ); + + asmvolatile ( +" 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 ) { } }
pc-bios/s390-ccw/s390-ccw.h +1 -1
@@ -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) {
Signature · 1 line
1.7.9.5
Re: [Qemu-devel] [PATCH 10/10] S390: Enabling device and program selection
Quoted 11 lines · 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 <[email protected]>hw/s390x/ipl.c +0
-0
hw/s390x/ipl.c static void s390_ipl_from_disk(VirtIOBlkCcw *dev, uint64_t pswaddr) · line 83
Quoted 7 lines
hw/s390x/ipl.c +4
-0@@ -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.
pc-bios/s390-ccw.img
Quoted 4 lines
hw/s390x/ipl.c +0
-0s390_add_running_cpu (cpu); }pc-bios/s390-ccw.img +0
-0
Please do blob patches at the end of the series in a separate patch.
Alex
Quoted 231 lines
index
b549a86e55194bbf54e25f839e52b490ac308260..fe8d2c6b9f5d937ea156084f7eb248b17e1fa89c100644 GIT binary patch
literal 17528
zcmeHPe^4CPeSf=ma0fzoCCl<ja_q%s671OcKscqgr#T5skVlb;qNFHJA|oA$8zZ2{ zNlRzOKNqh)=J{>*s0UWAIubT8V_k#gf!5h<)+ni=tN0Kq8Yo5XG-T}M>V#EE$mVo z@%s6G-l(06N>SSJJUaIXSlcT?f3Vu_kDXe{P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AzH#|kjs4!1caUqp5Moz3GWjv6olqbugy& 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-lN) 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-qmcNpc-bios/s390-ccw/bootmap.c +2
-2@@ -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);pc-bios/s390-ccw/main.c +18
-4@@ -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; + registeruint64_t reg7 asm("7" ); + registeruint64_t reg8 asm("8" ); + + asmvolatile ( +" 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 ) { } }pc-bios/s390-ccw/s390-ccw.h +1
-1@@ -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) {Signature · 1 line
1.7.9.5
Re: [Qemu-devel] [PATCH 10/10] S390: Enabling device and program selection
In reply to Dominik DingelQuoted 202 lines · 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 <[email protected]>hw/s390x/ipl.c +4
-0@@ -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); }pc-bios/s390-ccw.img binary +0
-0pc-bios/s390-ccw/bootmap.c +2
-2@@ -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);pc-bios/s390-ccw/main.c +1
-1@@ -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;
pc-bios/s390-ccw/main.c static void virtio_setup(void) · line 38
Quoted 5 lines
pc-bios/s390-ccw/main.c +1
-1@@ -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.
Quoted 8 lines
pc-bios/s390-ccw/main.c +1
-0if (virtio_is_blk (blk_schid)) { found = true;break ;@@ -52,10 +52,24 @@ static void virtio_setup(void)int main (void ) { +uint64_t boot_value;
pc-bios/s390-ccw/main.c static void virtio_setup(void) · line 65
Quoted 10 lines
pc-bios/s390-ccw/main.c +10
-0+uint64_t load_parm; + registeruint64_t reg7 asm("7" ); + registeruint64_t reg8 asm("8" ); + + asmvolatile ( +" 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
Quoted 28 lines
pc-bios/s390-ccw/main.c +5
-2+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 ) { } }pc-bios/s390-ccw/s390-ccw.h +1
-1@@ -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) {Signature · 1 line
1.7.9.5
Re: [Qemu-devel] [PATCH 10/10] S390: Enabling device and program selection
Quoted 199 lines · On Fri, 26 Apr 2013 18:56:44 +0200 Alexander Graf <[email protected]> wrote:
Quoted 196 lines · 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 <[email protected]>hw/s390x/ipl.c +4
-0@@ -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); }pc-bios/s390-ccw.img binary +0
-0pc-bios/s390-ccw/bootmap.c +2
-2@@ -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);pc-bios/s390-ccw/main.c +0
-0@@ -20,7 +20,7 @@ void virtio_panic(const char *string)while (1 ) { } }
Quoted 13 lines
pc-bios/s390-ccw/main.c static void virtio_setup(void) · line 38
Quoted 11 lines
pc-bios/s390-ccw/main.c +2
-2-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_nopassed 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.
Quoted 6 lines
Quoted 6 lines
pc-bios/s390-ccw/main.c +0
-0if (virtio_is_blk (blk_schid)) { found = true;break ;@@ -52,10 +52,24 @@ static void virtio_setup(void)
Quoted 15 lines
pc-bios/s390-ccw/main.c static void virtio_setup(void) · line 65
Quoted 13 lines
pc-bios/s390-ccw/main.c +11
-0int main (void ) { +uint64_t boot_value; +uint64_t load_parm; + registeruint64_t reg7 asm("7" ); + registeruint64_t reg8 asm("8" ); + + asmvolatile ( +" 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.
Quoted 32 lines
Alex
Quoted 28 lines
pc-bios/s390-ccw/main.c +5
-2+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 ) { } }pc-bios/s390-ccw/s390-ccw.h +1
-1@@ -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) {Signature · 1 line
1.7.9.5
Re: [Qemu-devel] [PATCH 10/10] S390: Enabling device and program selection
Quoted 216 lines · Dominik Dingel
Quoted 199 lines · On Fri, 26 Apr 2013 18:56:44 +0200 Alexander Graf <[email protected]> wrote:
Quoted 196 lines · 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 <[email protected]>hw/s390x/ipl.c +4
-0@@ -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); }pc-bios/s390-ccw.img binary +0
-0pc-bios/s390-ccw/bootmap.c +2
-2@@ -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);pc-bios/s390-ccw/main.c +0
-0@@ -20,7 +20,7 @@ void virtio_panic(const char *string)while (1 ) { } }Quoted 13 lines
pc-bios/s390-ccw/main.c static void virtio_setup(void) · line 38
Quoted 11 lines
pc-bios/s390-ccw/main.c +2
-2-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_nopassed in? We need to support the mode where the user doesn't specify any device he wants to boot from.
Quoted 1 line
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.
Quoted 23 lines
Quoted 7 lines
Quoted 7 lines
pc-bios/s390-ccw/main.c +0
-0if (virtio_is_blk (blk_schid)) { found = true;break ;@@ -52,10 +52,24 @@ static void virtio_setup(void)Quoted 15 lines
pc-bios/s390-ccw/main.c static void virtio_setup(void) · line 65
Quoted 13 lines
pc-bios/s390-ccw/main.c +11
-0int main (void ) { +uint64_t boot_value; +uint64_t load_parm; + registeruint64_t reg7 asm("7" ); + registeruint64_t reg8 asm("8" ); + + asmvolatile ( +" 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?
Quoted 1 line
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
Quoted 10 lines · Dominik Dingel
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 aload_parmto 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.
Quoted 8 lines
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: Enhancedrain_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
Quoted 26 lines
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 selectionconfigure | 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(-)Signature · 1 line
1.7.9.5
Quoted 22 lines · On Fri, 26 Apr 2013 18:19:29 +0200 Alexander Graf <[email protected]> wrote:
Quoted 10 lines · Dominik Dingel
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 aload_parmto 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.
Quoted 8 lines
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: Enhancedrain_irqs().
s390-ccw.img: Rudimentary error checking.
s390-ccw.img: Get queue config from host.
Quoted 4 lines
I've applied Connie's patches out of this patch set meanwhile.
Alex
Thanks :).
Quoted 28 lines
Quoted 27 lines
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 selectionconfigure | 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(-)Signature · 1 line
1.7.9.5