From: "Collin L. Walling" <walling@linux.vnet.ibm.com>
To: qemu-s390x@nongnu.org, qemu-devel@nongnu.org
Cc: borntraeger@de.ibm.com, frankja@linux.vnet.ibm.com,
cohuck@redhat.com, thuth@redhat.com, david@redhat.com,
alifm@linux.vnet.ibm.com
Subject: [Qemu-devel] [PATCH v3 0/8] Interactive Boot Menu for DASD and SCSI Guests on s390x
Date: Mon, 15 Jan 2018 11:44:17 -0500 [thread overview]
Message-ID: <1516034665-27606-1-git-send-email-walling@linux.vnet.ibm.com> (raw)
--- [v3] ---
In an effort to make review less overwhelming, I've split up the larger commit
into 4 patches. It should be obvious how they all relate. This is for review
purposes unless it makes sense to keep them this way.
Patch "read input" contains the original commit message.
bootmap.c
In an effort to protect ourselves from the possible expansion of stage2 in
the future, I've changed the way that we read stage2 (described below). This
took some experimentation to find a somewhat efficient and easiest-to-read
approach without having to start from the beginning.
Previous Versions:
- define a scratch space to be as large as the current stage2 size (3 blks)
- load stage2 entirely in the defined space and parse it
- con: if stage2 expands, we'd have to update the Qemu code to accomodate
the new size (gross!)
Now:
- define a scratch space to be 4 blocks large (same size as "sec")
- load stage2 one-block-at-a-time, and parse each individual block
- if found, load the previous and next blocks (if possible)
- pro: we will be prepared to find the boot menu data if the stage2
bootloader expands toward its 24 block limit
Why load the previous block?
- the "flag" and "timeout" values that are stored by the zipl tool are
found at offsets prior to the boot menu banner
Why load the next block?
- this is a "just in case" measure when the boot menu entries span
multiple blocks (it *should not* span more than two)
menu.c
- separated some things into separate functions and added a few comments
menu.h
- defined offsets for the zipl flag and timeout values
libc.c
- created a wrapper for itostr that throws an assertion if provided array
is too small
ipl.c
- timeout is now stored as big endian
- set_boot_menu function is passed the iplb and now has a single
invocation (instead of one for each device type)
- loadparm interpretation is reverted to a similar design in v1. i.e.
we compare its value in pc-bios. This makes the most sense when
compared to the design in v2.
--- [Summary] ---
These patches implement a boot menu for ECKD DASD and SCSI guests on s390x.
The menu will only appear if the disk has been configured for IPL with the
zIPL tool and with the following QEMU command line options:
-boot menu=on[,splash-time=X] and/or -machine loadparm='prompt'
or via the following libvirt domain xml:
<os>
<bootmenu enable='yes' timeout='X'/>
</os>
or
<disk>
...
<boot order='1' loadparm='PROMPT'/>
</disk>
Where X is some positive integer representing time in milliseconds.
A loadparm other than 'prompt' will disable the menu and just boot
the specified entry.
If no boot options are specified, we will attempt to use the values
provided by zipl (ECKD DASD only).
Collin L. Walling (8):
s390-ccw: update libc
s390-ccw: ipl structs for eckd cdl/ldl
s390-ccw: parse and set boot menu options
s390-ccw: interactive boot menu for eckd dasd (menu setup)
s390-ccw: interactive boot menu for eckd dasd (read stage2 data)
s390-ccw: interactive boot menu for eckd dasd (print menu)
s390-ccw: interactive boot menu for eckd dasd (read input)
s390-ccw: interactive boot menu for scsi
hw/s390x/ipl.c | 54 ++++++++++
hw/s390x/ipl.h | 11 +-
pc-bios/s390-ccw/Makefile | 2 +-
pc-bios/s390-ccw/bootmap.c | 145 ++++++++++++++++++++++----
pc-bios/s390-ccw/bootmap.h | 72 +++++++------
pc-bios/s390-ccw/iplb.h | 11 +-
pc-bios/s390-ccw/libc.c | 83 +++++++++++++++
pc-bios/s390-ccw/libc.h | 31 ++++++
pc-bios/s390-ccw/main.c | 41 +++++---
pc-bios/s390-ccw/menu.c | 240 ++++++++++++++++++++++++++++++++++++++++++++
pc-bios/s390-ccw/menu.h | 35 +++++++
pc-bios/s390-ccw/s390-ccw.h | 2 +
pc-bios/s390-ccw/sclp.c | 30 ++++--
pc-bios/s390-ccw/virtio.c | 2 +-
14 files changed, 679 insertions(+), 80 deletions(-)
create mode 100644 pc-bios/s390-ccw/libc.c
create mode 100644 pc-bios/s390-ccw/menu.c
create mode 100644 pc-bios/s390-ccw/menu.h
--
2.7.4
next reply other threads:[~2018-01-15 16:45 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-15 16:44 Collin L. Walling [this message]
2018-01-15 16:44 ` [Qemu-devel] [PATCH v3 1/8] s390-ccw: update libc Collin L. Walling
2018-01-15 17:05 ` Eric Blake
2018-01-15 17:23 ` Collin L. Walling
2018-01-16 10:00 ` Thomas Huth
2018-01-16 17:19 ` [Qemu-devel] [qemu-s390x] " Collin L. Walling
2018-01-16 11:07 ` Christian Borntraeger
2018-01-16 15:32 ` Collin L. Walling
2018-01-16 15:48 ` Thomas Huth
2018-01-15 16:44 ` [Qemu-devel] [PATCH v3 2/8] s390-ccw: ipl structs for eckd cdl/ldl Collin L. Walling
2018-01-16 12:32 ` Thomas Huth
2018-01-16 15:21 ` [Qemu-devel] [qemu-s390x] " Collin L. Walling
2018-01-15 16:44 ` [Qemu-devel] [PATCH v3 3/8] s390-ccw: parse and set boot menu options Collin L. Walling
2018-01-16 12:44 ` Thomas Huth
2018-01-16 15:26 ` [Qemu-devel] [qemu-s390x] " Collin L. Walling
2018-01-15 16:44 ` [Qemu-devel] [PATCH v3 4/8] s390-ccw: interactive boot menu for eckd dasd (menu setup) Collin L. Walling
2018-01-16 18:23 ` Thomas Huth
2018-01-16 19:37 ` [Qemu-devel] [qemu-s390x] " Collin L. Walling
2018-01-17 6:11 ` Thomas Huth
2018-01-17 12:12 ` Collin L. Walling
2018-01-15 16:44 ` [Qemu-devel] [PATCH v3 5/8] s390-ccw: interactive boot menu for eckd dasd (read stage2 data) Collin L. Walling
2018-01-17 8:38 ` Thomas Huth
2018-01-17 9:12 ` [Qemu-devel] [qemu-s390x] " Thomas Huth
2018-01-17 12:29 ` Collin L. Walling
2018-01-15 16:44 ` [Qemu-devel] [PATCH v3 6/8] s390-ccw: interactive boot menu for eckd dasd (print menu) Collin L. Walling
2018-01-17 8:58 ` Thomas Huth
2018-01-15 16:44 ` [Qemu-devel] [PATCH v3 7/8] s390-ccw: interactive boot menu for eckd dasd (read input) Collin L. Walling
2018-01-17 10:10 ` Thomas Huth
2018-01-17 13:19 ` [Qemu-devel] [qemu-s390x] " Collin L. Walling
2018-01-15 16:44 ` [Qemu-devel] [PATCH v3 8/8] s390-ccw: interactive boot menu for scsi Collin L. Walling
2018-01-17 10:16 ` Thomas Huth
2018-01-15 16:58 ` [Qemu-devel] [PATCH v3 0/8] Interactive Boot Menu for DASD and SCSI Guests on s390x no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1516034665-27606-1-git-send-email-walling@linux.vnet.ibm.com \
--to=walling@linux.vnet.ibm.com \
--cc=alifm@linux.vnet.ibm.com \
--cc=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=david@redhat.com \
--cc=frankja@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).