qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org, qemu-riscv@nongnu.org,
	"Bernhard Beschow" <shentey@gmail.com>,
	"Mark Cave-Ayland" <mark.caveayland@nutanix.com>,
	qemu-ppc@nongnu.org, qemu-block@nongnu.org,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>
Subject: [PATCH v2 3/7] hw/i386/ioapic: Use proper SysBus accessors
Date: Tue, 28 Oct 2025 09:02:53 +0100	[thread overview]
Message-ID: <20251028080258.23309-4-philmd@linaro.org> (raw)
In-Reply-To: <20251028080258.23309-1-philmd@linaro.org>

SysBusDevice::mmio[] is kind of internal. Use the proper
sysbus_mmio_get_region() accessor.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/i386/kvm/ioapic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/i386/kvm/ioapic.c b/hw/i386/kvm/ioapic.c
index 693ee978a12..0519432edbe 100644
--- a/hw/i386/kvm/ioapic.c
+++ b/hw/i386/kvm/ioapic.c
@@ -80,6 +80,7 @@ static void kvm_ioapic_put(IOAPICCommonState *s)
 {
     struct kvm_irqchip chip;
     struct kvm_ioapic_state *kioapic;
+    MemoryRegion *mr = sysbus_mmio_get_region(s->busdev, 0);
     int ret, i;
 
     chip.chip_id = KVM_IRQCHIP_IOAPIC;
@@ -87,7 +88,7 @@ static void kvm_ioapic_put(IOAPICCommonState *s)
 
     kioapic->id = s->id;
     kioapic->ioregsel = s->ioregsel;
-    kioapic->base_address = s->busdev.mmio[0].addr;
+    kioapic->base_address = mr->addr;
     kioapic->irr = s->irr;
     for (i = 0; i < IOAPIC_NUM_PINS; i++) {
         kioapic->redirtbl[i].bits = s->ioredtbl[i];
-- 
2.51.0



  parent reply	other threads:[~2025-10-28  8:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-28  8:02 [PATCH v2 0/7] hw/sysbus: Spring cleanups (part 1) Philippe Mathieu-Daudé
2025-10-28  8:02 ` [PATCH v2 1/7] hw/sysbus: Use memory_region_name() Philippe Mathieu-Daudé
2025-10-28  8:46   ` Marc-André Lureau
2025-10-28  8:02 ` [PATCH v2 2/7] hw/i386/microvm: Use proper SysBus accessors Philippe Mathieu-Daudé
2025-10-28  8:02 ` Philippe Mathieu-Daudé [this message]
2025-10-28  8:02 ` [PATCH v2 4/7] hw/timer/hpet: " Philippe Mathieu-Daudé
2025-10-28  8:02 ` [PATCH v2 5/7] hw/acpi/cxl: " Philippe Mathieu-Daudé
2025-10-28  8:02 ` [PATCH v2 6/7] hw/ppc/e500: " Philippe Mathieu-Daudé
2025-10-28 12:27   ` BALATON Zoltan
2025-10-28  8:02 ` [PATCH v2 7/7] hw/pci-bridge/pci_expander_bridge: " Philippe Mathieu-Daudé
2025-10-28  8:49 ` [PATCH v2 0/7] hw/sysbus: Spring cleanups (part 1) Marc-André Lureau
2025-10-28  9:16   ` Peter Maydell
2025-10-28 11:37     ` Philippe Mathieu-Daudé
2025-10-28 11:11   ` 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=20251028080258.23309-4-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=eduardo@habkost.net \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mark.caveayland@nutanix.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=shentey@gmail.com \
    /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).