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>,
	clg@kaod.org, qemu-devel <qemu-devel@nongnu.org>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Subject: Re: [Qemu-devel] [PATCH 11/15] hw/sparc/sun4m: Replace 'empty_slot' by 'unimplemented_device'
Date: Tue, 2 Oct 2018 10:14:54 +0200	[thread overview]
Message-ID: <CACXAS8CcEu89HkP3HtT0snp_H8hc9HmEhX9-iK4e4W-035v-kQ@mail.gmail.com> (raw)
In-Reply-To: <20181001220942.2382-12-f4bug@amsat.org>

Hi Philippe,

On Tue, Oct 2, 2018 at 12:10 AM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> The TYPE_EMPTY_SLOT and TYPE_UNIMPLEMENTED_DEVICE are identical devices,
> however the later use more recent APIs and is more widely used.
>
> Replace 'empty_slot' by 'unimplemented_device' to simplify devices code
> maintenance.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  default-configs/sparc-softmmu.mak |  1 -
>  hw/sparc/sun4m.c                  | 24 ++++++++++++++----------
>  2 files changed, 14 insertions(+), 11 deletions(-)
>
> diff --git a/default-configs/sparc-softmmu.mak b/default-configs/sparc-softmmu.mak
> index 12f97eeb20..7369b54467 100644
> --- a/default-configs/sparc-softmmu.mak
> +++ b/default-configs/sparc-softmmu.mak
> @@ -8,7 +8,6 @@ CONFIG_ESCC=y
>  CONFIG_M48T59=y
>  CONFIG_PTIMER=y
>  CONFIG_FDC=y
> -CONFIG_EMPTY_SLOT=y
>  CONFIG_PCNET_COMMON=y
>  CONFIG_LANCE=y
>  CONFIG_TCX=y
> diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
> index 3c29b68e67..ca37acf7af 100644
> --- a/hw/sparc/sun4m.c
> +++ b/hw/sparc/sun4m.c
> @@ -42,7 +42,7 @@
>  #include "hw/nvram/chrp_nvram.h"
>  #include "hw/nvram/fw_cfg.h"
>  #include "hw/char/escc.h"
> -#include "hw/empty_slot.h"
> +#include "hw/misc/unimp.h"
>  #include "hw/loader.h"
>  #include "elf.h"
>  #include "trace.h"
> @@ -863,7 +863,8 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
>      ram_init(0, machine->ram_size, hwdef->max_mem);
>      /* models without ECC don't trap when missing ram is accessed */
>      if (!hwdef->ecc_base) {
> -        empty_slot_init(machine->ram_size, hwdef->max_mem - machine->ram_size);
> +        create_unimplemented_device("ecc", machine->ram_size,
> +                                    hwdef->max_mem - machine->ram_size);

In this particular case of find the name UNIMPLEMENTED_DEVICE a bit
misleading: there is nothing to implement for non-installed memory
SIMMs. It's rather an unconnected device. And the name "ecc" is
misleading too. These machines are not supposed to have any ECC.
Maybe "unconnected-ram", "empty-ram-slot" or "empty-slot"?

Regards,
Artyom

>      }
>
>      prom_init(hwdef->slavio_base, bios_name);
> @@ -892,9 +893,10 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
>      if (hwdef->iommu_pad_base) {
>          /* On the real hardware (SS-5, LX) the MMU is not padded, but aliased.
>             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);
> +           when does. Using the 'unimplemented device' instead of aliasing can
> +           help with debugging such accesses */
> +        create_unimplemented_device("iommu.alias", hwdef->iommu_pad_base,
> +                                    hwdef->iommu_pad_len);
>      }
>
>      sparc32_dma_init(hwdef->dma_base,
> @@ -944,12 +946,13 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
>      for (i = num_vsimms; i < MAX_VSIMMS; i++) {
>          /* vsimm registers probed by OBP */
>          if (hwdef->vsimm[i].reg_base) {
> -            empty_slot_init(hwdef->vsimm[i].reg_base, 0x2000);
> +            create_unimplemented_device("vsimm", hwdef->vsimm[i].reg_base,
> +                                        0x2000);
>          }
>      }
>
>      if (hwdef->sx_base) {
> -        empty_slot_init(hwdef->sx_base, 0x2000);
> +        create_unimplemented_device("sx", hwdef->sx_base, 0x2000);
>      }
>
>      nvram = m48t59_init(slavio_irq[0], hwdef->nvram_base, 0, 0x2000, 1968, 8);
> @@ -1012,14 +1015,15 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
>      if (hwdef->dbri_base) {
>          /* ISDN chip with attached CS4215 audio codec */
>          /* prom space */
> -        empty_slot_init(hwdef->dbri_base+0x1000, 0x30);
> +        create_unimplemented_device("dbri.prom", hwdef->dbri_base + 0x1000,
> +                                    0x30);
>          /* reg space */
> -        empty_slot_init(hwdef->dbri_base+0x10000, 0x100);
> +        create_unimplemented_device("dbri", hwdef->dbri_base + 0x10000, 0x100);
>      }
>
>      if (hwdef->bpp_base) {
>          /* parallel port */
> -        empty_slot_init(hwdef->bpp_base, 0x20);
> +        create_unimplemented_device("bpp", hwdef->bpp_base, 0x20);
>      }
>
>      kernel_size = sun4m_load_kernel(machine->kernel_filename,
> --
> 2.19.0
>


-- 
Regards,
Artyom Tarasenko

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

  reply	other threads:[~2018-10-02  8:15 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-01 22:09 [Qemu-devel] [PATCH 00/15] another SysBusDevice::init to Device::realize cleanup Philippe Mathieu-Daudé
2018-10-01 22:09 ` [Qemu-devel] [PATCH 01/15] trace-events: Fix copy/paste typo Philippe Mathieu-Daudé
2018-10-02 13:10   ` Peter Maydell
2018-10-02 15:49   ` Cédric Le Goater
2018-10-01 22:09 ` [Qemu-devel] [PATCH 02/15] hw/timer/sun4v-rtc: Convert from DPRINTF() macro to trace events Philippe Mathieu-Daudé
2018-10-02 11:30   ` Artyom Tarasenko
2018-10-02 15:49   ` Cédric Le Goater
2018-10-01 22:09 ` [Qemu-devel] [PATCH 03/15] hw/timer/sun4v-rtc: Use DeviceState::realize rather than SysBusDevice::init Philippe Mathieu-Daudé
2018-10-02  8:38   ` Thomas Huth
2018-10-02 15:49   ` Cédric Le Goater
2018-10-01 22:09 ` [Qemu-devel] [PATCH 04/15] hw/ssi/xilinx_spi: " Philippe Mathieu-Daudé
2018-10-02  8:40   ` Thomas Huth
2018-10-02 15:49   ` Cédric Le Goater
2018-10-04 17:29   ` Alistair Francis
2018-10-01 22:09 ` [Qemu-devel] [PATCH 05/15] hw/sh4/sh_pci: " Philippe Mathieu-Daudé
2018-10-02 13:13   ` Peter Maydell
2018-10-02 19:59     ` Philippe Mathieu-Daudé
2018-10-02 20:37       ` Marcel Apfelbaum
2018-10-02 20:59         ` Philippe Mathieu-Daudé
2018-10-02 15:49   ` Cédric Le Goater
2018-10-01 22:09 ` [Qemu-devel] [PATCH 06/15] hw/pci-host/bonito: " Philippe Mathieu-Daudé
2018-10-02 21:24   ` Philippe Mathieu-Daudé
2018-10-01 22:09 ` [Qemu-devel] [PATCH 07/15] hw/mips/gt64xxx_pci: Convert gt64120_reset() function into Device reset method Philippe Mathieu-Daudé
2018-10-02 13:15   ` Peter Maydell
2018-10-02 15:49   ` Cédric Le Goater
2018-10-01 22:09 ` [Qemu-devel] [PATCH 08/15] hw/mips/gt64xxx_pci: Mark as bridge device Philippe Mathieu-Daudé
2018-10-02 13:16   ` Peter Maydell
2018-10-02 15:49   ` Cédric Le Goater
2018-10-01 22:09 ` [Qemu-devel] [PATCH 09/15] hw/mips/malta: Replace 'empty_slot' by 'unimplemented_device' Philippe Mathieu-Daudé
2018-10-02 13:23   ` Peter Maydell
2018-10-02 19:40     ` Philippe Mathieu-Daudé
2018-10-03  9:28       ` Peter Maydell
2018-10-01 22:09 ` [Qemu-devel] [PATCH 10/15] hw/sparc64/niagara: " Philippe Mathieu-Daudé
2018-10-02 13:24   ` Peter Maydell
2018-10-02 15:50     ` Artyom Tarasenko
2018-10-01 22:09 ` [Qemu-devel] [PATCH 11/15] hw/sparc/sun4m: " Philippe Mathieu-Daudé
2018-10-02  8:14   ` Artyom Tarasenko [this message]
2018-10-02 21:32     ` Philippe Mathieu-Daudé
2018-10-01 22:09 ` [Qemu-devel] [PATCH 12/15] hw/core: Remove the 'empty_slot' device Philippe Mathieu-Daudé
2018-10-01 22:09 ` [Qemu-devel] [RFC PATCH 13/15] hw/alpha/typhoon: Remove unuseful code Philippe Mathieu-Daudé
2018-10-02  8:34   ` Thomas Huth
2018-10-01 22:09 ` [Qemu-devel] [RFC PATCH 14/15] hw/hppa/dino: " Philippe Mathieu-Daudé
2018-10-02  8:35   ` Thomas Huth
2018-10-01 22:09 ` [Qemu-devel] [RFC PATCH 15/15] hw/mips/malta: " Philippe Mathieu-Daudé
2018-10-02  8:36   ` Thomas Huth

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=CACXAS8CcEu89HkP3HtT0snp_H8hc9HmEhX9-iK4e4W-035v-kQ@mail.gmail.com \
    --to=atar4qemu@gmail.com \
    --cc=clg@kaod.org \
    --cc=ehabkost@redhat.com \
    --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).