Skip to content

split out piix specific part from pc emulator and some clean ups

Isaku Yamahata qemu-devel 1 version Applied

Status from this message: Thanks, applied all.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest26 patches 2 repliesApplied

Changes from V12 from the cover letter

- 2/26 acpi: split out apm register emulation from acpi.c
The patch originally convert CMOS S3 code to qemu_irq. However the conversion is already done by Blue Swirl. So the patch was simplified.
- 22/26 pci hotadd, acpi_piix4: remove global variables
Minor style fix according to Blue's patch.
- rebased to 5acd0646b6033d40ef5d0ae06338cc354108f640

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/26acpi: split out piix4 smbus routines from acpi.c into pm_smbus.cMakefile.target hw/acpi.c hw/pm_smbus.c +1 more+209 -1560 replies
2/26acpi: split out apm register emulation from acpi.cMakefile.target hw/acpi.c hw/apm.c +1 more+127 -450 replies
3/26acpi: add acpi constants from linux header files and use them.hw/acpi.c hw/acpi.h+103 -310 replies
4/26acpi: split acpi.c into the common part and the piix4 part.Makefile.target hw/acpi.c hw/acpi_piix4.c+2 -7340 replies
5/26pc: initialize ioapic before use.hw/pc.c+3 -30 replies
6/26pc, i440fx: Make smm enable/disable function i440fx independent.hw/pc.c hw/pc.h hw/piix_pci.c+22 -50 replies
7/26pc: make an unnecessary global variable, pit, local.hw/pc.c+1 -10 replies
8/26pc: remove a global variable, floppy_controller.hw/pc.c+5 -30 replies
9/26pc: remove global variable rtc_state by using qemu_irq.hw/pc.c+7 -90 replies
10/26pc: introduce a function to allocate cpu irq.hw/pc.c+6 -10 replies
11/26pc: make pc_init1() not refer ferr_irq directly.hw/pc.c hw/pc.h+9 -10 replies
12/26pc: split out cpu initialization from pc_init1() into pc_cpus_init().hw/pc.c+19 -120 replies
13/26pc: split out memory allocation from pc_init1() into pc_memory_init()hw/pc.c+45 -280 replies
14/26pc: split out vga initialization from pc_init1() into pc_vga_init().hw/pc.c+23 -180 replies
15/26pc: split out basic device init from pc_init1() into pc_basic_device_init()hw/pc.c+48 -380 replies
16/26pc: split out pci device init from pc_init1() into pc_pci_device_init()hw/pc.c+12 -70 replies
17/26pc: split out piix specific part from pc.c into pc_piix.cMakefile.target hw/fdc.h hw/pc.c +2 more+381 -3270 replies
18/26pc: move rtc declarations from pc.h into a dedicated header file.hw/mc146818rtc.h hw/pc.h+11 -80 replies
19/26rtc: make rtc_xxx accept/return ISADevice instead of RTCState.hw/mc146818rtc.c hw/mc146818rtc.h hw/mips_jazz.c +6 more+34 -260 replies
20/26acpi_piix4: qdevfy.hw/acpi_piix4.c+46 -150 replies
21/26pci hotplug: add argument to pci hot plug callback.hw/acpi_piix4.c hw/pci.c hw/pci.h+10 -80 replies
22/26pci hotadd, acpi_piix4: remove global variableshw/acpi_piix4.c hw/pc.h hw/pc_piix.c+48 -430 replies
23/26pm_smbus: remove #ifdef DEBUG.hw/pm_smbus.c+12 -90 replies
24/26acpi_piix4: remove #ifdef DEBUG.hw/acpi_piix4.c+18 -370 replies
25/26apm: remove #ifdef DEBUG.hw/apm.c+8 -60 replies
26/26mc146818rtc: remove #ifdef DEBUG_CMOS.hw/mc146818rtc.c+10 -80 replies

Reviews trailers per patch

All 26 patches have a Reviewed-by or Acked-by.

PatchGerd Hoffmann
1/26A-b
2/26A-b
3/26A-b
4/26A-b
5/26A-b
6/26A-b
7/26A-b
8/26A-b
9/26A-b
10/26A-b
11/26A-b
12/26A-b
13/26A-b
14/26A-b
15/26A-b
16/26A-b
17/26A-b
18/26A-b
19/26A-b
20/26A-b
21/26A-b
22/26A-b
23/26A-b
24/26A-b
25/26A-b
26/26A-b

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

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 00/26] split out piix specific part from pc emulator and some clean ups

patch series description:
This patch series is for spliting out piix specific part from pc emulator to make it easier to implement other pc chipset emulator.

I observed that make was confused not to rebuild files sometimes due to splitting up a file into files. It results in duplicated/undefined symbols. In that case, 'make clean;make' will fix it.

Blue, your patches were combied into 21/26, and 22/26. Please check it. Your patches to acpi.c had some issues. I fixed them in this patch series.

1/2 acpi: remove static pm_state:
The first argument, dev, of piix4_device_hotplug() is not PIIX4PMState device, but hot plugged device.
So the container_of() doesn't make sense.
2/2 acpi: remove static gpe and pci0_status variables
The call back argument to pge_readb(), gpe_writeb() is struct gpe_regs. Not PIIX4PMState.
The callback argument pcihotplug_read(), pcihotplug_write() is struct pci_status. Not PIIX4PMState.
Those argument type is void*, so compiler didn't catch it.

thanks,

