[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-commits] [qemu/qemu] 06f152: pflash: Require backend size to match
From: |
Peter Maydell |
Subject: |
[Qemu-commits] [qemu/qemu] 06f152: pflash: Require backend size to match device, impr... |
Date: |
Tue, 26 Mar 2019 03:27:17 -0700 |
Branch: refs/heads/master
Home: https://github.com/qemu/qemu
Commit: 06f1521795207359a395996c253c306f4ab7586e
https://github.com/qemu/qemu/commit/06f1521795207359a395996c253c306f4ab7586e
Author: Markus Armbruster <address@hidden>
Date: 2019-03-26 (Tue, 26 Mar 2019)
Changed paths:
M hw/block/block.c
M hw/block/pflash_cfi01.c
M hw/block/pflash_cfi02.c
M include/hw/block/block.h
Log Message:
-----------
pflash: Require backend size to match device, improve errors
We reject undersized backends with a rather enigmatic "failed to read
the initial flash content" error. For instance:
$ qemu-system-ppc64 -S -display none -M sam460ex -drive
if=pflash,format=raw,file=eins.img
qemu-system-ppc64: Initialization of device cfi.pflash02 failed: failed to
read the initial flash content
We happily accept oversized images, ignoring their tail. Throwing
away parts of firmware that way is pretty much certain to end in an
even more enigmatic failure to boot.
Require the backend's size to match the device's size exactly. Report
mismatch like this:
qemu-system-ppc64: Initialization of device cfi.pflash01 failed: device
requires 1048576 bytes, block backend provides 512 bytes
Improve the error for actual read failures to "can't read block
backend".
To avoid duplicating even more code between the two pflash device
models, do all that in new helper blk_check_size_and_read_all().
The error reporting can still be confusing. For instance:
qemu-system-ppc64 -S -display none -M taihu -drive
if=pflash,format=raw,file=eins.img -drive
if=pflash,unit=1,format=raw,file=zwei.img
qemu-system-ppc64: Initialization of device cfi.pflash02 failed: device
requires 2097152 bytes, block backend provides 512 bytes
Leaves the user guessing which of the two -drive is wrong. Mention
the issue in a TODO comment.
Suggested-by: Alex Bennée <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Commit: 3f905a5bba69691f1384a0464b5a7b8e516861c4
https://github.com/qemu/qemu/commit/3f905a5bba69691f1384a0464b5a7b8e516861c4
Author: Alex Bennée <address@hidden>
Date: 2019-03-26 (Tue, 26 Mar 2019)
Changed paths:
M hw/block/pflash_cfi01.c
M hw/block/pflash_cfi02.c
Log Message:
-----------
pflash: Bury disabled code to limit device sizes
We disabled code to limit device sizes to 8, 16, 32 or 64MiB more than
a decade ago in commit 95d1f3edd5e and c8b153d7949, v0.9.1. Bury.
Signed-off-by: Alex Bennée <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
[Extracted from a larger patch, extended to pflash_cfi02.c]
Signed-off-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Commit: 527266f324def9f7f392fe3b0dd940cb8dc699d9
https://github.com/qemu/qemu/commit/527266f324def9f7f392fe3b0dd940cb8dc699d9
Author: Peter Maydell <address@hidden>
Date: 2019-03-26 (Tue, 26 Mar 2019)
Changed paths:
M hw/block/block.c
M hw/block/pflash_cfi01.c
M hw/block/pflash_cfi02.c
M include/hw/block/block.h
Log Message:
-----------
Merge remote-tracking branch 'remotes/armbru/tags/pull-pflash-2019-03-26'
into staging
Pflash and firmware configuration patches for 2019-03-26
# gpg: Signature made Tue 26 Mar 2019 07:21:13 GMT
# gpg: using RSA key 3870B400EB918653
# gpg: Good signature from "Markus Armbruster <address@hidden>" [full]
# gpg: aka "Markus Armbruster <address@hidden>" [full]
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653
* remotes/armbru/tags/pull-pflash-2019-03-26:
pflash: Bury disabled code to limit device sizes
pflash: Require backend size to match device, improve errors
Signed-off-by: Peter Maydell <address@hidden>
Compare: https://github.com/qemu/qemu/compare/199f8d94be10...527266f324de
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-commits] [qemu/qemu] 06f152: pflash: Require backend size to match device, impr...,
Peter Maydell <=