[PATCH v2 0/7] hw/sysbus: Spring cleanups (part 1)

Philippe Mathieu-Daudé posted 7 patches 2 weeks, 3 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20251028080258.23309-1-philmd@linaro.org
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Ani Sinha <anisinha@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, Richard Henderson <richard.henderson@linaro.org>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Bernhard Beschow <shentey@gmail.com>
There is a newer version of this series
hw/acpi/cxl.c                       | 2 +-
hw/core/sysbus.c                    | 2 +-
hw/i386/kvm/ioapic.c                | 3 ++-
hw/i386/microvm-dt.c                | 6 ++++--
hw/pci-bridge/pci_expander_bridge.c | 6 +++---
hw/ppc/e500.c                       | 2 +-
hw/timer/hpet.c                     | 3 ++-
7 files changed, 14 insertions(+), 10 deletions(-)
[PATCH v2 0/7] hw/sysbus: Spring cleanups (part 1)
Posted by Philippe Mathieu-Daudé 2 weeks, 3 days ago
- Use proper SysBus accessors

Since v1:
- Reduce series

Philippe Mathieu-Daudé (7):
  hw/sysbus: Use memory_region_name()
  hw/i386/microvm: Use proper SysBus accessors
  hw/i386/ioapic: Use proper SysBus accessors
  hw/timer/hpet: Use proper SysBus accessors
  hw/acpi/cxl: Use proper SysBus accessors
  hw/ppc/e500: Use proper SysBus accessors
  hw/pci-bridge/pci_expander_bridge: Use proper SysBus accessors

 hw/acpi/cxl.c                       | 2 +-
 hw/core/sysbus.c                    | 2 +-
 hw/i386/kvm/ioapic.c                | 3 ++-
 hw/i386/microvm-dt.c                | 6 ++++--
 hw/pci-bridge/pci_expander_bridge.c | 6 +++---
 hw/ppc/e500.c                       | 2 +-
 hw/timer/hpet.c                     | 3 ++-
 7 files changed, 14 insertions(+), 10 deletions(-)

-- 
2.51.0


Re: [PATCH v2 0/7] hw/sysbus: Spring cleanups (part 1)
Posted by Marc-André Lureau 2 weeks, 3 days ago
Hi

On Tue, Oct 28, 2025 at 12:04 PM Philippe Mathieu-Daudé
<philmd@linaro.org> wrote:
>
> - Use proper SysBus accessors
>
> Since v1:
> - Reduce series
>
> Philippe Mathieu-Daudé (7):
>   hw/sysbus: Use memory_region_name()
>   hw/i386/microvm: Use proper SysBus accessors
>   hw/i386/ioapic: Use proper SysBus accessors
>   hw/timer/hpet: Use proper SysBus accessors
>   hw/acpi/cxl: Use proper SysBus accessors
>   hw/ppc/e500: Use proper SysBus accessors
>   hw/pci-bridge/pci_expander_bridge: Use proper SysBus accessors
>

There are a bunch of compilation issues that I will let you address for v3.

It looks like it should be possible to remove the "addr" field from
SysBusDevice.mmio. On the surface it looks redundante with
MemoryRegion.addr. I might be missing something.



>  hw/acpi/cxl.c                       | 2 +-
>  hw/core/sysbus.c                    | 2 +-
>  hw/i386/kvm/ioapic.c                | 3 ++-
>  hw/i386/microvm-dt.c                | 6 ++++--
>  hw/pci-bridge/pci_expander_bridge.c | 6 +++---
>  hw/ppc/e500.c                       | 2 +-
>  hw/timer/hpet.c                     | 3 ++-
>  7 files changed, 14 insertions(+), 10 deletions(-)
>
> --
> 2.51.0
>
>


