qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: BALATON Zoltan <balaton@eik.bme.hu>,
	qemu-devel@nongnu.org, qemu-ppc@nongnu.org
Cc: Nicholas Piggin <npiggin@gmail.com>,
	Harsh Prateek Bora <harshpb@linux.ibm.com>
Subject: Re: [PATCH 2/4] hw/pci-host/articia: Map PCI memory windows in realize
Date: Mon, 27 Oct 2025 20:35:39 +0100	[thread overview]
Message-ID: <7747275c-8e0a-4983-8613-fc39fc03bb39@linaro.org> (raw)
In-Reply-To: <ceda4c28887c40e1c8eae3f561ee381ca98b0484.1761346145.git.balaton@eik.bme.hu>

On 25/10/25 01:31, BALATON Zoltan wrote:
> These memory windows are a result of the address decoding in the
> Articia S north bridge so better model it there and not in board code.
> 
> Suggested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
> ---
>   hw/pci-host/articia.c | 15 ++++++++++++++-
>   hw/ppc/amigaone.c     | 28 +++++-----------------------
>   hw/ppc/pegasos2.c     | 13 -------------
>   3 files changed, 19 insertions(+), 37 deletions(-)


> @@ -169,6 +174,7 @@ static void articia_realize(DeviceState *dev, Error **errp)
>   {
>       ArticiaState *s = ARTICIA(dev);
>       PCIHostState *h = PCI_HOST_BRIDGE(dev);
> +    MemoryRegion *mr;
>       PCIDevice *pdev;
>   
>       bitbang_i2c_init(&s->smbus, i2c_init_bus(dev, "smbus"));
> @@ -180,6 +186,14 @@ static void articia_realize(DeviceState *dev, Error **errp)
>       memory_region_init_io(&s->reg, OBJECT(s), &articia_reg_ops, s,
>                             TYPE_ARTICIA, 0x1000000);
>       memory_region_add_subregion_overlap(&s->reg, 0, &s->io, 1);
> +    mr = g_new(MemoryRegion, 1);

Won't Coverity or other analysis tools complain about the leak?
(this is why we usually keep a reference in the device state, here
ArticiaState). Otherwise:

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>

> +    memory_region_init_alias(mr, OBJECT(dev), "pci-mem-low", &s->mem,
> +                             0, PCI_LOW_SIZE);
> +    memory_region_add_subregion(get_system_memory(), PCI_LOW_ADDR, mr);
> +    mr = g_new(MemoryRegion, 1);
> +    memory_region_init_alias(mr, OBJECT(dev), "pci-mem-high", &s->mem,
> +                             PCI_HIGH_ADDR, PCI_HIGH_SIZE);
> +    memory_region_add_subregion(get_system_memory(), PCI_HIGH_ADDR, mr);


  reply	other threads:[~2025-10-27 19:37 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-24 23:31 [PATCH 0/4] Some more pegasos patches BALATON Zoltan
2025-10-24 23:31 ` [PATCH 1/4] hw/ppc/pegasos2: Add /chosen/stdin node with VOF BALATON Zoltan
2025-10-30  8:06   ` Harsh Prateek Bora
2025-10-24 23:31 ` [PATCH 2/4] hw/pci-host/articia: Map PCI memory windows in realize BALATON Zoltan
2025-10-27 19:35   ` Philippe Mathieu-Daudé [this message]
2025-10-27 19:47     ` BALATON Zoltan
2025-10-28  5:01       ` Philippe Mathieu-Daudé
2025-10-28 12:59         ` BALATON Zoltan
2025-10-28 16:33           ` Akihiko Odaki
2025-10-28 21:28             ` BALATON Zoltan
2025-10-29  4:23               ` Akihiko Odaki
2025-10-29 10:30                 ` BALATON Zoltan
2025-10-29 13:25                   ` BALATON Zoltan
2025-10-30  0:36                     ` Mark Cave-Ayland
2025-10-30 10:29                       ` BALATON Zoltan
2025-10-29 19:20                   ` Peter Xu
2025-10-30 10:25                     ` Paolo Bonzini
2025-10-30 10:38                       ` BALATON Zoltan
2025-10-30 10:49                         ` Paolo Bonzini
2025-10-30 11:01                           ` BALATON Zoltan
2025-10-30 12:29                             ` Paolo Bonzini
2025-10-30 12:45                               ` BALATON Zoltan
2025-10-30 10:53                       ` BALATON Zoltan
2025-10-28 23:57     ` BALATON Zoltan
2025-10-24 23:31 ` [PATCH 3/4] hw/ppc/pegasos2: Rename to pegasos BALATON Zoltan
2025-10-27 19:36   ` Philippe Mathieu-Daudé
2025-10-24 23:31 ` [PATCH 4/4] hw/ppc/pegasos: Update documentation for pegasos1 BALATON Zoltan
2025-10-27 19:37   ` Philippe Mathieu-Daudé

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=7747275c-8e0a-4983-8613-fc39fc03bb39@linaro.org \
    --to=philmd@linaro.org \
    --cc=balaton@eik.bme.hu \
    --cc=harshpb@linux.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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).