[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 02/27] pflash_cfi01: Do not exit() on guest aborting
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PULL 02/27] pflash_cfi01: Do not exit() on guest aborting "write to buffer" |
Date: |
Mon, 11 Mar 2019 23:08:18 +0100 |
When a guest tries to abort "write to buffer" (command 0xE8), we print
"PFLASH: Possible BUG - Write block confirm", then exit(1). Letting
the guest terminate QEMU is not a good idea. Instead, LOG_UNIMP we
screwed up, then reset the device.
Macro PFLASH_BUG() is now unused; delete it.
Suggested-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
Message-Id: <address@hidden>
---
hw/block/pflash_cfi01.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c
index a51ac9f399..e6d933a06d 100644
--- a/hw/block/pflash_cfi01.c
+++ b/hw/block/pflash_cfi01.c
@@ -49,12 +49,6 @@
#include "sysemu/sysemu.h"
#include "trace.h"
-#define PFLASH_BUG(fmt, ...) \
-do { \
- fprintf(stderr, "PFLASH: Possible BUG - " fmt, ## __VA_ARGS__); \
- exit(1); \
-} while(0)
-
/* #define PFLASH_DEBUG */
#ifdef PFLASH_DEBUG
#define DPRINTF(fmt, ...) \
@@ -623,8 +617,11 @@ static void pflash_write(PFlashCFI01 *pfl, hwaddr offset,
pfl->wcycle = 0;
pfl->status |= 0x80;
} else {
- DPRINTF("%s: unknown command for \"write block\"\n", __func__);
- PFLASH_BUG("Write block confirm");
+ qemu_log_mask(LOG_UNIMP,
+ "%s: Aborting write to buffer not implemented,"
+ " the data is already written to storage!\n"
+ "Flash device reset into READ mode.\n",
+ __func__);
goto reset_flash;
}
break;
--
2.17.2
- [Qemu-devel] [PULL 00/27] Pflash and firmware configuration patches for 2019-03-11, Markus Armbruster, 2019/03/11
- [Qemu-devel] [PULL 02/27] pflash_cfi01: Do not exit() on guest aborting "write to buffer",
Markus Armbruster <=
- [Qemu-devel] [PULL 10/27] mips_malta: Delete disabled, broken DEBUG_BOARD_INIT code, Markus Armbruster, 2019/03/11
- [Qemu-devel] [PULL 03/27] pflash_cfi01: Log use of flawed "write to buffer", Markus Armbruster, 2019/03/11
- [Qemu-devel] [PULL 01/27] pflash: Rename pflash_t to PFlashCFI01, PFlashCFI02, Markus Armbruster, 2019/03/11
- [Qemu-devel] [PULL 09/27] r2d: Fix flash memory size, sector size, width, device ID, Markus Armbruster, 2019/03/11
- [Qemu-devel] [PULL 06/27] sam460ex: Don't size flash memory to match backing image, Markus Armbruster, 2019/03/11
- [Qemu-devel] [PULL 08/27] ppc405_boards: Don't size flash memory to match backing image, Markus Armbruster, 2019/03/11
- [Qemu-devel] [PULL 20/27] vl: Improve legibility of BlockdevOptions queue, Markus Armbruster, 2019/03/11
- [Qemu-devel] [PULL 16/27] qdev: Fix latent bug with compat_props and onboard devices, Markus Armbruster, 2019/03/11
- [Qemu-devel] [PULL 05/27] hw: Use PFLASH_CFI0{1, 2} and TYPE_PFLASH_CFI0{1, 2}, Markus Armbruster, 2019/03/11
- [Qemu-devel] [PULL 24/27] pc_sysfw: Remove unused PcSysFwDevice, Markus Armbruster, 2019/03/11