Changes from V12:
- 2/26 acpi: split out apm register emulation from acpi.c
The patch originally convert CMOS S3 code to qemu_irq. However the conversion is already done by Blue Swirl. So the patch was simplified.
- 22/26 pci hotadd, acpi_piix4: remove global variables
Minor style fix according to Blue's patch.
- rebased to 5acd0646b6033d40ef5d0ae06338cc354108f640

Changes from V11:
- s/pc_smbus/pm_smbus/g, s/pc_apm/apm/g and so on
because it isn't pc specifc. mips also uses it.
- No logic changes.

Changes from V10:
- pass DeviceState* to pc_smbus_init(), now info qtree shows smbus.
- change pci hotplug argument from void * to DeviceState*.

Changes from V9:
- rebased 502e64fe23f19c086d42f6178cdda19e58996080
- use qemu_irq to remove global variables, rtc_state
- make rtc_xxx functions accept/return ISADevice and related clean ups
- pci hot plug clean up
- removed #ifdef DEBUG patches.

Changes from V8:
- make rtc_xxx functions accept/return ISADevice.
- move up ioapic initalization patch.
- fixed up copyright notice.

Changes from V7:
- rebased to fe0d61231eb6be6a83c54f4a2795f924ee963f8f

Changes from v6:
- rebased to 731c54f86988d3f28268f184fabfe9b2a32fb5d3

Changes from v5:
- rebased 0.11.0-rc0
- changed qemu_system_powerdown_register() to call qemu_system_shutdown_request() if qemu_system_shutdown() is called before registering.

Changes from v4:
- fix version number.
- rebased anthony's staging tree whose latest change set is 62969268f876c547ee64da6d60e0f363e0f1df75

Changes from v3:
- move qemu_system_powerdown() in vl.c and more generic following the comment by Marcelo Tosatti <[email protected]> acpi.c: make qemu_system_powerdown() piix independent.
- define cmos_set_s3_resume_init() and cmos_set_s3_resume() in pc.c even if TARGET_I386 isn't defined following th ecommit by Paolo Bonzini <[email protected]>
pc.c: remove a global variable, RTCState *rtc_state.
- minor compilation fixes

Changes from v2:
- clean up pc_pci_device_init() not to use unnecessary braces.

Changes from v1:
- make patches full bisectable
- typo s/allocte/allocate/
- some minor fixes
- dropped a merged patch

Isaku Yamahata (26):
acpi: split out piix4 smbus routines from acpi.c into pm_smbus.c
acpi: split out apm register emulation from acpi.c
acpi: add acpi constants from linux header files and use them.
acpi: split acpi.c into the common part and the piix4 part.
pc: initialize ioapic before use.
pc, i440fx: Make smm enable/disable function i440fx independent.
pc: make an unnecessary global variable, pit, local.
pc: remove a global variable, floppy_controller.
pc: remove global variable rtc_state by using qemu_irq.
pc: introduce a function to allocate cpu irq.
pc: make pc_init1() not refer ferr_irq directly.
pc: split out cpu initialization from pc_init1() into pc_cpus_init().
pc: split out memory allocation from pc_init1() into pc_memory_init()
pc: split out vga initialization from pc_init1() into pc_vga_init().
pc: split out basic device init from pc_init1() into
pc_basic_device_init()
pc: split out pci device init from pc_init1() into
pc_pci_device_init()
pc: split out piix specific part from pc.c into pc_piix.c
pc: move rtc declarations from pc.h into a dedicated header file.
rtc: make rtc_xxx accept/return ISADevice instead of RTCState.
acpi_piix4: qdevfy.
pci hotplug: add argument to pci hot plug callback.
pci hotadd, acpi_piix4: remove global variables
pm_smbus: remove #ifdef DEBUG.
acpi_piix4: remove #ifdef DEBUG.
apm: remove #ifdef DEBUG.
mc146818rtc: remove #ifdef DEBUG_CMOS.

 Makefile.target  |    2 +
 hw/acpi.c        |  743 +-----------------------------------------------------
 hw/acpi.h        |   78 ++++++
 hw/acpi_piix4.c  |  602 +++++++++++++++++++++++++++++++++++++++++++
 hw/apm.c         |   87 +++++++
 hw/apm.h         |   22 ++
 hw/fdc.h         |    5 +
 hw/mc146818rtc.c |   44 ++--
 hw/mc146818rtc.h |   10 +
 hw/mips_jazz.c   |    1 +
 hw/mips_malta.c  |    3 +-
 hw/mips_r4k.c    |    3 +-
 hw/pc.c          |  423 +++++++------------------------
 hw/pc.h          |   48 +++-
 hw/pc_piix.c     |  316 +++++++++++++++++++++++
 hw/pci.c         |    8 +-
 hw/pci.h         |    4 +-
 hw/piix_pci.c    |    5 +-
 hw/pm_smbus.c    |  181 +++++++++++++
 hw/pm_smbus.h    |   21 ++
 hw/ppc_prep.c    |    1 +
 21 files changed, 1500 insertions(+), 1107 deletions(-)
 create mode 100644 hw/acpi.h
 create mode 100644 hw/acpi_piix4.c
 create mode 100644 hw/apm.c
 create mode 100644 hw/apm.h
 create mode 100644 hw/mc146818rtc.h
 create mode 100644 hw/pc_piix.c
 create mode 100644 hw/pm_smbus.c
 create mode 100644 hw/pm_smbus.h