qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alistair Francis <alistair23@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm <qemu-arm@nongnu.org>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
	"Alistair Francis" <alistair@alistair23.me>
Subject: Re: [PATCH 15/17] hw/arm/pxa2xx_pic: Use LOG_GUEST_ERROR for bad guest register accesses
Date: Tue, 30 Jun 2020 17:52:51 -0700	[thread overview]
Message-ID: <CAKmqyKPESaqQGAHJ4bPMapgm_nKQUujrcR7nXCYpaG8sERTxkA@mail.gmail.com> (raw)
In-Reply-To: <20200628142429.17111-16-peter.maydell@linaro.org>

On Sun, Jun 28, 2020 at 7:29 AM Peter Maydell <peter.maydell@linaro.org> wrote:
>
> Instead of using printf() for logging guest accesses to invalid
> register offsets in the pxa2xx PIC device, use the usual
> qemu_log_mask(LOG_GUEST_ERROR,...).
>
> This was the only user of the REG_FMT macro in pxa.h, so we can
> remove that.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  include/hw/arm/pxa.h | 1 -
>  hw/arm/pxa2xx_pic.c  | 9 +++++++--
>  2 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/include/hw/arm/pxa.h b/include/hw/arm/pxa.h
> index f6dfb5c0cf0..8843e5f9107 100644
> --- a/include/hw/arm/pxa.h
> +++ b/include/hw/arm/pxa.h
> @@ -184,7 +184,6 @@ struct PXA2xxI2SState {
>  };
>
>  # define PA_FMT                        "0x%08lx"
> -# define REG_FMT               "0x" TARGET_FMT_plx
>
>  PXA2xxState *pxa270_init(MemoryRegion *address_space, unsigned int sdram_size,
>                           const char *revision);
> diff --git a/hw/arm/pxa2xx_pic.c b/hw/arm/pxa2xx_pic.c
> index 105c5e63f2f..ceee6aa48db 100644
> --- a/hw/arm/pxa2xx_pic.c
> +++ b/hw/arm/pxa2xx_pic.c
> @@ -11,6 +11,7 @@
>  #include "qemu/osdep.h"
>  #include "qapi/error.h"
>  #include "qemu/module.h"
> +#include "qemu/log.h"
>  #include "cpu.h"
>  #include "hw/arm/pxa.h"
>  #include "hw/sysbus.h"
> @@ -166,7 +167,9 @@ static uint64_t pxa2xx_pic_mem_read(void *opaque, hwaddr offset,
>      case ICHP: /* Highest Priority register */
>          return pxa2xx_pic_highest(s);
>      default:
> -        printf("%s: Bad register offset " REG_FMT "\n", __func__, offset);
> +        qemu_log_mask(LOG_GUEST_ERROR,
> +                      "pxa2xx_pic_mem_read: bad register offset 0x%" HWADDR_PRIx
> +                      "\n", offset);
>          return 0;
>      }
>  }
> @@ -199,7 +202,9 @@ static void pxa2xx_pic_mem_write(void *opaque, hwaddr offset,
>          s->priority[32 + ((offset - IPR32) >> 2)] = value & 0x8000003f;
>          break;
>      default:
> -        printf("%s: Bad register offset " REG_FMT "\n", __func__, offset);
> +        qemu_log_mask(LOG_GUEST_ERROR,
> +                      "pxa2xx_pic_mem_write: bad register offset 0x%"
> +                      HWADDR_PRIx "\n", offset);
>          return;
>      }
>      pxa2xx_pic_update(opaque);
> --
> 2.20.1
>
>


  parent reply	other threads:[~2020-07-01  1:03 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-28 14:24 [PATCH 00/17] spitz: fix hacks, fix CID 1421913, various cleanups Peter Maydell
2020-06-28 14:24 ` [PATCH 01/17] hw/arm/spitz: Detabify Peter Maydell
2020-06-29  8:49   ` Philippe Mathieu-Daudé
2020-06-29 19:30   ` Alistair Francis
2020-06-28 14:24 ` [PATCH 02/17] hw/arm/spitz: Create SpitzMachineClass abstract base class Peter Maydell
2020-06-29  8:55   ` Philippe Mathieu-Daudé
2020-06-29 14:03     ` Peter Maydell
2020-06-28 14:24 ` [PATCH 03/17] hw/arm/spitz: Keep pointers to MPU and SSI devices in SpitzMachineState Peter Maydell
2020-06-29 19:36   ` Alistair Francis
2020-06-28 14:24 ` [PATCH 04/17] hw/arm/spitz: Keep pointers to scp0, scp1 " Peter Maydell
2020-06-29 19:38   ` Alistair Francis
2020-06-28 14:24 ` [PATCH 05/17] hw/arm/spitz: Implement inbound GPIO lines for bit5 and power signals Peter Maydell
2020-06-30 20:45   ` Alistair Francis
2020-06-28 14:24 ` [PATCH 06/17] hw/misc/max111x: provide QOM properties for setting initial values Peter Maydell
2020-06-29  9:01   ` Philippe Mathieu-Daudé
2020-06-30 20:51   ` Alistair Francis
2020-06-28 14:24 ` [PATCH 07/17] hw/misc/max111x: Don't use vmstate_register() Peter Maydell
2020-06-29  9:01   ` Philippe Mathieu-Daudé
2020-06-30 20:52   ` Alistair Francis
2020-06-28 14:24 ` [PATCH 08/17] ssi: Add ssi_realize_and_unref() Peter Maydell
2020-06-29  9:02   ` Philippe Mathieu-Daudé
2020-06-30 20:55   ` Alistair Francis
2020-06-28 14:24 ` [PATCH 09/17] hw/arm/spitz: Use max111x properties to set initial values Peter Maydell
2020-06-29  9:09   ` Philippe Mathieu-Daudé
2020-06-29 14:05     ` Peter Maydell
2020-06-28 14:24 ` [PATCH 10/17] hw/misc/max111x: Use GPIO lines rather than max111x_set_input() Peter Maydell
2020-07-01  0:37   ` Alistair Francis
2020-06-28 14:24 ` [PATCH 11/17] hw/misc/max111x: Create header file for documentation, TYPE_ macros Peter Maydell
2020-06-29  8:29   ` Philippe Mathieu-Daudé
2020-06-29 12:07     ` Peter Maydell
2020-06-29 14:57       ` Philippe Mathieu-Daudé
2020-06-28 14:24 ` [PATCH 12/17] hw/arm/spitz: Encapsulate misc GPIO handling in a device Peter Maydell
2020-06-29  9:12   ` Philippe Mathieu-Daudé
2020-07-02 17:39   ` Alistair Francis
2020-06-28 14:24 ` [PATCH 13/17] hw/gpio/zaurus.c: Use LOG_GUEST_ERROR for bad guest register accesses Peter Maydell
2020-06-29  9:13   ` Philippe Mathieu-Daudé
2020-07-01  0:38   ` Alistair Francis
2020-06-28 14:24 ` [PATCH 14/17] hw/arm/spitz: " Peter Maydell
2020-06-29  9:14   ` Philippe Mathieu-Daudé
2020-07-01  0:52   ` Alistair Francis
2020-06-28 14:24 ` [PATCH 15/17] hw/arm/pxa2xx_pic: " Peter Maydell
2020-06-29  9:14   ` Philippe Mathieu-Daudé
2020-07-01  0:52   ` Alistair Francis [this message]
2020-06-28 14:24 ` [PATCH 16/17] hw/arm/spitz: Provide usual QOM macros for corgi-ssp and spitz-lcdtg Peter Maydell
2020-06-29  9:17   ` Philippe Mathieu-Daudé
2020-07-02 17:51   ` Alistair Francis
2020-06-28 14:24 ` [PATCH 17/17] Replace uses of FROM_SSI_SLAVE() macro with QOM casts Peter Maydell
2020-06-29  9:18   ` Philippe Mathieu-Daudé
2020-07-02 18:23   ` Alistair Francis
2020-06-28 14:43 ` [PATCH 00/17] spitz: fix hacks, fix CID 1421913, various cleanups no-reply

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=CAKmqyKPESaqQGAHJ4bPMapgm_nKQUujrcR7nXCYpaG8sERTxkA@mail.gmail.com \
    --to=alistair23@gmail.com \
    --cc=alistair@alistair23.me \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@redhat.com \
    --cc=qemu-arm@nongnu.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).