On Sun, 6 Oct 2024 at 17:50, BALATON Zoltan <bala...@eik.bme.hu> 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 <bala...@eik.bme.hu>
> ---
>  include/qemu/log.h | 1 +
>  system/memory.c    | 6 +++---
>  system/physmem.c   | 2 +-
>  util/log.c         | 2 ++
>  4 files changed, 7 insertions(+), 4 deletions(-)

It seems reasonable to me to separate out "log invalid
memory accesses", yes.

> diff --git a/util/log.c b/util/log.c
> index 6219819855..1aa7396277 100644
> --- a/util/log.c
> +++ b/util/log.c
> @@ -503,6 +503,8 @@ const QEMULogItem qemu_log_items[] = {
>        "open a separate log file per thread; filename must contain '%d'" },
>      { CPU_LOG_TB_VPU, "vpu",
>        "include VPU registers in the 'cpu' logging" },
> +    { LOG_MEM_ACCESS, "memaccess",
> +      "log invalid memory accesses" },
>      { 0, NULL, NULL },

As a naming thing, these are logging specifically invalid
memory accesses, not all accesses, so we should have
both the user-facing name and the LOG_ constant be
named appropriately. Perhaps
  LOG_INV_MEM_ACCESS, "invalid_mem_accesses" ?

thanks
-- PMM

Reply via email to