[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [qemu-s390x] [RFC 03/15] s390-bios: decouple common boo
From: |
Thomas Huth |
Subject: |
Re: [Qemu-devel] [qemu-s390x] [RFC 03/15] s390-bios: decouple common boot logic from virtio |
Date: |
Wed, 11 Jul 2018 12:41:32 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 |
On 05.07.2018 19:25, Jason J. Herne wrote:
> From: "Jason J. Herne" <address@hidden>
git commit --amend --reset-author ?
> Create a boot_setup function to handle getting boot information from
> the machine/hypervisor. This decouples common boot logic from the
> virtio code path and allows us to make use of it for the real dasd boot
> scenario.
>
> Signed-off-by: Jason J. Herne <address@hidden>
> Acked-by: Halil Pasic <address@hidden>
> Reviewed-by: Collin Walling <address@hidden
> Signed-off-by: Jason J. Herne <address@hidden>
> ---
> pc-bios/s390-ccw/main.c | 28 ++++++++++++++++++++--------
> 1 file changed, 20 insertions(+), 8 deletions(-)
>
> diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
> index 63117d1..8ecab93 100644
> --- a/pc-bios/s390-ccw/main.c
> +++ b/pc-bios/s390-ccw/main.c
> @@ -14,16 +14,17 @@
>
> char stack[PAGE_SIZE * 8] __attribute__((__aligned__(PAGE_SIZE)));
> static SubChannelId blk_schid = { .one = 1 };
> -IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE)));
> static char loadparm_str[LOADPARM_LEN + 1] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
> QemuIplParameters qipl;
> +IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE)));
> +static bool have_iplb;
>
> #define LOADPARM_PROMPT "PROMPT "
> #define LOADPARM_EMPTY " "
> #define BOOT_MENU_FLAG_MASK (QIPL_FLAG_BM_OPTS_CMD | QIPL_FLAG_BM_OPTS_ZIPL)
>
> /*
> - * Priniciples of Operations (SA22-7832-09) chapter 17 requires that
> + * Principles of Operations (SA22-7832-09) chapter 17 requires that
> * a subsystem-identification is at 184-187 and bytes 188-191 are zero
> * after list-directed-IPL and ccw-IPL.
> */
> @@ -111,23 +112,33 @@ static void cio_setup(void)
> enable_mss_facility();
> }
>
> +/*
> + * Collect various pieces of information from the hypervisor/hardware that
> + * we'll use to determine exactly how we'll boot.
> + */
> +static void boot_setup(void)
> +{
> + char lpmsg[] = "LOADPARM=[________]\n";
> +
> + sclp_get_loadparm_ascii(loadparm_str);
> + memcpy(lpmsg + 10, loadparm_str, 8);
> + sclp_print(lpmsg);
> +
> + have_iplb = store_iplb(&iplb);
> +}
> +
> static void virtio_setup(void)
> {
> Schib schib;
> int ssid;
> bool found = false;
> uint16_t dev_no;
> - char ldp[] = "LOADPARM=[________]\n";
> VDev *vdev = virtio_get_device();
> QemuIplParameters *early_qipl = (QemuIplParameters *)QIPL_ADDRESS;
>
> - sclp_get_loadparm_ascii(loadparm_str);
> - memcpy(ldp + 10, loadparm_str, LOADPARM_LEN);
> - sclp_print(ldp);
> -
> memcpy(&qipl, early_qipl, sizeof(QemuIplParameters));
>
> - if (store_iplb(&iplb)) {
> + if (have_iplb) {
> switch (iplb.pbt) {
> case S390_IPL_TYPE_CCW:
> dev_no = iplb.ccw.devno;
> @@ -174,6 +185,7 @@ int main(void)
> {
> sclp_setup();
> cio_setup();
> + boot_setup();
Maybe rather name it bootparm_setup? Just "boot" is IMHO a little bit
too generic... Anyway:
Reviewed-by: Thomas Huth <address@hidden>
- Re: [Qemu-devel] [RFC 15/15] s390-bios: Use sense ccw to ensure consistent device state at boot time, (continued)
- [Qemu-devel] [RFC 05/15] s390-bios: Factor finding boot device out of virtio code path, Jason J. Herne, 2018/07/05
- [Qemu-devel] [RFC 12/15] s390-bios: Use control unit type to determine boot method, Jason J. Herne, 2018/07/05
- [Qemu-devel] [RFC 02/15] s390-bios: decouple cio setup from virtio, Jason J. Herne, 2018/07/05
- [Qemu-devel] [RFC 11/15] s390-bios: Refactor virtio to run channel programs via cio, Jason J. Herne, 2018/07/05
- [Qemu-devel] [RFC 03/15] s390-bios: decouple common boot logic from virtio, Jason J. Herne, 2018/07/05
- Re: [Qemu-devel] [qemu-s390x] [RFC 03/15] s390-bios: decouple common boot logic from virtio,
Thomas Huth <=
- [Qemu-devel] [RFC 07/15] s390-bios: Decouple channel i/o logic from virtio, Jason J. Herne, 2018/07/05
- [Qemu-devel] [RFC 14/15] s390-bios: Support booting from real dasd device, Jason J. Herne, 2018/07/05
- Re: [Qemu-devel] [qemu-s390x] [RFC 14/15] s390-bios: Support booting from real dasd device, David Hildenbrand, 2018/07/17
- Re: [Qemu-devel] [qemu-s390x] [RFC 14/15] s390-bios: Support booting from real dasd device, Cornelia Huck, 2018/07/18
- Re: [Qemu-devel] [qemu-s390x] [RFC 14/15] s390-bios: Support booting from real dasd device, David Hildenbrand, 2018/07/18
- Re: [Qemu-devel] [qemu-s390x] [RFC 14/15] s390-bios: Support booting from real dasd device, Halil Pasic, 2018/07/18
- Re: [Qemu-devel] [qemu-s390x] [RFC 14/15] s390-bios: Support booting from real dasd device, Cornelia Huck, 2018/07/18
- Re: [Qemu-devel] [qemu-s390x] [RFC 14/15] s390-bios: Support booting from real dasd device, Halil Pasic, 2018/07/18
Re: [Qemu-devel] [RFC 14/15] s390-bios: Support booting from real dasd device, Halil Pasic, 2018/07/18