- document s390x boot devices

- bug fixes
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEEw9DWbcNiT/aowBjO3s9rk8bwL68FAl9HpCkSHGNvaHVja0By
 ZWRoYXQuY29tAAoJEN7Pa5PG8C+v3fUP/2o4ARBR2WeopsJQTqL543CTMKPVUzs5
 P9280lP2pG0zrpZ//HIGrFv2SWEizXvhXqagX0SJhWWp4wLNFsXdQSdn3HNWGsWR
 6kMEI2AfoJO9Z1pR+UCEbXnhMrl+FX2pd6mewUROZuhnTm8ktOlgrCOc+QGMrPZI
 BRU0q4fWcD/HDS6JEfIJw6jqCyE55+jlI53FH9apgLHOqqF+bbw4nwvsYXL9q0D9
 YQPFyy9w8Q3mwLdznrYuxfwnSJfyxB5irD/iOZbjDUB4b2Gv09+bD2E3OG08leyu
 Q3Fj8AWkZYkD8k9gjbnijbhGSOI/TS1kjrTTWh68p6M/YWDp+BlLJRs0V6wDCDnz
 eRXG+Rf0qxKozVv70yFo7vUS2HZiE//qN/gQhiVzkFND+9/5rjpGiStRkzbDF9O6
 TAD6XbAUJ3wXCBwmEpmmzLjF31zngCFtAqaPKRvkL0644KWxHG8FRgMhcKBuvn9g
 CaCnKkQUt3ryAKZqX39TOh9qR72b4K1UZtwz0HWgjN3beewTnYH8t7GFVt9GyUQ2
 xwnrm6P0q43UJITOU0Ag2YL3d3ZLzc7rOzoBpZwmlt5/Sl7MzIte03i4JxuF9yj/
 cPBT9l7SPWkRwiqsIpE1ukZcBhxWGlp4or7yGM5dMM2GAg2tWA2S/n9UNuGGC6TK
 jwi361KSy4W/
 =PCke
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20200827' into staging

- document s390x boot devices
- bug fixes

# gpg: Signature made Thu 27 Aug 2020 13:16:41 BST
# gpg:                using RSA key C3D0D66DC3624FF6A8C018CEDECF6B93C6F02FAF
# gpg:                issuer "cohuck@redhat.com"
# gpg: Good signature from "Cornelia Huck <conny@cornelia-huck.de>" [unknown]
# gpg:                 aka "Cornelia Huck <huckc@linux.vnet.ibm.com>" [full]
# gpg:                 aka "Cornelia Huck <cornelia.huck@de.ibm.com>" [full]
# gpg:                 aka "Cornelia Huck <cohuck@kernel.org>" [unknown]
# gpg:                 aka "Cornelia Huck <cohuck@redhat.com>" [unknown]
# Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF

* remotes/cohuck/tags/s390x-20200827:
  hw/vfio/ap: Plug memleak in vfio_ap_get_group()
  docs/system/s390x: Add a chapter about s390x boot devices
  virtio-ccw-input: fix description

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2020-08-27 13:48:12 +01:00
commit ac8b279f13
4 changed files with 85 additions and 1 deletions

View File

@ -0,0 +1,82 @@
Boot devices on s390x
=====================
Booting with bootindex parameter
--------------------------------
For classical mainframe guests (i.e. LPAR or z/VM installations), you always
have to explicitly specify the disk where you want to boot from (or "IPL" from,
in s390x-speak -- IPL means "Initial Program Load"). In particular, there can
also be only one boot device according to the architecture specification, thus
specifying multiple boot devices is not possible (yet).
So for booting an s390x guest in QEMU, you should always mark the
device where you want to boot from with the ``bootindex`` property, for
example::
qemu-system-s390x -drive if=none,id=dr1,file=guest.qcow2 \
-device virtio-blk,drive=dr1,bootindex=1
For booting from a CD-ROM ISO image (which needs to include El-Torito boot
information in order to be bootable), it is recommended to specify a ``scsi-cd``
device, for example like this::
qemu-system-s390x -blockdev file,node-name=c1,filename=... \
-device virtio-scsi \
-device scsi-cd,drive=c1,bootindex=1
Note that you really have to use the ``bootindex`` property to select the
boot device. The old-fashioned ``-boot order=...`` command of QEMU (and
also ``-boot once=...``) is not supported on s390x.
Booting without bootindex parameter
-----------------------------------
The QEMU guest firmware (the so-called s390-ccw bios) has also some rudimentary
support for scanning through the available block devices. So in case you did
not specify a boot device with the ``bootindex`` property, there is still a
chance that it finds a bootable device on its own and starts a guest operating
system from it. However, this scanning algorithm is still very rough and may
be incomplete, so that it might fail to detect a bootable device in many cases.
It is really recommended to always specify the boot device with the
``bootindex`` property instead.
This also means that you should avoid the classical short-cut commands like
``-hda``, ``-cdrom`` or ``-drive if=virtio``, since it is not possible to
specify the ``bootindex`` with these commands. Note that the convenience
``-cdrom`` option even does not give you a real (virtio-scsi) CD-ROM device on
s390x. Due to technical limitations in the QEMU code base, you will get a
virtio-blk device with this parameter instead, which might not be the right
device type for installing a Linux distribution via ISO image. It is
recommended to specify a CD-ROM device via ``-device scsi-cd`` (as mentioned
above) instead.
Booting from a network device
-----------------------------
Beside the normal guest firmware (which is loaded from the file ``s390-ccw.img``
in the data directory of QEMU, or via the ``-bios`` option), QEMU ships with
a small TFTP network bootloader firmware for virtio-net-ccw devices, too. This
firmware is loaded from a file called ``s390-netboot.img`` in the QEMU data
directory. In case you want to load it from a different filename instead,
you can specify it via the ``-global s390-ipl.netboot_fw=filename``
command line option.
The ``bootindex`` property is especially important for booting via the network.
If you don't specify the the ``bootindex`` property here, the network bootloader
firmware code won't get loaded into the guest memory so that the network boot
will fail. For a successful network boot, try something like this::
qemu-system-s390x -netdev user,id=n1,tftp=...,bootfile=... \
-device virtio-net-ccw,netdev=n1,bootindex=1
The network bootloader firmware also has basic support for pxelinux.cfg-style
configuration files. See the `PXELINUX Configuration page
<https://wiki.syslinux.org/wiki/index.php?title=PXELINUX#Configuration>`__
for details how to set up the configuration file on your TFTP server.
The supported configuration file entries are ``DEFAULT``, ``LABEL``,
``KERNEL``, ``INITRD`` and ``APPEND`` (see the `Syslinux Config file syntax
<https://wiki.syslinux.org/wiki/index.php?title=Config>`__ for more
information).

View File

@ -31,4 +31,5 @@ Architectural features
======================
.. toctree::
s390x/bootdevices
s390x/protvirt

View File

@ -1,5 +1,5 @@
/*
* virtio ccw scsi implementation
* virtio ccw input implementation
*
* Copyright 2012, 2015 IBM Corp.
*

View File

@ -71,6 +71,7 @@ static VFIOGroup *vfio_ap_get_group(VFIOAPDevice *vapdev, Error **errp)
if (!group_path) {
error_setg(errp, "%s: no iommu_group found for %s: %s",
VFIO_AP_DEVICE_TYPE, vapdev->vdev.sysfsdev, gerror->message);
g_error_free(gerror);
return NULL;
}