Skip to content

QOM'ify PIIX southbridge creation

Bernhard Beschow qemu-devel 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest11 patches 2 repliesIn review
  2. v37 patches 18 repliesSuperseded
  3. v26 patches 6 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v16 patches12 repliesSuperseded

Changes in v4 from the cover letter

* Rebase onto https://patchew.org/QEMU/[email protected]/
* Cosmetics (fix typo, omit "include") (Mark, Philippe)
* Split piix3 and piix4 (Philippe)
* s/Found-by/Reported-by/ (Philippe)
* Don't alias smbus (Mark)

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11hw/southbridge/piix: Aggregate all PIIX southbridge type nameshw/isa/piix3.c include/hw/isa/isa.h include/hw/southbridge/piix.h+4 -50 replies
2/11hw/isa/piix4: Use object_initialize_child() for embedded structhw/isa/piix4.c+1 -10 replies
3/11hw/isa/piix4: Move pci_map_irq_fn' near pci_set_irq_fnhw/isa/piix4.c+25 -250 replies
4/11hw/isa/piix4: QOM'ify PCI device creation and wiringhw/isa/piix4.c+22 -80 replies
5/11hw/isa/piix4: Factor out ISABus retrieval from piix4_create()hw/isa/piix4.c hw/mips/malta.c include/hw/southbridge/piix.h+4 -70 replies
6/11hw/isa/piix4: QOM'ify PIIX4 PM creationhw/isa/piix4.c hw/mips/malta.c include/hw/southbridge/piix.h+18 -130 replies
7/11hw/isa/piix4: Inline and remove piix4_create()hw/isa/piix4.c hw/mips/malta.c include/hw/southbridge/piix.h+4 -160 replies
8/11hw/isa/piix3: Move pci_map_irq_fn near pci_set_irq_fnhw/isa/piix3.c+11 -110 replies
9/11hw/isa/piix3: QOM'ify PCI device creation and wiringhw/isa/piix3.c+45 -220 replies
10/11hw/isa/piix3: Factor out ISABus retrieval from piix3_create()hw/i386/pc_piix.c hw/isa/piix3.c include/hw/southbridge/piix.h+4 -40 replies
11/11hw/isa/piix3: Inline and remove piix3_create()hw/i386/pc_piix.c hw/isa/piix3.c include/hw/southbridge/piix.h+5 -160 replies

Reviews trailers per patch

9 of 11 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchMark Cave-AylandPhilippe Mathieu-Daudé
SeriesR-b
1/11R-b R-b
2/11R-b
3/11R-b R-b
4/11R-b
5/11R-b R-b
6/11
7/11R-b
8/11R-b R-b
9/11
10/11R-b
11/11R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 00/11] QOM'ify PIIX southbridge creation

v4:
* Rebase onto https://patchew.org/QEMU/[email protected]/
* Cosmetics (fix typo, omit "include") (Mark, Philippe)
* Split piix3 and piix4 (Philippe)
* s/Found-by/Reported-by/ (Philippe)
* Don't alias smbus (Mark)

v3:
* Rebase onto 'hw/acpi/piix4: remove legacy piix4_pm_init() function' (Mark) [1]
* Use embedded structs for touched PCI devices (Mark)
* Fix piix4's rtc embedded struct to be initialized by object_initialize_child() (Peter) [2]

Testing done:

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

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

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.

[1] https://lists.gnu.org/archive/html/qemu-devel/2022-05/msg05686.html
[2] https://lists.gnu.org/archive/html/qemu-devel/2022-02/msg01128.html

Bernhard Beschow (11):
hw/southbridge/piix: Aggregate all PIIX southbridge type names hw/isa/piix4: Use object_initialize_child() for embedded struct hw/isa/piix4: Move pci_map_irq_fn' near pci_set_irq_fn hw/isa/piix4: QOM'ify PCI device creation and wiring hw/isa/piix4: Factor out ISABus retrieval from piix4_create() hw/isa/piix4: QOM'ify PIIX4 PM creation
hw/isa/piix4: Inline and remove piix4_create() hw/isa/piix3: Move pci_map_irq_fn near pci_set_irq_fn hw/isa/piix3: QOM'ify PCI device creation and wiring hw/isa/piix3: Factor out ISABus retrieval from piix3_create() hw/isa/piix3: Inline and remove piix3_create()

 hw/i386/pc_piix.c             |   7 +-
 hw/isa/piix3.c                |  98 +++++++++++++++-------------
 hw/isa/piix4.c                | 119 +++++++++++++++++-----------------
 hw/mips/malta.c               |   9 ++-
 include/hw/isa/isa.h          |   2 -
 include/hw/southbridge/piix.h |   6 +-
 6 files changed, 128 insertions(+), 113 deletions(-)
Signature · 1 line
2.36.1