[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-commits] [qemu/qemu] f8333d: target/s390x/tcg: SPX: check validity
From: |
Richard Henderson |
Subject: |
[Qemu-commits] [qemu/qemu] f8333d: target/s390x/tcg: SPX: check validity of new prefix |
Date: |
Thu, 07 Jul 2022 17:46:04 -0700 |
Branch: refs/heads/master
Home: https://github.com/qemu/qemu
Commit: f8333de27933b201b73a6c9830afbf1b48ac5dbe
https://github.com/qemu/qemu/commit/f8333de27933b201b73a6c9830afbf1b48ac5dbe
Author: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
Date: 2022-07-06 (Wed, 06 Jul 2022)
Changed paths:
M target/s390x/tcg/misc_helper.c
Log Message:
-----------
target/s390x/tcg: SPX: check validity of new prefix
According to the architecture, SET PREFIX must try to access the new
prefix area and recognize an addressing exception if the area is not
accessible.
For qemu this check prevents a crash in cpu_map_lowcore after an
inaccessible prefix area has been set.
Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Message-Id: <20220630094340.3646279-1-scgl@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Commit: 2ba3cc47672a67a09ef64c5af2eca07fbf4cd21f
https://github.com/qemu/qemu/commit/2ba3cc47672a67a09ef64c5af2eca07fbf4cd21f
Author: Thomas Huth <thuth@redhat.com>
Date: 2022-07-06 (Wed, 06 Jul 2022)
Changed paths:
M pc-bios/s390-ccw/main.c
M pc-bios/s390-ccw/s390-ccw.h
Log Message:
-----------
pc-bios/s390-ccw: Add a proper prototype for main()
Older versions of Clang complain if there is no prototype for main().
Add one, and while we're at it, make sure that we use the same type
for main.c and netmain.c - since the return value does not matter,
declare the return type of main() as "void".
Message-Id: <20220704111903.62400-2-thuth@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Commit: 1f2c2ee48e87ea743f8e23cc7569dd26c4cf9623
https://github.com/qemu/qemu/commit/1f2c2ee48e87ea743f8e23cc7569dd26c4cf9623
Author: Thomas Huth <thuth@redhat.com>
Date: 2022-07-06 (Wed, 06 Jul 2022)
Changed paths:
M pc-bios/s390-ccw/virtio-blkdev.c
M pc-bios/s390-ccw/virtio.h
Log Message:
-----------
pc-bios/s390-ccw/virtio: Introduce a macro for the DASD block size
Use VIRTIO_DASD_DEFAULT_BLOCK_SIZE instead of the magic value 4096.
Message-Id: <20220704111903.62400-3-thuth@redhat.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Commit: 422865f6672ee1482b98d18321b55c1ecfb06c82
https://github.com/qemu/qemu/commit/422865f6672ee1482b98d18321b55c1ecfb06c82
Author: Thomas Huth <thuth@redhat.com>
Date: 2022-07-06 (Wed, 06 Jul 2022)
Changed paths:
M pc-bios/s390-ccw/bootmap.c
Log Message:
-----------
pc-bios/s390-ccw/bootmap: Improve the guessing logic in zipl_load_vblk()
The logic of trying an final ISO or ECKD boot on virtio-block devices is
very weird: Since the geometry hardly ever matches in virtio_disk_is_scsi(),
virtio_blk_setup_device() always sets a "guessed" disk geometry via
virtio_assume_scsi() (which is certainly also wrong in a lot of cases).
zipl_load_vblk() then sees that there's been a "virtio_guessed_disk_nature"
and tries to fix up the geometry again via virtio_assume_iso9660() before
always trying to do ipl_iso_el_torito(). That's a very brain-twisting
way of attempting to boot from ISO images, which won't work anymore after
the following patches that will clean up the virtio_assume_scsi() mess
(and thus get rid of the "virtio_guessed_disk_nature" here).
Let's try a better approach instead: ISO files always have a magic
string "CD001" at offset 0x8001 (see e.g. the ECMA-119 specification)
which we can use to decide whether we should try to boot in ISO 9660
mode (which we should also try if we see a sector size of 2048).
And if we were not able to boot in ISO mode here, the final boot attempt
before panicking is to boot in ECKD mode. Since this is our last boot
attempt anyway, simply always assume the ECKD geometry here (if the sector
size was not 4096 yet), so that we also do not depend on the guessed disk
geometry from virtio_blk_setup_device() here anymore.
Message-Id: <20220704111903.62400-4-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Commit: bbf615f7b707f009ef8e757d170902ad33b90644
https://github.com/qemu/qemu/commit/bbf615f7b707f009ef8e757d170902ad33b90644
Author: Thomas Huth <thuth@redhat.com>
Date: 2022-07-06 (Wed, 06 Jul 2022)
Changed paths:
M pc-bios/s390-ccw/virtio-blkdev.c
M pc-bios/s390-ccw/virtio.h
Log Message:
-----------
pc-bios/s390-ccw/virtio-blkdev: Simplify/fix virtio_ipl_disk_is_valid()
The s390-ccw bios fails to boot if the boot disk is a virtio-blk
disk with a sector size of 4096. For example:
dasdfmt -b 4096 -d cdl -y -p -M quick /dev/dasdX
fdasd -a /dev/dasdX
install a guest onto /dev/dasdX1 using virtio-blk
qemu-system-s390x -nographic -hda /dev/dasdX1
The bios then bails out with:
! Cannot read block 0 !
Looking at virtio_ipl_disk_is_valid() and especially the function
virtio_disk_is_scsi(), it does not really make sense that we expect
only such a limited disk geometry (like a block size of 512) for
our boot disks. Let's relax the check and allow everything that
remotely looks like a sane disk.
Message-Id: <20220704111903.62400-5-thuth@redhat.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Commit: 5447de2619050a0a4dd480b97f88a9b58da360d1
https://github.com/qemu/qemu/commit/5447de2619050a0a4dd480b97f88a9b58da360d1
Author: Thomas Huth <thuth@redhat.com>
Date: 2022-07-06 (Wed, 06 Jul 2022)
Changed paths:
M pc-bios/s390-ccw/virtio-blkdev.c
M pc-bios/s390-ccw/virtio.h
Log Message:
-----------
pc-bios/s390-ccw/virtio-blkdev: Remove virtio_assume_scsi()
The virtio_assume_scsi() function is very questionable: First, it
is only called for virtio-blk, and not for virtio-scsi, so the naming
is already quite confusing. Second, it is called if we detected a
"invalid" IPL disk, trying to fix it by blindly setting a sector
size of 512. This of course won't work in most cases since disks
might have a different sector size for a reason.
Thus let's remove this strange function now. The calling code can
also be removed completely, since there is another spot in main.c
that does "IPL_assert(virtio_ipl_disk_is_valid(), ...)" to make
sure that we do not try to IPL from an invalid device.
Message-Id: <20220704111903.62400-6-thuth@redhat.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Commit: 175aa06a152ef6b58ba9b2e47a1296b024dea70c
https://github.com/qemu/qemu/commit/175aa06a152ef6b58ba9b2e47a1296b024dea70c
Author: Thomas Huth <thuth@redhat.com>
Date: 2022-07-06 (Wed, 06 Jul 2022)
Changed paths:
M pc-bios/s390-ccw/virtio.c
Log Message:
-----------
pc-bios/s390-ccw/virtio: Set missing status bits while initializing
According chapter "3.1.1 Driver Requirements: Device Initialization"
of the Virtio specification (v1.1), a driver for a device has to set
the ACKNOWLEDGE and DRIVER bits in the status field after resetting
the device. The s390-ccw bios skipped these steps so far and seems
like QEMU never cared. Anyway, it's better to follow the spec, so
let's set these bits now in the right spots, too.
Message-Id: <20220704111903.62400-7-thuth@redhat.com>
Acked-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Commit: aa5c69ce99411c4886bcd051f288afc02b6d968d
https://github.com/qemu/qemu/commit/aa5c69ce99411c4886bcd051f288afc02b6d968d
Author: Thomas Huth <thuth@redhat.com>
Date: 2022-07-06 (Wed, 06 Jul 2022)
Changed paths:
M pc-bios/s390-ccw/virtio.c
Log Message:
-----------
pc-bios/s390-ccw/virtio: Read device config after feature negotiation
Feature negotiation should be done first, since some fields in the
config area can depend on the negotiated features and thus should
rather be read afterwards.
While we're at it, also adjust the error message here a little bit
(the code is nowadays used for non-block virtio devices, too).
Message-Id: <20220704111903.62400-8-thuth@redhat.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Commit: 070824885741f5d2a66626d3c4ecb2773c8e0552
https://github.com/qemu/qemu/commit/070824885741f5d2a66626d3c4ecb2773c8e0552
Author: Thomas Huth <thuth@redhat.com>
Date: 2022-07-06 (Wed, 06 Jul 2022)
Changed paths:
M pc-bios/s390-ccw/virtio.c
Log Message:
-----------
pc-bios/s390-ccw/virtio: Beautify the code for reading virtqueue configuration
It looks nicer if we separate the run_ccw() from the IPL_assert()
statement, and the error message should talk about "virtio device"
instead of "block device", since this code is nowadays used for
non-block (i.e. network) devices, too.
Message-Id: <20220704111903.62400-9-thuth@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Commit: cf30b7c4a9b2c64518be8037c2e6670aacdb00b9
https://github.com/qemu/qemu/commit/cf30b7c4a9b2c64518be8037c2e6670aacdb00b9
Author: Thomas Huth <thuth@redhat.com>
Date: 2022-07-06 (Wed, 06 Jul 2022)
Changed paths:
M pc-bios/s390-ccw/main.c
M pc-bios/s390-ccw/virtio-blkdev.c
M pc-bios/s390-ccw/virtio-scsi.c
M pc-bios/s390-ccw/virtio-scsi.h
Log Message:
-----------
pc-bios/s390-ccw: Split virtio-scsi code from virtio_blk_setup_device()
The next patch is going to add more virtio-block specific code to
virtio_blk_setup_device(), and if the virtio-scsi code is also in
there, this is more cumbersome. And the calling function virtio_setup()
in main.c looks at the device type already anyway, so it's more
logical to separate the virtio-scsi stuff into a new function in
virtio-scsi.c instead.
Message-Id: <20220704111903.62400-10-thuth@redhat.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Commit: 9125a314cca4a1838b09305a87d8efb98f80ab67
https://github.com/qemu/qemu/commit/9125a314cca4a1838b09305a87d8efb98f80ab67
Author: Thomas Huth <thuth@redhat.com>
Date: 2022-07-06 (Wed, 06 Jul 2022)
Changed paths:
M pc-bios/s390-ccw/virtio-blkdev.c
Log Message:
-----------
pc-bios/s390-ccw/virtio-blkdev: Request the right feature bits
The virtio-blk code uses the block size and geometry fields in the
config area. According to the virtio-spec, these have to be negotiated
with the right feature bits during initialization, otherwise they
might not be available. QEMU is so far very forgiving and always
provides them, but we should not rely on this behavior, so let's
better request them properly via the VIRTIO_BLK_F_GEOMETRY and
VIRTIO_BLK_F_BLK_SIZE feature bits.
Message-Id: <20220704111903.62400-11-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Commit: 3953ae186880473df802a7bdf8e855807cc7d59e
https://github.com/qemu/qemu/commit/3953ae186880473df802a7bdf8e855807cc7d59e
Author: Thomas Huth <thuth@redhat.com>
Date: 2022-07-06 (Wed, 06 Jul 2022)
Changed paths:
M pc-bios/s390-ccw/virtio.h
Log Message:
-----------
pc-bios/s390-ccw/virtio: Remove "extern" keyword from prototypes
All the other protytpes in the headers here do not use the "extern"
keyword, so let's unify this by removing the "extern" from the misfits,
too.
Message-Id: <20220704111903.62400-12-thuth@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Commit: e2269220acb03e6c6a460c3090d804835e202239
https://github.com/qemu/qemu/commit/e2269220acb03e6c6a460c3090d804835e202239
Author: Thomas Huth <thuth@redhat.com>
Date: 2022-07-06 (Wed, 06 Jul 2022)
Changed paths:
M pc-bios/s390-ccw/netboot.mak
Log Message:
-----------
pc-bios/s390-ccw/netboot.mak: Ignore Clang's warnings about GNU extensions
When compiling the s390-ccw bios with Clang (v14.0), there is currently
an unuseful warning like this:
CC pc-bios/s390-ccw/ipv6.o
../../roms/SLOF/lib/libnet/ipv6.c:447:18: warning: variable length array
folded to constant array as an extension [-Wgnu-folding-constant]
unsigned short raw[ip6size];
^
SLOF is currently GCC-only and cannot be compiled with Clang yet, so
it is expected that such extensions sneak in there - and as long as
we don't want to compile the code with a compiler that is neither GCC
or Clang, it is also not necessary to avoid such extensions.
Thus these GNU-extension related warnings are completely useless in
the s390-ccw bios, especially in the code that is coming from SLOF,
so we should simply disable the related warnings here now.
Message-Id: <20220704111903.62400-13-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Commit: 4c4156db1cc828dc2d7d22cbf3982815d6d8564a
https://github.com/qemu/qemu/commit/4c4156db1cc828dc2d7d22cbf3982815d6d8564a
Author: Thomas Huth <thuth@redhat.com>
Date: 2022-07-06 (Wed, 06 Jul 2022)
Changed paths:
M pc-bios/s390-ccw.img
M pc-bios/s390-netboot.img
Log Message:
-----------
pc-bios/s390-ccw: Update the s390-ccw bios binaries with the virtio-blk fixes
The binaries have been recompiled with the fixes from the previous patches.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Commit: b67b6c7ce4d56bb76a523eb63feb4a1978b05351
https://github.com/qemu/qemu/commit/b67b6c7ce4d56bb76a523eb63feb4a1978b05351
Author: Richard Henderson <richard.henderson@linaro.org>
Date: 2022-07-06 (Wed, 06 Jul 2022)
Changed paths:
M target/s390x/tcg/translate.c
Log Message:
-----------
target/s390x: Remove DISAS_GOTO_TB
There is nothing to distinguish this from DISAS_NORETURN.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220702060228.420454-2-richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Commit: 8ec2edac5f32117b523620a216638704d80bbed9
https://github.com/qemu/qemu/commit/8ec2edac5f32117b523620a216638704d80bbed9
Author: Richard Henderson <richard.henderson@linaro.org>
Date: 2022-07-06 (Wed, 06 Jul 2022)
Changed paths:
M target/s390x/tcg/translate.c
Log Message:
-----------
target/s390x: Remove DISAS_PC_STALE
There is nothing to distinguish this from DISAS_TOO_MANY.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220702060228.420454-3-richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Commit: 872e13796f732cfd65c4dc62bd2e4bbdbb4fa848
https://github.com/qemu/qemu/commit/872e13796f732cfd65c4dc62bd2e4bbdbb4fa848
Author: Richard Henderson <richard.henderson@linaro.org>
Date: 2022-07-06 (Wed, 06 Jul 2022)
Changed paths:
M target/s390x/tcg/translate.c
Log Message:
-----------
target/s390x: Remove DISAS_PC_STALE_NOCHAIN
Replace this with a flag: exit_to_mainloop.
We can now control the exit for each of DISAS_TOO_MANY,
DISAS_PC_UPDATED, and DISAS_PC_CC_UPDATED, and fold in
the check for PER.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220702060228.420454-4-richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Commit: 3d8111fd3bf7298486bcf1a72013b44c9044104e
https://github.com/qemu/qemu/commit/3d8111fd3bf7298486bcf1a72013b44c9044104e
Author: Richard Henderson <richard.henderson@linaro.org>
Date: 2022-07-06 (Wed, 06 Jul 2022)
Changed paths:
M target/s390x/tcg/translate.c
Log Message:
-----------
target/s390x: Exit tb after executing ex_value
When EXECUTE sets ex_value to interrupt the constructed instruction,
we implicitly disable interrupts so that the value is not corrupted.
Exit to the main loop after execution, so that we re-evaluate any
pending interrupts.
Reported-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220702060228.420454-5-richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Commit: 212267df2b5fb8e7221fd706daac5891060f0e5c
https://github.com/qemu/qemu/commit/212267df2b5fb8e7221fd706daac5891060f0e5c
Author: Richard Henderson <richard.henderson@linaro.org>
Date: 2022-07-07 (Thu, 07 Jul 2022)
Changed paths:
M pc-bios/s390-ccw.img
M pc-bios/s390-ccw/bootmap.c
M pc-bios/s390-ccw/main.c
M pc-bios/s390-ccw/netboot.mak
M pc-bios/s390-ccw/s390-ccw.h
M pc-bios/s390-ccw/virtio-blkdev.c
M pc-bios/s390-ccw/virtio-scsi.c
M pc-bios/s390-ccw/virtio-scsi.h
M pc-bios/s390-ccw/virtio.c
M pc-bios/s390-ccw/virtio.h
M pc-bios/s390-netboot.img
M target/s390x/tcg/misc_helper.c
M target/s390x/tcg/translate.c
Log Message:
-----------
Merge tag 'pull-request-2022-07-07' of https://gitlab.com/thuth/qemu into
staging
* Check validity of the address in the SET PREFIX instruction
* Fix booting from devices that use 4k sectors, but are not like DASDs
* Re-evaluate pending interrupts after EXECUTE of certain instructions
# -----BEGIN PGP SIGNATURE-----
#
# iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmLGhkURHHRodXRoQHJl
# ZGhhdC5jb20ACgkQLtnXdP5wLbU76Q//Y4mEXxWZDpJTg7tL5SZP+UzBVttnCifv
# 6q+2I0keOUs6wFhPq8TzBqkazT9wlv51cNrY2Q3fU9I3dpDeRbAXZR34UD4kw5an
# Q+ZQcebuGSKLjzMrIb1DLAieq8OmZR5FvDUu16BbeJr6GIQIE80lMRfWh9j30UfW
# tlxkXr15BnyPx6m0rSGwzkZD2vgfj5zSUrDtYJcUsfypIA9OOBMA7yNGNlO+d94V
# UZiKgNQtAoBNm4hZh2M86nsUtem+WpMTZQnDnCpMLYvFV/u9jRQBFSR+Ay41hcEN
# WYuLK61rkjc9gPWSjeNNT28x8RMvFJU4YNn1UDiMRSzrigxeui6MOW3SI/h3y6tI
# 94yXmXV2IuDMibvOjK07nkDaEItqPxfj6zuM2xW1Nc+l8Sk12korFBpk/AZiD0Jo
# R3u36efci3zNqDRDJvhGUv8sGcv0mwO7Agq1Bm3h5941gYwzQKILHCShL7DPzvQa
# h+K1MsT7vWfh5++unkGUrN/Zd9CazEylbDuWtywK8lgQcTGDO/9rab8GeXfH/5es
# Tp0RGJwxmalgrAHZPK9lqgpQaGw92ct2G5odvc82EXQhgccnN9mh54BHPfdKs95E
# JZVrXtZH3Gtgl5MGZ+yJevWSc9h1iRnRF4a7QC3UlVBjA/9yAWzQUAnNGZOamE/s
# F+pi89oWLn8=
# =UsTi
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 07 Jul 2022 12:37:49 PM +0530
# gpg: using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg: issuer "thuth@redhat.com"
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [undefined]
# gpg: aka "Thomas Huth <thuth@redhat.com>" [undefined]
# gpg: aka "Thomas Huth <th.huth@posteo.de>" [unknown]
# gpg: aka "Thomas Huth <huth@tuxfamily.org>" [undefined]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg: There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3 EAB9 2ED9 D774 FE70 2DB5
* tag 'pull-request-2022-07-07' of https://gitlab.com/thuth/qemu:
target/s390x: Exit tb after executing ex_value
target/s390x: Remove DISAS_PC_STALE_NOCHAIN
target/s390x: Remove DISAS_PC_STALE
target/s390x: Remove DISAS_GOTO_TB
pc-bios/s390-ccw: Update the s390-ccw bios binaries with the virtio-blk fixes
pc-bios/s390-ccw/netboot.mak: Ignore Clang's warnings about GNU extensions
pc-bios/s390-ccw/virtio: Remove "extern" keyword from prototypes
pc-bios/s390-ccw/virtio-blkdev: Request the right feature bits
pc-bios/s390-ccw: Split virtio-scsi code from virtio_blk_setup_device()
pc-bios/s390-ccw/virtio: Beautify the code for reading virtqueue configuration
pc-bios/s390-ccw/virtio: Read device config after feature negotiation
pc-bios/s390-ccw/virtio: Set missing status bits while initializing
pc-bios/s390-ccw/virtio-blkdev: Remove virtio_assume_scsi()
pc-bios/s390-ccw/virtio-blkdev: Simplify/fix virtio_ipl_disk_is_valid()
pc-bios/s390-ccw/bootmap: Improve the guessing logic in zipl_load_vblk()
pc-bios/s390-ccw/virtio: Introduce a macro for the DASD block size
pc-bios/s390-ccw: Add a proper prototype for main()
target/s390x/tcg: SPX: check validity of new prefix
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Compare: https://github.com/qemu/qemu/compare/a74c66b1b933...212267df2b5f