[PATCH 0/7] hw/ide: Untangle ISA/PCI abuses of ide_init_ioport()

Philippe Mathieu-Daudé posted 7 patches 1 year, 2 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230208000743.79415-1-philmd@linaro.org
Maintainers: John Snow <jsnow@redhat.com>
There is a newer version of this series
hw/ide/ioport.c           | 13 ++++++++++---
hw/ide/isa.c              |  2 +-
hw/ide/piix.c             | 21 ++++++---------------
hw/isa/isa-bus.c          | 13 ++++++++++---
include/hw/ide/internal.h |  4 +++-
include/hw/isa/isa.h      |  5 +----
6 files changed, 31 insertions(+), 27 deletions(-)
[PATCH 0/7] hw/ide: Untangle ISA/PCI abuses of ide_init_ioport()
Posted by Philippe Mathieu-Daudé 1 year, 2 months ago
Background thread:
https://lore.kernel.org/qemu-devel/5095dffc-309b-6c72-d255-8cdaa6fd3d52@ilande.co.uk/

The ide_init_ioport() method expect an ISA device, but is
massaged to accept NULL device (IOW, non-ISA devices...).

A plausible explanation is QOM objects can only inherit one
parent, and ide_init_ioport() was first used with ISA children.
Later it was adapted to accept PCI children in a convoluted
way. The PIIX IDE function abuse it.

This series rename the current ide_init_ioport() as
ide_init_ioport_isa(), then add a generic ide_init_ioport()
which works with PCI devices.

This is required to proceed with more PIIX cleanups.

Philippe Mathieu-Daudé (7):
  hw/isa: Un-inline isa_bus_from_device()
  hw/isa: Use isa_address_space_io() to reduce access on global 'isabus'
  hw/ide: Rename ISA specific ide_init_ioport() as ide_init_ioport_isa()
  hw/ide: Introduce generic ide_init_ioport()
  hw/ide/piix: Use generic ide_init_ioport()
  hw/isa: Assert isa_register_portio_list() gets non-NULL ISA device
  hw/ide/piix: Remove dead code in pci_piix_init_ports()

 hw/ide/ioport.c           | 13 ++++++++++---
 hw/ide/isa.c              |  2 +-
 hw/ide/piix.c             | 21 ++++++---------------
 hw/isa/isa-bus.c          | 13 ++++++++++---
 include/hw/ide/internal.h |  4 +++-
 include/hw/isa/isa.h      |  5 +----
 6 files changed, 31 insertions(+), 27 deletions(-)

-- 
2.38.1


Re: [PATCH 0/7] hw/ide: Untangle ISA/PCI abuses of ide_init_ioport()
Posted by Philippe Mathieu-Daudé 1 year, 2 months ago
On 8/2/23 01:07, Philippe Mathieu-Daudé wrote:
> Background thread:
> https://lore.kernel.org/qemu-devel/5095dffc-309b-6c72-d255-8cdaa6fd3d52@ilande.co.uk/
> 
> The ide_init_ioport() method expect an ISA device, but is
> massaged to accept NULL device (IOW, non-ISA devices...).
> 
> A plausible explanation is QOM objects can only inherit one
> parent, and ide_init_ioport() was first used with ISA children.
> Later it was adapted to accept PCI children in a convoluted
> way. The PIIX IDE function abuse it.
> 
> This series rename the current ide_init_ioport() as
> ide_init_ioport_isa(), then add a generic ide_init_ioport()
> which works with PCI devices.
> 
> This is required to proceed with more PIIX cleanups.
> 
> Philippe Mathieu-Daudé (7):
>    hw/isa: Un-inline isa_bus_from_device()
>    hw/isa: Use isa_address_space_io() to reduce access on global 'isabus'
>    hw/ide: Rename ISA specific ide_init_ioport() as ide_init_ioport_isa()
>    hw/ide: Introduce generic ide_init_ioport()
>    hw/ide/piix: Use generic ide_init_ioport()
>    hw/isa: Assert isa_register_portio_list() gets non-NULL ISA device
>    hw/ide/piix: Remove dead code in pci_piix_init_ports()

Forgot:
Based-on: <20230207234615.77300-1-philmd@linaro.org>
"exec/ioport: Factor portio_list_register[flush_coalesced]() out"
https://lore.kernel.org/qemu-devel/20230207234615.77300-1-philmd@linaro.org/