[PATCH v2 0/6] QOM'ify PIIX southbridge creation

Bernhard Beschow posted 6 patches 1 month ago
hw/i386/pc_piix.c             |  7 ++-
hw/isa/piix3.c                | 98 +++++++++++++++++++----------------
hw/isa/piix4.c                | 97 +++++++++++++++-------------------
hw/mips/malta.c               |  7 ++-
include/hw/isa/isa.h          |  2 -
include/hw/southbridge/piix.h |  6 +--
6 files changed, 109 insertions(+), 108 deletions(-)
[PATCH v2 0/6] QOM'ify PIIX southbridge creation
Posted by Bernhard Beschow 1 month ago
v2:
* Preserve `DeviceState *` as return value of piix4_create() (Mark)
* Aggregate all type name movements into first commit (Mark)
* Have piix4 southbridge rather than malta board instantiate piix4 pm (me)

Testing done:

1)
`make check-avocado` for --target-list=x86_64-softmmu,mips-softmmu
Result: All pass.

2)
Modify pci_piix3_realize() to start with
    error_setg(errp, "This is a test");
Then start `qemu-system-x86_64 -M pc -m 1G -accel kvm -cpu host -cdrom archlinux-2022.05.01-x86_64.iso`.
Result: qemu-system-x86_64 aborts with: "This is a test"


v1:
The piix3 and piix4 southbridge devices still rely on create() functions which
are deprecated. This series resolves these functions piece by piece to
modernize the code.

Both devices are modified in lockstep where possible to provide more context.

Testing done:
* `qemu-system-x86_64 -M pc -m 2G -cdrom archlinux-2022.05.01-x86_64.iso`
* `qemu-system-mipsel -M malta -kernel vmlinux-3.2.0-4-4kc-malta -hda 
debian_wheezy_mipsel_standard.qcow2 -append "root=/dev/sda1 console=tty0"`

In both cases the system booted successfully and it was possible to shut down
the system using the `poweroff` command.

Bernhard Beschow (6):
  include/hw/southbridge/piix: Aggregate all PIIX soughbridge type names
  hw/isa/piix{3,4}: Move pci_map_irq_fn's near pci_set_irq_fn's
  hw/isa/piix{3,4}: QOM'ify PCI device creation and wiring
  hw/isa/piix{3,4}: Factor out ISABus retrieval from create() functions
  hw/isa/piix4: QOM'ify PIIX4 PM creation
  hw/isa/piix{3,4}: Inline and remove create() functions

 hw/i386/pc_piix.c             |  7 ++-
 hw/isa/piix3.c                | 98 +++++++++++++++++++----------------
 hw/isa/piix4.c                | 97 +++++++++++++++-------------------
 hw/mips/malta.c               |  7 ++-
 include/hw/isa/isa.h          |  2 -
 include/hw/southbridge/piix.h |  6 +--
 6 files changed, 109 insertions(+), 108 deletions(-)

-- 
2.36.1
Re: [PATCH v2 0/6] QOM'ify PIIX southbridge creation
Posted by Philippe Mathieu-Daudé via 1 month ago
On 22/5/22 23:24, Bernhard Beschow wrote:

> Bernhard Beschow (6):
>    include/hw/southbridge/piix: Aggregate all PIIX soughbridge type names
>    hw/isa/piix{3,4}: Move pci_map_irq_fn's near pci_set_irq_fn's
>    hw/isa/piix{3,4}: QOM'ify PCI device creation and wiring
>    hw/isa/piix{3,4}: Factor out ISABus retrieval from create() functions
>    hw/isa/piix4: QOM'ify PIIX4 PM creation
>    hw/isa/piix{3,4}: Inline and remove create() functions

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>