From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 09/10] hw/block/onenand: use qemu_log_mask() for reporting
Date: Mon, 19 Nov 2018 15:57:29 +0000 [thread overview]
Message-ID: <20181119155730.11758-10-peter.maydell@linaro.org> (raw)
In-Reply-To: <20181119155730.11758-1-peter.maydell@linaro.org>
Update the onenand device to use qemu_log_mask() for reporting
guest errors and unimplemented features, rather than plain
fprintf() and hw_error().
(We leave the hw_error() in onenand_reset(), as that is
triggered by a failure to read the underlying block device
for the bootRAM, not by guest action.)
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20181115143535.5885-3-peter.maydell@linaro.org
---
hw/block/onenand.c | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/hw/block/onenand.c b/hw/block/onenand.c
index 49ef68c9b14..2b48609776d 100644
--- a/hw/block/onenand.c
+++ b/hw/block/onenand.c
@@ -28,6 +28,7 @@
#include "exec/memory.h"
#include "hw/sysbus.h"
#include "qemu/error-report.h"
+#include "qemu/log.h"
/* 11 for 2kB-page OneNAND ("2nd generation") and 10 for 1kB-page chips */
#define PAGE_SHIFT 11
@@ -594,8 +595,8 @@ static void onenand_command(OneNANDState *s)
default:
s->status |= ONEN_ERR_CMD;
s->intstatus |= ONEN_INT;
- fprintf(stderr, "%s: unknown OneNAND command %x\n",
- __func__, s->command);
+ qemu_log_mask(LOG_GUEST_ERROR, "unknown OneNAND command %x\n",
+ s->command);
}
onenand_intr_update(s);
@@ -657,12 +658,13 @@ static uint64_t onenand_read(void *opaque, hwaddr addr,
case 0xff02: /* ECC Result of spare area data */
case 0xff03: /* ECC Result of main area data */
case 0xff04: /* ECC Result of spare area data */
- hw_error("%s: implement ECC\n", __func__);
+ qemu_log_mask(LOG_UNIMP,
+ "onenand: ECC result registers unimplemented\n");
return 0x0000;
}
- fprintf(stderr, "%s: unknown OneNAND register %x\n",
- __func__, offset);
+ qemu_log_mask(LOG_GUEST_ERROR, "read of unknown OneNAND register 0x%x\n",
+ offset);
return 0;
}
@@ -706,8 +708,9 @@ static void onenand_write(void *opaque, hwaddr addr,
break;
default:
- fprintf(stderr, "%s: unknown OneNAND boot command %"PRIx64"\n",
- __func__, value);
+ qemu_log_mask(LOG_GUEST_ERROR,
+ "unknown OneNAND boot command %" PRIx64 "\n",
+ value);
}
break;
@@ -757,8 +760,9 @@ static void onenand_write(void *opaque, hwaddr addr,
break;
default:
- fprintf(stderr, "%s: unknown OneNAND register %x\n",
- __func__, offset);
+ qemu_log_mask(LOG_GUEST_ERROR,
+ "write to unknown OneNAND register 0x%x\n",
+ offset);
}
}
--
2.19.1
next prev parent reply other threads:[~2018-11-19 15:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-19 15:57 [Qemu-devel] [PULL 00/10] target-arm queue Peter Maydell
2018-11-19 15:57 ` [Qemu-devel] [PULL 01/10] target/arm: Install ARMISARegisters from kvm host Peter Maydell
2018-11-19 15:57 ` [Qemu-devel] [PULL 02/10] target/arm: Fill in ARMISARegisters for kvm64 Peter Maydell
2018-11-19 15:57 ` [Qemu-devel] [PULL 03/10] target/arm: Introduce read_sys_reg32 for kvm32 Peter Maydell
2018-11-19 15:57 ` [Qemu-devel] [PULL 04/10] target/arm: Fill in ARMISARegisters " Peter Maydell
2018-11-19 15:57 ` [Qemu-devel] [PULL 05/10] MAINTAINERS: Add entries for missing ARM boards Peter Maydell
2018-11-19 15:57 ` [Qemu-devel] [PULL 06/10] hw/arm/stm32f205: Fix the UART and Timer region size Peter Maydell
2018-11-19 15:57 ` [Qemu-devel] [PULL 07/10] target/arm: fix smc incorrectly trapping to EL3 when secure is off Peter Maydell
2018-11-19 15:57 ` [Qemu-devel] [PULL 08/10] hw/block/onenand: Fix off-by-one error allowing out-of-bounds read Peter Maydell
2018-11-19 15:57 ` Peter Maydell [this message]
2018-11-19 15:57 ` [Qemu-devel] [PULL 10/10] MAINTAINERS: list myself as maintainer for various Arm boards Peter Maydell
2018-11-19 18:10 ` [Qemu-devel] [PULL 00/10] target-arm queue Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181119155730.11758-10-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).