qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/2] log: Add separate debug option for logging invalid memor


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 1/2] log: Add separate debug option for logging invalid memory accesses
Date: Mon, 13 Feb 2023 14:45:32 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.7.2

On 19/1/23 22:40, BALATON Zoltan wrote:
Currently -d guest_errors enables logging of different invalid actions
by the guest such as misusing hardware, accessing missing features or
invalid memory areas. The memory access logging can be quite verbose
which obscures the other messages enabled by this debug switch so
separate it by adding a new -d memaccess option to make it possible to
control it independently of other guest error logs.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
  include/qemu/log.h | 1 +
  softmmu/memory.c   | 6 +++---
  softmmu/physmem.c  | 2 +-
  util/log.c         | 2 ++
  4 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/include/qemu/log.h b/include/qemu/log.h
index c5643d8dd5..4bf0a65a85 100644
--- a/include/qemu/log.h
+++ b/include/qemu/log.h
@@ -35,6 +35,7 @@ bool qemu_log_separate(void);
  /* LOG_STRACE is used for user-mode strace logging. */
  #define LOG_STRACE         (1 << 19)
  #define LOG_PER_THREAD     (1 << 20)
+#define LOG_MEM_ACCESS     (1 << 21)
/* Lock/unlock output. */ diff --git a/softmmu/memory.c b/softmmu/memory.c
index 9d64efca26..0a9fa67d32 100644
--- a/softmmu/memory.c
+++ b/softmmu/memory.c
@@ -1379,7 +1379,7 @@ bool memory_region_access_valid(MemoryRegion *mr,
  {
      if (mr->ops->valid.accepts
          && !mr->ops->valid.accepts(mr->opaque, addr, size, is_write, attrs)) {
-        qemu_log_mask(LOG_GUEST_ERROR, "Invalid %s at addr 0x%" HWADDR_PRIX
+        qemu_log_mask(LOG_MEM_ACCESS, "Invalid %s at addr 0x%" HWADDR_PRIX

Can we use LOG_GUEST_ERROR|LOG_MEM_ACCESS to keep current behavior?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]