-- 
Marc-André Lureau
Re: [PATCH v2 0/7] hw/sysbus: Spring cleanups (part 1)
Posted by Philippe Mathieu-Daudé 2 weeks, 3 days ago
On 28/10/25 09:49, Marc-André Lureau wrote:
> Hi
> 
> On Tue, Oct 28, 2025 at 12:04 PM Philippe Mathieu-Daudé
> <philmd@linaro.org> wrote:
>>
>> - Use proper SysBus accessors
>>
>> Since v1:
>> - Reduce series
>>
>> Philippe Mathieu-Daudé (7):
>>    hw/sysbus: Use memory_region_name()
>>    hw/i386/microvm: Use proper SysBus accessors
>>    hw/i386/ioapic: Use proper SysBus accessors
>>    hw/timer/hpet: Use proper SysBus accessors
>>    hw/acpi/cxl: Use proper SysBus accessors
>>    hw/ppc/e500: Use proper SysBus accessors
>>    hw/pci-bridge/pci_expander_bridge: Use proper SysBus accessors
>>
> 
> There are a bunch of compilation issues that I will let you address for v3.

Sorry, this is based on my latest PR:
https://github.com/philmd/qemu/releases/tag/hw-misc-20251028
Based-on: <20251028074901.22062-1-philmd@linaro.org>

Re: [PATCH v2 0/7] hw/sysbus: Spring cleanups (part 1)
Posted by Peter Maydell 2 weeks, 3 days ago
On Tue, 28 Oct 2025 at 08:50, Marc-André Lureau
<marcandre.lureau@gmail.com> wrote:
>
> Hi
>
> On Tue, Oct 28, 2025 at 12:04 PM Philippe Mathieu-Daudé
> <philmd@linaro.org> wrote:
> >
> > - Use proper SysBus accessors
> >
> > Since v1:
> > - Reduce series
> >
> > Philippe Mathieu-Daudé (7):
> >   hw/sysbus: Use memory_region_name()
> >   hw/i386/microvm: Use proper SysBus accessors
> >   hw/i386/ioapic: Use proper SysBus accessors
> >   hw/timer/hpet: Use proper SysBus accessors
> >   hw/acpi/cxl: Use proper SysBus accessors
> >   hw/ppc/e500: Use proper SysBus accessors
> >   hw/pci-bridge/pci_expander_bridge: Use proper SysBus accessors
> >
>
> There are a bunch of compilation issues that I will let you address for v3.
>
> It looks like it should be possible to remove the "addr" field from
> SysBusDevice.mmio. On the surface it looks redundante with
> MemoryRegion.addr. I might be missing something.

Yes, I think they'll always be the same value. But
MemoryRegion::addr is private data of MemoryRegion
and there's no 'get' function provided; SysBus shouldn't
be reaching inside an MR struct to look at its internals.

(There is a memory_region_set_address(), so we could
I guess provide a memory_region_get_address() ?)

-- PMM
Re: [PATCH v2 0/7] hw/sysbus: Spring cleanups (part 1)
Posted by Philippe Mathieu-Daudé 2 weeks, 3 days ago
On 28/10/25 10:16, Peter Maydell wrote:
> On Tue, 28 Oct 2025 at 08:50, Marc-André Lureau
> <marcandre.lureau@gmail.com> wrote:
>>
>> Hi
>>
>> On Tue, Oct 28, 2025 at 12:04 PM Philippe Mathieu-Daudé
>> <philmd@linaro.org> wrote:
>>>
>>> - Use proper SysBus accessors
>>>
>>> Since v1:
>>> - Reduce series
>>>
>>> Philippe Mathieu-Daudé (7):
>>>    hw/sysbus: Use memory_region_name()
>>>    hw/i386/microvm: Use proper SysBus accessors
>>>    hw/i386/ioapic: Use proper SysBus accessors
>>>    hw/timer/hpet: Use proper SysBus accessors
>>>    hw/acpi/cxl: Use proper SysBus accessors
>>>    hw/ppc/e500: Use proper SysBus accessors
>>>    hw/pci-bridge/pci_expander_bridge: Use proper SysBus accessors
>>>
>>
>> There are a bunch of compilation issues that I will let you address for v3.
>>
>> It looks like it should be possible to remove the "addr" field from
>> SysBusDevice.mmio. On the surface it looks redundante with
>> MemoryRegion.addr. I might be missing something.
> 
> Yes, I think they'll always be the same value. But
> MemoryRegion::addr is private data of MemoryRegion
> and there's no 'get' function provided; SysBus shouldn't
> be reaching inside an MR struct to look at its internals.
> 
> (There is a memory_region_set_address(), so we could
> I guess provide a memory_region_get_address() ?)

OK, thanks!