qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/12] hw: Strengthen SysBus & QBus API
@ 2023-10-19  7:15 Philippe Mathieu-Daudé
  2023-10-19  7:15 ` [PATCH v2 01/12] hw/i386/amd_iommu: Do not use SysBus API to map local MMIO region Philippe Mathieu-Daudé
                   ` (13 more replies)
  0 siblings, 14 replies; 24+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-10-19  7:15 UTC (permalink / raw)
  To: qemu-devel
  Cc: Daniel P. Berrangé, Ilya Leoshkevich, Halil Pasic,
	Huacai Chen, Beniamino Galvani, Thomas Huth, Jiaxun Yang,
	Marcel Apfelbaum, qemu-arm, Mark Cave-Ayland, Eric Farman,
	Paolo Bonzini, Philippe Mathieu-Daudé, qemu-s390x,
	Strahinja Jankovic, Richard Henderson, Markus Armbruster,
	Song Gao, Eduardo Habkost, Peter Xu, Sergio Lopez,
	Christian Borntraeger, David Hildenbrand, Peter Maydell,
	Michael S. Tsirkin, Jason Wang

Hi,

This series ensure:

- qbus_new() and sysbus_init_mmio() are called *before*
  a device is realized,
- sysbus_mmio_map() is called *after* it is realized.

First we fix some abuse, then we enforce in qdev/sysbus
core code.

There is still a failure in PXA2xx:

  qemu-system-aarch64: sysbus_init_mmio(type:pxa2xx_pic) but object is realized

Apparently it cames from commit 3f6c925f37 ("Use i2c_slave_init() to
allocate the PXA (dummy) I2C slave"), which I presume was how to model
slave<->master transactions *before* I2C bus modelling.

Based-on: <20231018133059.85765-1-philmd@linaro.org>
          "hw/ppc: SysBus simplifications" [1]
Based-on: <20231018131220.84380-1-philmd@linaro.org>
          "hw/arm/pxa2xx: SysBus/QDev fixes" [2]

v1: https://lore.kernel.org/qemu-devel/20231018141151.87466-1-philmd@linaro.org/
[1] https://lore.kernel.org/qemu-devel/20231018133059.85765-1-philmd@linaro.org/
[2] https://lore.kernel.org/qemu-devel/20231018131220.84380-1-philmd@linaro.org/

Philippe Mathieu-Daudé (12):
  hw/i386/amd_iommu: Do not use SysBus API to map local MMIO region
  hw/i386/intel_iommu: Do not use SysBus API to map local MMIO region
  hw/misc/allwinner-dramc: Move sysbus_mmio_map call from init ->
    realize
  hw/misc/allwinner-dramc: Do not use SysBus API to map local MMIO
    region
  hw/pci-host/bonito: Do not use SysBus API to map local MMIO region
  hw/acpi: Realize ACPI_GED sysbus device before accessing it
  hw/arm/virt: Realize ARM_GICV2M sysbus device before accessing it
  hw/isa: Realize ISA BUS sysbus device before accessing it
  hw/s390x/css-bridge: Realize sysbus device before accessing it
  hw/qdev: Ensure parent device is not realized before adding bus
  hw/sysbus: Ensure device is not realized before adding MMIO region
  hw/sysbus: Ensure device is realized before mapping it

 hw/arm/virt.c                 |  5 ++---
 hw/core/bus.c                 |  7 +++++++
 hw/core/sysbus.c              | 13 +++++++++++++
 hw/i386/amd_iommu.c           |  5 ++---
 hw/i386/intel_iommu.c         |  5 ++---
 hw/i386/microvm.c             |  2 +-
 hw/isa/isa-bus.c              | 11 +++++++++--
 hw/loongarch/virt.c           |  2 +-
 hw/misc/allwinner-r40-dramc.c | 20 +++++++++-----------
 hw/pci-host/bonito.c          | 32 ++++++++++++++++----------------
 hw/s390x/css-bridge.c         |  7 +++----
 11 files changed, 65 insertions(+), 44 deletions(-)

-- 
2.41.0



^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2023-10-20 14:33 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-19  7:15 [PATCH v2 00/12] hw: Strengthen SysBus & QBus API Philippe Mathieu-Daudé
2023-10-19  7:15 ` [PATCH v2 01/12] hw/i386/amd_iommu: Do not use SysBus API to map local MMIO region Philippe Mathieu-Daudé
2023-10-20  3:33   ` Zhao Liu
2023-10-19  7:16 ` [PATCH v2 02/12] hw/i386/intel_iommu: " Philippe Mathieu-Daudé
2023-10-20  3:35   ` Zhao Liu
2023-10-19  7:16 ` [PATCH v2 03/12] hw/misc/allwinner-dramc: Move sysbus_mmio_map call from init -> realize Philippe Mathieu-Daudé
2023-10-19  7:34   ` Thomas Huth
2023-10-19  7:16 ` [PATCH v2 04/12] hw/misc/allwinner-dramc: Do not use SysBus API to map local MMIO region Philippe Mathieu-Daudé
2023-10-19  7:44   ` Thomas Huth
2023-10-19  7:16 ` [PATCH v2 05/12] hw/pci-host/bonito: " Philippe Mathieu-Daudé
2023-10-19  7:26   ` Thomas Huth
2023-10-19  7:38     ` Philippe Mathieu-Daudé
2023-10-19  7:16 ` [PATCH v2 06/12] hw/acpi: Realize ACPI_GED sysbus device before accessing it Philippe Mathieu-Daudé
2023-10-19  7:16 ` [PATCH v2 07/12] hw/arm/virt: Realize ARM_GICV2M " Philippe Mathieu-Daudé
2023-10-19  7:16 ` [PATCH v2 08/12] hw/isa: Realize ISA BUS " Philippe Mathieu-Daudé
2023-10-19  7:16 ` [PATCH v2 09/12] hw/s390x/css-bridge: Realize " Philippe Mathieu-Daudé
2023-10-19  7:46   ` Thomas Huth
2023-10-20 14:21   ` Eric Farman
2023-10-19  7:16 ` [PATCH v2 10/12] hw/qdev: Ensure parent device is not realized before adding bus Philippe Mathieu-Daudé
2023-10-19  7:16 ` [PATCH v2 11/12] hw/sysbus: Ensure device is not realized before adding MMIO region Philippe Mathieu-Daudé
2023-10-19  7:16 ` [PATCH v2 12/12] hw/sysbus: Ensure device is realized before mapping it Philippe Mathieu-Daudé
2023-10-19  7:32 ` [PATCH v2 00/12] hw: Strengthen SysBus & QBus API Thomas Huth
2023-10-19  7:35   ` Philippe Mathieu-Daudé
2023-10-19 21:40 ` Philippe Mathieu-Daudé

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).