|
|
7711c0 |
From f72f8a75f6b29f02a2226324901e35dbb07ae932 Mon Sep 17 00:00:00 2001
|
|
|
7711c0 |
From: Markus Armbruster <armbru@redhat.com>
|
|
|
7711c0 |
Date: Fri, 17 May 2019 06:50:53 +0200
|
|
|
7711c0 |
Subject: [PATCH 26/53] pflash_cfi01: Do not exit() on guest aborting "write to
|
|
|
7711c0 |
buffer"
|
|
|
7711c0 |
MIME-Version: 1.0
|
|
|
7711c0 |
Content-Type: text/plain; charset=UTF-8
|
|
|
7711c0 |
Content-Transfer-Encoding: 8bit
|
|
|
7711c0 |
|
|
|
7711c0 |
RH-Author: Markus Armbruster <armbru@redhat.com>
|
|
|
7711c0 |
Message-id: <20190517065120.12028-5-armbru@redhat.com>
|
|
|
7711c0 |
Patchwork-id: 87986
|
|
|
7711c0 |
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH v3 04/31] pflash_cfi01: Do not exit() on guest aborting "write to buffer"
|
|
|
7711c0 |
Bugzilla: 1624009
|
|
|
7711c0 |
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
|
|
|
7711c0 |
RH-Acked-by: Thomas Huth <thuth@redhat.com>
|
|
|
7711c0 |
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
7711c0 |
|
|
|
7711c0 |
When a guest tries to abort "write to buffer" (command 0xE8), we print
|
|
|
7711c0 |
"PFLASH: Possible BUG - Write block confirm", then exit(1). Letting
|
|
|
7711c0 |
the guest terminate QEMU is not a good idea. Instead, LOG_UNIMP we
|
|
|
7711c0 |
screwed up, then reset the device.
|
|
|
7711c0 |
|
|
|
7711c0 |
Macro PFLASH_BUG() is now unused; delete it.
|
|
|
7711c0 |
|
|
|
7711c0 |
Suggested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
|
|
|
7711c0 |
Signed-off-by: Markus Armbruster <armbru@redhat.com>
|
|
|
7711c0 |
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
|
|
|
7711c0 |
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
|
|
|
7711c0 |
Message-Id: <20190308094610.21210-3-armbru@redhat.com>
|
|
|
7711c0 |
(cherry picked from commit 2d93bebf81520ccebeb9a3ea9bd051ce088854ea)
|
|
|
7711c0 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
7711c0 |
---
|
|
|
7711c0 |
hw/block/pflash_cfi01.c | 13 +++++--------
|
|
|
7711c0 |
1 file changed, 5 insertions(+), 8 deletions(-)
|
|
|
7711c0 |
|
|
|
7711c0 |
diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c
|
|
|
7711c0 |
index 389bc60..c565db1 100644
|
|
|
7711c0 |
--- a/hw/block/pflash_cfi01.c
|
|
|
7711c0 |
+++ b/hw/block/pflash_cfi01.c
|
|
|
7711c0 |
@@ -49,12 +49,6 @@
|
|
|
7711c0 |
#include "hw/sysbus.h"
|
|
|
7711c0 |
#include "sysemu/sysemu.h"
|
|
|
7711c0 |
|
|
|
7711c0 |
-#define PFLASH_BUG(fmt, ...) \
|
|
|
7711c0 |
-do { \
|
|
|
7711c0 |
- fprintf(stderr, "PFLASH: Possible BUG - " fmt, ## __VA_ARGS__); \
|
|
|
7711c0 |
- exit(1); \
|
|
|
7711c0 |
-} while(0)
|
|
|
7711c0 |
-
|
|
|
7711c0 |
/* #define PFLASH_DEBUG */
|
|
|
7711c0 |
#ifdef PFLASH_DEBUG
|
|
|
7711c0 |
#define DPRINTF(fmt, ...) \
|
|
|
7711c0 |
@@ -636,8 +630,11 @@ static void pflash_write(PFlashCFI01 *pfl, hwaddr offset,
|
|
|
7711c0 |
pfl->wcycle = 0;
|
|
|
7711c0 |
pfl->status |= 0x80;
|
|
|
7711c0 |
} else {
|
|
|
7711c0 |
- DPRINTF("%s: unknown command for \"write block\"\n", __func__);
|
|
|
7711c0 |
- PFLASH_BUG("Write block confirm");
|
|
|
7711c0 |
+ qemu_log_mask(LOG_UNIMP,
|
|
|
7711c0 |
+ "%s: Aborting write to buffer not implemented,"
|
|
|
7711c0 |
+ " the data is already written to storage!\n"
|
|
|
7711c0 |
+ "Flash device reset into READ mode.\n",
|
|
|
7711c0 |
+ __func__);
|
|
|
7711c0 |
goto reset_flash;
|
|
|
7711c0 |
}
|
|
|
7711c0 |
break;
|
|
|
7711c0 |
--
|
|
|
7711c0 |
1.8.3.1
|
|
|
7711c0 |
|