Skip to contentSkip to conversation

Tame a few "touch this, recompile the world" headers

PATCH Superseded Markus Armbruster 20 participants 124 messages Aug 6, 2019 – Oct 11, 2019 Page 1 of 4

Subsystems (15)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover Tame a few "touch this, recompile the world" headers

We have quite a few "touch this, recompile the world" headers. My "build everything" tree has some 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h). Touching any of 54 headers triggers a recompile of more than half of them.

This series reduces them to 46.

Six of the 54 are included always by design, via qemu/osdep.h. These are

bld/config-host.h
include/glib-compat.h
include/qemu/compiler.h
include/qemu/osdep.h
include/qemu/typedefs.h
include/sysemu/os-posix.h

Additionally, osdep.h includes either include/exec/poison.h or bld/TARGET_DIR/config-target.h.

The seven headers this series improves to my satisfaction (for now) are

bld/qapi/qapi-types-common.h
include/block/aio.h
include/hw/irq.h
include/qemu/event_notifier.h
include/qemu/main-loop.h
include/qemu/uuid.h
include/sysemu/sysemu.h

Of these, block/aio.h, qemu/main-loop.h and sysemu/sysemu.h are particular significant, as they in turn include numerous other headers.

The series makes real progress on a few more, but they're still bad:

bld/qapi/qapi-types-run-state.h
include/qemu/timer.h
include/qom/cpu.h
include/disas/dis-asm.h
include/qemu/notify.h
include/qemu/atomic.h

Minor improvements:

    bld/qapi/qapi-builtin-types.h
    bld/qapi/qapi-types-sockets.h
    include/exec/cpu-common.h
    include/exec/hwaddr.h
    include/exec/memattrs.h
    include/exec/memory.h
    include/exec/memory_ldst.inc.h
    include/exec/memory_ldst_cached.inc.h
    include/exec/memory_ldst_phys.inc.h
    include/exec/ramlist.h
    include/fpu/softfloat-types.h
    include/hw/hotplug.h
    include/hw/qdev-core.h
    include/qapi/util.h
    include/qemu/bitmap.h
    include/qemu/bitops.h
    include/qemu/bswap.h
    include/qemu/coroutine.h
    include/qemu/host-utils.h
    include/qemu/int128.h
    include/qemu/lockable.h
    include/qemu/module.h
    include/qemu/processor.h
    include/qemu/qsp.h
    include/qemu/queue.h
    include/qemu/rcu.h
    include/qemu/rcu_queue.h
    include/qemu/sys_membarrier.h
    include/qemu/thread-posix.h
    include/qemu/thread.h
    include/qom/object.h

Untouched:

    include/exec/cpu-all.h
    include/exec/cpu-defs.h
    tcg/i386/tcg-target.h
    tcg/tcg-mo.h

Further improvement is certainly possible. exec/cpu-all.h, exec/cpu-defs.h, exec/memory.h, hw/qdev-core.h, qemu/coroutine.h, qemu/lockable.h, and qom/cpu.h each pull in more than ten other headers, which makes them particularly wortwhile targets.

Observed patterns of #include misuse:

* Copy pasta

I found and deleted quite a few #include that were almost certainly never needed. The most likely explanation is lazy copying from a "similar" file. My deletions produced only minor improvements, though.

* "Convenience" headers

We sometimes have a header include a bunch of other headers the header itself doesn't need, so the header's users don't have to. An extreme case is hw/hw.h: it pulls in more than 40 other headers, then declares just hw_error(). Most of its users need only a fraction of it. PATCH 08-09,12-18 fix that, trading the very occasional convenience of not having to type a few #include directives for build speed.

* "Fat" headers

Some headers provide many things to many customers. Bad when the customers generally need only parts. Worse when such a "fat" header pulls in loads more. This series grapples with three instances:
qapi/qapi-types-common.h (PATCH 03), hw/boards.h, which pulls in almost 70 headers (PATCH 19-23), and sysemu/sysemu.h, which pulls in more than 20 (PATCH 23-28).

* Design erosion

Off-the-cuff additions to headers can erode design. For instance, the generated trace.h were carefully designed for minimal dependencies. We let them balloon when we added the per-vCPU tracing feature a few years later. PATCH 07 grapples with that.

PATCH 01 was previously posted separately. Since it needs a rebase now, I include it.

Related prior discussion:
Subject: Re: Our use of #include is undisciplined, and what to do about it
Date: Mon, 27 May 2019 15:12:34 +0200
Message-ID: <[email protected]>
https://lists.gnu.org/archive/html/qemu-devel/2019-05/msg06291.html

Detailed measurements, improvements under 10% omitted:

before after improvement

   5557     525    5032  91% include/hw/irq.h
   5585     846    4739  85% include/sysemu/sysemu.h
   5591     857    4734  85% include/qemu/uuid.h
   5694    1681    4013  70% include/qemu/main-loop.h
   5713    2755    2958  52% include/block/aio.h
   5715    2777    2938  51% include/qemu/event_notifier.h
   2814     268    2546  90% bld/qapi/qapi-types-block.h
   2473     old    2473 100% include/hw/qdev.h
   2596     179    2417  93% include/hw/hw.h
   2600     184    2416  93% include/sysemu/reset.h
   2598     193    2405  93% include/migration/qemu-file-types.h
   3033     870    2163  71% bld/qapi/qapi-types-misc.h
   5713    4226    1487  26% bld/qapi/qapi-types-run-state.h
   2666    1237    1429  54% include/hw/qdev-properties.h
   5729    4418    1311  23% include/qemu/timer.h
   2677    1548    1129  42% include/migration/vmstate.h
   3875    2877     998  26% bld/qapi/qapi-types-common.h
   2972    2071     901  30% bld/qapi/qapi-types-block-core.h
   2976    2077     899  30% bld/qapi/qapi-types-job.h
   3013    2115     898  30% bld/qapi/qapi-types-crypto.h
   4589    3957     632  14% include/qom/cpu.h
   4608    3976     632  14% include/disas/dis-asm.h
   3326    2715     611  18% bld/qapi/qapi-types-sockets.h
    248     111     137  55% include/sysemu/hostmem.h
     41      27      14  34% include/hw/ide/internal.h
     66      52      14  21% include/hw/ide.h
    109      95      14  13% include/scsi/constants.h
     17      11       6  35% include/hw/ide/pci.h
    141     142      -1  -1% include/qapi/qobject-input-visitor.h
    149     150      -1  -1% include/qapi/qmp-event.h
    152     153      -1  -1% bld/qapi/qapi-emit-events.h
    392     393      -1   0% include/qapi/qmp/qerror.h
    238     240      -2  -1% include/qapi/dealloc-visitor.h
    245     247      -2  -1% include/qapi/qobject-output-visitor.h
    342     344      -2  -1% include/qapi/qmp/qdict.h
    404     406      -2   0% include/qapi/qmp/qobject.h
   2632    2635      -3   0% include/qapi/error.h
    554     558      -4  -1% bld/qapi/qapi-builtin-visit.h
    793     797      -4  -1% include/qapi/visitor.h
   1129    1133      -4   0% include/exec/poison.h
   6591    6595      -4   0% bld/config-host.h
   6591    6595      -4   0% include/glib-compat.h
   6591    6595      -4   0% include/qemu/compiler.h
   6591    6595      -4   0% include/qemu/osdep.h
   6591    6595      -4   0% include/qemu/typedefs.h
   6591    6595      -4   0% include/sysemu/os-posix.h
    119     135     -16 -13% include/sysemu/numa.h
    new      32     -32      bld/qapi/qapi-events-error.h
    new      63     -63      bld/qapi/qapi-commands-error.h
    new     128    -128      bld/qapi/qapi-visit-error.h
    new     530    -530      include/sysemu/runstate.h
    new    1334   -1334      trace/control-vcpu.h
    new    2667   -2667      bld/qapi/qapi-types-error.h

The additional inclusions are due to PATCH 3's new bld/qapi-*-error.c, except for sysemu/numa.h, which is due to PATCH 25.

v2:
* Rebased
* PATCH 09+20+21
- Unbreak a few *kvm*.c for ppc, arm, mips, s390x. I currently have no way to even compile-test the latter two.
* PATCH 21
- Drop spurious whitespace changes [Eduardo]
* PATCH 22+23
- Keep some #include "hw/board.h" [Eduardo]
* PATCH 24
- Commit message spelling fix
* PATCH 26
- Make .c defining QemuOptsList declared in sysemu/sysemu.h include it
* PATCH 27+28
- Swapped to make it more obvious why both are useful
* PATCH 27
- Do not create sysemu/vmstate-notify.h, create sysemu/runstate.h in PATCH 29 instead
* PATCH 29
- New [Paolo]

Markus Armbruster (29):
include: Make headers more self-contained
Include generated QAPI headers less
qapi: Split error.json off common.json
memory: Fix type of IOMMUMemoryRegionClass member @parent_class
queue: Drop superfluous #include qemu/atomic.h
trace: Eliminate use of TARGET_FMT_plx
trace: Do not include qom/cpu.h into generated trace.h Include sysemu/reset.h a lot less
Include migration/qemu-file-types.h a lot less
ide: Include hw/ide/internal a bit less outside hw/ide/
typedefs: Separate incomplete types and function types Include hw/irq.h a lot less
Clean up inclusion of exec/cpu-common.h
migration: Move the VMStateDescription typedef to typedefs.h Include migration/vmstate.h less
Include exec/memory.h slightly less
Include qom/object.h slightly less
Include hw/hw.h exactly where needed
Include qemu/queue.h slightly less
Include qemu/main-loop.h less
Include hw/qdev-properties.h less
Include hw/boards.h a bit less
numa: Don't include hw/boards.h into sysemu/numa.h Include sysemu/hostmem.h less
numa: Move remaining NUMA declarations from sysemu.h to numa.h Clean up inclusion of sysemu/sysemu.h
Include sysemu/sysemu.h a lot less
sysemu: Move the VMChangeStateEntry typedef to qemu/typedefs.h
sysemu: Split sysemu/runstate.h off sysemu/sysemu.h

 MAINTAINERS                              |  2 +
 accel/kvm/kvm-all.c                      |  4 +-
 accel/stubs/tcg-stub.c                   |  1 -
 accel/tcg/tcg-all.c                      |  1 -
 audio/audio.c                            |  4 +-
 audio/spiceaudio.c                       |  1 -
 audio/wavcapture.c                       |  1 -
 backends/cryptodev-builtin.c             |  1 -
 backends/cryptodev-vhost-user.c          |  1 -
 backends/cryptodev.c                     |  1 -
 backends/hostmem.c                       |  1 +
 backends/vhost-user.c                    |  1 -
 balloon.c                                |  1 -
 block.c                                  |  1 +
 block/block-backend.c                    |  4 +-
 block/create.c                           |  1 +
 block/io.c                               |  1 +
 block/nbd.c                              |  1 +
 block/nfs.c                              |  2 +-
 block/nvme.c                             |  1 +
 block/qcow2.c                            |  1 +
 block/qed.c                              |  1 +
 block/sheepdog.c                         |  1 +
 block/throttle-groups.c                  |  1 +
 blockdev-nbd.c                           |  1 -
 blockdev.c                               |  2 +
 blockjob.c                               |  1 +
 chardev/baum.c                           |  1 +
 chardev/char-pipe.c                      |  1 +
 chardev/char-win-stdio.c                 |  1 +
 chardev/char-win.c                       |  1 +
 cpus.c                                   |  3 ++
 device-hotplug.c                         |  1 -
 dump/dump.c                              |  3 +-
 dump/win_dump.c                          |  1 -
 exec.c                                   |  4 +-
 fsdev/qemu-fsdev-throttle.c              |  1 +
 fsdev/qemu-fsdev-throttle.h              |  1 -
 gdbstub.c                                |  1 +
 hw/9pfs/9p.c                             |  1 +
 hw/9pfs/codir.c                          |  1 +
 hw/9pfs/cofile.c                         |  1 +
 hw/9pfs/cofs.c                           |  1 +
 hw/9pfs/coth.c                           |  1 +
 hw/9pfs/coth.h                           |  1 -
 hw/9pfs/coxattr.c                        |  1 +
 hw/9pfs/virtio-9p-device.c               |  1 +
 hw/9pfs/xen-9p-backend.c                 |  2 +-
 hw/acpi/core.c                           |  4 +-
 hw/acpi/cpu.c                            |  1 +
 hw/acpi/cpu_hotplug.c                    |  1 -
 hw/acpi/ich9.c                           |  7 ++-
 hw/acpi/memory_hotplug.c                 |  1 +
 hw/acpi/pcihp.c                          |  3 +-
 hw/acpi/piix4.c                          |  8 ++-
 hw/acpi/tco.c                            |  2 +
 hw/acpi/vmgenid.c                        |  4 +-
 hw/adc/stm32f2xx_adc.c                   |  2 +-
 hw/alpha/alpha_sys.h                     |  1 -
 hw/alpha/dp264.c                         |  2 -
 hw/alpha/pci.c                           |  1 -
 hw/alpha/typhoon.c                       |  4 +-
 hw/arm/allwinner-a10.c                   |  2 +
 hw/arm/armsse.c                          |  2 +
 hw/arm/armv7m.c                          |  2 +
 hw/arm/aspeed.c                          |  1 +
 hw/arm/aspeed_soc.c                      |  1 +
 hw/arm/boot.c                            |  3 +-
 hw/arm/collie.c                          |  1 -
 hw/arm/cubieboard.c                      |  1 +
 hw/arm/digic.c                           |  1 +
 hw/arm/exynos4210.c                      |  4 +-
 hw/arm/exynos4_boards.c                  |  2 +
 hw/arm/fsl-imx25.c                       |  2 +-
 hw/arm/fsl-imx31.c                       |  2 +-
 hw/arm/fsl-imx6.c                        |  1 +
 hw/arm/gumstix.c                         |  1 -
 hw/arm/highbank.c                        |  2 +
 hw/arm/integratorcp.c                    |  4 ++
 hw/arm/kzm.c                             |  1 +
 hw/arm/mainstone.c                       |  1 -
 hw/arm/mcimx6ul-evk.c                    |  1 +
 hw/arm/mcimx7d-sabre.c                   |  1 +
 hw/arm/microbit.c                        |  1 +
 hw/arm/msf2-soc.c                        |  4 +-
 hw/arm/msf2-som.c                        |  1 +
 hw/arm/musicpal.c                        |  5 ++
 hw/arm/netduino2.c                       |  1 +
 hw/arm/nrf51_soc.c                       |  2 -
 hw/arm/nseries.c                         |  3 ++
 hw/arm/omap1.c                           |  6 +++
 hw/arm/omap2.c                           |  6 ++-
 hw/arm/omap_sx1.c                        |  1 -
 hw/arm/palm.c                            |  3 +-
 hw/arm/pxa2xx.c                          |  3 ++
 hw/arm/pxa2xx_gpio.c                     |  3 ++
 hw/arm/pxa2xx_pic.c                      |  2 +-
 hw/arm/realview.c                        |  1 +
 hw/arm/sabrelite.c                       |  1 +
 hw/arm/sbsa-ref.c                        |  2 +
 hw/arm/smmu-common.c                     |  1 -
 hw/arm/smmuv3.c                          |  4 +-
 hw/arm/spitz.c                           |  5 +-
 hw/arm/stellaris.c                       |  3 ++
 hw/arm/stm32f205_soc.c                   |  2 +
 hw/arm/strongarm.c                       |  3 ++
 hw/arm/sysbus-fdt.c                      |  1 -
 hw/arm/tosa.c                            |  4 +-
 hw/arm/versatilepb.c                     |  2 +
 hw/arm/virt-acpi-build.c                 |  3 +-
 hw/arm/virt.c                            |  4 ++
 hw/arm/xlnx-zynqmp.c                     |  1 +
 hw/arm/z2.c                              |  4 +-
 hw/audio/ac97.c                          |  3 +-
 hw/audio/adlib.c                         |  2 +-
 hw/audio/cs4231.c                        |  1 +
 hw/audio/cs4231a.c                       |  5 +-
 hw/audio/es1370.c                        |  2 +-
 hw/audio/gus.c                           |  4 +-
 hw/audio/hda-codec.c                     |  3 +-
 hw/audio/intel-hda.c                     |  3 +-
 hw/audio/intel-hda.h                     |  2 +-
 hw/audio/lm4549.c                        |  1 +
 hw/audio/lm4549.h                        |  1 +
 hw/audio/marvell_88w8618.c               |  4 +-
 hw/audio/milkymist-ac97.c                |  3 +-
 hw/audio/pcspk.c                         |  2 +-
 hw/audio/pl041.c                         |  3 ++
 hw/audio/sb16.c                          |  5 +-
 hw/audio/wm8750.c                        |  1 +
 hw/block/dataplane/virtio-blk.c          |  1 +
 hw/block/dataplane/xen-block.c           |  2 +-
 hw/block/ecc.c                           |  2 +-
 hw/block/fdc.c                           |  5 +-
 hw/block/m25p80.c                        |  3 +-
 hw/block/nand.c                          |  3 +-
 hw/block/nvme.c                          |  3 +-
 hw/block/onenand.c                       |  2 +
 hw/block/pflash_cfi01.c                  |  5 +-
 hw/block/pflash_cfi02.c                  |  3 +-
 hw/block/tc58128.c                       |  1 -
 hw/block/vhost-user-blk.c                |  3 ++
 hw/block/virtio-blk.c                    |  4 ++
 hw/block/xen-block.c                     |  3 +-
 hw/char/bcm2835_aux.c                    |  3 ++
 hw/char/cadence_uart.c                   |  2 +
 hw/char/cmsdk-apb-uart.c                 |  2 +
 hw/char/debugcon.c                       |  2 +-
 hw/char/digic-uart.c                     |  3 +-
 hw/char/escc.c                           |  4 +-
 hw/char/etraxfs_ser.c                    |  2 +
 hw/char/exynos4210_uart.c                |  4 +-
 hw/char/grlib_apbuart.c                  |  2 +
 hw/char/imx_serial.c                     |  4 +-
 hw/char/ipoctal232.c                     |  3 ++
 hw/char/lm32_juart.c                     |  3 +-
 hw/char/lm32_uart.c                      |  4 +-
 hw/char/mcf_uart.c                       |  3 +-
 hw/char/milkymist-uart.c                 |  4 +-
 hw/char/nrf51_uart.c                     |  3 ++
 hw/char/omap_uart.c                      |  1 -
 hw/char/parallel-isa.c                   |  2 +
 hw/char/parallel.c                       |  5 +-
 hw/char/pl011.c                          |  2 +
 hw/char/sclpconsole-lm.c                 |  3 +-
 hw/char/sclpconsole.c                    |  3 +-
 hw/char/serial-isa.c                     |  3 ++
 hw/char/serial-pci-multi.c               |  3 ++
 hw/char/serial-pci.c                     |  3 ++
 hw/char/serial.c                         |  4 ++
 hw/char/sh_serial.c                      |  3 +-
 hw/char/spapr_vty.c                      |  4 +-
 hw/char/stm32f2xx_usart.c                |  2 +
 hw/char/terminal3270.c                   |  1 +
 hw/char/virtio-console.c                 |  1 +
 hw/char/virtio-serial-bus.c              |  3 ++
 hw/char/xen_console.c                    |  2 +-
 hw/char/xilinx_uartlite.c                |  3 ++
 hw/core/bus.c                            |  2 +-
 hw/core/empty_slot.c                     |  1 -
 hw/core/generic-loader.c                 |  2 +
 hw/core/loader-fit.c                     |  1 -
 hw/core/loader.c                         |  2 +
 hw/core/machine-qmp-cmds.c               |  2 +
 hw/core/null-machine.c                   |  1 -
 hw/core/numa.c                           |  5 ++
 hw/core/or-irq.c                         |  3 ++
 hw/core/platform-bus.c                   |  2 +-
 hw/core/ptimer.c                         |  3 +-
 hw/core/qdev-fw.c                        |  2 +-
 hw/core/qdev-properties-system.c         |  2 +-
 hw/core/qdev-properties.c                |  4 +-
 hw/core/qdev.c                           |  5 +-
 hw/core/register.c                       |  1 -
 hw/core/split-irq.c                      |  2 +
 hw/core/vm-change-state-handler.c        |  3 +-
 hw/cpu/a15mpcore.c                       |  2 +
 hw/cpu/a9mpcore.c                        |  2 +
 hw/cpu/arm11mpcore.c                     |  2 +
 hw/cpu/cluster.c                         |  1 +
 hw/cpu/realview_mpcore.c                 |  2 +
 hw/cris/boot.c                           |  2 +-
 hw/display/ads7846.c                     |  2 +
 hw/display/ati.c                         |  2 +-
 hw/display/bcm2835_fb.c                  |  4 ++
 hw/display/bochs-display.c               |  3 +-
 hw/display/cg3.c                         |  3 ++
 hw/display/cirrus_vga.c                  |  4 +-
 hw/display/cirrus_vga_isa.c              |  2 +-
 hw/display/dpcd.c                        |  1 +
 hw/display/edid-region.c                 |  1 +
 hw/display/exynos4210_fimd.c             |  3 ++
 hw/display/framebuffer.c                 |  1 -
 hw/display/g364fb.c                      |  3 ++
 hw/display/i2c-ddc.c                     |  2 +
 hw/display/jazz_led.c                    |  1 +
 hw/display/milkymist-tmu2.c              |  3 +-
 hw/display/milkymist-vgafb.c             |  2 +
 hw/display/omap_dss.c                    |  2 +
 hw/display/omap_lcdc.c                   |  3 +-
 hw/display/pl110.c                       |  2 +
 hw/display/pxa2xx_lcd.c                  |  2 +
 hw/display/qxl-render.c                  |  1 +
 hw/display/qxl.c                         |  5 +-
 hw/display/qxl.h                         |  1 -
 hw/display/ramfb-standalone.c            |  2 +-
 hw/display/ramfb.c                       |  3 +-
 hw/display/sii9022.c                     |  1 +
 hw/display/sm501.c                       |  3 +-
 hw/display/ssd0303.c                     |  1 +
 hw/display/ssd0323.c                     |  1 +
 hw/display/tc6393xb.c                    |  4 +-
 hw/display/tcx.c                         |  2 +
 hw/display/vga-isa-mm.c                  |  4 +-
 hw/display/vga-isa.c                     |  2 +-
 hw/display/vga-pci.c                     |  3 +-
 hw/display/vga.c                         |  4 +-
 hw/display/vhost-user-gpu.c              |  1 +
 hw/display/virtio-gpu-pci.c              |  1 +
 hw/display/virtio-gpu.c                  |  3 ++
 hw/display/virtio-vga.c                  |  2 +-
 hw/display/vmware_vga.c                  |  3 +-
 hw/display/xenfb.c                       |  1 -
 hw/display/xlnx_dp.c                     |  2 +
 hw/dma/bcm2835_dma.c                     |  2 +
 hw/dma/etraxfs_dma.c                     |  5 +-
 hw/dma/i82374.c                          |  2 +
 hw/dma/i8257.c                           |  3 +-
 hw/dma/pl080.c                           |  4 ++
 hw/dma/pl330.c                           |  3 ++
 hw/dma/puv3_dma.c                        |  1 -
 hw/dma/pxa2xx_dma.c                      |  3 ++
 hw/dma/rc4030.c                          |  3 +-
 hw/dma/sparc32_dma.c                     |  4 +-
 hw/dma/xilinx_axidma.c                   |  3 ++
 hw/dma/xlnx-zdma.c                       |  3 ++
 hw/dma/xlnx-zynq-devcfg.c                |  3 +-
 hw/dma/xlnx_dpdma.c                      |  2 +
 hw/gpio/bcm2835_gpio.c                   |  2 +
 hw/gpio/gpio_key.c                       |  2 +
 hw/gpio/imx_gpio.c                       |  3 ++
 hw/gpio/max7310.c                        |  4 ++
 hw/gpio/mpc8xxx.c                        |  2 +
 hw/gpio/nrf51_gpio.c                     |  2 +
 hw/gpio/omap_gpio.c                      |  3 +-
 hw/gpio/pl061.c                          |  2 +
 hw/gpio/puv3_gpio.c                      |  1 -
 hw/gpio/zaurus.c                         |  3 +-
 hw/hppa/dino.c                           |  4 +-
 hw/hppa/hppa_sys.h                       |  1 -
 hw/hppa/machine.c                        |  2 +-
 hw/hppa/pci.c                            |  1 -
 hw/hyperv/hyperv_testdev.c               |  1 -
 hw/i2c/aspeed_i2c.c                      |  2 +
 hw/i2c/bitbang_i2c.c                     |  2 +-
 hw/i2c/core.c                            |  2 +
 hw/i2c/exynos4210_i2c.c                  |  2 +
 hw/i2c/imx_i2c.c                         |  2 +
 hw/i2c/microbit_i2c.c                    |  1 +
 hw/i2c/mpc_i2c.c                         |  2 +
 hw/i2c/omap_i2c.c                        |  3 +-
 hw/i2c/pm_smbus.c                        |  3 +-
 hw/i2c/ppc4xx_i2c.c                      |  2 +-
 hw/i2c/smbus_eeprom.c                    |  3 +-
 hw/i2c/smbus_ich9.c                      |  3 +-
 hw/i2c/smbus_master.c                    |  1 -
 hw/i2c/smbus_slave.c                     |  2 +-
 hw/i386/acpi-build.c                     |  2 +
 hw/i386/amd_iommu.c                      |  2 +
 hw/i386/amd_iommu.h                      |  1 -
 hw/i386/intel_iommu.c                    |  3 ++
 hw/i386/kvm/clock.c                      |  4 +-
 hw/i386/kvm/i8254.c                      |  3 +-
 hw/i386/kvm/i8259.c                      |  1 +
 hw/i386/kvm/ioapic.c                     |  2 +
 hw/i386/kvmvapic.c                       |  2 +
 hw/i386/multiboot.c                      |  1 -
 hw/i386/pc.c                             |  5 +-
 hw/i386/pc_piix.c                        |  3 +-
 hw/i386/pc_q35.c                         |  3 +-
 hw/i386/pc_sysfw.c                       |  3 +-
 hw/i386/vmmouse.c                        |  5 +-
 hw/i386/vmport.c                         |  2 -
 hw/i386/x86-iommu.c                      |  1 +
 hw/i386/xen/xen-hvm.c                    |  5 ++
 hw/i386/xen/xen-mapcache.c               |  1 +
 hw/i386/xen/xen_platform.c               |  2 +-
 hw/i386/xen/xen_pvdevice.c               |  3 +-
 hw/ide/ahci-allwinner.c                  |  2 +-
 hw/ide/ahci.c                            |  4 +-
 hw/ide/ahci_internal.h                   |  1 +
 hw/ide/cmd646.c                          |  5 +-
 hw/ide/core.c                            |  5 +-
 hw/ide/ich.c                             |  2 +-
 hw/ide/ioport.c                          |  2 -
 hw/ide/isa.c                             |  3 +-
 hw/ide/macio.c                           |  3 +-
 hw/ide/microdrive.c                      |  2 +-
 hw/ide/mmio.c                            |  3 +-
 hw/ide/pci.c                             |  2 +-
 hw/ide/piix.c                            |  4 +-
 hw/ide/qdev.c                            |  5 +-
 hw/ide/sii3112.c                         |  1 +
 hw/ide/via.c                             |  4 +-
 hw/input/adb-kbd.c                       |  2 +-
 hw/input/adb-mouse.c                     |  1 +
 hw/input/adb.c                           |  2 +
 hw/input/hid.c                           |  3 +-
 hw/input/lm832x.c                        |  4 +-
 hw/input/milkymist-softusb.c             |  4 +-
 hw/input/pckbd.c                         |  7 ++-
 hw/input/pl050.c                         |  2 +
 hw/input/ps2.c                           |  6 ++-
 hw/input/pxa2xx_keypad.c                 |  2 +
 hw/input/stellaris_input.c               |  4 +-
 hw/input/tsc2005.c                       |  4 +-
 hw/input/tsc210x.c                       |  3 ++
 hw/input/vhost-user-input.c              |  1 -
 hw/input/virtio-input-hid.c              |  2 +-
 hw/input/virtio-input-host.c             |  2 +-
 hw/input/virtio-input.c                  |  2 +-
 hw/intc/allwinner-a10-pic.c              |  3 +-
 hw/intc/apic_common.c                    |  4 +-
 hw/intc/arm_gic.c                        |  1 +
 hw/intc/arm_gic_common.c                 |  2 +
 hw/intc/arm_gicv2m.c                     |  2 +
 hw/intc/arm_gicv3_common.c               |  2 +
 hw/intc/arm_gicv3_cpuif.c                |  1 +
 hw/intc/arm_gicv3_its_common.c           |  1 +
 hw/intc/arm_gicv3_its_kvm.c              |  3 +-
 hw/intc/arm_gicv3_kvm.c                  |  2 +-
 hw/intc/armv7m_nvic.c                    |  3 ++
 hw/intc/aspeed_vic.c                     |  2 +
 hw/intc/bcm2835_ic.c                     |  2 +
 hw/intc/bcm2836_control.c                |  2 +
 hw/intc/etraxfs_pic.c                    |  3 +-
 hw/intc/exynos4210_combiner.c            |  4 ++
 hw/intc/exynos4210_gic.c                 |  2 +
 hw/intc/grlib_irqmp.c                    |  1 +
 hw/intc/heathrow_pic.c                   |  3 +-
 hw/intc/i8259.c                          |  3 +-
 hw/intc/i8259_common.c                   |  3 ++
 hw/intc/imx_avic.c                       |  2 +
 hw/intc/imx_gpcv2.c                      |  1 +
 hw/intc/ioapic.c                         |  3 +-
 hw/intc/ioapic_common.c                  |  1 +
 hw/intc/lm32_pic.c                       |  3 +-
 hw/intc/mips_gic.c                       |  5 +-
 hw/intc/nios2_iic.c                      |  1 +
 hw/intc/omap_intc.c                      |  3 +-
 hw/intc/ompic.c                          |  4 +-
 hw/intc/openpic.c                        |  4 +-
 hw/intc/openpic_kvm.c                    |  2 +-
 hw/intc/pl190.c                          |  2 +
 hw/intc/pnv_xive.c                       |  2 +
 hw/intc/puv3_intc.c                      |  1 +
 hw/intc/realview_gic.c                   |  2 +
 hw/intc/s390_flic.c                      |  3 +-
 hw/intc/sh_intc.c                        |  2 +-
 hw/intc/slavio_intctl.c                  |  2 +
 hw/intc/spapr_xive.c                     |  3 ++
 hw/intc/spapr_xive_kvm.c                 |  1 +
 hw/intc/xics.c                           |  5 +-
 hw/intc/xics_kvm.c                       |  1 -
 hw/intc/xics_pnv.c                       |  1 -
 hw/intc/xics_spapr.c                     |  1 -
 hw/intc/xilinx_intc.c                    |  3 +-
 hw/intc/xive.c                           |  3 ++
 hw/intc/xlnx-pmu-iomod-intc.c            |  3 ++
 hw/intc/xlnx-zynqmp-ipi.c                |  2 +
 hw/ipack/ipack.c                         |  3 ++
 hw/ipack/tpci200.c                       |  2 +
 hw/ipmi/ipmi.c                           |  4 +-
 hw/ipmi/ipmi_bmc_extern.c                |  3 +-
 hw/ipmi/ipmi_bmc_sim.c                   |  2 +
 hw/ipmi/isa_ipmi_bt.c                    |  4 +-
 hw/ipmi/isa_ipmi_kcs.c                   |  4 +-
 hw/isa/apm.c                             |  2 +-
 hw/isa/i82378.c                          |  2 +
 hw/isa/isa-superio.c                     |  1 +
 hw/isa/lpc_ich9.c                        |  6 ++-
 hw/isa/pc87312.c                         |  2 +
 hw/isa/piix4.c                           |  3 +-
 hw/isa/vt82c686.c                        |  5 +-
 hw/lm32/lm32.h                           |  1 +
 hw/lm32/lm32_boards.c                    |  3 +-
 hw/lm32/milkymist-hw.h                   |  2 +-
 hw/lm32/milkymist.c                      |  4 +-
 hw/m68k/an5206.c                         |  1 -
 hw/m68k/mcf5206.c                        |  3 ++
 hw/m68k/mcf5208.c                        |  3 ++
 hw/m68k/mcf_intc.c                       |  1 +
 hw/mem/memory-device.c                   |  1 -
 hw/mem/nvdimm.c                          |  2 +
 hw/mem/pc-dimm.c                         |  4 ++
 hw/microblaze/boot.c                     |  1 +
 hw/microblaze/boot.h                     |  1 -
 hw/microblaze/petalogix_ml605_mmu.c      |  2 +-
 hw/microblaze/petalogix_s3adsp1800_mmu.c |  1 -
 hw/microblaze/xlnx-zynqmp-pmu.c          |  1 -
 hw/mips/addr.c                           |  1 -
 hw/mips/boston.c                         |  3 +-
 hw/mips/cps.c                            |  2 +
 hw/mips/gt64xxx_pci.c                    |  3 +-
 hw/mips/mips_fulong2e.c                  |  2 +-
 hw/mips/mips_int.c                       |  2 +-
 hw/mips/mips_jazz.c                      |  2 +-
 hw/mips/mips_malta.c                     |  4 +-
 hw/mips/mips_mipssim.c                   |  3 +-
 hw/mips/mips_r4k.c                       |  4 +-
 hw/misc/a9scu.c                          |  2 +
 hw/misc/applesmc.c                       |  2 +-
 hw/misc/arm11scu.c                       |  1 +
 hw/misc/arm_integrator_debug.c           |  1 -
 hw/misc/arm_l2x0.c                       |  2 +
 hw/misc/arm_sysctl.c                     |  6 ++-
 hw/misc/armsse-cpuid.c                   |  2 +-
 hw/misc/armsse-mhu.c                     |  3 +-
 hw/misc/aspeed_scu.c                     |  1 +
 hw/misc/aspeed_sdmc.c                    |  1 +
 hw/misc/aspeed_xdma.c                    |  2 +
 hw/misc/bcm2835_mbox.c                   |  2 +
 hw/misc/bcm2835_property.c               |  3 ++
 hw/misc/bcm2835_rng.c                    |  1 +
 hw/misc/cbus.c                           |  2 +-
 hw/misc/debugexit.c                      |  2 +-
 hw/misc/eccmemctl.c                      |  3 ++
 hw/misc/edu.c                            |  1 +
 hw/misc/exynos4210_clk.c                 |  1 +
 hw/misc/exynos4210_pmu.c                 |  3 +-
 hw/misc/exynos4210_rng.c                 |  1 +
 hw/misc/imx25_ccm.c                      |  1 +
 hw/misc/imx31_ccm.c                      |  1 +
 hw/misc/imx6_ccm.c                       |  1 +
 hw/misc/imx6_src.c                       |  3 +-
 hw/misc/imx6ul_ccm.c                     |  1 +
 hw/misc/imx7_ccm.c                       |  1 +
 hw/misc/imx7_gpr.c                       |  1 -
 hw/misc/imx7_snvs.c                      |  2 +-
 hw/misc/iotkit-secctl.c                  |  2 +
 hw/misc/iotkit-sysctl.c                  |  4 +-
 hw/misc/iotkit-sysinfo.c                 |  2 +-
 hw/misc/ivshmem.c                        |  3 +-
 hw/misc/macio/cuda.c                     |  5 +-
 hw/misc/macio/gpio.c                     |  3 +-
 hw/misc/macio/mac_dbdma.c                |  3 +-
 hw/misc/macio/macio.c                    |  4 +-
 hw/misc/macio/pmu.c                      |  6 ++-
 hw/misc/max111x.c                        |  2 +
 hw/misc/milkymist-hpdmc.c                |  2 +-
 hw/misc/milkymist-pfpu.c                 |  3 +-
 hw/misc/mips_cmgcr.c                     |  4 +-
 hw/misc/mips_cpc.c                       |  2 +
 hw/misc/mips_itu.c                       |  1 +
 hw/misc/mos6522.c                        |  5 +-
 hw/misc/mps2-fpgaio.c                    |  2 +
 hw/misc/mps2-scc.c                       |  2 +
 hw/misc/msf2-sysreg.c                    |  2 +
 hw/misc/mst_fpga.c                       |  3 +-
 hw/misc/nrf51_rng.c                      |  3 ++
 hw/misc/omap_clk.c                       |  2 +
 hw/misc/omap_gpmc.c                      |  3 +-
 hw/misc/omap_l4.c                        |  1 -
 hw/misc/omap_sdrc.c                      |  1 -
 hw/misc/pc-testdev.c                     |  3 +-
 hw/misc/pca9552.c                        |  2 +-
 hw/misc/pci-testdev.c                    |  2 +-
 hw/misc/puv3_pm.c                        |  1 -
 hw/misc/pvpanic.c                        |  3 +-
 hw/misc/sga.c                            |  1 -
 hw/misc/slavio_misc.c                    |  4 +-
 hw/misc/tmp105.c                         |  3 +-
 hw/misc/tmp421.c                         |  2 +-
 hw/misc/tz-mpc.c                         |  3 ++
 hw/misc/tz-msc.c                         |  3 ++
 hw/misc/tz-ppc.c                         |  3 ++
 hw/misc/unimp.c                          |  1 -
 hw/misc/vmcoreinfo.c                     |  2 +
 hw/misc/zynq-xadc.c                      |  4 +-
 hw/misc/zynq_slcr.c                      |  4 +-
 hw/moxie/moxiesim.c                      |  3 +-
 hw/net/allwinner_emac.c                  |  3 ++
 hw/net/cadence_gem.c                     |  3 ++
 hw/net/can/can_kvaser_pci.c              |  4 +-
 hw/net/can/can_mioe3680_pci.c            |  4 +-
 hw/net/can/can_pcm3680_pci.c             |  4 +-
 hw/net/can/can_sja1000.c                 |  4 +-
 hw/net/can/can_sja1000.h                 |  1 +
 hw/net/dp8393x.c                         |  3 ++
 hw/net/e1000.c                           |  3 +-
 hw/net/e1000e.c                          |  3 ++
 hw/net/e1000e_core.c                     |  3 +-
 hw/net/e1000x_common.c                   |  1 -
 hw/net/eepro100.c                        |  4 +-
 hw/net/fsl_etsec/etsec.c                 |  4 +-
 hw/net/fsl_etsec/etsec.h                 |  1 -
 hw/net/ftgmac100.c                       |  3 ++
 hw/net/imx_fec.c                         |  3 ++
 hw/net/lan9118.c                         |  6 ++-
 hw/net/lance.c                           |  2 +
 hw/net/mcf_fec.c                         |  2 +
 hw/net/milkymist-minimac2.c              |  4 +-
 hw/net/mipsnet.c                         |  4 +-
 hw/net/ne2000-isa.c                      |  2 +-
 hw/net/ne2000-pci.c                      |  4 ++
 hw/net/ne2000.c                          |  4 +-
 hw/net/ne2000.h                          |  1 -
 hw/net/opencores_eth.c                   |  4 +-
 hw/net/pcnet-pci.c                       |  3 ++
 hw/net/pcnet.c                           |  5 +-
 hw/net/pcnet.h                           |  1 +
 hw/net/rocker/rocker.c                   |  3 +-
 hw/net/rocker/rocker_desc.c              |  1 -
 hw/net/rtl8139.c                         |  3 +-
 hw/net/smc91c111.c                       |  3 ++
 hw/net/spapr_llan.c                      |  5 +-
 hw/net/stellaris_enet.c                  |  3 ++
 hw/net/sungem.c                          |  2 +
 hw/net/sunhme.c                          |  3 +-
 hw/net/vhost_net.c                       |  2 +-
 hw/net/virtio-net.c                      |  3 ++
 hw/net/vmxnet3.c                         |  2 +
 hw/net/xen_nic.c                         |  1 -
 hw/net/xgmac.c                           |  3 ++
 hw/net/xilinx_axienet.c                  |  4 ++
 hw/net/xilinx_ethlite.c                  |  3 +-
 hw/nios2/10m50_devboard.c                |  2 +-
 hw/nios2/boot.c                          |  1 +
 hw/nios2/boot.h                          |  1 -
 hw/nios2/cpu_pic.c                       |  1 +
 hw/nios2/generic_nommu.c                 |  2 -
 hw/nvram/chrp_nvram.c                    |  1 -
 hw/nvram/ds1225y.c                       |  2 +
 hw/nvram/eeprom93xx.c                    |  3 +-
 hw/nvram/eeprom_at24c.c                  |  2 +-
 hw/nvram/fw_cfg.c                        |  5 +-
 hw/nvram/mac_nvram.c                     |  3 +-
 hw/nvram/nrf51_nvm.c                     |  2 +
 hw/nvram/spapr_nvram.c                   |  4 ++
 hw/openrisc/cputimer.c                   |  2 +-
 hw/openrisc/openrisc_sim.c               |  4 +-
 hw/openrisc/pic_cpu.c                    |  2 +-
 hw/pci-bridge/gen_pcie_root_port.c       |  2 +
 hw/pci-bridge/i82801b11.c                |  1 +
 hw/pci-bridge/ioh3420.c                  |  1 +
 hw/pci-bridge/pci_bridge_dev.c           |  1 +
 hw/pci-bridge/pci_expander_bridge.c      |  1 +
 hw/pci-bridge/pcie_pci_bridge.c          |  1 +
 hw/pci-bridge/pcie_root_port.c           |  1 +
 hw/pci-bridge/xio3130_downstream.c       |  2 +
 hw/pci-bridge/xio3130_upstream.c         |  1 +
 hw/pci-host/bonito.c                     |  6 ++-
 hw/pci-host/designware.c                 |  3 ++
 hw/pci-host/gpex.c                       |  4 +-
 hw/pci-host/grackle.c                    |  2 +
 hw/pci-host/pam.c                        |  1 -
 hw/pci-host/piix.c                       |  8 ++-
 hw/pci-host/ppce500.c                    |  4 +-
 hw/pci-host/prep.c                       |  4 +-
 hw/pci-host/q35.c                        |  3 +-
 hw/pci-host/sabre.c                      |  4 +-
 hw/pci-host/uninorth.c                   |  3 +-
 hw/pci-host/versatile.c                  |  3 ++
 hw/pci-host/xilinx-pcie.c                |  2 +
 hw/pci/msix.c                            |  3 +-
 hw/pci/pci.c                             |  6 ++-
 hw/pci/pcie_aer.c                        |  1 +
 hw/pci/pcie_host.c                       |  1 -
 hw/pci/pcie_port.c                       |  1 +
 hw/pci/shpc.c                            |  1 +
 hw/pcmcia/pcmcia.c                       |  1 -
 hw/pcmcia/pxa2xx.c                       |  2 +-
 hw/ppc/e500.c                            |  5 +-
 hw/ppc/e500plat.c                        |  1 -
 hw/ppc/mac.h                             |  1 -
 hw/ppc/mac_newworld.c                    |  3 +-
 hw/ppc/mac_oldworld.c                    |  3 +-
 hw/ppc/mpc8544_guts.c                    |  3 +-
 hw/ppc/mpc8544ds.c                       |  1 -
 hw/ppc/pnv.c                             |  5 +-
 hw/ppc/pnv_bmc.c                         |  2 -
 hw/ppc/pnv_core.c                        |  3 +-
 hw/ppc/pnv_lpc.c                         |  2 +-
 hw/ppc/pnv_occ.c                         |  2 -
 hw/ppc/pnv_psi.c                         |  4 +-
 hw/ppc/pnv_xscom.c                       |  1 -
 hw/ppc/ppc.c                             |  7 ++-
 hw/ppc/ppc405_boards.c                   |  3 +-
 hw/ppc/ppc405_uc.c                       |  5 +-
 hw/ppc/ppc440_bamboo.c                   |  2 +-
 hw/ppc/ppc440_pcix.c                     |  2 +-
 hw/ppc/ppc440_uc.c                       |  5 +-
 hw/ppc/ppc4xx_devs.c                     |  4 +-
 hw/ppc/ppc4xx_pci.c                      |  4 +-
 hw/ppc/ppc_booke.c                       |  5 +-
 hw/ppc/ppce500_spin.c                    |  1 -
 hw/ppc/prep.c                            |  4 +-
 hw/ppc/prep_systemio.c                   |  5 +-
 hw/ppc/rs6000_mc.c                       |  2 +
 hw/ppc/sam460ex.c                        |  3 +-
 hw/ppc/spapr.c                           |  6 ++-
 hw/ppc/spapr_caps.c                      |  1 +
 hw/ppc/spapr_cpu_core.c                  |  5 +-
 hw/ppc/spapr_drc.c                       |  3 +-
 hw/ppc/spapr_events.c                    |  5 +-
 hw/ppc/spapr_hcall.c                     |  3 +-
 hw/ppc/spapr_iommu.c                     |  3 +-
 hw/ppc/spapr_irq.c                       |  2 +
 hw/ppc/spapr_ovec.c                      |  1 +
 hw/ppc/spapr_pci.c                       |  4 +-
 hw/ppc/spapr_rng.c                       |  3 +-
 hw/ppc/spapr_rtas.c                      |  3 +-
 hw/ppc/spapr_rtc.c                       |  1 +
 hw/ppc/spapr_vio.c                       |  5 +-
 hw/ppc/virtex_ml507.c                    |  3 +-
 hw/rdma/vmw/pvrdma_cmd.c                 |  1 -
 hw/rdma/vmw/pvrdma_main.c                |  4 +-
 hw/riscv/boot.c                          |  2 +-
 hw/riscv/riscv_hart.c                    |  2 +
 hw/riscv/sifive_clint.c                  |  1 +
 hw/riscv/sifive_e.c                      |  2 +-
 hw/riscv/sifive_gpio.c                   |  2 +
 hw/riscv/sifive_plic.c                   |  1 +
 hw/riscv/sifive_prci.c                   |  2 +
 hw/riscv/sifive_test.c                   |  2 +
 hw/riscv/sifive_u.c                      |  2 +-
 hw/riscv/sifive_uart.c                   |  2 +
 hw/riscv/spike.c                         |  2 +-
 hw/riscv/virt.c                          |  2 +-
 hw/s390x/3270-ccw.c                      |  2 +
 hw/s390x/ap-device.c                     |  1 -
 hw/s390x/ccw-device.c                    |  1 +
 hw/s390x/css-bridge.c                    |  1 +
 hw/s390x/css.c                           |  2 +-
 hw/s390x/event-facility.c                |  2 +-
 hw/s390x/ipl.c                           |  3 ++
 hw/s390x/ipl.h                           |  2 +-
 hw/s390x/s390-ccw.c                      |  1 +
 hw/s390x/s390-pci-bus.c                  |  1 +
 hw/s390x/s390-skeys.c                    |  1 +
 hw/s390x/s390-stattrib.c                 |  1 -
 hw/s390x/s390-virtio-ccw.c               |  3 ++
 hw/s390x/sclpcpu.c                       |  1 -
 hw/s390x/sclpquiesce.c                   |  4 +-
 hw/s390x/tod-kvm.c                       |  2 +-
 hw/s390x/tod.c                           |  1 +
 hw/s390x/vhost-vsock-ccw.c               |  1 +
 hw/s390x/virtio-ccw-9p.c                 |  1 +
 hw/s390x/virtio-ccw-balloon.c            |  1 +
 hw/s390x/virtio-ccw-blk.c                |  1 +
 hw/s390x/virtio-ccw-crypto.c             |  1 +
 hw/s390x/virtio-ccw-gpu.c                |  1 +
 hw/s390x/virtio-ccw-input.c              |  1 +
 hw/s390x/virtio-ccw-net.c                |  1 +
 hw/s390x/virtio-ccw-rng.c                |  1 +
 hw/s390x/virtio-ccw-scsi.c               |  1 +
 hw/s390x/virtio-ccw-serial.c             |  1 +
 hw/s390x/virtio-ccw.c                    |  3 +-
 hw/scsi/esp-pci.c                        |  2 +
 hw/scsi/esp.c                            |  2 +
 hw/scsi/lsi53c895a.c                     |  3 +-
 hw/scsi/megasas.c                        |  3 +-
 hw/scsi/mptconfig.c                      |  1 -
 hw/scsi/mptendian.c                      |  1 -
 hw/scsi/mptsas.c                         |  5 +-
 hw/scsi/scsi-bus.c                       |  7 ++-
 hw/scsi/scsi-disk.c                      |  5 +-
 hw/scsi/scsi-generic.c                   |  2 +
 hw/scsi/spapr_vscsi.c                    |  4 +-
 hw/scsi/vhost-scsi.c                     |  3 +-
 hw/scsi/vhost-user-scsi.c                |  2 +
 hw/scsi/virtio-scsi.c                    |  2 +
 hw/scsi/vmw_pvscsi.c                     |  3 ++
 hw/sd/bcm2835_sdhost.c                   |  2 +
 hw/sd/milkymist-memcard.c                |  4 +-
 hw/sd/omap_mmc.c                         |  3 +-
 hw/sd/pl181.c                            |  2 +
 hw/sd/pxa2xx_mmci.c                      |  4 +-
 hw/sd/sd.c                               |  4 +-
 hw/sd/sdhci-pci.c                        |  2 +-
 hw/sd/sdhci.c                            |  4 +-
 hw/sd/ssi-sd.c                           |  2 +
 hw/semihosting/config.c                  |  1 +
 hw/sh4/r2d.c                             |  5 +-
 hw/sh4/sh7750.c                          |  3 +-
 hw/sh4/sh7750_regnames.c                 |  1 -
 hw/sh4/sh_pci.c                          |  1 +
 hw/sh4/shix.c                            |  1 -
 hw/smbios/smbios.c                       |  1 -
 hw/sparc/leon3.c                         |  5 +-
 hw/sparc/sun4m.c                         |  6 +++
 hw/sparc/sun4m_iommu.c                   |  3 ++
 hw/sparc64/niagara.c                     |  3 +-
 hw/sparc64/sparc64.c                     |  1 +
 hw/sparc64/sun4u.c                       |  5 +-
 hw/ssi/aspeed_smc.c                      |  4 +-
 hw/ssi/imx_spi.c                         |  3 +-
 hw/ssi/mss-spi.c                         |  2 +
 hw/ssi/omap_spi.c                        |  2 +
 hw/ssi/pl022.c                           |  2 +
 hw/ssi/ssi.c                             |  1 +
 hw/ssi/stm32f2xx_spi.c                   |  1 +
 hw/ssi/xilinx_spi.c                      |  4 +-
 hw/ssi/xilinx_spips.c                    |  4 +-
 hw/timer/a9gtimer.c                      |  4 ++
 hw/timer/allwinner-a10-pit.c             |  5 +-
 hw/timer/altera_timer.c                  |  4 +-
 hw/timer/arm_mptimer.c                   |  4 ++
 hw/timer/arm_timer.c                     |  4 +-
 hw/timer/armv7m_systick.c                |  2 +
 hw/timer/aspeed_rtc.c                    |  1 +
 hw/timer/aspeed_timer.c                  |  2 +
 hw/timer/cadence_ttc.c                   |  2 +
 hw/timer/cmsdk-apb-dualtimer.c           |  3 ++
 hw/timer/cmsdk-apb-timer.c               |  2 +
 hw/timer/digic-timer.c                   |  1 +
 hw/timer/ds1338.c                        |  1 +
 hw/timer/etraxfs_timer.c                 |  5 +-
 hw/timer/exynos4210_mct.c                |  4 ++
 hw/timer/exynos4210_pwm.c                |  2 +
 hw/timer/exynos4210_rtc.c                |  5 +-
 hw/timer/grlib_gptimer.c                 |  2 +
 hw/timer/hpet.c                          |  3 +-
 hw/timer/i8254.c                         |  2 +-
 hw/timer/i8254_common.c                  |  3 +-
 hw/timer/imx_epit.c                      |  2 +
 hw/timer/imx_gpt.c                       |  2 +
 hw/timer/lm32_timer.c                    |  4 +-
 hw/timer/m48t59-isa.c                    |  1 +
 hw/timer/m48t59.c                        |  5 +-
 hw/timer/mc146818rtc.c                   |  6 ++-
 hw/timer/milkymist-sysctl.c              |  7 ++-
 hw/timer/mips_gictimer.c                 |  1 -
 hw/timer/mss-timer.c                     |  3 ++
 hw/timer/nrf51_timer.c                   |  2 +
 hw/timer/omap_gptimer.c                  |  3 +-
 hw/timer/omap_synctimer.c                |  1 -
 hw/timer/pl031.c                         |  3 ++
 hw/timer/puv3_ost.c                      |  1 +
 hw/timer/pxa2xx_timer.c                  |  6 ++-
 hw/timer/sh_timer.c                      |  1 +
 hw/timer/slavio_timer.c                  |  3 ++
 hw/timer/stm32f2xx_timer.c               |  3 ++
 hw/timer/sun4v-rtc.c                     |  1 -
 hw/timer/twl92230.c                      |  4 +-
 hw/timer/xilinx_timer.c                  |  2 +
 hw/timer/xlnx-zynqmp-rtc.c               |  2 +
 hw/tpm/tpm_crb.c                         |  2 -
 hw/tpm/tpm_emulator.c                    |  2 +-
 hw/tpm/tpm_passthrough.c                 |  1 -
 hw/tpm/tpm_ppi.c                         |  1 -
 hw/tpm/tpm_tis.c                         |  3 ++
 hw/tpm/tpm_util.c                        |  2 +-
 hw/tpm/trace-events                      |  4 +-
 hw/tricore/tricore_testboard.c           |  2 -
 hw/unicore32/puv3.c                      |  1 +
 hw/usb/bus.c                             |  4 +-
 hw/usb/ccid-card-emulated.c              |  1 +
 hw/usb/ccid-card-passthru.c              |  2 +
 hw/usb/ccid.h                            |  2 +-
 hw/usb/dev-audio.c                       |  3 +-
 hw/usb/dev-bluetooth.c                   |  1 +
 hw/usb/dev-hid.c                         |  3 +-
 hw/usb/dev-hub.c                         |  2 +
 hw/usb/dev-mtp.c                         |  2 +
 hw/usb/dev-network.c                     |  2 +
 hw/usb/dev-serial.c                      |  2 +
 hw/usb/dev-smartcard-reader.c            |  2 +
 hw/usb/dev-storage.c                     |  2 +
 hw/usb/dev-uas.c                         |  3 ++
 hw/usb/dev-wacom.c                       |  2 +-
 hw/usb/hcd-ehci-pci.c                    |  2 +
 hw/usb/hcd-ehci-sysbus.c                 |  2 +
 hw/usb/hcd-ehci.c                        |  4 ++
 hw/usb/hcd-ehci.h                        |  2 -
 hw/usb/hcd-ohci-pci.c                    |  3 +-
 hw/usb/hcd-ohci.c                        |  4 +-
 hw/usb/hcd-uhci.c                        |  3 +-
 hw/usb/hcd-xhci-nec.c                    |  2 +-
 hw/usb/hcd-xhci.c                        |  3 +-
 hw/usb/host-libusb.c                     |  4 ++
 hw/usb/libhw.c                           |  1 -
 hw/usb/redirect.c                        |  4 ++
 hw/usb/tusb6010.c                        |  1 +
 hw/usb/xen-usb.c                         |  1 +
 hw/vfio/amd-xgbe.c                       |  1 +
 hw/vfio/ap.c                             |  4 +-
 hw/vfio/calxeda-xgmac.c                  |  1 +
 hw/vfio/ccw.c                            |  2 +
 hw/vfio/common.c                         |  2 +
 hw/vfio/pci-quirks.c                     |  2 +
 hw/vfio/pci.c                            |  5 ++
 hw/vfio/platform.c                       |  5 +-
 hw/virtio/vhost-backend.c                |  1 +
 hw/virtio/vhost-scsi-pci.c               |  1 +
 hw/virtio/vhost-user-blk-pci.c           |  1 +
 hw/virtio/vhost-user-scsi-pci.c          |  1 +
 hw/virtio/vhost-user.c                   |  1 +
 hw/virtio/vhost-vsock-pci.c              |  1 +
 hw/virtio/vhost-vsock.c                  |  1 +
 hw/virtio/vhost.c                        |  2 +-
 hw/virtio/virtio-9p-pci.c                |  1 +
 hw/virtio/virtio-balloon-pci.c           |  1 +
 hw/virtio/virtio-balloon.c               |  1 +
 hw/virtio/virtio-blk-pci.c               |  1 +
 hw/virtio/virtio-bus.c                   |  2 -
 hw/virtio/virtio-crypto-pci.c            |  1 +
 hw/virtio/virtio-crypto.c                |  3 +-
 hw/virtio/virtio-input-pci.c             |  1 +
 hw/virtio/virtio-mmio.c                  |  3 ++
 hw/virtio/virtio-net-pci.c               |  1 +
 hw/virtio/virtio-pci.c                   |  2 +
 hw/virtio/virtio-pmem.c                  |  3 ++
 hw/virtio/virtio-rng.c                   |  4 +-
 hw/virtio/virtio-scsi-pci.c              |  1 +
 hw/virtio/virtio-serial-pci.c            |  1 +
 hw/virtio/virtio.c                       |  4 ++
 hw/watchdog/cmsdk-apb-watchdog.c         |  3 ++
 hw/watchdog/watchdog.c                   |  2 +-
 hw/watchdog/wdt_aspeed.c                 |  2 +
 hw/watchdog/wdt_diag288.c                |  2 +
 hw/watchdog/wdt_i6300esb.c               |  2 +-
 hw/watchdog/wdt_ib700.c                  |  2 +-
 hw/xen/xen-bus-helper.c                  |  1 -
 hw/xen/xen-bus.c                         |  2 +-
 hw/xen/xen-common.c                      |  1 +
 hw/xen/xen-legacy-backend.c              |  3 +-
 hw/xen/xen_devconfig.c                   |  1 +
 hw/xen/xen_pt.c                          |  1 +
 hw/xen/xen_pt_load_rom.c                 |  2 -
 hw/xen/xen_pvdev.c                       |  1 +
 hw/xenpv/xen_machine_pv.c                |  2 +-
 hw/xtensa/mx_pic.c                       |  2 +-
 hw/xtensa/pic_cpu.c                      |  2 +-
 hw/xtensa/sim.c                          |  1 +
 hw/xtensa/xtensa_memory.c                |  2 -
 hw/xtensa/xtensa_memory.h                |  1 -
 hw/xtensa/xtfpga.c                       |  4 ++
 include/authz/listfile.h                 |  1 -
 include/block/block.h                    |  1 -
 include/block/block_int.h                |  1 -
 include/block/raw-aio.h                  |  1 +
 include/block/write-threshold.h          |  1 +
 include/chardev/char-fe.h                |  1 +
 include/chardev/char-io.h                |  1 +
 include/chardev/char.h                   |  2 +-
 include/disas/disas.h                    |  1 +
 include/exec/cpu-defs.h                  |  1 -
 include/exec/cputlb.h                    |  2 +
 include/exec/exec-all.h                  |  1 +
 include/exec/ioport.h                    |  2 +
 include/exec/memory-internal.h           |  2 +
 include/exec/memory.h                    |  9 +++-
 include/exec/ram_addr.h                  |  1 +
 include/exec/softmmu-semi.h              |  2 +
 include/exec/tb-hash.h                   |  2 +
 include/exec/user/thunk.h                |  1 +
 include/fpu/softfloat-macros.h           |  2 +
 include/hw/acpi/acpi.h                   |  1 -
 include/hw/acpi/acpi_dev_interface.h     |  2 +
 include/hw/acpi/pci.h                    |  2 +
 include/hw/acpi/tco.h                    |  1 +
 include/hw/acpi/vmgenid.h                |  2 +-
 include/hw/adc/stm32f2xx_adc.h           |  2 +
 include/hw/arm/allwinner-a10.h           |  3 +-
 include/hw/arm/aspeed_soc.h              |  1 +
 include/hw/arm/bcm2836.h                 |  1 +
 include/hw/arm/boot.h                    |  2 -
 include/hw/arm/exynos4210.h              |  2 +-
 include/hw/arm/fsl-imx25.h               |  1 +
 include/hw/arm/fsl-imx31.h               |  1 +
 include/hw/arm/fsl-imx7.h                |  1 -
 include/hw/arm/omap.h                    |  1 -
 include/hw/arm/sharpsl.h                 |  2 +
 include/hw/arm/soc_dma.h                 |  3 +-
 include/hw/arm/xlnx-zynqmp.h             |  2 +-
 include/hw/audio/pcspk.h                 |  2 +-
 include/hw/audio/wm8750.h                |  1 -
 include/hw/block/fdc.h                   |  1 +
 include/hw/block/flash.h                 |  2 +-
 include/hw/boards.h                      |  4 +-
 include/hw/bt.h                          |  1 -
 include/hw/char/cadence_uart.h           |  1 +
 include/hw/char/cmsdk-apb-uart.h         |  1 +
 include/hw/char/escc.h                   |  1 +
 include/hw/char/lm32_juart.h             |  2 +-
 include/hw/char/parallel.h               |  1 -
 include/hw/char/pl011.h                  |  1 +
 include/hw/char/serial.h                 |  2 -
 include/hw/char/stm32f2xx_usart.h        |  1 -
 include/hw/char/xilinx_uartlite.h        |  3 ++
 include/hw/core/generic-loader.h         |  1 +
 include/hw/core/split-irq.h              |  1 -
 include/hw/cpu/cluster.h                 |  2 +-
 include/hw/cpu/core.h                    |  2 +-
 include/hw/cris/etraxfs.h                |  2 +
 include/hw/cris/etraxfs_dma.h            |  2 +
 include/hw/display/blizzard.h            |  1 -
 include/hw/display/edid.h                |  2 +-
 include/hw/display/i2c-ddc.h             |  1 +
 include/hw/display/milkymist_tmu2.h      |  3 +-
 include/hw/display/tc6393xb.h            |  3 --
 include/hw/display/vga.h                 |  2 +-
 include/hw/dma/i8257.h                   |  1 -
 include/hw/empty_slot.h                  |  2 +
 include/hw/gpio/bcm2835_gpio.h           |  1 +
 include/hw/hw.h                          |  9 ----
 include/hw/i2c/aspeed_i2c.h              |  1 +
 include/hw/i2c/i2c.h                     |  2 +-
 include/hw/i2c/pm_smbus.h                |  1 +
 include/hw/i2c/smbus_eeprom.h            |  1 +
 include/hw/i386/apic_internal.h          |  1 +
 include/hw/i386/ich9.h                   |  1 -
 include/hw/i386/intel_iommu.h            |  2 +-
 include/hw/i386/ioapic_internal.h        |  2 +-
 include/hw/i386/pc.h                     |  1 -
 include/hw/ide/internal.h                |  4 +-
 include/hw/input/adb.h                   |  2 +-
 include/hw/input/gamepad.h               |  1 -
 include/hw/input/hid.h                   |  1 -
 include/hw/input/i8042.h                 |  1 -
 include/hw/input/tsc2xxx.h               |  1 -
 include/hw/intc/allwinner-a10-pic.h      |  2 +
 include/hw/intc/heathrow_pic.h           |  2 +
 include/hw/intc/mips_gic.h               |  1 +
 include/hw/ipack/ipack.h                 |  2 +-
 include/hw/ipmi/ipmi.h                   |  2 +-
 include/hw/irq.h                         |  4 --
 include/hw/isa/apm.h                     |  1 -
 include/hw/isa/i8259_internal.h          |  1 -
 include/hw/isa/isa.h                     |  2 +-
 include/hw/isa/vt82c686.h                |  1 +
 include/hw/mem/memory-device.h           |  3 +-
 include/hw/mem/pc-dimm.h                 |  4 +-
 include/hw/mips/cps.h                    |  1 +
 include/hw/mips/mips.h                   |  1 -
 include/hw/misc/auxbus.h                 |  3 +-
 include/hw/misc/cbus.h                   |  1 -
 include/hw/misc/macio/cuda.h             |  2 +
 include/hw/misc/macio/gpio.h             |  3 ++
 include/hw/misc/macio/macio.h            |  2 +
 include/hw/misc/macio/pmu.h              |  3 ++
 include/hw/misc/mips_cmgcr.h             |  2 +
 include/hw/misc/mips_cpc.h               |  2 +
 include/hw/misc/mos6522.h                |  1 -
 include/hw/misc/pvpanic.h                |  2 +
 include/hw/misc/stm32f2xx_syscfg.h       |  1 -
 include/hw/misc/unimp.h                  |  1 +
 include/hw/misc/vmcoreinfo.h             |  2 +-
 include/hw/net/allwinner_emac.h          |  1 +
 include/hw/net/lan9118.h                 |  1 -
 include/hw/net/lance.h                   |  1 +
 include/hw/net/ne2000-isa.h              |  3 +-
 include/hw/net/smc91c111.h               |  1 -
 include/hw/nvram/chrp_nvram.h            |  2 +
 include/hw/or-irq.h                      |  1 -
 include/hw/pci-host/designware.h         |  1 -
 include/hw/pci-host/gpex.h               |  1 -
 include/hw/pci-host/q35.h                |  1 -
 include/hw/pci-host/sabre.h              |  2 +
 include/hw/pci-host/uninorth.h           |  3 +-
 include/hw/pci-host/xilinx-pcie.h        |  1 -
 include/hw/pci/pci.h                     |  1 -
 include/hw/pci/pcie.h                    |  1 -
 include/hw/pci/pcie_aer.h                |  2 +-
 include/hw/pci/shpc.h                    |  1 +
 include/hw/pcmcia.h                      |  2 +-
 include/hw/ppc/openpic.h                 |  1 -
 include/hw/ppc/pnv_core.h                |  1 +
 include/hw/ppc/ppc4xx.h                  |  3 ++
 include/hw/ppc/spapr_cpu_core.h          |  2 +-
 include/hw/ppc/spapr_drc.h               |  5 +-
 include/hw/ppc/spapr_irq.h               |  2 +
 include/hw/ppc/spapr_ovec.h              |  1 -
 include/hw/ppc/spapr_vio.h               |  1 +
 include/hw/ppc/spapr_xive.h              |  1 +
 include/hw/ppc/xics.h                    |  3 +-
 include/hw/ppc/xive.h                    |  1 -
 include/hw/ppc/xive_regs.h               |  3 ++
 include/hw/ptimer.h                      |  1 -
 include/hw/qdev-core.h                   | 12 +----
 include/hw/qdev-properties.h             |  2 -
 include/hw/qdev.h                        |  8 ---
 include/hw/riscv/boot.h                  |  2 +
 include/hw/riscv/riscv_hart.h            |  3 ++
 include/hw/riscv/riscv_htif.h            |  2 -
 include/hw/riscv/sifive_clint.h          |  2 +
 include/hw/riscv/sifive_e.h              |  1 +
 include/hw/riscv/sifive_plic.h           |  2 +-
 include/hw/riscv/sifive_prci.h           |  2 +
 include/hw/riscv/sifive_test.h           |  2 +
 include/hw/riscv/sifive_u.h              |  1 +
 include/hw/riscv/sifive_uart.h           |  3 ++
 include/hw/riscv/spike.h                 |  3 ++
 include/hw/riscv/virt.h                  |  3 ++
 include/hw/s390x/ap-device.h             |  2 +
 include/hw/s390x/css-bridge.h            |  3 +-
 include/hw/s390x/css.h                   |  1 +
 include/hw/s390x/event-facility.h        |  2 +-
 include/hw/s390x/sclp.h                  |  1 -
 include/hw/s390x/storage-attributes.h    |  2 +-
 include/hw/s390x/storage-keys.h          |  2 +-
 include/hw/s390x/tod.h                   |  4 +-
 include/hw/scsi/scsi.h                   |  4 +-
 include/hw/sd/sd.h                       |  2 +-
 include/hw/semihosting/console.h         |  2 +
 include/hw/sh4/sh_intc.h                 |  2 +-
 include/hw/sparc/grlib.h                 |  1 -
 include/hw/sparc/sparc64.h               |  2 +
 include/hw/ssi/aspeed_smc.h              |  1 +
 include/hw/ssi/ssi.h                     |  2 +-
 include/hw/ssi/stm32f2xx_spi.h           |  1 -
 include/hw/ssi/xilinx_spips.h            |  1 +
 include/hw/sysbus.h                      |  2 +-
 include/hw/timer/allwinner-a10-pit.h     |  1 +
 include/hw/timer/aspeed_rtc.h            |  1 -
 include/hw/timer/cmsdk-apb-timer.h       |  1 +
 include/hw/timer/i8254.h                 |  3 +-
 include/hw/timer/i8254_internal.h        |  2 +-
 include/hw/timer/m48t59.h                |  1 +
 include/hw/timer/mc146818rtc_regs.h      |  2 +
 include/hw/timer/stm32f2xx_timer.h       |  1 -
 include/hw/timer/xlnx-zynqmp-rtc.h       |  1 +
 include/hw/tricore/tricore.h             |  1 -
 include/hw/usb.h                         |  3 +-
 include/hw/vfio/vfio-platform.h          |  1 -
 include/hw/virtio/vhost-scsi-common.h    |  1 -
 include/hw/virtio/vhost-scsi.h           |  1 -
 include/hw/virtio/vhost-user-blk.h       |  1 -
 include/hw/virtio/vhost-user-scsi.h      |  1 -
 include/hw/virtio/vhost.h                |  1 -
 include/hw/virtio/virtio-access.h        |  1 +
 include/hw/virtio/virtio-bus.h           |  3 +-
 include/hw/virtio/virtio-gpu-bswap.h     |  1 +
 include/hw/virtio/virtio-pmem.h          |  2 +-
 include/hw/virtio/virtio-rng.h           |  1 +
 include/hw/virtio/virtio-serial.h        |  1 -
 include/hw/virtio/virtio.h               |  6 +--
 include/hw/watchdog/wdt_aspeed.h         |  1 +
 include/hw/watchdog/wdt_diag288.h        |  2 +-
 include/hw/xen/xen-legacy-backend.h      |  1 -
 include/hw/xen/xen.h                     |  1 -
 include/hw/xen/xen_common.h              |  2 -
 include/hw/xtensa/mx_pic.h               |  1 -
 include/libdecnumber/decNumberLocal.h    |  1 +
 include/migration/cpu.h                  |  3 ++
 include/migration/global_state.h         |  1 -
 include/migration/misc.h                 |  1 -
 include/migration/vmstate.h              |  1 -
 include/monitor/hmp-target.h             |  2 +
 include/monitor/qdev.h                   |  2 -
 include/net/can_emu.h                    |  1 +
 include/net/filter.h                     |  1 +
 include/net/net.h                        |  1 -
 include/qapi/error.h                     |  2 +-
 include/qemu/atomic128.h                 |  2 +
 include/qemu/fifo8.h                     |  1 -
 include/qemu/job.h                       |  2 +-
 include/qemu/queue.h                     |  2 -
 include/qemu/range.h                     |  2 -
 include/qemu/ratelimit.h                 |  2 +
 include/qemu/thread-win32.h              |  2 +-
 include/qemu/typedefs.h                  | 24 +++++++--
 include/qom/cpu.h                        |  4 +-
 include/qom/object.h                     |  1 -
 include/sysemu/accel.h                   |  1 -
 include/sysemu/arch_init.h               |  1 -
 include/sysemu/balloon.h                 |  1 +
 include/sysemu/cryptodev-vhost-user.h    |  2 +
 include/sysemu/cryptodev.h               |  1 +
 include/sysemu/dma.h                     |  1 -
 include/sysemu/hax.h                     |  1 -
 include/sysemu/hostmem.h                 |  3 +-
 include/sysemu/hvf.h                     |  2 +-
 include/sysemu/iothread.h                |  1 +
 include/sysemu/kvm.h                     |  1 -
 include/sysemu/kvm_int.h                 |  2 +-
 include/sysemu/memory_mapping.h          |  1 +
 include/sysemu/numa.h                    | 18 +++++--
 include/sysemu/replay.h                  |  2 +-
 include/sysemu/rng.h                     |  1 +
 include/sysemu/runstate.h                | 68 ++++++++++++++++++++++++
 include/sysemu/sysemu.h                  | 68 ------------------------
 include/sysemu/xen-mapcache.h            |  2 +
 include/ui/egl-helpers.h                 |  2 +
 include/ui/input.h                       |  1 +
 include/ui/spice-display.h               |  2 +-
 linux-user/elfload.c                     |  1 +
 linux-user/main.c                        |  1 +
 linux-user/qemu.h                        |  1 -
 linux-user/syscall.c                     |  1 +
 memory.c                                 |  5 +-
 migration/block-dirty-bitmap.c           |  2 +-
 migration/block.c                        |  1 +
 migration/colo.c                         |  3 ++
 migration/global_state.c                 |  1 +
 migration/migration.c                    |  4 ++
 migration/migration.h                    |  4 +-
 migration/postcopy-ram.c                 |  1 +
 migration/qemu-file-channel.c            |  1 -
 migration/qemu-file.h                    |  1 +
 migration/rdma.c                         |  1 +
 migration/savevm.c                       |  4 ++
 migration/vmstate-types.c                |  1 -
 monitor/hmp-cmds.c                       |  2 +-
 monitor/hmp.c                            |  2 +-
 monitor/misc.c                           |  2 +-
 monitor/monitor-internal.h               |  1 -
 monitor/monitor.c                        |  1 +
 monitor/qmp-cmds.c                       |  2 +-
 nbd/client.c                             |  1 +
 nbd/nbd-internal.h                       |  2 -
 nbd/server.c                             |  1 +
 net/can/can_socketcan.c                  |  1 +
 net/net.c                                |  4 +-
 net/netmap.c                             |  1 -
 net/tap-bsd.c                            |  1 -
 net/tap-linux.c                          |  1 -
 net/tap-solaris.c                        |  1 -
 net/tap-win32.c                          |  2 +-
 net/tap.c                                |  1 +
 os-posix.c                               |  2 +-
 os-win32.c                               |  2 +-
 qapi/Makefile.objs                       |  2 +-
 qapi/common.json                         | 24 ---------
 qapi/error.json                          | 29 ++++++++++
 qapi/qapi-dealloc-visitor.c              |  1 -
 qapi/qapi-schema.json                    |  1 +
 qapi/qmp-dispatch.c                      |  2 +-
 qdev-monitor.c                           |  2 +-
 qemu-img.c                               |  2 +-
 qom/cpu.c                                |  3 +-
 qom/object.c                             |  1 +
 qom/qom-qmp-cmds.c                       |  2 +-
 qtest.c                                  |  3 +-
 replay/replay-audio.c                    |  1 -
 replay/replay-char.c                     |  1 -
 replay/replay-internal.c                 |  3 +-
 replay/replay-net.c                      |  1 -
 replay/replay-snapshot.c                 |  1 -
 replay/replay.c                          |  2 +-
 scripts/tracetool/format/c.py            |  1 +
 scripts/tracetool/format/h.py            |  7 ++-
 scripts/tracetool/format/log_stap.py     |  3 --
 stubs/change-state-handler.c             |  2 +-
 stubs/replay.c                           |  1 -
 stubs/runstate-check.c                   |  2 +-
 stubs/semihost.c                         |  1 +
 stubs/vm-stop.c                          |  2 +-
 target/alpha/cpu.h                       |  2 +-
 target/alpha/machine.c                   |  3 +-
 target/alpha/sys_helper.c                |  1 +
 target/arm/cpu.h                         |  2 +-
 target/arm/cpu64.c                       |  1 -
 target/arm/helper-a64.c                  |  2 +-
 target/arm/helper.c                      |  4 +-
 target/arm/kvm.c                         |  2 +
 target/arm/kvm32.c                       |  1 -
 target/arm/kvm64.c                       |  2 +-
 target/arm/m_helper.c                    |  3 +-
 target/arm/machine.c                     |  3 +-
 target/arm/monitor.c                     |  1 -
 target/arm/psci.c                        |  4 +-
 target/cris/cpu.h                        |  2 +-
 target/cris/machine.c                    |  2 +-
 target/hppa/cpu.h                        |  4 +-
 target/hppa/machine.c                    |  3 +-
 target/hppa/op_helper.c                  |  2 +-
 target/i386/cpu.c                        |  2 +-
 target/i386/cpu.h                        |  2 +-
 target/i386/excp_helper.c                |  2 +-
 target/i386/hax-all.c                    |  4 +-
 target/i386/helper.c                     |  2 +-
 target/i386/hvf/hvf.c                    |  4 +-
 target/i386/hvf/x86_task.c               |  2 -
 target/i386/kvm.c                        |  3 ++
 target/i386/machine.c                    |  3 +-
 target/i386/monitor.c                    |  1 +
 target/i386/sev.c                        |  1 +
 target/i386/sev_i386.h                   |  2 +-
 target/i386/whpx-all.c                   |  4 +-
 target/lm32/cpu.h                        |  2 +-
 target/lm32/helper.c                     |  1 -
 target/lm32/machine.c                    |  3 +-
 target/lm32/op_helper.c                  |  3 +-
 target/m68k/m68k-semi.c                  |  1 -
 target/mips/cp0_timer.c                  |  1 +
 target/mips/internal.h                   |  2 +-
 target/mips/kvm.c                        |  3 +-
 target/mips/machine.c                    |  2 +-
 target/moxie/machine.c                   |  3 +-
 target/nios2/nios2-semi.c                |  1 -
 target/openrisc/cpu.h                    |  2 +-
 target/openrisc/machine.c                |  3 +-
 target/ppc/cpu-qom.h                     |  2 +-
 target/ppc/cpu.h                         |  2 +-
 target/ppc/int_helper.c                  |  2 +
 target/ppc/kvm.c                         |  4 +-
 target/ppc/machine.c                     |  4 +-
 target/ppc/mem_helper.c                  |  2 +
 target/ppc/misc_helper.c                 |  2 +
 target/ppc/mmu_helper.c                  |  2 +
 target/ppc/translate.c                   |  1 +
 target/s390x/cpu.c                       |  2 +-
 target/s390x/cpu.h                       |  2 +-
 target/s390x/helper.c                    |  2 +-
 target/s390x/kvm.c                       |  3 +-
 target/s390x/machine.c                   |  2 +-
 target/s390x/mmu_helper.c                |  1 +
 target/s390x/sigp.c                      |  2 +-
 target/sh4/helper.c                      |  3 +-
 target/sparc/cpu.h                       |  2 +-
 target/sparc/helper.c                    |  1 -
 target/sparc/int32_helper.c              |  2 +-
 target/sparc/machine.c                   |  3 +-
 target/tilegx/cpu.c                      |  1 -
 target/xtensa/translate.c                |  1 -
 target/xtensa/xtensa-semi.c              |  1 -
 tcg/optimize.c                           |  1 -
 tcg/tcg-common.c                         |  1 -
 tcg/tcg-op-gvec.c                        |  1 +
 tcg/tcg.c                                |  1 -
 tests/migration-test.c                   |  1 -
 tests/test-bdrv-drain.c                  |  1 +
 tests/test-bdrv-graph-mod.c              |  1 +
 tests/test-block-backend.c               |  1 +
 tests/test-block-iothread.c              |  1 +
 tests/test-image-locking.c               |  1 +
 tests/test-qdev-global-props.c           |  2 +-
 tests/test-replication.c                 |  1 +
 tests/test-throttle.c                    |  1 +
 trace/control-internal.h                 | 25 ---------
 trace/control-vcpu.h                     | 63 ++++++++++++++++++++++
 trace/control.h                          | 24 ---------
 trace/qmp.c                              |  2 +-
 ui/cocoa.m                               |  1 -
 ui/gtk.c                                 |  1 +
 ui/input-keymap.c                        |  1 -
 ui/input-legacy.c                        |  1 -
 ui/input-linux.c                         |  2 +-
 ui/input.c                               |  1 +
 ui/kbd-state.c                           |  1 -
 ui/keymaps.c                             |  1 -
 ui/sdl2-2d.c                             |  1 -
 ui/sdl2-gl.c                             |  1 -
 ui/sdl2-input.c                          |  1 -
 ui/sdl2.c                                |  1 +
 ui/spice-core.c                          |  4 +-
 ui/spice-display.c                       |  2 +-
 ui/vnc-auth-sasl.h                       |  1 -
 ui/vnc.c                                 |  2 +
 ui/vnc.h                                 |  1 -
 util/fifo8.c                             |  1 +
 util/oslib-posix.c                       |  1 +
 util/qemu-timer.c                        |  1 -
 util/vfio-helpers.c                      |  1 -
 vl.c                                     | 11 ++--
 1277 files changed, 2164 insertions(+), 1027 deletions(-)
 delete mode 100644 include/hw/qdev.h
 create mode 100644 include/sysemu/runstate.h
 create mode 100644 qapi/error.json
 create mode 100644 trace/control-vcpu.h
Signature · 1 line
2.21.0
#1 lore raw

PATCH v2 1/29 include: Make headers more self-contained

Back in 2016, we discussed[1] rules for headers, and these were generally liked:

1. Have a carefully curated header that's included everywhere first. We got that already thanks to Peter: osdep.h.

2. Headers should normally include everything they need beyond osdep.h. If exceptions are needed for some reason, they must be documented in the header. If all that's needed from a header is typedefs, put those into qemu/typedefs.h instead of including the header.

3. Cyclic inclusion is forbidden.

This patch gets include/ closer to obeying 2.

It's actually extracted from my "[RFC] Baby steps towards saner headers" series[2], which demonstrates a possible path towards checking 2 automatically. It passes the RFC test there.

[1] Message-ID: <[email protected]>

    https://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg03345.html
[2] Message-Id: <[email protected]>
    https://lists.nongnu.org/archive/html/qemu-devel/2019-07/msg02715.html
---
 include/block/raw-aio.h               | 1 +
 include/block/write-threshold.h       | 1 +
 include/disas/disas.h                 | 1 +
 include/exec/cputlb.h                 | 2 ++
 include/exec/exec-all.h               | 1 +
 include/exec/ioport.h                 | 2 ++
 include/exec/memory-internal.h        | 2 ++
 include/exec/ram_addr.h               | 1 +
 include/exec/softmmu-semi.h           | 2 ++
 include/exec/tb-hash.h                | 2 ++
 include/exec/user/thunk.h             | 1 +
 include/fpu/softfloat-macros.h        | 2 ++
 include/hw/acpi/pci.h                 | 2 ++
 include/hw/acpi/tco.h                 | 2 ++
 include/hw/adc/stm32f2xx_adc.h        | 2 ++
 include/hw/arm/allwinner-a10.h        | 1 +
 include/hw/arm/aspeed_soc.h           | 1 +
 include/hw/arm/bcm2836.h              | 1 +
 include/hw/arm/exynos4210.h           | 2 +-
 include/hw/arm/fsl-imx25.h            | 1 +
 include/hw/arm/fsl-imx31.h            | 1 +
 include/hw/arm/sharpsl.h              | 2 ++
 include/hw/arm/xlnx-zynqmp.h          | 1 +
 include/hw/block/fdc.h                | 2 ++
 include/hw/block/flash.h              | 1 +
 include/hw/char/escc.h                | 1 +
 include/hw/char/xilinx_uartlite.h     | 2 ++
 include/hw/core/generic-loader.h      | 1 +
 include/hw/cris/etraxfs.h             | 1 +
 include/hw/cris/etraxfs_dma.h         | 3 +++
 include/hw/display/i2c-ddc.h          | 1 +
 include/hw/empty_slot.h               | 2 ++
 include/hw/gpio/bcm2835_gpio.h        | 1 +
 include/hw/i2c/aspeed_i2c.h           | 1 +
 include/hw/i386/apic_internal.h       | 1 +
 include/hw/i386/ioapic_internal.h     | 1 +
 include/hw/intc/allwinner-a10-pic.h   | 2 ++
 include/hw/intc/heathrow_pic.h        | 2 ++
 include/hw/intc/mips_gic.h            | 1 +
 include/hw/isa/vt82c686.h             | 2 ++
 include/hw/mips/cps.h                 | 1 +
 include/hw/misc/macio/cuda.h          | 2 ++
 include/hw/misc/macio/gpio.h          | 3 +++
 include/hw/misc/macio/macio.h         | 2 ++
 include/hw/misc/macio/pmu.h           | 3 +++
 include/hw/misc/mips_cmgcr.h          | 2 ++
 include/hw/misc/mips_cpc.h            | 2 ++
 include/hw/misc/pvpanic.h             | 2 ++
 include/hw/net/allwinner_emac.h       | 1 +
 include/hw/net/lance.h                | 1 +
 include/hw/nvram/chrp_nvram.h         | 2 ++
 include/hw/pci-host/sabre.h           | 2 ++
 include/hw/pci-host/uninorth.h        | 2 +-
 include/hw/pci/pcie_aer.h             | 1 +
 include/hw/ppc/pnv_core.h             | 1 +
 include/hw/ppc/ppc4xx.h               | 4 ++++
 include/hw/ppc/spapr_irq.h            | 3 +++
 include/hw/ppc/spapr_vio.h            | 1 +
 include/hw/ppc/spapr_xive.h           | 2 ++
 include/hw/ppc/xive_regs.h            | 3 +++
 include/hw/riscv/boot.h               | 2 ++
 include/hw/riscv/riscv_hart.h         | 3 +++
 include/hw/riscv/sifive_clint.h       | 2 ++
 include/hw/riscv/sifive_e.h           | 1 +
 include/hw/riscv/sifive_plic.h        | 2 +-
 include/hw/riscv/sifive_prci.h        | 2 ++
 include/hw/riscv/sifive_test.h        | 2 ++
 include/hw/riscv/sifive_u.h           | 1 +
 include/hw/riscv/sifive_uart.h        | 3 +++
 include/hw/riscv/spike.h              | 3 +++
 include/hw/riscv/virt.h               | 3 +++
 include/hw/s390x/ap-device.h          | 2 ++
 include/hw/s390x/css-bridge.h         | 3 ++-
 include/hw/s390x/css.h                | 1 +
 include/hw/s390x/tod.h                | 2 +-
 include/hw/semihosting/console.h      | 2 ++
 include/hw/sh4/sh_intc.h              | 1 +
 include/hw/sparc/sparc64.h            | 2 ++
 include/hw/ssi/aspeed_smc.h           | 1 +
 include/hw/ssi/xilinx_spips.h         | 1 +
 include/hw/timer/allwinner-a10-pit.h  | 1 +
 include/hw/timer/i8254_internal.h     | 1 +
 include/hw/timer/m48t59.h             | 2 ++
 include/hw/timer/mc146818rtc_regs.h   | 2 ++
 include/hw/timer/xlnx-zynqmp-rtc.h    | 1 +
 include/hw/virtio/virtio-access.h     | 1 +
 include/hw/virtio/virtio-gpu-bswap.h  | 1 +
 include/hw/virtio/virtio-rng.h        | 1 +
 include/hw/watchdog/wdt_aspeed.h      | 1 +
 include/libdecnumber/decNumberLocal.h | 1 +
 include/migration/cpu.h               | 2 ++
 include/monitor/hmp-target.h          | 2 ++
 include/qemu/atomic128.h              | 2 ++
 include/qemu/ratelimit.h              | 2 ++
 include/qemu/thread-win32.h           | 2 +-
 include/sysemu/balloon.h              | 1 +
 include/sysemu/cryptodev-vhost-user.h | 2 ++
 include/sysemu/hvf.h                  | 1 +
 include/sysemu/iothread.h             | 1 +
 include/sysemu/kvm_int.h              | 2 ++
 include/sysemu/memory_mapping.h       | 2 ++
 include/sysemu/xen-mapcache.h         | 2 ++
 include/ui/egl-helpers.h              | 3 +++
 include/ui/input.h                    | 1 +
 include/ui/spice-display.h            | 1 +
 target/hppa/cpu.h                     | 2 +-
 106 files changed, 171 insertions(+), 7 deletions(-)
include/block/raw-aio.h +1 -0
index 0cb7cc74a2..264e3eb10e 100644
@@ -15,6 +15,7 @@
 #ifndef QEMU_RAW_AIO_H
 #define QEMU_RAW_AIO_H
 
+#include "block/aio.h"
 #include "qemu/coroutine.h"
 #include "qemu/iov.h"
 
include/block/write-threshold.h +1 -0
index 80d8aab5d0..25c71b7374 100644
@@ -12,6 +12,7 @@
 #ifndef BLOCK_WRITE_THRESHOLD_H
 #define BLOCK_WRITE_THRESHOLD_H
 
+#include "block/block_int.h"
 
 /*
  * bdrv_write_threshold_set:
include/disas/disas.h +1 -0
index 15da511f49..ba47e9197c 100644
@@ -1,6 +1,7 @@
 #ifndef QEMU_DISAS_H
 #define QEMU_DISAS_H
 
+#include "exec/hwaddr.h"
 
 #ifdef NEED_CPU_H
 #include "cpu.h"
include/exec/cputlb.h +2 -0
index 5373188be3..23abd71579 100644
@@ -19,6 +19,8 @@
 #ifndef CPUTLB_H
 #define CPUTLB_H
 
+#include "exec/cpu-common.h"
+
 #if !defined(CONFIG_USER_ONLY)
 /* cputlb.c */
 void tlb_protect_code(ram_addr_t ram_addr);
include/exec/exec-all.h +1 -0
index 16034ee651..135aeaab0d 100644
@@ -20,6 +20,7 @@
 #ifndef EXEC_ALL_H
 #define EXEC_ALL_H
 
+#include "cpu.h"
 #include "exec/tb-context.h"
 #include "sysemu/cpus.h"
 
include/exec/ioport.h +2 -0
index a298b89ce1..97feb296d2 100644
@@ -24,6 +24,8 @@
 #ifndef IOPORT_H
 #define IOPORT_H
 
+#include "exec/memory.h"
+
 #define MAX_IOPORTS     (64 * 1024)
 #define IOPORTS_MASK    (MAX_IOPORTS - 1)
 
include/exec/memory-internal.h +2 -0
index d1a9dd1ec8..ef4fb92371 100644
@@ -20,6 +20,8 @@
 #ifndef MEMORY_INTERNAL_H
 #define MEMORY_INTERNAL_H
 
+#include "cpu.h"
+
 #ifndef CONFIG_USER_ONLY
 static inline AddressSpaceDispatch *flatview_to_dispatch(FlatView *fv)
 {
include/exec/ram_addr.h +1 -0
index b7b2e60ff6..a327a80cfe 100644
@@ -20,6 +20,7 @@
 #define RAM_ADDR_H
 
 #ifndef CONFIG_USER_ONLY
+#include "cpu.h"
 #include "hw/xen/xen.h"
 #include "sysemu/tcg.h"
 #include "exec/ramlist.h"
include/exec/softmmu-semi.h +2 -0
index 970837992e..fbcae88f4b 100644
@@ -10,6 +10,8 @@
 #ifndef SOFTMMU_SEMI_H
 #define SOFTMMU_SEMI_H
 
+#include "cpu.h"
+
 static inline uint64_t softmmu_tget64(CPUArchState *env, target_ulong addr)
 {
     uint64_t val;
include/exec/tb-hash.h +2 -0
index 4f3a37d927..805235d321 100644
@@ -20,6 +20,8 @@
 #ifndef EXEC_TB_HASH_H
 #define EXEC_TB_HASH_H
 
+#include "exec/cpu-defs.h"
+#include "exec/exec-all.h"
 #include "qemu/xxhash.h"
 
 #ifdef CONFIG_SOFTMMU
include/exec/user/thunk.h +1 -0
index 8d3af5a3be..d05a8a4dab 100644
@@ -20,6 +20,7 @@
 #define THUNK_H
 
 #include "cpu.h"
+#include "exec/user/abitypes.h"
 
 /* types enums definitions */
 
include/fpu/softfloat-macros.h +2 -0
index c55aa6d174..be83a833ec 100644
@@ -82,6 +82,8 @@ this code that are retained.
 #ifndef FPU_SOFTFLOAT_MACROS_H
 #define FPU_SOFTFLOAT_MACROS_H
 
+#include "fpu/softfloat.h"
+
 /*----------------------------------------------------------------------------
 | Shifts `a' right by the number of bits given in `count'.  If any nonzero
 | bits are shifted off, they are ``jammed'' into the least significant bit of
include/hw/acpi/pci.h +2 -0
index 8bbd32cf45..4594d7dc62 100644
@@ -25,6 +25,8 @@
 #ifndef HW_ACPI_PCI_H
 #define HW_ACPI_PCI_H
 
+#include "hw/acpi/bios-linker-loader.h"
+
 typedef struct AcpiMcfgInfo {
     uint64_t base;
     uint32_t size;
include/hw/acpi/tco.h +2 -0
index d19dd59353..8adb7a0d20 100644
@@ -9,6 +9,8 @@
 #ifndef HW_ACPI_TCO_H
 #define HW_ACPI_TCO_H
 
+#include "exec/memory.h"
+#include "migration/vmstate.h"
 
 /* As per ICH9 spec, the internal timer has an error of ~0.6s on every tick */
 #define TCO_TICK_NSEC 600000000LL
include/hw/adc/stm32f2xx_adc.h +2 -0
index a72f734eb1..663b79f4f3 100644
@@ -25,6 +25,8 @@
 #ifndef HW_STM32F2XX_ADC_H
 #define HW_STM32F2XX_ADC_H
 
+#include "hw/sysbus.h"
+
 #define ADC_SR    0x00
 #define ADC_CR1   0x04
 #define ADC_CR2   0x08
include/hw/arm/allwinner-a10.h +1 -0
index e99fe2ea2e..7182ce5c4b 100644
@@ -11,6 +11,7 @@
 #include "hw/ide/ahci.h"
 
 #include "sysemu/sysemu.h"
+#include "target/arm/cpu.h"
 
 
 #define AW_A10_PIC_REG_BASE     0x01c20400
include/hw/arm/aspeed_soc.h +1 -0
index cef605ad6b..976fd6be93 100644
@@ -22,6 +22,7 @@
 #include "hw/ssi/aspeed_smc.h"
 #include "hw/watchdog/wdt_aspeed.h"
 #include "hw/net/ftgmac100.h"
+#include "target/arm/cpu.h"
 
 #define ASPEED_SPIS_NUM  2
 #define ASPEED_WDTS_NUM  3
include/hw/arm/bcm2836.h +1 -0
index a2cb8454de..97187f72be 100644
@@ -13,6 +13,7 @@
 
 #include "hw/arm/bcm2835_peripherals.h"
 #include "hw/intc/bcm2836_control.h"
+#include "target/arm/cpu.h"
 
 #define TYPE_BCM283X "bcm283x"
 #define BCM283X(obj) OBJECT_CHECK(BCM283XState, (obj), TYPE_BCM283X)
include/hw/arm/exynos4210.h +1 -1
index aa137271c0..358f4619de 100644
@@ -25,7 +25,7 @@
 #ifndef EXYNOS4210_H
 #define EXYNOS4210_H
 
-#include "exec/memory.h"
+#include "hw/sysbus.h"
 #include "target/arm/cpu-qom.h"
 
 #define EXYNOS4210_NCPUS                    2
include/hw/arm/fsl-imx25.h +1 -0
index 3280ab1fb0..241efb52ae 100644
@@ -27,6 +27,7 @@
 #include "hw/i2c/imx_i2c.h"
 #include "hw/gpio/imx_gpio.h"
 #include "exec/memory.h"
+#include "target/arm/cpu.h"
 
 #define TYPE_FSL_IMX25 "fsl,imx25"
 #define FSL_IMX25(obj) OBJECT_CHECK(FslIMX25State, (obj), TYPE_FSL_IMX25)
include/hw/arm/fsl-imx31.h +1 -0
index e68a81efd7..ac5ca9826a 100644
@@ -26,6 +26,7 @@
 #include "hw/i2c/imx_i2c.h"
 #include "hw/gpio/imx_gpio.h"
 #include "exec/memory.h"
+#include "target/arm/cpu.h"
 
 #define TYPE_FSL_IMX31 "fsl,imx31"
 #define FSL_IMX31(obj) OBJECT_CHECK(FslIMX31State, (obj), TYPE_FSL_IMX31)
include/hw/arm/sharpsl.h +2 -0
index 5bf6db1fa2..a5ef797a67 100644
@@ -6,6 +6,8 @@
 #ifndef QEMU_SHARPSL_H
 #define QEMU_SHARPSL_H
 
+#include "exec/hwaddr.h"
+
 #define zaurus_printf(format, ...)	\
     fprintf(stderr, "%s: " format, __func__, ##__VA_ARGS__)
 
include/hw/arm/xlnx-zynqmp.h +1 -0
index 35804ea80a..6cb65e7537 100644
@@ -32,6 +32,7 @@
 #include "hw/intc/xlnx-zynqmp-ipi.h"
 #include "hw/timer/xlnx-zynqmp-rtc.h"
 #include "hw/cpu/cluster.h"
+#include "target/arm/cpu.h"
 
 #define TYPE_XLNX_ZYNQMP "xlnx,zynqmp"
 #define XLNX_ZYNQMP(obj) OBJECT_CHECK(XlnxZynqMPState, (obj), \
include/hw/block/fdc.h +2 -0
index 8cece84326..f4fe2f471b 100644
@@ -1,6 +1,8 @@
 #ifndef HW_FDC_H
 #define HW_FDC_H
 
+#include "exec/hwaddr.h"
+#include "hw/irq.h"
 #include "qapi/qapi-types-block.h"
 
 /* fdc.c */
include/hw/block/flash.h +1 -0
index 1acaf7de80..83a75f3170 100644
@@ -4,6 +4,7 @@
 /* NOR flash devices */
 
 #include "exec/memory.h"
+#include "migration/vmstate.h"
 
 /* pflash_cfi01.c */
 
include/hw/char/escc.h +1 -0
index 42aca83611..d5196c53e6 100644
@@ -3,6 +3,7 @@
 
 #include "chardev/char-fe.h"
 #include "chardev/char-serial.h"
+#include "hw/sysbus.h"
 #include "ui/input.h"
 
 /* escc.c */
include/hw/char/xilinx_uartlite.h +2 -0
index 634086b657..99d8bbf405 100644
@@ -15,6 +15,8 @@
 #ifndef XILINX_UARTLITE_H
 #define XILINX_UARTLITE_H
 
+#include "hw/sysbus.h"
+
 static inline DeviceState *xilinx_uartlite_create(hwaddr addr,
                                         qemu_irq irq,
                                         Chardev *chr)
include/hw/core/generic-loader.h +1 -0
index dd27c42ab0..9ffce1c5a3 100644
@@ -19,6 +19,7 @@
 #define GENERIC_LOADER_H
 
 #include "elf.h"
+#include "hw/qdev-core.h"
 
 typedef struct GenericLoaderState {
     /* <private> */
include/hw/cris/etraxfs.h +1 -0
index 8da965addb..494222d315 100644
@@ -27,6 +27,7 @@
 
 #include "net/net.h"
 #include "hw/cris/etraxfs_dma.h"
+#include "hw/sysbus.h"
 
 /* Instantiate an ETRAXFS Ethernet MAC.  */
 static inline DeviceState *
include/hw/cris/etraxfs_dma.h +3 -0
index f6f33e0980..31ae360611 100644
@@ -1,6 +1,9 @@
 #ifndef HW_ETRAXFS_DMA_H
 #define HW_ETRAXFS_DMA_H
 
+#include "exec/hwaddr.h"
+#include "hw/irq.h"
+
 struct dma_context_metadata {
 	/* data descriptor md */
 	uint16_t metadata;
include/hw/display/i2c-ddc.h +1 -0
index c29443c5af..1cf53a0c8d 100644
@@ -20,6 +20,7 @@
 #define I2C_DDC_H
 
 #include "hw/display/edid.h"
+#include "hw/i2c/i2c.h"
 
 /* A simple I2C slave which just returns the contents of its EDID blob. */
 struct I2CDDCState {
include/hw/empty_slot.h +2 -0
index 123a9f8989..cb9a221aa6 100644
@@ -1,6 +1,8 @@
 #ifndef HW_EMPTY_SLOT_H
 #define HW_EMPTY_SLOT_H
 
+#include "exec/hwaddr.h"
+
 /* empty_slot.c */
 void empty_slot_init(hwaddr addr, uint64_t slot_size);
 
include/hw/gpio/bcm2835_gpio.h +1 -0
index 9f8e0c720c..b0de0a3c74 100644
@@ -15,6 +15,7 @@
 #define BCM2835_GPIO_H
 
 #include "hw/sd/sd.h"
+#include "hw/sysbus.h"
 
 typedef struct BCM2835GpioState {
     SysBusDevice parent_obj;
include/hw/i2c/aspeed_i2c.h +1 -0
index f9020acdef..f742936175 100644
@@ -21,6 +21,7 @@
 #define ASPEED_I2C_H
 
 #include "hw/i2c/i2c.h"
+#include "hw/sysbus.h"
 
 #define TYPE_ASPEED_I2C "aspeed.i2c"
 #define ASPEED_I2C(obj) \
include/hw/i386/apic_internal.h +1 -0
index 1209eb483a..b04bdd947f 100644
@@ -24,6 +24,7 @@
 #include "cpu.h"
 #include "exec/memory.h"
 #include "qemu/timer.h"
+#include "target/i386/cpu-qom.h"
 
 /* APIC Local Vector Table */
 #define APIC_LVT_TIMER                  0
include/hw/i386/ioapic_internal.h +1 -0
index 07002f9662..3d2eec2aa7 100644
@@ -24,6 +24,7 @@
 
 #include "hw/hw.h"
 #include "exec/memory.h"
+#include "hw/i386/ioapic.h"
 #include "hw/sysbus.h"
 #include "qemu/notify.h"
 
include/hw/intc/allwinner-a10-pic.h +2 -0
index 1d314a70d9..a5895401d1 100644
@@ -1,6 +1,8 @@
 #ifndef ALLWINNER_A10_PIC_H
 #define ALLWINNER_A10_PIC_H
 
+#include "hw/sysbus.h"
+
 #define TYPE_AW_A10_PIC  "allwinner-a10-pic"
 #define AW_A10_PIC(obj) OBJECT_CHECK(AwA10PICState, (obj), TYPE_AW_A10_PIC)
 
include/hw/intc/heathrow_pic.h +2 -0
index 6c91ec91bb..b163e27ab9 100644
@@ -26,6 +26,8 @@
 #ifndef HW_INTC_HEATHROW_PIC_H
 #define HW_INTC_HEATHROW_PIC_H
 
+#include "hw/sysbus.h"
+
 #define TYPE_HEATHROW "heathrow"
 #define HEATHROW(obj) OBJECT_CHECK(HeathrowState, (obj), TYPE_HEATHROW)
 
include/hw/intc/mips_gic.h +1 -0
index 902a12b178..8428287bf9 100644
@@ -13,6 +13,7 @@
 
 #include "qemu/units.h"
 #include "hw/timer/mips_gictimer.h"
+#include "hw/sysbus.h"
 #include "cpu.h"
 /*
  * GIC Specific definitions
include/hw/isa/vt82c686.h +2 -0
index c3c2b6e786..a54c3fe60a 100644
@@ -1,6 +1,8 @@
 #ifndef HW_VT82C686_H
 #define HW_VT82C686_H
 
+#include "hw/irq.h"
+
 #define TYPE_VT82C686B_SUPERIO "vt82c686b-superio"
 
 /* vt82c686.c */
include/hw/mips/cps.h +1 -0
index aab1af926d..a941c55f27 100644
@@ -25,6 +25,7 @@
 #include "hw/intc/mips_gic.h"
 #include "hw/misc/mips_cpc.h"
 #include "hw/misc/mips_itu.h"
+#include "target/mips/cpu.h"
 
 #define TYPE_MIPS_CPS "mips-cps"
 #define MIPS_CPS(obj) OBJECT_CHECK(MIPSCPSState, (obj), TYPE_MIPS_CPS)
include/hw/misc/macio/cuda.h +2 -0
index 7dad469142..5768075ac5 100644
@@ -26,6 +26,8 @@
 #ifndef CUDA_H
 #define CUDA_H
 
+#include "hw/misc/mos6522.h"
+
 /* CUDA commands (2nd byte) */
 #define CUDA_WARM_START                0x0
 #define CUDA_AUTOPOLL                  0x1
include/hw/misc/macio/gpio.h +3 -0
index 2838ae5fde..24a4364b39 100644
@@ -26,6 +26,9 @@
 #ifndef MACIO_GPIO_H
 #define MACIO_GPIO_H
 
+#include "hw/ppc/openpic.h"
+#include "hw/sysbus.h"
+
 #define TYPE_MACIO_GPIO "macio-gpio"
 #define MACIO_GPIO(obj) OBJECT_CHECK(MacIOGPIOState, (obj), TYPE_MACIO_GPIO)
 
include/hw/misc/macio/macio.h +2 -0
index 970058b6ed..070a694eb5 100644
@@ -27,10 +27,12 @@
 #define MACIO_H
 
 #include "hw/char/escc.h"
+#include "hw/ide/internal.h"
 #include "hw/intc/heathrow_pic.h"
 #include "hw/misc/macio/cuda.h"
 #include "hw/misc/macio/gpio.h"
 #include "hw/misc/macio/pmu.h"
+#include "hw/ppc/mac.h"
 #include "hw/ppc/mac_dbdma.h"
 #include "hw/ppc/openpic.h"
 
include/hw/misc/macio/pmu.h +3 -0
index d10895ba5f..7ef83dee4c 100644
@@ -10,6 +10,9 @@
 #ifndef PMU_H
 #define PMU_H
 
+#include "hw/misc/mos6522.h"
+#include "hw/misc/macio/gpio.h"
+
 /*
  * PMU commands
  */
include/hw/misc/mips_cmgcr.h +2 -0
index c9dfcb4b84..3e6e223273 100644
@@ -10,6 +10,8 @@
 #ifndef MIPS_CMGCR_H
 #define MIPS_CMGCR_H
 
+#include "hw/sysbus.h"
+
 #define TYPE_MIPS_GCR "mips-gcr"
 #define MIPS_GCR(obj) OBJECT_CHECK(MIPSGCRState, (obj), TYPE_MIPS_GCR)
 
include/hw/misc/mips_cpc.h +2 -0
index 72c834e039..3f670578b0 100644
@@ -20,6 +20,8 @@
 #ifndef MIPS_CPC_H
 #define MIPS_CPC_H
 
+#include "hw/sysbus.h"
+
 #define CPC_ADDRSPACE_SZ    0x6000
 
 /* CPC blocks offsets relative to base address */
include/hw/misc/pvpanic.h +2 -0
index 1ee071a703..840bf4ec09 100644
@@ -14,6 +14,8 @@
 #ifndef HW_MISC_PVPANIC_H
 #define HW_MISC_PVPANIC_H
 
+#include "qom/object.h"
+
 #define TYPE_PVPANIC "pvpanic"
 
 #define PVPANIC_IOPORT_PROP "ioport"
include/hw/net/allwinner_emac.h +1 -0
index 905a43deb4..5013207d15 100644
@@ -27,6 +27,7 @@
 #include "net/net.h"
 #include "qemu/fifo8.h"
 #include "hw/net/mii.h"
+#include "hw/sysbus.h"
 
 #define TYPE_AW_EMAC "allwinner-emac"
 #define AW_EMAC(obj) OBJECT_CHECK(AwEmacState, (obj), TYPE_AW_EMAC)
include/hw/net/lance.h +1 -0
index ffdd35c4d7..0357f5f65c 100644
@@ -31,6 +31,7 @@
 
 #include "net/net.h"
 #include "hw/net/pcnet.h"
+#include "hw/sysbus.h"
 
 #define TYPE_LANCE "lance"
 #define SYSBUS_PCNET(obj) \
include/hw/nvram/chrp_nvram.h +2 -0
index b4f5b2b104..09941a9be4 100644
@@ -18,6 +18,8 @@
 #ifndef CHRP_NVRAM_H
 #define CHRP_NVRAM_H
 
+#include "qemu/bswap.h"
+
 /* OpenBIOS NVRAM partition */
 typedef struct {
     uint8_t signature;
include/hw/pci-host/sabre.h +2 -0
index 9afa4938fd..99b5aefbec 100644
@@ -1,6 +1,8 @@
 #ifndef HW_PCI_HOST_SABRE_H
 #define HW_PCI_HOST_SABRE_H
 
+#include "hw/pci/pci.h"
+#include "hw/pci/pci_host.h"
 #include "hw/sparc/sun4u_iommu.h"
 
 #define MAX_IVEC 0x40
include/hw/pci-host/uninorth.h +1 -1
index 060324536a..9a5cabd4c5 100644
@@ -26,7 +26,7 @@
 #define UNINORTH_H
 
 #include "hw/hw.h"
-
+#include "hw/pci/pci_host.h"
 #include "hw/ppc/openpic.h"
 
 /* UniNorth version */
include/hw/pci/pcie_aer.h +1 -0
index 729a9439c8..502dcd7eba 100644
@@ -22,6 +22,7 @@
 #define QEMU_PCIE_AER_H
 
 #include "hw/hw.h"
+#include "hw/pci/pci_regs.h"
 
 /* definitions which PCIExpressDevice uses */
 
include/hw/ppc/pnv_core.h +1 -0
index d0926454a9..bfbd2ec42a 100644
@@ -21,6 +21,7 @@
 #define PPC_PNV_CORE_H
 
 #include "hw/cpu/core.h"
+#include "target/ppc/cpu.h"
 
 #define TYPE_PNV_CORE "powernv-cpu-core"
 #define PNV_CORE(obj) \
include/hw/ppc/ppc4xx.h +4 -0
index 39a7ba1ce6..90f8866138 100644
@@ -25,6 +25,10 @@
 #ifndef PPC4XX_H
 #define PPC4XX_H
 
+#include "hw/ppc/ppc.h"
+#include "exec/cpu-common.h"
+#include "exec/memory.h"
+
 /* PowerPC 4xx core initialization */
 PowerPCCPU *ppc4xx_init(const char *cpu_model,
                         clk_setup_t *cpu_clk, clk_setup_t *tb_clk,
include/hw/ppc/spapr_irq.h +3 -0
index f965a58f89..cd6e18b05e 100644
@@ -10,6 +10,9 @@
 #ifndef HW_SPAPR_IRQ_H
 #define HW_SPAPR_IRQ_H
 
+#include "hw/irq.h"
+#include "target/ppc/cpu-qom.h"
+
 /*
  * IRQ range offsets per device type
  */
include/hw/ppc/spapr_vio.h +1 -0
index 04609f214e..875be28cdd 100644
@@ -22,6 +22,7 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "hw/ppc/spapr.h"
 #include "sysemu/dma.h"
 
 #define TYPE_VIO_SPAPR_DEVICE "vio-spapr-device"
include/hw/ppc/spapr_xive.h +2 -0
index 7197144265..a39e672f27 100644
@@ -10,7 +10,9 @@
 #ifndef PPC_SPAPR_XIVE_H
 #define PPC_SPAPR_XIVE_H
 
+#include "hw/ppc/spapr_irq.h"
 #include "hw/ppc/xive.h"
+#include "sysemu/sysemu.h"
 
 #define TYPE_SPAPR_XIVE "spapr-xive"
 #define SPAPR_XIVE(obj) OBJECT_CHECK(SpaprXive, (obj), TYPE_SPAPR_XIVE)
include/hw/ppc/xive_regs.h +3 -0
index 1a8c5b5e64..b0c68ab5f7 100644
@@ -16,6 +16,9 @@
 #ifndef PPC_XIVE_REGS_H
 #define PPC_XIVE_REGS_H
 
+#include "qemu/bswap.h"
+#include "qemu/host-utils.h"
+
 /*
  * Interrupt source number encoding on PowerBUS
  */
include/hw/riscv/boot.h +2 -0
index d56f2ae3eb..1f21c2bef1 100644
@@ -20,6 +20,8 @@
 #ifndef RISCV_BOOT_H
 #define RISCV_BOOT_H
 
+#include "exec/cpu-defs.h"
+
 void riscv_find_and_load_firmware(MachineState *machine,
                                   const char *default_machine_firmware,
                                   hwaddr firmware_load_addr);
include/hw/riscv/riscv_hart.h +3 -0
index 0671d88a44..3b52b50571 100644
@@ -21,6 +21,9 @@
 #ifndef HW_RISCV_HART_H
 #define HW_RISCV_HART_H
 
+#include "hw/sysbus.h"
+#include "target/riscv/cpu.h"
+
 #define TYPE_RISCV_HART_ARRAY "riscv.hart_array"
 
 #define RISCV_HART_ARRAY(obj) \
include/hw/riscv/sifive_clint.h +2 -0
index e2865be1d1..ae8286c884 100644
@@ -20,6 +20,8 @@
 #ifndef HW_SIFIVE_CLINT_H
 #define HW_SIFIVE_CLINT_H
 
+#include "hw/sysbus.h"
+
 #define TYPE_SIFIVE_CLINT "riscv.sifive.clint"
 
 #define SIFIVE_CLINT(obj) \
include/hw/riscv/sifive_e.h +1 -0
index d175b24cb2..9c868dd7f9 100644
@@ -19,6 +19,7 @@
 #ifndef HW_SIFIVE_E_H
 #define HW_SIFIVE_E_H
 
+#include "hw/riscv/riscv_hart.h"
 #include "hw/riscv/sifive_gpio.h"
 
 #define TYPE_RISCV_E_SOC "riscv.sifive.e.soc"
include/hw/riscv/sifive_plic.h +1 -1
index ce8907f6aa..b0edba2884 100644
@@ -21,7 +21,7 @@
 #ifndef HW_SIFIVE_PLIC_H
 #define HW_SIFIVE_PLIC_H
 
-#include "hw/irq.h"
+#include "hw/sysbus.h"
 
 #define TYPE_SIFIVE_PLIC "riscv.sifive.plic"
 
include/hw/riscv/sifive_prci.h +2 -0
index bd51c4af3c..8b7de134f8 100644
@@ -19,6 +19,8 @@
 #ifndef HW_SIFIVE_PRCI_H
 #define HW_SIFIVE_PRCI_H
 
+#include "hw/sysbus.h"
+
 enum {
     SIFIVE_PRCI_HFROSCCFG   = 0x0,
     SIFIVE_PRCI_HFXOSCCFG   = 0x4,
include/hw/riscv/sifive_test.h +2 -0
index 71d4c9fad7..3a603a6ead 100644
@@ -19,6 +19,8 @@
 #ifndef HW_SIFIVE_TEST_H
 #define HW_SIFIVE_TEST_H
 
+#include "hw/sysbus.h"
+
 #define TYPE_SIFIVE_TEST "riscv.sifive.test"
 
 #define SIFIVE_TEST(obj) \
include/hw/riscv/sifive_u.h +1 -0
index 892f0eee21..be021ce256 100644
@@ -20,6 +20,7 @@
 #define HW_SIFIVE_U_H
 
 #include "hw/net/cadence_gem.h"
+#include "hw/riscv/riscv_hart.h"
 
 #define TYPE_RISCV_U_SOC "riscv.sifive.u.soc"
 #define RISCV_U_SOC(obj) \
include/hw/riscv/sifive_uart.h +3 -0
index c8dc1c57fd..65668825a3 100644
@@ -20,6 +20,9 @@
 #ifndef HW_SIFIVE_UART_H
 #define HW_SIFIVE_UART_H
 
+#include "chardev/char-fe.h"
+#include "hw/sysbus.h"
+
 enum {
     SIFIVE_UART_TXFIFO        = 0,
     SIFIVE_UART_RXFIFO        = 4,
include/hw/riscv/spike.h +3 -0
index 641b70da67..03d870363c 100644
@@ -19,6 +19,9 @@
 #ifndef HW_RISCV_SPIKE_H
 #define HW_RISCV_SPIKE_H
 
+#include "hw/riscv/riscv_hart.h"
+#include "hw/sysbus.h"
+
 typedef struct {
     /*< private >*/
     SysBusDevice parent_obj;
include/hw/riscv/virt.h +3 -0
index d01a1a85c4..6e5fbe5d3b 100644
@@ -19,6 +19,9 @@
 #ifndef HW_RISCV_VIRT_H
 #define HW_RISCV_VIRT_H
 
+#include "hw/riscv/riscv_hart.h"
+#include "hw/sysbus.h"
+
 typedef struct {
     /*< private >*/
     SysBusDevice parent_obj;
include/hw/s390x/ap-device.h +2 -0
index 765e9082a3..1aa89c36be 100644
@@ -10,6 +10,8 @@
 #ifndef HW_S390X_AP_DEVICE_H
 #define HW_S390X_AP_DEVICE_H
 
+#include "hw/qdev-core.h"
+
 #define AP_DEVICE_TYPE       "ap-device"
 
 typedef struct APDevice {
include/hw/s390x/css-bridge.h +2 -1
index 5a0203be5f..f7ed2d9a03 100644
@@ -12,8 +12,9 @@
 
 #ifndef HW_S390X_CSS_BRIDGE_H
 #define HW_S390X_CSS_BRIDGE_H
+
 #include "qom/object.h"
-#include "hw/qdev-core.h"
+#include "hw/sysbus.h"
 
 /* virtual css bridge */
 typedef struct VirtualCssBridge {
include/hw/s390x/css.h +1 -0
index d033387fba..f46bcafb16 100644
@@ -17,6 +17,7 @@
 #include "hw/s390x/s390_flic.h"
 #include "hw/s390x/ioinst.h"
 #include "sysemu/kvm.h"
+#include "target/s390x/cpu-qom.h"
 
 /* Channel subsystem constants. */
 #define MAX_DEVNO 65535
include/hw/s390x/tod.h +1 -1
index 9c4a6000c3..d71f4ea8a7 100644
@@ -12,7 +12,7 @@
 #define HW_S390_TOD_H
 
 #include "hw/qdev.h"
-#include "s390-tod.h"
+#include "target/s390x/s390-tod.h"
 
 typedef struct S390TOD {
     uint8_t high;
include/hw/semihosting/console.h +2 -0
index cfab572c0c..9be9754bcd 100644
@@ -9,6 +9,8 @@
 #ifndef SEMIHOST_CONSOLE_H
 #define SEMIHOST_CONSOLE_H
 
+#include "cpu.h"
+
 /**
  * qemu_semihosting_console_outs:
  * @env: CPUArchState
include/hw/sh4/sh_intc.h +1 -0
index b7c2404334..3d3efde059 100644
@@ -1,6 +1,7 @@
 #ifndef SH_INTC_H
 #define SH_INTC_H
 
+#include "exec/memory.h"
 #include "hw/irq.h"
 
 typedef unsigned char intc_enum;
include/hw/sparc/sparc64.h +2 -0
index 21ab79e343..4ced36fb5a 100644
@@ -1,6 +1,8 @@
 #ifndef HW_SPARC_SPARC64_H
 #define HW_SPARC_SPARC64_H
 
+#include "target/sparc/cpu-qom.h"
+
 #define IVEC_MAX             0x40
 
 SPARCCPU *sparc64_cpu_devinit(const char *cpu_type, uint64_t prom_addr);
include/hw/ssi/aspeed_smc.h +1 -0
index 591279ba1f..aa07dac4fe 100644
@@ -26,6 +26,7 @@
 #define ASPEED_SMC_H
 
 #include "hw/ssi/ssi.h"
+#include "hw/sysbus.h"
 
 typedef struct AspeedSegments {
     hwaddr addr;
include/hw/ssi/xilinx_spips.h +1 -0
index a0a0ae7584..6a39b55a7b 100644
@@ -28,6 +28,7 @@
 #include "hw/ssi/ssi.h"
 #include "qemu/fifo32.h"
 #include "hw/stream.h"
+#include "hw/sysbus.h"
 
 typedef struct XilinxSPIPS XilinxSPIPS;
 
include/hw/timer/allwinner-a10-pit.h +1 -0
index c0cc3e2169..871c95b512 100644
@@ -2,6 +2,7 @@
 #define ALLWINNER_A10_PIT_H
 
 #include "hw/ptimer.h"
+#include "hw/sysbus.h"
 
 #define TYPE_AW_A10_PIT "allwinner-A10-timer"
 #define AW_A10_PIT(obj) OBJECT_CHECK(AwA10PITState, (obj), TYPE_AW_A10_PIT)
include/hw/timer/i8254_internal.h +1 -0
index c37a438f82..e611c6f227 100644
@@ -27,6 +27,7 @@
 
 #include "hw/hw.h"
 #include "hw/isa/isa.h"
+#include "hw/timer/i8254.h"
 #include "qemu/timer.h"
 
 typedef struct PITChannelState {
include/hw/timer/m48t59.h +2 -0
index 43efc91f56..d3fb50e08c 100644
@@ -1,6 +1,8 @@
 #ifndef HW_M48T59_H
 #define HW_M48T59_H
 
+#include "exec/hwaddr.h"
+#include "hw/irq.h"
 #include "qom/object.h"
 
 #define TYPE_NVRAM "nvram"
include/hw/timer/mc146818rtc_regs.h +2 -0
index c62f17bf2d..bfbb57e570 100644
@@ -25,6 +25,8 @@
 #ifndef MC146818RTC_REGS_H
 #define MC146818RTC_REGS_H
 
+#include "qemu/timer.h"
+
 #define RTC_ISA_IRQ 8
 
 #define RTC_SECONDS             0
include/hw/timer/xlnx-zynqmp-rtc.h +1 -0
index 6e9134edf6..97e32322ed 100644
@@ -28,6 +28,7 @@
 #define HW_TIMER_XLNX_ZYNQMP_RTC_H
 
 #include "hw/register.h"
+#include "hw/sysbus.h"
 
 #define TYPE_XLNX_ZYNQMP_RTC "xlnx-zynmp.rtc"
 
include/hw/virtio/virtio-access.h +1 -0
index bdf58f3119..6818a23a2d 100644
@@ -16,6 +16,7 @@
 #ifndef QEMU_VIRTIO_ACCESS_H
 #define QEMU_VIRTIO_ACCESS_H
 
+#include "exec/hwaddr.h"
 #include "hw/virtio/virtio.h"
 #include "hw/virtio/virtio-bus.h"
 
include/hw/virtio/virtio-gpu-bswap.h +1 -0
index 38d12160f6..203f9e1718 100644
@@ -15,6 +15,7 @@
 #define HW_VIRTIO_GPU_BSWAP_H
 
 #include "qemu/bswap.h"
+#include "standard-headers/linux/virtio_gpu.h"
 
 static inline void
 virtio_gpu_ctrl_hdr_bswap(struct virtio_gpu_ctrl_hdr *hdr)
include/hw/virtio/virtio-rng.h +1 -0
index 922dce7cac..ff699335e3 100644
@@ -12,6 +12,7 @@
 #ifndef QEMU_VIRTIO_RNG_H
 #define QEMU_VIRTIO_RNG_H
 
+#include "hw/virtio/virtio.h"
 #include "sysemu/rng.h"
 #include "sysemu/rng-random.h"
 #include "standard-headers/linux/virtio_rng.h"
include/hw/watchdog/wdt_aspeed.h +1 -0
index daef0c0e23..8c5691ce20 100644
@@ -10,6 +10,7 @@
 #ifndef WDT_ASPEED_H
 #define WDT_ASPEED_H
 
+#include "hw/misc/aspeed_scu.h"
 #include "hw/sysbus.h"
 
 #define TYPE_ASPEED_WDT "aspeed.wdt"
include/libdecnumber/decNumberLocal.h +1 -0
index 12cf1d8b6f..4d53c077f2 100644
@@ -44,6 +44,7 @@
   #define DECNLAUTHOR	"Mike Cowlishaw"	      /* Who to blame */
 
   #include "libdecnumber/dconfig.h"
+  #include "libdecnumber/decContext.h"
 
   /* Conditional code flag -- set this to match hardware platform     */
   /* 1=little-endian, 0=big-endian	                              */
include/migration/cpu.h +2 -0
index a40bd3549f..8424f1631a 100644
@@ -2,6 +2,8 @@
 #ifndef MIGRATION_CPU_H
 #define MIGRATION_CPU_H
 
+#include "exec/cpu-defs.h"
+
 #if TARGET_LONG_BITS == 64
 #define qemu_put_betl qemu_put_be64
 #define qemu_get_betl qemu_get_be64
include/monitor/hmp-target.h +2 -0
index 454e8ed155..8b7820a3ad 100644
@@ -25,6 +25,8 @@
 #ifndef MONITOR_HMP_TARGET_H
 #define MONITOR_HMP_TARGET_H
 
+#include "cpu.h"
+
 #define MD_TLONG 0
 #define MD_I32   1
 
include/qemu/atomic128.h +2 -0
index ddd0d55d31..6b34484e15 100644
@@ -13,6 +13,8 @@
 #ifndef QEMU_ATOMIC128_H
 #define QEMU_ATOMIC128_H
 
+#include "qemu/int128.h"
+
 /*
  * GCC is a house divided about supporting large atomic operations.
  *
include/qemu/ratelimit.h +2 -0
index 1b38291823..01da8d63f1 100644
@@ -14,6 +14,8 @@
 #ifndef QEMU_RATELIMIT_H
 #define QEMU_RATELIMIT_H
 
+#include "qemu/timer.h"
+
 typedef struct {
     int64_t slice_start_time;
     int64_t slice_end_time;
include/qemu/thread-win32.h +1 -1
index 50af5dd7ab..d0a1a9597e 100644
@@ -47,6 +47,6 @@ struct QemuThread {
 };
 
 /* Only valid for joinable threads.  */
-HANDLE qemu_thread_get_handle(QemuThread *thread);
+HANDLE qemu_thread_get_handle(struct QemuThread *thread);
 
 #endif
include/sysemu/balloon.h +1 -0
index c8f6145257..aea0c44985 100644
@@ -14,6 +14,7 @@
 #ifndef QEMU_BALLOON_H
 #define QEMU_BALLOON_H
 
+#include "exec/cpu-common.h"
 #include "qapi/qapi-types-misc.h"
 
 typedef void (QEMUBalloonEvent)(void *opaque, ram_addr_t target);
include/sysemu/cryptodev-vhost-user.h +2 -0
index 6debf53fc5..2c0a0a1cd8 100644
@@ -23,6 +23,8 @@
 #ifndef CRYPTODEV_VHOST_USER_H
 #define CRYPTODEV_VHOST_USER_H
 
+#include "sysemu/cryptodev-vhost.h"
+
 #define VHOST_USER_MAX_AUTH_KEY_LEN    512
 #define VHOST_USER_MAX_CIPHER_KEY_LEN  64
 
include/sysemu/hvf.h +1 -0
index d275b5a843..dd1722f2df 100644
@@ -13,6 +13,7 @@
 #ifndef HVF_H
 #define HVF_H
 
+#include "cpu.h"
 #include "qemu/bitops.h"
 #include "exec/memory.h"
 #include "sysemu/accel.h"
include/sysemu/iothread.h +1 -0
index 5f6240d5cb..6181486401 100644
@@ -16,6 +16,7 @@
 
 #include "block/aio.h"
 #include "qemu/thread.h"
+#include "qom/object.h"
 
 #define TYPE_IOTHREAD "iothread"
 
include/sysemu/kvm_int.h +2 -0
index 31df465fdc..787dbc7770 100644
@@ -9,6 +9,8 @@
 #ifndef QEMU_KVM_INT_H
 #define QEMU_KVM_INT_H
 
+#include "exec/cpu-common.h"
+#include "exec/memory.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/accel.h"
 #include "sysemu/kvm.h"
include/sysemu/memory_mapping.h +2 -0
index 58452457ce..1b440df486 100644
@@ -15,6 +15,8 @@
 #define MEMORY_MAPPING_H
 
 #include "qemu/queue.h"
+#include "exec/cpu-common.h"
+#include "exec/cpu-defs.h"
 #include "exec/memory.h"
 
 typedef struct GuestPhysBlock {
include/sysemu/xen-mapcache.h +2 -0
index a03e2f1878..c8e7c2f6cf 100644
@@ -9,6 +9,8 @@
 #ifndef XEN_MAPCACHE_H
 #define XEN_MAPCACHE_H
 
+#include "exec/cpu-common.h"
+
 typedef hwaddr (*phys_offset_to_gaddr_t)(hwaddr phys_offset,
                                          ram_addr_t size);
 #ifdef CONFIG_XEN
include/ui/egl-helpers.h +3 -0
index d714127799..58bd3a1ec4 100644
@@ -4,6 +4,9 @@
 #include <epoxy/gl.h>
 #include <epoxy/egl.h>
 #include <gbm.h>
+#include "qapi/qapi-types-ui.h"
+#include "ui/console.h"
+#include "ui/shader.h"
 
 extern EGLDisplay *qemu_egl_display;
 extern EGLConfig qemu_egl_config;
include/ui/input.h +1 -0
index 8c8ccb999f..c86219a1c1 100644
@@ -2,6 +2,7 @@
 #define INPUT_H
 
 #include "qapi/qapi-types-ui.h"
+#include "qemu/notify.h"
 
 #define INPUT_EVENT_MASK_KEY   (1<<INPUT_EVENT_KIND_KEY)
 #define INPUT_EVENT_MASK_BTN   (1<<INPUT_EVENT_KIND_BTN)
include/ui/spice-display.h +1 -0
index eed60e4fae..58bb5b4c53 100644
@@ -18,6 +18,7 @@
 #ifndef UI_SPICE_DISPLAY_H
 #define UI_SPICE_DISPLAY_H
 
+#include <spice.h>
 #include <spice/ipc_ring.h>
 #include <spice/enums.h>
 #include <spice/qxl_dev.h>
target/hppa/cpu.h +1 -1
index aab251bc4b..e9fba96be9 100644
@@ -22,7 +22,7 @@
 
 #include "cpu-qom.h"
 #include "exec/cpu-defs.h"
-
+#include "exec/memory.h"
 
 /* PA-RISC 1.x processors have a strong memory model.  */
 /* ??? While we do not yet implement PA-RISC 2.0, those processors have
Signature · 1 line
2.21.0
#2 lore raw

Re: [Qemu-devel] [PATCH v2 01/29] include: Make headers more self-contained

Quoted 27 lines · Markus Armbruster

Back in 2016, we discussed[1] rules for headers, and these were generally liked:

1. Have a carefully curated header that's included everywhere first. We got that already thanks to Peter: osdep.h.

2. Headers should normally include everything they need beyond osdep.h. If exceptions are needed for some reason, they must be documented in the header. If all that's needed from a header is typedefs, put those into qemu/typedefs.h instead of including the header.

3. Cyclic inclusion is forbidden.

This patch gets include/ closer to obeying 2.

It's actually extracted from my "[RFC] Baby steps towards saner headers" series[2], which demonstrates a possible path towards checking 2 automatically. It passes the RFC test there.

[1] Message-ID: <[email protected]>

    https://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg03345.html
[2] Message-Id: <[email protected]>
    https://lists.nongnu.org/archive/html/qemu-devel/2019-07/msg02715.html

---

<snip>

Quoted 9 lines
 include/exec/cputlb.h                 | 2 ++
 include/exec/exec-all.h               | 1 +
 include/exec/ioport.h                 | 2 ++
 include/exec/memory-internal.h        | 2 ++
 include/exec/ram_addr.h               | 1 +
 include/exec/softmmu-semi.h           | 2 ++
 include/exec/tb-hash.h                | 2 ++
 include/exec/user/thunk.h             | 1 +
 include/fpu/softfloat-macros.h        | 2 ++

<snip>

Quoted 109 lines

/*
* bdrv_write_threshold_set:

include/disas/disas.h +1 -0
index 15da511f49..ba47e9197c 100644
@@ -1,6 +1,7 @@
 #ifndef QEMU_DISAS_H
 #define QEMU_DISAS_H
 
+#include "exec/hwaddr.h"
 
 #ifdef NEED_CPU_H
 #include "cpu.h"
include/exec/cputlb.h +2 -0
index 5373188be3..23abd71579 100644
@@ -19,6 +19,8 @@
 #ifndef CPUTLB_H
 #define CPUTLB_H
 
+#include "exec/cpu-common.h"
+
 #if !defined(CONFIG_USER_ONLY)
 /* cputlb.c */
 void tlb_protect_code(ram_addr_t ram_addr);
include/exec/exec-all.h +1 -0
index 16034ee651..135aeaab0d 100644
@@ -20,6 +20,7 @@
 #ifndef EXEC_ALL_H
 #define EXEC_ALL_H
 
+#include "cpu.h"
 #include "exec/tb-context.h"
 #include "sysemu/cpus.h"
 
include/exec/ioport.h +2 -0
index a298b89ce1..97feb296d2 100644
@@ -24,6 +24,8 @@
 #ifndef IOPORT_H
 #define IOPORT_H
 
+#include "exec/memory.h"
+
 #define MAX_IOPORTS     (64 * 1024)
 #define IOPORTS_MASK    (MAX_IOPORTS - 1)
 
include/exec/memory-internal.h +2 -0
index d1a9dd1ec8..ef4fb92371 100644
@@ -20,6 +20,8 @@
 #ifndef MEMORY_INTERNAL_H
 #define MEMORY_INTERNAL_H
 
+#include "cpu.h"
+
 #ifndef CONFIG_USER_ONLY
 static inline AddressSpaceDispatch *flatview_to_dispatch(FlatView *fv)
 {
include/exec/ram_addr.h +1 -0
index b7b2e60ff6..a327a80cfe 100644
@@ -20,6 +20,7 @@
 #define RAM_ADDR_H
 
 #ifndef CONFIG_USER_ONLY
+#include "cpu.h"
 #include "hw/xen/xen.h"
 #include "sysemu/tcg.h"
 #include "exec/ramlist.h"
include/exec/softmmu-semi.h +2 -0
index 970837992e..fbcae88f4b 100644
@@ -10,6 +10,8 @@
 #ifndef SOFTMMU_SEMI_H
 #define SOFTMMU_SEMI_H
 
+#include "cpu.h"
+
 static inline uint64_t softmmu_tget64(CPUArchState *env, target_ulong addr)
 {
     uint64_t val;
include/exec/tb-hash.h +2 -0
index 4f3a37d927..805235d321 100644
@@ -20,6 +20,8 @@
 #ifndef EXEC_TB_HASH_H
 #define EXEC_TB_HASH_H
 
+#include "exec/cpu-defs.h"
+#include "exec/exec-all.h"
 #include "qemu/xxhash.h"
 
 #ifdef CONFIG_SOFTMMU
include/exec/user/thunk.h +0 -0
index 8d3af5a3be..d05a8a4dab 100644

include/exec/user/thunk.h line 25

Quoted 6 lines
include/exec/user/thunk.h +1 -0
@@ -20,6 +20,7 @@
 #define THUNK_H
 
 #include "cpu.h"
+#include "exec/user/abitypes.h"
 
 /* types enums definitions */

These all seem OK.

include/fpu/softfloat-macros.h this code that are retained. · line 86

Quoted 11 lines
include/fpu/softfloat-macros.h +2 -0
index c55aa6d174..be83a833ec 100644
@@ -82,6 +82,8 @@ this code that are retained.
 #ifndef FPU_SOFTFLOAT_MACROS_H
 #define FPU_SOFTFLOAT_MACROS_H
 
+#include "fpu/softfloat.h"
+

What does softfloat-macros actually need from the core softfloat API? These are lower level functions used by softfloat itself (and m68k for it's own bit fiddling).

--
Alex Bennée

#3 lore raw

Re: [Qemu-devel] [PATCH v2 01/29] include: Make headers more self-contained

Quoted 167 lines · Alex Bennée
Quoted 27 lines · Markus Armbruster

Back in 2016, we discussed[1] rules for headers, and these were generally liked:

1. Have a carefully curated header that's included everywhere first. We got that already thanks to Peter: osdep.h.

2. Headers should normally include everything they need beyond osdep.h. If exceptions are needed for some reason, they must be documented in the header. If all that's needed from a header is typedefs, put those into qemu/typedefs.h instead of including the header.

3. Cyclic inclusion is forbidden.

This patch gets include/ closer to obeying 2.

It's actually extracted from my "[RFC] Baby steps towards saner headers" series[2], which demonstrates a possible path towards checking 2 automatically. It passes the RFC test there.

[1] Message-ID: <[email protected]>

    https://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg03345.html
[2] Message-Id: <[email protected]>
    https://lists.nongnu.org/archive/html/qemu-devel/2019-07/msg02715.html

---

<snip>

Quoted 9 lines
 include/exec/cputlb.h                 | 2 ++
 include/exec/exec-all.h               | 1 +
 include/exec/ioport.h                 | 2 ++
 include/exec/memory-internal.h        | 2 ++
 include/exec/ram_addr.h               | 1 +
 include/exec/softmmu-semi.h           | 2 ++
 include/exec/tb-hash.h                | 2 ++
 include/exec/user/thunk.h             | 1 +
 include/fpu/softfloat-macros.h        | 2 ++

<snip>

Quoted 109 lines

/*
* bdrv_write_threshold_set:

include/disas/disas.h +1 -0
index 15da511f49..ba47e9197c 100644
@@ -1,6 +1,7 @@
 #ifndef QEMU_DISAS_H
 #define QEMU_DISAS_H
 
+#include "exec/hwaddr.h"
 
 #ifdef NEED_CPU_H
 #include "cpu.h"
include/exec/cputlb.h +2 -0
index 5373188be3..23abd71579 100644
@@ -19,6 +19,8 @@
 #ifndef CPUTLB_H
 #define CPUTLB_H
 
+#include "exec/cpu-common.h"
+
 #if !defined(CONFIG_USER_ONLY)
 /* cputlb.c */
 void tlb_protect_code(ram_addr_t ram_addr);
include/exec/exec-all.h +1 -0
index 16034ee651..135aeaab0d 100644
@@ -20,6 +20,7 @@
 #ifndef EXEC_ALL_H
 #define EXEC_ALL_H
 
+#include "cpu.h"
 #include "exec/tb-context.h"
 #include "sysemu/cpus.h"
 
include/exec/ioport.h +2 -0
index a298b89ce1..97feb296d2 100644
@@ -24,6 +24,8 @@
 #ifndef IOPORT_H
 #define IOPORT_H
 
+#include "exec/memory.h"
+
 #define MAX_IOPORTS     (64 * 1024)
 #define IOPORTS_MASK    (MAX_IOPORTS - 1)
 
include/exec/memory-internal.h +2 -0
index d1a9dd1ec8..ef4fb92371 100644
@@ -20,6 +20,8 @@
 #ifndef MEMORY_INTERNAL_H
 #define MEMORY_INTERNAL_H
 
+#include "cpu.h"
+
 #ifndef CONFIG_USER_ONLY
 static inline AddressSpaceDispatch *flatview_to_dispatch(FlatView *fv)
 {
include/exec/ram_addr.h +1 -0
index b7b2e60ff6..a327a80cfe 100644
@@ -20,6 +20,7 @@
 #define RAM_ADDR_H
 
 #ifndef CONFIG_USER_ONLY
+#include "cpu.h"
 #include "hw/xen/xen.h"
 #include "sysemu/tcg.h"
 #include "exec/ramlist.h"
include/exec/softmmu-semi.h +2 -0
index 970837992e..fbcae88f4b 100644
@@ -10,6 +10,8 @@
 #ifndef SOFTMMU_SEMI_H
 #define SOFTMMU_SEMI_H
 
+#include "cpu.h"
+
 static inline uint64_t softmmu_tget64(CPUArchState *env, target_ulong addr)
 {
     uint64_t val;
include/exec/tb-hash.h +2 -0
index 4f3a37d927..805235d321 100644
@@ -20,6 +20,8 @@
 #ifndef EXEC_TB_HASH_H
 #define EXEC_TB_HASH_H
 
+#include "exec/cpu-defs.h"
+#include "exec/exec-all.h"
 #include "qemu/xxhash.h"
 
 #ifdef CONFIG_SOFTMMU
include/exec/user/thunk.h +0 -0
index 8d3af5a3be..d05a8a4dab 100644

include/exec/user/thunk.h line 25

Quoted 6 lines
include/exec/user/thunk.h +1 -0
@@ -20,6 +20,7 @@
 #define THUNK_H
 
 #include "cpu.h"
+#include "exec/user/abitypes.h"
 
 /* types enums definitions */

These all seem OK.

Quoted 9 lines
include/fpu/softfloat-macros.h +0 -0
index c55aa6d174..be83a833ec 100644
@@ -82,6 +82,8 @@ this code that are retained.
 #ifndef FPU_SOFTFLOAT_MACROS_H
 #define FPU_SOFTFLOAT_MACROS_H
 
Quoted 6 lines

include/fpu/softfloat-macros.h this code that are retained. · line 86

Quoted 2 lines
include/fpu/softfloat-macros.h +2 -0
+#include "fpu/softfloat.h"
+

What does softfloat-macros actually need from the core softfloat API? These are lower level functions used by softfloat itself (and m68k for it's own bit fiddling).

I extracted this patch out of "[PATCH RFC v5 0/3] Baby steps towards saner headers". PATCH 1/3 creates make target "check-source", which is what I used to find headers that aren't self-contained. In this case:

CC cris-softmmu/tests/headers-tgt/include/fpu/softfloat.o
In file included from tests/headers-tgt/include/fpu/softfloat-macros.c:21:
/work/armbru/qemu/include/fpu/softfloat-macros.h: In function ‘estimateDiv128To64’:
/work/armbru/qemu/include/fpu/softfloat-macros.h:623:27: error: implicit declaration of function ‘LIT64’ [-Werror=implicit-function-declaration]
623 | if ( b <= a0 ) return LIT64( 0xFFFFFFFFFFFFFFFF );
| ^~~~~
/work/armbru/qemu/include/fpu/softfloat-macros.h:623:27: error: nested extern declaration of ‘LIT64’ [-Werror=nested-externs] /work/armbru/qemu/include/fpu/softfloat-macros.h: At top level:
/work/armbru/qemu/include/fpu/softfloat-macros.h:761:15: error: unknown type name ‘flag’
761 | static inline flag eq128( uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1 )
| ^~~~
/work/armbru/qemu/include/fpu/softfloat-macros.h:774:15: error: unknown type name ‘flag’
774 | static inline flag le128( uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1 )
| ^~~~
/work/armbru/qemu/include/fpu/softfloat-macros.h:787:15: error: unknown type name ‘flag’
787 | static inline flag lt128( uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1 )
| ^~~~
/work/armbru/qemu/include/fpu/softfloat-macros.h:800:15: error: unknown type name ‘flag’
800 | static inline flag ne128( uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1 )
| ^~~~
cc1: all warnings being treated as errors
make[1]: *** [/work/armbru/qemu/rules.mak:69: tests/headers-tgt/include/fpu/softfloat-macros.o] Error 1

#4 lore raw

Re: [Qemu-devel] [PATCH v2 01/29] include: Make headers more self-contained

Quoted 180 lines · Markus Armbruster
Quoted 167 lines · Alex Bennée
Quoted 27 lines · Markus Armbruster

Back in 2016, we discussed[1] rules for headers, and these were generally liked:

1. Have a carefully curated header that's included everywhere first. We got that already thanks to Peter: osdep.h.

2. Headers should normally include everything they need beyond osdep.h. If exceptions are needed for some reason, they must be documented in the header. If all that's needed from a header is typedefs, put those into qemu/typedefs.h instead of including the header.

3. Cyclic inclusion is forbidden.

This patch gets include/ closer to obeying 2.

It's actually extracted from my "[RFC] Baby steps towards saner headers" series[2], which demonstrates a possible path towards checking 2 automatically. It passes the RFC test there.

[1] Message-ID: <[email protected]>

    https://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg03345.html
[2] Message-Id: <[email protected]>
    https://lists.nongnu.org/archive/html/qemu-devel/2019-07/msg02715.html

---

<snip>

Quoted 9 lines
 include/exec/cputlb.h                 | 2 ++
 include/exec/exec-all.h               | 1 +
 include/exec/ioport.h                 | 2 ++
 include/exec/memory-internal.h        | 2 ++
 include/exec/ram_addr.h               | 1 +
 include/exec/softmmu-semi.h           | 2 ++
 include/exec/tb-hash.h                | 2 ++
 include/exec/user/thunk.h             | 1 +
 include/fpu/softfloat-macros.h        | 2 ++

<snip>

Quoted 109 lines

/*
* bdrv_write_threshold_set:

include/disas/disas.h +1 -0
index 15da511f49..ba47e9197c 100644
@@ -1,6 +1,7 @@
 #ifndef QEMU_DISAS_H
 #define QEMU_DISAS_H
 
+#include "exec/hwaddr.h"
 
 #ifdef NEED_CPU_H
 #include "cpu.h"
include/exec/cputlb.h +2 -0
index 5373188be3..23abd71579 100644
@@ -19,6 +19,8 @@
 #ifndef CPUTLB_H
 #define CPUTLB_H
 
+#include "exec/cpu-common.h"
+
 #if !defined(CONFIG_USER_ONLY)
 /* cputlb.c */
 void tlb_protect_code(ram_addr_t ram_addr);
include/exec/exec-all.h +1 -0
index 16034ee651..135aeaab0d 100644
@@ -20,6 +20,7 @@
 #ifndef EXEC_ALL_H
 #define EXEC_ALL_H
 
+#include "cpu.h"
 #include "exec/tb-context.h"
 #include "sysemu/cpus.h"
 
include/exec/ioport.h +2 -0
index a298b89ce1..97feb296d2 100644
@@ -24,6 +24,8 @@
 #ifndef IOPORT_H
 #define IOPORT_H
 
+#include "exec/memory.h"
+
 #define MAX_IOPORTS     (64 * 1024)
 #define IOPORTS_MASK    (MAX_IOPORTS - 1)
 
include/exec/memory-internal.h +2 -0
index d1a9dd1ec8..ef4fb92371 100644
@@ -20,6 +20,8 @@
 #ifndef MEMORY_INTERNAL_H
 #define MEMORY_INTERNAL_H
 
+#include "cpu.h"
+
 #ifndef CONFIG_USER_ONLY
 static inline AddressSpaceDispatch *flatview_to_dispatch(FlatView *fv)
 {
include/exec/ram_addr.h +1 -0
index b7b2e60ff6..a327a80cfe 100644
@@ -20,6 +20,7 @@
 #define RAM_ADDR_H
 
 #ifndef CONFIG_USER_ONLY
+#include "cpu.h"
 #include "hw/xen/xen.h"
 #include "sysemu/tcg.h"
 #include "exec/ramlist.h"
include/exec/softmmu-semi.h +2 -0
index 970837992e..fbcae88f4b 100644
@@ -10,6 +10,8 @@
 #ifndef SOFTMMU_SEMI_H
 #define SOFTMMU_SEMI_H
 
+#include "cpu.h"
+
 static inline uint64_t softmmu_tget64(CPUArchState *env, target_ulong addr)
 {
     uint64_t val;
include/exec/tb-hash.h +2 -0
index 4f3a37d927..805235d321 100644
@@ -20,6 +20,8 @@
 #ifndef EXEC_TB_HASH_H
 #define EXEC_TB_HASH_H
 
+#include "exec/cpu-defs.h"
+#include "exec/exec-all.h"
 #include "qemu/xxhash.h"
 
 #ifdef CONFIG_SOFTMMU
include/exec/user/thunk.h +0 -0
index 8d3af5a3be..d05a8a4dab 100644

include/exec/user/thunk.h line 25

Quoted 6 lines
include/exec/user/thunk.h +1 -0
@@ -20,6 +20,7 @@
 #define THUNK_H
 
 #include "cpu.h"
+#include "exec/user/abitypes.h"
 
 /* types enums definitions */

These all seem OK.

Quoted 9 lines
include/fpu/softfloat-macros.h +0 -0
index c55aa6d174..be83a833ec 100644
@@ -82,6 +82,8 @@ this code that are retained.
 #ifndef FPU_SOFTFLOAT_MACROS_H
 #define FPU_SOFTFLOAT_MACROS_H
 
Quoted 6 lines

include/fpu/softfloat-macros.h this code that are retained. · line 86

Quoted 2 lines
include/fpu/softfloat-macros.h +2 -0
+#include "fpu/softfloat.h"
+

What does softfloat-macros actually need from the core softfloat API? These are lower level functions used by softfloat itself (and m68k for it's own bit fiddling).

I extracted this patch out of "[PATCH RFC v5 0/3] Baby steps towards saner headers". PATCH 1/3 creates make target "check-source", which is what I used to find headers that aren't self-contained. In this case:

Quoted 5 lines

CC cris-softmmu/tests/headers-tgt/include/fpu/softfloat.o
In file included from tests/headers-tgt/include/fpu/softfloat-macros.c:21:
/work/armbru/qemu/include/fpu/softfloat-macros.h: In function ‘estimateDiv128To64’:
/work/armbru/qemu/include/fpu/softfloat-macros.h:623:27: error: implicit declaration of function ‘LIT64’ [-Werror=implicit-function-declaration]
623 | if ( b <= a0 ) return LIT64( 0xFFFFFFFFFFFFFFFF );

The LIT64 definition should be moved to softfloat-types.h which is already included by softfloat.h unless we already have a QEMU expansion we should be using. The softfloat-macros.h can include softfloat-types.h as well and we should only include the full softfloat.h if they need it.

Do you want me to spin up a patch?

Quoted 9 lines

| ^~~~~
/work/armbru/qemu/include/fpu/softfloat-macros.h:623:27: error: nested extern declaration of ‘LIT64’ [-Werror=nested-externs] /work/armbru/qemu/include/fpu/softfloat-macros.h: At top level:
/work/armbru/qemu/include/fpu/softfloat-macros.h:761:15: error: unknown type name ‘flag’
761 | static inline flag eq128( uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1 )
| ^~~~
/work/armbru/qemu/include/fpu/softfloat-macros.h:774:15: error: unknown type name ‘flag’
774 | static inline flag le128( uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1 )
| ^~~~

Quoted 8 lines

/work/armbru/qemu/include/fpu/softfloat-macros.h:787:15: error: unknown type name ‘flag’
787 | static inline flag lt128( uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1 )
| ^~~~
/work/armbru/qemu/include/fpu/softfloat-macros.h:800:15: error: unknown type name ‘flag’
800 | static inline flag ne128( uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1 )
| ^~~~
cc1: all warnings being treated as errors
make[1]: *** [/work/armbru/qemu/rules.mak:69: tests/headers-tgt/include/fpu/softfloat-macros.o] Error 1

--
Alex Bennée

#5 lore raw

Re: [Qemu-devel] [PATCH v2 01/29] include: Make headers more self-contained

Quoted 32 lines · Alex Bennée
Quoted 30 lines · Markus Armbruster
Quoted 28 lines · Alex Bennée
Quoted 26 lines · Markus Armbruster

Back in 2016, we discussed[1] rules for headers, and these were generally liked:

1. Have a carefully curated header that's included everywhere first. We got that already thanks to Peter: osdep.h.

2. Headers should normally include everything they need beyond osdep.h. If exceptions are needed for some reason, they must be documented in the header. If all that's needed from a header is typedefs, put those into qemu/typedefs.h instead of including the header.

3. Cyclic inclusion is forbidden.

This patch gets include/ closer to obeying 2.

It's actually extracted from my "[RFC] Baby steps towards saner headers" series[2], which demonstrates a possible path towards checking 2 automatically. It passes the RFC test there.

[1] Message-ID: <[email protected]>

    https://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg03345.html
[2] Message-Id: <[email protected]>
    https://lists.nongnu.org/archive/html/qemu-devel/2019-07/msg02715.html

[...]

Quoted 25 lines
Quoted 19 lines
Quoted 8 lines
Quoted 8 lines
include/fpu/softfloat-macros.h +0 -0
index c55aa6d174..be83a833ec 100644
@@ -82,6 +82,8 @@ this code that are retained.
 #ifndef FPU_SOFTFLOAT_MACROS_H
 #define FPU_SOFTFLOAT_MACROS_H
 
Quoted 6 lines

include/fpu/softfloat-macros.h this code that are retained. · line 86

Quoted 2 lines
include/fpu/softfloat-macros.h +2 -0
+#include "fpu/softfloat.h"
+

What does softfloat-macros actually need from the core softfloat API? These are lower level functions used by softfloat itself (and m68k for it's own bit fiddling).

I extracted this patch out of "[PATCH RFC v5 0/3] Baby steps towards saner headers". PATCH 1/3 creates make target "check-source", which is what I used to find headers that aren't self-contained. In this case:

Quoted 5 lines

CC cris-softmmu/tests/headers-tgt/include/fpu/softfloat.o
In file included from tests/headers-tgt/include/fpu/softfloat-macros.c:21:
/work/armbru/qemu/include/fpu/softfloat-macros.h: In function ‘estimateDiv128To64’:
/work/armbru/qemu/include/fpu/softfloat-macros.h:623:27: error: implicit declaration of function ‘LIT64’ [-Werror=implicit-function-declaration]
623 | if ( b <= a0 ) return LIT64( 0xFFFFFFFFFFFFFFFF );

Quoted 6 lines

The LIT64 definition should be moved to softfloat-types.h which is already included by softfloat.h unless we already have a QEMU expansion we should be using. The softfloat-macros.h can include softfloat-types.h as well and we should only include the full softfloat.h if they need it.

Do you want me to spin up a patch?

Yes, please!

[...]

#6 lore raw

PATCH v2 2/29 Include generated QAPI headers less

In reply to Markus Armbruster

Some of the generated qapi-types-MODULE.h are included all over the place. Changing a QAPI type can trigger massive recompiling. Top scorers recompile more than 1000 out of some 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h):

    6300 qapi/qapi-builtin-types.h
    5700 qapi/qapi-types-run-state.h
    3900 qapi/qapi-types-common.h
    3300 qapi/qapi-types-sockets.h
    3000 qapi/qapi-types-misc.h
    3000 qapi/qapi-types-crypto.h
    3000 qapi/qapi-types-job.h
    3000 qapi/qapi-types-block-core.h
    2800 qapi/qapi-types-block.h
    1300 qapi/qapi-types-net.h

Clean up headers to include generated QAPI headers only where needed. Impact is negligible except for hw/qdev-properties.h.

This header includes qapi/qapi-types-block.h and qapi/qapi-types-misc.h. They are used only in expansions of property definition macros such as DEFINE_PROP_BLOCKDEV_ON_ERROR() and DEFINE_PROP_OFF_AUTO(). Moving their inclusion from hw/qdev-properties.h to the users of these macros avoids pointless recompiles. This is how other property definition macros, such as DEFINE_PROP_NETDEV(), already work.

Improves things for some of the top scorers:

    3600 qapi/qapi-types-common.h
    2800 qapi/qapi-types-sockets.h
     900 qapi/qapi-types-misc.h
    2200 qapi/qapi-types-crypto.h
    2100 qapi/qapi-types-job.h
    2100 qapi/qapi-types-block-core.h
     270 qapi/qapi-types-block.h
---
 hw/core/qdev-properties.c            | 2 ++
 hw/i386/kvm/i8254.c                  | 1 +
 hw/ide/qdev.c                        | 1 +
 include/authz/listfile.h             | 1 -
 include/block/block.h                | 1 -
 include/hw/acpi/acpi_dev_interface.h | 1 +
 include/hw/mem/memory-device.h       | 1 +
 include/hw/ppc/spapr_drc.h           | 1 -
 include/hw/qdev-properties.h         | 2 --
 include/hw/virtio/virtio-pmem.h      | 1 +
 include/migration/global_state.h     | 1 -
 include/qemu/job.h                   | 2 +-
 include/sysemu/arch_init.h           | 1 -
 include/ui/egl-helpers.h             | 1 -
 monitor/monitor-internal.h           | 1 -
 target/i386/monitor.c                | 1 +
 target/i386/sev_i386.h               | 2 +-
 ui/vnc.h                             | 1 -
 18 files changed, 10 insertions(+), 12 deletions(-)
hw/core/qdev-properties.c +2 -0
index 81c97f48a7..8510ad14b0 100644
@@ -3,6 +3,8 @@
 #include "hw/qdev.h"
 #include "qapi/error.h"
 #include "hw/pci/pci.h"
+#include "qapi/qapi-types-block.h"
+#include "qapi/qapi-types-misc.h"
 #include "qapi/qmp/qerror.h"
 #include "qemu/ctype.h"
 #include "qemu/error-report.h"
hw/i386/kvm/i8254.c +1 -0
index c29956ab77..27e36a2abf 100644
@@ -25,6 +25,7 @@
 
 #include "qemu/osdep.h"
 #include <linux/kvm.h>
+#include "qapi/qapi-types-misc.h"
 #include "qapi/error.h"
 #include "qemu/module.h"
 #include "qemu/timer.h"
hw/ide/qdev.c +1 -0
index 9d8502785d..eea22c09f4 100644
@@ -21,6 +21,7 @@
 #include "hw/hw.h"
 #include "sysemu/dma.h"
 #include "qapi/error.h"
+#include "qapi/qapi-types-block.h"
 #include "qemu/error-report.h"
 #include "qemu/module.h"
 #include "hw/ide/internal.h"
include/authz/listfile.h +0 -1
index 33b728d873..24ae2e606c 100644
@@ -22,7 +22,6 @@
 #define QAUTHZ_LISTFILE_H
 
 #include "authz/list.h"
-#include "qapi/qapi-types-authz.h"
 #include "qemu/filemonitor.h"
 
 #define TYPE_QAUTHZ_LIST_FILE "authz-list-file"
include/block/block.h +0 -1
index 50a07c1c33..ae79b70e2d 100644
@@ -2,7 +2,6 @@
 #define BLOCK_H
 
 #include "block/aio.h"
-#include "qapi/qapi-types-block-core.h"
 #include "block/aio-wait.h"
 #include "qemu/iov.h"
 #include "qemu/coroutine.h"
include/hw/acpi/acpi_dev_interface.h +1 -0
index 43ff119179..6465072b7d 100644
@@ -1,6 +1,7 @@
 #ifndef ACPI_DEV_INTERFACE_H
 #define ACPI_DEV_INTERFACE_H
 
+#include "qapi/qapi-types-misc.h"
 #include "qom/object.h"
 #include "hw/boards.h"
 
include/hw/mem/memory-device.h +1 -0
index 0293a96abb..2ada6e7bde 100644
@@ -13,6 +13,7 @@
 #ifndef MEMORY_DEVICE_H
 #define MEMORY_DEVICE_H
 
+#include "qapi/qapi-types-misc.h"
 #include "qom/object.h"
 #include "hw/qdev.h"
 
include/hw/ppc/spapr_drc.h +0 -1
index c2c543a591..576c711b86 100644
@@ -14,7 +14,6 @@
 #define HW_SPAPR_DRC_H
 
 #include <libfdt.h>
-#include "qapi/qapi-types-run-state.h"
 #include "qom/object.h"
 #include "sysemu/sysemu.h"
 #include "hw/qdev.h"
include/hw/qdev-properties.h +0 -2
index 1eae5ab056..bb34a614e2 100644
@@ -1,8 +1,6 @@
 #ifndef QEMU_QDEV_PROPERTIES_H
 #define QEMU_QDEV_PROPERTIES_H
 
-#include "qapi/qapi-types-block.h"
-#include "qapi/qapi-types-misc.h"
 #include "hw/qdev-core.h"
 
 /*** qdev-properties.c ***/
include/hw/virtio/virtio-pmem.h +1 -0
index 19b6ee6d75..8bf2ae780f 100644
@@ -15,6 +15,7 @@
 #define HW_VIRTIO_PMEM_H
 
 #include "hw/virtio/virtio.h"
+#include "qapi/qapi-types-misc.h"
 #include "sysemu/hostmem.h"
 
 #define TYPE_VIRTIO_PMEM "virtio-pmem"
include/migration/global_state.h +0 -1
index fd22dd3034..d307de8350 100644
@@ -13,7 +13,6 @@
 #ifndef QEMU_MIGRATION_GLOBAL_STATE_H
 #define QEMU_MIGRATION_GLOBAL_STATE_H
 
-#include "qapi/qapi-types-run-state.h"
 #include "sysemu/sysemu.h"
 
 void register_global_state(void);
include/qemu/job.h +1 -1
index 9e7cd1e4a0..73c67d3175 100644
@@ -26,7 +26,7 @@
 #ifndef JOB_H
 #define JOB_H
 
-#include "qapi/qapi-types-block-core.h"
+#include "qapi/qapi-types-job.h"
 #include "qemu/queue.h"
 #include "qemu/coroutine.h"
 #include "block/aio.h"
include/sysemu/arch_init.h +0 -1
index 10cbafe970..62c6fe4cf1 100644
@@ -1,7 +1,6 @@
 #ifndef QEMU_ARCH_INIT_H
 #define QEMU_ARCH_INIT_H
 
-#include "qapi/qapi-types-misc.h"
 
 enum {
     QEMU_ARCH_ALL = -1,
include/ui/egl-helpers.h +0 -1
index 58bd3a1ec4..dad19e9873 100644
@@ -4,7 +4,6 @@
 #include <epoxy/gl.h>
 #include <epoxy/egl.h>
 #include <gbm.h>
-#include "qapi/qapi-types-ui.h"
 #include "ui/console.h"
 #include "ui/shader.h"
 
monitor/monitor-internal.h +0 -1
index 7760b22ba3..d78f5ca190 100644
@@ -27,7 +27,6 @@
 
 #include "chardev/char-fe.h"
 #include "monitor/monitor.h"
-#include "qapi/qapi-types-misc.h"
 #include "qapi/qmp/dispatch.h"
 #include "qapi/qmp/json-parser.h"
 #include "qemu/readline.h"
target/i386/monitor.c +1 -0
index 1f3b532fc2..9fb4d641d5 100644
@@ -33,6 +33,7 @@
 #include "sysemu/sev.h"
 #include "qapi/error.h"
 #include "sev_i386.h"
+#include "qapi/qapi-commands-misc-target.h"
 #include "qapi/qapi-commands-misc.h"
 
 /* Perform linear address sign extension */
target/i386/sev_i386.h +1 -1
index 55313441ae..8ada9d385d 100644
@@ -19,7 +19,7 @@
 #include "sysemu/kvm.h"
 #include "sysemu/sev.h"
 #include "qemu/error-report.h"
-#include "qapi/qapi-commands-misc-target.h"
+#include "qapi/qapi-types-misc-target.h"
 
 #define SEV_POLICY_NODBG        0x1
 #define SEV_POLICY_NOKS         0x2
ui/vnc.h +0 -1
index 2f84db3142..18f1b1d6d0 100644
@@ -27,7 +27,6 @@
 #ifndef QEMU_VNC_H
 #define QEMU_VNC_H
 
-#include "qapi/qapi-types-ui.h"
 #include "qemu/queue.h"
 #include "qemu/thread.h"
 #include "ui/console.h"
Signature · 1 line
2.21.0
Reviewed-by on v2 2/29
#7 lore raw

Re: [Qemu-devel] [PATCH v2 02/29] Include generated QAPI headers less

Quoted 37 lines · Markus Armbruster

Some of the generated qapi-types-MODULE.h are included all over the place. Changing a QAPI type can trigger massive recompiling. Top scorers recompile more than 1000 out of some 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h):

    6300 qapi/qapi-builtin-types.h
    5700 qapi/qapi-types-run-state.h
    3900 qapi/qapi-types-common.h
    3300 qapi/qapi-types-sockets.h
    3000 qapi/qapi-types-misc.h
    3000 qapi/qapi-types-crypto.h
    3000 qapi/qapi-types-job.h
    3000 qapi/qapi-types-block-core.h
    2800 qapi/qapi-types-block.h
    1300 qapi/qapi-types-net.h

Clean up headers to include generated QAPI headers only where needed. Impact is negligible except for hw/qdev-properties.h.

This header includes qapi/qapi-types-block.h and qapi/qapi-types-misc.h. They are used only in expansions of property definition macros such as DEFINE_PROP_BLOCKDEV_ON_ERROR() and DEFINE_PROP_OFF_AUTO(). Moving their inclusion from hw/qdev-properties.h to the users of these macros avoids pointless recompiles. This is how other property definition macros, such as DEFINE_PROP_NETDEV(), already work.

Improves things for some of the top scorers:

    3600 qapi/qapi-types-common.h
    2800 qapi/qapi-types-sockets.h
     900 qapi/qapi-types-misc.h
    2200 qapi/qapi-types-crypto.h
    2100 qapi/qapi-types-job.h
    2100 qapi/qapi-types-block-core.h
     270 qapi/qapi-types-block.h
Quoted 2 lines

---

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org
Reviewed-by Tested-by on v2 2/29
#8 lore raw

Re: [Qemu-devel] [PATCH v2 02/29] Include generated QAPI headers less

In reply to Markus Armbruster
Quoted 37 lines · Markus Armbruster

Some of the generated qapi-types-MODULE.h are included all over the place. Changing a QAPI type can trigger massive recompiling. Top scorers recompile more than 1000 out of some 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h):

    6300 qapi/qapi-builtin-types.h
    5700 qapi/qapi-types-run-state.h
    3900 qapi/qapi-types-common.h
    3300 qapi/qapi-types-sockets.h
    3000 qapi/qapi-types-misc.h
    3000 qapi/qapi-types-crypto.h
    3000 qapi/qapi-types-job.h
    3000 qapi/qapi-types-block-core.h
    2800 qapi/qapi-types-block.h
    1300 qapi/qapi-types-net.h

Clean up headers to include generated QAPI headers only where needed. Impact is negligible except for hw/qdev-properties.h.

This header includes qapi/qapi-types-block.h and qapi/qapi-types-misc.h. They are used only in expansions of property definition macros such as DEFINE_PROP_BLOCKDEV_ON_ERROR() and DEFINE_PROP_OFF_AUTO(). Moving their inclusion from hw/qdev-properties.h to the users of these macros avoids pointless recompiles. This is how other property definition macros, such as DEFINE_PROP_NETDEV(), already work.

Improves things for some of the top scorers:

    3600 qapi/qapi-types-common.h
    2800 qapi/qapi-types-sockets.h
     900 qapi/qapi-types-misc.h
    2200 qapi/qapi-types-crypto.h
    2100 qapi/qapi-types-job.h
    2100 qapi/qapi-types-block-core.h
     270 qapi/qapi-types-block.h
Quoted 1 line
Quoted 242 lines
---
 hw/core/qdev-properties.c            | 2 ++
 hw/i386/kvm/i8254.c                  | 1 +
 hw/ide/qdev.c                        | 1 +
 include/authz/listfile.h             | 1 -
 include/block/block.h                | 1 -
 include/hw/acpi/acpi_dev_interface.h | 1 +
 include/hw/mem/memory-device.h       | 1 +
 include/hw/ppc/spapr_drc.h           | 1 -
 include/hw/qdev-properties.h         | 2 --
 include/hw/virtio/virtio-pmem.h      | 1 +
 include/migration/global_state.h     | 1 -
 include/qemu/job.h                   | 2 +-
 include/sysemu/arch_init.h           | 1 -
 include/ui/egl-helpers.h             | 1 -
 monitor/monitor-internal.h           | 1 -
 target/i386/monitor.c                | 1 +
 target/i386/sev_i386.h               | 2 +-
 ui/vnc.h                             | 1 -
 18 files changed, 10 insertions(+), 12 deletions(-)
hw/core/qdev-properties.c +2 -0
index 81c97f48a7..8510ad14b0 100644
@@ -3,6 +3,8 @@
 #include "hw/qdev.h"
 #include "qapi/error.h"
 #include "hw/pci/pci.h"
+#include "qapi/qapi-types-block.h"
+#include "qapi/qapi-types-misc.h"
 #include "qapi/qmp/qerror.h"
 #include "qemu/ctype.h"
 #include "qemu/error-report.h"
hw/i386/kvm/i8254.c +1 -0
index c29956ab77..27e36a2abf 100644
@@ -25,6 +25,7 @@
 
 #include "qemu/osdep.h"
 #include <linux/kvm.h>
+#include "qapi/qapi-types-misc.h"
 #include "qapi/error.h"
 #include "qemu/module.h"
 #include "qemu/timer.h"
hw/ide/qdev.c +1 -0
index 9d8502785d..eea22c09f4 100644
@@ -21,6 +21,7 @@
 #include "hw/hw.h"
 #include "sysemu/dma.h"
 #include "qapi/error.h"
+#include "qapi/qapi-types-block.h"
 #include "qemu/error-report.h"
 #include "qemu/module.h"
 #include "hw/ide/internal.h"
include/authz/listfile.h +0 -1
index 33b728d873..24ae2e606c 100644
@@ -22,7 +22,6 @@
 #define QAUTHZ_LISTFILE_H
 
 #include "authz/list.h"
-#include "qapi/qapi-types-authz.h"
 #include "qemu/filemonitor.h"
 
 #define TYPE_QAUTHZ_LIST_FILE "authz-list-file"
include/block/block.h +0 -1
index 50a07c1c33..ae79b70e2d 100644
@@ -2,7 +2,6 @@
 #define BLOCK_H
 
 #include "block/aio.h"
-#include "qapi/qapi-types-block-core.h"
 #include "block/aio-wait.h"
 #include "qemu/iov.h"
 #include "qemu/coroutine.h"
include/hw/acpi/acpi_dev_interface.h +1 -0
index 43ff119179..6465072b7d 100644
@@ -1,6 +1,7 @@
 #ifndef ACPI_DEV_INTERFACE_H
 #define ACPI_DEV_INTERFACE_H
 
+#include "qapi/qapi-types-misc.h"
 #include "qom/object.h"
 #include "hw/boards.h"
 
include/hw/mem/memory-device.h +1 -0
index 0293a96abb..2ada6e7bde 100644
@@ -13,6 +13,7 @@
 #ifndef MEMORY_DEVICE_H
 #define MEMORY_DEVICE_H
 
+#include "qapi/qapi-types-misc.h"
 #include "qom/object.h"
 #include "hw/qdev.h"
 
include/hw/ppc/spapr_drc.h +0 -1
index c2c543a591..576c711b86 100644
@@ -14,7 +14,6 @@
 #define HW_SPAPR_DRC_H
 
 #include <libfdt.h>
-#include "qapi/qapi-types-run-state.h"
 #include "qom/object.h"
 #include "sysemu/sysemu.h"
 #include "hw/qdev.h"
include/hw/qdev-properties.h +0 -2
index 1eae5ab056..bb34a614e2 100644
@@ -1,8 +1,6 @@
 #ifndef QEMU_QDEV_PROPERTIES_H
 #define QEMU_QDEV_PROPERTIES_H
 
-#include "qapi/qapi-types-block.h"
-#include "qapi/qapi-types-misc.h"
 #include "hw/qdev-core.h"
 
 /*** qdev-properties.c ***/
include/hw/virtio/virtio-pmem.h +1 -0
index 19b6ee6d75..8bf2ae780f 100644
@@ -15,6 +15,7 @@
 #define HW_VIRTIO_PMEM_H
 
 #include "hw/virtio/virtio.h"
+#include "qapi/qapi-types-misc.h"
 #include "sysemu/hostmem.h"
 
 #define TYPE_VIRTIO_PMEM "virtio-pmem"
include/migration/global_state.h +0 -1
index fd22dd3034..d307de8350 100644
@@ -13,7 +13,6 @@
 #ifndef QEMU_MIGRATION_GLOBAL_STATE_H
 #define QEMU_MIGRATION_GLOBAL_STATE_H
 
-#include "qapi/qapi-types-run-state.h"
 #include "sysemu/sysemu.h"
 
 void register_global_state(void);
include/qemu/job.h +1 -1
index 9e7cd1e4a0..73c67d3175 100644
@@ -26,7 +26,7 @@
 #ifndef JOB_H
 #define JOB_H
 
-#include "qapi/qapi-types-block-core.h"
+#include "qapi/qapi-types-job.h"
 #include "qemu/queue.h"
 #include "qemu/coroutine.h"
 #include "block/aio.h"
include/sysemu/arch_init.h +0 -1
index 10cbafe970..62c6fe4cf1 100644
@@ -1,7 +1,6 @@
 #ifndef QEMU_ARCH_INIT_H
 #define QEMU_ARCH_INIT_H
 
-#include "qapi/qapi-types-misc.h"
 
 enum {
     QEMU_ARCH_ALL = -1,
include/ui/egl-helpers.h +0 -1
index 58bd3a1ec4..dad19e9873 100644
@@ -4,7 +4,6 @@
 #include <epoxy/gl.h>
 #include <epoxy/egl.h>
 #include <gbm.h>
-#include "qapi/qapi-types-ui.h"
 #include "ui/console.h"
 #include "ui/shader.h"
 
monitor/monitor-internal.h +0 -1
index 7760b22ba3..d78f5ca190 100644
@@ -27,7 +27,6 @@
 
 #include "chardev/char-fe.h"
 #include "monitor/monitor.h"
-#include "qapi/qapi-types-misc.h"
 #include "qapi/qmp/dispatch.h"
 #include "qapi/qmp/json-parser.h"
 #include "qemu/readline.h"
target/i386/monitor.c +1 -0
index 1f3b532fc2..9fb4d641d5 100644
@@ -33,6 +33,7 @@
 #include "sysemu/sev.h"
 #include "qapi/error.h"
 #include "sev_i386.h"
+#include "qapi/qapi-commands-misc-target.h"
 #include "qapi/qapi-commands-misc.h"
 
 /* Perform linear address sign extension */
target/i386/sev_i386.h +1 -1
index 55313441ae..8ada9d385d 100644
@@ -19,7 +19,7 @@
 #include "sysemu/kvm.h"
 #include "sysemu/sev.h"
 #include "qemu/error-report.h"
-#include "qapi/qapi-commands-misc-target.h"
+#include "qapi/qapi-types-misc-target.h"
 
 #define SEV_POLICY_NODBG        0x1
 #define SEV_POLICY_NOKS         0x2
ui/vnc.h +0 -1
index 2f84db3142..18f1b1d6d0 100644
@@ -27,7 +27,6 @@
 #ifndef QEMU_VNC_H
 #define QEMU_VNC_H
 
-#include "qapi/qapi-types-ui.h"
 #include "qemu/queue.h"
 #include "qemu/thread.h"
 #include "ui/console.h"
#9 lore raw

PATCH v2 3/29 qapi: Split error.json off common.json

In reply to Markus Armbruster

In my "build everything" tree, changing a type in qapi/common.json triggers a recompile of some 3600 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h).

One common dependency is QapiErrorClass: it's used only in in qapi/error.h, which uses nothing else, and is widely included.

Move QapiErrorClass from common.json to new error.json. Touching common.json now recompiles only some 2900 objects.

---
 MAINTAINERS           |  2 ++
 include/qapi/error.h  |  2 +-
 qapi/Makefile.objs    |  2 +-
 qapi/common.json      | 24 ------------------------
 qapi/error.json       | 29 +++++++++++++++++++++++++++++
 qapi/qapi-schema.json |  1 +
 6 files changed, 34 insertions(+), 26 deletions(-)
 create mode 100644 qapi/error.json
MAINTAINERS +2 -0
index d6de200453..adc64cfe33 100644
@@ -1874,6 +1874,7 @@ M: Markus Armbruster <[email protected]>
 S: Supported
 F: include/qapi/error.h
 F: include/qemu/error-report.h
+F: qapi/error.json
 F: util/error.c
 F: util/qemu-error.c
 
@@ -2062,6 +2063,7 @@ F: monitor/monitor-internal.h
 F: monitor/qmp*
 F: monitor/misc.c
 F: monitor/monitor.c
+F: qapi/error.json
 F: docs/devel/*qmp-*
 F: docs/interop/*qmp-*
 F: scripts/qmp/
include/qapi/error.h +1 -1
index 51b63dd4b5..3f95141a01 100644
@@ -119,7 +119,7 @@
 #ifndef ERROR_H
 #define ERROR_H
 
-#include "qapi/qapi-types-common.h"
+#include "qapi/qapi-types-error.h"
 
 /*
  * Overall category of an error.
qapi/Makefile.objs +1 -1
index c5a29e86e2..dd3f5e6f94 100644
@@ -6,7 +6,7 @@ util-obj-y += qmp-event.o
 util-obj-y += qapi-util.o
 
 QAPI_COMMON_MODULES = audio authz block-core block char common crypto
-QAPI_COMMON_MODULES += dump introspect job machine migration misc net
+QAPI_COMMON_MODULES += dump error introspect job machine migration misc net
 QAPI_COMMON_MODULES += qdev qom rdma rocker run-state sockets tpm
 QAPI_COMMON_MODULES += trace transaction ui
 QAPI_TARGET_MODULES = machine-target misc-target
qapi/common.json +0 -24
index 99d313ef3b..3d4e8de1e0 100644
@@ -4,30 +4,6 @@
 # = Common data types
 ##
 
-##
-# @QapiErrorClass:
-#
-# QEMU error classes
-#
-# @GenericError: this is used for errors that don't require a specific error
-#                class. This should be the default case for most errors
-#
-# @CommandNotFound: the requested command has not been found
-#
-# @DeviceNotActive: a device has failed to be become active
-#
-# @DeviceNotFound: the requested device has not been found
-#
-# @KVMMissingCap: the requested operation can't be fulfilled because a
-#                 required KVM capability is missing
-#
-# Since: 1.2
-##
-{ 'enum': 'QapiErrorClass',
-  # Keep this in sync with ErrorClass in error.h
-  'data': [ 'GenericError', 'CommandNotFound',
-            'DeviceNotActive', 'DeviceNotFound', 'KVMMissingCap' ] }
-
 ##
 # @IoOperationType:
 #
qapi/error.json new file +29 -0
new file mode 100644
index 0000000000..3fad08f506
@@ -0,0 +1,29 @@
+# -*- Mode: Python -*-
+
+##
+# = QMP errors
+##
+
+##
+# @QapiErrorClass:
+#
+# QEMU error classes
+#
+# @GenericError: this is used for errors that don't require a specific error
+#                class. This should be the default case for most errors
+#
+# @CommandNotFound: the requested command has not been found
+#
+# @DeviceNotActive: a device has failed to be become active
+#
+# @DeviceNotFound: the requested device has not been found
+#
+# @KVMMissingCap: the requested operation can't be fulfilled because a
+#                 required KVM capability is missing
+#
+# Since: 1.2
+##
+{ 'enum': 'QapiErrorClass',
+  # Keep this in sync with ErrorClass in error.h
+  'data': [ 'GenericError', 'CommandNotFound',
+            'DeviceNotActive', 'DeviceNotFound', 'KVMMissingCap' ] }
qapi/qapi-schema.json +1 -0
index 38af54d6b3..920b03b0aa 100644
@@ -80,6 +80,7 @@
 # stable order, it's best to include each sub-schema just once, or
 # include it first right here.
 
+{ 'include': 'error.json' }
 { 'include': 'common.json' }
 { 'include': 'sockets.json' }
 { 'include': 'run-state.json' }
Signature · 1 line
2.21.0
Reviewed-by Tested-by on v2 3/29
#10 lore raw

Re: [Qemu-devel] [PATCH v2 03/29] qapi: Split error.json off common.json

Quoted 9 lines · Markus Armbruster

In my "build everything" tree, changing a type in qapi/common.json triggers a recompile of some 3600 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h).

One common dependency is QapiErrorClass: it's used only in in qapi/error.h, which uses nothing else, and is widely included.

Move QapiErrorClass from common.json to new error.json. Touching common.json now recompiles only some 2900 objects.

Nice.

Quoted 4 lines
Quoted 139 lines
---
 MAINTAINERS           |  2 ++
 include/qapi/error.h  |  2 +-
 qapi/Makefile.objs    |  2 +-
 qapi/common.json      | 24 ------------------------
 qapi/error.json       | 29 +++++++++++++++++++++++++++++
 qapi/qapi-schema.json |  1 +
 6 files changed, 34 insertions(+), 26 deletions(-)
 create mode 100644 qapi/error.json
MAINTAINERS +2 -0
index d6de200453..adc64cfe33 100644
@@ -1874,6 +1874,7 @@ M: Markus Armbruster <[email protected]>
 S: Supported
 F: include/qapi/error.h
 F: include/qemu/error-report.h
+F: qapi/error.json
 F: util/error.c
 F: util/qemu-error.c
 
@@ -2062,6 +2063,7 @@ F: monitor/monitor-internal.h
 F: monitor/qmp*
 F: monitor/misc.c
 F: monitor/monitor.c
+F: qapi/error.json
 F: docs/devel/*qmp-*
 F: docs/interop/*qmp-*
 F: scripts/qmp/
include/qapi/error.h +1 -1
index 51b63dd4b5..3f95141a01 100644
@@ -119,7 +119,7 @@
 #ifndef ERROR_H
 #define ERROR_H
 
-#include "qapi/qapi-types-common.h"
+#include "qapi/qapi-types-error.h"
 
 /*
  * Overall category of an error.
qapi/Makefile.objs +1 -1
index c5a29e86e2..dd3f5e6f94 100644
@@ -6,7 +6,7 @@ util-obj-y += qmp-event.o
 util-obj-y += qapi-util.o
 
 QAPI_COMMON_MODULES = audio authz block-core block char common crypto
-QAPI_COMMON_MODULES += dump introspect job machine migration misc net
+QAPI_COMMON_MODULES += dump error introspect job machine migration misc net
 QAPI_COMMON_MODULES += qdev qom rdma rocker run-state sockets tpm
 QAPI_COMMON_MODULES += trace transaction ui
 QAPI_TARGET_MODULES = machine-target misc-target
qapi/common.json +0 -24
index 99d313ef3b..3d4e8de1e0 100644
@@ -4,30 +4,6 @@
 # = Common data types
 ##
 
-##
-# @QapiErrorClass:
-#
-# QEMU error classes
-#
-# @GenericError: this is used for errors that don't require a specific error
-#                class. This should be the default case for most errors
-#
-# @CommandNotFound: the requested command has not been found
-#
-# @DeviceNotActive: a device has failed to be become active
-#
-# @DeviceNotFound: the requested device has not been found
-#
-# @KVMMissingCap: the requested operation can't be fulfilled because a
-#                 required KVM capability is missing
-#
-# Since: 1.2
-##
-{ 'enum': 'QapiErrorClass',
-  # Keep this in sync with ErrorClass in error.h
-  'data': [ 'GenericError', 'CommandNotFound',
-            'DeviceNotActive', 'DeviceNotFound', 'KVMMissingCap' ] }
-
 ##
 # @IoOperationType:
 #
qapi/error.json new file +29 -0
new file mode 100644
index 0000000000..3fad08f506
@@ -0,0 +1,29 @@
+# -*- Mode: Python -*-
+
+##
+# = QMP errors
+##
+
+##
+# @QapiErrorClass:
+#
+# QEMU error classes
+#
+# @GenericError: this is used for errors that don't require a specific error
+#                class. This should be the default case for most errors
+#
+# @CommandNotFound: the requested command has not been found
+#
+# @DeviceNotActive: a device has failed to be become active
+#
+# @DeviceNotFound: the requested device has not been found
+#
+# @KVMMissingCap: the requested operation can't be fulfilled because a
+#                 required KVM capability is missing
+#
+# Since: 1.2
+##
+{ 'enum': 'QapiErrorClass',
+  # Keep this in sync with ErrorClass in error.h
+  'data': [ 'GenericError', 'CommandNotFound',
+            'DeviceNotActive', 'DeviceNotFound', 'KVMMissingCap' ] }
qapi/qapi-schema.json +1 -0
index 38af54d6b3..920b03b0aa 100644
@@ -80,6 +80,7 @@
 # stable order, it's best to include each sub-schema just once, or
 # include it first right here.
 
+{ 'include': 'error.json' }
 { 'include': 'common.json' }
 { 'include': 'sockets.json' }
 { 'include': 'run-state.json' }
#11 lore raw

PATCH v2 4/29 memory: Fix type of IOMMUMemoryRegionClass member @parent_class

In reply to Markus Armbruster

TYPE_IOMMU_MEMORY_REGION is a direct subtype of TYPE_MEMORY_REGION. Its instance struct is IOMMUMemoryRegion, and its first member is a MemoryRegion. Correct. Its class struct is IOMMUMemoryRegionClass, and its first member is a DeviceClass. Wrong. Messed up when commit 1221a474676 introduced the QOM type. It even included hw/qdev-core.h just for that.

TYPE_MEMORY_REGION doesn't bother to define a class struct. This is fine, it simply defaults to its super-type TYPE_OBJECT's class struct ObjectClass. Changing IOMMUMemoryRegionClass's first member's type to ObjectClass would be a minimal fix, if a bit brittle: if TYPE_MEMORY_REGION ever acquired own class struct, we'd have to update IOMMUMemoryRegionClass to use it.

Fix it the clean and robust way instead: give TYPE_MEMORY_REGION its own class struct MemoryRegionClass now, and use it for IOMMUMemoryRegionClass's first member.

Revert the include of hw/qdev-core.h, and fix the few files that have come to rely on it.

---
 hw/display/vga-isa-mm.c | 1 +
 hw/net/pcnet.h          | 1 +
 include/exec/memory.h   | 9 +++++++--
 memory.c                | 1 +
 4 files changed, 10 insertions(+), 2 deletions(-)
hw/display/vga-isa-mm.c +1 -0
index 215e649719..a790f69b6d 100644
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qemu/bitops.h"
 #include "qemu/units.h"
 #include "hw/hw.h"
 #include "hw/display/vga.h"
hw/net/pcnet.h +1 -0
index 40831a7845..28d19a5c6f 100644
@@ -8,6 +8,7 @@
 #define PCNET_LOOPTEST_NOCRC	2
 
 #include "exec/memory.h"
+#include "hw/irq.h"
 
 /* BUS CONFIGURATION REGISTERS */
 #define BCR_MSRDA    0
include/exec/memory.h +7 -2
index bb0961ddb9..238370a2ff 100644
@@ -25,7 +25,6 @@
 #include "qemu/notify.h"
 #include "qom/object.h"
 #include "qemu/rcu.h"
-#include "hw/qdev-core.h"
 
 #define RAM_ADDR_INVALID (~(ram_addr_t)0)
 
@@ -205,6 +204,12 @@ struct MemoryRegionOps {
     } impl;
 };
 
+typedef struct MemoryRegionClass {
+    /* private */
+    ObjectClass parent_class;
+} MemoryRegionClass;
+
+
 enum IOMMUMemoryRegionAttr {
     IOMMU_ATTR_SPAPR_TCE_FD
 };
@@ -237,7 +242,7 @@ enum IOMMUMemoryRegionAttr {
  */
 typedef struct IOMMUMemoryRegionClass {
     /* private */
-    struct DeviceClass parent_class;
+    MemoryRegionClass parent_class;
 
     /*
      * Return a TLB entry that contains a given address.
memory.c +1 -0
index 5d8c9a9234..09d9b254fd 100644
@@ -3245,6 +3245,7 @@ void memory_region_init_rom_device(MemoryRegion *mr,
 static const TypeInfo memory_region_info = {
     .parent             = TYPE_OBJECT,
     .name               = TYPE_MEMORY_REGION,
+    .class_size         = sizeof(MemoryRegionClass),
     .instance_size      = sizeof(MemoryRegion),
     .instance_init      = memory_region_initfn,
     .instance_finalize  = memory_region_finalize,
Signature · 1 line
2.21.0
Tested-by on v2 4/29
#12 lore raw

Re: [Qemu-devel] [PATCH v2 04/29] memory: Fix type of IOMMUMemoryRegionClass member @parent_class

Quoted 18 lines · Markus Armbruster

TYPE_IOMMU_MEMORY_REGION is a direct subtype of TYPE_MEMORY_REGION. Its instance struct is IOMMUMemoryRegion, and its first member is a MemoryRegion. Correct. Its class struct is IOMMUMemoryRegionClass, and its first member is a DeviceClass. Wrong. Messed up when commit 1221a474676 introduced the QOM type. It even included hw/qdev-core.h just for that.

TYPE_MEMORY_REGION doesn't bother to define a class struct. This is fine, it simply defaults to its super-type TYPE_OBJECT's class struct ObjectClass. Changing IOMMUMemoryRegionClass's first member's type to ObjectClass would be a minimal fix, if a bit brittle: if TYPE_MEMORY_REGION ever acquired own class struct, we'd have to update IOMMUMemoryRegionClass to use it.

Fix it the clean and robust way instead: give TYPE_MEMORY_REGION its own class struct MemoryRegionClass now, and use it for IOMMUMemoryRegionClass's first member.

Quoted 6 lines

Revert the include of hw/qdev-core.h, and fix the few files that have come to rely on it.

Quoted 78 lines
---
 hw/display/vga-isa-mm.c | 1 +
 hw/net/pcnet.h          | 1 +
 include/exec/memory.h   | 9 +++++++--
 memory.c                | 1 +
 4 files changed, 10 insertions(+), 2 deletions(-)
hw/display/vga-isa-mm.c +1 -0
index 215e649719..a790f69b6d 100644
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qemu/bitops.h"
 #include "qemu/units.h"
 #include "hw/hw.h"
 #include "hw/display/vga.h"
hw/net/pcnet.h +1 -0
index 40831a7845..28d19a5c6f 100644
@@ -8,6 +8,7 @@
 #define PCNET_LOOPTEST_NOCRC	2
 
 #include "exec/memory.h"
+#include "hw/irq.h"
 
 /* BUS CONFIGURATION REGISTERS */
 #define BCR_MSRDA    0
include/exec/memory.h +7 -2
index bb0961ddb9..238370a2ff 100644
@@ -25,7 +25,6 @@
 #include "qemu/notify.h"
 #include "qom/object.h"
 #include "qemu/rcu.h"
-#include "hw/qdev-core.h"
 
 #define RAM_ADDR_INVALID (~(ram_addr_t)0)
 
@@ -205,6 +204,12 @@ struct MemoryRegionOps {
     } impl;
 };
 
+typedef struct MemoryRegionClass {
+    /* private */
+    ObjectClass parent_class;
+} MemoryRegionClass;
+
+
 enum IOMMUMemoryRegionAttr {
     IOMMU_ATTR_SPAPR_TCE_FD
 };
@@ -237,7 +242,7 @@ enum IOMMUMemoryRegionAttr {
  */
 typedef struct IOMMUMemoryRegionClass {
     /* private */
-    struct DeviceClass parent_class;
+    MemoryRegionClass parent_class;
 
     /*
      * Return a TLB entry that contains a given address.
memory.c +1 -0
index 5d8c9a9234..09d9b254fd 100644
@@ -3245,6 +3245,7 @@ void memory_region_init_rom_device(MemoryRegion *mr,
 static const TypeInfo memory_region_info = {
     .parent             = TYPE_OBJECT,
     .name               = TYPE_MEMORY_REGION,
+    .class_size         = sizeof(MemoryRegionClass),
     .instance_size      = sizeof(MemoryRegion),
     .instance_init      = memory_region_initfn,
     .instance_finalize  = memory_region_finalize,
Acked-by
#13 lore raw

Re: [Qemu-devel] [PATCH v2 04/29] memory: Fix type of IOMMUMemoryRegionClass member @parent_class

Quoted 19 lines · Philippe Mathieu-Daudé
Quoted 18 lines · Markus Armbruster

TYPE_IOMMU_MEMORY_REGION is a direct subtype of TYPE_MEMORY_REGION. Its instance struct is IOMMUMemoryRegion, and its first member is a MemoryRegion. Correct. Its class struct is IOMMUMemoryRegionClass, and its first member is a DeviceClass. Wrong. Messed up when commit 1221a474676 introduced the QOM type. It even included hw/qdev-core.h just for that.

TYPE_MEMORY_REGION doesn't bother to define a class struct. This is fine, it simply defaults to its super-type TYPE_OBJECT's class struct ObjectClass. Changing IOMMUMemoryRegionClass's first member's type to ObjectClass would be a minimal fix, if a bit brittle: if TYPE_MEMORY_REGION ever acquired own class struct, we'd have to update IOMMUMemoryRegionClass to use it.

Fix it the clean and robust way instead: give TYPE_MEMORY_REGION its own class struct MemoryRegionClass now, and use it for IOMMUMemoryRegionClass's first member.

Quoted 8 lines
Quoted 6 lines

Revert the include of hw/qdev-core.h, and fix the few files that have come to rely on it.

#14 lore raw

PATCH v2 5/29 queue: Drop superfluous #include qemu/atomic.h

In reply to Markus Armbruster

When commit 5f7d05ecfda added QLIST_INSERT_HEAD_RCU() to qemu/queue.h, it had to include qemu/atomic.h. Commit 341774fe6cc removed QLIST_INSERT_HEAD_RCU() again, but neglected to remove the #include. Do that now.

---
 include/qemu/queue.h | 2 --
 1 file changed, 2 deletions(-)
include/qemu/queue.h +0 -2
index 0379bd8fdb..73bf4a984d 100644
@@ -78,8 +78,6 @@
  * For details on the use of these macros, see the queue(3) manual page.
  */
 
-#include "qemu/atomic.h" /* for smp_wmb() */
-
 /*
  * List definitions.
  */
Signature · 1 line
2.21.0
Reviewed-by Tested-by on v2 5/29
#15 lore raw

Re: [Qemu-devel] [PATCH v2 05/29] queue: Drop superfluous #include qemu/atomic.h

Quoted 7 lines · Markus Armbruster

When commit 5f7d05ecfda added QLIST_INSERT_HEAD_RCU() to qemu/queue.h, it had to include qemu/atomic.h. Commit 341774fe6cc removed QLIST_INSERT_HEAD_RCU() again, but neglected to remove the #include. Do that now.

Quoted 18 lines
---
 include/qemu/queue.h | 2 --
 1 file changed, 2 deletions(-)
include/qemu/queue.h +0 -2
index 0379bd8fdb..73bf4a984d 100644
@@ -78,8 +78,6 @@
  * For details on the use of these macros, see the queue(3) manual page.
  */
 
-#include "qemu/atomic.h" /* for smp_wmb() */
-
 /*
  * List definitions.
  */
Reviewed-by on v2 5/29
#16 lore raw

Re: [Qemu-devel] [PATCH v2 05/29] queue: Drop superfluous #include qemu/atomic.h

In reply to Markus Armbruster
Quoted 7 lines · Markus Armbruster

When commit 5f7d05ecfda added QLIST_INSERT_HEAD_RCU() to qemu/queue.h, it had to include qemu/atomic.h. Commit 341774fe6cc removed QLIST_INSERT_HEAD_RCU() again, but neglected to remove the #include. Do that now.

Quoted 9 lines
---
 include/qemu/queue.h | 2 --
 1 file changed, 2 deletions(-)
include/qemu/queue.h +0 -0
index 0379bd8fdb..73bf4a984d 100644

include/qemu/queue.h line 83

Quoted 8 lines
include/qemu/queue.h +0 -2
@@ -78,8 +78,6 @@
  * For details on the use of these macros, see the queue(3) manual page.
  */
 
-#include "qemu/atomic.h" /* for smp_wmb() */
-
 /*
  * List definitions.
  */

--
Alex Bennée

#17 lore raw

PATCH v2 6/29 trace: Eliminate use of TARGET_FMT_plx

In reply to Markus Armbruster

hw/tpm/trace-events uses TARGET_FMT_plx formats with uint64_t arguments. That's wrong, TARGET_FMT_plx takes hwaddr. Since hwaddr happens to be uint64_t, it works anyway. Messed up in commit ec427498da5, v2.12.0. Clean up by replacing TARGET_FMT_plx with its macro expansion.

scripts/tracetool/format/log_stap.py (commit 62dd1048c0b, v4.0.0) has a special case for TARGET_FMT_plx. Delete it.

---
 hw/tpm/trace-events                  | 4 ++--
 scripts/tracetool/format/log_stap.py | 3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)
hw/tpm/trace-events +2 -2
index 0b94aa1526..25e47a595a 100644
@@ -1,8 +1,8 @@
 # See docs/devel/tracing.txt for syntax documentation.
 
 # tpm_crb.c
-tpm_crb_mmio_read(uint64_t addr, unsigned size, uint32_t val) "CRB read 0x" TARGET_FMT_plx " len:%u val: 0x%" PRIx32
-tpm_crb_mmio_write(uint64_t addr, unsigned size, uint32_t val) "CRB write 0x" TARGET_FMT_plx " len:%u val: 0x%" PRIx32
+tpm_crb_mmio_read(uint64_t addr, unsigned size, uint32_t val) "CRB read 0x016%" PRIx64 " len:%u val: 0x%" PRIx32
+tpm_crb_mmio_write(uint64_t addr, unsigned size, uint32_t val) "CRB write 0x%016" PRIx64 " len:%u val: 0x%" PRIx32
 
 # tpm_passthrough.c
 tpm_passthrough_handle_request(void *cmd) "processing command %p"
scripts/tracetool/format/log_stap.py +0 -3
index 3ccbc09d61..9ab0cf2cce 100644
@@ -30,9 +30,6 @@ def c_macro_to_format(macro):
     if macro.startswith("PRI"):
         return macro[3]
 
-    if macro == "TARGET_FMT_plx":
-        return "%016x"
-
     raise Exception("Unhandled macro '%s'" % macro)
 
 def c_fmt_to_stap(fmt):
Signature · 1 line
2.21.0
Reviewed-by on v2 6/29
#18 lore raw

Re: [Qemu-devel] [PATCH v2 06/29] trace: Eliminate use of TARGET_FMT_plx

Quoted 9 lines · Markus Armbruster

hw/tpm/trace-events uses TARGET_FMT_plx formats with uint64_t arguments. That's wrong, TARGET_FMT_plx takes hwaddr. Since hwaddr happens to be uint64_t, it works anyway. Messed up in commit ec427498da5, v2.12.0. Clean up by replacing TARGET_FMT_plx with its macro expansion.

scripts/tracetool/format/log_stap.py (commit 62dd1048c0b, v4.0.0) has a special case for TARGET_FMT_plx. Delete it.

Quoted 8 lines
---
 hw/tpm/trace-events                  | 4 ++--
 scripts/tracetool/format/log_stap.py | 3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)
#19 lore raw

PATCH v2 7/29 trace: Do not include qom/cpu.h into generated trace.h

In reply to Markus Armbruster

docs/devel/tracing.txt explains "since many source files include trace.h, [the generated trace.h use] a minimum of types and other header files included to keep the namespace clean and compile times and dependencies down."

Commit 4815185902 "trace: Add per-vCPU tracing states for events with the 'vcpu' property" made them all include qom/cpu.h via control-internal.h. qom/cpu.h in turn includes about thirty headers. Ouch.

Per-vCPU tracing is currently not supported in sub-directories' trace-events. In other words, qom/cpu.h can only be used in trace-root.h, not in any trace.h.

Split trace/control-vcpu.h off trace/control.h and trace/control-internal.h. Have the generated trace.h include trace/control.h (which no longer includes qom/cpu.h), and trace-root.h include trace/control-vcpu.h (which includes it).

The resulting improvement is a bit disappointing: in my "build everything" tree, some 1100 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h) depend on a trace.h, and about 600 of them no longer depend on qom/cpu.h. But more than 1300 others depend on trace-root.h. More work is clearly needed. Left for another day.

---
 block/block-backend.c         |  1 +
 qom/object.c                  |  1 +
 scripts/tracetool/format/c.py |  1 +
 scripts/tracetool/format/h.py |  7 +++-
 trace/control-internal.h      | 25 --------------
 trace/control-vcpu.h          | 63 +++++++++++++++++++++++++++++++++++
 trace/control.h               | 24 -------------
 trace/qmp.c                   |  2 +-
 ui/vnc.c                      |  1 +
 9 files changed, 74 insertions(+), 51 deletions(-)
 create mode 100644 trace/control-vcpu.h
block/block-backend.c +1 -0
index 0056b526b8..6aed80bf0b 100644
@@ -15,6 +15,7 @@
 #include "block/block_int.h"
 #include "block/blockjob.h"
 #include "block/throttle-groups.h"
+#include "hw/qdev-core.h"
 #include "sysemu/blockdev.h"
 #include "sysemu/sysemu.h"
 #include "qapi/error.h"
qom/object.c +1 -0
index 1555547727..6fa9c619fa 100644
@@ -11,6 +11,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/qdev-core.h"
 #include "qapi/error.h"
 #include "qom/object.h"
 #include "qom/object_interfaces.h"
scripts/tracetool/format/c.py +1 -0
index 833c05a022..31207961b0 100644
@@ -28,6 +28,7 @@ def generate(events, backend, group):
     out('/* This file is autogenerated by tracetool, do not edit. */',
         '',
         '#include "qemu/osdep.h"',
+        '#include "qemu/module.h"',
         '#include "%s"' % header,
         '')
 
scripts/tracetool/format/h.py +6 -1
index 338a2365ee..5596b304e6 100644
@@ -17,12 +17,17 @@ from tracetool import out
 
 
 def generate(events, backend, group):
+    if group == "root":
+        header = "trace/control-vcpu.h"
+    else:
+        header = "trace/control.h"
+
     out('/* This file is autogenerated by tracetool, do not edit. */',
         '',
         '#ifndef TRACE_%s_GENERATED_TRACERS_H' % group.upper(),
         '#define TRACE_%s_GENERATED_TRACERS_H' % group.upper(),
         '',
-        '#include "trace/control.h"',
+        '#include "%s"' % header,
         '')
 
     for e in events:
trace/control-internal.h +0 -25
index c7fbe2d3bf..8b2b50a7cf 100644
@@ -10,9 +10,6 @@
 #ifndef TRACE__CONTROL_INTERNAL_H
 #define TRACE__CONTROL_INTERNAL_H
 
-#include "qom/cpu.h"
-
-
 extern int trace_events_enabled_count;
 
 
@@ -59,28 +56,6 @@ static inline bool trace_event_get_state_dynamic(TraceEvent *ev)
     return unlikely(trace_events_enabled_count) && *ev->dstate;
 }
 
-static inline bool
-trace_event_get_vcpu_state_dynamic_by_vcpu_id(CPUState *vcpu,
-                                              uint32_t vcpu_id)
-{
-    /* it's on fast path, avoid consistency checks (asserts) */
-    if (unlikely(trace_events_enabled_count)) {
-        return test_bit(vcpu_id, vcpu->trace_dstate);
-    } else {
-        return false;
-    }
-}
-
-static inline bool trace_event_get_vcpu_state_dynamic(CPUState *vcpu,
-                                                      TraceEvent *ev)
-{
-    uint32_t vcpu_id;
-    assert(trace_event_is_vcpu(ev));
-    vcpu_id = trace_event_get_vcpu_id(ev);
-    return trace_event_get_vcpu_state_dynamic_by_vcpu_id(vcpu, vcpu_id);
-}
-
-
 void trace_event_register_group(TraceEvent **events);
 
 #endif /* TRACE__CONTROL_INTERNAL_H */
trace/control-vcpu.h new file +63 -0

63 lines not on this page · raw message

trace/control.h +0 -24
index 570492d6e8..1f81c491b6 100644
@@ -119,22 +119,6 @@ static const char * trace_event_get_name(TraceEvent *ev);
 #define trace_event_get_state_backends(id)              \
     ((id ##_ENABLED) && id ##_BACKEND_DSTATE())
 
-/**
- * trace_event_get_vcpu_state:
- * @vcpu: Target vCPU.
- * @id: Event identifier name.
- *
- * Get the tracing state of an event (both static and dynamic) for the given
- * vCPU.
- *
- * If the event has the disabled property, the check will have no performance
- * impact.
- */
-#define trace_event_get_vcpu_state(vcpu, id)                            \
-    ((id ##_ENABLED) &&                                                 \
-     trace_event_get_vcpu_state_dynamic_by_vcpu_id(                     \
-         vcpu, _ ## id ## _EVENT.vcpu_id))
-
 /**
  * trace_event_get_state_static:
  * @id: Event identifier.
@@ -155,14 +139,6 @@ static bool trace_event_get_state_static(TraceEvent *ev);
  */
 static bool trace_event_get_state_dynamic(TraceEvent *ev);
 
-/**
- * trace_event_get_vcpu_state_dynamic:
- *
- * Get the dynamic tracing state of an event for the given vCPU.
- */
-static bool trace_event_get_vcpu_state_dynamic(CPUState *vcpu, TraceEvent *ev);
-
-
 /**
  * trace_event_set_state_dynamic:
  *
trace/qmp.c +1 -1
index ea99b00956..38246e1aa6 100644
@@ -10,7 +10,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qapi/qapi-commands-trace.h"
-#include "control.h"
+#include "control-vcpu.h"
 
 
 static CPUState *get_cpu(bool has_vcpu, int vcpu, Error **errp)
ui/vnc.c +1 -0
index 38f92bfca3..f47f726681 100644
@@ -28,6 +28,7 @@
 #include "vnc.h"
 #include "vnc-jobs.h"
 #include "trace.h"
+#include "hw/qdev-core.h"
 #include "sysemu/sysemu.h"
 #include "qemu/error-report.h"
 #include "qemu/module.h"
Signature · 1 line
2.21.0
Reviewed-by on v2 7/29
#20 lore raw

Re: [Qemu-devel] [PATCH v2 07/29] trace: Do not include qom/cpu.h into generated trace.h

Quoted 28 lines · Markus Armbruster

docs/devel/tracing.txt explains "since many source files include trace.h, [the generated trace.h use] a minimum of types and other header files included to keep the namespace clean and compile times and dependencies down."

Commit 4815185902 "trace: Add per-vCPU tracing states for events with the 'vcpu' property" made them all include qom/cpu.h via control-internal.h. qom/cpu.h in turn includes about thirty headers. Ouch.

Per-vCPU tracing is currently not supported in sub-directories' trace-events. In other words, qom/cpu.h can only be used in trace-root.h, not in any trace.h.

Split trace/control-vcpu.h off trace/control.h and trace/control-internal.h. Have the generated trace.h include trace/control.h (which no longer includes qom/cpu.h), and trace-root.h include trace/control-vcpu.h (which includes it).

The resulting improvement is a bit disappointing: in my "build everything" tree, some 1100 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h) depend on a trace.h, and about 600 of them no longer depend on qom/cpu.h. But more than 1300 others depend on trace-root.h. More work is clearly needed. Left for another day.

Quoted 12 lines
---
 block/block-backend.c         |  1 +
 qom/object.c                  |  1 +
 scripts/tracetool/format/c.py |  1 +
 scripts/tracetool/format/h.py |  7 +++-
 trace/control-internal.h      | 25 --------------
 trace/control-vcpu.h          | 63 +++++++++++++++++++++++++++++++++++
 trace/control.h               | 24 -------------
 trace/qmp.c                   |  2 +-
 ui/vnc.c                      |  1 +
 9 files changed, 74 insertions(+), 51 deletions(-)
 create mode 100644 trace/control-vcpu.h
Reviewed-by Tested-by
#21 lore raw

Re: [Qemu-devel] [PATCH v2 07/29] trace: Do not include qom/cpu.h into generated trace.h

Quoted 42 lines · Stefan Hajnoczi
Quoted 28 lines · Markus Armbruster

docs/devel/tracing.txt explains "since many source files include trace.h, [the generated trace.h use] a minimum of types and other header files included to keep the namespace clean and compile times and dependencies down."

Commit 4815185902 "trace: Add per-vCPU tracing states for events with the 'vcpu' property" made them all include qom/cpu.h via control-internal.h. qom/cpu.h in turn includes about thirty headers. Ouch.

Per-vCPU tracing is currently not supported in sub-directories' trace-events. In other words, qom/cpu.h can only be used in trace-root.h, not in any trace.h.

Split trace/control-vcpu.h off trace/control.h and trace/control-internal.h. Have the generated trace.h include trace/control.h (which no longer includes qom/cpu.h), and trace-root.h include trace/control-vcpu.h (which includes it).

The resulting improvement is a bit disappointing: in my "build everything" tree, some 1100 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h) depend on a trace.h, and about 600 of them no longer depend on qom/cpu.h. But more than 1300 others depend on trace-root.h. More work is clearly needed. Left for another day.

Quoted 12 lines
---
 block/block-backend.c         |  1 +
 qom/object.c                  |  1 +
 scripts/tracetool/format/c.py |  1 +
 scripts/tracetool/format/h.py |  7 +++-
 trace/control-internal.h      | 25 --------------
 trace/control-vcpu.h          | 63 +++++++++++++++++++++++++++++++++++
 trace/control.h               | 24 -------------
 trace/qmp.c                   |  2 +-
 ui/vnc.c                      |  1 +
 9 files changed, 74 insertions(+), 51 deletions(-)
 create mode 100644 trace/control-vcpu.h
Quoted 1 line
#22 lore raw

PATCH v2 8/29 Include sysemu/reset.h a lot less

In reply to Markus Armbruster

In my "build everything" tree, changing sysemu/reset.h triggers a recompile of some 2600 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h).

The main culprit is hw/hw.h, which supposedly includes it for convenience.

Include sysemu/reset.h only where it's needed. Touching it now recompiles less than 200 objects.

---
 hw/acpi/ich9.c             | 2 ++
 hw/acpi/piix4.c            | 2 ++
 hw/acpi/vmgenid.c          | 1 +
 hw/arm/armv7m.c            | 1 +
 hw/arm/boot.c              | 1 +
 hw/arm/nseries.c           | 1 +
 hw/arm/omap1.c             | 1 +
 hw/arm/omap2.c             | 1 +
 hw/arm/virt-acpi-build.c   | 1 +
 hw/char/parallel.c         | 1 +
 hw/char/serial.c           | 1 +
 hw/core/generic-loader.c   | 1 +
 hw/core/loader.c           | 1 +
 hw/cris/boot.c             | 1 +
 hw/display/cirrus_vga.c    | 1 +
 hw/display/ramfb.c         | 2 ++
 hw/display/vga.c           | 2 ++
 hw/hppa/machine.c          | 1 +
 hw/i386/acpi-build.c       | 1 +
 hw/i386/pc.c               | 1 +
 hw/ide/cmd646.c            | 1 +
 hw/ide/piix.c              | 1 +
 hw/ide/sii3112.c           | 1 +
 hw/ide/via.c               | 1 +
 hw/input/lm832x.c          | 1 +
 hw/input/pckbd.c           | 2 ++
 hw/input/ps2.c             | 2 ++
 hw/input/tsc2005.c         | 1 +
 hw/input/tsc210x.c         | 1 +
 hw/intc/mips_gic.c         | 1 +
 hw/intc/pnv_xive.c         | 1 +
 hw/intc/spapr_xive.c       | 1 +
 hw/intc/xics.c             | 1 +
 hw/intc/xive.c             | 1 +
 hw/isa/piix4.c             | 1 +
 hw/isa/vt82c686.c          | 1 +
 hw/lm32/lm32_boards.c      | 1 +
 hw/lm32/milkymist.c        | 1 +
 hw/microblaze/boot.c       | 1 +
 hw/mips/cps.c              | 1 +
 hw/mips/mips_fulong2e.c    | 1 +
 hw/mips/mips_jazz.c        | 1 +
 hw/mips/mips_malta.c       | 1 +
 hw/mips/mips_mipssim.c     | 2 ++
 hw/mips/mips_r4k.c         | 2 ++
 hw/misc/vmcoreinfo.c       | 1 +
 hw/moxie/moxiesim.c        | 2 ++
 hw/net/eepro100.c          | 1 +
 hw/nios2/boot.c            | 1 +
 hw/nvram/fw_cfg.c          | 1 +
 hw/openrisc/openrisc_sim.c | 1 +
 hw/pci-host/bonito.c       | 1 +
 hw/pci-host/piix.c         | 1 +
 hw/ppc/e500.c              | 1 +
 hw/ppc/mac_newworld.c      | 1 +
 hw/ppc/mac_oldworld.c      | 1 +
 hw/ppc/pnv.c               | 1 +
 hw/ppc/pnv_core.c          | 1 +
 hw/ppc/pnv_psi.c           | 1 +
 hw/ppc/ppc405_boards.c     | 2 ++
 hw/ppc/ppc405_uc.c         | 2 ++
 hw/ppc/ppc440_bamboo.c     | 1 +
 hw/ppc/ppc440_uc.c         | 1 +
 hw/ppc/ppc4xx_devs.c       | 2 ++
 hw/ppc/ppc4xx_pci.c        | 1 +
 hw/ppc/ppc_booke.c         | 2 ++
 hw/ppc/prep.c              | 2 ++
 hw/ppc/sam460ex.c          | 1 +
 hw/ppc/spapr.c             | 1 +
 hw/ppc/spapr_cpu_core.c    | 2 ++
 hw/ppc/spapr_drc.c         | 1 +
 hw/ppc/virtex_ml507.c      | 1 +
 hw/riscv/riscv_hart.c      | 1 +
 hw/s390x/ipl.c             | 1 +
 hw/s390x/s390-virtio-ccw.c | 1 +
 hw/sh4/r2d.c               | 1 +
 hw/sparc/leon3.c           | 2 ++
 hw/sparc/sun4m.c           | 2 ++
 hw/sparc64/sparc64.c       | 1 +
 hw/timer/etraxfs_timer.c   | 1 +
 hw/timer/mc146818rtc.c     | 1 +
 hw/tpm/tpm_ppi.c           | 1 -
 hw/vfio/common.c           | 1 +
 hw/watchdog/wdt_diag288.c  | 1 +
 hw/xtensa/sim.c            | 1 +
 hw/xtensa/xtfpga.c         | 1 +
 include/hw/hw.h            | 1 -
 target/i386/cpu.c          | 1 +
 target/i386/hax-all.c      | 1 +
 target/i386/kvm.c          | 1 +
 target/s390x/cpu.c         | 1 +
 vl.c                       | 1 +
 92 files changed, 107 insertions(+), 2 deletions(-)
hw/acpi/ich9.c +2 -0
index e53dfe1ee3..b4d987c811 100644
@@ -23,6 +23,7 @@
  * Contributions after 2012-01-13 are licensed under the terms of the
  * GNU GPL, version 2 or (at your option) any later version.
  */
+
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "qapi/error.h"
@@ -30,6 +31,7 @@
 #include "hw/i386/pc.h"
 #include "hw/pci/pci.h"
 #include "qemu/timer.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "hw/acpi/acpi.h"
 #include "hw/acpi/tco.h"
hw/acpi/piix4.c +2 -0
index ec4e186cec..a59e58d937 100644
@@ -18,6 +18,7 @@
  * Contributions after 2012-01-13 are licensed under the terms of the
  * GNU GPL, version 2 or (at your option) any later version.
  */
+
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
@@ -25,6 +26,7 @@
 #include "hw/i2c/pm_smbus.h"
 #include "hw/pci/pci.h"
 #include "hw/acpi/acpi.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "qapi/error.h"
 #include "qemu/range.h"
hw/acpi/vmgenid.c +1 -0
index b891df375f..ed92ccc4b8 100644
@@ -18,6 +18,7 @@
 #include "hw/acpi/aml-build.h"
 #include "hw/acpi/vmgenid.h"
 #include "hw/nvram/fw_cfg.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 
 void vmgenid_build_acpi(VmGenIdState *vms, GArray *table_data, GArray *guid,
hw/arm/armv7m.c +1 -0
index b9efad6bac..4b2d8b6574 100644
@@ -16,6 +16,7 @@
 #include "hw/loader.h"
 #include "elf.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "qemu/error-report.h"
 #include "qemu/module.h"
 #include "exec/address-spaces.h"
hw/arm/boot.c +1 -0
index c2b89b3bb9..d082daf6f2 100644
@@ -18,6 +18,7 @@
 #include "sysemu/kvm.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/numa.h"
+#include "sysemu/reset.h"
 #include "hw/boards.h"
 #include "hw/loader.h"
 #include "elf.h"
hw/arm/nseries.c +1 -0
index 4a79f5c88b..3f3eca52e2 100644
@@ -23,6 +23,7 @@
 #include "cpu.h"
 #include "qemu/cutils.h"
 #include "qemu/bswap.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "hw/arm/omap.h"
 #include "hw/arm/boot.h"
hw/arm/omap1.c +1 -0
index 28fbe275a8..beaddaf11f 100644
@@ -29,6 +29,7 @@
 #include "sysemu/sysemu.h"
 #include "hw/arm/soc_dma.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "qemu/range.h"
 #include "hw/sysbus.h"
 #include "qemu/cutils.h"
hw/arm/omap2.c +1 -0
index 87ced7f3a2..7d4cac1f46 100644
@@ -23,6 +23,7 @@
 #include "qapi/error.h"
 #include "cpu.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "hw/boards.h"
 #include "hw/hw.h"
 #include "hw/arm/boot.h"
hw/arm/virt-acpi-build.c +1 -0
index 0afb372769..ad54d65ea0 100644
@@ -44,6 +44,7 @@
 #include "hw/pci/pci.h"
 #include "hw/arm/virt.h"
 #include "sysemu/numa.h"
+#include "sysemu/reset.h"
 #include "kvm_arm.h"
 
 #define ARM_SPI_BASE 32
hw/char/parallel.c +1 -0
index 1cd4c54a02..fed15dc548 100644
@@ -31,6 +31,7 @@
 #include "chardev/char-fe.h"
 #include "hw/isa/isa.h"
 #include "hw/char/parallel.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "trace.h"
 
hw/char/serial.c +1 -0
index 7c42a2abfc..a9e42f7d97 100644
@@ -28,6 +28,7 @@
 #include "chardev/char-serial.h"
 #include "qapi/error.h"
 #include "qemu/timer.h"
+#include "sysemu/reset.h"
 #include "qemu/error-report.h"
 #include "trace.h"
 
hw/core/generic-loader.c +1 -0
index 79a493e577..579fe5ed32 100644
@@ -34,6 +34,7 @@
 #include "qom/cpu.h"
 #include "hw/sysbus.h"
 #include "sysemu/dma.h"
+#include "sysemu/reset.h"
 #include "hw/loader.h"
 #include "qapi/error.h"
 #include "qemu/module.h"
hw/core/loader.c +1 -0
index 425bf69a99..830845dd73 100644
@@ -48,6 +48,7 @@
 #include "hw/hw.h"
 #include "disas/disas.h"
 #include "monitor/monitor.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "uboot_image.h"
 #include "hw/loader.h"
hw/cris/boot.c +1 -0
index 602f538ef6..d44fdec43f 100644
@@ -29,6 +29,7 @@
 #include "elf.h"
 #include "boot.h"
 #include "qemu/cutils.h"
+#include "sysemu/reset.h"
 
 static void main_cpu_reset(void *opaque)
 {
hw/display/cirrus_vga.c +1 -0
index 2e4911a1e3..4ccf5b4f18 100644
@@ -35,6 +35,7 @@
 #include "qemu/osdep.h"
 #include "qemu/module.h"
 #include "qemu/units.h"
+#include "sysemu/reset.h"
 #include "qapi/error.h"
 #include "trace.h"
 #include "hw/hw.h"
hw/display/ramfb.c +2 -0
index b4eb283ef8..6026a35b11 100644
@@ -10,12 +10,14 @@
  * This work is licensed under the terms of the GNU GPL, version 2 or later.
  * See the COPYING file in the top-level directory.
  */
+
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qemu/option.h"
 #include "hw/loader.h"
 #include "hw/display/ramfb.h"
 #include "ui/console.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 
 struct QEMU_PACKED RAMFBCfg {
hw/display/vga.c +2 -0
index 910a23c12e..4d3572891a 100644
@@ -21,8 +21,10 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "qemu/units.h"
+#include "sysemu/reset.h"
 #include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/display/vga.h"
hw/hppa/machine.c +1 -0
index 662838d83b..bc74438496 100644
@@ -11,6 +11,7 @@
 #include "hw/loader.h"
 #include "hw/boards.h"
 #include "qemu/error-report.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "hw/timer/mc146818rtc.h"
 #include "hw/ide.h"
hw/i386/acpi-build.c +1 -0
index f3fdfefcd5..74667a53be 100644
@@ -48,6 +48,7 @@
 #include "hw/timer/mc146818rtc_regs.h"
 #include "hw/mem/memory-device.h"
 #include "sysemu/numa.h"
+#include "sysemu/reset.h"
 
 /* Supported chipsets: */
 #include "hw/acpi/piix4.h"
hw/i386/pc.c +1 -0
index 549c437050..73b55500b0 100644
@@ -54,6 +54,7 @@
 #include "sysemu/numa.h"
 #include "sysemu/kvm.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "kvm_i386.h"
 #include "hw/xen/xen.h"
 #include "hw/xen/start_info.h"
hw/ide/cmd646.c +1 -0
index ed23aabf21..e5542c9811 100644
@@ -30,6 +30,7 @@
 #include "hw/isa/isa.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/dma.h"
+#include "sysemu/reset.h"
 
 #include "hw/ide/pci.h"
 #include "trace.h"
hw/ide/piix.c +1 -0
index b97e555072..c4c6d4b760 100644
@@ -31,6 +31,7 @@
 #include "sysemu/sysemu.h"
 #include "sysemu/blockdev.h"
 #include "sysemu/dma.h"
+#include "sysemu/reset.h"
 
 #include "hw/ide/pci.h"
 #include "trace.h"
hw/ide/sii3112.c +1 -0
index d7590d4ba4..2181260531 100644
@@ -15,6 +15,7 @@
 #include "qemu/osdep.h"
 #include "hw/ide/pci.h"
 #include "qemu/module.h"
+#include "sysemu/reset.h"
 #include "trace.h"
 
 #define TYPE_SII3112_PCI "sii3112"
hw/ide/via.c +1 -0
index c3bda909f9..6d54ac55f0 100644
@@ -30,6 +30,7 @@
 #include "qemu/module.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/dma.h"
+#include "sysemu/reset.h"
 
 #include "hw/ide/pci.h"
 #include "trace.h"
hw/input/lm832x.c +1 -0
index 5203da2bcf..ebb72c6590 100644
@@ -23,6 +23,7 @@
 #include "hw/i2c/i2c.h"
 #include "qemu/module.h"
 #include "qemu/timer.h"
+#include "sysemu/reset.h"
 #include "ui/console.h"
 
 #define TYPE_LM8323 "lm8323"
hw/input/pckbd.c +2 -0
index 47a606f5e3..5d06a53362 100644
@@ -21,6 +21,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "qemu/log.h"
 #include "hw/hw.h"
@@ -28,6 +29,7 @@
 #include "hw/i386/pc.h"
 #include "hw/input/ps2.h"
 #include "hw/input/i8042.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 
 #include "trace.h"
hw/input/ps2.c +2 -0
index d3161f1e7c..8d922b05c9 100644
@@ -21,12 +21,14 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "qemu/log.h"
 #include "hw/hw.h"
 #include "hw/input/ps2.h"
 #include "ui/console.h"
 #include "ui/input.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 
 #include "trace.h"
hw/input/tsc2005.c +1 -0
index f82771e7a7..0a0431744c 100644
@@ -22,6 +22,7 @@
 #include "qemu/log.h"
 #include "hw/hw.h"
 #include "qemu/timer.h"
+#include "sysemu/reset.h"
 #include "ui/console.h"
 #include "hw/input/tsc2xxx.h"
 #include "trace.h"
hw/input/tsc210x.c +1 -0
index f94cb4683b..d2486f4b4e 100644
@@ -23,6 +23,7 @@
 #include "hw/hw.h"
 #include "audio/audio.h"
 #include "qemu/timer.h"
+#include "sysemu/reset.h"
 #include "ui/console.h"
 #include "hw/arm/omap.h"            /* For I2SCodec */
 #include "hw/input/tsc2xxx.h"
hw/intc/mips_gic.c +1 -0
index 33ab51c5b8..e27e333766 100644
@@ -18,6 +18,7 @@
 #include "exec/memory.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/kvm.h"
+#include "sysemu/reset.h"
 #include "kvm_mips.h"
 #include "hw/intc/mips_gic.h"
 
hw/intc/pnv_xive.c +1 -0
index 4dc92ef1e3..63b0f461ec 100644
@@ -14,6 +14,7 @@
 #include "target/ppc/cpu.h"
 #include "sysemu/cpus.h"
 #include "sysemu/dma.h"
+#include "sysemu/reset.h"
 #include "monitor/monitor.h"
 #include "hw/ppc/fdt.h"
 #include "hw/ppc/pnv.h"
hw/intc/spapr_xive.c +1 -0
index 3ae311d9ff..2e39cc1e47 100644
@@ -14,6 +14,7 @@
 #include "qemu/error-report.h"
 #include "target/ppc/cpu.h"
 #include "sysemu/cpus.h"
+#include "sysemu/reset.h"
 #include "monitor/monitor.h"
 #include "hw/ppc/fdt.h"
 #include "hw/ppc/spapr.h"
hw/intc/xics.c +1 -0
index faa976e2f8..9ed224ce5f 100644
@@ -38,6 +38,7 @@
 #include "monitor/monitor.h"
 #include "hw/intc/intc.h"
 #include "sysemu/kvm.h"
+#include "sysemu/reset.h"
 
 void icp_pic_print_info(ICPState *icp, Monitor *mon)
 {
hw/intc/xive.c +1 -0
index cf77bdb7d3..b27d6b8646 100644
@@ -14,6 +14,7 @@
 #include "target/ppc/cpu.h"
 #include "sysemu/cpus.h"
 #include "sysemu/dma.h"
+#include "sysemu/reset.h"
 #include "hw/qdev-properties.h"
 #include "monitor/monitor.h"
 #include "hw/ppc/xive.h"
hw/isa/piix4.c +1 -0
index 6b8bc3faf0..3677976ef7 100644
@@ -28,6 +28,7 @@
 #include "hw/pci/pci.h"
 #include "hw/isa/isa.h"
 #include "hw/sysbus.h"
+#include "sysemu/reset.h"
 
 PCIDevice *piix4_dev;
 
hw/isa/vt82c686.c +1 -0
index 12c460590f..81bffb1fb9 100644
@@ -22,6 +22,7 @@
 #include "hw/isa/apm.h"
 #include "hw/acpi/acpi.h"
 #include "hw/i2c/pm_smbus.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "qemu/module.h"
 #include "qemu/timer.h"
hw/lm32/lm32_boards.c +1 -0
index fb9d52d54f..e075ebc8a6 100644
@@ -30,6 +30,7 @@
 #include "lm32_hwsetup.h"
 #include "lm32.h"
 #include "exec/address-spaces.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 
 typedef struct {
hw/lm32/milkymist.c +1 -0
index 689e633199..33669ee19b 100644
@@ -27,6 +27,7 @@
 #include "hw/block/flash.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "hw/boards.h"
 #include "hw/loader.h"
 #include "elf.h"
hw/microblaze/boot.c +1 -0
index a7af4c0704..bade4d22c0 100644
@@ -31,6 +31,7 @@
 #include "qemu/config-file.h"
 #include "qemu/error-report.h"
 #include "sysemu/device_tree.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "hw/loader.h"
 #include "elf.h"
hw/mips/cps.c +1 -0
index 0d459c4141..aea6bcd7fe 100644
@@ -24,6 +24,7 @@
 #include "hw/mips/mips.h"
 #include "hw/mips/cpudevs.h"
 #include "sysemu/kvm.h"
+#include "sysemu/reset.h"
 
 qemu_irq get_cps_irq(MIPSCPSState *s, int pin_number)
 {
hw/mips/mips_fulong2e.c +1 -0
index 5dbaa3bfcc..0a1bf5ef5c 100644
@@ -44,6 +44,7 @@
 #include "hw/timer/i8254.h"
 #include "exec/address-spaces.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "qemu/error-report.h"
 
 #define DEBUG_FULONG2E_INIT
hw/mips/mips_jazz.c +1 -0
index fa8775d428..6ea25cd5f4 100644
@@ -48,6 +48,7 @@
 #include "hw/sysbus.h"
 #include "exec/address-spaces.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "qemu/help_option.h"
hw/mips/mips_malta.c +1 -0
index 20e019bf66..29bc8de5cf 100644
@@ -51,6 +51,7 @@
 #include "hw/sysbus.h"             /* SysBusDevice */
 #include "qemu/host-utils.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "hw/empty_slot.h"
hw/mips/mips_mipssim.c +2 -0
index 824abda657..280e76a482 100644
@@ -24,6 +24,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qemu-common.h"
@@ -43,6 +44,7 @@
 #include "exec/address-spaces.h"
 #include "qemu/error-report.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 
 static struct _loaderparams {
     int ram_size;
hw/mips/mips_r4k.c +2 -0
index 93dbf76bb4..191047826d 100644
@@ -7,6 +7,7 @@
  * All peripherial devices are attached to this "bus" with
  * the standard PC ISA addresses.
 */
+
 #include "qemu/osdep.h"
 #include "qemu/units.h"
 #include "qapi/error.h"
@@ -33,6 +34,7 @@
 #include "hw/timer/i8254.h"
 #include "exec/address-spaces.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "qemu/error-report.h"
 
 #define MAX_IDE_BUS 2
hw/misc/vmcoreinfo.c +1 -0
index 987d6f52af..49e87d462b 100644
@@ -13,6 +13,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qemu/module.h"
+#include "sysemu/reset.h"
 #include "hw/nvram/fw_cfg.h"
 #include "hw/misc/vmcoreinfo.h"
 
hw/moxie/moxiesim.c +2 -0
index d771d393c2..16a7d58274 100644
@@ -24,6 +24,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "qemu/error-report.h"
 #include "qapi/error.h"
@@ -31,6 +32,7 @@
 #include "hw/sysbus.h"
 #include "hw/hw.h"
 #include "net/net.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "hw/boards.h"
 #include "hw/loader.h"
hw/net/eepro100.c +1 -0
index 6607c9142d..e0cf0c46d7 100644
@@ -49,6 +49,7 @@
 #include "hw/nvram/eeprom93xx.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/dma.h"
+#include "sysemu/reset.h"
 #include "qemu/bitops.h"
 #include "qemu/module.h"
 #include "qapi/error.h"
hw/nios2/boot.c +1 -0
index 276068c842..d78bc9ed0e 100644
@@ -36,6 +36,7 @@
 #include "qemu/config-file.h"
 #include "qemu/error-report.h"
 #include "sysemu/device_tree.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "hw/loader.h"
 #include "elf.h"
hw/nvram/fw_cfg.c +1 -0
index dcfd6d2ed3..3032f1c65f 100644
@@ -27,6 +27,7 @@
 #include "hw/hw.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/dma.h"
+#include "sysemu/reset.h"
 #include "hw/boards.h"
 #include "hw/nvram/fw_cfg.h"
 #include "hw/sysbus.h"
hw/openrisc/openrisc_sim.c +1 -0
index b85f0df323..cb2fc5ba78 100644
@@ -32,6 +32,7 @@
 #include "sysemu/sysemu.h"
 #include "hw/sysbus.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 
 #define KERNEL_LOAD_ADDR 0x100
 
hw/pci-host/bonito.c +1 -0
index dde4437595..36c7ca45ad 100644
@@ -44,6 +44,7 @@
 #include "hw/i386/pc.h"
 #include "hw/mips/mips.h"
 #include "hw/pci/pci_host.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "exec/address-spaces.h"
 
hw/pci-host/piix.c +1 -0
index d9c70f7ce6..f3671d28b7 100644
@@ -33,6 +33,7 @@
 #include "qemu/range.h"
 #include "hw/xen/xen.h"
 #include "hw/pci-host/pam.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "hw/i386/ioapic.h"
 #include "qapi/visitor.h"
hw/ppc/e500.c +1 -0
index a3eac7f057..566f179bb1 100644
@@ -28,6 +28,7 @@
 #include "hw/boards.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/kvm.h"
+#include "sysemu/reset.h"
 #include "kvm_ppc.h"
 #include "sysemu/device_tree.h"
 #include "hw/ppc/openpic.h"
hw/ppc/mac_newworld.c +1 -0
index 09bc6068f3..0f9f351eb1 100644
@@ -68,6 +68,7 @@
 #include "elf.h"
 #include "qemu/error-report.h"
 #include "sysemu/kvm.h"
+#include "sysemu/reset.h"
 #include "kvm_ppc.h"
 #include "hw/usb.h"
 #include "exec/address-spaces.h"
hw/ppc/mac_oldworld.c +1 -0
index 9ffde5b6f7..6640057473 100644
@@ -47,6 +47,7 @@
 #include "elf.h"
 #include "qemu/error-report.h"
 #include "sysemu/kvm.h"
+#include "sysemu/reset.h"
 #include "kvm_ppc.h"
 #include "exec/address-spaces.h"
 
hw/ppc/pnv.c +1 -0
index bd4531c822..96608883aa 100644
@@ -23,6 +23,7 @@
 #include "qapi/error.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/numa.h"
+#include "sysemu/reset.h"
 #include "sysemu/cpus.h"
 #include "sysemu/device_tree.h"
 #include "hw/hw.h"
hw/ppc/pnv_core.c +1 -0
index c6411ecc1d..ff477ba6c9 100644
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "qapi/error.h"
 #include "qemu/log.h"
hw/ppc/pnv_psi.c +1 -0
index d7b6f5d75b..6b26d0f6bc 100644
@@ -22,6 +22,7 @@
 #include "target/ppc/cpu.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
+#include "sysemu/reset.h"
 #include "qapi/error.h"
 #include "monitor/monitor.h"
 
hw/ppc/ppc405_boards.c +2 -0
index 13318a9faf..5b278e7791 100644
@@ -21,6 +21,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "qemu/units.h"
 #include "qapi/error.h"
@@ -33,6 +34,7 @@
 #include "hw/block/flash.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "sysemu/block-backend.h"
 #include "hw/boards.h"
 #include "qemu/log.h"
hw/ppc/ppc405_uc.c +2 -0
index edb6b2d190..f9d98fe71e 100644
@@ -21,6 +21,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "qemu/units.h"
 #include "qapi/error.h"
@@ -32,6 +33,7 @@
 #include "ppc405.h"
 #include "hw/char/serial.h"
 #include "qemu/timer.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "qemu/log.h"
 #include "exec/address-spaces.h"
hw/ppc/ppc440_bamboo.c +1 -0
index b4da099e3e..1bd92aa749 100644
@@ -31,6 +31,7 @@
 #include "ppc405.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "hw/sysbus.h"
 
 #define BINARY_DEVICE_TREE_FILE "bamboo.dtb"
hw/ppc/ppc440_uc.c +1 -0
index 5c1a53d6e7..7329cfe651 100644
@@ -21,6 +21,7 @@
 #include "hw/ppc/ppc.h"
 #include "hw/pci/pci.h"
 #include "sysemu/block-backend.h"
+#include "sysemu/reset.h"
 #include "ppc440.h"
 
 /*****************************************************************************/
hw/ppc/ppc4xx_devs.c +2 -0
index fdfeb67e65..e62bef3b8d 100644
@@ -21,8 +21,10 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "qemu/units.h"
+#include "sysemu/reset.h"
 #include "cpu.h"
 #include "hw/hw.h"
 #include "hw/ppc/ppc.h"
hw/ppc/ppc4xx_pci.c +1 -0
index e7cf8d50a5..b013319c60 100644
@@ -24,6 +24,7 @@
 #include "hw/ppc/ppc.h"
 #include "hw/ppc/ppc4xx.h"
 #include "qemu/module.h"
+#include "sysemu/reset.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_host.h"
 #include "exec/address-spaces.h"
hw/ppc/ppc_booke.c +2 -0
index 18d1457581..ba5f513ca5 100644
@@ -21,11 +21,13 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "hw/hw.h"
 #include "hw/ppc/ppc.h"
 #include "qemu/timer.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "qemu/log.h"
 #include "hw/loader.h"
hw/ppc/prep.c +2 -0
index ab3c1df1fc..84e968e28c 100644
@@ -22,6 +22,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "hw/hw.h"
@@ -45,6 +46,7 @@
 #include "sysemu/arch_init.h"
 #include "sysemu/kvm.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "exec/address-spaces.h"
 #include "trace.h"
 #include "elf.h"
hw/ppc/sam460ex.c +1 -0
index fbcddc5b00..c1d6f74d5b 100644
@@ -31,6 +31,7 @@
 #include "hw/block/flash.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "hw/sysbus.h"
 #include "hw/char/serial.h"
 #include "hw/i2c/ppc4xx_i2c.h"
hw/ppc/spapr.c +1 -0
index 821f0d4a49..5cade1a374 100644
@@ -31,6 +31,7 @@
 #include "sysemu/sysemu.h"
 #include "sysemu/numa.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "hw/hw.h"
 #include "qemu/log.h"
 #include "hw/fw-path-provider.h"
hw/ppc/spapr_cpu_core.c +2 -0
index 5621fb9a3d..ccc8970c7c 100644
@@ -6,6 +6,7 @@
  * This work is licensed under the terms of the GNU GPL, version 2 or later.
  * See the COPYING file in the top-level directory.
  */
+
 #include "qemu/osdep.h"
 #include "hw/cpu/core.h"
 #include "hw/ppc/spapr_cpu_core.h"
@@ -19,6 +20,7 @@
 #include "hw/ppc/ppc.h"
 #include "target/ppc/mmu-hash64.h"
 #include "sysemu/numa.h"
+#include "sysemu/reset.h"
 #include "sysemu/hw_accel.h"
 #include "qemu/error-report.h"
 
hw/ppc/spapr_drc.c +1 -0
index bacadfcac5..678493a9c5 100644
@@ -23,6 +23,7 @@
 #include "hw/ppc/spapr.h" /* for RTAS return codes */
 #include "hw/pci-host/spapr.h" /* spapr_phb_remove_pci_device_cb callback */
 #include "sysemu/device_tree.h"
+#include "sysemu/reset.h"
 #include "trace.h"
 
 #define DRC_CONTAINER_PATH "/dr-connector"
hw/ppc/virtex_ml507.c +1 -0
index 834053a7d2..06f5a28601 100644
@@ -32,6 +32,7 @@
 #include "hw/block/flash.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "hw/boards.h"
 #include "sysemu/device_tree.h"
 #include "hw/loader.h"
hw/riscv/riscv_hart.c +1 -0
index ca69a1bcd8..61bd4d5170 100644
@@ -21,6 +21,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qemu/module.h"
+#include "sysemu/reset.h"
 #include "hw/sysbus.h"
 #include "target/riscv/cpu.h"
 #include "hw/riscv/riscv_hart.h"
hw/s390x/ipl.c +1 -0
index 60bd081d3e..2e5ce11a6b 100644
@@ -14,6 +14,7 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qapi/error.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/tcg.h"
 #include "cpu.h"
hw/s390x/s390-virtio-ccw.c +1 -0
index 5b6a9a4e55..4ffdd53a85 100644
@@ -27,6 +27,7 @@
 #include "qemu/error-report.h"
 #include "qemu/option.h"
 #include "s390-pci-bus.h"
+#include "sysemu/reset.h"
 #include "hw/s390x/storage-keys.h"
 #include "hw/s390x/storage-attributes.h"
 #include "hw/s390x/event-facility.h"
hw/sh4/r2d.c +1 -0
index f22c79c867..da79bf0337 100644
@@ -30,6 +30,7 @@
 #include "hw/sysbus.h"
 #include "hw/hw.h"
 #include "hw/sh4/sh.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "hw/boards.h"
 #include "hw/pci/pci.h"
hw/sparc/leon3.c +2 -0
index 19cedebd16..c7ddfa2cfe 100644
@@ -21,6 +21,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "qemu/units.h"
 #include "qemu/error-report.h"
@@ -32,6 +33,7 @@
 #include "hw/ptimer.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "hw/boards.h"
 #include "hw/loader.h"
 #include "elf.h"
hw/sparc/sun4m.c +2 -0
index b2342f2a89..93a69c12fb 100644
@@ -21,6 +21,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "qemu/units.h"
 #include "qapi/error.h"
@@ -33,6 +34,7 @@
 #include "hw/timer/m48t59.h"
 #include "hw/sparc/sparc32_dma.h"
 #include "hw/block/fdc.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "net/net.h"
 #include "hw/boards.h"
hw/sparc64/sparc64.c +1 -0
index 689801f37d..100b2fab17 100644
@@ -28,6 +28,7 @@
 #include "hw/char/serial.h"
 #include "hw/sparc/sparc64.h"
 #include "qemu/timer.h"
+#include "sysemu/reset.h"
 #include "trace.h"
 
 
hw/timer/etraxfs_timer.c +1 -0
index 53834e197f..18887b2be2 100644
@@ -24,6 +24,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "qemu/module.h"
 #include "qemu/timer.h"
hw/timer/mc146818rtc.c +1 -0
index ce4550b6f2..21fcba5e3a 100644
@@ -31,6 +31,7 @@
 #include "qemu/timer.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/replay.h"
+#include "sysemu/reset.h"
 #include "hw/timer/mc146818rtc.h"
 #include "qapi/error.h"
 #include "qapi/qapi-commands-misc-target.h"
hw/tpm/tpm_ppi.c +0 -1
index cd8205f212..ff314592b4 100644
@@ -16,7 +16,6 @@
 #include "qapi/error.h"
 #include "cpu.h"
 #include "sysemu/memory_mapping.h"
-#include "sysemu/reset.h"
 #include "migration/vmstate.h"
 #include "tpm_ppi.h"
 #include "trace.h"
hw/vfio/common.c +1 -0
index a859298fda..a363b4495f 100644
@@ -34,6 +34,7 @@
 #include "qemu/range.h"
 #include "sysemu/balloon.h"
 #include "sysemu/kvm.h"
+#include "sysemu/reset.h"
 #include "trace.h"
 #include "qapi/error.h"
 
hw/watchdog/wdt_diag288.c +1 -0
index 29e5b5dcf6..fec046ef09 100644
@@ -12,6 +12,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "sysemu/reset.h"
 #include "sysemu/watchdog.h"
 #include "hw/sysbus.h"
 #include "qemu/timer.h"
hw/xtensa/sim.c +1 -0
index 09165b6f4d..981dbb7bbe 100644
@@ -28,6 +28,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "cpu.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "hw/boards.h"
 #include "hw/loader.h"
hw/xtensa/xtfpga.c +1 -0
index f7f3e11e93..0a2cce3c64 100644
@@ -41,6 +41,7 @@
 #include "hw/block/flash.h"
 #include "chardev/char.h"
 #include "sysemu/device_tree.h"
+#include "sysemu/reset.h"
 #include "qemu/error-report.h"
 #include "qemu/option.h"
 #include "bootparam.h"
include/hw/hw.h +0 -1
index b1b79964b5..a4fb2390e8 100644
@@ -12,7 +12,6 @@
 #include "hw/irq.h"
 #include "migration/vmstate.h"
 #include "migration/qemu-file-types.h"
-#include "sysemu/reset.h"
 
 void QEMU_NORETURN hw_error(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
 
target/i386/cpu.c +1 -0
index 19751e37a7..80f1443110 100644
@@ -26,6 +26,7 @@
 #include "cpu.h"
 #include "exec/exec-all.h"
 #include "sysemu/kvm.h"
+#include "sysemu/reset.h"
 #include "sysemu/hvf.h"
 #include "sysemu/cpus.h"
 #include "kvm_i386.h"
target/i386/hax-all.c +1 -0
index 9e7b77965d..bcacdd1d8f 100644
@@ -30,6 +30,7 @@
 #include "qemu-common.h"
 #include "hax-i386.h"
 #include "sysemu/accel.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "qemu/main-loop.h"
 #include "hw/boards.h"
target/i386/kvm.c +1 -0
index dbbb13772a..30ed209e6b 100644
@@ -24,6 +24,7 @@
 #include "sysemu/sysemu.h"
 #include "sysemu/hw_accel.h"
 #include "sysemu/kvm_int.h"
+#include "sysemu/reset.h"
 #include "kvm_i386.h"
 #include "hyperv.h"
 #include "hyperv-proto.h"
target/s390x/cpu.c +1 -0
index 736a7903e2..3caba8d5e1 100644
@@ -26,6 +26,7 @@
 #include "internal.h"
 #include "kvm_s390x.h"
 #include "sysemu/kvm.h"
+#include "sysemu/reset.h"
 #include "qemu/timer.h"
 #include "qemu/error-report.h"
 #include "qemu/module.h"
vl.c +1 -0
index b426b32134..1abfd306e3 100644
@@ -30,6 +30,7 @@
 #include "qemu/cutils.h"
 #include "qemu/help_option.h"
 #include "qemu/uuid.h"
+#include "sysemu/reset.h"
 #include "sysemu/seccomp.h"
 #include "sysemu/tcg.h"
 
Signature · 1 line
2.21.0
Tested-by on v2 8/29
#23 lore raw

Re: [Qemu-devel] [PATCH v2 08/29] Include sysemu/reset.h a lot less

Quoted 7 lines · Markus Armbruster

In my "build everything" tree, changing sysemu/reset.h triggers a recompile of some 2600 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h).

The main culprit is hw/hw.h, which supposedly includes it for convenience.

Quoted 6 lines

Include sysemu/reset.h only where it's needed. Touching it now recompiles less than 200 objects.

Quoted 1,322 lines
---
 hw/acpi/ich9.c             | 2 ++
 hw/acpi/piix4.c            | 2 ++
 hw/acpi/vmgenid.c          | 1 +
 hw/arm/armv7m.c            | 1 +
 hw/arm/boot.c              | 1 +
 hw/arm/nseries.c           | 1 +
 hw/arm/omap1.c             | 1 +
 hw/arm/omap2.c             | 1 +
 hw/arm/virt-acpi-build.c   | 1 +
 hw/char/parallel.c         | 1 +
 hw/char/serial.c           | 1 +
 hw/core/generic-loader.c   | 1 +
 hw/core/loader.c           | 1 +
 hw/cris/boot.c             | 1 +
 hw/display/cirrus_vga.c    | 1 +
 hw/display/ramfb.c         | 2 ++
 hw/display/vga.c           | 2 ++
 hw/hppa/machine.c          | 1 +
 hw/i386/acpi-build.c       | 1 +
 hw/i386/pc.c               | 1 +
 hw/ide/cmd646.c            | 1 +
 hw/ide/piix.c              | 1 +
 hw/ide/sii3112.c           | 1 +
 hw/ide/via.c               | 1 +
 hw/input/lm832x.c          | 1 +
 hw/input/pckbd.c           | 2 ++
 hw/input/ps2.c             | 2 ++
 hw/input/tsc2005.c         | 1 +
 hw/input/tsc210x.c         | 1 +
 hw/intc/mips_gic.c         | 1 +
 hw/intc/pnv_xive.c         | 1 +
 hw/intc/spapr_xive.c       | 1 +
 hw/intc/xics.c             | 1 +
 hw/intc/xive.c             | 1 +
 hw/isa/piix4.c             | 1 +
 hw/isa/vt82c686.c          | 1 +
 hw/lm32/lm32_boards.c      | 1 +
 hw/lm32/milkymist.c        | 1 +
 hw/microblaze/boot.c       | 1 +
 hw/mips/cps.c              | 1 +
 hw/mips/mips_fulong2e.c    | 1 +
 hw/mips/mips_jazz.c        | 1 +
 hw/mips/mips_malta.c       | 1 +
 hw/mips/mips_mipssim.c     | 2 ++
 hw/mips/mips_r4k.c         | 2 ++
 hw/misc/vmcoreinfo.c       | 1 +
 hw/moxie/moxiesim.c        | 2 ++
 hw/net/eepro100.c          | 1 +
 hw/nios2/boot.c            | 1 +
 hw/nvram/fw_cfg.c          | 1 +
 hw/openrisc/openrisc_sim.c | 1 +
 hw/pci-host/bonito.c       | 1 +
 hw/pci-host/piix.c         | 1 +
 hw/ppc/e500.c              | 1 +
 hw/ppc/mac_newworld.c      | 1 +
 hw/ppc/mac_oldworld.c      | 1 +
 hw/ppc/pnv.c               | 1 +
 hw/ppc/pnv_core.c          | 1 +
 hw/ppc/pnv_psi.c           | 1 +
 hw/ppc/ppc405_boards.c     | 2 ++
 hw/ppc/ppc405_uc.c         | 2 ++
 hw/ppc/ppc440_bamboo.c     | 1 +
 hw/ppc/ppc440_uc.c         | 1 +
 hw/ppc/ppc4xx_devs.c       | 2 ++
 hw/ppc/ppc4xx_pci.c        | 1 +
 hw/ppc/ppc_booke.c         | 2 ++
 hw/ppc/prep.c              | 2 ++
 hw/ppc/sam460ex.c          | 1 +
 hw/ppc/spapr.c             | 1 +
 hw/ppc/spapr_cpu_core.c    | 2 ++
 hw/ppc/spapr_drc.c         | 1 +
 hw/ppc/virtex_ml507.c      | 1 +
 hw/riscv/riscv_hart.c      | 1 +
 hw/s390x/ipl.c             | 1 +
 hw/s390x/s390-virtio-ccw.c | 1 +
 hw/sh4/r2d.c               | 1 +
 hw/sparc/leon3.c           | 2 ++
 hw/sparc/sun4m.c           | 2 ++
 hw/sparc64/sparc64.c       | 1 +
 hw/timer/etraxfs_timer.c   | 1 +
 hw/timer/mc146818rtc.c     | 1 +
 hw/tpm/tpm_ppi.c           | 1 -
 hw/vfio/common.c           | 1 +
 hw/watchdog/wdt_diag288.c  | 1 +
 hw/xtensa/sim.c            | 1 +
 hw/xtensa/xtfpga.c         | 1 +
 include/hw/hw.h            | 1 -
 target/i386/cpu.c          | 1 +
 target/i386/hax-all.c      | 1 +
 target/i386/kvm.c          | 1 +
 target/s390x/cpu.c         | 1 +
 vl.c                       | 1 +
 92 files changed, 107 insertions(+), 2 deletions(-)
hw/acpi/ich9.c +2 -0
index e53dfe1ee3..b4d987c811 100644
@@ -23,6 +23,7 @@
  * Contributions after 2012-01-13 are licensed under the terms of the
  * GNU GPL, version 2 or (at your option) any later version.
  */
+
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "qapi/error.h"
@@ -30,6 +31,7 @@
 #include "hw/i386/pc.h"
 #include "hw/pci/pci.h"
 #include "qemu/timer.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "hw/acpi/acpi.h"
 #include "hw/acpi/tco.h"
hw/acpi/piix4.c +2 -0
index ec4e186cec..a59e58d937 100644
@@ -18,6 +18,7 @@
  * Contributions after 2012-01-13 are licensed under the terms of the
  * GNU GPL, version 2 or (at your option) any later version.
  */
+
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
@@ -25,6 +26,7 @@
 #include "hw/i2c/pm_smbus.h"
 #include "hw/pci/pci.h"
 #include "hw/acpi/acpi.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "qapi/error.h"
 #include "qemu/range.h"
hw/acpi/vmgenid.c +1 -0
index b891df375f..ed92ccc4b8 100644
@@ -18,6 +18,7 @@
 #include "hw/acpi/aml-build.h"
 #include "hw/acpi/vmgenid.h"
 #include "hw/nvram/fw_cfg.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 
 void vmgenid_build_acpi(VmGenIdState *vms, GArray *table_data, GArray *guid,
hw/arm/armv7m.c +1 -0
index b9efad6bac..4b2d8b6574 100644
@@ -16,6 +16,7 @@
 #include "hw/loader.h"
 #include "elf.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "qemu/error-report.h"
 #include "qemu/module.h"
 #include "exec/address-spaces.h"
hw/arm/boot.c +1 -0
index c2b89b3bb9..d082daf6f2 100644
@@ -18,6 +18,7 @@
 #include "sysemu/kvm.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/numa.h"
+#include "sysemu/reset.h"
 #include "hw/boards.h"
 #include "hw/loader.h"
 #include "elf.h"
hw/arm/nseries.c +1 -0
index 4a79f5c88b..3f3eca52e2 100644
@@ -23,6 +23,7 @@
 #include "cpu.h"
 #include "qemu/cutils.h"
 #include "qemu/bswap.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "hw/arm/omap.h"
 #include "hw/arm/boot.h"
hw/arm/omap1.c +1 -0
index 28fbe275a8..beaddaf11f 100644
@@ -29,6 +29,7 @@
 #include "sysemu/sysemu.h"
 #include "hw/arm/soc_dma.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "qemu/range.h"
 #include "hw/sysbus.h"
 #include "qemu/cutils.h"
hw/arm/omap2.c +1 -0
index 87ced7f3a2..7d4cac1f46 100644
@@ -23,6 +23,7 @@
 #include "qapi/error.h"
 #include "cpu.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "hw/boards.h"
 #include "hw/hw.h"
 #include "hw/arm/boot.h"
hw/arm/virt-acpi-build.c +1 -0
index 0afb372769..ad54d65ea0 100644
@@ -44,6 +44,7 @@
 #include "hw/pci/pci.h"
 #include "hw/arm/virt.h"
 #include "sysemu/numa.h"
+#include "sysemu/reset.h"
 #include "kvm_arm.h"
 
 #define ARM_SPI_BASE 32
hw/char/parallel.c +1 -0
index 1cd4c54a02..fed15dc548 100644
@@ -31,6 +31,7 @@
 #include "chardev/char-fe.h"
 #include "hw/isa/isa.h"
 #include "hw/char/parallel.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "trace.h"
 
hw/char/serial.c +1 -0
index 7c42a2abfc..a9e42f7d97 100644
@@ -28,6 +28,7 @@
 #include "chardev/char-serial.h"
 #include "qapi/error.h"
 #include "qemu/timer.h"
+#include "sysemu/reset.h"
 #include "qemu/error-report.h"
 #include "trace.h"
 
hw/core/generic-loader.c +1 -0
index 79a493e577..579fe5ed32 100644
@@ -34,6 +34,7 @@
 #include "qom/cpu.h"
 #include "hw/sysbus.h"
 #include "sysemu/dma.h"
+#include "sysemu/reset.h"
 #include "hw/loader.h"
 #include "qapi/error.h"
 #include "qemu/module.h"
hw/core/loader.c +1 -0
index 425bf69a99..830845dd73 100644
@@ -48,6 +48,7 @@
 #include "hw/hw.h"
 #include "disas/disas.h"
 #include "monitor/monitor.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "uboot_image.h"
 #include "hw/loader.h"
hw/cris/boot.c +1 -0
index 602f538ef6..d44fdec43f 100644
@@ -29,6 +29,7 @@
 #include "elf.h"
 #include "boot.h"
 #include "qemu/cutils.h"
+#include "sysemu/reset.h"
 
 static void main_cpu_reset(void *opaque)
 {
hw/display/cirrus_vga.c +1 -0
index 2e4911a1e3..4ccf5b4f18 100644
@@ -35,6 +35,7 @@
 #include "qemu/osdep.h"
 #include "qemu/module.h"
 #include "qemu/units.h"
+#include "sysemu/reset.h"
 #include "qapi/error.h"
 #include "trace.h"
 #include "hw/hw.h"
hw/display/ramfb.c +2 -0
index b4eb283ef8..6026a35b11 100644
@@ -10,12 +10,14 @@
  * This work is licensed under the terms of the GNU GPL, version 2 or later.
  * See the COPYING file in the top-level directory.
  */
+
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qemu/option.h"
 #include "hw/loader.h"
 #include "hw/display/ramfb.h"
 #include "ui/console.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 
 struct QEMU_PACKED RAMFBCfg {
hw/display/vga.c +2 -0
index 910a23c12e..4d3572891a 100644
@@ -21,8 +21,10 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "qemu/units.h"
+#include "sysemu/reset.h"
 #include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/display/vga.h"
hw/hppa/machine.c +1 -0
index 662838d83b..bc74438496 100644
@@ -11,6 +11,7 @@
 #include "hw/loader.h"
 #include "hw/boards.h"
 #include "qemu/error-report.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "hw/timer/mc146818rtc.h"
 #include "hw/ide.h"
hw/i386/acpi-build.c +1 -0
index f3fdfefcd5..74667a53be 100644
@@ -48,6 +48,7 @@
 #include "hw/timer/mc146818rtc_regs.h"
 #include "hw/mem/memory-device.h"
 #include "sysemu/numa.h"
+#include "sysemu/reset.h"
 
 /* Supported chipsets: */
 #include "hw/acpi/piix4.h"
hw/i386/pc.c +1 -0
index 549c437050..73b55500b0 100644
@@ -54,6 +54,7 @@
 #include "sysemu/numa.h"
 #include "sysemu/kvm.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "kvm_i386.h"
 #include "hw/xen/xen.h"
 #include "hw/xen/start_info.h"
hw/ide/cmd646.c +1 -0
index ed23aabf21..e5542c9811 100644
@@ -30,6 +30,7 @@
 #include "hw/isa/isa.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/dma.h"
+#include "sysemu/reset.h"
 
 #include "hw/ide/pci.h"
 #include "trace.h"
hw/ide/piix.c +1 -0
index b97e555072..c4c6d4b760 100644
@@ -31,6 +31,7 @@
 #include "sysemu/sysemu.h"
 #include "sysemu/blockdev.h"
 #include "sysemu/dma.h"
+#include "sysemu/reset.h"
 
 #include "hw/ide/pci.h"
 #include "trace.h"
hw/ide/sii3112.c +1 -0
index d7590d4ba4..2181260531 100644
@@ -15,6 +15,7 @@
 #include "qemu/osdep.h"
 #include "hw/ide/pci.h"
 #include "qemu/module.h"
+#include "sysemu/reset.h"
 #include "trace.h"
 
 #define TYPE_SII3112_PCI "sii3112"
hw/ide/via.c +1 -0
index c3bda909f9..6d54ac55f0 100644
@@ -30,6 +30,7 @@
 #include "qemu/module.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/dma.h"
+#include "sysemu/reset.h"
 
 #include "hw/ide/pci.h"
 #include "trace.h"
hw/input/lm832x.c +1 -0
index 5203da2bcf..ebb72c6590 100644
@@ -23,6 +23,7 @@
 #include "hw/i2c/i2c.h"
 #include "qemu/module.h"
 #include "qemu/timer.h"
+#include "sysemu/reset.h"
 #include "ui/console.h"
 
 #define TYPE_LM8323 "lm8323"
hw/input/pckbd.c +2 -0
index 47a606f5e3..5d06a53362 100644
@@ -21,6 +21,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "qemu/log.h"
 #include "hw/hw.h"
@@ -28,6 +29,7 @@
 #include "hw/i386/pc.h"
 #include "hw/input/ps2.h"
 #include "hw/input/i8042.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 
 #include "trace.h"
hw/input/ps2.c +2 -0
index d3161f1e7c..8d922b05c9 100644
@@ -21,12 +21,14 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "qemu/log.h"
 #include "hw/hw.h"
 #include "hw/input/ps2.h"
 #include "ui/console.h"
 #include "ui/input.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 
 #include "trace.h"
hw/input/tsc2005.c +1 -0
index f82771e7a7..0a0431744c 100644
@@ -22,6 +22,7 @@
 #include "qemu/log.h"
 #include "hw/hw.h"
 #include "qemu/timer.h"
+#include "sysemu/reset.h"
 #include "ui/console.h"
 #include "hw/input/tsc2xxx.h"
 #include "trace.h"
hw/input/tsc210x.c +1 -0
index f94cb4683b..d2486f4b4e 100644
@@ -23,6 +23,7 @@
 #include "hw/hw.h"
 #include "audio/audio.h"
 #include "qemu/timer.h"
+#include "sysemu/reset.h"
 #include "ui/console.h"
 #include "hw/arm/omap.h"            /* For I2SCodec */
 #include "hw/input/tsc2xxx.h"
hw/intc/mips_gic.c +1 -0
index 33ab51c5b8..e27e333766 100644
@@ -18,6 +18,7 @@
 #include "exec/memory.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/kvm.h"
+#include "sysemu/reset.h"
 #include "kvm_mips.h"
 #include "hw/intc/mips_gic.h"
 
hw/intc/pnv_xive.c +1 -0
index 4dc92ef1e3..63b0f461ec 100644
@@ -14,6 +14,7 @@
 #include "target/ppc/cpu.h"
 #include "sysemu/cpus.h"
 #include "sysemu/dma.h"
+#include "sysemu/reset.h"
 #include "monitor/monitor.h"
 #include "hw/ppc/fdt.h"
 #include "hw/ppc/pnv.h"
hw/intc/spapr_xive.c +1 -0
index 3ae311d9ff..2e39cc1e47 100644
@@ -14,6 +14,7 @@
 #include "qemu/error-report.h"
 #include "target/ppc/cpu.h"
 #include "sysemu/cpus.h"
+#include "sysemu/reset.h"
 #include "monitor/monitor.h"
 #include "hw/ppc/fdt.h"
 #include "hw/ppc/spapr.h"
hw/intc/xics.c +1 -0
index faa976e2f8..9ed224ce5f 100644
@@ -38,6 +38,7 @@
 #include "monitor/monitor.h"
 #include "hw/intc/intc.h"
 #include "sysemu/kvm.h"
+#include "sysemu/reset.h"
 
 void icp_pic_print_info(ICPState *icp, Monitor *mon)
 {
hw/intc/xive.c +1 -0
index cf77bdb7d3..b27d6b8646 100644
@@ -14,6 +14,7 @@
 #include "target/ppc/cpu.h"
 #include "sysemu/cpus.h"
 #include "sysemu/dma.h"
+#include "sysemu/reset.h"
 #include "hw/qdev-properties.h"
 #include "monitor/monitor.h"
 #include "hw/ppc/xive.h"
hw/isa/piix4.c +1 -0
index 6b8bc3faf0..3677976ef7 100644
@@ -28,6 +28,7 @@
 #include "hw/pci/pci.h"
 #include "hw/isa/isa.h"
 #include "hw/sysbus.h"
+#include "sysemu/reset.h"
 
 PCIDevice *piix4_dev;
 
hw/isa/vt82c686.c +1 -0
index 12c460590f..81bffb1fb9 100644
@@ -22,6 +22,7 @@
 #include "hw/isa/apm.h"
 #include "hw/acpi/acpi.h"
 #include "hw/i2c/pm_smbus.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "qemu/module.h"
 #include "qemu/timer.h"
hw/lm32/lm32_boards.c +1 -0
index fb9d52d54f..e075ebc8a6 100644
@@ -30,6 +30,7 @@
 #include "lm32_hwsetup.h"
 #include "lm32.h"
 #include "exec/address-spaces.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 
 typedef struct {
hw/lm32/milkymist.c +1 -0
index 689e633199..33669ee19b 100644
@@ -27,6 +27,7 @@
 #include "hw/block/flash.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "hw/boards.h"
 #include "hw/loader.h"
 #include "elf.h"
hw/microblaze/boot.c +1 -0
index a7af4c0704..bade4d22c0 100644
@@ -31,6 +31,7 @@
 #include "qemu/config-file.h"
 #include "qemu/error-report.h"
 #include "sysemu/device_tree.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "hw/loader.h"
 #include "elf.h"
hw/mips/cps.c +1 -0
index 0d459c4141..aea6bcd7fe 100644
@@ -24,6 +24,7 @@
 #include "hw/mips/mips.h"
 #include "hw/mips/cpudevs.h"
 #include "sysemu/kvm.h"
+#include "sysemu/reset.h"
 
 qemu_irq get_cps_irq(MIPSCPSState *s, int pin_number)
 {
hw/mips/mips_fulong2e.c +1 -0
index 5dbaa3bfcc..0a1bf5ef5c 100644
@@ -44,6 +44,7 @@
 #include "hw/timer/i8254.h"
 #include "exec/address-spaces.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "qemu/error-report.h"
 
 #define DEBUG_FULONG2E_INIT
hw/mips/mips_jazz.c +1 -0
index fa8775d428..6ea25cd5f4 100644
@@ -48,6 +48,7 @@
 #include "hw/sysbus.h"
 #include "exec/address-spaces.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "qemu/help_option.h"
hw/mips/mips_malta.c +1 -0
index 20e019bf66..29bc8de5cf 100644
@@ -51,6 +51,7 @@
 #include "hw/sysbus.h"             /* SysBusDevice */
 #include "qemu/host-utils.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "hw/empty_slot.h"
hw/mips/mips_mipssim.c +2 -0
index 824abda657..280e76a482 100644
@@ -24,6 +24,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qemu-common.h"
@@ -43,6 +44,7 @@
 #include "exec/address-spaces.h"
 #include "qemu/error-report.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 
 static struct _loaderparams {
     int ram_size;
hw/mips/mips_r4k.c +2 -0
index 93dbf76bb4..191047826d 100644
@@ -7,6 +7,7 @@
  * All peripherial devices are attached to this "bus" with
  * the standard PC ISA addresses.
 */
+
 #include "qemu/osdep.h"
 #include "qemu/units.h"
 #include "qapi/error.h"
@@ -33,6 +34,7 @@
 #include "hw/timer/i8254.h"
 #include "exec/address-spaces.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "qemu/error-report.h"
 
 #define MAX_IDE_BUS 2
hw/misc/vmcoreinfo.c +1 -0
index 987d6f52af..49e87d462b 100644
@@ -13,6 +13,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qemu/module.h"
+#include "sysemu/reset.h"
 #include "hw/nvram/fw_cfg.h"
 #include "hw/misc/vmcoreinfo.h"
 
hw/moxie/moxiesim.c +2 -0
index d771d393c2..16a7d58274 100644
@@ -24,6 +24,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "qemu/error-report.h"
 #include "qapi/error.h"
@@ -31,6 +32,7 @@
 #include "hw/sysbus.h"
 #include "hw/hw.h"
 #include "net/net.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "hw/boards.h"
 #include "hw/loader.h"
hw/net/eepro100.c +1 -0
index 6607c9142d..e0cf0c46d7 100644
@@ -49,6 +49,7 @@
 #include "hw/nvram/eeprom93xx.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/dma.h"
+#include "sysemu/reset.h"
 #include "qemu/bitops.h"
 #include "qemu/module.h"
 #include "qapi/error.h"
hw/nios2/boot.c +1 -0
index 276068c842..d78bc9ed0e 100644
@@ -36,6 +36,7 @@
 #include "qemu/config-file.h"
 #include "qemu/error-report.h"
 #include "sysemu/device_tree.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "hw/loader.h"
 #include "elf.h"
hw/nvram/fw_cfg.c +1 -0
index dcfd6d2ed3..3032f1c65f 100644
@@ -27,6 +27,7 @@
 #include "hw/hw.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/dma.h"
+#include "sysemu/reset.h"
 #include "hw/boards.h"
 #include "hw/nvram/fw_cfg.h"
 #include "hw/sysbus.h"
hw/openrisc/openrisc_sim.c +1 -0
index b85f0df323..cb2fc5ba78 100644
@@ -32,6 +32,7 @@
 #include "sysemu/sysemu.h"
 #include "hw/sysbus.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 
 #define KERNEL_LOAD_ADDR 0x100
 
hw/pci-host/bonito.c +1 -0
index dde4437595..36c7ca45ad 100644
@@ -44,6 +44,7 @@
 #include "hw/i386/pc.h"
 #include "hw/mips/mips.h"
 #include "hw/pci/pci_host.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "exec/address-spaces.h"
 
hw/pci-host/piix.c +1 -0
index d9c70f7ce6..f3671d28b7 100644
@@ -33,6 +33,7 @@
 #include "qemu/range.h"
 #include "hw/xen/xen.h"
 #include "hw/pci-host/pam.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "hw/i386/ioapic.h"
 #include "qapi/visitor.h"
hw/ppc/e500.c +1 -0
index a3eac7f057..566f179bb1 100644
@@ -28,6 +28,7 @@
 #include "hw/boards.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/kvm.h"
+#include "sysemu/reset.h"
 #include "kvm_ppc.h"
 #include "sysemu/device_tree.h"
 #include "hw/ppc/openpic.h"
hw/ppc/mac_newworld.c +1 -0
index 09bc6068f3..0f9f351eb1 100644
@@ -68,6 +68,7 @@
 #include "elf.h"
 #include "qemu/error-report.h"
 #include "sysemu/kvm.h"
+#include "sysemu/reset.h"
 #include "kvm_ppc.h"
 #include "hw/usb.h"
 #include "exec/address-spaces.h"
hw/ppc/mac_oldworld.c +1 -0
index 9ffde5b6f7..6640057473 100644
@@ -47,6 +47,7 @@
 #include "elf.h"
 #include "qemu/error-report.h"
 #include "sysemu/kvm.h"
+#include "sysemu/reset.h"
 #include "kvm_ppc.h"
 #include "exec/address-spaces.h"
 
hw/ppc/pnv.c +1 -0
index bd4531c822..96608883aa 100644
@@ -23,6 +23,7 @@
 #include "qapi/error.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/numa.h"
+#include "sysemu/reset.h"
 #include "sysemu/cpus.h"
 #include "sysemu/device_tree.h"
 #include "hw/hw.h"
hw/ppc/pnv_core.c +1 -0
index c6411ecc1d..ff477ba6c9 100644
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "qapi/error.h"
 #include "qemu/log.h"
hw/ppc/pnv_psi.c +1 -0
index d7b6f5d75b..6b26d0f6bc 100644
@@ -22,6 +22,7 @@
 #include "target/ppc/cpu.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
+#include "sysemu/reset.h"
 #include "qapi/error.h"
 #include "monitor/monitor.h"
 
hw/ppc/ppc405_boards.c +2 -0
index 13318a9faf..5b278e7791 100644
@@ -21,6 +21,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "qemu/units.h"
 #include "qapi/error.h"
@@ -33,6 +34,7 @@
 #include "hw/block/flash.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "sysemu/block-backend.h"
 #include "hw/boards.h"
 #include "qemu/log.h"
hw/ppc/ppc405_uc.c +2 -0
index edb6b2d190..f9d98fe71e 100644
@@ -21,6 +21,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "qemu/units.h"
 #include "qapi/error.h"
@@ -32,6 +33,7 @@
 #include "ppc405.h"
 #include "hw/char/serial.h"
 #include "qemu/timer.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "qemu/log.h"
 #include "exec/address-spaces.h"
hw/ppc/ppc440_bamboo.c +1 -0
index b4da099e3e..1bd92aa749 100644
@@ -31,6 +31,7 @@
 #include "ppc405.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "hw/sysbus.h"
 
 #define BINARY_DEVICE_TREE_FILE "bamboo.dtb"
hw/ppc/ppc440_uc.c +1 -0
index 5c1a53d6e7..7329cfe651 100644
@@ -21,6 +21,7 @@
 #include "hw/ppc/ppc.h"
 #include "hw/pci/pci.h"
 #include "sysemu/block-backend.h"
+#include "sysemu/reset.h"
 #include "ppc440.h"
 
 /*****************************************************************************/
hw/ppc/ppc4xx_devs.c +2 -0
index fdfeb67e65..e62bef3b8d 100644
@@ -21,8 +21,10 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "qemu/units.h"
+#include "sysemu/reset.h"
 #include "cpu.h"
 #include "hw/hw.h"
 #include "hw/ppc/ppc.h"
hw/ppc/ppc4xx_pci.c +1 -0
index e7cf8d50a5..b013319c60 100644
@@ -24,6 +24,7 @@
 #include "hw/ppc/ppc.h"
 #include "hw/ppc/ppc4xx.h"
 #include "qemu/module.h"
+#include "sysemu/reset.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_host.h"
 #include "exec/address-spaces.h"
hw/ppc/ppc_booke.c +2 -0
index 18d1457581..ba5f513ca5 100644
@@ -21,11 +21,13 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "hw/hw.h"
 #include "hw/ppc/ppc.h"
 #include "qemu/timer.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "qemu/log.h"
 #include "hw/loader.h"
hw/ppc/prep.c +2 -0
index ab3c1df1fc..84e968e28c 100644
@@ -22,6 +22,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "hw/hw.h"
@@ -45,6 +46,7 @@
 #include "sysemu/arch_init.h"
 #include "sysemu/kvm.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "exec/address-spaces.h"
 #include "trace.h"
 #include "elf.h"
hw/ppc/sam460ex.c +1 -0
index fbcddc5b00..c1d6f74d5b 100644
@@ -31,6 +31,7 @@
 #include "hw/block/flash.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "hw/sysbus.h"
 #include "hw/char/serial.h"
 #include "hw/i2c/ppc4xx_i2c.h"
hw/ppc/spapr.c +1 -0
index 821f0d4a49..5cade1a374 100644
@@ -31,6 +31,7 @@
 #include "sysemu/sysemu.h"
 #include "sysemu/numa.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "hw/hw.h"
 #include "qemu/log.h"
 #include "hw/fw-path-provider.h"
hw/ppc/spapr_cpu_core.c +2 -0
index 5621fb9a3d..ccc8970c7c 100644
@@ -6,6 +6,7 @@
  * This work is licensed under the terms of the GNU GPL, version 2 or later.
  * See the COPYING file in the top-level directory.
  */
+
 #include "qemu/osdep.h"
 #include "hw/cpu/core.h"
 #include "hw/ppc/spapr_cpu_core.h"
@@ -19,6 +20,7 @@
 #include "hw/ppc/ppc.h"
 #include "target/ppc/mmu-hash64.h"
 #include "sysemu/numa.h"
+#include "sysemu/reset.h"
 #include "sysemu/hw_accel.h"
 #include "qemu/error-report.h"
 
hw/ppc/spapr_drc.c +1 -0
index bacadfcac5..678493a9c5 100644
@@ -23,6 +23,7 @@
 #include "hw/ppc/spapr.h" /* for RTAS return codes */
 #include "hw/pci-host/spapr.h" /* spapr_phb_remove_pci_device_cb callback */
 #include "sysemu/device_tree.h"
+#include "sysemu/reset.h"
 #include "trace.h"
 
 #define DRC_CONTAINER_PATH "/dr-connector"
hw/ppc/virtex_ml507.c +1 -0
index 834053a7d2..06f5a28601 100644
@@ -32,6 +32,7 @@
 #include "hw/block/flash.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "hw/boards.h"
 #include "sysemu/device_tree.h"
 #include "hw/loader.h"
hw/riscv/riscv_hart.c +1 -0
index ca69a1bcd8..61bd4d5170 100644
@@ -21,6 +21,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qemu/module.h"
+#include "sysemu/reset.h"
 #include "hw/sysbus.h"
 #include "target/riscv/cpu.h"
 #include "hw/riscv/riscv_hart.h"
hw/s390x/ipl.c +1 -0
index 60bd081d3e..2e5ce11a6b 100644
@@ -14,6 +14,7 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qapi/error.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/tcg.h"
 #include "cpu.h"
hw/s390x/s390-virtio-ccw.c +1 -0
index 5b6a9a4e55..4ffdd53a85 100644
@@ -27,6 +27,7 @@
 #include "qemu/error-report.h"
 #include "qemu/option.h"
 #include "s390-pci-bus.h"
+#include "sysemu/reset.h"
 #include "hw/s390x/storage-keys.h"
 #include "hw/s390x/storage-attributes.h"
 #include "hw/s390x/event-facility.h"
hw/sh4/r2d.c +1 -0
index f22c79c867..da79bf0337 100644
@@ -30,6 +30,7 @@
 #include "hw/sysbus.h"
 #include "hw/hw.h"
 #include "hw/sh4/sh.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "hw/boards.h"
 #include "hw/pci/pci.h"
hw/sparc/leon3.c +2 -0
index 19cedebd16..c7ddfa2cfe 100644
@@ -21,6 +21,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "qemu/units.h"
 #include "qemu/error-report.h"
@@ -32,6 +33,7 @@
 #include "hw/ptimer.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/qtest.h"
+#include "sysemu/reset.h"
 #include "hw/boards.h"
 #include "hw/loader.h"
 #include "elf.h"
hw/sparc/sun4m.c +2 -0
index b2342f2a89..93a69c12fb 100644
@@ -21,6 +21,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "qemu/units.h"
 #include "qapi/error.h"
@@ -33,6 +34,7 @@
 #include "hw/timer/m48t59.h"
 #include "hw/sparc/sparc32_dma.h"
 #include "hw/block/fdc.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "net/net.h"
 #include "hw/boards.h"
hw/sparc64/sparc64.c +1 -0
index 689801f37d..100b2fab17 100644
@@ -28,6 +28,7 @@
 #include "hw/char/serial.h"
 #include "hw/sparc/sparc64.h"
 #include "qemu/timer.h"
+#include "sysemu/reset.h"
 #include "trace.h"
 
 
hw/timer/etraxfs_timer.c +1 -0
index 53834e197f..18887b2be2 100644
@@ -24,6 +24,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "qemu/module.h"
 #include "qemu/timer.h"
hw/timer/mc146818rtc.c +1 -0
index ce4550b6f2..21fcba5e3a 100644
@@ -31,6 +31,7 @@
 #include "qemu/timer.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/replay.h"
+#include "sysemu/reset.h"
 #include "hw/timer/mc146818rtc.h"
 #include "qapi/error.h"
 #include "qapi/qapi-commands-misc-target.h"
hw/tpm/tpm_ppi.c +0 -1
index cd8205f212..ff314592b4 100644
@@ -16,7 +16,6 @@
 #include "qapi/error.h"
 #include "cpu.h"
 #include "sysemu/memory_mapping.h"
-#include "sysemu/reset.h"
 #include "migration/vmstate.h"
 #include "tpm_ppi.h"
 #include "trace.h"
hw/vfio/common.c +1 -0
index a859298fda..a363b4495f 100644
@@ -34,6 +34,7 @@
 #include "qemu/range.h"
 #include "sysemu/balloon.h"
 #include "sysemu/kvm.h"
+#include "sysemu/reset.h"
 #include "trace.h"
 #include "qapi/error.h"
 
hw/watchdog/wdt_diag288.c +1 -0
index 29e5b5dcf6..fec046ef09 100644
@@ -12,6 +12,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "sysemu/reset.h"
 #include "sysemu/watchdog.h"
 #include "hw/sysbus.h"
 #include "qemu/timer.h"
hw/xtensa/sim.c +1 -0
index 09165b6f4d..981dbb7bbe 100644
@@ -28,6 +28,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "cpu.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "hw/boards.h"
 #include "hw/loader.h"
hw/xtensa/xtfpga.c +1 -0
index f7f3e11e93..0a2cce3c64 100644
@@ -41,6 +41,7 @@
 #include "hw/block/flash.h"
 #include "chardev/char.h"
 #include "sysemu/device_tree.h"
+#include "sysemu/reset.h"
 #include "qemu/error-report.h"
 #include "qemu/option.h"
 #include "bootparam.h"
include/hw/hw.h +0 -1
index b1b79964b5..a4fb2390e8 100644
@@ -12,7 +12,6 @@
 #include "hw/irq.h"
 #include "migration/vmstate.h"
 #include "migration/qemu-file-types.h"
-#include "sysemu/reset.h"
 
 void QEMU_NORETURN hw_error(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
 
target/i386/cpu.c +1 -0
index 19751e37a7..80f1443110 100644
@@ -26,6 +26,7 @@
 #include "cpu.h"
 #include "exec/exec-all.h"
 #include "sysemu/kvm.h"
+#include "sysemu/reset.h"
 #include "sysemu/hvf.h"
 #include "sysemu/cpus.h"
 #include "kvm_i386.h"
target/i386/hax-all.c +1 -0
index 9e7b77965d..bcacdd1d8f 100644
@@ -30,6 +30,7 @@
 #include "qemu-common.h"
 #include "hax-i386.h"
 #include "sysemu/accel.h"
+#include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "qemu/main-loop.h"
 #include "hw/boards.h"
target/i386/kvm.c +1 -0
index dbbb13772a..30ed209e6b 100644
@@ -24,6 +24,7 @@
 #include "sysemu/sysemu.h"
 #include "sysemu/hw_accel.h"
 #include "sysemu/kvm_int.h"
+#include "sysemu/reset.h"
 #include "kvm_i386.h"
 #include "hyperv.h"
 #include "hyperv-proto.h"
target/s390x/cpu.c +1 -0
index 736a7903e2..3caba8d5e1 100644
@@ -26,6 +26,7 @@
 #include "internal.h"
 #include "kvm_s390x.h"
 #include "sysemu/kvm.h"
+#include "sysemu/reset.h"
 #include "qemu/timer.h"
 #include "qemu/error-report.h"
 #include "qemu/module.h"
vl.c +1 -0
index b426b32134..1abfd306e3 100644
@@ -30,6 +30,7 @@
 #include "qemu/cutils.h"
 #include "qemu/help_option.h"
 #include "qemu/uuid.h"
+#include "sysemu/reset.h"
 #include "sysemu/seccomp.h"
 #include "sysemu/tcg.h"
 
#24 lore raw

PATCH v2 9/29 Include migration/qemu-file-types.h a lot less

In reply to Markus Armbruster

In my "build everything" tree, changing migration/qemu-file-types.h triggers a recompile of some 2600 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h).

The culprit is again hw/hw.h, which supposedly includes it for convenience.

Include migration/qemu-file-types.h only where it's needed. Touching it now recompiles less than 200 objects.

---
 hw/acpi/piix4.c             | 1 +
 hw/block/virtio-blk.c       | 1 +
 hw/char/virtio-serial-bus.c | 1 +
 hw/display/virtio-gpu.c     | 1 +
 hw/intc/apic_common.c       | 1 +
 hw/nvram/eeprom93xx.c       | 1 +
 hw/nvram/fw_cfg.c           | 1 +
 hw/pci-host/piix.c          | 1 +
 hw/pci/msix.c               | 1 +
 hw/pci/pci.c                | 1 +
 hw/pci/shpc.c               | 1 +
 hw/ppc/spapr.c              | 1 +
 hw/s390x/s390-skeys.c       | 1 +
 hw/s390x/tod.c              | 1 +
 hw/s390x/virtio-ccw.c       | 1 +
 hw/scsi/mptsas.c            | 1 +
 hw/scsi/scsi-bus.c          | 1 +
 hw/scsi/scsi-disk.c         | 1 +
 hw/scsi/scsi-generic.c      | 1 +
 hw/scsi/virtio-scsi.c       | 1 +
 hw/timer/i8254_common.c     | 1 +
 hw/timer/twl92230.c         | 1 +
 hw/usb/redirect.c           | 1 +
 hw/virtio/vhost.c           | 1 +
 hw/virtio/virtio-mmio.c     | 1 +
 hw/virtio/virtio-pci.c      | 1 +
 hw/virtio/virtio.c          | 1 +
 include/hw/hw.h             | 1 -
 include/migration/cpu.h     | 1 +
 target/ppc/kvm.c            | 1 +
 30 files changed, 29 insertions(+), 1 deletion(-)
hw/acpi/piix4.c +1 -0
index a59e58d937..0d8c821f37 100644
@@ -40,6 +40,7 @@
 #include "hw/acpi/memory_hotplug.h"
 #include "hw/acpi/acpi_dev_interface.h"
 #include "hw/xen/xen.h"
+#include "migration/qemu-file-types.h"
 #include "qom/cpu.h"
 #include "trace.h"
 
hw/block/virtio-blk.c +1 -0
index cbb3729158..1f40834d27 100644
@@ -26,6 +26,7 @@
 # include <scsi/sg.h>
 #endif
 #include "hw/virtio/virtio-bus.h"
+#include "migration/qemu-file-types.h"
 #include "hw/virtio/virtio-access.h"
 
 /* Config size before the discard support (hide associated config fields) */
hw/char/virtio-serial-bus.c +1 -0
index f7a54f261b..b868e54d72 100644
@@ -22,6 +22,7 @@
 #include "qapi/error.h"
 #include "qemu/iov.h"
 #include "qemu/module.h"
+#include "migration/qemu-file-types.h"
 #include "monitor/monitor.h"
 #include "qemu/error-report.h"
 #include "qemu/queue.h"
hw/display/virtio-gpu.c +1 -0
index 25d9e327fc..ed92071963 100644
@@ -18,6 +18,7 @@
 #include "trace.h"
 #include "sysemu/dma.h"
 #include "hw/virtio/virtio.h"
+#include "migration/qemu-file-types.h"
 #include "hw/virtio/virtio-gpu.h"
 #include "hw/virtio/virtio-gpu-bswap.h"
 #include "hw/virtio/virtio-gpu-pixman.h"
hw/intc/apic_common.c +1 -0
index e764a2bb03..7045761281 100644
@@ -31,6 +31,7 @@
 #include "sysemu/kvm.h"
 #include "hw/qdev.h"
 #include "hw/sysbus.h"
+#include "migration/qemu-file-types.h"
 
 static int apic_irq_delivered;
 bool apic_report_tpr_access;
hw/nvram/eeprom93xx.c +1 -0
index 2db3d7cce6..5fc23df1d4 100644
@@ -38,6 +38,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/nvram/eeprom93xx.h"
+#include "migration/qemu-file-types.h"
 
 /* Debug EEPROM emulation. */
 //~ #define DEBUG_EEPROM
hw/nvram/fw_cfg.c +1 -0
index 3032f1c65f..8db0297d59 100644
@@ -31,6 +31,7 @@
 #include "hw/boards.h"
 #include "hw/nvram/fw_cfg.h"
 #include "hw/sysbus.h"
+#include "migration/qemu-file-types.h"
 #include "trace.h"
 #include "qemu/error-report.h"
 #include "qemu/option.h"
hw/pci-host/piix.c +1 -0
index f3671d28b7..e5955457ab 100644
@@ -32,6 +32,7 @@
 #include "qapi/error.h"
 #include "qemu/range.h"
 #include "hw/xen/xen.h"
+#include "migration/qemu-file-types.h"
 #include "hw/pci-host/pam.h"
 #include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
hw/pci/msix.c +1 -0
index d39dcf32e8..ebe804b473 100644
@@ -20,6 +20,7 @@
 #include "hw/pci/msix.h"
 #include "hw/pci/pci.h"
 #include "hw/xen/xen.h"
+#include "migration/qemu-file-types.h"
 #include "qemu/range.h"
 #include "qapi/error.h"
 #include "trace.h"
hw/pci/pci.c +1 -0
index 8076a80ab3..43a3cac138 100644
@@ -29,6 +29,7 @@
 #include "hw/pci/pci_bridge.h"
 #include "hw/pci/pci_bus.h"
 #include "hw/pci/pci_host.h"
+#include "migration/qemu-file-types.h"
 #include "monitor/monitor.h"
 #include "net/net.h"
 #include "sysemu/sysemu.h"
hw/pci/shpc.c +1 -0
index 5a10c6e9a5..7f0aa28e44 100644
@@ -4,6 +4,7 @@
 #include "qemu/range.h"
 #include "qemu/error-report.h"
 #include "hw/pci/shpc.h"
+#include "migration/qemu-file-types.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_bus.h"
 #include "hw/pci/msi.h"
hw/ppc/spapr.c +1 -0
index 5cade1a374..76e815ceee 100644
@@ -42,6 +42,7 @@
 #include "sysemu/hw_accel.h"
 #include "kvm_ppc.h"
 #include "migration/misc.h"
+#include "migration/qemu-file-types.h"
 #include "migration/global_state.h"
 #include "migration/register.h"
 #include "mmu-hash64.h"
hw/s390x/s390-skeys.c +1 -0
index e5bd92c0c7..d4807f7777 100644
@@ -18,6 +18,7 @@
 #include "qapi/qmp/qdict.h"
 #include "qemu/error-report.h"
 #include "sysemu/kvm.h"
+#include "migration/qemu-file-types.h"
 #include "migration/register.h"
 
 #define S390_SKEYS_BUFFER_SIZE (128 * KiB)  /* Room for 128k storage keys */
hw/s390x/tod.c +1 -0
index a9fca8eb0b..1bf0875afa 100644
@@ -14,6 +14,7 @@
 #include "qemu/error-report.h"
 #include "qemu/module.h"
 #include "sysemu/kvm.h"
+#include "migration/qemu-file-types.h"
 #include "migration/register.h"
 
 void s390_init_tod(void)
hw/s390x/virtio-ccw.c +1 -0
index 43d3a1b029..fa537bfba3 100644
@@ -17,6 +17,7 @@
 #include "sysemu/kvm.h"
 #include "net/net.h"
 #include "hw/virtio/virtio.h"
+#include "migration/qemu-file-types.h"
 #include "hw/virtio/virtio-net.h"
 #include "hw/sysbus.h"
 #include "qemu/bitops.h"
hw/scsi/mptsas.c +1 -0
index 3f94d5ab55..6d2c15a2bc 100644
@@ -34,6 +34,7 @@
 #include "trace.h"
 #include "qapi/error.h"
 #include "mptsas.h"
+#include "migration/qemu-file-types.h"
 #include "mpi.h"
 
 #define NAA_LOCALLY_ASSIGNED_ID 0x3ULL
hw/scsi/scsi-bus.c +1 -0
index fdc3a0e4e0..81fe7c3301 100644
@@ -5,6 +5,7 @@
 #include "qemu/module.h"
 #include "qemu/option.h"
 #include "hw/scsi/scsi.h"
+#include "migration/qemu-file-types.h"
 #include "scsi/constants.h"
 #include "hw/qdev.h"
 #include "sysemu/block-backend.h"
hw/scsi/scsi-disk.c +1 -0
index af3e622dc5..558fa11511 100644
@@ -25,6 +25,7 @@
 #include "qemu/error-report.h"
 #include "qemu/module.h"
 #include "hw/scsi/scsi.h"
+#include "migration/qemu-file-types.h"
 #include "hw/scsi/emulation.h"
 #include "scsi/constants.h"
 #include "sysemu/sysemu.h"
hw/scsi/scsi-generic.c +1 -0
index c11a0c9a84..44430b6ea6 100644
@@ -17,6 +17,7 @@
 #include "qemu/error-report.h"
 #include "qemu/module.h"
 #include "hw/scsi/scsi.h"
+#include "migration/qemu-file-types.h"
 #include "hw/scsi/emulation.h"
 #include "sysemu/block-backend.h"
 #include "trace.h"
hw/scsi/virtio-scsi.c +1 -0
index 8b9e5e2b49..a6d61aacdb 100644
@@ -17,6 +17,7 @@
 #include "qapi/error.h"
 #include "standard-headers/linux/virtio_ids.h"
 #include "hw/virtio/virtio-scsi.h"
+#include "migration/qemu-file-types.h"
 #include "qemu/error-report.h"
 #include "qemu/iov.h"
 #include "qemu/module.h"
hw/timer/i8254_common.c +1 -0
index 76ca6ec444..3e980f2dee 100644
@@ -30,6 +30,7 @@
 #include "qemu/timer.h"
 #include "hw/timer/i8254.h"
 #include "hw/timer/i8254_internal.h"
+#include "migration/qemu-file-types.h"
 
 /* val must be 0 or 1 */
 void pit_set_gate(ISADevice *dev, int channel, int val)
hw/timer/twl92230.c +1 -0
index 0ef4fc1fc1..91ae7bf203 100644
@@ -24,6 +24,7 @@
 #include "hw/hw.h"
 #include "qemu/timer.h"
 #include "hw/i2c/i2c.h"
+#include "migration/qemu-file-types.h"
 #include "sysemu/sysemu.h"
 #include "ui/console.h"
 #include "qemu/bcd.h"
hw/usb/redirect.c +1 -0
index 998fc6e4b0..846e60f3bb 100644
@@ -41,6 +41,7 @@
 #include <usbredirfilter.h>
 
 #include "hw/usb.h"
+#include "migration/qemu-file-types.h"
 
 /* ERROR is defined below. Remove any previous definition. */
 #undef ERROR
hw/virtio/vhost.c +1 -0
index bc899fc60e..ba1006ad96 100644
@@ -26,6 +26,7 @@
 #include "hw/virtio/virtio-bus.h"
 #include "hw/virtio/virtio-access.h"
 #include "migration/blocker.h"
+#include "migration/qemu-file-types.h"
 #include "sysemu/dma.h"
 #include "trace.h"
 
hw/virtio/virtio-mmio.c +1 -0
index 97b7f35496..d4c0997074 100644
@@ -23,6 +23,7 @@
 #include "standard-headers/linux/virtio_mmio.h"
 #include "hw/sysbus.h"
 #include "hw/virtio/virtio.h"
+#include "migration/qemu-file-types.h"
 #include "qemu/host-utils.h"
 #include "qemu/module.h"
 #include "sysemu/kvm.h"
hw/virtio/virtio-pci.c +1 -0
index f6d2223e78..1117f2347b 100644
@@ -19,6 +19,7 @@
 
 #include "standard-headers/linux/virtio_pci.h"
 #include "hw/virtio/virtio.h"
+#include "migration/qemu-file-types.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_bus.h"
 #include "qapi/error.h"
hw/virtio/virtio.c +1 -0
index a94ea18a9c..79c7a910cc 100644
@@ -19,6 +19,7 @@
 #include "qemu/error-report.h"
 #include "qemu/module.h"
 #include "hw/virtio/virtio.h"
+#include "migration/qemu-file-types.h"
 #include "qemu/atomic.h"
 #include "hw/virtio/virtio-bus.h"
 #include "hw/virtio/virtio-access.h"
include/hw/hw.h +0 -1
index a4fb2390e8..b399627cbe 100644
@@ -11,7 +11,6 @@
 #include "exec/memory.h"
 #include "hw/irq.h"
 #include "migration/vmstate.h"
-#include "migration/qemu-file-types.h"
 
 void QEMU_NORETURN hw_error(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
 
include/migration/cpu.h +1 -0
index 8424f1631a..21c4fc9eab 100644
@@ -3,6 +3,7 @@
 #define MIGRATION_CPU_H
 
 #include "exec/cpu-defs.h"
+#include "migration/qemu-file-types.h"
 
 #if TARGET_LONG_BITS == 64
 #define qemu_put_betl qemu_put_be64
target/ppc/kvm.c +1 -0
index 8a06d3171e..4bd95be9cd 100644
@@ -38,6 +38,7 @@
 #include "hw/ppc/spapr.h"
 #include "hw/ppc/spapr_cpu_core.h"
 #include "hw/ppc/ppc.h"
+#include "migration/qemu-file-types.h"
 #include "sysemu/watchdog.h"
 #include "trace.h"
 #include "exec/gdbstub.h"
Signature · 1 line
2.21.0
Reviewed-by Tested-by on v2 9/29
#25 lore raw

Re: [Qemu-devel] [PATCH v2 09/29] Include migration/qemu-file-types.h a lot less

Quoted 43 lines · Markus Armbruster

In my "build everything" tree, changing migration/qemu-file-types.h triggers a recompile of some 2600 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h).

The culprit is again hw/hw.h, which supposedly includes it for convenience.

Include migration/qemu-file-types.h only where it's needed. Touching it now recompiles less than 200 objects.

---
 hw/acpi/piix4.c             | 1 +
 hw/block/virtio-blk.c       | 1 +
 hw/char/virtio-serial-bus.c | 1 +
 hw/display/virtio-gpu.c     | 1 +
 hw/intc/apic_common.c       | 1 +
 hw/nvram/eeprom93xx.c       | 1 +
 hw/nvram/fw_cfg.c           | 1 +
 hw/pci-host/piix.c          | 1 +
 hw/pci/msix.c               | 1 +
 hw/pci/pci.c                | 1 +
 hw/pci/shpc.c               | 1 +
 hw/ppc/spapr.c              | 1 +
 hw/s390x/s390-skeys.c       | 1 +
 hw/s390x/tod.c              | 1 +
 hw/s390x/virtio-ccw.c       | 1 +
 hw/scsi/mptsas.c            | 1 +
 hw/scsi/scsi-bus.c          | 1 +
 hw/scsi/scsi-disk.c         | 1 +
 hw/scsi/scsi-generic.c      | 1 +
 hw/scsi/virtio-scsi.c       | 1 +
 hw/timer/i8254_common.c     | 1 +
 hw/timer/twl92230.c         | 1 +
 hw/usb/redirect.c           | 1 +
 hw/virtio/vhost.c           | 1 +
 hw/virtio/virtio-mmio.c     | 1 +
 hw/virtio/virtio-pci.c      | 1 +
 hw/virtio/virtio.c          | 1 +
 include/hw/hw.h             | 1 -
 include/migration/cpu.h     | 1 +
 target/ppc/kvm.c            | 1 +
 30 files changed, 29 insertions(+), 1 deletion(-)

[...]

include/hw/hw.h line 14

Quoted 9 lines
include/hw/hw.h +0 -1
index a4fb2390e8..b399627cbe 100644
@@ -11,7 +11,6 @@
 #include "exec/memory.h"
 #include "hw/irq.h"
 #include "migration/vmstate.h"
-#include "migration/qemu-file-types.h"
Quoted 28 lines
include/hw/hw.h +0 -0
 void QEMU_NORETURN hw_error(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
 
include/migration/cpu.h +1 -0
index 8424f1631a..21c4fc9eab 100644
@@ -3,6 +3,7 @@
 #define MIGRATION_CPU_H
 
 #include "exec/cpu-defs.h"
+#include "migration/qemu-file-types.h"
 
 #if TARGET_LONG_BITS == 64
 #define qemu_put_betl qemu_put_be64
target/ppc/kvm.c +1 -0
index 8a06d3171e..4bd95be9cd 100644
@@ -38,6 +38,7 @@
 #include "hw/ppc/spapr.h"
 #include "hw/ppc/spapr_cpu_core.h"
 #include "hw/ppc/ppc.h"
+#include "migration/qemu-file-types.h"
 #include "sysemu/watchdog.h"
 #include "trace.h"
 #include "exec/gdbstub.h"
#26 lore raw

Re: [Qemu-devel] [PATCH v2 09/29] Include migration/qemu-file-types.h a lot less

Quoted 45 lines · Philippe Mathieu-Daudé
Quoted 43 lines · Markus Armbruster

In my "build everything" tree, changing migration/qemu-file-types.h triggers a recompile of some 2600 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h).

The culprit is again hw/hw.h, which supposedly includes it for convenience.

Include migration/qemu-file-types.h only where it's needed. Touching it now recompiles less than 200 objects.

---
 hw/acpi/piix4.c             | 1 +
 hw/block/virtio-blk.c       | 1 +
 hw/char/virtio-serial-bus.c | 1 +
 hw/display/virtio-gpu.c     | 1 +
 hw/intc/apic_common.c       | 1 +
 hw/nvram/eeprom93xx.c       | 1 +
 hw/nvram/fw_cfg.c           | 1 +
 hw/pci-host/piix.c          | 1 +
 hw/pci/msix.c               | 1 +
 hw/pci/pci.c                | 1 +
 hw/pci/shpc.c               | 1 +
 hw/ppc/spapr.c              | 1 +
 hw/s390x/s390-skeys.c       | 1 +
 hw/s390x/tod.c              | 1 +
 hw/s390x/virtio-ccw.c       | 1 +
 hw/scsi/mptsas.c            | 1 +
 hw/scsi/scsi-bus.c          | 1 +
 hw/scsi/scsi-disk.c         | 1 +
 hw/scsi/scsi-generic.c      | 1 +
 hw/scsi/virtio-scsi.c       | 1 +
 hw/timer/i8254_common.c     | 1 +
 hw/timer/twl92230.c         | 1 +
 hw/usb/redirect.c           | 1 +
 hw/virtio/vhost.c           | 1 +
 hw/virtio/virtio-mmio.c     | 1 +
 hw/virtio/virtio-pci.c      | 1 +
 hw/virtio/virtio.c          | 1 +
 include/hw/hw.h             | 1 -
 include/migration/cpu.h     | 1 +
 target/ppc/kvm.c            | 1 +
 30 files changed, 29 insertions(+), 1 deletion(-)

[...]

Quoted 12 lines

include/hw/hw.h line 14

Quoted 9 lines
include/hw/hw.h +0 -1
index a4fb2390e8..b399627cbe 100644
@@ -11,7 +11,6 @@
 #include "exec/memory.h"
 #include "hw/irq.h"
 #include "migration/vmstate.h"
-#include "migration/qemu-file-types.h"

Oops another miss:

hw/intc/s390_flic_kvm.c: In function 'kvm_flic_save':
hw/intc/s390_flic_kvm.c:395:9: error: implicit declaration of function 'qemu_put_be64' [-Werror=implicit-function-declaration]

         qemu_put_be64(f, FLIC_FAILED);
         ^~~~~~~~~~~~~
Quoted 14 lines
Quoted 14 lines
include/hw/hw.h +0 -0
 void QEMU_NORETURN hw_error(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
 
include/migration/cpu.h +1 -0
index 8424f1631a..21c4fc9eab 100644
@@ -3,6 +3,7 @@
 #define MIGRATION_CPU_H
 
 #include "exec/cpu-defs.h"
+#include "migration/qemu-file-types.h"
 
 #if TARGET_LONG_BITS == 64
 #define qemu_put_betl qemu_put_be64
#27 lore raw

Re: [Qemu-devel] [PATCH v2 09/29] Include migration/qemu-file-types.h a lot less

Quoted 59 lines · Philippe Mathieu-Daudé
Quoted 45 lines · Philippe Mathieu-Daudé
Quoted 43 lines · Markus Armbruster

In my "build everything" tree, changing migration/qemu-file-types.h triggers a recompile of some 2600 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h).

The culprit is again hw/hw.h, which supposedly includes it for convenience.

Include migration/qemu-file-types.h only where it's needed. Touching it now recompiles less than 200 objects.

---
 hw/acpi/piix4.c             | 1 +
 hw/block/virtio-blk.c       | 1 +
 hw/char/virtio-serial-bus.c | 1 +
 hw/display/virtio-gpu.c     | 1 +
 hw/intc/apic_common.c       | 1 +
 hw/nvram/eeprom93xx.c       | 1 +
 hw/nvram/fw_cfg.c           | 1 +
 hw/pci-host/piix.c          | 1 +
 hw/pci/msix.c               | 1 +
 hw/pci/pci.c                | 1 +
 hw/pci/shpc.c               | 1 +
 hw/ppc/spapr.c              | 1 +
 hw/s390x/s390-skeys.c       | 1 +
 hw/s390x/tod.c              | 1 +
 hw/s390x/virtio-ccw.c       | 1 +
 hw/scsi/mptsas.c            | 1 +
 hw/scsi/scsi-bus.c          | 1 +
 hw/scsi/scsi-disk.c         | 1 +
 hw/scsi/scsi-generic.c      | 1 +
 hw/scsi/virtio-scsi.c       | 1 +
 hw/timer/i8254_common.c     | 1 +
 hw/timer/twl92230.c         | 1 +
 hw/usb/redirect.c           | 1 +
 hw/virtio/vhost.c           | 1 +
 hw/virtio/virtio-mmio.c     | 1 +
 hw/virtio/virtio-pci.c      | 1 +
 hw/virtio/virtio.c          | 1 +
 include/hw/hw.h             | 1 -
 include/migration/cpu.h     | 1 +
 target/ppc/kvm.c            | 1 +
 30 files changed, 29 insertions(+), 1 deletion(-)

[...]

Quoted 12 lines

include/hw/hw.h line 14

Quoted 9 lines
include/hw/hw.h +0 -1
index a4fb2390e8..b399627cbe 100644
@@ -11,7 +11,6 @@
 #include "exec/memory.h"
 #include "hw/irq.h"
 #include "migration/vmstate.h"
-#include "migration/qemu-file-types.h"
Quoted 7 lines

Oops another miss:

hw/intc/s390_flic_kvm.c: In function 'kvm_flic_save':
hw/intc/s390_flic_kvm.c:395:9: error: implicit declaration of function 'qemu_put_be64' [-Werror=implicit-function-declaration]

         qemu_put_be64(f, FLIC_FAILED);
         ^~~~~~~~~~~~~

Patchew found this, too. I'll fix it. Thanks!

#28 lore raw

PATCH v2 10/29 ide: Include hw/ide/internal a bit less outside hw/ide/

In reply to Markus Armbruster

According to hw/ide/internal's file comment, only files in hw/ide/ are supposed to include it. Drag reality slightly closer to supposition.

Three includes outside hw/ide remain: hw/arm/sbsa-ref.c, include/hw/ide/pci.h, and include/hw/misc/macio/macio.h. Turns out board code needs ide-internal.h to wire up IDE stuff. More cleanup is needed. Left for another day.

---
 hw/arm/allwinner-a10.c         | 1 +
 hw/arm/cubieboard.c            | 1 +
 hw/arm/xlnx-zynqmp.c           | 1 +
 hw/ide/ahci_internal.h         | 1 +
 hw/ppc/mac.h                   | 1 -
 include/hw/arm/allwinner-a10.h | 1 -
 include/hw/arm/xlnx-zynqmp.h   | 1 -
 include/hw/misc/mos6522.h      | 1 -
 8 files changed, 4 insertions(+), 4 deletions(-)
hw/arm/allwinner-a10.c +1 -0
index 35e906ca54..3b0d3eccdd 100644
@@ -16,6 +16,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "exec/address-spaces.h"
 #include "qapi/error.h"
 #include "qemu/module.h"
 #include "cpu.h"
hw/arm/cubieboard.c +1 -0
index f7c8a5985a..38e0ca0f53 100644
@@ -16,6 +16,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "exec/address-spaces.h"
 #include "qapi/error.h"
 #include "cpu.h"
 #include "hw/sysbus.h"
hw/arm/xlnx-zynqmp.c +1 -0
index a60830d37a..0f587e63d3 100644
@@ -24,6 +24,7 @@
 #include "hw/boards.h"
 #include "exec/address-spaces.h"
 #include "sysemu/kvm.h"
+#include "sysemu/sysemu.h"
 #include "kvm_arm.h"
 
 #define GIC_NUM_SPI_INTR 160
hw/ide/ahci_internal.h +1 -0
index 95ecddcd3c..73424516da 100644
@@ -25,6 +25,7 @@
 #define HW_IDE_AHCI_INTERNAL_H
 
 #include "hw/ide/ahci.h"
+#include "hw/ide/internal.h"
 #include "hw/sysbus.h"
 
 #define AHCI_MEM_BAR_SIZE         0x1000
hw/ppc/mac.h +0 -1
index a741300ac9..6af87d1fa0 100644
@@ -30,7 +30,6 @@
 #include "exec/memory.h"
 #include "hw/boards.h"
 #include "hw/sysbus.h"
-#include "hw/ide/internal.h"
 #include "hw/input/adb.h"
 #include "hw/misc/mos6522.h"
 #include "hw/pci/pci_host.h"
include/hw/arm/allwinner-a10.h +0 -1
index 7182ce5c4b..101b72a71d 100644
@@ -7,7 +7,6 @@
 #include "hw/timer/allwinner-a10-pit.h"
 #include "hw/intc/allwinner-a10-pic.h"
 #include "hw/net/allwinner_emac.h"
-#include "hw/ide/pci.h"
 #include "hw/ide/ahci.h"
 
 #include "sysemu/sysemu.h"
include/hw/arm/xlnx-zynqmp.h +0 -1
index 6cb65e7537..d7483c3b42 100644
@@ -22,7 +22,6 @@
 #include "hw/intc/arm_gic.h"
 #include "hw/net/cadence_gem.h"
 #include "hw/char/cadence_uart.h"
-#include "hw/ide/pci.h"
 #include "hw/ide/ahci.h"
 #include "hw/sd/sdhci.h"
 #include "hw/ssi/xilinx_spips.h"
include/hw/misc/mos6522.h +0 -1
index 03d9f0c059..493c907537 100644
@@ -29,7 +29,6 @@
 
 #include "exec/memory.h"
 #include "hw/sysbus.h"
-#include "hw/ide/internal.h"
 #include "hw/input/adb.h"
 
 /* Bits in ACR */
Signature · 1 line
2.21.0
Reviewed-by on v2 10/29
#29 lore raw

Re: [Qemu-devel] [PATCH v2 10/29] ide: Include hw/ide/internal a bit less outside hw/ide/

Quoted 3 lines · Markus Armbruster

According to hw/ide/internal's file comment, only files in hw/ide/ are supposed to include it. Drag reality slightly closer to supposition.

The downside of having your internal include ripped away and stuck in the includes/ folder.

Quoted 5 lines

Three includes outside hw/ide remain: hw/arm/sbsa-ref.c, include/hw/ide/pci.h, and include/hw/misc/macio/macio.h. Turns out board code needs ide-internal.h to wire up IDE stuff. More cleanup is needed. Left for another day.

Yuh. This is mostly why I haven't touched it.

Quoted 2 lines

Thank you.

Quoted 108 lines
---
 hw/arm/allwinner-a10.c         | 1 +
 hw/arm/cubieboard.c            | 1 +
 hw/arm/xlnx-zynqmp.c           | 1 +
 hw/ide/ahci_internal.h         | 1 +
 hw/ppc/mac.h                   | 1 -
 include/hw/arm/allwinner-a10.h | 1 -
 include/hw/arm/xlnx-zynqmp.h   | 1 -
 include/hw/misc/mos6522.h      | 1 -
 8 files changed, 4 insertions(+), 4 deletions(-)
hw/arm/allwinner-a10.c +1 -0
index 35e906ca54..3b0d3eccdd 100644
@@ -16,6 +16,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "exec/address-spaces.h"
 #include "qapi/error.h"
 #include "qemu/module.h"
 #include "cpu.h"
hw/arm/cubieboard.c +1 -0
index f7c8a5985a..38e0ca0f53 100644
@@ -16,6 +16,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "exec/address-spaces.h"
 #include "qapi/error.h"
 #include "cpu.h"
 #include "hw/sysbus.h"
hw/arm/xlnx-zynqmp.c +1 -0
index a60830d37a..0f587e63d3 100644
@@ -24,6 +24,7 @@
 #include "hw/boards.h"
 #include "exec/address-spaces.h"
 #include "sysemu/kvm.h"
+#include "sysemu/sysemu.h"
 #include "kvm_arm.h"
 
 #define GIC_NUM_SPI_INTR 160
hw/ide/ahci_internal.h +1 -0
index 95ecddcd3c..73424516da 100644
@@ -25,6 +25,7 @@
 #define HW_IDE_AHCI_INTERNAL_H
 
 #include "hw/ide/ahci.h"
+#include "hw/ide/internal.h"
 #include "hw/sysbus.h"
 
 #define AHCI_MEM_BAR_SIZE         0x1000
hw/ppc/mac.h +0 -1
index a741300ac9..6af87d1fa0 100644
@@ -30,7 +30,6 @@
 #include "exec/memory.h"
 #include "hw/boards.h"
 #include "hw/sysbus.h"
-#include "hw/ide/internal.h"
 #include "hw/input/adb.h"
 #include "hw/misc/mos6522.h"
 #include "hw/pci/pci_host.h"
include/hw/arm/allwinner-a10.h +0 -1
index 7182ce5c4b..101b72a71d 100644
@@ -7,7 +7,6 @@
 #include "hw/timer/allwinner-a10-pit.h"
 #include "hw/intc/allwinner-a10-pic.h"
 #include "hw/net/allwinner_emac.h"
-#include "hw/ide/pci.h"
 #include "hw/ide/ahci.h"
 
 #include "sysemu/sysemu.h"
include/hw/arm/xlnx-zynqmp.h +0 -1
index 6cb65e7537..d7483c3b42 100644
@@ -22,7 +22,6 @@
 #include "hw/intc/arm_gic.h"
 #include "hw/net/cadence_gem.h"
 #include "hw/char/cadence_uart.h"
-#include "hw/ide/pci.h"
 #include "hw/ide/ahci.h"
 #include "hw/sd/sdhci.h"
 #include "hw/ssi/xilinx_spips.h"
include/hw/misc/mos6522.h +0 -1
index 03d9f0c059..493c907537 100644
@@ -29,7 +29,6 @@
 
 #include "exec/memory.h"
 #include "hw/sysbus.h"
-#include "hw/ide/internal.h"
 #include "hw/input/adb.h"
 
 /* Bits in ACR */
Reviewed-by Tested-by
#30 lore raw

Re: [Qemu-devel] [PATCH v2 10/29] ide: Include hw/ide/internal a bit less outside hw/ide/

Quoted 7 lines · John Snow
Quoted 3 lines · Markus Armbruster

According to hw/ide/internal's file comment, only files in hw/ide/ are supposed to include it. Drag reality slightly closer to supposition.

The downside of having your internal include ripped away and stuck in the includes/ folder.

Not sure this is a 'downside', it looks more than proper design issue to me (often the case with very old subsystems).

Quoted 6 lines
Quoted 5 lines

Three includes outside hw/ide remain: hw/arm/sbsa-ref.c, include/hw/ide/pci.h, and include/hw/misc/macio/macio.h. Turns out board code needs ide-internal.h to wire up IDE stuff. More cleanup is needed. Left for another day.

Quoted 8 lines

Yuh. This is mostly why I haven't touched it.

Quoted 2 lines

Thank you.

Quoted 109 lines
Quoted 108 lines
---
 hw/arm/allwinner-a10.c         | 1 +
 hw/arm/cubieboard.c            | 1 +
 hw/arm/xlnx-zynqmp.c           | 1 +
 hw/ide/ahci_internal.h         | 1 +
 hw/ppc/mac.h                   | 1 -
 include/hw/arm/allwinner-a10.h | 1 -
 include/hw/arm/xlnx-zynqmp.h   | 1 -
 include/hw/misc/mos6522.h      | 1 -
 8 files changed, 4 insertions(+), 4 deletions(-)
hw/arm/allwinner-a10.c +1 -0
index 35e906ca54..3b0d3eccdd 100644
@@ -16,6 +16,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "exec/address-spaces.h"
 #include "qapi/error.h"
 #include "qemu/module.h"
 #include "cpu.h"
hw/arm/cubieboard.c +1 -0
index f7c8a5985a..38e0ca0f53 100644
@@ -16,6 +16,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "exec/address-spaces.h"
 #include "qapi/error.h"
 #include "cpu.h"
 #include "hw/sysbus.h"
hw/arm/xlnx-zynqmp.c +1 -0
index a60830d37a..0f587e63d3 100644
@@ -24,6 +24,7 @@
 #include "hw/boards.h"
 #include "exec/address-spaces.h"
 #include "sysemu/kvm.h"
+#include "sysemu/sysemu.h"
 #include "kvm_arm.h"
 
 #define GIC_NUM_SPI_INTR 160
hw/ide/ahci_internal.h +1 -0
index 95ecddcd3c..73424516da 100644
@@ -25,6 +25,7 @@
 #define HW_IDE_AHCI_INTERNAL_H
 
 #include "hw/ide/ahci.h"
+#include "hw/ide/internal.h"
 #include "hw/sysbus.h"
 
 #define AHCI_MEM_BAR_SIZE         0x1000
hw/ppc/mac.h +0 -1
index a741300ac9..6af87d1fa0 100644
@@ -30,7 +30,6 @@
 #include "exec/memory.h"
 #include "hw/boards.h"
 #include "hw/sysbus.h"
-#include "hw/ide/internal.h"
 #include "hw/input/adb.h"
 #include "hw/misc/mos6522.h"
 #include "hw/pci/pci_host.h"
include/hw/arm/allwinner-a10.h +0 -1
index 7182ce5c4b..101b72a71d 100644
@@ -7,7 +7,6 @@
 #include "hw/timer/allwinner-a10-pit.h"
 #include "hw/intc/allwinner-a10-pic.h"
 #include "hw/net/allwinner_emac.h"
-#include "hw/ide/pci.h"
 #include "hw/ide/ahci.h"
 
 #include "sysemu/sysemu.h"
include/hw/arm/xlnx-zynqmp.h +0 -1
index 6cb65e7537..d7483c3b42 100644
@@ -22,7 +22,6 @@
 #include "hw/intc/arm_gic.h"
 #include "hw/net/cadence_gem.h"
 #include "hw/char/cadence_uart.h"
-#include "hw/ide/pci.h"
 #include "hw/ide/ahci.h"
 #include "hw/sd/sdhci.h"
 #include "hw/ssi/xilinx_spips.h"
include/hw/misc/mos6522.h +0 -1
index 03d9f0c059..493c907537 100644
@@ -29,7 +29,6 @@
 
 #include "exec/memory.h"
 #include "hw/sysbus.h"
-#include "hw/ide/internal.h"
 #include "hw/input/adb.h"
 
 /* Bits in ACR */
#31 lore raw

Re: [Qemu-devel] [PATCH v2 10/29] ide: Include hw/ide/internal a bit less outside hw/ide/

Quoted 6 lines · Philippe Mathieu-Daudé
Quoted 5 lines · John Snow
Quoted 3 lines · Markus Armbruster

According to hw/ide/internal's file comment, only files in hw/ide/ are supposed to include it. Drag reality slightly closer to supposition.

Quoted 6 lines
Quoted 2 lines

The downside of having your internal include ripped away and stuck in the includes/ folder.

Not sure this is a 'downside', it looks more than proper design issue to me (often the case with very old subsystems).

For context, the "internal" header here used to actually be internal. It was moved wholesale to the "public" includes directory, which makes it easier for people to start stealing things from inside of it, which causes trouble.

--js

#32 lore raw

PATCH v2 11/29 typedefs: Separate incomplete types and function types

In reply to Markus Armbruster

While there, drop the obsolete file comment.

---
 include/qemu/typedefs.h | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
include/qemu/typedefs.h +8 -4
index fcdaae58c4..29346648d4 100644
@@ -1,10 +1,10 @@
 #ifndef QEMU_TYPEDEFS_H
 #define QEMU_TYPEDEFS_H
 
-/* A load of opaque types so that device init declarations don't have to
-   pull in all the real definitions.  */
-
-/* Please keep this list in case-insensitive alphabetical order */
+/*
+ * Incomplete struct types
+ * Please keep this list in case-insensitive alphabetical order.
+ */
 typedef struct AdapterInfo AdapterInfo;
 typedef struct AddressSpace AddressSpace;
 typedef struct AioContext AioContext;
@@ -101,6 +101,10 @@ typedef struct SHPCDevice SHPCDevice;
 typedef struct SSIBus SSIBus;
 typedef struct VirtIODevice VirtIODevice;
 typedef struct Visitor Visitor;
+
+/*
+ * Function types
+ */
 typedef void SaveStateHandler(QEMUFile *f, void *opaque);
 typedef int LoadStateHandler(QEMUFile *f, void *opaque, int version_id);
 
Signature · 1 line
2.21.0
Reviewed-by Tested-by on v2 11/29
#33 lore raw

Re: [Qemu-devel] [PATCH v2 11/29] typedefs: Separate incomplete types and function types

Quoted 3 lines · Markus Armbruster

While there, drop the obsolete file comment.

Quoted 35 lines
---
 include/qemu/typedefs.h | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
include/qemu/typedefs.h +8 -4
index fcdaae58c4..29346648d4 100644
@@ -1,10 +1,10 @@
 #ifndef QEMU_TYPEDEFS_H
 #define QEMU_TYPEDEFS_H
 
-/* A load of opaque types so that device init declarations don't have to
-   pull in all the real definitions.  */
-
-/* Please keep this list in case-insensitive alphabetical order */
+/*
+ * Incomplete struct types
+ * Please keep this list in case-insensitive alphabetical order.
+ */
 typedef struct AdapterInfo AdapterInfo;
 typedef struct AddressSpace AddressSpace;
 typedef struct AioContext AioContext;
@@ -101,6 +101,10 @@ typedef struct SHPCDevice SHPCDevice;
 typedef struct SSIBus SSIBus;
 typedef struct VirtIODevice VirtIODevice;
 typedef struct Visitor Visitor;
+
+/*
+ * Function types
+ */
 typedef void SaveStateHandler(QEMUFile *f, void *opaque);
 typedef int LoadStateHandler(QEMUFile *f, void *opaque, int version_id);
 
#34 lore raw

PATCH v2 12/29 Include hw/irq.h a lot less

In reply to Markus Armbruster

In my "build everything" tree, changing hw/irq.h triggers a recompile of some 5400 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h).

hw/hw.h supposedly includes it for convenience. Several other headers include it just to get qemu_irq and.or qemu_irq_handler.

Move the qemu_irq and qemu_irq_handler typedefs from hw/irq.h to qemu/typedefs.h, and then include hw/irq.h only where it's still needed. Touching it now recompiles only some 500 objects.

---
 hw/acpi/core.c                   | 1 +
 hw/acpi/piix4.c                  | 1 +
 hw/alpha/alpha_sys.h             | 1 -
 hw/alpha/typhoon.c               | 1 +
 hw/arm/armsse.c                  | 1 +
 hw/arm/exynos4210.c              | 1 +
 hw/arm/exynos4_boards.c          | 1 +
 hw/arm/integratorcp.c            | 1 +
 hw/arm/msf2-soc.c                | 1 +
 hw/arm/musicpal.c                | 1 +
 hw/arm/omap1.c                   | 1 +
 hw/arm/omap2.c                   | 1 +
 hw/arm/palm.c                    | 2 ++
 hw/arm/pxa2xx.c                  | 1 +
 hw/arm/pxa2xx_gpio.c             | 1 +
 hw/arm/realview.c                | 1 +
 hw/arm/smmuv3.c                  | 1 +
 hw/arm/spitz.c                   | 1 +
 hw/arm/stellaris.c               | 1 +
 hw/arm/strongarm.c               | 1 +
 hw/arm/tosa.c                    | 1 +
 hw/arm/versatilepb.c             | 1 +
 hw/arm/virt.c                    | 1 +
 hw/arm/z2.c                      | 1 +
 hw/audio/cs4231a.c               | 1 +
 hw/audio/gus.c                   | 1 +
 hw/audio/marvell_88w8618.c       | 1 +
 hw/audio/milkymist-ac97.c        | 1 +
 hw/audio/pl041.c                 | 1 +
 hw/audio/sb16.c                  | 1 +
 hw/block/fdc.c                   | 1 +
 hw/char/bcm2835_aux.c            | 1 +
 hw/char/cadence_uart.c           | 1 +
 hw/char/cmsdk-apb-uart.c         | 1 +
 hw/char/escc.c                   | 1 +
 hw/char/etraxfs_ser.c            | 1 +
 hw/char/exynos4210_uart.c        | 1 +
 hw/char/grlib_apbuart.c          | 1 +
 hw/char/imx_serial.c             | 1 +
 hw/char/ipoctal232.c             | 1 +
 hw/char/lm32_uart.c              | 1 +
 hw/char/mcf_uart.c               | 1 +
 hw/char/milkymist-uart.c         | 1 +
 hw/char/nrf51_uart.c             | 1 +
 hw/char/parallel.c               | 1 +
 hw/char/pl011.c                  | 1 +
 hw/char/serial-pci-multi.c       | 1 +
 hw/char/serial-pci.c             | 1 +
 hw/char/serial.c                 | 1 +
 hw/char/sh_serial.c              | 2 ++
 hw/char/spapr_vty.c              | 1 +
 hw/char/stm32f2xx_usart.c        | 1 +
 hw/char/xilinx_uartlite.c        | 1 +
 hw/core/or-irq.c                 | 1 +
 hw/core/qdev.c                   | 1 +
 hw/core/split-irq.c              | 1 +
 hw/cpu/a15mpcore.c               | 1 +
 hw/cpu/a9mpcore.c                | 1 +
 hw/cpu/arm11mpcore.c             | 1 +
 hw/cpu/realview_mpcore.c         | 1 +
 hw/display/ads7846.c             | 1 +
 hw/display/bcm2835_fb.c          | 1 +
 hw/display/cg3.c                 | 1 +
 hw/display/exynos4210_fimd.c     | 1 +
 hw/display/g364fb.c              | 1 +
 hw/display/milkymist-tmu2.c      | 1 +
 hw/display/omap_dss.c            | 2 ++
 hw/display/omap_lcdc.c           | 2 ++
 hw/display/pl110.c               | 1 +
 hw/display/pxa2xx_lcd.c          | 1 +
 hw/display/tc6393xb.c            | 2 ++
 hw/display/xlnx_dp.c             | 1 +
 hw/dma/bcm2835_dma.c             | 1 +
 hw/dma/etraxfs_dma.c             | 2 ++
 hw/dma/pl080.c                   | 1 +
 hw/dma/pl330.c                   | 1 +
 hw/dma/pxa2xx_dma.c              | 1 +
 hw/dma/rc4030.c                  | 1 +
 hw/dma/sparc32_dma.c             | 1 +
 hw/dma/xilinx_axidma.c           | 1 +
 hw/dma/xlnx-zdma.c               | 1 +
 hw/dma/xlnx-zynq-devcfg.c        | 1 +
 hw/dma/xlnx_dpdma.c              | 1 +
 hw/gpio/bcm2835_gpio.c           | 1 +
 hw/gpio/gpio_key.c               | 1 +
 hw/gpio/imx_gpio.c               | 1 +
 hw/gpio/max7310.c                | 1 +
 hw/gpio/mpc8xxx.c                | 1 +
 hw/gpio/nrf51_gpio.c             | 1 +
 hw/gpio/omap_gpio.c              | 1 +
 hw/gpio/pl061.c                  | 1 +
 hw/gpio/zaurus.c                 | 1 +
 hw/hppa/dino.c                   | 1 +
 hw/hppa/hppa_sys.h               | 1 -
 hw/i2c/aspeed_i2c.c              | 1 +
 hw/i2c/bitbang_i2c.c             | 1 +
 hw/i2c/exynos4210_i2c.c          | 1 +
 hw/i2c/imx_i2c.c                 | 1 +
 hw/i2c/mpc_i2c.c                 | 1 +
 hw/i2c/omap_i2c.c                | 1 +
 hw/i2c/ppc4xx_i2c.c              | 1 +
 hw/i386/kvm/i8259.c              | 1 +
 hw/i386/kvm/ioapic.c             | 1 +
 hw/i386/pc.c                     | 1 +
 hw/i386/pc_piix.c                | 1 +
 hw/i386/xen/xen-hvm.c            | 1 +
 hw/input/lm832x.c                | 1 +
 hw/input/milkymist-softusb.c     | 1 +
 hw/input/pckbd.c                 | 1 +
 hw/input/pl050.c                 | 1 +
 hw/input/pxa2xx_keypad.c         | 1 +
 hw/input/stellaris_input.c       | 2 ++
 hw/input/tsc2005.c               | 1 +
 hw/input/tsc210x.c               | 1 +
 hw/intc/allwinner-a10-pic.c      | 1 +
 hw/intc/arm_gic.c                | 1 +
 hw/intc/arm_gicv2m.c             | 1 +
 hw/intc/arm_gicv3_cpuif.c        | 1 +
 hw/intc/armv7m_nvic.c            | 1 +
 hw/intc/aspeed_vic.c             | 1 +
 hw/intc/bcm2835_ic.c             | 1 +
 hw/intc/bcm2836_control.c        | 1 +
 hw/intc/etraxfs_pic.c            | 1 +
 hw/intc/exynos4210_combiner.c    | 1 +
 hw/intc/heathrow_pic.c           | 1 +
 hw/intc/i8259.c                  | 2 ++
 hw/intc/imx_avic.c               | 1 +
 hw/intc/lm32_pic.c               | 1 +
 hw/intc/mips_gic.c               | 1 +
 hw/intc/nios2_iic.c              | 1 +
 hw/intc/omap_intc.c              | 1 +
 hw/intc/ompic.c                  | 1 +
 hw/intc/openpic.c                | 1 +
 hw/intc/pl190.c                  | 1 +
 hw/intc/puv3_intc.c              | 1 +
 hw/intc/realview_gic.c           | 1 +
 hw/intc/sh_intc.c                | 1 +
 hw/intc/slavio_intctl.c          | 1 +
 hw/intc/xics.c                   | 1 +
 hw/intc/xilinx_intc.c            | 1 +
 hw/intc/xive.c                   | 1 +
 hw/intc/xlnx-pmu-iomod-intc.c    | 1 +
 hw/intc/xlnx-zynqmp-ipi.c        | 1 +
 hw/ipack/ipack.c                 | 1 +
 hw/ipack/tpci200.c               | 1 +
 hw/ipmi/isa_ipmi_bt.c            | 1 +
 hw/ipmi/isa_ipmi_kcs.c           | 1 +
 hw/isa/i82378.c                  | 1 +
 hw/isa/lpc_ich9.c                | 2 ++
 hw/lm32/lm32_boards.c            | 1 +
 hw/lm32/milkymist.c              | 1 +
 hw/m68k/mcf5206.c                | 2 ++
 hw/m68k/mcf5208.c                | 2 ++
 hw/m68k/mcf_intc.c               | 1 +
 hw/mips/gt64xxx_pci.c            | 1 +
 hw/mips/mips_int.c               | 1 +
 hw/mips/mips_malta.c             | 1 +
 hw/misc/arm_sysctl.c             | 1 +
 hw/misc/armsse-mhu.c             | 1 +
 hw/misc/aspeed_xdma.c            | 1 +
 hw/misc/bcm2835_mbox.c           | 1 +
 hw/misc/bcm2835_property.c       | 1 +
 hw/misc/eccmemctl.c              | 1 +
 hw/misc/iotkit-secctl.c          | 1 +
 hw/misc/macio/mac_dbdma.c        | 1 +
 hw/misc/macio/pmu.c              | 1 +
 hw/misc/max111x.c                | 1 +
 hw/misc/milkymist-pfpu.c         | 1 +
 hw/misc/mos6522.c                | 1 +
 hw/misc/mst_fpga.c               | 1 +
 hw/misc/nrf51_rng.c              | 1 +
 hw/misc/omap_clk.c               | 2 ++
 hw/misc/omap_gpmc.c              | 2 ++
 hw/misc/pc-testdev.c             | 1 +
 hw/misc/slavio_misc.c            | 1 +
 hw/misc/tmp105.c                 | 1 +
 hw/misc/tz-mpc.c                 | 1 +
 hw/misc/tz-msc.c                 | 1 +
 hw/misc/tz-ppc.c                 | 1 +
 hw/misc/zynq-xadc.c              | 1 +
 hw/net/allwinner_emac.c          | 1 +
 hw/net/cadence_gem.c             | 1 +
 hw/net/can/can_kvaser_pci.c      | 1 +
 hw/net/can/can_mioe3680_pci.c    | 1 +
 hw/net/can/can_pcm3680_pci.c     | 1 +
 hw/net/can/can_sja1000.c         | 2 ++
 hw/net/dp8393x.c                 | 1 +
 hw/net/fsl_etsec/etsec.c         | 1 +
 hw/net/ftgmac100.c               | 1 +
 hw/net/imx_fec.c                 | 1 +
 hw/net/lan9118.c                 | 1 +
 hw/net/mcf_fec.c                 | 1 +
 hw/net/milkymist-minimac2.c      | 1 +
 hw/net/mipsnet.c                 | 1 +
 hw/net/ne2000-pci.c              | 2 ++
 hw/net/ne2000.c                  | 1 +
 hw/net/opencores_eth.c           | 1 +
 hw/net/pcnet-pci.c               | 1 +
 hw/net/pcnet.c                   | 1 +
 hw/net/smc91c111.c               | 1 +
 hw/net/spapr_llan.c              | 1 +
 hw/net/stellaris_enet.c          | 1 +
 hw/net/xgmac.c                   | 1 +
 hw/net/xilinx_axienet.c          | 1 +
 hw/net/xilinx_ethlite.c          | 1 +
 hw/nios2/cpu_pic.c               | 1 +
 hw/openrisc/openrisc_sim.c       | 1 +
 hw/openrisc/pic_cpu.c            | 1 +
 hw/pci-host/bonito.c             | 1 +
 hw/pci-host/designware.c         | 1 +
 hw/pci-host/gpex.c               | 1 +
 hw/pci-host/grackle.c            | 1 +
 hw/pci-host/piix.c               | 1 +
 hw/pci-host/ppce500.c            | 1 +
 hw/pci-host/prep.c               | 1 +
 hw/pci-host/sabre.c              | 1 +
 hw/pci-host/uninorth.c           | 1 +
 hw/pci-host/versatile.c          | 1 +
 hw/pci-host/xilinx-pcie.c        | 1 +
 hw/pci/pci.c                     | 1 +
 hw/pcmcia/pxa2xx.c               | 1 +
 hw/ppc/e500.c                    | 1 +
 hw/ppc/pnv_lpc.c                 | 1 +
 hw/ppc/pnv_psi.c                 | 1 +
 hw/ppc/ppc.c                     | 2 ++
 hw/ppc/ppc405_uc.c               | 1 +
 hw/ppc/ppc440_pcix.c             | 1 +
 hw/ppc/ppc440_uc.c               | 1 +
 hw/ppc/ppc4xx_devs.c             | 1 +
 hw/ppc/ppc4xx_pci.c              | 1 +
 hw/ppc/prep.c                    | 1 +
 hw/ppc/prep_systemio.c           | 1 +
 hw/ppc/spapr_events.c            | 2 ++
 hw/ppc/spapr_irq.c               | 1 +
 hw/ppc/spapr_pci.c               | 1 +
 hw/ppc/spapr_vio.c               | 1 +
 hw/riscv/sifive_gpio.c           | 1 +
 hw/riscv/sifive_uart.c           | 1 +
 hw/scsi/esp-pci.c                | 1 +
 hw/scsi/esp.c                    | 1 +
 hw/scsi/lsi53c895a.c             | 1 +
 hw/sd/bcm2835_sdhost.c           | 1 +
 hw/sd/omap_mmc.c                 | 2 ++
 hw/sd/pl181.c                    | 1 +
 hw/sd/pxa2xx_mmci.c              | 1 +
 hw/sd/sd.c                       | 1 +
 hw/sd/sdhci.c                    | 1 +
 hw/sh4/r2d.c                     | 1 +
 hw/sh4/sh7750.c                  | 2 ++
 hw/sh4/sh_pci.c                  | 1 +
 hw/sparc/leon3.c                 | 1 +
 hw/sparc/sun4m.c                 | 1 +
 hw/sparc/sun4m_iommu.c           | 1 +
 hw/ssi/aspeed_smc.c              | 1 +
 hw/ssi/imx_spi.c                 | 1 +
 hw/ssi/mss-spi.c                 | 1 +
 hw/ssi/omap_spi.c                | 2 ++
 hw/ssi/pl022.c                   | 1 +
 hw/ssi/xilinx_spi.c              | 1 +
 hw/ssi/xilinx_spips.c            | 1 +
 hw/timer/a9gtimer.c              | 1 +
 hw/timer/allwinner-a10-pit.c     | 1 +
 hw/timer/altera_timer.c          | 1 +
 hw/timer/arm_mptimer.c           | 1 +
 hw/timer/arm_timer.c             | 1 +
 hw/timer/armv7m_systick.c        | 1 +
 hw/timer/aspeed_timer.c          | 1 +
 hw/timer/cadence_ttc.c           | 1 +
 hw/timer/cmsdk-apb-dualtimer.c   | 1 +
 hw/timer/cmsdk-apb-timer.c       | 1 +
 hw/timer/etraxfs_timer.c         | 1 +
 hw/timer/exynos4210_mct.c        | 1 +
 hw/timer/exynos4210_pwm.c        | 1 +
 hw/timer/exynos4210_rtc.c        | 1 +
 hw/timer/grlib_gptimer.c         | 1 +
 hw/timer/hpet.c                  | 1 +
 hw/timer/i8254.c                 | 1 +
 hw/timer/imx_epit.c              | 1 +
 hw/timer/imx_gpt.c               | 1 +
 hw/timer/lm32_timer.c            | 1 +
 hw/timer/m48t59.c                | 1 +
 hw/timer/mc146818rtc.c           | 1 +
 hw/timer/milkymist-sysctl.c      | 1 +
 hw/timer/mss-timer.c             | 1 +
 hw/timer/nrf51_timer.c           | 1 +
 hw/timer/omap_gptimer.c          | 2 ++
 hw/timer/pl031.c                 | 1 +
 hw/timer/puv3_ost.c              | 1 +
 hw/timer/pxa2xx_timer.c          | 1 +
 hw/timer/sh_timer.c              | 1 +
 hw/timer/slavio_timer.c          | 1 +
 hw/timer/stm32f2xx_timer.c       | 1 +
 hw/timer/twl92230.c              | 1 +
 hw/timer/xilinx_timer.c          | 1 +
 hw/timer/xlnx-zynqmp-rtc.c       | 1 +
 hw/tpm/tpm_tis.c                 | 1 +
 hw/unicore32/puv3.c              | 1 +
 hw/usb/hcd-ehci.c                | 1 +
 hw/usb/hcd-ohci.c                | 1 +
 hw/vfio/platform.c               | 1 +
 hw/virtio/virtio-mmio.c          | 1 +
 hw/watchdog/cmsdk-apb-watchdog.c | 1 +
 hw/xtensa/mx_pic.c               | 1 +
 hw/xtensa/pic_cpu.c              | 1 +
 include/hw/acpi/acpi.h           | 1 -
 include/hw/arm/boot.h            | 1 -
 include/hw/arm/omap.h            | 1 -
 include/hw/arm/soc_dma.h         | 1 -
 include/hw/block/fdc.h           | 1 -
 include/hw/bt.h                  | 1 -
 include/hw/core/split-irq.h      | 1 -
 include/hw/cris/etraxfs_dma.h    | 1 -
 include/hw/display/blizzard.h    | 1 -
 include/hw/display/tc6393xb.h    | 1 -
 include/hw/hw.h                  | 1 -
 include/hw/ide/internal.h        | 1 +
 include/hw/input/gamepad.h       | 1 -
 include/hw/input/tsc2xxx.h       | 1 -
 include/hw/irq.h                 | 4 ----
 include/hw/isa/vt82c686.h        | 1 -
 include/hw/mips/mips.h           | 1 -
 include/hw/misc/cbus.h           | 1 -
 include/hw/net/lan9118.h         | 1 -
 include/hw/net/smc91c111.h       | 1 -
 include/hw/or-irq.h              | 1 -
 include/hw/ppc/spapr_irq.h       | 1 -
 include/hw/qdev-core.h           | 1 -
 include/hw/sh4/sh_intc.h         | 1 -
 include/hw/timer/m48t59.h        | 1 -
 include/hw/tricore/tricore.h     | 1 -
 include/hw/vfio/vfio-platform.h  | 1 -
 include/hw/xen/xen.h             | 1 -
 include/hw/xtensa/mx_pic.h       | 1 -
 include/qemu/typedefs.h          | 9 +++++++++
 include/sysemu/kvm.h             | 1 -
 target/arm/helper.c              | 1 +
 target/arm/kvm.c                 | 1 +
 target/mips/cp0_timer.c          | 1 +
 338 files changed, 336 insertions(+), 34 deletions(-)
hw/acpi/core.c +1 -0
index 228828a494..39e9fb1a6c 100644
@@ -22,6 +22,7 @@
 #include "qemu/osdep.h"
 #include "sysemu/sysemu.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/acpi/acpi.h"
 #include "hw/nvram/fw_cfg.h"
 #include "qemu/config-file.h"
hw/acpi/piix4.c +1 -0
index 0d8c821f37..8f9a7ba2ab 100644
@@ -22,6 +22,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
+#include "hw/irq.h"
 #include "hw/isa/apm.h"
 #include "hw/i2c/pm_smbus.h"
 #include "hw/pci/pci.h"
hw/alpha/alpha_sys.h +0 -1
index b6d8369ed7..4e127a6de8 100644
@@ -8,7 +8,6 @@
 #include "hw/pci/pci_host.h"
 #include "hw/ide.h"
 #include "hw/i386/pc.h"
-#include "hw/irq.h"
 
 
 PCIBus *typhoon_init(ram_addr_t, ISABus **, qemu_irq *, AlphaCPU *[4],
hw/alpha/typhoon.c +1 -0
index 3f34a5153f..6797eb0abe 100644
@@ -12,6 +12,7 @@
 #include "qapi/error.h"
 #include "cpu.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "sysemu/sysemu.h"
 #include "alpha_sys.h"
 #include "exec/address-spaces.h"
hw/arm/armsse.c +1 -0
index b5c614cc3a..85cfa414eb 100644
@@ -19,6 +19,7 @@
 #include "hw/registerfields.h"
 #include "hw/arm/armsse.h"
 #include "hw/arm/boot.h"
+#include "hw/irq.h"
 
 /* Format of the System Information block SYS_CONFIG register */
 typedef enum SysConfigFormat {
hw/arm/exynos4210.c +1 -0
index becd864c19..9aa5ec3f5d 100644
@@ -26,6 +26,7 @@
 #include "qemu/log.h"
 #include "cpu.h"
 #include "hw/cpu/a9mpcore.h"
+#include "hw/irq.h"
 #include "hw/boards.h"
 #include "sysemu/sysemu.h"
 #include "hw/sysbus.h"
hw/arm/exynos4_boards.c +1 -0
index ac0b0dc2a9..7624e16084 100644
@@ -34,6 +34,7 @@
 #include "hw/arm/exynos4210.h"
 #include "hw/net/lan9118.h"
 #include "hw/boards.h"
+#include "hw/irq.h"
 
 #define SMDK_LAN9118_BASE_ADDR      0x05000000
 
hw/arm/integratorcp.c +1 -0
index 200c0107f0..d6025684f4 100644
@@ -20,6 +20,7 @@
 #include "sysemu/sysemu.h"
 #include "qemu/error-report.h"
 #include "hw/char/pl011.h"
+#include "hw/irq.h"
 
 #define TYPE_INTEGRATOR_CM "integrator_core"
 #define INTEGRATOR_CM(obj) \
hw/arm/msf2-soc.c +1 -0
index 1ccb644df7..4e5251c92e 100644
@@ -27,6 +27,7 @@
 #include "qapi/error.h"
 #include "exec/address-spaces.h"
 #include "hw/char/serial.h"
+#include "hw/irq.h"
 #include "hw/boards.h"
 #include "hw/arm/msf2-soc.h"
 #include "hw/misc/unimp.h"
hw/arm/musicpal.c +1 -0
index 95d56f3208..848e49f459 100644
@@ -23,6 +23,7 @@
 #include "hw/block/flash.h"
 #include "ui/console.h"
 #include "hw/i2c/i2c.h"
+#include "hw/irq.h"
 #include "hw/audio/wm8750.h"
 #include "sysemu/block-backend.h"
 #include "exec/address-spaces.h"
hw/arm/omap1.c +1 -0
index beaddaf11f..cce671014b 100644
@@ -24,6 +24,7 @@
 #include "cpu.h"
 #include "hw/boards.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/arm/boot.h"
 #include "hw/arm/omap.h"
 #include "sysemu/sysemu.h"
hw/arm/omap2.c +1 -0
index 7d4cac1f46..397630e2f2 100644
@@ -26,6 +26,7 @@
 #include "sysemu/reset.h"
 #include "hw/boards.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/arm/boot.h"
 #include "hw/arm/omap.h"
 #include "sysemu/sysemu.h"
hw/arm/palm.c +2 -0
index 9eb9612bce..a5eccb7290 100644
@@ -16,6 +16,7 @@
  * You should have received a copy of the GNU General Public License along
  * with this program; if not, see <http://www.gnu.org/licenses/>.
  */
+
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "hw/hw.h"
@@ -27,6 +28,7 @@
 #include "hw/boards.h"
 #include "hw/arm/boot.h"
 #include "hw/input/tsc2xxx.h"
+#include "hw/irq.h"
 #include "hw/loader.h"
 #include "exec/address-spaces.h"
 #include "cpu.h"
hw/arm/pxa2xx.c +1 -0
index e2e43ae6e8..ab3fbd7b64 100644
@@ -18,6 +18,7 @@
 #include "sysemu/sysemu.h"
 #include "hw/char/serial.h"
 #include "hw/i2c/i2c.h"
+#include "hw/irq.h"
 #include "hw/ssi/ssi.h"
 #include "chardev/char-fe.h"
 #include "sysemu/blockdev.h"
hw/arm/pxa2xx_gpio.c +1 -0
index d1fc9cba67..1b1fc499dc 100644
@@ -10,6 +10,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "hw/arm/pxa.h"
 #include "qemu/log.h"
hw/arm/realview.c +1 -0
index 7c56c8d2ed..b108a9ab26 100644
@@ -25,6 +25,7 @@
 #include "hw/char/pl011.h"
 #include "hw/cpu/a9mpcore.h"
 #include "hw/intc/realview_gic.h"
+#include "hw/irq.h"
 
 #define SMP_BOOT_ADDR 0xe0000000
 #define SMP_BOOTREG_ADDR 0x10000030
hw/arm/smmuv3.c +1 -0
index e96d5beb9a..ccca60720e 100644
@@ -18,6 +18,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/boards.h"
+#include "hw/irq.h"
 #include "sysemu/sysemu.h"
 #include "hw/sysbus.h"
 #include "hw/qdev-core.h"
hw/arm/spitz.c +1 -0
index 723cf5d592..b90431ffea 100644
@@ -18,6 +18,7 @@
 #include "sysemu/sysemu.h"
 #include "hw/pcmcia.h"
 #include "hw/i2c/i2c.h"
+#include "hw/irq.h"
 #include "hw/ssi/ssi.h"
 #include "hw/block/flash.h"
 #include "qemu/timer.h"
hw/arm/stellaris.c +1 -0
index 499035f5c8..088ae2dbd7 100644
@@ -22,6 +22,7 @@
 #include "hw/arm/armv7m.h"
 #include "hw/char/pl011.h"
 #include "hw/input/gamepad.h"
+#include "hw/irq.h"
 #include "hw/watchdog/cmsdk-apb-watchdog.h"
 #include "hw/misc/unimp.h"
 #include "cpu.h"
hw/arm/strongarm.c +1 -0
index fed51a8183..2e016f4b77 100644
@@ -31,6 +31,7 @@
 #include "qemu-common.h"
 #include "cpu.h"
 #include "hw/boards.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "strongarm.h"
 #include "qemu/error-report.h"
hw/arm/tosa.c +1 -0
index 7843d68d46..80c61aef16 100644
@@ -21,6 +21,7 @@
 #include "hw/boards.h"
 #include "hw/display/tc6393xb.h"
 #include "hw/i2c/i2c.h"
+#include "hw/irq.h"
 #include "hw/ssi/ssi.h"
 #include "hw/sysbus.h"
 #include "exec/address-spaces.h"
hw/arm/versatilepb.c +1 -0
index e5857117ac..bc922345a6 100644
@@ -17,6 +17,7 @@
 #include "sysemu/sysemu.h"
 #include "hw/pci/pci.h"
 #include "hw/i2c/i2c.h"
+#include "hw/irq.h"
 #include "hw/boards.h"
 #include "exec/address-spaces.h"
 #include "hw/block/flash.h"
hw/arm/virt.c +1 -0
index d9496c9363..0e5152ed3b 100644
@@ -57,6 +57,7 @@
 #include "hw/arm/fdt.h"
 #include "hw/intc/arm_gic.h"
 #include "hw/intc/arm_gicv3_common.h"
+#include "hw/irq.h"
 #include "kvm_arm.h"
 #include "hw/firmware/smbios.h"
 #include "qapi/visitor.h"
hw/arm/z2.c +1 -0
index 44aa748d39..366d46ff5f 100644
@@ -16,6 +16,7 @@
 #include "hw/arm/pxa.h"
 #include "hw/arm/boot.h"
 #include "hw/i2c/i2c.h"
+#include "hw/irq.h"
 #include "hw/ssi/ssi.h"
 #include "hw/boards.h"
 #include "sysemu/sysemu.h"
hw/audio/cs4231a.c +1 -0
index 7216b41cc1..9eeab137c7 100644
@@ -26,6 +26,7 @@
 #include "hw/hw.h"
 #include "hw/audio/soundhw.h"
 #include "audio/audio.h"
+#include "hw/irq.h"
 #include "hw/isa/isa.h"
 #include "hw/qdev.h"
 #include "qemu/module.h"
hw/audio/gus.c +1 -0
index 9ab51631d9..61230147ce 100644
@@ -28,6 +28,7 @@
 #include "hw/hw.h"
 #include "hw/audio/soundhw.h"
 #include "audio/audio.h"
+#include "hw/irq.h"
 #include "hw/isa/isa.h"
 #include "gusemu.h"
 #include "gustate.h"
hw/audio/marvell_88w8618.c +1 -0
index ff1a0d0d8f..167b478ec6 100644
@@ -13,6 +13,7 @@
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/audio/wm8750.h"
 #include "audio/audio.h"
 #include "qapi/error.h"
hw/audio/milkymist-ac97.c +1 -0
index bf6a5a6b96..3ba382ee4d 100644
@@ -23,6 +23,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "trace.h"
 #include "audio/audio.h"
hw/audio/pl041.c +1 -0
index 59c6ce1f2e..47f0dfff18 100644
@@ -21,6 +21,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
hw/audio/sb16.c +1 -0
index a2db06a2bb..ba5a5dd022 100644
@@ -26,6 +26,7 @@
 #include "hw/hw.h"
 #include "hw/audio/soundhw.h"
 #include "audio/audio.h"
+#include "hw/irq.h"
 #include "hw/isa/isa.h"
 #include "hw/qdev.h"
 #include "qemu/timer.h"
hw/block/fdc.c +1 -0
index 9b24cb9b85..91d5f56cec 100644
@@ -33,6 +33,7 @@
 #include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "qemu/timer.h"
+#include "hw/irq.h"
 #include "hw/isa/isa.h"
 #include "hw/sysbus.h"
 #include "hw/block/block.h"
hw/char/bcm2835_aux.c +1 -0
index 94679d276c..8395c79520 100644
@@ -22,6 +22,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/char/bcm2835_aux.h"
+#include "hw/irq.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
 
hw/char/cadence_uart.c +1 -0
index fa25fe24da..6b9eb140c7 100644
@@ -29,6 +29,7 @@
 #include "qemu/log.h"
 #include "qemu/module.h"
 #include "hw/char/cadence_uart.h"
+#include "hw/irq.h"
 
 #ifdef CADENCE_UART_ERR_DEBUG
 #define DB_PRINT(...) do { \
hw/char/cmsdk-apb-uart.c +1 -0
index 606c9cc7d6..dd96a3302e 100644
@@ -25,6 +25,7 @@
 #include "chardev/char-fe.h"
 #include "chardev/char-serial.h"
 #include "hw/char/cmsdk-apb-uart.h"
+#include "hw/irq.h"
 
 REG32(DATA, 0)
 REG32(STATE, 4)
hw/char/escc.c +1 -0
index 8ddbb4be4f..678d494d39 100644
@@ -24,6 +24,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "qemu/module.h"
 #include "hw/char/escc.h"
hw/char/etraxfs_ser.c +1 -0
index 9745bca86c..e93f31c76a 100644
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "chardev/char-fe.h"
 #include "qemu/log.h"
hw/char/exynos4210_uart.c +1 -0
index c5700eeaec..dabcd07415 100644
@@ -28,6 +28,7 @@
 #include "chardev/char-serial.h"
 
 #include "hw/arm/exynos4210.h"
+#include "hw/irq.h"
 
 #undef DEBUG_UART
 #undef DEBUG_UART_EXTEND
hw/char/grlib_apbuart.c +1 -0
index c2bb3ac153..13013e8a1c 100644
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/sparc/grlib.h"
 #include "hw/sysbus.h"
 #include "qemu/module.h"
hw/char/imx_serial.c +1 -0
index 0655a9571b..f79e47d4ee 100644
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/char/imx_serial.h"
+#include "hw/irq.h"
 #include "sysemu/sysemu.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
hw/char/ipoctal232.c +1 -0
index 5ab731e408..7674e2d7b6 100644
@@ -10,6 +10,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/ipack/ipack.h"
+#include "hw/irq.h"
 #include "qemu/bitops.h"
 #include "qemu/module.h"
 #include "chardev/char-fe.h"
hw/char/lm32_uart.c +1 -0
index d047a44e34..377032567a 100644
@@ -24,6 +24,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "trace.h"
 #include "chardev/char-fe.h"
hw/char/mcf_uart.c +1 -0
index 7b06110c4d..c403a1fdc6 100644
@@ -8,6 +8,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "qemu/module.h"
 #include "hw/m68k/mcf.h"
hw/char/milkymist-uart.c +1 -0
index 8a78fcca8f..d4641b5f44 100644
@@ -23,6 +23,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "trace.h"
 #include "chardev/char-fe.h"
hw/char/nrf51_uart.c +1 -0
index c90b491477..bbe766d3c6 100644
@@ -16,6 +16,7 @@
 #include "qemu/log.h"
 #include "qemu/module.h"
 #include "hw/char/nrf51_uart.h"
+#include "hw/irq.h"
 #include "trace.h"
 
 static void nrf51_uart_update_irq(NRF51UARTState *s)
hw/char/parallel.c +1 -0
index fed15dc548..ea8ab35e59 100644
@@ -29,6 +29,7 @@
 #include "hw/hw.h"
 #include "chardev/char-parallel.h"
 #include "chardev/char-fe.h"
+#include "hw/irq.h"
 #include "hw/isa/isa.h"
 #include "hw/char/parallel.h"
 #include "sysemu/reset.h"
hw/char/pl011.c +1 -0
index c1ae2f31f5..a2da375528 100644
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/char/pl011.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "chardev/char-fe.h"
 #include "qemu/log.h"
hw/char/serial-pci-multi.c +1 -0
index 63dcbaa984..65dbfbd205 100644
@@ -30,6 +30,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "hw/char/serial.h"
+#include "hw/irq.h"
 #include "hw/pci/pci.h"
 
 #define PCI_SERIAL_MAX_PORTS 4
hw/char/serial-pci.c +1 -0
index 9028efbda8..808d32b508 100644
@@ -29,6 +29,7 @@
 #include "qapi/error.h"
 #include "qemu/module.h"
 #include "hw/char/serial.h"
+#include "hw/irq.h"
 #include "hw/pci/pci.h"
 
 typedef struct PCISerialState {
hw/char/serial.c +1 -0
index a9e42f7d97..1d977287ea 100644
@@ -25,6 +25,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/char/serial.h"
+#include "hw/irq.h"
 #include "chardev/char-serial.h"
 #include "qapi/error.h"
 #include "qemu/timer.h"
hw/char/sh_serial.c +2 -0
index 67740b7ee6..7a40aa90af 100644
@@ -24,8 +24,10 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/sh4/sh.h"
 #include "chardev/char-fe.h"
 #include "qapi/error.h"
hw/char/spapr_vty.c +1 -0
index 871d2666f3..f360ab3612 100644
@@ -5,6 +5,7 @@
 #include "cpu.h"
 #include "hw/qdev.h"
 #include "chardev/char-fe.h"
+#include "hw/irq.h"
 #include "hw/ppc/spapr.h"
 #include "hw/ppc/spapr_vio.h"
 
hw/char/stm32f2xx_usart.c +1 -0
index 40c365b908..f43eb74fb1 100644
@@ -24,6 +24,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/char/stm32f2xx_usart.h"
+#include "hw/irq.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
 
hw/char/xilinx_uartlite.c +1 -0
index 880962a756..250eed945c 100644
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "qemu/module.h"
 #include "chardev/char-fe.h"
hw/core/or-irq.c +1 -0
index 123a8c644a..6ed34d9238 100644
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/or-irq.h"
 #include "qemu/module.h"
 
hw/core/qdev.c +1 -0
index 94ebc0a4a1..5c4b67a408 100644
@@ -35,6 +35,7 @@
 #include "qemu/error-report.h"
 #include "qemu/option.h"
 #include "hw/hotplug.h"
+#include "hw/irq.h"
 #include "hw/boards.h"
 #include "hw/sysbus.h"
 
hw/core/split-irq.c +1 -0
index c606f4a802..6808e812b5 100644
@@ -25,6 +25,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/core/split-irq.h"
+#include "hw/irq.h"
 #include "qapi/error.h"
 #include "qemu/module.h"
 
hw/cpu/a15mpcore.c +1 -0
index 980f230d75..fc19ed0214 100644
@@ -22,6 +22,7 @@
 #include "qapi/error.h"
 #include "qemu/module.h"
 #include "hw/cpu/a15mpcore.h"
+#include "hw/irq.h"
 #include "sysemu/kvm.h"
 #include "kvm_arm.h"
 
hw/cpu/a9mpcore.c +1 -0
index 187e4d939e..9dda4d8888 100644
@@ -12,6 +12,7 @@
 #include "qapi/error.h"
 #include "qemu/module.h"
 #include "hw/cpu/a9mpcore.h"
+#include "hw/irq.h"
 #include "qom/cpu.h"
 
 static void a9mp_priv_set_irq(void *opaque, int irq, int level)
hw/cpu/arm11mpcore.c +1 -0
index 2404f93a3e..c611a6ff32 100644
@@ -12,6 +12,7 @@
 #include "qemu/module.h"
 #include "hw/cpu/arm11mpcore.h"
 #include "hw/intc/realview_gic.h"
+#include "hw/irq.h"
 
 
 static void mpcore_priv_set_irq(void *opaque, int irq, int level)
hw/cpu/realview_mpcore.c +1 -0
index f06294bb5e..34da446d94 100644
@@ -13,6 +13,7 @@
 #include "qemu/module.h"
 #include "hw/cpu/arm11mpcore.h"
 #include "hw/intc/realview_gic.h"
+#include "hw/irq.h"
 
 #define TYPE_REALVIEW_MPCORE_RIRQ "realview_mpcore"
 #define REALVIEW_MPCORE_RIRQ(obj) \
hw/display/ads7846.c +1 -0
index 1a97e97638..12d8272615 100644
@@ -11,6 +11,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/ssi/ssi.h"
 #include "qemu/module.h"
 #include "ui/console.h"
hw/display/bcm2835_fb.c +1 -0
index 2311ec75b8..e446355f29 100644
@@ -26,6 +26,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "hw/display/bcm2835_fb.h"
+#include "hw/irq.h"
 #include "framebuffer.h"
 #include "ui/pixel_ops.h"
 #include "hw/misc/bcm2835_mbox_defs.h"
hw/display/cg3.c +1 -0
index a7340dc1c2..7cf9ebd604 100644
@@ -29,6 +29,7 @@
 #include "qemu/error-report.h"
 #include "ui/console.h"
 #include "hw/sysbus.h"
+#include "hw/irq.h"
 #include "hw/loader.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
hw/display/exynos4210_fimd.c +1 -0
index 61f7408b1c..889622eefa 100644
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "ui/console.h"
 #include "ui/pixel_ops.h"
hw/display/g364fb.c +1 -0
index 1774b4452e..89248f87df 100644
@@ -20,6 +20,7 @@
 #include "qemu/osdep.h"
 #include "qemu/units.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "qemu/error-report.h"
 #include "qemu/module.h"
 #include "ui/console.h"
hw/display/milkymist-tmu2.c +1 -0
index e1ed018b8f..3f92378410 100644
@@ -26,6 +26,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "trace.h"
 #include "qapi/error.h"
hw/display/omap_dss.c +2 -0
index 601f178fdd..637aae8d39 100644
@@ -17,8 +17,10 @@
  * You should have received a copy of the GNU General Public License along
  * with this program; if not, see <http://www.gnu.org/licenses/>.
  */
+
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "ui/console.h"
 #include "hw/arm/omap.h"
 
hw/display/omap_lcdc.c +2 -0
index 07a5effe04..b00ce04b3b 100644
@@ -16,8 +16,10 @@
  * You should have received a copy of the GNU General Public License along
  * with this program; if not, see <http://www.gnu.org/licenses/>.
  */
+
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "ui/console.h"
 #include "hw/arm/omap.h"
 #include "framebuffer.h"
hw/display/pl110.c +1 -0
index 2bdfc3cc49..8fb510ee73 100644
@@ -8,6 +8,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "ui/console.h"
 #include "framebuffer.h"
hw/display/pxa2xx_lcd.c +1 -0
index b83f80753a..7aca3912f5 100644
@@ -12,6 +12,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "ui/console.h"
 #include "hw/arm/pxa.h"
 #include "ui/pixel_ops.h"
hw/display/tc6393xb.c +2 -0
index 0b7c59cde7..10e7f74c74 100644
@@ -10,10 +10,12 @@
  * Contributions after 2012-01-13 are licensed under the terms of the
  * GNU GPL, version 2 or (at your option) any later version.
  */
+
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qemu/host-utils.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/display/tc6393xb.h"
 #include "hw/block/flash.h"
 #include "ui/console.h"
hw/display/xlnx_dp.c +1 -0
index cc5b650df0..4daac38070 100644
@@ -27,6 +27,7 @@
 #include "qemu/log.h"
 #include "qemu/module.h"
 #include "hw/display/xlnx_dp.h"
+#include "hw/irq.h"
 
 #ifndef DEBUG_DP
 #define DEBUG_DP 0
hw/dma/bcm2835_dma.c +1 -0
index a39e8f4968..090c73d951 100644
@@ -6,6 +6,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "hw/dma/bcm2835_dma.h"
+#include "hw/irq.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
 
hw/dma/etraxfs_dma.c +2 -0
index 85783eb847..4285443c81 100644
@@ -21,8 +21,10 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "exec/address-spaces.h"
 #include "sysemu/sysemu.h"
 
hw/dma/pl080.c +1 -0
index 7e5762457b..be7f9c71a8 100644
@@ -13,6 +13,7 @@
 #include "qemu/log.h"
 #include "qemu/module.h"
 #include "hw/dma/pl080.h"
+#include "hw/irq.h"
 #include "qapi/error.h"
 
 #define PL080_CONF_E    0x1
hw/dma/pl330.c +1 -0
index a56a3e7771..0d772de9f3 100644
@@ -16,6 +16,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "qapi/error.h"
 #include "qemu/timer.h"
hw/dma/pxa2xx_dma.c +1 -0
index d6fb957417..1c273fb309 100644
@@ -10,6 +10,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/arm/pxa.h"
 #include "hw/sysbus.h"
 #include "qapi/error.h"
hw/dma/rc4030.c +1 -0
index 155af9b26a..f7650f617c 100644
@@ -25,6 +25,7 @@
 #include "qemu/osdep.h"
 #include "qemu/units.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/mips/mips.h"
 #include "hw/sysbus.h"
 #include "qemu/timer.h"
hw/dma/sparc32_dma.c +1 -0
index 88765d0c25..a05b6be95c 100644
@@ -27,6 +27,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/sparc/sparc32_dma.h"
 #include "hw/sparc/sun4m_iommu.h"
 #include "hw/sysbus.h"
hw/dma/xilinx_axidma.c +1 -0
index 921be178d9..83b52e4ac7 100644
@@ -26,6 +26,7 @@
 #include "hw/sysbus.h"
 #include "qapi/error.h"
 #include "qemu/timer.h"
+#include "hw/irq.h"
 #include "hw/ptimer.h"
 #include "qemu/log.h"
 #include "qemu/main-loop.h"
hw/dma/xlnx-zdma.c +1 -0
index 51e1ead4fa..5afd77a5b8 100644
@@ -28,6 +28,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/dma/xlnx-zdma.h"
+#include "hw/irq.h"
 #include "qemu/bitops.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
hw/dma/xlnx-zynq-devcfg.c +1 -0
index 7a03ce1b02..855c784758 100644
@@ -26,6 +26,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/dma/xlnx-zynq-devcfg.h"
+#include "hw/irq.h"
 #include "qemu/bitops.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/dma.h"
hw/dma/xlnx_dpdma.c +1 -0
index e834f81e17..1bba7f2159 100644
@@ -27,6 +27,7 @@
 #include "qemu/log.h"
 #include "qemu/module.h"
 #include "hw/dma/xlnx_dpdma.h"
+#include "hw/irq.h"
 
 #ifndef DEBUG_DPDMA
 #define DEBUG_DPDMA 0
hw/gpio/bcm2835_gpio.c +1 -0
index ba8dd6c393..ea3f3f2bda 100644
@@ -19,6 +19,7 @@
 #include "hw/sysbus.h"
 #include "hw/sd/sd.h"
 #include "hw/gpio/bcm2835_gpio.h"
+#include "hw/irq.h"
 
 #define GPFSEL0   0x00
 #define GPFSEL1   0x04
hw/gpio/gpio_key.c +1 -0
index 7d5510257e..66866fa87c 100644
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "qemu/module.h"
 #include "qemu/timer.h"
hw/gpio/imx_gpio.c +1 -0
index a51af72c1f..3d3c9644db 100644
@@ -19,6 +19,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/gpio/imx_gpio.h"
+#include "hw/irq.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
 
hw/gpio/max7310.c +1 -0
index 273da622ca..b0925ab1a1 100644
@@ -9,6 +9,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/i2c/i2c.h"
+#include "hw/irq.h"
 #include "qemu/module.h"
 
 #define TYPE_MAX7310 "max7310"
hw/gpio/mpc8xxx.c +1 -0
index 6ff56dc3f2..f3b90b4b33 100644
@@ -20,6 +20,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "qemu/module.h"
 
hw/gpio/nrf51_gpio.c +1 -0
index dd6c16a841..24a890911a 100644
@@ -14,6 +14,7 @@
 #include "qemu/log.h"
 #include "qemu/module.h"
 #include "hw/gpio/nrf51_gpio.h"
+#include "hw/irq.h"
 #include "trace.h"
 
 /*
hw/gpio/omap_gpio.c +1 -0
index e2785c5dc7..6ab51a9428 100644
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/arm/omap.h"
 #include "hw/sysbus.h"
 #include "qemu/error-report.h"
hw/gpio/pl061.c +1 -0
index 02c01fd521..c605d91c93 100644
@@ -9,6 +9,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
hw/gpio/zaurus.c +1 -0
index f2f1f67266..98aa416931 100644
@@ -18,6 +18,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/arm/sharpsl.h"
 #include "hw/sysbus.h"
 #include "qemu/module.h"
hw/hppa/dino.c +1 -0
index e94614abbd..90da6bcbb9 100644
@@ -16,6 +16,7 @@
 #include "qapi/error.h"
 #include "cpu.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "sysemu/sysemu.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_bus.h"
hw/hppa/hppa_sys.h +0 -1
index f5f983bf4c..43d25d21fc 100644
@@ -7,7 +7,6 @@
 #include "hw/pci/pci_host.h"
 #include "hw/ide.h"
 #include "hw/i386/pc.h"
-#include "hw/irq.h"
 
 #include "hppa_hardware.h"
 
hw/i2c/aspeed_i2c.c +1 -0
index 219ad3806f..bb7ef3cbf3 100644
@@ -23,6 +23,7 @@
 #include "qemu/log.h"
 #include "qemu/module.h"
 #include "hw/i2c/aspeed_i2c.h"
+#include "hw/irq.h"
 
 /* I2C Global Register */
 
hw/i2c/bitbang_i2c.c +1 -0
index 60c7a9be0b..2289128aaf 100644
@@ -12,6 +12,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/i2c/bitbang_i2c.h"
 #include "hw/sysbus.h"
 #include "qemu/module.h"
hw/i2c/exynos4210_i2c.c +1 -0
index 70a97a3e2d..07d83d5a63 100644
@@ -25,6 +25,7 @@
 #include "qemu/timer.h"
 #include "hw/sysbus.h"
 #include "hw/i2c/i2c.h"
+#include "hw/irq.h"
 
 #ifndef EXYNOS4_I2C_DEBUG
 #define EXYNOS4_I2C_DEBUG                 0
hw/i2c/imx_i2c.c +1 -0
index ce7a94c282..1d6b695615 100644
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/i2c/imx_i2c.h"
+#include "hw/irq.h"
 #include "hw/i2c/i2c.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
hw/i2c/mpc_i2c.c +1 -0
index e9a1127050..0aa4cacb65 100644
@@ -19,6 +19,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/i2c/i2c.h"
+#include "hw/irq.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
 #include "hw/sysbus.h"
hw/i2c/omap_i2c.c +1 -0
index d7ebeae8e2..309a37b1fa 100644
@@ -22,6 +22,7 @@
 #include "qemu/module.h"
 #include "hw/hw.h"
 #include "hw/i2c/i2c.h"
+#include "hw/irq.h"
 #include "hw/arm/omap.h"
 #include "hw/sysbus.h"
 #include "qemu/error-report.h"
hw/i2c/ppc4xx_i2c.c +1 -0
index 462729db4e..d110b417c6 100644
@@ -30,6 +30,7 @@
 #include "cpu.h"
 #include "hw/hw.h"
 #include "hw/i2c/ppc4xx_i2c.h"
+#include "hw/irq.h"
 
 #define PPC4xx_I2C_MEM_SIZE 18
 
hw/i386/kvm/i8259.c +1 -0
index bfdeab29be..d0c1b1deac 100644
@@ -14,6 +14,7 @@
 #include "hw/isa/i8259_internal.h"
 #include "qemu/module.h"
 #include "hw/i386/apic_internal.h"
+#include "hw/irq.h"
 #include "sysemu/kvm.h"
 
 #define TYPE_KVM_I8259 "kvm-i8259"
hw/i386/kvm/ioapic.c +1 -0
index e453692199..99ef530967 100644
@@ -13,6 +13,7 @@
 #include "qemu/osdep.h"
 #include "monitor/monitor.h"
 #include "hw/i386/pc.h"
+#include "hw/irq.h"
 #include "hw/i386/ioapic_internal.h"
 #include "hw/i386/apic_internal.h"
 #include "sysemu/kvm.h"
hw/i386/pc.c +1 -0
index 73b55500b0..1453696975 100644
@@ -46,6 +46,7 @@
 #include "hw/dma/i8257.h"
 #include "hw/timer/i8254.h"
 #include "hw/input/i8042.h"
+#include "hw/irq.h"
 #include "hw/audio/pcspk.h"
 #include "hw/pci/msi.h"
 #include "hw/sysbus.h"
hw/i386/pc_piix.c +1 -0
index c2280c72ef..129f47493b 100644
@@ -38,6 +38,7 @@
 #include "net/net.h"
 #include "hw/boards.h"
 #include "hw/ide.h"
+#include "hw/irq.h"
 #include "sysemu/kvm.h"
 #include "hw/kvm/clock.h"
 #include "sysemu/sysemu.h"
hw/i386/xen/xen-hvm.c +1 -0
index e8e79e0917..f769cd91f2 100644
@@ -14,6 +14,7 @@
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_host.h"
 #include "hw/i386/pc.h"
+#include "hw/irq.h"
 #include "hw/i386/apic-msidef.h"
 #include "hw/xen/xen_common.h"
 #include "hw/xen/xen-legacy-backend.h"
hw/input/lm832x.c +1 -0
index ebb72c6590..2ab6d3290b 100644
@@ -21,6 +21,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/i2c/i2c.h"
+#include "hw/irq.h"
 #include "qemu/module.h"
 #include "qemu/timer.h"
 #include "sysemu/reset.h"
hw/input/milkymist-softusb.c +1 -0
index f779cd4370..92e07fbd8c 100644
@@ -28,6 +28,7 @@
 #include "trace.h"
 #include "ui/console.h"
 #include "hw/input/hid.h"
+#include "hw/irq.h"
 #include "qemu/error-report.h"
 #include "qemu/module.h"
 
hw/input/pckbd.c +1 -0
index 5d06a53362..7e76ee7ad3 100644
@@ -28,6 +28,7 @@
 #include "hw/isa/isa.h"
 #include "hw/i386/pc.h"
 #include "hw/input/ps2.h"
+#include "hw/irq.h"
 #include "hw/input/i8042.h"
 #include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
hw/input/pl050.c +1 -0
index b79bf1647d..2318dbfeac 100644
@@ -10,6 +10,7 @@
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
 #include "hw/input/ps2.h"
+#include "hw/irq.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
 
hw/input/pxa2xx_keypad.c +1 -0
index 93db9ed25b..4788c96d19 100644
@@ -13,6 +13,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/arm/pxa.h"
 #include "ui/console.h"
 
hw/input/stellaris_input.c +2 -0
index 3a666d61d4..ffea0542ba 100644
@@ -6,9 +6,11 @@
  *
  * This code is licensed under the GPL.
  */
+
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/input/gamepad.h"
+#include "hw/irq.h"
 #include "ui/console.h"
 
 typedef struct {
hw/input/tsc2005.c +1 -0
index 0a0431744c..e21356c18d 100644
@@ -25,6 +25,7 @@
 #include "sysemu/reset.h"
 #include "ui/console.h"
 #include "hw/input/tsc2xxx.h"
+#include "hw/irq.h"
 #include "trace.h"
 
 #define TSC_CUT_RESOLUTION(value, p)	((value) >> (16 - (p ? 12 : 10)))
hw/input/tsc210x.c +1 -0
index d2486f4b4e..be7d948168 100644
@@ -27,6 +27,7 @@
 #include "ui/console.h"
 #include "hw/arm/omap.h"            /* For I2SCodec */
 #include "hw/input/tsc2xxx.h"
+#include "hw/irq.h"
 
 #define TSC_DATA_REGISTERS_PAGE		0x0
 #define TSC_CONTROL_REGISTERS_PAGE	0x1
hw/intc/allwinner-a10-pic.c +1 -0
index 080bdd791f..9df3e18539 100644
@@ -19,6 +19,7 @@
 #include "hw/sysbus.h"
 #include "sysemu/sysemu.h"
 #include "hw/intc/allwinner-a10-pic.h"
+#include "hw/irq.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
 
hw/intc/arm_gic.c +1 -0
index 77427a4188..7af591daac 100644
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "gic_internal.h"
 #include "qapi/error.h"
hw/intc/arm_gicv2m.c +1 -0
index 05f299fc7f..2c96d4fba0 100644
@@ -28,6 +28,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "hw/sysbus.h"
+#include "hw/irq.h"
 #include "hw/pci/msi.h"
 #include "sysemu/kvm.h"
 #include "qemu/log.h"
hw/intc/arm_gicv3_cpuif.c +1 -0
index 3b212d91c8..a254b0ce87 100644
@@ -17,6 +17,7 @@
 #include "qemu/main-loop.h"
 #include "trace.h"
 #include "gicv3_internal.h"
+#include "hw/irq.h"
 #include "cpu.h"
 
 void gicv3_set_gicv3state(CPUState *cpu, GICv3CPUState *s)
hw/intc/armv7m_nvic.c +1 -0
index 9f8f0d3ff5..69670a2d97 100644
@@ -16,6 +16,7 @@
 #include "hw/sysbus.h"
 #include "qemu/timer.h"
 #include "hw/intc/armv7m_nvic.h"
+#include "hw/irq.h"
 #include "target/arm/cpu.h"
 #include "exec/exec-all.h"
 #include "qemu/log.h"
hw/intc/aspeed_vic.c +1 -0
index 266a309f3b..e17343cd73 100644
@@ -29,6 +29,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/intc/aspeed_vic.h"
+#include "hw/irq.h"
 #include "qemu/bitops.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
hw/intc/bcm2835_ic.c +1 -0
index 61d37643a1..20db52bd8e 100644
@@ -14,6 +14,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/intc/bcm2835_ic.h"
+#include "hw/irq.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
 
hw/intc/bcm2836_control.c +1 -0
index 66417c85e4..a983fe565f 100644
@@ -17,6 +17,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/intc/bcm2836_control.h"
+#include "hw/irq.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
 
hw/intc/etraxfs_pic.c +1 -0
index 20e1391d64..dc72dd5412 100644
@@ -26,6 +26,7 @@
 #include "hw/sysbus.h"
 #include "qemu/module.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 //#include "pc.h"
 //#include "etraxfs.h"
 
hw/intc/exynos4210_combiner.c +1 -0
index 6fed0e8d16..ed558115f6 100644
@@ -32,6 +32,7 @@
 #include "qemu/module.h"
 
 #include "hw/arm/exynos4210.h"
+#include "hw/irq.h"
 
 //#define DEBUG_COMBINER
 
hw/intc/heathrow_pic.c +1 -0
index c282ac4006..ac1f7c0c8f 100644
@@ -28,6 +28,7 @@
 #include "hw/ppc/mac.h"
 #include "qemu/module.h"
 #include "hw/intc/heathrow_pic.h"
+#include "hw/irq.h"
 #include "trace.h"
 
 static inline int heathrow_check_irq(HeathrowPICState *pic)
hw/intc/i8259.c +2 -0
index 76f3d873b8..e581e6b0ab 100644
@@ -21,9 +21,11 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
+#include "hw/irq.h"
 #include "hw/isa/isa.h"
 #include "qemu/timer.h"
 #include "qemu/log.h"
hw/intc/imx_avic.c +1 -0
index 83a4101528..022ed05b6f 100644
@@ -17,6 +17,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/intc/imx_avic.h"
+#include "hw/irq.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
 
hw/intc/lm32_pic.c +1 -0
index 170fa7a1ac..c133d30cf2 100644
@@ -26,6 +26,7 @@
 #include "trace.h"
 #include "hw/lm32/lm32_pic.h"
 #include "hw/intc/intc.h"
+#include "hw/irq.h"
 
 #define TYPE_LM32_PIC "lm32-pic"
 #define LM32_PIC(obj) OBJECT_CHECK(LM32PicState, (obj), TYPE_LM32_PIC)
hw/intc/mips_gic.c +1 -0
index e27e333766..166eb6ecce 100644
@@ -21,6 +21,7 @@
 #include "sysemu/reset.h"
 #include "kvm_mips.h"
 #include "hw/intc/mips_gic.h"
+#include "hw/irq.h"
 
 static void mips_gic_set_vp_irq(MIPSGICState *gic, int vp, int pin)
 {
hw/intc/nios2_iic.c +1 -0
index 7329434b91..3a5d86c2a4 100644
@@ -22,6 +22,7 @@
 #include "qemu/module.h"
 #include "qapi/error.h"
 
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "cpu.h"
 
hw/intc/omap_intc.c +1 -0
index 053e67c66b..4b3ddc0a67 100644
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/arm/omap.h"
 #include "hw/sysbus.h"
 #include "qemu/error-report.h"
hw/intc/ompic.c +1 -0
index 9cb310a5dd..31004ac613 100644
@@ -11,6 +11,7 @@
 #include "qemu/module.h"
 #include "qapi/error.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "exec/memory.h"
 
hw/intc/openpic.c +1 -0
index 9b4fc6cf43..49d64bccfe 100644
@@ -36,6 +36,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/ppc/mac.h"
 #include "hw/pci/pci.h"
 #include "hw/ppc/openpic.h"
hw/intc/pl190.c +1 -0
index b4f31efc45..1a5e760f0f 100644
@@ -8,6 +8,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
hw/intc/puv3_intc.c +1 -0
index e2f6d9875a..e018955ce8 100644
@@ -10,6 +10,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 
 #undef DEBUG_PUV3
hw/intc/realview_gic.c +1 -0
index 99557544db..ac22a2abde 100644
@@ -11,6 +11,7 @@
 #include "qapi/error.h"
 #include "qemu/module.h"
 #include "hw/intc/realview_gic.h"
+#include "hw/irq.h"
 
 static void realview_gic_set_irq(void *opaque, int irq, int level)
 {
hw/intc/sh_intc.c +1 -0
index bac7886f25..62521500f9 100644
@@ -12,6 +12,7 @@
 #include "cpu.h"
 #include "hw/sh4/sh_intc.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/sh4/sh.h"
 
 //#define DEBUG_INTC
hw/intc/slavio_intctl.c +1 -0
index ca528753bf..e97afcadf6 100644
@@ -27,6 +27,7 @@
 #include "qemu/module.h"
 #include "hw/sysbus.h"
 #include "hw/intc/intc.h"
+#include "hw/irq.h"
 #include "trace.h"
 
 //#define DEBUG_IRQ_COUNT
hw/intc/xics.c +1 -0
index 9ed224ce5f..beb37b1a2b 100644
@@ -37,6 +37,7 @@
 #include "qapi/visitor.h"
 #include "monitor/monitor.h"
 #include "hw/intc/intc.h"
+#include "hw/irq.h"
 #include "sysemu/kvm.h"
 #include "sysemu/reset.h"
 
hw/intc/xilinx_intc.c +1 -0
index d5363e977f..baf5353cd1 100644
@@ -26,6 +26,7 @@
 #include "hw/sysbus.h"
 #include "qemu/module.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 
 #define D(x)
 
hw/intc/xive.c +1 -0
index b27d6b8646..d977ed568f 100644
@@ -17,6 +17,7 @@
 #include "sysemu/reset.h"
 #include "hw/qdev-properties.h"
 #include "monitor/monitor.h"
+#include "hw/irq.h"
 #include "hw/ppc/xive.h"
 #include "hw/ppc/xive_regs.h"
 
hw/intc/xlnx-pmu-iomod-intc.c +1 -0
index 0b8ff897dc..9fcd17c6fd 100644
@@ -31,6 +31,7 @@
 #include "qemu/log.h"
 #include "qemu/module.h"
 #include "hw/intc/xlnx-pmu-iomod-intc.h"
+#include "hw/irq.h"
 
 #ifndef XLNX_PMU_IO_INTC_ERR_DEBUG
 #define XLNX_PMU_IO_INTC_ERR_DEBUG 0
hw/intc/xlnx-zynqmp-ipi.c +1 -0
index 0dad6c04f5..43a1b789b5 100644
@@ -32,6 +32,7 @@
 #include "qemu/log.h"
 #include "qemu/module.h"
 #include "hw/intc/xlnx-zynqmp-ipi.h"
+#include "hw/irq.h"
 
 #ifndef XLNX_ZYNQMP_IPI_ERR_DEBUG
 #define XLNX_ZYNQMP_IPI_ERR_DEBUG 0
hw/ipack/ipack.c +1 -0
index 6b1b72f94d..b8ff979d72 100644
@@ -12,6 +12,7 @@
 #include "qapi/error.h"
 #include "qemu/module.h"
 #include "hw/ipack/ipack.h"
+#include "hw/irq.h"
 
 IPackDevice *ipack_device_find(IPackBus *bus, int32_t slot)
 {
hw/ipack/tpci200.c +1 -0
index d4d85107d0..7ee9d01771 100644
@@ -11,6 +11,7 @@
 #include "qemu/osdep.h"
 #include "qemu/units.h"
 #include "hw/ipack/ipack.h"
+#include "hw/irq.h"
 #include "hw/pci/pci.h"
 #include "qemu/bitops.h"
 #include "qemu/module.h"
hw/ipmi/isa_ipmi_bt.c +1 -0
index 1846d5b9a4..af07278c19 100644
@@ -28,6 +28,7 @@
 #include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/ipmi/ipmi.h"
+#include "hw/irq.h"
 #include "hw/isa/isa.h"
 
 /* Control register */
hw/ipmi/isa_ipmi_kcs.c +1 -0
index 068f341256..583497685a 100644
@@ -28,6 +28,7 @@
 #include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/ipmi/ipmi.h"
+#include "hw/irq.h"
 #include "hw/isa/isa.h"
 
 #define IPMI_KCS_OBF_BIT        0
hw/isa/i82378.c +1 -0
index c08970b24a..90ebba59b7 100644
@@ -20,6 +20,7 @@
 #include "qemu/osdep.h"
 #include "hw/pci/pci.h"
 #include "hw/i386/pc.h"
+#include "hw/irq.h"
 #include "hw/timer/i8254.h"
 #include "hw/audio/pcspk.h"
 
hw/isa/lpc_ich9.c +2 -0
index a7081bd52d..42a1232787 100644
@@ -27,6 +27,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "hw/hw.h"
@@ -35,6 +36,7 @@
 #include "hw/isa/isa.h"
 #include "hw/sysbus.h"
 #include "hw/i386/pc.h"
+#include "hw/irq.h"
 #include "hw/isa/apm.h"
 #include "hw/i386/ioapic.h"
 #include "hw/pci/pci.h"
hw/lm32/lm32_boards.c +1 -0
index e075ebc8a6..d710980045 100644
@@ -23,6 +23,7 @@
 #include "cpu.h"
 #include "hw/sysbus.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/block/flash.h"
 #include "hw/boards.h"
 #include "hw/loader.h"
hw/lm32/milkymist.c +1 -0
index 33669ee19b..864712d977 100644
@@ -24,6 +24,7 @@
 #include "cpu.h"
 #include "hw/sysbus.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/block/flash.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/qtest.h"
hw/m68k/mcf5206.c +2 -0
index 1c17f83eed..5ee1498f48 100644
@@ -5,10 +5,12 @@
  *
  * This code is licensed under the GPL
  */
+
 #include "qemu/osdep.h"
 #include "qemu/error-report.h"
 #include "cpu.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/m68k/mcf.h"
 #include "qemu/timer.h"
 #include "hw/ptimer.h"
hw/m68k/mcf5208.c +2 -0
index 6f6efae9fc..3a21c62809 100644
@@ -5,6 +5,7 @@
  *
  * This code is licensed under the GPL
  */
+
 #include "qemu/osdep.h"
 #include "qemu/units.h"
 #include "qemu/error-report.h"
@@ -12,6 +13,7 @@
 #include "qemu-common.h"
 #include "cpu.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/m68k/mcf.h"
 #include "hw/m68k/mcf_fec.h"
 #include "qemu/timer.h"
hw/m68k/mcf_intc.c +1 -0
index a613aed820..d9e03a06ab 100644
@@ -10,6 +10,7 @@
 #include "qemu/module.h"
 #include "cpu.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "hw/m68k/mcf.h"
 
hw/mips/gt64xxx_pci.c +1 -0
index 2fa313f498..15d4adb3cd 100644
@@ -30,6 +30,7 @@
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_host.h"
 #include "hw/i386/pc.h"
+#include "hw/irq.h"
 #include "exec/address-spaces.h"
 #include "trace.h"
 
hw/mips/mips_int.c +1 -0
index f899f6ceb3..ae4244c32e 100644
@@ -23,6 +23,7 @@
 #include "qemu/osdep.h"
 #include "qemu/main-loop.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/mips/cpudevs.h"
 #include "cpu.h"
 #include "sysemu/kvm.h"
hw/mips/mips_malta.c +1 -0
index 29bc8de5cf..02200ab7d4 100644
@@ -43,6 +43,7 @@
 #include "qemu/log.h"
 #include "hw/mips/bios.h"
 #include "hw/ide.h"
+#include "hw/irq.h"
 #include "hw/loader.h"
 #include "elf.h"
 #include "hw/timer/mc146818rtc.h"
hw/misc/arm_sysctl.c +1 -0
index 457dfadfab..be8c9c0a7f 100644
@@ -9,6 +9,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "qemu/timer.h"
 #include "qemu/bitops.h"
 #include "hw/sysbus.h"
hw/misc/armsse-mhu.c +1 -0
index 514321a9ec..f8d4187bb8 100644
@@ -23,6 +23,7 @@
 #include "sysemu/sysemu.h"
 #include "hw/sysbus.h"
 #include "hw/registerfields.h"
+#include "hw/irq.h"
 #include "hw/misc/armsse-mhu.h"
 
 REG32(CPU0INTR_STAT, 0x0)
hw/misc/aspeed_xdma.c +1 -0
index eebd4ad540..18a83bcc6c 100644
@@ -9,6 +9,7 @@
 #include "qemu/osdep.h"
 #include "qemu/log.h"
 #include "qemu/error-report.h"
+#include "hw/irq.h"
 #include "hw/misc/aspeed_xdma.h"
 #include "qapi/error.h"
 
hw/misc/bcm2835_mbox.c +1 -0
index a87da5ee53..e484d25c29 100644
@@ -10,6 +10,7 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
+#include "hw/irq.h"
 #include "hw/misc/bcm2835_mbox.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
hw/misc/bcm2835_property.c +1 -0
index 0bf789cf60..51cd93fc8b 100644
@@ -6,6 +6,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "hw/misc/bcm2835_property.h"
+#include "hw/irq.h"
 #include "hw/misc/bcm2835_mbox_defs.h"
 #include "sysemu/dma.h"
 #include "qemu/log.h"
hw/misc/eccmemctl.c +1 -0
index 8386db07df..c16d56c8c7 100644
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "qemu/module.h"
 #include "trace.h"
hw/misc/iotkit-secctl.c +1 -0
index 58fd94b14f..963fd6efd3 100644
@@ -16,6 +16,7 @@
 #include "trace.h"
 #include "hw/sysbus.h"
 #include "hw/registerfields.h"
+#include "hw/irq.h"
 #include "hw/misc/iotkit-secctl.h"
 
 /* Registers in the secure privilege control block */
hw/misc/macio/mac_dbdma.c +1 -0
index 548625a5f0..8a1de8c31d 100644
@@ -39,6 +39,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/ppc/mac_dbdma.h"
 #include "qemu/main-loop.h"
 #include "qemu/module.h"
hw/misc/macio/pmu.c +1 -0
index 753561d3f1..6280bcbc61 100644
@@ -33,6 +33,7 @@
 #include "hw/hw.h"
 #include "hw/ppc/mac.h"
 #include "hw/input/adb.h"
+#include "hw/irq.h"
 #include "hw/misc/mos6522.h"
 #include "hw/misc/macio/gpio.h"
 #include "hw/misc/macio/pmu.h"
hw/misc/max111x.c +1 -0
index d373ece0c9..6fd7210c67 100644
@@ -11,6 +11,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/ssi/ssi.h"
 #include "qemu/module.h"
 
hw/misc/milkymist-pfpu.c +1 -0
index 1c27f1a4bc..fb21b898d1 100644
@@ -24,6 +24,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "trace.h"
 #include "qemu/log.h"
hw/misc/mos6522.c +1 -0
index e72ed69d51..84c677c131 100644
@@ -27,6 +27,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/input/adb.h"
+#include "hw/irq.h"
 #include "hw/misc/mos6522.h"
 #include "qemu/timer.h"
 #include "sysemu/sysemu.h"
hw/misc/mst_fpga.c +1 -0
index fd18303724..256746ac15 100644
@@ -13,6 +13,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "qemu/module.h"
 
hw/misc/nrf51_rng.c +1 -0
index 96ef4330eb..cf1bec223e 100644
@@ -14,6 +14,7 @@
 #include "qemu/module.h"
 #include "qapi/error.h"
 #include "hw/arm/nrf51.h"
+#include "hw/irq.h"
 #include "hw/misc/nrf51_rng.h"
 #include "qemu/guest-random.h"
 
hw/misc/omap_clk.c +2 -0
index 9ea14186d4..c77ca2fc74 100644
@@ -18,8 +18,10 @@
  * You should have received a copy of the GNU General Public License along
  * with this program; if not, see <http://www.gnu.org/licenses/>.
  */
+
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/arm/omap.h"
 
 struct clk {
hw/misc/omap_gpmc.c +2 -0
index 84f9e4c612..6253b0b2d4 100644
@@ -18,8 +18,10 @@
  * You should have received a copy of the GNU General Public License along
  * with this program; if not, see <http://www.gnu.org/licenses/>.
  */
+
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/block/flash.h"
 #include "hw/arm/omap.h"
 #include "exec/memory.h"
hw/misc/pc-testdev.c +1 -0
index 1f9abd52b8..46adb6b5fc 100644
@@ -39,6 +39,7 @@
 #include "hw/hw.h"
 #include "hw/qdev.h"
 #include "qemu/module.h"
+#include "hw/irq.h"
 #include "hw/isa/isa.h"
 
 #define IOMEM_LEN    0x10000
hw/misc/slavio_misc.c +1 -0
index 9c2cf04646..5f351950db 100644
@@ -24,6 +24,7 @@
 
 #include "qemu/osdep.h"
 #include "sysemu/sysemu.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "qemu/module.h"
 #include "trace.h"
hw/misc/tmp105.c +1 -0
index 19def5c20f..2e304218f4 100644
@@ -21,6 +21,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/i2c/i2c.h"
+#include "hw/irq.h"
 #include "tmp105.h"
 #include "qapi/error.h"
 #include "qapi/visitor.h"
hw/misc/tz-mpc.c +1 -0
index 45a3e31c3d..802aeb7377 100644
@@ -16,6 +16,7 @@
 #include "trace.h"
 #include "hw/sysbus.h"
 #include "hw/registerfields.h"
+#include "hw/irq.h"
 #include "hw/misc/tz-mpc.h"
 
 /* Our IOMMU has two IOMMU indexes, one for secure transactions and one for
hw/misc/tz-msc.c +1 -0
index 52b96ba70d..7d1a536ce4 100644
@@ -16,6 +16,7 @@
 #include "trace.h"
 #include "hw/sysbus.h"
 #include "hw/registerfields.h"
+#include "hw/irq.h"
 #include "hw/misc/tz-msc.h"
 
 static void tz_msc_update_irq(TZMSC *s)
hw/misc/tz-ppc.c +1 -0
index 2a14a26f29..54db7fc152 100644
@@ -16,6 +16,7 @@
 #include "trace.h"
 #include "hw/sysbus.h"
 #include "hw/registerfields.h"
+#include "hw/irq.h"
 #include "hw/misc/tz-ppc.h"
 
 static void tz_ppc_update_irq(TZPPC *s)
hw/misc/zynq-xadc.c +1 -0
index f1e48601dc..c5cff5a8a9 100644
@@ -15,6 +15,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/misc/zynq-xadc.h"
 #include "qemu/timer.h"
 #include "sysemu/sysemu.h"
hw/net/allwinner_emac.c +1 -0
index eecda52800..dad25bd4e9 100644
@@ -21,6 +21,7 @@
 #include "hw/sysbus.h"
 #include "net/net.h"
 #include "qemu/fifo8.h"
+#include "hw/irq.h"
 #include "hw/net/allwinner_emac.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
hw/net/cadence_gem.c +1 -0
index d412085884..f4e4a4dd87 100644
@@ -25,6 +25,7 @@
 #include "qemu/osdep.h"
 #include <zlib.h> /* For crc32 */
 
+#include "hw/irq.h"
 #include "hw/net/cadence_gem.h"
 #include "qapi/error.h"
 #include "qemu/log.h"
hw/net/can/can_kvaser_pci.c +1 -0
index df639f8fa0..3b8e38eb83 100644
@@ -37,6 +37,7 @@
 #include "qapi/error.h"
 #include "chardev/char.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/pci/pci.h"
 #include "net/can_emu.h"
 
hw/net/can/can_mioe3680_pci.c +1 -0
index 7af0993d7a..c09ae69261 100644
@@ -33,6 +33,7 @@
 #include "qapi/error.h"
 #include "chardev/char.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/pci/pci.h"
 #include "net/can_emu.h"
 
hw/net/can/can_pcm3680_pci.c +1 -0
index 3f7312af07..843a76cf37 100644
@@ -33,6 +33,7 @@
 #include "qapi/error.h"
 #include "chardev/char.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/pci/pci.h"
 #include "net/can_emu.h"
 
hw/net/can/can_sja1000.c +2 -0
index 9a85038c8a..ee079d355f 100644
@@ -24,10 +24,12 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "qemu/log.h"
 #include "chardev/char.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "net/can_emu.h"
 
 #include "can_sja1000.h"
hw/net/dp8393x.c +1 -0
index bdb0b3b2c2..70a78ad337 100644
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "net/net.h"
 #include "qapi/error.h"
hw/net/fsl_etsec/etsec.c +1 -0
index 2a8b99a2e4..e217238296 100644
@@ -29,6 +29,7 @@
 #include "qemu/osdep.h"
 #include "sysemu/sysemu.h"
 #include "hw/sysbus.h"
+#include "hw/irq.h"
 #include "hw/ptimer.h"
 #include "etsec.h"
 #include "registers.h"
hw/net/ftgmac100.c +1 -0
index d2cded5e94..2848bff3e5 100644
@@ -12,6 +12,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/net/ftgmac100.h"
 #include "sysemu/dma.h"
 #include "qemu/log.h"
hw/net/imx_fec.c +1 -0
index 404154ebbf..fe9d9028fa 100644
@@ -22,6 +22,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/net/imx_fec.h"
 #include "sysemu/dma.h"
 #include "qemu/log.h"
hw/net/lan9118.c +1 -0
index f6120be219..e2da54cbd8 100644
@@ -14,6 +14,7 @@
 #include "hw/sysbus.h"
 #include "net/net.h"
 #include "net/eth.h"
+#include "hw/irq.h"
 #include "hw/net/lan9118.h"
 #include "sysemu/sysemu.h"
 #include "hw/ptimer.h"
hw/net/mcf_fec.c +1 -0
index 78468fad6b..e4a3b55eb6 100644
@@ -8,6 +8,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "net/net.h"
 #include "qemu/module.h"
 #include "hw/m68k/mcf.h"
hw/net/milkymist-minimac2.c +1 -0
index 41ef7a4456..bad1066781 100644
@@ -26,6 +26,7 @@
 #include "qapi/error.h"
 #include "cpu.h" /* FIXME: why does this use TARGET_PAGE_ALIGN? */
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "trace.h"
 #include "net/net.h"
hw/net/mipsnet.c +1 -0
index c5fbd8431f..007c94aa30 100644
@@ -1,5 +1,6 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "net/net.h"
 #include "qemu/module.h"
 #include "trace.h"
hw/net/ne2000-pci.c +2 -0
index cb05744f3c..4f28e31baa 100644
@@ -21,7 +21,9 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/pci/pci.h"
 #include "ne2000.h"
 #include "sysemu/sysemu.h"
hw/net/ne2000.c +1 -0
index 1cf4b57341..4b9231c495 100644
@@ -25,6 +25,7 @@
 #include "qemu/osdep.h"
 #include "net/eth.h"
 #include "qemu/module.h"
+#include "hw/irq.h"
 #include "ne2000.h"
 #include "sysemu/sysemu.h"
 #include "trace.h"
hw/net/opencores_eth.c +1 -0
index a5abb8df46..3e759d79d8 100644
@@ -33,6 +33,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/net/mii.h"
 #include "hw/sysbus.h"
 #include "net/net.h"
hw/net/pcnet-pci.c +1 -0
index 600d09ce92..df8cb6621f 100644
@@ -28,6 +28,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/pci/pci.h"
 #include "net/net.h"
 #include "qemu/module.h"
hw/net/pcnet.c +1 -0
index 16683091c9..f73e3422f4 100644
@@ -37,6 +37,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu/log.h"
+#include "hw/irq.h"
 #include "hw/qdev.h"
 #include "net/net.h"
 #include "net/eth.h"
hw/net/smc91c111.c +1 -0
index 4a612eebe9..f5149124e6 100644
@@ -10,6 +10,7 @@
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
 #include "net/net.h"
+#include "hw/irq.h"
 #include "hw/net/smc91c111.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
hw/net/spapr_llan.c +1 -0
index f162d49025..1867c355e3 100644
@@ -28,6 +28,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
 #include "net/net.h"
hw/net/stellaris_enet.c +1 -0
index 2f645bfb71..756ac5600b 100644
@@ -8,6 +8,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "net/net.h"
 #include "qemu/log.h"
hw/net/xgmac.c +1 -0
index f49df95b07..c2efc77452 100644
@@ -25,6 +25,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
hw/net/xilinx_axienet.c +1 -0
index feeaca680e..b1247a1d9b 100644
@@ -30,6 +30,7 @@
 #include "net/net.h"
 #include "net/checksum.h"
 
+#include "hw/irq.h"
 #include "hw/stream.h"
 
 #define DPHY(x)
hw/net/xilinx_ethlite.c +1 -0
index 8f3a8f8597..27a4fc8d87 100644
@@ -27,6 +27,7 @@
 #include "cpu.h" /* FIXME should not use tswap* */
 #include "hw/sysbus.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "net/net.h"
 
 #define D(x)
hw/nios2/cpu_pic.c +1 -0
index 5525e25ff0..1c1989d56a 100644
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "hw/irq.h"
 
 #include "qemu/config-file.h"
 
hw/openrisc/openrisc_sim.c +1 -0
index cb2fc5ba78..965d5b44ee 100644
@@ -23,6 +23,7 @@
 #include "qapi/error.h"
 #include "cpu.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/boards.h"
 #include "elf.h"
 #include "hw/char/serial.h"
hw/openrisc/pic_cpu.c +1 -0
index 2f53cfc82e..d3f179ff8d 100644
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "cpu.h"
 
 /* OpenRISC pic handler */
hw/pci-host/bonito.c +1 -0
index 36c7ca45ad..ca526bd71b 100644
@@ -42,6 +42,7 @@
 #include "hw/hw.h"
 #include "hw/pci/pci.h"
 #include "hw/i386/pc.h"
+#include "hw/irq.h"
 #include "hw/mips/mips.h"
 #include "hw/pci/pci_host.h"
 #include "sysemu/reset.h"
hw/pci-host/designware.c +1 -0
index 9ae8c0deb7..de4300d554 100644
@@ -25,6 +25,7 @@
 #include "hw/pci/pci_bridge.h"
 #include "hw/pci/pci_host.h"
 #include "hw/pci/pcie_port.h"
+#include "hw/irq.h"
 #include "hw/pci-host/designware.h"
 
 #define DESIGNWARE_PCIE_PORT_LINK_CONTROL          0x710
hw/pci-host/gpex.c +1 -0
index 629d1a4624..72c58a054b 100644
@@ -32,6 +32,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/pci-host/gpex.h"
 #include "qemu/module.h"
 
hw/pci-host/grackle.c +1 -0
index ed3b3c361f..912f8bf13f 100644
@@ -28,6 +28,7 @@
 #include "hw/ppc/mac.h"
 #include "hw/pci/pci.h"
 #include "hw/intc/heathrow_pic.h"
+#include "hw/irq.h"
 #include "qapi/error.h"
 #include "qemu/module.h"
 #include "trace.h"
hw/pci-host/piix.c +1 -0
index e5955457ab..ecf634a04d 100644
@@ -25,6 +25,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
+#include "hw/irq.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_host.h"
 #include "hw/isa/isa.h"
hw/pci-host/ppce500.c +1 -0
index 21eaa30a20..406ebf0438 100644
@@ -16,6 +16,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/ppc/e500-ccsr.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_host.h"
hw/pci-host/prep.c +1 -0
index c564f234af..2b68af9811 100644
@@ -32,6 +32,7 @@
 #include "hw/pci/pci_bus.h"
 #include "hw/pci/pci_host.h"
 #include "hw/i386/pc.h"
+#include "hw/irq.h"
 #include "hw/loader.h"
 #include "hw/or-irq.h"
 #include "exec/address-spaces.h"
hw/pci-host/sabre.c +1 -0
index 2cec1116af..772ac1f725 100644
@@ -30,6 +30,7 @@
 #include "hw/pci/pci_host.h"
 #include "hw/pci/pci_bridge.h"
 #include "hw/pci/pci_bus.h"
+#include "hw/irq.h"
 #include "hw/pci-bridge/simba.h"
 #include "hw/pci-host/sabre.h"
 #include "sysemu/sysemu.h"
hw/pci-host/uninorth.c +1 -0
index 680fefd066..4ffb2d0d03 100644
@@ -24,6 +24,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/ppc/mac.h"
 #include "qemu/module.h"
 #include "hw/pci/pci.h"
hw/pci-host/versatile.c +1 -0
index 791b321ea0..221cc40134 100644
@@ -9,6 +9,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
+#include "hw/irq.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_bus.h"
 #include "hw/pci/pci_host.h"
hw/pci-host/xilinx-pcie.c +1 -0
index 192b697453..f42fabbbe7 100644
@@ -22,6 +22,7 @@
 #include "qemu/units.h"
 #include "qapi/error.h"
 #include "hw/pci/pci_bridge.h"
+#include "hw/irq.h"
 #include "hw/pci-host/xilinx-pcie.h"
 
 enum root_cfg_reg {
hw/pci/pci.c +1 -0
index 43a3cac138..bc7ce92dcb 100644
@@ -25,6 +25,7 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_bridge.h"
 #include "hw/pci/pci_bus.h"
hw/pcmcia/pxa2xx.c +1 -0
index 8993b784bb..26ab2267de 100644
@@ -12,6 +12,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "qemu/module.h"
 #include "hw/pcmcia.h"
hw/ppc/e500.c +1 -0
index 566f179bb1..0451a4e338 100644
@@ -45,6 +45,7 @@
 #include "hw/platform-bus.h"
 #include "hw/net/fsl_etsec/etsec.h"
 #include "hw/i2c/i2c.h"
+#include "hw/irq.h"
 
 #define EPAPR_MAGIC                (0x45504150)
 #define BINARY_DEVICE_TREE_FILE    "mpc8544ds.dtb"
hw/ppc/pnv_lpc.c +1 -0
index a9f150c3ca..d4433d73e1 100644
@@ -23,6 +23,7 @@
 #include "qapi/error.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
+#include "hw/irq.h"
 #include "hw/isa/isa.h"
 
 #include "hw/ppc/pnv.h"
hw/ppc/pnv_psi.c +1 -0
index 6b26d0f6bc..e66aeec4aa 100644
@@ -19,6 +19,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "target/ppc/cpu.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
hw/ppc/ppc.c +2 -0
index a9e508c496..163a34ee4c 100644
@@ -21,9 +21,11 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/ppc/ppc.h"
 #include "hw/ppc/ppc_e500.h"
 #include "qemu/timer.h"
hw/ppc/ppc405_uc.c +1 -0
index f9d98fe71e..bb62714fd9 100644
@@ -30,6 +30,7 @@
 #include "hw/ppc/ppc.h"
 #include "hw/boards.h"
 #include "hw/i2c/ppc4xx_i2c.h"
+#include "hw/irq.h"
 #include "ppc405.h"
 #include "hw/char/serial.h"
 #include "qemu/timer.h"
hw/ppc/ppc440_pcix.c +1 -0
index ca54631f9d..77a78388c1 100644
@@ -24,6 +24,7 @@
 #include "qemu/log.h"
 #include "qemu/module.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/ppc/ppc.h"
 #include "hw/ppc/ppc4xx.h"
 #include "hw/pci/pci.h"
hw/ppc/ppc440_uc.c +1 -0
index 7329cfe651..6570c2d120 100644
@@ -16,6 +16,7 @@
 #include "qemu/module.h"
 #include "cpu.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "exec/address-spaces.h"
 #include "exec/memory.h"
 #include "hw/ppc/ppc.h"
hw/ppc/ppc4xx_devs.c +1 -0
index e62bef3b8d..49d714756f 100644
@@ -27,6 +27,7 @@
 #include "sysemu/reset.h"
 #include "cpu.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/ppc/ppc.h"
 #include "hw/ppc/ppc4xx.h"
 #include "hw/boards.h"
hw/ppc/ppc4xx_pci.c +1 -0
index b013319c60..27f25f4e58 100644
@@ -21,6 +21,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/ppc/ppc.h"
 #include "hw/ppc/ppc4xx.h"
 #include "qemu/module.h"
hw/ppc/prep.c +1 -0
index 84e968e28c..01dc7e111b 100644
@@ -39,6 +39,7 @@
 #include "qemu/error-report.h"
 #include "qemu/log.h"
 #include "hw/ide.h"
+#include "hw/irq.h"
 #include "hw/loader.h"
 #include "hw/timer/mc146818rtc.h"
 #include "hw/isa/pc87312.h"
hw/ppc/prep_systemio.c +1 -0
index df7603b986..898ab1533f 100644
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/isa/isa.h"
 #include "exec/address-spaces.h"
 #include "qemu/error-report.h" /* for error_report() */
hw/ppc/spapr_events.c +2 -0
index ae0f093f59..d75359c5f3 100644
@@ -24,6 +24,7 @@
  * THE SOFTWARE.
  *
  */
+
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "cpu.h"
@@ -35,6 +36,7 @@
 #include "hw/ppc/spapr.h"
 #include "hw/ppc/spapr_vio.h"
 #include "hw/pci/pci.h"
+#include "hw/irq.h"
 #include "hw/pci-host/spapr.h"
 #include "hw/ppc/spapr_drc.h"
 #include "qemu/help_option.h"
hw/ppc/spapr_irq.c +1 -0
index d07aed8ca9..66705962e7 100644
@@ -11,6 +11,7 @@
 #include "qemu/log.h"
 #include "qemu/error-report.h"
 #include "qapi/error.h"
+#include "hw/irq.h"
 #include "hw/ppc/spapr.h"
 #include "hw/ppc/spapr_cpu_core.h"
 #include "hw/ppc/spapr_xive.h"
hw/ppc/spapr_pci.c +1 -0
index 9003fe9010..54d0a32c17 100644
@@ -27,6 +27,7 @@
 #include "qapi/error.h"
 #include "cpu.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/msi.h"
hw/ppc/spapr_vio.c +1 -0
index 583c13deda..0f4f4bedd3 100644
@@ -24,6 +24,7 @@
 #include "qapi/error.h"
 #include "qapi/visitor.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "qemu/log.h"
 #include "sysemu/sysemu.h"
 #include "hw/boards.h"
hw/riscv/sifive_gpio.c +1 -0
index 06bd8112d7..da19daa880 100644
@@ -13,6 +13,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu/log.h"
+#include "hw/irq.h"
 #include "hw/riscv/sifive_gpio.h"
 #include "trace.h"
 
hw/riscv/sifive_uart.c +1 -0
index 3b3f94f51d..d18613fb33 100644
@@ -22,6 +22,7 @@
 #include "chardev/char.h"
 #include "chardev/char-fe.h"
 #include "target/riscv/cpu.h"
+#include "hw/irq.h"
 #include "hw/riscv/sifive_uart.h"
 
 /*
hw/scsi/esp-pci.c +1 -0
index 342f500f82..f945502f3a 100644
@@ -25,6 +25,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/pci/pci.h"
+#include "hw/irq.h"
 #include "hw/nvram/eeprom93xx.h"
 #include "hw/scsi/esp.h"
 #include "trace.h"
hw/scsi/esp.c +1 -0
index 7508d035ca..3b717e9526 100644
@@ -25,6 +25,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
+#include "hw/irq.h"
 #include "hw/scsi/esp.h"
 #include "trace.h"
 #include "qemu/log.h"
hw/scsi/lsi53c895a.c +1 -0
index 10468c1ec1..1a042aa00b 100644
@@ -16,6 +16,7 @@
 #include "qemu/osdep.h"
 
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/pci/pci.h"
 #include "hw/scsi/scsi.h"
 #include "sysemu/dma.h"
hw/sd/bcm2835_sdhost.c +1 -0
index 2778fb0de4..4609cc031c 100644
@@ -15,6 +15,7 @@
 #include "qemu/log.h"
 #include "qemu/module.h"
 #include "sysemu/blockdev.h"
+#include "hw/irq.h"
 #include "hw/sd/bcm2835_sdhost.h"
 #include "trace.h"
 
hw/sd/omap_mmc.c +2 -0
index d0c98ca021..15a0bbe87d 100644
@@ -18,9 +18,11 @@
  * You should have received a copy of the GNU General Public License along
  * with this program; if not, see <http://www.gnu.org/licenses/>.
  */
+
 #include "qemu/osdep.h"
 #include "qemu/log.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/arm/omap.h"
 #include "hw/sd/sd.h"
 
hw/sd/pl181.c +1 -0
index 81b406dbf0..3c615f2b8f 100644
@@ -10,6 +10,7 @@
 #include "qemu/osdep.h"
 #include "sysemu/blockdev.h"
 #include "hw/sysbus.h"
+#include "hw/irq.h"
 #include "hw/sd/sd.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
hw/sd/pxa2xx_mmci.c +1 -0
index 81ff5cea86..1eb1248cad 100644
@@ -13,6 +13,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "hw/arm/pxa.h"
 #include "hw/sd/sd.h"
hw/sd/sd.c +1 -0
index 917195a65b..21adf2be16 100644
@@ -34,6 +34,7 @@
 #include "qemu/units.h"
 #include "hw/qdev.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/registerfields.h"
 #include "sysemu/block-backend.h"
 #include "hw/sd/sd.h"
hw/sd/sdhci.c +1 -0
index 7b80b1d93f..46c7fbd677 100644
@@ -27,6 +27,7 @@
 #include "qemu/error-report.h"
 #include "qapi/error.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "sysemu/dma.h"
 #include "qemu/timer.h"
 #include "qemu/bitops.h"
hw/sh4/r2d.c +1 -0
index da79bf0337..9838ea3323 100644
@@ -37,6 +37,7 @@
 #include "net/net.h"
 #include "sh7750_regs.h"
 #include "hw/ide.h"
+#include "hw/irq.h"
 #include "hw/loader.h"
 #include "hw/usb.h"
 #include "hw/block/flash.h"
hw/sh4/sh7750.c +2 -0
index 2fb6e618d9..b35d07265d 100644
@@ -22,8 +22,10 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/sh4/sh.h"
 #include "sysemu/sysemu.h"
 #include "sh7750_regs.h"
hw/sh4/sh_pci.c +1 -0
index b15f264e99..71afd23b67 100644
@@ -25,6 +25,7 @@
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
 #include "hw/sh4/sh.h"
+#include "hw/irq.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_host.h"
 #include "qemu/bswap.h"
hw/sparc/leon3.c +1 -0
index c7ddfa2cfe..9c43806690 100644
@@ -29,6 +29,7 @@
 #include "qemu-common.h"
 #include "cpu.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "qemu/timer.h"
 #include "hw/ptimer.h"
 #include "sysemu/sysemu.h"
hw/sparc/sun4m.c +1 -0
index 93a69c12fb..0f9cda19f3 100644
@@ -44,6 +44,7 @@
 #include "hw/nvram/fw_cfg.h"
 #include "hw/char/escc.h"
 #include "hw/empty_slot.h"
+#include "hw/irq.h"
 #include "hw/loader.h"
 #include "elf.h"
 #include "trace.h"
hw/sparc/sun4m_iommu.c +1 -0
index 45a61ecf87..36b5c0c133 100644
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/sparc/sun4m_iommu.h"
 #include "hw/sysbus.h"
 #include "qemu/module.h"
hw/ssi/aspeed_smc.c +1 -0
index 81f2fb7f70..eb6eee6586 100644
@@ -29,6 +29,7 @@
 #include "qemu/module.h"
 #include "qemu/error-report.h"
 
+#include "hw/irq.h"
 #include "hw/ssi/aspeed_smc.h"
 
 /* CE Type Setting Register */
hw/ssi/imx_spi.c +1 -0
index 5cec9b5d05..79c8a6dae7 100644
@@ -9,6 +9,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/ssi/imx_spi.h"
 #include "sysemu/sysemu.h"
 #include "qemu/log.h"
hw/ssi/mss-spi.c +1 -0
index 4c9da5d2b2..d000c91341 100644
@@ -24,6 +24,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/ssi/mss-spi.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
hw/ssi/omap_spi.c +2 -0
index f278a55160..7c7e689707 100644
@@ -19,9 +19,11 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
+
 #include "qemu/osdep.h"
 #include "qemu/log.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/arm/omap.h"
 
 /* Multichannel SPI */
hw/ssi/pl022.c +1 -0
index fec73cae26..286b08438d 100644
@@ -9,6 +9,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
+#include "hw/irq.h"
 #include "hw/ssi/pl022.h"
 #include "hw/ssi/ssi.h"
 #include "qemu/log.h"
hw/ssi/xilinx_spi.c +1 -0
index 1379cb164b..5495d3e3cb 100644
@@ -31,6 +31,7 @@
 #include "qemu/module.h"
 #include "qemu/fifo8.h"
 
+#include "hw/irq.h"
 #include "hw/ssi/ssi.h"
 
 #ifdef XILINX_SPI_ERR_DEBUG
hw/ssi/xilinx_spips.c +1 -0
index b29e0a4a89..451d5a0783 100644
@@ -25,6 +25,7 @@
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
 #include "sysemu/sysemu.h"
+#include "hw/irq.h"
 #include "hw/ptimer.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
hw/timer/a9gtimer.c +1 -0
index 09e2a7b7bf..0d18497322 100644
@@ -21,6 +21,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/timer/a9gtimer.h"
 #include "qapi/error.h"
 #include "qemu/timer.h"
hw/timer/allwinner-a10-pit.c +1 -0
index 763e1090ec..490e584604 100644
@@ -16,6 +16,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "sysemu/sysemu.h"
 #include "hw/timer/allwinner-a10-pit.h"
hw/timer/altera_timer.c +1 -0
index 5c1d9e4074..0dd4f321f7 100644
@@ -24,6 +24,7 @@
 
 #include "hw/sysbus.h"
 #include "sysemu/sysemu.h"
+#include "hw/irq.h"
 #include "hw/ptimer.h"
 
 #define R_STATUS      0
hw/timer/arm_mptimer.c +1 -0
index 93044aacfd..3092b85d91 100644
@@ -20,6 +20,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/ptimer.h"
 #include "hw/timer/arm_mptimer.h"
 #include "qapi/error.h"
hw/timer/arm_timer.c +1 -0
index f0a753404d..30ad2245da 100644
@@ -11,6 +11,7 @@
 #include "hw/sysbus.h"
 #include "qemu/timer.h"
 #include "hw/qdev.h"
+#include "hw/irq.h"
 #include "hw/ptimer.h"
 #include "qemu/main-loop.h"
 #include "qemu/module.h"
hw/timer/armv7m_systick.c +1 -0
index 94640743b5..8a91ba345b 100644
@@ -11,6 +11,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/timer/armv7m_systick.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "qemu/timer.h"
 #include "qemu/log.h"
hw/timer/aspeed_timer.c +1 -0
index 29cc5e8070..c8e4892989 100644
@@ -11,6 +11,7 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "hw/timer/aspeed_timer.h"
 #include "qemu/bitops.h"
hw/timer/cadence_ttc.c +1 -0
index 115d935f84..810c08a0ae 100644
@@ -17,6 +17,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "qemu/module.h"
 #include "qemu/timer.h"
hw/timer/cmsdk-apb-dualtimer.c +1 -0
index 383f6e12b1..7328abb40b 100644
@@ -23,6 +23,7 @@
 #include "qemu/main-loop.h"
 #include "qemu/module.h"
 #include "hw/sysbus.h"
+#include "hw/irq.h"
 #include "hw/registerfields.h"
 #include "hw/timer/cmsdk-apb-dualtimer.h"
 
hw/timer/cmsdk-apb-timer.c +1 -0
index 2e7318b81f..07f82e5fa1 100644
@@ -34,6 +34,7 @@
 #include "qapi/error.h"
 #include "trace.h"
 #include "hw/sysbus.h"
+#include "hw/irq.h"
 #include "hw/registerfields.h"
 #include "hw/timer/cmsdk-apb-timer.h"
 
hw/timer/etraxfs_timer.c +1 -0
index 18887b2be2..2fd54ad4dc 100644
@@ -28,6 +28,7 @@
 #include "sysemu/sysemu.h"
 #include "qemu/module.h"
 #include "qemu/timer.h"
+#include "hw/irq.h"
 #include "hw/ptimer.h"
 
 #define D(x)
hw/timer/exynos4210_mct.c +1 -0
index 874c7b8522..25e2125af8 100644
@@ -61,6 +61,7 @@
 #include "hw/ptimer.h"
 
 #include "hw/arm/exynos4210.h"
+#include "hw/irq.h"
 
 //#define DEBUG_MCT
 
hw/timer/exynos4210_pwm.c +1 -0
index 9bc0327785..2af7b374cc 100644
@@ -29,6 +29,7 @@
 #include "hw/ptimer.h"
 
 #include "hw/arm/exynos4210.h"
+#include "hw/irq.h"
 
 //#define DEBUG_PWM
 
hw/timer/exynos4210_rtc.c +1 -0
index 0ecedf7394..b9dfaf51f7 100644
@@ -35,6 +35,7 @@
 #include "hw/ptimer.h"
 
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "sysemu/sysemu.h"
 
 #include "hw/arm/exynos4210.h"
hw/timer/grlib_gptimer.c +1 -0
index e45a49075b..28ba1259d0 100644
@@ -26,6 +26,7 @@
 #include "hw/sparc/grlib.h"
 #include "hw/sysbus.h"
 #include "qemu/timer.h"
+#include "hw/irq.h"
 #include "hw/ptimer.h"
 #include "qemu/main-loop.h"
 #include "qemu/module.h"
hw/timer/hpet.c +1 -0
index 41024f39fb..17838df783 100644
@@ -27,6 +27,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
+#include "hw/irq.h"
 #include "ui/console.h"
 #include "qapi/error.h"
 #include "qemu/error-report.h"
hw/timer/i8254.c +1 -0
index 0972c4724e..97258757b1 100644
@@ -24,6 +24,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "qemu/module.h"
 #include "qemu/timer.h"
 #include "hw/timer/i8254.h"
hw/timer/imx_epit.c +1 -0
index 7a883160f4..afeb74339a 100644
@@ -14,6 +14,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/timer/imx_epit.h"
+#include "hw/irq.h"
 #include "hw/misc/imx_ccm.h"
 #include "qemu/main-loop.h"
 #include "qemu/module.h"
hw/timer/imx_gpt.c +1 -0
index 3086c03774..b4cfc52019 100644
@@ -13,6 +13,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/timer/imx_gpt.h"
 #include "qemu/main-loop.h"
 #include "qemu/module.h"
hw/timer/lm32_timer.c +1 -0
index 6ce876c6ae..4beffc1396 100644
@@ -23,6 +23,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "trace.h"
 #include "qemu/timer.h"
hw/timer/m48t59.c +1 -0
index 030c8872a2..e2479c504a 100644
@@ -26,6 +26,7 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/timer/m48t59.h"
 #include "qemu/timer.h"
 #include "sysemu/sysemu.h"
hw/timer/mc146818rtc.c +1 -0
index 21fcba5e3a..0410cccafa 100644
@@ -28,6 +28,7 @@
 #include "qemu/module.h"
 #include "qemu/bcd.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "qemu/timer.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/replay.h"
hw/timer/milkymist-sysctl.c +1 -0
index a9d250877c..0f9c39715d 100644
@@ -23,6 +23,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "sysemu/sysemu.h"
 #include "trace.h"
hw/timer/mss-timer.c +1 -0
index 6add47af99..1be9baf9c0 100644
@@ -27,6 +27,7 @@
 #include "qemu/main-loop.h"
 #include "qemu/module.h"
 #include "qemu/log.h"
+#include "hw/irq.h"
 #include "hw/timer/mss-timer.h"
 
 #ifndef MSS_TIMER_ERR_DEBUG
hw/timer/nrf51_timer.c +1 -0
index 29fb81a744..297403c4fd 100644
@@ -15,6 +15,7 @@
 #include "qemu/log.h"
 #include "qemu/module.h"
 #include "hw/arm/nrf51.h"
+#include "hw/irq.h"
 #include "hw/timer/nrf51_timer.h"
 #include "trace.h"
 
hw/timer/omap_gptimer.c +2 -0
index ae2dc99832..c34f60b5d4 100644
@@ -17,8 +17,10 @@
  * You should have received a copy of the GNU General Public License along
  * with this program; if not, see <http://www.gnu.org/licenses/>.
  */
+
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "qemu/timer.h"
 #include "hw/arm/omap.h"
 
hw/timer/pl031.c +1 -0
index 1a7e2ee06b..435c4a6c7e 100644
@@ -14,6 +14,7 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "hw/timer/pl031.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "qemu/timer.h"
 #include "sysemu/sysemu.h"
hw/timer/puv3_ost.c +1 -0
index 4a8ae37ffd..6fe370049b 100644
@@ -11,6 +11,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
+#include "hw/irq.h"
 #include "hw/ptimer.h"
 #include "qemu/main-loop.h"
 #include "qemu/module.h"
hw/timer/pxa2xx_timer.c +1 -0
index 8c1ef43cd5..9c3b2b80ab 100644
@@ -9,6 +9,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "qemu/timer.h"
 #include "sysemu/sysemu.h"
 #include "hw/arm/pxa.h"
hw/timer/sh_timer.c +1 -0
index 91b18ba312..adcc0c138e 100644
@@ -10,6 +10,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/sh4/sh.h"
 #include "qemu/timer.h"
 #include "qemu/main-loop.h"
hw/timer/slavio_timer.c +1 -0
index 005fd599e8..310a0a126a 100644
@@ -24,6 +24,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu/timer.h"
+#include "hw/irq.h"
 #include "hw/ptimer.h"
 #include "hw/sysbus.h"
 #include "trace.h"
hw/timer/stm32f2xx_timer.c +1 -0
index 4c49dc4995..d7af928667 100644
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/timer/stm32f2xx_timer.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
hw/timer/twl92230.c +1 -0
index 91ae7bf203..795f894a39 100644
@@ -24,6 +24,7 @@
 #include "hw/hw.h"
 #include "qemu/timer.h"
 #include "hw/i2c/i2c.h"
+#include "hw/irq.h"
 #include "migration/qemu-file-types.h"
 #include "sysemu/sysemu.h"
 #include "ui/console.h"
hw/timer/xilinx_timer.c +1 -0
index 16bcd0393b..c4a83af8b9 100644
@@ -24,6 +24,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
+#include "hw/irq.h"
 #include "hw/ptimer.h"
 #include "qemu/log.h"
 #include "qemu/main-loop.h"
hw/timer/xlnx-zynqmp-rtc.c +1 -0
index 36daf0c7e7..48c3fba677 100644
@@ -31,6 +31,7 @@
 #include "qemu/bitops.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
+#include "hw/irq.h"
 #include "hw/ptimer.h"
 #include "qemu/cutils.h"
 #include "sysemu/sysemu.h"
hw/tpm/tpm_tis.c +1 -0
index d6b3212890..747e943c42 100644
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/isa/isa.h"
 #include "qapi/error.h"
 #include "qemu/module.h"
hw/unicore32/puv3.c +1 -0
index 132e6086ee..7e933de228 100644
@@ -20,6 +20,7 @@
 #undef DEBUG_PUV3
 #include "hw/unicore32/puv3.h"
 #include "hw/input/i8042.h"
+#include "hw/irq.h"
 
 #define KERNEL_LOAD_ADDR        0x03000000
 #define KERNEL_MAX_SIZE         0x00800000 /* Just a guess */
hw/usb/hcd-ehci.c +1 -0
index 62dab0592f..d2189fc844 100644
@@ -28,6 +28,7 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
+#include "hw/irq.h"
 #include "hw/usb/ehci-regs.h"
 #include "hw/usb/hcd-ehci.h"
 #include "trace.h"
hw/usb/hcd-ohci.c +1 -0
index 4f6fdbc0a7..1ced5cd71a 100644
@@ -27,6 +27,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "qapi/error.h"
 #include "qemu/module.h"
 #include "qemu/timer.h"
hw/vfio/platform.c +1 -0
index 622e609fb4..708df2ec0d 100644
@@ -29,6 +29,7 @@
 #include "qemu/queue.h"
 #include "hw/sysbus.h"
 #include "trace.h"
+#include "hw/irq.h"
 #include "hw/platform-bus.h"
 #include "sysemu/kvm.h"
 
hw/virtio/virtio-mmio.c +1 -0
index d4c0997074..3dc525dea4 100644
@@ -21,6 +21,7 @@
 
 #include "qemu/osdep.h"
 #include "standard-headers/linux/virtio_mmio.h"
+#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "hw/virtio/virtio.h"
 #include "migration/qemu-file-types.h"
hw/watchdog/cmsdk-apb-watchdog.c +1 -0
index 54ac393020..a79da39dd5 100644
@@ -28,6 +28,7 @@
 #include "qemu/module.h"
 #include "sysemu/watchdog.h"
 #include "hw/sysbus.h"
+#include "hw/irq.h"
 #include "hw/registerfields.h"
 #include "hw/watchdog/cmsdk-apb-watchdog.h"
 
hw/xtensa/mx_pic.c +1 -0
index 7075db9d4b..912de66206 100644
@@ -27,6 +27,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "hw/xtensa/mx_pic.h"
 #include "qemu/log.h"
 
hw/xtensa/pic_cpu.c +1 -0
index df3acbb541..b708290d7b 100644
@@ -28,6 +28,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "hw/hw.h"
+#include "hw/irq.h"
 #include "qemu/log.h"
 #include "qemu/timer.h"
 
include/hw/acpi/acpi.h +0 -1
index c91e2b9df2..1f2dafbd7d 100644
@@ -22,7 +22,6 @@
 
 #include "qemu/notify.h"
 #include "exec/memory.h"
-#include "hw/irq.h"
 #include "hw/acpi/acpi_dev_interface.h"
 
 /*
include/hw/arm/boot.h +0 -1
index c48cc4c2bc..350d4b0498 100644
@@ -13,7 +13,6 @@
 
 #include "exec/memory.h"
 #include "target/arm/cpu-qom.h"
-#include "hw/irq.h"
 #include "qemu/notify.h"
 
 typedef enum {
include/hw/arm/omap.h +0 -1
index d21e418242..2fda996648 100644
@@ -21,7 +21,6 @@
 #define HW_ARM_OMAP_H
 
 #include "exec/memory.h"
-#include "hw/irq.h"
 #include "hw/input/tsc2xxx.h"
 #include "target/arm/cpu-qom.h"
 #include "qemu/log.h"
include/hw/arm/soc_dma.h +0 -1
index fae322997e..7886291d54 100644
@@ -22,7 +22,6 @@
 #define HW_SOC_DMA_H
 
 #include "exec/memory.h"
-#include "hw/irq.h"
 
 struct soc_dma_s;
 struct soc_dma_ch_s;
include/hw/block/fdc.h +0 -1
index f4fe2f471b..c15ff4c623 100644
@@ -2,7 +2,6 @@
 #define HW_FDC_H
 
 #include "exec/hwaddr.h"
-#include "hw/irq.h"
 #include "qapi/qapi-types-block.h"
 
 /* fdc.c */
include/hw/bt.h +0 -1
index b5e11d4d43..d9ee2fc29a 100644
@@ -26,7 +26,6 @@
 #ifndef HW_BT_H
 #define HW_BT_H
 
-#include "hw/irq.h"
 
 /* BD Address */
 typedef struct {
include/hw/core/split-irq.h +0 -1
index bb87157c5a..872a39aa4f 100644
@@ -35,7 +35,6 @@
 #ifndef HW_SPLIT_IRQ_H
 #define HW_SPLIT_IRQ_H
 
-#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "qom/object.h"
 
include/hw/cris/etraxfs_dma.h +0 -1
index 31ae360611..095d76b956 100644
@@ -2,7 +2,6 @@
 #define HW_ETRAXFS_DMA_H
 
 #include "exec/hwaddr.h"
-#include "hw/irq.h"
 
 struct dma_context_metadata {
 	/* data descriptor md */
include/hw/display/blizzard.h +0 -1
index ef72bbc186..5b33018835 100644
@@ -11,7 +11,6 @@
 #ifndef HW_DISPLAY_BLIZZARD_H
 #define HW_DISPLAY_BLIZZARD_H
 
-#include "hw/irq.h"
 
 void *s1d13745_init(qemu_irq gpio_int);
 void s1d13745_write(void *opaque, int dc, uint16_t value);
include/hw/display/tc6393xb.h +0 -1
index 5c4da91f80..c653ef717b 100644
@@ -13,7 +13,6 @@
 #define HW_DISPLAY_TC6393XB_H
 
 #include "exec/memory.h"
-#include "hw/irq.h"
 
 typedef struct TC6393xbState TC6393xbState;
 
include/hw/hw.h +0 -1
index b399627cbe..38d2fb1f40 100644
@@ -9,7 +9,6 @@
 #include "exec/cpu-common.h"
 #include "qom/object.h"
 #include "exec/memory.h"
-#include "hw/irq.h"
 #include "migration/vmstate.h"
 
 void QEMU_NORETURN hw_error(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
include/hw/ide/internal.h +1 -0
index 8efd03132b..c6954c1d56 100644
@@ -7,6 +7,7 @@
  * non-internal declarations are in hw/ide.h
  */
 #include "hw/ide.h"
+#include "hw/irq.h"
 #include "hw/isa/isa.h"
 #include "sysemu/dma.h"
 #include "sysemu/sysemu.h"
include/hw/input/gamepad.h +0 -1
index e20211baef..6f6aa2406a 100644
@@ -11,7 +11,6 @@
 #ifndef HW_INPUT_GAMEPAD_H
 #define HW_INPUT_GAMEPAD_H
 
-#include "hw/irq.h"
 
 /* stellaris_input.c */
 void stellaris_gamepad_init(int n, qemu_irq *irq, const int *keycode);
include/hw/input/tsc2xxx.h +0 -1
index dbfe5c55c1..3cd8f1bf55 100644
@@ -11,7 +11,6 @@
 #ifndef HW_INPUT_TSC2XXX_H
 #define HW_INPUT_TSC2XXX_H
 
-#include "hw/irq.h"
 #include "ui/console.h"
 
 typedef struct uWireSlave {
include/hw/irq.h +0 -4
index 7a40e3ed26..fe527f6f51 100644
@@ -5,10 +5,6 @@
 
 #define TYPE_IRQ "irq"
 
-typedef struct IRQState *qemu_irq;
-
-typedef void (*qemu_irq_handler)(void *opaque, int n, int level);
-
 void qemu_set_irq(qemu_irq irq, int level);
 
 static inline void qemu_irq_raise(qemu_irq irq)
include/hw/isa/vt82c686.h +0 -1
index a54c3fe60a..f23f45dfb1 100644
@@ -1,7 +1,6 @@
 #ifndef HW_VT82C686_H
 #define HW_VT82C686_H
 
-#include "hw/irq.h"
 
 #define TYPE_VT82C686B_SUPERIO "vt82c686b-superio"
 
include/hw/mips/mips.h +0 -1
index 2f6774d540..0af4c3d5d7 100644
@@ -6,7 +6,6 @@
 #define INITRD_PAGE_MASK (~((1 << 16) - 1))
 
 #include "exec/memory.h"
-#include "hw/irq.h"
 
 /* gt64xxx.c */
 PCIBus *gt64120_register(qemu_irq *pic);
include/hw/misc/cbus.h +0 -1
index c899943e03..5334984020 100644
@@ -13,7 +13,6 @@
 #ifndef HW_MISC_CBUS_H
 #define HW_MISC_CBUS_H
 
-#include "hw/irq.h"
 
 typedef struct {
     qemu_irq clk;
include/hw/net/lan9118.h +0 -1
index 500acb4c14..3d0c67f339 100644
@@ -11,7 +11,6 @@
 #ifndef HW_NET_LAN9118_H
 #define HW_NET_LAN9118_H
 
-#include "hw/irq.h"
 #include "net/net.h"
 
 #define TYPE_LAN9118 "lan9118"
include/hw/net/smc91c111.h +0 -1
index a66ba4112f..df5b11dcef 100644
@@ -11,7 +11,6 @@
 #ifndef HW_NET_SMC91C111_H
 #define HW_NET_SMC91C111_H
 
-#include "hw/irq.h"
 #include "net/net.h"
 
 void smc91c111_init(NICInfo *, uint32_t, qemu_irq);
include/hw/or-irq.h +0 -1
index 5a31e5a188..3a3230dd84 100644
@@ -25,7 +25,6 @@
 #ifndef HW_OR_IRQ_H
 #define HW_OR_IRQ_H
 
-#include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "qom/object.h"
 
include/hw/ppc/spapr_irq.h +0 -1
index cd6e18b05e..8132e00366 100644
@@ -10,7 +10,6 @@
 #ifndef HW_SPAPR_IRQ_H
 #define HW_SPAPR_IRQ_H
 
-#include "hw/irq.h"
 #include "target/ppc/cpu-qom.h"
 
 /*
include/hw/qdev-core.h +0 -1
index 136df7774c..b870c8ceeb 100644
@@ -4,7 +4,6 @@
 #include "qemu/queue.h"
 #include "qemu/bitmap.h"
 #include "qom/object.h"
-#include "hw/irq.h"
 #include "hw/hotplug.h"
 #include "sysemu/sysemu.h"
 
include/hw/sh4/sh_intc.h +0 -1
index 3d3efde059..65f3425057 100644
@@ -2,7 +2,6 @@
 #define SH_INTC_H
 
 #include "exec/memory.h"
-#include "hw/irq.h"
 
 typedef unsigned char intc_enum;
 
include/hw/timer/m48t59.h +0 -1
index d3fb50e08c..f74854c026 100644
@@ -2,7 +2,6 @@
 #define HW_M48T59_H
 
 #include "exec/hwaddr.h"
-#include "hw/irq.h"
 #include "qom/object.h"
 
 #define TYPE_NVRAM "nvram"
include/hw/tricore/tricore.h +0 -1
index 89ef922c67..c19ed3f013 100644
@@ -2,7 +2,6 @@
 #define HW_TRICORE_H
 
 #include "exec/memory.h"
-#include "hw/irq.h"
 
 struct tricore_boot_info {
     uint64_t ram_size;
include/hw/vfio/vfio-platform.h +0 -1
index 30d3c28d3b..4ec70c813a 100644
@@ -20,7 +20,6 @@
 #include "hw/vfio/vfio-common.h"
 #include "qemu/event_notifier.h"
 #include "qemu/queue.h"
-#include "hw/irq.h"
 
 #define TYPE_VFIO_PLATFORM "vfio-platform"
 
include/hw/xen/xen.h +0 -1
index 9c7b5f78dc..5ac1c6dc55 100644
@@ -9,7 +9,6 @@
  */
 
 #include "exec/cpu-common.h"
-#include "hw/irq.h"
 
 /* xen-machine.c */
 enum xen_mode {
include/hw/xtensa/mx_pic.h +0 -1
index c9ea9e737c..500424c8d3 100644
@@ -29,7 +29,6 @@
 #define XTENSA_MX_PIC_H
 
 #include "exec/memory.h"
-#include "hw/irq.h"
 
 struct XtensaMxPic;
 typedef struct XtensaMxPic XtensaMxPic;
include/qemu/typedefs.h +9 -0
index 29346648d4..c32efb5b18 100644
@@ -102,10 +102,19 @@ typedef struct SSIBus SSIBus;
 typedef struct VirtIODevice VirtIODevice;
 typedef struct Visitor Visitor;
 
+/*
+ * Pointer types
+ * Such typedefs should be limited to cases where the typedef's users
+ * are oblivious of its "pointer-ness".
+ * Please keep this list in case-insensitive alphabetical order.
+ */
+typedef struct IRQState *qemu_irq;
+
 /*
  * Function types
  */
 typedef void SaveStateHandler(QEMUFile *f, void *opaque);
 typedef int LoadStateHandler(QEMUFile *f, void *opaque, int version_id);
+typedef void (*qemu_irq_handler)(void *opaque, int n, int level);
 
 #endif /* QEMU_TYPEDEFS_H */
include/sysemu/kvm.h +0 -1
index acd90aebb6..c8ea412f62 100644
@@ -17,7 +17,6 @@
 #include "qemu/queue.h"
 #include "qom/cpu.h"
 #include "exec/memattrs.h"
-#include "hw/irq.h"
 
 #ifdef NEED_CPU_H
 # ifdef CONFIG_KVM
target/arm/helper.c +1 -0
index b74c23a9bc..75b66bf844 100644
@@ -20,6 +20,7 @@
 #include "qemu/qemu-print.h"
 #include "exec/exec-all.h"
 #include <zlib.h> /* For crc32 */
+#include "hw/irq.h"
 #include "hw/semihosting/semihost.h"
 #include "sysemu/cpus.h"
 #include "sysemu/kvm.h"
target/arm/kvm.c +1 -0
index fe4f461d4e..36a1e60bd4 100644
@@ -27,6 +27,7 @@
 #include "exec/memattrs.h"
 #include "exec/address-spaces.h"
 #include "hw/boards.h"
+#include "hw/irq.h"
 #include "qemu/log.h"
 
 const KVMCapabilityInfo kvm_arch_required_capabilities[] = {
target/mips/cp0_timer.c +1 -0
index f4716395df..48c18d7818 100644
@@ -21,6 +21,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/irq.h"
 #include "hw/mips/cpudevs.h"
 #include "qemu/timer.h"
 #include "sysemu/kvm.h"
Signature · 1 line
2.21.0
Reviewed-by Tested-by on v2 12/29
#35 lore raw

Re: [Qemu-devel] [PATCH v2 12/29] Include hw/irq.h a lot less

Quoted 353 lines · Markus Armbruster

In my "build everything" tree, changing hw/irq.h triggers a recompile of some 5400 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h).

hw/hw.h supposedly includes it for convenience. Several other headers include it just to get qemu_irq and.or qemu_irq_handler.

Move the qemu_irq and qemu_irq_handler typedefs from hw/irq.h to qemu/typedefs.h, and then include hw/irq.h only where it's still needed. Touching it now recompiles only some 500 objects.

---
 hw/acpi/core.c                   | 1 +
 hw/acpi/piix4.c                  | 1 +
 hw/alpha/alpha_sys.h             | 1 -
 hw/alpha/typhoon.c               | 1 +
 hw/arm/armsse.c                  | 1 +
 hw/arm/exynos4210.c              | 1 +
 hw/arm/exynos4_boards.c          | 1 +
 hw/arm/integratorcp.c            | 1 +
 hw/arm/msf2-soc.c                | 1 +
 hw/arm/musicpal.c                | 1 +
 hw/arm/omap1.c                   | 1 +
 hw/arm/omap2.c                   | 1 +
 hw/arm/palm.c                    | 2 ++
 hw/arm/pxa2xx.c                  | 1 +
 hw/arm/pxa2xx_gpio.c             | 1 +
 hw/arm/realview.c                | 1 +
 hw/arm/smmuv3.c                  | 1 +
 hw/arm/spitz.c                   | 1 +
 hw/arm/stellaris.c               | 1 +
 hw/arm/strongarm.c               | 1 +
 hw/arm/tosa.c                    | 1 +
 hw/arm/versatilepb.c             | 1 +
 hw/arm/virt.c                    | 1 +
 hw/arm/z2.c                      | 1 +
 hw/audio/cs4231a.c               | 1 +
 hw/audio/gus.c                   | 1 +
 hw/audio/marvell_88w8618.c       | 1 +
 hw/audio/milkymist-ac97.c        | 1 +
 hw/audio/pl041.c                 | 1 +
 hw/audio/sb16.c                  | 1 +
 hw/block/fdc.c                   | 1 +
 hw/char/bcm2835_aux.c            | 1 +
 hw/char/cadence_uart.c           | 1 +
 hw/char/cmsdk-apb-uart.c         | 1 +
 hw/char/escc.c                   | 1 +
 hw/char/etraxfs_ser.c            | 1 +
 hw/char/exynos4210_uart.c        | 1 +
 hw/char/grlib_apbuart.c          | 1 +
 hw/char/imx_serial.c             | 1 +
 hw/char/ipoctal232.c             | 1 +
 hw/char/lm32_uart.c              | 1 +
 hw/char/mcf_uart.c               | 1 +
 hw/char/milkymist-uart.c         | 1 +
 hw/char/nrf51_uart.c             | 1 +
 hw/char/parallel.c               | 1 +
 hw/char/pl011.c                  | 1 +
 hw/char/serial-pci-multi.c       | 1 +
 hw/char/serial-pci.c             | 1 +
 hw/char/serial.c                 | 1 +
 hw/char/sh_serial.c              | 2 ++
 hw/char/spapr_vty.c              | 1 +
 hw/char/stm32f2xx_usart.c        | 1 +
 hw/char/xilinx_uartlite.c        | 1 +
 hw/core/or-irq.c                 | 1 +
 hw/core/qdev.c                   | 1 +
 hw/core/split-irq.c              | 1 +
 hw/cpu/a15mpcore.c               | 1 +
 hw/cpu/a9mpcore.c                | 1 +
 hw/cpu/arm11mpcore.c             | 1 +
 hw/cpu/realview_mpcore.c         | 1 +
 hw/display/ads7846.c             | 1 +
 hw/display/bcm2835_fb.c          | 1 +
 hw/display/cg3.c                 | 1 +
 hw/display/exynos4210_fimd.c     | 1 +
 hw/display/g364fb.c              | 1 +
 hw/display/milkymist-tmu2.c      | 1 +
 hw/display/omap_dss.c            | 2 ++
 hw/display/omap_lcdc.c           | 2 ++
 hw/display/pl110.c               | 1 +
 hw/display/pxa2xx_lcd.c          | 1 +
 hw/display/tc6393xb.c            | 2 ++
 hw/display/xlnx_dp.c             | 1 +
 hw/dma/bcm2835_dma.c             | 1 +
 hw/dma/etraxfs_dma.c             | 2 ++
 hw/dma/pl080.c                   | 1 +
 hw/dma/pl330.c                   | 1 +
 hw/dma/pxa2xx_dma.c              | 1 +
 hw/dma/rc4030.c                  | 1 +
 hw/dma/sparc32_dma.c             | 1 +
 hw/dma/xilinx_axidma.c           | 1 +
 hw/dma/xlnx-zdma.c               | 1 +
 hw/dma/xlnx-zynq-devcfg.c        | 1 +
 hw/dma/xlnx_dpdma.c              | 1 +
 hw/gpio/bcm2835_gpio.c           | 1 +
 hw/gpio/gpio_key.c               | 1 +
 hw/gpio/imx_gpio.c               | 1 +
 hw/gpio/max7310.c                | 1 +
 hw/gpio/mpc8xxx.c                | 1 +
 hw/gpio/nrf51_gpio.c             | 1 +
 hw/gpio/omap_gpio.c              | 1 +
 hw/gpio/pl061.c                  | 1 +
 hw/gpio/zaurus.c                 | 1 +
 hw/hppa/dino.c                   | 1 +
 hw/hppa/hppa_sys.h               | 1 -
 hw/i2c/aspeed_i2c.c              | 1 +
 hw/i2c/bitbang_i2c.c             | 1 +
 hw/i2c/exynos4210_i2c.c          | 1 +
 hw/i2c/imx_i2c.c                 | 1 +
 hw/i2c/mpc_i2c.c                 | 1 +
 hw/i2c/omap_i2c.c                | 1 +
 hw/i2c/ppc4xx_i2c.c              | 1 +
 hw/i386/kvm/i8259.c              | 1 +
 hw/i386/kvm/ioapic.c             | 1 +
 hw/i386/pc.c                     | 1 +
 hw/i386/pc_piix.c                | 1 +
 hw/i386/xen/xen-hvm.c            | 1 +
 hw/input/lm832x.c                | 1 +
 hw/input/milkymist-softusb.c     | 1 +
 hw/input/pckbd.c                 | 1 +
 hw/input/pl050.c                 | 1 +
 hw/input/pxa2xx_keypad.c         | 1 +
 hw/input/stellaris_input.c       | 2 ++
 hw/input/tsc2005.c               | 1 +
 hw/input/tsc210x.c               | 1 +
 hw/intc/allwinner-a10-pic.c      | 1 +
 hw/intc/arm_gic.c                | 1 +
 hw/intc/arm_gicv2m.c             | 1 +
 hw/intc/arm_gicv3_cpuif.c        | 1 +
 hw/intc/armv7m_nvic.c            | 1 +
 hw/intc/aspeed_vic.c             | 1 +
 hw/intc/bcm2835_ic.c             | 1 +
 hw/intc/bcm2836_control.c        | 1 +
 hw/intc/etraxfs_pic.c            | 1 +
 hw/intc/exynos4210_combiner.c    | 1 +
 hw/intc/heathrow_pic.c           | 1 +
 hw/intc/i8259.c                  | 2 ++
 hw/intc/imx_avic.c               | 1 +
 hw/intc/lm32_pic.c               | 1 +
 hw/intc/mips_gic.c               | 1 +
 hw/intc/nios2_iic.c              | 1 +
 hw/intc/omap_intc.c              | 1 +
 hw/intc/ompic.c                  | 1 +
 hw/intc/openpic.c                | 1 +
 hw/intc/pl190.c                  | 1 +
 hw/intc/puv3_intc.c              | 1 +
 hw/intc/realview_gic.c           | 1 +
 hw/intc/sh_intc.c                | 1 +
 hw/intc/slavio_intctl.c          | 1 +
 hw/intc/xics.c                   | 1 +
 hw/intc/xilinx_intc.c            | 1 +
 hw/intc/xive.c                   | 1 +
 hw/intc/xlnx-pmu-iomod-intc.c    | 1 +
 hw/intc/xlnx-zynqmp-ipi.c        | 1 +
 hw/ipack/ipack.c                 | 1 +
 hw/ipack/tpci200.c               | 1 +
 hw/ipmi/isa_ipmi_bt.c            | 1 +
 hw/ipmi/isa_ipmi_kcs.c           | 1 +
 hw/isa/i82378.c                  | 1 +
 hw/isa/lpc_ich9.c                | 2 ++
 hw/lm32/lm32_boards.c            | 1 +
 hw/lm32/milkymist.c              | 1 +
 hw/m68k/mcf5206.c                | 2 ++
 hw/m68k/mcf5208.c                | 2 ++
 hw/m68k/mcf_intc.c               | 1 +
 hw/mips/gt64xxx_pci.c            | 1 +
 hw/mips/mips_int.c               | 1 +
 hw/mips/mips_malta.c             | 1 +
 hw/misc/arm_sysctl.c             | 1 +
 hw/misc/armsse-mhu.c             | 1 +
 hw/misc/aspeed_xdma.c            | 1 +
 hw/misc/bcm2835_mbox.c           | 1 +
 hw/misc/bcm2835_property.c       | 1 +
 hw/misc/eccmemctl.c              | 1 +
 hw/misc/iotkit-secctl.c          | 1 +
 hw/misc/macio/mac_dbdma.c        | 1 +
 hw/misc/macio/pmu.c              | 1 +
 hw/misc/max111x.c                | 1 +
 hw/misc/milkymist-pfpu.c         | 1 +
 hw/misc/mos6522.c                | 1 +
 hw/misc/mst_fpga.c               | 1 +
 hw/misc/nrf51_rng.c              | 1 +
 hw/misc/omap_clk.c               | 2 ++
 hw/misc/omap_gpmc.c              | 2 ++
 hw/misc/pc-testdev.c             | 1 +
 hw/misc/slavio_misc.c            | 1 +
 hw/misc/tmp105.c                 | 1 +
 hw/misc/tz-mpc.c                 | 1 +
 hw/misc/tz-msc.c                 | 1 +
 hw/misc/tz-ppc.c                 | 1 +
 hw/misc/zynq-xadc.c              | 1 +
 hw/net/allwinner_emac.c          | 1 +
 hw/net/cadence_gem.c             | 1 +
 hw/net/can/can_kvaser_pci.c      | 1 +
 hw/net/can/can_mioe3680_pci.c    | 1 +
 hw/net/can/can_pcm3680_pci.c     | 1 +
 hw/net/can/can_sja1000.c         | 2 ++
 hw/net/dp8393x.c                 | 1 +
 hw/net/fsl_etsec/etsec.c         | 1 +
 hw/net/ftgmac100.c               | 1 +
 hw/net/imx_fec.c                 | 1 +
 hw/net/lan9118.c                 | 1 +
 hw/net/mcf_fec.c                 | 1 +
 hw/net/milkymist-minimac2.c      | 1 +
 hw/net/mipsnet.c                 | 1 +
 hw/net/ne2000-pci.c              | 2 ++
 hw/net/ne2000.c                  | 1 +
 hw/net/opencores_eth.c           | 1 +
 hw/net/pcnet-pci.c               | 1 +
 hw/net/pcnet.c                   | 1 +
 hw/net/smc91c111.c               | 1 +
 hw/net/spapr_llan.c              | 1 +
 hw/net/stellaris_enet.c          | 1 +
 hw/net/xgmac.c                   | 1 +
 hw/net/xilinx_axienet.c          | 1 +
 hw/net/xilinx_ethlite.c          | 1 +
 hw/nios2/cpu_pic.c               | 1 +
 hw/openrisc/openrisc_sim.c       | 1 +
 hw/openrisc/pic_cpu.c            | 1 +
 hw/pci-host/bonito.c             | 1 +
 hw/pci-host/designware.c         | 1 +
 hw/pci-host/gpex.c               | 1 +
 hw/pci-host/grackle.c            | 1 +
 hw/pci-host/piix.c               | 1 +
 hw/pci-host/ppce500.c            | 1 +
 hw/pci-host/prep.c               | 1 +
 hw/pci-host/sabre.c              | 1 +
 hw/pci-host/uninorth.c           | 1 +
 hw/pci-host/versatile.c          | 1 +
 hw/pci-host/xilinx-pcie.c        | 1 +
 hw/pci/pci.c                     | 1 +
 hw/pcmcia/pxa2xx.c               | 1 +
 hw/ppc/e500.c                    | 1 +
 hw/ppc/pnv_lpc.c                 | 1 +
 hw/ppc/pnv_psi.c                 | 1 +
 hw/ppc/ppc.c                     | 2 ++
 hw/ppc/ppc405_uc.c               | 1 +
 hw/ppc/ppc440_pcix.c             | 1 +
 hw/ppc/ppc440_uc.c               | 1 +
 hw/ppc/ppc4xx_devs.c             | 1 +
 hw/ppc/ppc4xx_pci.c              | 1 +
 hw/ppc/prep.c                    | 1 +
 hw/ppc/prep_systemio.c           | 1 +
 hw/ppc/spapr_events.c            | 2 ++
 hw/ppc/spapr_irq.c               | 1 +
 hw/ppc/spapr_pci.c               | 1 +
 hw/ppc/spapr_vio.c               | 1 +
 hw/riscv/sifive_gpio.c           | 1 +
 hw/riscv/sifive_uart.c           | 1 +
 hw/scsi/esp-pci.c                | 1 +
 hw/scsi/esp.c                    | 1 +
 hw/scsi/lsi53c895a.c             | 1 +
 hw/sd/bcm2835_sdhost.c           | 1 +
 hw/sd/omap_mmc.c                 | 2 ++
 hw/sd/pl181.c                    | 1 +
 hw/sd/pxa2xx_mmci.c              | 1 +
 hw/sd/sd.c                       | 1 +
 hw/sd/sdhci.c                    | 1 +
 hw/sh4/r2d.c                     | 1 +
 hw/sh4/sh7750.c                  | 2 ++
 hw/sh4/sh_pci.c                  | 1 +
 hw/sparc/leon3.c                 | 1 +
 hw/sparc/sun4m.c                 | 1 +
 hw/sparc/sun4m_iommu.c           | 1 +
 hw/ssi/aspeed_smc.c              | 1 +
 hw/ssi/imx_spi.c                 | 1 +
 hw/ssi/mss-spi.c                 | 1 +
 hw/ssi/omap_spi.c                | 2 ++
 hw/ssi/pl022.c                   | 1 +
 hw/ssi/xilinx_spi.c              | 1 +
 hw/ssi/xilinx_spips.c            | 1 +
 hw/timer/a9gtimer.c              | 1 +
 hw/timer/allwinner-a10-pit.c     | 1 +
 hw/timer/altera_timer.c          | 1 +
 hw/timer/arm_mptimer.c           | 1 +
 hw/timer/arm_timer.c             | 1 +
 hw/timer/armv7m_systick.c        | 1 +
 hw/timer/aspeed_timer.c          | 1 +
 hw/timer/cadence_ttc.c           | 1 +
 hw/timer/cmsdk-apb-dualtimer.c   | 1 +
 hw/timer/cmsdk-apb-timer.c       | 1 +
 hw/timer/etraxfs_timer.c         | 1 +
 hw/timer/exynos4210_mct.c        | 1 +
 hw/timer/exynos4210_pwm.c        | 1 +
 hw/timer/exynos4210_rtc.c        | 1 +
 hw/timer/grlib_gptimer.c         | 1 +
 hw/timer/hpet.c                  | 1 +
 hw/timer/i8254.c                 | 1 +
 hw/timer/imx_epit.c              | 1 +
 hw/timer/imx_gpt.c               | 1 +
 hw/timer/lm32_timer.c            | 1 +
 hw/timer/m48t59.c                | 1 +
 hw/timer/mc146818rtc.c           | 1 +
 hw/timer/milkymist-sysctl.c      | 1 +
 hw/timer/mss-timer.c             | 1 +
 hw/timer/nrf51_timer.c           | 1 +
 hw/timer/omap_gptimer.c          | 2 ++
 hw/timer/pl031.c                 | 1 +
 hw/timer/puv3_ost.c              | 1 +
 hw/timer/pxa2xx_timer.c          | 1 +
 hw/timer/sh_timer.c              | 1 +
 hw/timer/slavio_timer.c          | 1 +
 hw/timer/stm32f2xx_timer.c       | 1 +
 hw/timer/twl92230.c              | 1 +
 hw/timer/xilinx_timer.c          | 1 +
 hw/timer/xlnx-zynqmp-rtc.c       | 1 +
 hw/tpm/tpm_tis.c                 | 1 +
 hw/unicore32/puv3.c              | 1 +
 hw/usb/hcd-ehci.c                | 1 +
 hw/usb/hcd-ohci.c                | 1 +
 hw/vfio/platform.c               | 1 +
 hw/virtio/virtio-mmio.c          | 1 +
 hw/watchdog/cmsdk-apb-watchdog.c | 1 +
 hw/xtensa/mx_pic.c               | 1 +
 hw/xtensa/pic_cpu.c              | 1 +
 include/hw/acpi/acpi.h           | 1 -
 include/hw/arm/boot.h            | 1 -
 include/hw/arm/omap.h            | 1 -
 include/hw/arm/soc_dma.h         | 1 -
 include/hw/block/fdc.h           | 1 -
 include/hw/bt.h                  | 1 -
 include/hw/core/split-irq.h      | 1 -
 include/hw/cris/etraxfs_dma.h    | 1 -
 include/hw/display/blizzard.h    | 1 -
 include/hw/display/tc6393xb.h    | 1 -
 include/hw/hw.h                  | 1 -
 include/hw/ide/internal.h        | 1 +
 include/hw/input/gamepad.h       | 1 -
 include/hw/input/tsc2xxx.h       | 1 -
 include/hw/irq.h                 | 4 ----
 include/hw/isa/vt82c686.h        | 1 -
 include/hw/mips/mips.h           | 1 -
 include/hw/misc/cbus.h           | 1 -
 include/hw/net/lan9118.h         | 1 -
 include/hw/net/smc91c111.h       | 1 -
 include/hw/or-irq.h              | 1 -
 include/hw/ppc/spapr_irq.h       | 1 -
 include/hw/qdev-core.h           | 1 -
 include/hw/sh4/sh_intc.h         | 1 -
 include/hw/timer/m48t59.h        | 1 -
 include/hw/tricore/tricore.h     | 1 -
 include/hw/vfio/vfio-platform.h  | 1 -
 include/hw/xen/xen.h             | 1 -
 include/hw/xtensa/mx_pic.h       | 1 -
 include/qemu/typedefs.h          | 9 +++++++++
 include/sysemu/kvm.h             | 1 -
 target/arm/helper.c              | 1 +
 target/arm/kvm.c                 | 1 +
 target/mips/cp0_timer.c          | 1 +
 338 files changed, 336 insertions(+), 34 deletions(-)

[...]

Quoted 15 lines
include/hw/irq.h +0 -4
index 7a40e3ed26..fe527f6f51 100644
@@ -5,10 +5,6 @@
 
 #define TYPE_IRQ "irq"
 
-typedef struct IRQState *qemu_irq;
-
-typedef void (*qemu_irq_handler)(void *opaque, int n, int level);
-
 void qemu_set_irq(qemu_irq irq, int level);
 
 static inline void qemu_irq_raise(qemu_irq irq)

[...]

Quoted 14 lines
include/qemu/typedefs.h +6 -0
index 29346648d4..c32efb5b18 100644
@@ -102,10 +102,19 @@ typedef struct SSIBus SSIBus;
 typedef struct VirtIODevice VirtIODevice;
 typedef struct Visitor Visitor;
 
+/*
+ * Pointer types
+ * Such typedefs should be limited to cases where the typedef's users
+ * are oblivious of its "pointer-ness".
+ * Please keep this list in case-insensitive alphabetical order.
+ */

include/qemu/typedefs.h typedef struct SSIBus SSIBus; · line 120

Quoted 10 lines
include/qemu/typedefs.h +3 -0
+typedef struct IRQState *qemu_irq;
+
 /*
  * Function types
  */
 typedef void SaveStateHandler(QEMUFile *f, void *opaque);
 typedef int LoadStateHandler(QEMUFile *f, void *opaque, int version_id);
+typedef void (*qemu_irq_handler)(void *opaque, int n, int level);
 
 #endif /* QEMU_TYPEDEFS_H */

This one was painful to review.

#36 lore raw

Re: [Qemu-devel] [PATCH v2 12/29] Include hw/irq.h a lot less

Quoted 13 lines · Philippe Mathieu-Daudé
Quoted 11 lines · Markus Armbruster

In my "build everything" tree, changing hw/irq.h triggers a recompile of some 5400 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h).

hw/hw.h supposedly includes it for convenience. Several other headers include it just to get qemu_irq and.or qemu_irq_handler.

Move the qemu_irq and qemu_irq_handler typedefs from hw/irq.h to qemu/typedefs.h, and then include hw/irq.h only where it's still needed. Touching it now recompiles only some 500 objects.

Quoted 6 lines
Quoted 6 lines

/*
* Function types
*/
typedef void SaveStateHandler(QEMUFile *f, void *opaque); typedef int LoadStateHandler(QEMUFile *f, void *opaque, int version_id);
+typedef void (*qemu_irq_handler)(void *opaque, int n, int level);

Should we prefer a consistent form for function pointer typedefs? Here, we've mixed 'rettype Name(params)' with 'rettype (*name)(params)'.

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org
#37 lore raw

Re: [Qemu-devel] [PATCH v2 12/29] Include hw/irq.h a lot less

Quoted 21 lines · Eric Blake
Quoted 13 lines · Philippe Mathieu-Daudé
Quoted 11 lines · Markus Armbruster

In my "build everything" tree, changing hw/irq.h triggers a recompile of some 5400 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h).

hw/hw.h supposedly includes it for convenience. Several other headers include it just to get qemu_irq and.or qemu_irq_handler.

Move the qemu_irq and qemu_irq_handler typedefs from hw/irq.h to qemu/typedefs.h, and then include hw/irq.h only where it's still needed. Touching it now recompiles only some 500 objects.

Quoted 6 lines
Quoted 6 lines

/*
* Function types
*/
typedef void SaveStateHandler(QEMUFile *f, void *opaque); typedef int LoadStateHandler(QEMUFile *f, void *opaque, int version_id);
+typedef void (*qemu_irq_handler)(void *opaque, int n, int level);

Quoted 2 lines

Should we prefer a consistent form for function pointer typedefs? Here, we've mixed 'rettype Name(params)' with 'rettype (*name)(params)'.

Which of the two difference I can see do you mean?

CamelCase vs. lower_case_with_underscore?

Parenthesis around the type name? I wouldn't call that inconsistent, we simply use parenthesis only when needed.

#38 lore raw

Re: [Qemu-devel] [PATCH v2 12/29] Include hw/irq.h a lot less

Quoted 8 lines · Markus Armbruster
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

typedef void SaveStateHandler(QEMUFile *f, void *opaque); typedef int LoadStateHandler(QEMUFile *f, void *opaque, int version_id);
+typedef void (*qemu_irq_handler)(void *opaque, int n, int level);

Should we prefer a consistent form for function pointer typedefs? Here, we've mixed 'rettype Name(params)' with 'rettype (*name)(params)'.

Which of the two difference I can see do you mean?

Eric asked about function type vs pointer-to-function type.

In usage,

SaveStateHandler *variable;
vs
qemu_irq_handler variable;

r~

#39 lore raw

Re: [Qemu-devel] [PATCH v2 12/29] Include hw/irq.h a lot less

In reply to Markus Armbruster
Quoted 11 lines · Markus Armbruster
Quoted 9 lines
Quoted 6 lines
Quoted 6 lines

/*
* Function types
*/
typedef void SaveStateHandler(QEMUFile *f, void *opaque); typedef int LoadStateHandler(QEMUFile *f, void *opaque, int version_id);
+typedef void (*qemu_irq_handler)(void *opaque, int n, int level);

Should we prefer a consistent form for function pointer typedefs? Here, we've mixed 'rettype Name(params)' with 'rettype (*name)(params)'.

Which of the two difference I can see do you mean?

Both :)

Quoted 2 lines

CamelCase vs. lower_case_with_underscore?

Indeed, choosing a consistent naming convention to make it obvious we are referring to a typedef naming a function signature may be useful.

Quoted 3 lines

Parenthesis around the type name? I wouldn't call that inconsistent, we simply use parenthesis only when needed.

And the question of whether the * is implied by the typedef itself (which we tend to avoid for typedefs to structures) or must be supplied at the point of use. It gets odd since C permits both 'FuncType f = myfunc' and 'FuncType f = &myfunc', and since invoking through a function pointer can be done as both 'f(args)' and '(*f)(args)'. However, since we only have 3 uses total that declare a use of SaveStateHandler and LoadStateHandler, compared to a LOT of use of qemu_irq_handler, moving the '*' out of the declarations and into the typedef of the former is a lot easier than moving the '*' out of the typedef and into the declarations of the latter.

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org
#40 lore raw

PATCH v2 13/29 Clean up inclusion of exec/cpu-common.h

In reply to Markus Armbruster

migration/qemu-file.h neglects to include it even though it needs ram_addr_t. Fix that. Drop a few superfluous inclusions elsewhere.

---
 accel/stubs/tcg-stub.c          | 1 -
 balloon.c                       | 1 -
 hw/smbios/smbios.c              | 1 -
 include/hw/hw.h                 | 1 -
 include/hw/ppc/ppc4xx.h         | 1 -
 include/migration/misc.h        | 1 -
 include/sysemu/kvm_int.h        | 1 -
 include/sysemu/memory_mapping.h | 1 -
 migration/migration.h           | 1 -
 migration/qemu-file-channel.c   | 1 -
 migration/qemu-file.h           | 1 +
 migration/vmstate-types.c       | 1 -
 qom/cpu.c                       | 1 -
 tcg/optimize.c                  | 1 -
 tcg/tcg-common.c                | 1 -
 tcg/tcg.c                       | 1 -
 16 files changed, 1 insertion(+), 15 deletions(-)
accel/stubs/tcg-stub.c +0 -1
index 76ae461749..e2d23edafe 100644
@@ -14,7 +14,6 @@
 #include "qemu-common.h"
 #include "cpu.h"
 #include "tcg/tcg.h"
-#include "exec/cpu-common.h"
 #include "exec/exec-all.h"
 
 void tb_flush(CPUState *cpu)
balloon.c +0 -1
index 914b3662db..f104b42961 100644
@@ -26,7 +26,6 @@
 
 #include "qemu/osdep.h"
 #include "qemu/atomic.h"
-#include "exec/cpu-common.h"
 #include "sysemu/kvm.h"
 #include "sysemu/balloon.h"
 #include "trace-root.h"
hw/smbios/smbios.c +0 -1
index 7bcd67b098..11d476c4a2 100644
@@ -28,7 +28,6 @@
 #include "hw/firmware/smbios.h"
 #include "hw/loader.h"
 #include "hw/boards.h"
-#include "exec/cpu-common.h"
 #include "smbios_build.h"
 
 /* legacy structures and constants for <= 2.0 machines */
include/hw/hw.h +0 -1
index 38d2fb1f40..86ff26b712 100644
@@ -6,7 +6,6 @@
 #error Cannot include hw/hw.h from user emulation
 #endif
 
-#include "exec/cpu-common.h"
 #include "qom/object.h"
 #include "exec/memory.h"
 #include "migration/vmstate.h"
include/hw/ppc/ppc4xx.h +0 -1
index 90f8866138..7d82259051 100644
@@ -26,7 +26,6 @@
 #define PPC4XX_H
 
 #include "hw/ppc/ppc.h"
-#include "exec/cpu-common.h"
 #include "exec/memory.h"
 
 /* PowerPC 4xx core initialization */
include/migration/misc.h +0 -1
index 5cdbabd094..b9d8e787af 100644
@@ -14,7 +14,6 @@
 #ifndef MIGRATION_MISC_H
 #define MIGRATION_MISC_H
 
-#include "exec/cpu-common.h"
 #include "qemu/notify.h"
 #include "qapi/qapi-types-net.h"
 
include/sysemu/kvm_int.h +0 -1
index 787dbc7770..5d341cc29b 100644
@@ -9,7 +9,6 @@
 #ifndef QEMU_KVM_INT_H
 #define QEMU_KVM_INT_H
 
-#include "exec/cpu-common.h"
 #include "exec/memory.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/accel.h"
include/sysemu/memory_mapping.h +0 -1
index 1b440df486..4b20f1a639 100644
@@ -15,7 +15,6 @@
 #define MEMORY_MAPPING_H
 
 #include "qemu/queue.h"
-#include "exec/cpu-common.h"
 #include "exec/cpu-defs.h"
 #include "exec/memory.h"
 
migration/migration.h +0 -1
index 1fdd7b21fd..26f01d00f6 100644
@@ -16,7 +16,6 @@
 
 #include "qapi/qapi-types-migration.h"
 #include "qemu/thread.h"
-#include "exec/cpu-common.h"
 #include "qemu/coroutine_int.h"
 #include "hw/qdev.h"
 #include "io/channel.h"
migration/qemu-file-channel.c +0 -1
index 8e639eb496..78ef248820 100644
@@ -24,7 +24,6 @@
 
 #include "qemu/osdep.h"
 #include "qemu-file-channel.h"
-#include "exec/cpu-common.h"
 #include "qemu-file.h"
 #include "io/channel-socket.h"
 #include "qemu/iov.h"
migration/qemu-file.h +1 -0
index 13baf896bd..21f3ae4be2 100644
@@ -26,6 +26,7 @@
 #define MIGRATION_QEMU_FILE_H
 
 #include <zlib.h>
+#include "exec/cpu-common.h"
 
 /* Read a chunk of data from a file at the given position.  The pos argument
  * can be ignored if the file is only be used for streaming.  The number of
migration/vmstate-types.c +0 -1
index 845f4649ee..bee658a1b2 100644
@@ -11,7 +11,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "exec/cpu-common.h"
 #include "qemu-file.h"
 #include "migration.h"
 #include "migration/vmstate.h"
qom/cpu.c +0 -1
index f376f782d8..fdc1af8f40 100644
@@ -25,7 +25,6 @@
 #include "qemu/notify.h"
 #include "qemu/log.h"
 #include "exec/log.h"
-#include "exec/cpu-common.h"
 #include "qemu/error-report.h"
 #include "qemu/qemu-print.h"
 #include "sysemu/sysemu.h"
tcg/optimize.c +0 -1
index d2424de4af..cee2a36a60 100644
@@ -24,7 +24,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "exec/cpu-common.h"
 #include "tcg-op.h"
 
 #define CASE_OP_32_64(x)                        \
tcg/tcg-common.c +0 -1
index 907d58d0f0..97305a3efc 100644
@@ -23,7 +23,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "exec/cpu-common.h"
 #include "tcg/tcg.h"
 
 #if defined(CONFIG_TCG_INTERPRETER)
tcg/tcg.c +0 -1
index be2c33c400..2db83ce2e8 100644
@@ -42,7 +42,6 @@
 #define NO_CPU_IO_DEFS
 #include "cpu.h"
 
-#include "exec/cpu-common.h"
 #include "exec/exec-all.h"
 
 #if !defined(CONFIG_USER_ONLY)
Signature · 1 line
2.21.0
Reviewed-by Tested-by on v2 13/29
#41 lore raw

Re: [Qemu-devel] [PATCH v2 13/29] Clean up inclusion of exec/cpu-common.h

Quoted 209 lines · Markus Armbruster

migration/qemu-file.h neglects to include it even though it needs ram_addr_t. Fix that. Drop a few superfluous inclusions elsewhere.

---
 accel/stubs/tcg-stub.c          | 1 -
 balloon.c                       | 1 -
 hw/smbios/smbios.c              | 1 -
 include/hw/hw.h                 | 1 -
 include/hw/ppc/ppc4xx.h         | 1 -
 include/migration/misc.h        | 1 -
 include/sysemu/kvm_int.h        | 1 -
 include/sysemu/memory_mapping.h | 1 -
 migration/migration.h           | 1 -
 migration/qemu-file-channel.c   | 1 -
 migration/qemu-file.h           | 1 +
 migration/vmstate-types.c       | 1 -
 qom/cpu.c                       | 1 -
 tcg/optimize.c                  | 1 -
 tcg/tcg-common.c                | 1 -
 tcg/tcg.c                       | 1 -
 16 files changed, 1 insertion(+), 15 deletions(-)
accel/stubs/tcg-stub.c +0 -1
index 76ae461749..e2d23edafe 100644
@@ -14,7 +14,6 @@
 #include "qemu-common.h"
 #include "cpu.h"
 #include "tcg/tcg.h"
-#include "exec/cpu-common.h"
 #include "exec/exec-all.h"
 
 void tb_flush(CPUState *cpu)
balloon.c +0 -1
index 914b3662db..f104b42961 100644
@@ -26,7 +26,6 @@
 
 #include "qemu/osdep.h"
 #include "qemu/atomic.h"
-#include "exec/cpu-common.h"
 #include "sysemu/kvm.h"
 #include "sysemu/balloon.h"
 #include "trace-root.h"
hw/smbios/smbios.c +0 -1
index 7bcd67b098..11d476c4a2 100644
@@ -28,7 +28,6 @@
 #include "hw/firmware/smbios.h"
 #include "hw/loader.h"
 #include "hw/boards.h"
-#include "exec/cpu-common.h"
 #include "smbios_build.h"
 
 /* legacy structures and constants for <= 2.0 machines */
include/hw/hw.h +0 -1
index 38d2fb1f40..86ff26b712 100644
@@ -6,7 +6,6 @@
 #error Cannot include hw/hw.h from user emulation
 #endif
 
-#include "exec/cpu-common.h"
 #include "qom/object.h"
 #include "exec/memory.h"
 #include "migration/vmstate.h"
include/hw/ppc/ppc4xx.h +0 -1
index 90f8866138..7d82259051 100644
@@ -26,7 +26,6 @@
 #define PPC4XX_H
 
 #include "hw/ppc/ppc.h"
-#include "exec/cpu-common.h"
 #include "exec/memory.h"
 
 /* PowerPC 4xx core initialization */
include/migration/misc.h +0 -1
index 5cdbabd094..b9d8e787af 100644
@@ -14,7 +14,6 @@
 #ifndef MIGRATION_MISC_H
 #define MIGRATION_MISC_H
 
-#include "exec/cpu-common.h"
 #include "qemu/notify.h"
 #include "qapi/qapi-types-net.h"
 
include/sysemu/kvm_int.h +0 -1
index 787dbc7770..5d341cc29b 100644
@@ -9,7 +9,6 @@
 #ifndef QEMU_KVM_INT_H
 #define QEMU_KVM_INT_H
 
-#include "exec/cpu-common.h"
 #include "exec/memory.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/accel.h"
include/sysemu/memory_mapping.h +0 -1
index 1b440df486..4b20f1a639 100644
@@ -15,7 +15,6 @@
 #define MEMORY_MAPPING_H
 
 #include "qemu/queue.h"
-#include "exec/cpu-common.h"
 #include "exec/cpu-defs.h"
 #include "exec/memory.h"
 
migration/migration.h +0 -1
index 1fdd7b21fd..26f01d00f6 100644
@@ -16,7 +16,6 @@
 
 #include "qapi/qapi-types-migration.h"
 #include "qemu/thread.h"
-#include "exec/cpu-common.h"
 #include "qemu/coroutine_int.h"
 #include "hw/qdev.h"
 #include "io/channel.h"
migration/qemu-file-channel.c +0 -1
index 8e639eb496..78ef248820 100644
@@ -24,7 +24,6 @@
 
 #include "qemu/osdep.h"
 #include "qemu-file-channel.h"
-#include "exec/cpu-common.h"
 #include "qemu-file.h"
 #include "io/channel-socket.h"
 #include "qemu/iov.h"
migration/qemu-file.h +1 -0
index 13baf896bd..21f3ae4be2 100644
@@ -26,6 +26,7 @@
 #define MIGRATION_QEMU_FILE_H
 
 #include <zlib.h>
+#include "exec/cpu-common.h"
 
 /* Read a chunk of data from a file at the given position.  The pos argument
  * can be ignored if the file is only be used for streaming.  The number of
migration/vmstate-types.c +0 -1
index 845f4649ee..bee658a1b2 100644
@@ -11,7 +11,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "exec/cpu-common.h"
 #include "qemu-file.h"
 #include "migration.h"
 #include "migration/vmstate.h"
qom/cpu.c +0 -1
index f376f782d8..fdc1af8f40 100644
@@ -25,7 +25,6 @@
 #include "qemu/notify.h"
 #include "qemu/log.h"
 #include "exec/log.h"
-#include "exec/cpu-common.h"
 #include "qemu/error-report.h"
 #include "qemu/qemu-print.h"
 #include "sysemu/sysemu.h"
tcg/optimize.c +0 -1
index d2424de4af..cee2a36a60 100644
@@ -24,7 +24,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "exec/cpu-common.h"
 #include "tcg-op.h"
 
 #define CASE_OP_32_64(x)                        \
tcg/tcg-common.c +0 -1
index 907d58d0f0..97305a3efc 100644
@@ -23,7 +23,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "exec/cpu-common.h"
 #include "tcg/tcg.h"
 
 #if defined(CONFIG_TCG_INTERPRETER)
tcg/tcg.c +0 -0
index be2c33c400..2db83ce2e8 100644

tcg/tcg.c line 47

Quoted 7 lines
tcg/tcg.c +0 -1
@@ -42,7 +42,6 @@
 #define NO_CPU_IO_DEFS
 #include "cpu.h"
 
-#include "exec/cpu-common.h"
 #include "exec/exec-all.h"
 
 #if !defined(CONFIG_USER_ONLY)