qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Artyom Tarasenko <atar4qemu@gmail.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Aleksandar Rikalo <arikalo@wavecomp.com>,
	Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
	qemu-devel <qemu-devel@nongnu.org>,
	Aleksandar Markovic <amarkovic@wavecomp.com>,
	Aurelien Jarno <aurelien@aurel32.net>
Subject: Re: [Qemu-devel] [PATCH 9/9] hw/misc/empty_slot: Pass the slot name as argument
Date: Tue, 25 Jun 2019 09:03:53 +0200	[thread overview]
Message-ID: <CACXAS8B1iSM1TKOW5E3cgT7tsbRrOw8OvO+ATKLpdQsGQ98Tew@mail.gmail.com> (raw)
In-Reply-To: <20190624220056.25861-10-f4bug@amsat.org>

On Tue, Jun 25, 2019 at 12:01 AM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> Use the slot name to have more meaningful tracing logs.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Reviewed-by: Artyom Tarasenko <atar4qemu@gmail.com>

> ---
>  include/hw/misc/empty_slot.h | 3 ++-
>  hw/mips/mips_malta.c         | 2 +-
>  hw/misc/empty_slot.c         | 6 ++++--
>  hw/sparc/sun4m.c             | 9 ++++++---
>  4 files changed, 13 insertions(+), 7 deletions(-)
>
> diff --git a/include/hw/misc/empty_slot.h b/include/hw/misc/empty_slot.h
> index 46483f24c3..d0cd989d2d 100644
> --- a/include/hw/misc/empty_slot.h
> +++ b/include/hw/misc/empty_slot.h
> @@ -14,6 +14,7 @@
>
>  /**
>   * empty_slot_init: create and map a RAZ/WI device
> + * @name: name of the device for debug logging
>   * @base: base address of the device's MMIO region
>   * @size: size of the device's MMIO region
>   *
> @@ -27,6 +28,6 @@
>   * use it to cover a large region and then map other devices on top of it
>   * if necessary.
>   */
> -void empty_slot_init(hwaddr addr, uint64_t slot_size);
> +void empty_slot_init(const char *name, hwaddr addr, uint64_t slot_size);
>
>  #endif
> diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
> index 7008be2e5b..51db5212be 100644
> --- a/hw/mips/mips_malta.c
> +++ b/hw/mips/mips_malta.c
> @@ -1212,7 +1212,7 @@ void mips_malta_init(MachineState *machine)
>      /* The whole address space decoded by the GT-64120A doesn't generate
>         exception when accessing invalid memory. Create an empty slot to
>         emulate this feature. */
> -    empty_slot_init(0, 0x20000000);
> +    empty_slot_init("gt64120-ad", 0x00000000, 0x20000000);
>
>      qdev_init_nofail(dev);
>
> diff --git a/hw/misc/empty_slot.c b/hw/misc/empty_slot.c
> index b810655554..396f9dd06a 100644
> --- a/hw/misc/empty_slot.c
> +++ b/hw/misc/empty_slot.c
> @@ -52,12 +52,13 @@ static const MemoryRegionOps empty_slot_ops = {
>      .endianness = DEVICE_NATIVE_ENDIAN,
>  };
>
> -void empty_slot_init(hwaddr addr, uint64_t slot_size)
> +void empty_slot_init(const char *name, hwaddr addr, uint64_t slot_size)
>  {
>      DeviceState *dev;
>
>      dev = qdev_create(NULL, TYPE_EMPTY_SLOT);
>
> +    qdev_prop_set_string(dev, "name", name);
>      qdev_prop_set_uint64(dev, "size", slot_size);
>      qdev_init_nofail(dev);
>
> @@ -77,7 +78,8 @@ static void empty_slot_realize(DeviceState *dev, Error **errp)
>          return;
>      }
>      if (s->name == NULL) {
> -        s->name = g_strdup("empty-slot");
> +        error_setg(errp, "property 'name' not specified");
> +        return;
>      }
>
>      memory_region_init_io(&s->iomem, OBJECT(s), &empty_slot_ops, s,
> diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
> index d55753d5cb..b17be3ddb8 100644
> --- a/hw/sparc/sun4m.c
> +++ b/hw/sparc/sun4m.c
> @@ -819,7 +819,7 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
>                                           machine->ram_size);
>      memory_region_add_subregion(get_system_memory(), 0x00000000, &ram);
>      /* models without ECC don't trap when missing ram is accessed */
> -    empty_slot_init(0x00000000, hwdef->max_mem);
> +    empty_slot_init("dram", 0x00000000, hwdef->max_mem);
>
>      /* init CPUs */
>      for(i = 0; i < smp_cpus; i++) {
> @@ -859,7 +859,8 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
>             Software shouldn't use aliased addresses, neither should it crash
>             when does. Using empty_slot instead of aliasing can help with
>             debugging such accesses */
> -        empty_slot_init(hwdef->iommu_pad_base,hwdef->iommu_pad_len);
> +        empty_slot_init("iommu.alias",
> +                        hwdef->iommu_pad_base, hwdef->iommu_pad_len);
>      }
>
>      sparc32_dma_init(hwdef->dma_base,
> @@ -908,7 +909,9 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
>      for (i = 0; i < MAX_VSIMMS; i++) {
>          /* vsimm registers probed by OBP */
>          if (hwdef->vsimm[i].reg_base) {
> -            empty_slot_init(hwdef->vsimm[i].reg_base, 0x2000);
> +            char *name = g_strdup_printf("vsimm[%d]", i);
> +            empty_slot_init(name, hwdef->vsimm[i].reg_base, 0x2000);
> +            g_free(name);
>          }
>      }
>
> --
> 2.19.1
>


-- 
Regards,
Artyom Tarasenko

SPARC and PPC PReP under qemu blog: http://tyom.blogspot.com/search/label/qemu


      reply	other threads:[~2019-06-25  7:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-24 22:00 [Qemu-devel] [PATCH 0/9] hw/misc: Clean the empty_slot device Philippe Mathieu-Daudé
2019-06-24 22:00 ` [Qemu-devel] [PATCH 1/9] hw/misc: Move the 'empty_slot' device to hw/misc/ Philippe Mathieu-Daudé
2019-06-25  7:09   ` Artyom Tarasenko
2019-06-24 22:00 ` [Qemu-devel] [RFC PATCH 2/9] MAINTAINERS: Add the 'empty_slot' device with the 'unimp' one Philippe Mathieu-Daudé
2019-06-25  7:06   ` Artyom Tarasenko
2019-06-24 22:00 ` [Qemu-devel] [PATCH 3/9] hw/misc/empty_slot: Allow overide by device with higher priority Philippe Mathieu-Daudé
2019-06-25  7:08   ` Artyom Tarasenko
2019-06-24 22:00 ` [Qemu-devel] [PATCH 4/9] hw/misc/empty_slot: Add a qdev property 'size' Philippe Mathieu-Daudé
2019-06-25  7:09   ` Artyom Tarasenko
2019-06-24 22:00 ` [Qemu-devel] [PATCH 5/9] hw/misc/empty_slot: Add a qdev property 'name' Philippe Mathieu-Daudé
2019-06-25  7:05   ` Artyom Tarasenko
2019-06-24 22:00 ` [Qemu-devel] [PATCH 6/9] hw/misc/empty_slot: Convert debug printf()s to trace events Philippe Mathieu-Daudé
2019-06-25  7:04   ` Artyom Tarasenko
2019-06-24 22:00 ` [Qemu-devel] [PATCH 7/9] hw/sparc/sun4m: Mark some devices as 'unimplemented' Philippe Mathieu-Daudé
2019-06-25  7:16   ` Artyom Tarasenko
2019-06-24 22:00 ` [Qemu-devel] [PATCH 8/9] hw/sparc/sun4m: Simplify the RAM creation Philippe Mathieu-Daudé
2019-06-25  7:14   ` Artyom Tarasenko
2019-06-25  8:14     ` Philippe Mathieu-Daudé
2019-06-24 22:00 ` [Qemu-devel] [PATCH 9/9] hw/misc/empty_slot: Pass the slot name as argument Philippe Mathieu-Daudé
2019-06-25  7:03   ` Artyom Tarasenko [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=CACXAS8B1iSM1TKOW5E3cgT7tsbRrOw8OvO+ATKLpdQsGQ98Tew@mail.gmail.com \
    --to=atar4qemu@gmail.com \
    --cc=amarkovic@wavecomp.com \
    --cc=arikalo@wavecomp.com \
    --cc=aurelien@aurel32.net \
    --cc=f4bug@amsat.org \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=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).