All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Thomas Huth <huth@tuxfamily.org>
Cc: qemu-trivial@nongnu.org, Jason Wang <jasowang@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH v3 2/2] hw/m68k/mcf52xx: Replace hw_error() by qemu_log_mask()
Date: Tue, 26 May 2020 18:34:59 +0200	[thread overview]
Message-ID: <d2171c12-ae7f-30aa-2361-30b8e58906c5@amsat.org> (raw)
In-Reply-To: <20200526180416.4f151f81@thl530>

On 5/26/20 6:04 PM, Thomas Huth wrote:
> Am Tue, 26 May 2020 11:40:52 +0200
> schrieb Philippe Mathieu-Daudé <f4bug@amsat.org>:
> 
>> hw_error() calls exit(). This a bit overkill when we can log
>> the accesses as unimplemented or guest error.
>>
>> When fuzzing the devices, we don't want the whole process to
>> exit. Replace some hw_error() calls by qemu_log_mask().
>>
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> [...]
>> diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c
>> index b84c152ce3..108623b4ad 100644
>> --- a/hw/m68k/mcf5208.c
>> +++ b/hw/m68k/mcf5208.c
>> @@ -9,10 +9,10 @@
>>  #include "qemu/osdep.h"
>>  #include "qemu/units.h"
>>  #include "qemu/error-report.h"
>> +#include "qemu/log.h"
>>  #include "qapi/error.h"
>>  #include "qemu-common.h"
>>  #include "cpu.h"
>> -#include "hw/hw.h"
>>  #include "hw/irq.h"
>>  #include "hw/m68k/mcf.h"
>>  #include "hw/m68k/mcf_fec.h"
>> @@ -111,8 +111,9 @@ static void m5208_timer_write(void *opaque,
>> hwaddr offset, case 4:
>>          break;
>>      default:
>> -        hw_error("m5208_timer_write: Bad offset 0x%x\n",
>> (int)offset);
>> -        break;
>> +        qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%" PRIx64
>> "\n",
> 
> That likely should be HWADDR_PRIX, too? ... could be fixed up while
> applying the patch.

Oops yes. Thanks a lot!

> 
> With that:
> Reviewed-by: Thomas Huth <huth@tuxfamily.org>
> 
> 
>> +                      __func__, offset);
>> +        return;
>>      }
>>      m5208_timer_update(s);
>>  }
>> @@ -136,7 +137,8 @@ static uint64_t m5208_timer_read(void *opaque,
>> hwaddr addr, case 4:
>>          return ptimer_get_count(s->timer);
>>      default:
>> -        hw_error("m5208_timer_read: Bad offset 0x%x\n", (int)addr);
>> +        qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%"
>> HWADDR_PRIX "\n",
>> +                      __func__, addr);
>>          return 0;
>>      }
>>  }
>> @@ -164,7 +166,8 @@ static uint64_t m5208_sys_read(void *opaque,
>> hwaddr addr, return 0;
>>  
>>      default:
>> -        hw_error("m5208_sys_read: Bad offset 0x%x\n", (int)addr);
>> +        qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%"
>> HWADDR_PRIX "\n",
>> +                      __func__, addr);
>>          return 0;
>>      }
>>  }
>> @@ -172,7 +175,8 @@ static uint64_t m5208_sys_read(void *opaque,
>> hwaddr addr, static void m5208_sys_write(void *opaque, hwaddr addr,
>>                              uint64_t value, unsigned size)
>>  {
>> -    hw_error("m5208_sys_write: Bad offset 0x%x\n", (int)addr);
>> +    qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%" HWADDR_PRIX
>> "\n",
>> +                  __func__, addr);
>>  }
> 


      reply	other threads:[~2020-05-26 16:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-26  9:40 [PATCH v3 0/2] hw/m68k/mcf52xx: Replace hw_error() by qemu_log_mask() Philippe Mathieu-Daudé
2020-05-26  9:40 ` [PATCH v3 1/2] hw/m68k/mcf5206: Reduce m5206_mbar_read/write() offset arg to 16-bit Philippe Mathieu-Daudé
2020-05-26 15:59   ` Thomas Huth
2020-05-26  9:40 ` [PATCH v3 2/2] hw/m68k/mcf52xx: Replace hw_error() by qemu_log_mask() Philippe Mathieu-Daudé
2020-05-26 16:04   ` Thomas Huth
2020-05-26 16:34     ` Philippe Mathieu-Daudé [this message]

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=d2171c12-ae7f-30aa-2361-30b8e58906c5@amsat.org \
    --to=f4bug@amsat.org \
    --cc=huth@tuxfamily.org \
    --cc=jasowang@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.