Skip to contentSkip to conversation

NEED_CPU_H cleanups

GIT PULL Paolo Bonzini 2 participants 55 messages May 19, 2016

Subsystems (9)
lore
Share & tools
lore
#0 lore raw

The following changes since commit 8ec4fe0a4bed4fa27e6f28a746bcf77b27cd05a3:

Merge remote-tracking branch 'remotes/mjt/tags/pull-trivial-patches-2016-05-18' into staging (2016-05-19 09:27:28 +0100)

are available in the git repository at:

git://github.com/bonzini/qemu.git tags/for-upstream

for you to fetch changes up to 9a4292cfb84fc62435800086e5cecc7b0a4f7005:

hw: clean up hw/hw.h includes (2016-05-19 13:08:08 +0200)

----------------------------------------------------------------
NEED_CPU_H cleanups, big enough to deserve their own pull request.

----------------------------------------------------------------
Paolo Bonzini (52):
scripts: add script to build QEMU and analyze inclusions
s390x: move .needed functions for subsections to machine.c
include: move CPU-related definitions out of qemu-common.h
log: do not use CONFIG_USER_ONLY
cpu: make cpu-qom.h only include-able from cpu.h
target-alpha: make cpu-qom.h not target specific
target-arm: make cpu-qom.h not target specific
target-cris: make cpu-qom.h not target specific
target-i386: make cpu-qom.h not target specific
target-lm32: make cpu-qom.h not target specific
target-m68k: make cpu-qom.h not target specific
target-microblaze: make cpu-qom.h not target specific
target-mips: make cpu-qom.h not target specific
target-ppc: do not use target_ulong in cpu-qom.h
target-ppc: do not make PowerPCCPUClass depend on target-specific symbols
target-ppc: make cpu-qom.h not target specific
target-s390x: make cpu-qom.h not target specific
target-sh4: make cpu-qom.h not target specific
target-sparc: make cpu-qom.h not target specific
target-tricore: make cpu-qom.h not target specific
target-unicore32: make cpu-qom.h not target specific
target-xtensa: make cpu-qom.h not target specific
arm: include cpu-qom.h in files that require ARMCPU
m68k: include cpu-qom.h in files that require M68KCPU
sh4: include cpu-qom.h in files that require SuperHCPU
alpha: include cpu-qom.h in files that require AlphaCPU
mips: use MIPSCPU instead of CPUMIPSState
ppc: use PowerPCCPU instead of CPUPPCState
arm: remove useless cpu.h inclusion
explicitly include qom/cpu.h
explicitly include hw/qdev-core.h
explicitly include linux/kvm.h
apic: move target-dependent definitions to cpu.h
include: poison symbols in osdep.h
hw: do not use VMSTATE_*TL
hw: move CPU state serialization to migration/cpu.h
hw: cannot include hw/hw.h from user emulation
cpu: move endian-dependent load/store functions to cpu-all.h
qemu-common: stop including qemu/bswap.h from qemu-common.h
qemu-common: stop including qemu/host-utils.h from qemu-common.h
gdbstub: remove unnecessary includes from gdbstub-xml.c
dma: do not depend on kvm_enabled()
s390x: reorganize CSS bits between cpu.h and other headers
acpi: do not use TARGET_PAGE_SIZE
qemu-common: push cpu.h inclusion out of qemu-common.h
arm: move arm_log_exception into .c file
mips: move CP0 functions out of cpu.h
hw: explicitly include qemu/log.h
exec: extract exec/tb-context.h
cpu: move exec-all.h inclusion out of cpu.h
hw: remove pio_addr_t
hw: clean up hw/hw.h includes

 arch_init.c                                 |   2 +
 audio/mixeng.c                              |   1 +
 audio/noaudio.c                             |   1 +
 audio/spiceaudio.c                          |   1 +
 audio/wavaudio.c                            |   2 +-
 block/bochs.c                               |   1 +
 block/cloop.c                               |   1 +
 block/parallels.c                           |   1 +
 block/qcow.c                                |   1 +
 block/qcow2-cluster.c                       |   1 +
 block/qcow2-refcount.c                      |   1 +
 block/qcow2-snapshot.c                      |   1 +
 block/qcow2.c                               |   1 +
 block/qed-table.c                           |   1 +
 block/qed.c                                 |   1 +
 block/vdi.c                                 |   1 +
 block/vhdx-endian.c                         |   1 +
 block/vhdx-log.c                            |   1 +
 block/vhdx.c                                |   1 +
 block/vmdk.c                                |   1 +
 block/vpc.c                                 |   1 +
 block/vvfat.c                               |   1 +
 bootdevice.c                                |   1 +
 bsd-user/main.c                             |   2 +
 bsd-user/qemu.h                             |   1 +
 contrib/ivshmem-server/ivshmem-server.c     |   1 +
 cpu-exec-common.c                           |   1 +
 cpu-exec.c                                  |   1 +
 cpus.c                                      |   4 +-
 cputlb.c                                    |   1 +
 crypto/afsplit.c                            |   1 +
 crypto/block-luks.c                         |   1 +
 device_tree.c                               |   1 +
 disas/tci.c                                 |   1 +
 exec.c                                      |  25 ++--
 gdbstub.c                                   |   3 +-
 hw/acpi/core.c                              |   6 +
 hw/acpi/nvdimm.c                            |  22 ++--
 hw/acpi/piix4.c                             |   1 +
 hw/alpha/alpha_sys.h                        |   1 +
 hw/alpha/pci.c                              |   1 -
 hw/arm/ast2400.c                            |   1 +
 hw/arm/collie.c                             |   1 +
 hw/arm/nseries.c                            |   3 +
 hw/arm/palmetto-bmc.c                       |   1 +
 hw/arm/pxa2xx_gpio.c                        |   2 +
 hw/arm/stellaris.c                          |   1 +
 hw/arm/stm32f205_soc.c                      |   1 -
 hw/arm/strongarm.c                          |   1 +
 hw/arm/strongarm.h                          |   1 +
 hw/arm/xlnx-ep108.c                         |   1 +
 hw/audio/pl041.c                            |   1 +
 hw/block/hd-geometry.c                      |   1 +
 hw/block/m25p80.c                           |   1 +
 hw/block/pflash_cfi01.c                     |   1 +
 hw/bt/hci-csr.c                             |   1 +
 hw/bt/l2cap.c                               |   1 +
 hw/bt/sdp.c                                 |   1 +
 hw/char/bcm2835_aux.c                       |   1 +
 hw/char/cadence_uart.c                      |   4 +
 hw/char/digic-uart.c                        |   1 +
 hw/char/imx_serial.c                        |   1 +
 hw/char/pl011.c                             |   1 +
 hw/char/stm32f2xx_usart.c                   |   1 +
 hw/core/Makefile.objs                       |   2 +-
 hw/core/nmi.c                               |   5 +
 hw/core/sysbus.c                            |   4 +-
 hw/cpu/a9mpcore.c                           |   1 +
 hw/display/bcm2835_fb.c                     |   1 +
 hw/display/cg3.c                            |   2 +
 hw/display/pl110.c                          |   1 +
 hw/display/tc6393xb.c                       |   1 +
 hw/display/virtio-gpu.c                     |   1 +
 hw/dma/bcm2835_dma.c                        |   1 +
 hw/dma/pl080.c                              |   1 +
 hw/dma/pl330.c                              |   1 +
 hw/dma/rc4030.c                             |   1 +
 hw/gpio/gpio_key.c                          |   1 +
 hw/gpio/imx_gpio.c                          |   1 +
 hw/gpio/pl061.c                             |   1 +
 hw/i2c/imx_i2c.c                            |   1 +
 hw/i2c/versatile_i2c.c                      |   1 +
 hw/i386/kvm/apic.c                          |   2 +
 hw/i386/kvm/clock.c                         |   1 +
 hw/i386/kvm/i8254.c                         |   1 +
 hw/i386/kvm/pci-assign.c                    |   1 +
 hw/i386/kvmvapic.c                          |   3 +
 hw/input/pl050.c                            |   1 +
 hw/intc/allwinner-a10-pic.c                 |   1 +
 hw/intc/apic.c                              |   2 +
 hw/intc/apic_common.c                       |   2 +
 hw/intc/arm_gic.c                           |   1 +
 hw/intc/arm_gic_kvm.c                       |   2 +
 hw/intc/arm_gicv2m.c                        |   2 +
 hw/intc/armv7m_nvic.c                       |   2 +
 hw/intc/bcm2835_ic.c                        |   1 +
 hw/intc/bcm2836_control.c                   |   1 +
 hw/intc/i8259.c                             |   1 +
 hw/intc/imx_avic.c                          |   1 +
 hw/intc/ioapic.c                            |   1 +
 hw/intc/openpic.c                           |   1 +
 hw/intc/openpic_kvm.c                       |   2 +
 hw/intc/pl190.c                             |   1 +
 hw/intc/s390_flic_kvm.c                     |   2 +
 hw/intc/xics_kvm.c                          |   1 +
 hw/isa/lpc_ich9.c                           |   1 +
 hw/mips/cps.c                               |   7 +-
 hw/mips/cputimer.c                          |   4 +-
 hw/mips/mips_fulong2e.c                     |   4 +-
 hw/mips/mips_int.c                          |   3 +-
 hw/mips/mips_jazz.c                         |   4 +-
 hw/mips/mips_malta.c                        |   5 +-
 hw/mips/mips_mipssim.c                      |   4 +-
 hw/mips/mips_r4k.c                          |   4 +-
 hw/misc/arm11scu.c                          |   1 +
 hw/misc/arm_integrator_debug.c              |   1 +
 hw/misc/arm_l2x0.c                          |   1 +
 hw/misc/arm_sysctl.c                        |   1 +
 hw/misc/bcm2835_mbox.c                      |   1 +
 hw/misc/bcm2835_property.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                          |   1 +
 hw/misc/imx_ccm.c                           |   1 +
 hw/misc/macio/cuda.c                        |   1 +
 hw/misc/macio/mac_dbdma.c                   |   1 +
 hw/misc/mips_cmgcr.c                        |   1 +
 hw/misc/mips_cpc.c                          |   2 +
 hw/misc/mips_itu.c                          |   3 +
 hw/misc/pci-testdev.c                       |   1 +
 hw/misc/stm32f2xx_syscfg.c                  |   1 +
 hw/misc/zynq-xadc.c                         |   1 +
 hw/misc/zynq_slcr.c                         |   1 +
 hw/net/allwinner_emac.c                     |   1 +
 hw/net/fsl_etsec/etsec.c                    |   1 +
 hw/net/fsl_etsec/rings.c                    |   2 +-
 hw/net/imx_fec.c                            |   1 +
 hw/net/lan9118.c                            |   1 +
 hw/net/spapr_llan.c                         |   9 +-
 hw/pci-host/apb.c                           |   1 +
 hw/pci-host/versatile.c                     |   1 +
 hw/ppc/e500plat.c                           |   1 +
 hw/ppc/ppc.c                                |  20 +--
 hw/ppc/ppc4xx_devs.c                        |   1 +
 hw/ppc/prep.c                               |   1 +
 hw/ppc/spapr.c                              |   1 +
 hw/ppc/spapr_hcall.c                        |   3 +
 hw/ppc/spapr_iommu.c                        |   1 +
 hw/ppc/spapr_pci.c                          |   1 +
 hw/ppc/spapr_rtas.c                         |   2 +
 hw/ppc/spapr_vio.c                          |   3 +-
 hw/ppc/virtex_ml507.c                       |   1 +
 hw/s390x/css.c                              |   4 +-
 hw/s390x/s390-skeys.c                       |   1 +
 hw/s390x/s390-virtio-ccw.c                  |   4 +-
 hw/s390x/virtio-ccw.c                       |   5 +-
 hw/s390x/virtio-ccw.h                       |   3 +-
 hw/sd/pl181.c                               |   1 +
 hw/sd/sd.c                                  |   1 +
 hw/sd/sdhci.c                               |   1 +
 hw/sh4/sh7750.c                             |   1 +
 hw/ssi/imx_spi.c                            |   1 +
 hw/ssi/pl022.c                              |   1 +
 hw/timer/allwinner-a10-pit.c                |   1 +
 hw/timer/arm_timer.c                        |   1 +
 hw/timer/digic-timer.c                      |   1 +
 hw/timer/imx_epit.c                         |   1 +
 hw/timer/imx_gpt.c                          |   1 +
 hw/timer/pl031.c                            |   1 +
 hw/timer/stm32f2xx_timer.c                  |   1 +
 hw/vfio/common.c                            |   3 +
 hw/watchdog/wdt_diag288.c                   |   1 +
 hw/xtensa/pic_cpu.c                         |   1 +
 include/disas/disas.h                       |   2 +
 include/exec/cpu-all.h                      |  25 ++++
 include/exec/cpu-common.h                   |  14 ---
 include/exec/cpu-defs.h                     |   1 +
 include/exec/exec-all.h                     |  54 +-------
 include/exec/gdbstub.h                      |   2 +
 include/exec/helper-head.h                  |  23 ++--
 include/exec/hwaddr.h                       |   2 +
 include/exec/ioport.h                       |  19 +--
 include/exec/memory.h                       |  17 ---
 include/exec/poison.h                       |   8 --
 include/exec/tb-context.h                   |  46 +++++++
 include/hw/acpi/acpi.h                      |   7 --
 include/hw/arm/arm.h                        |   2 +-
 include/hw/arm/digic.h                      |   1 -
 include/hw/arm/exynos4210.h                 |   1 +
 include/hw/arm/fsl-imx6.h                   |   1 +
 include/hw/arm/omap.h                       |   1 +
 include/hw/arm/pxa.h                        |   1 +
 include/hw/arm/virt-acpi-build.h            |   1 +
 include/hw/arm/virt.h                       |   1 +
 include/hw/hw.h                             |  60 +--------
 include/hw/i386/apic.h                      |   5 -
 include/hw/isa/isa.h                        |   2 +-
 include/hw/m68k/mcf.h                       |   2 +
 include/hw/mips/cpudevs.h                   |   7 +-
 include/hw/ppc/openpic.h                    |   3 +-
 include/hw/ppc/ppc.h                        |  24 ++--
 include/hw/ppc/spapr_vio.h                  |   2 +-
 {hw => include/hw}/s390x/css.h              |  34 ++++-
 {target-s390x => include/hw/s390x}/ioinst.h |  16 +--
 include/hw/sd/sd.h                          |   2 +
 include/hw/sh4/sh.h                         |   1 +
 include/hw/sysbus.h                         |   4 +-
 include/hw/xen/xen.h                        |   7 +-
 include/migration/cpu.h                     |  48 +++++++
 include/qemu-common.h                       |  32 -----
 include/qemu/log.h                          |  17 +--
 include/qemu/osdep.h                        |   2 +
 include/qemu/timer.h                        |   1 +
 include/qom/cpu.h                           |  19 +++
 include/sysemu/cpus.h                       |  13 ++
 include/sysemu/dma.h                        |   5 +-
 include/sysemu/kvm.h                        |   1 +
 io/channel-websock.c                        |   1 +
 ioport.c                                    |  14 ++-
 kvm-stub.c                                  |   1 -
 linux-user/main.c                           |   2 +
 linux-user/qemu.h                           |   1 +
 memory.c                                    |   2 +
 migration/ram.c                             |   2 +
 migration/savevm.c                          |   1 +
 monitor.c                                   |   4 +
 nbd/nbd-internal.h                          |   1 +
 page_cache.c                                |   1 +
 qemu-nbd.c                                  |   1 +
 qtest.c                                     |   2 +
 scripts/analyze-inclusions                  | 102 +++++++++++++++
 scripts/create_config                       |   2 +-
 scripts/feature_to_c.sh                     |   2 -
 scripts/tracetool/format/tcg_helper_c.py    |   1 +
 slirp/slirp.h                               |   1 +
 stubs/cpu-get-icount.c                      |   1 +
 stubs/slirp.c                               |   1 +
 target-alpha/cpu-qom.h                      |  41 +-----
 target-alpha/cpu.c                          |   1 +
 target-alpha/cpu.h                          |  44 ++++++-
 target-alpha/fpu_helper.c                   |   1 +
 target-alpha/gdbstub.c                      |   1 +
 target-alpha/helper.c                       |   1 +
 target-alpha/int_helper.c                   |   1 +
 target-alpha/machine.c                      |   3 +
 target-alpha/mem_helper.c                   |   1 +
 target-alpha/sys_helper.c                   |   1 +
 target-alpha/translate.c                    |   1 +
 target-alpha/vax_helper.c                   |   1 +
 target-arm/arm-powerctl.c                   |   2 +
 target-arm/arm_ldst.h                       |   1 +
 target-arm/cpu-qom.h                        | 178 +-------------------------
 target-arm/cpu.c                            |   1 +
 target-arm/cpu.h                            | 181 +++++++++++++++++++++++++-
 target-arm/gdbstub.c                        |   1 +
 target-arm/gdbstub64.c                      |   1 +
 target-arm/helper-a64.c                     |   1 +
 target-arm/helper.c                         |  16 +++
 target-arm/internals.h                      |  15 ---
 target-arm/kvm-stub.c                       |   1 +
 target-arm/kvm.c                            |   1 +
 target-arm/kvm32.c                          |   3 +-
 target-arm/kvm64.c                          |   2 +-
 target-arm/machine.c                        |   3 +
 target-arm/op_helper.c                      |   1 +
 target-arm/psci.c                           |   2 +-
 target-arm/translate-a64.c                  |   1 +
 target-arm/translate.c                      |   1 +
 target-cris/cpu-qom.h                       |  40 +-----
 target-cris/cpu.c                           |   1 +
 target-cris/cpu.h                           |  43 ++++++-
 target-cris/gdbstub.c                       |   1 +
 target-cris/helper.c                        |   1 +
 target-cris/machine.c                       |   3 +
 target-cris/mmu.c                           |   1 +
 target-cris/op_helper.c                     |   1 +
 target-cris/translate.c                     |   1 +
 target-i386/bpt_helper.c                    |   1 +
 target-i386/cpu-qom.h                       |  98 +--------------
 target-i386/cpu.c                           |   3 +-
 target-i386/cpu.h                           | 107 +++++++++++++++-
 target-i386/excp_helper.c                   |   1 +
 target-i386/fpu_helper.c                    |   1 +
 target-i386/gdbstub.c                       |   1 +
 target-i386/helper.c                        |   1 +
 target-i386/int_helper.c                    |   1 +
 target-i386/kvm-stub.c                      |   1 +
 target-i386/kvm.c                           |   2 +-
 target-i386/machine.c                       |   6 +
 target-i386/mem_helper.c                    |   1 +
 target-i386/misc_helper.c                   |   1 +
 target-i386/mpx_helper.c                    |   1 +
 target-i386/seg_helper.c                    |   1 +
 target-i386/svm_helper.c                    |   1 +
 target-i386/translate.c                     |   1 +
 target-lm32/cpu-qom.h                       |  42 +------
 target-lm32/cpu.c                           |   1 +
 target-lm32/cpu.h                           |  46 ++++++-
 target-lm32/gdbstub.c                       |   1 +
 target-lm32/helper.c                        |   1 +
 target-lm32/machine.c                       |   3 +
 target-lm32/op_helper.c                     |   1 +
 target-lm32/translate.c                     |   1 +
 target-m68k/cpu-qom.h                       |  34 +----
 target-m68k/cpu.c                           |   1 +
 target-m68k/cpu.h                           |  38 +++++-
 target-m68k/gdbstub.c                       |   1 +
 target-m68k/helper.c                        |   1 +
 target-m68k/m68k-semi.c                     |   1 +
 target-m68k/op_helper.c                     |   1 +
 target-m68k/translate.c                     |   1 +
 target-microblaze/cpu-qom.h                 |  44 +------
 target-microblaze/cpu.c                     |   1 +
 target-microblaze/cpu.h                     |  47 ++++++-
 target-microblaze/gdbstub.c                 |   1 +
 target-microblaze/helper.c                  |   1 +
 target-microblaze/mmu.c                     |   1 +
 target-microblaze/op_helper.c               |   1 +
 target-microblaze/translate.c               |   1 +
 target-mips/cpu-qom.h                       |  37 +-----
 target-mips/cpu.c                           |   1 +
 target-mips/cpu.h                           | 171 +++++++------------------
 target-mips/gdbstub.c                       |   1 +
 target-mips/helper.c                        | 126 +++++++++++++++++++
 target-mips/kvm.c                           |   2 +-
 target-mips/machine.c                       |   4 +-
 target-mips/mips-semi.c                     |   1 +
 target-mips/msa_helper.c                    |   1 +
 target-mips/op_helper.c                     |   1 +
 target-mips/translate.c                     |   1 +
 target-moxie/cpu.c                          |   1 +
 target-moxie/cpu.h                          |   1 -
 target-moxie/machine.c                      |   3 +
 target-openrisc/cpu.c                       |   1 +
 target-openrisc/cpu.h                       |   2 -
 target-openrisc/exception.c                 |   1 +
 target-openrisc/gdbstub.c                   |   1 +
 target-openrisc/interrupt.c                 |   1 +
 target-openrisc/interrupt_helper.c          |   1 +
 target-openrisc/machine.c                   |   3 +
 target-openrisc/mmu.c                       |   1 +
 target-openrisc/mmu_helper.c                |   1 +
 target-openrisc/sys_helper.c                |   1 +
 target-ppc/cpu-qom.h                        | 167 +++++++++++++++---------
 target-ppc/cpu.h                            | 166 ++++++++----------------
 target-ppc/excp_helper.c                    |   1 +
 target-ppc/gdbstub.c                        |   1 +
 target-ppc/int_helper.c                     |   1 +
 target-ppc/kvm-stub.c                       |   1 +
 target-ppc/kvm.c                            |   2 +-
 target-ppc/machine.c                        |   5 +
 target-ppc/mem_helper.c                     |   2 +
 target-ppc/misc_helper.c                    |   1 +
 target-ppc/mmu-hash32.c                     |   3 +-
 target-ppc/mmu-hash32.h                     |   2 +-
 target-ppc/mmu-hash64.c                     |   3 +-
 target-ppc/mmu-hash64.h                     |   2 +-
 target-ppc/mmu_helper.c                     |   1 +
 target-ppc/timebase_helper.c                |   1 +
 target-ppc/translate.c                      |   1 +
 target-ppc/translate_init.c                 |  92 ++++++--------
 target-s390x/cc_helper.c                    |   1 +
 target-s390x/cpu-qom.h                      |  46 +------
 target-s390x/cpu.c                          |   4 +-
 target-s390x/cpu.h                          | 188 ++++++++++------------------
 target-s390x/fpu_helper.c                   |   1 +
 target-s390x/gdbstub.c                      |   2 +
 target-s390x/helper.c                       |   2 +
 target-s390x/int_helper.c                   |   1 +
 target-s390x/interrupt.c                    |  66 +++++++++-
 target-s390x/ioinst.c                       |   2 +-
 target-s390x/kvm.c                          |   2 +-
 target-s390x/machine.c                      |  20 +++
 target-s390x/mem_helper.c                   |   4 +
 target-s390x/misc_helper.c                  |   3 +-
 target-s390x/translate.c                    |   1 +
 target-sh4/cpu-qom.h                        |  31 +----
 target-sh4/cpu.c                            |   1 +
 target-sh4/cpu.h                            |  34 ++++-
 target-sh4/gdbstub.c                        |   1 +
 target-sh4/helper.c                         |   1 +
 target-sh4/op_helper.c                      |   1 +
 target-sh4/translate.c                      |   1 +
 target-sparc/cpu-qom.h                      |  38 +-----
 target-sparc/cpu.c                          |   1 +
 target-sparc/cpu.h                          |  40 +++++-
 target-sparc/gdbstub.c                      |   1 +
 target-sparc/helper.c                       |   1 +
 target-sparc/ldst_helper.c                  |   1 +
 target-sparc/machine.c                      |   6 +
 target-sparc/mmu_helper.c                   |   1 +
 target-sparc/translate.c                    |   1 +
 target-tilegx/cpu.c                         |   1 +
 target-tilegx/cpu.h                         |   2 -
 target-tilegx/helper.c                      |   1 +
 target-tilegx/translate.c                   |   1 +
 target-tricore/cpu-qom.h                    |  28 +----
 target-tricore/cpu.c                        |   1 +
 target-tricore/cpu.h                        |  32 ++++-
 target-tricore/helper.c                     |   1 +
 target-tricore/op_helper.c                  |   1 +
 target-tricore/translate.c                  |   1 +
 target-unicore32/cpu-qom.h                  |  30 +----
 target-unicore32/cpu.c                      |   1 +
 target-unicore32/cpu.h                      |  32 ++++-
 target-unicore32/helper.c                   |   1 +
 target-unicore32/op_helper.c                |   1 +
 target-unicore32/softmmu.c                  |   1 +
 target-unicore32/translate.c                |   1 +
 target-xtensa/cpu-qom.h                     |  39 +-----
 target-xtensa/cpu.c                         |   1 +
 target-xtensa/cpu.h                         |  38 +++++-
 target-xtensa/gdbstub.c                     |   2 +
 target-xtensa/op_helper.c                   |   1 +
 target-xtensa/translate.c                   |   1 +
 tcg/optimize.c                              |   3 +-
 tcg/tcg-common.c                            |   2 +
 tcg/tcg-op.c                                |   3 +
 tcg/tcg.c                                   |   5 +
 tcg/tcg.h                                   |  23 ++++
 tests/ide-test.c                            |   1 +
 tests/libqos/malloc.c                       |   1 +
 translate-all.c                             |   1 +
 translate-common.c                          |   1 +
 ui/vnc-ws.c                                 |   1 +
 user-exec.c                                 |   1 +
 util/buffer.c                               |   1 +
 util/log.c                                  |  12 +-
 vl.c                                        |   2 +
 xen-hvm.c                                   |   9 +-
 431 files changed, 2100 insertions(+), 1617 deletions(-)
 create mode 100644 include/exec/tb-context.h
 rename {hw => include/hw}/s390x/css.h (76%)
 rename {target-s390x => include/hw/s390x}/ioinst.h (87%)
 create mode 100644 include/migration/cpu.h
 create mode 100644 scripts/analyze-inclusions
Signature · 1 line
1.8.3.1
#1 lore raw

[Qemu-devel] [PULL 04/52] log: do not use CONFIG_USER_ONLY

This decouples logging further from config-target.h

---
 bsd-user/main.c    |  1 +
 include/qemu/log.h | 17 ++---------------
 linux-user/main.c  |  1 +
 util/log.c         | 12 ++++++++++--
 4 files changed, 14 insertions(+), 17 deletions(-)
bsd-user/main.c +1 -0
index 27854c1..058eaca 100644
@@ -849,6 +849,7 @@ int main(int argc, char **argv)
     }
 
     /* init debug */
+    qemu_log_needs_buffers();
     qemu_set_log_filename(log_file);
     if (log_mask) {
         int mask;
include/qemu/log.h +2 -15
index c52f136..234fa81 100644
@@ -104,21 +104,8 @@ typedef struct QEMULogItem {
 
 extern const QEMULogItem qemu_log_items[];
 
-/* This is the function that actually does the work of
- * changing the log level; it should only be accessed via
- * the qemu_set_log() wrapper.
- */
-void do_qemu_set_log(int log_flags, bool use_own_buffers);
-
-static inline void qemu_set_log(int log_flags)
-{
-#ifdef CONFIG_USER_ONLY
-    do_qemu_set_log(log_flags, true);
-#else
-    do_qemu_set_log(log_flags, false);
-#endif
-}
-
+void qemu_set_log(int log_flags);
+void qemu_log_needs_buffers(void);
 void qemu_set_log_filename(const char *filename);
 void qemu_set_dfilter_ranges(const char *ranges);
 bool qemu_log_in_addr_range(uint64_t addr);
linux-user/main.c +1 -0
index 5f3ec97..2b7fa9c 100644
@@ -3760,6 +3760,7 @@ static void handle_arg_log(const char *arg)
         qemu_print_log_usage(stdout);
         exit(EXIT_FAILURE);
     }
+    qemu_log_needs_buffers();
     qemu_set_log(mask);
 }
 
util/log.c +10 -2
index 1857730..5ad72c1 100644
@@ -42,8 +42,10 @@ void qemu_log(const char *fmt, ...)
     va_end(ap);
 }
 
+static bool log_uses_own_buffers;
+
 /* enable or disable low levels log */
-void do_qemu_set_log(int log_flags, bool use_own_buffers)
+void qemu_set_log(int log_flags)
 {
     qemu_loglevel = log_flags;
 #ifdef CONFIG_TRACE_LOG
@@ -70,7 +72,7 @@ void do_qemu_set_log(int log_flags, bool use_own_buffers)
             qemu_logfile = stderr;
         }
         /* must avoid mmap() usage of glibc by setting a buffer "by hand" */
-        if (use_own_buffers) {
+        if (log_uses_own_buffers) {
             static char logfile_buf[4096];
 
             setvbuf(qemu_logfile, logfile_buf, _IOLBF, sizeof(logfile_buf));
@@ -89,6 +91,12 @@ void do_qemu_set_log(int log_flags, bool use_own_buffers)
         qemu_log_close();
     }
 }
+
+void qemu_log_needs_buffers(void)
+{
+    log_uses_own_buffers = true;
+}
+
 /*
  * Allow the user to include %d in their logfile which will be
  * substituted with the current PID. This is useful for debugging many
Signature · 1 line
1.8.3.1
#2 lore raw

[Qemu-devel] [PULL 05/52] cpu: make cpu-qom.h only include-able from cpu.h

In reply to Paolo Bonzini

Make cpu-qom.h so that it is only included from cpu.h. Then there is no need for it to include cpu.h again.

Later we will make cpu-qom.h target independent and we will _want_ to include it from elsewhere, but for now reduce the number of cases to handle.

---
 target-alpha/cpu-qom.h     | 1 -
 target-arm/psci.c          | 1 -
 target-i386/cpu-qom.h      | 1 -
 target-lm32/cpu-qom.h      | 1 -
 target-ppc/cpu-qom.h       | 1 -
 target-s390x/cpu-qom.h     | 1 -
 target-sparc/cpu-qom.h     | 1 -
 target-unicore32/cpu-qom.h | 1 -
 target-xtensa/cpu-qom.h    | 1 -
 9 files changed, 9 deletions(-)
target-alpha/cpu-qom.h +0 -1
index b01c6c8..cf5264a 100644
@@ -21,7 +21,6 @@
 #define QEMU_ALPHA_CPU_QOM_H
 
 #include "qom/cpu.h"
-#include "cpu.h"
 
 #define TYPE_ALPHA_CPU "alpha-cpu"
 
target-arm/psci.c +0 -1
index ce2e0dc..071bbb4 100644
@@ -17,7 +17,6 @@
  */
 #include "qemu/osdep.h"
 #include <cpu.h>
-#include <cpu-qom.h>
 #include <exec/helper-proto.h>
 #include <kvm-consts.h>
 #include <sysemu/sysemu.h>
target-i386/cpu-qom.h +0 -1
index cb75017..2ca7b9e 100644
@@ -21,7 +21,6 @@
 #define QEMU_I386_CPU_QOM_H
 
 #include "qom/cpu.h"
-#include "cpu.h"
 #include "qemu/notify.h"
 
 #ifdef TARGET_X86_64
target-lm32/cpu-qom.h +0 -1
index 77bc7b2..54989e4 100644
@@ -21,7 +21,6 @@
 #define QEMU_LM32_CPU_QOM_H
 
 #include "qom/cpu.h"
-#include "cpu.h"
 
 #define TYPE_LM32_CPU "lm32-cpu"
 
target-ppc/cpu-qom.h +0 -1
index 7d5e2b3..eb822a3 100644
@@ -21,7 +21,6 @@
 #define QEMU_PPC_CPU_QOM_H
 
 #include "qom/cpu.h"
-#include "cpu.h"
 
 #ifdef TARGET_PPC64
 #define TYPE_POWERPC_CPU "powerpc64-cpu"
target-s390x/cpu-qom.h +0 -1
index 1c90933..681e370 100644
@@ -21,7 +21,6 @@
 #define QEMU_S390_CPU_QOM_H
 
 #include "qom/cpu.h"
-#include "cpu.h"
 
 #define TYPE_S390_CPU "s390-cpu"
 
target-sparc/cpu-qom.h +0 -1
index 5096b10..174dfd3 100644
@@ -21,7 +21,6 @@
 #define QEMU_SPARC_CPU_QOM_H
 
 #include "qom/cpu.h"
-#include "cpu.h"
 
 #ifdef TARGET_SPARC64
 #define TYPE_SPARC_CPU "sparc64-cpu"
target-unicore32/cpu-qom.h +0 -1
index ea65b83..e554f1f 100644
@@ -12,7 +12,6 @@
 #define QEMU_UC32_CPU_QOM_H
 
 #include "qom/cpu.h"
-#include "cpu.h"
 
 #define TYPE_UNICORE32_CPU "unicore32-cpu"
 
target-xtensa/cpu-qom.h +0 -1
index 2258224..f5d9b9f 100644
@@ -30,7 +30,6 @@
 #define QEMU_XTENSA_CPU_QOM_H
 
 #include "qom/cpu.h"
-#include "cpu.h"
 
 #define TYPE_XTENSA_CPU "xtensa-cpu"
 
Signature · 1 line
1.8.3.1
#3 lore raw

[Qemu-devel] [PULL 06/52] target-alpha: make cpu-qom.h not target specific

In reply to Paolo Bonzini

Make AlphaCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers.

---
 target-alpha/cpu-qom.h | 40 +---------------------------------------
 target-alpha/cpu.h     | 42 +++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 42 insertions(+), 40 deletions(-)
target-alpha/cpu-qom.h +1 -39
index cf5264a..bae4945 100644
@@ -47,44 +47,6 @@ typedef struct AlphaCPUClass {
     void (*parent_reset)(CPUState *cpu);
 } AlphaCPUClass;
 
-/**
- * AlphaCPU:
- * @env: #CPUAlphaState
- *
- * An Alpha CPU.
- */
-typedef struct AlphaCPU {
-    /*< private >*/
-    CPUState parent_obj;
-    /*< public >*/
-
-    CPUAlphaState env;
-
-    /* This alarm doesn't exist in real hardware; we wish it did.  */
-    QEMUTimer *alarm_timer;
-} AlphaCPU;
-
-static inline AlphaCPU *alpha_env_get_cpu(CPUAlphaState *env)
-{
-    return container_of(env, AlphaCPU, env);
-}
-
-#define ENV_GET_CPU(e) CPU(alpha_env_get_cpu(e))
-
-#define ENV_OFFSET offsetof(AlphaCPU, env)
-
-#ifndef CONFIG_USER_ONLY
-extern const struct VMStateDescription vmstate_alpha_cpu;
-#endif
-
-void alpha_cpu_do_interrupt(CPUState *cpu);
-bool alpha_cpu_exec_interrupt(CPUState *cpu, int int_req);
-void alpha_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,
-                          int flags);
-hwaddr alpha_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
-int alpha_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
-int alpha_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
-void alpha_cpu_do_unaligned_access(CPUState *cpu, vaddr addr,
-                                   int is_write, int is_user, uintptr_t retaddr);
+typedef struct AlphaCPU AlphaCPU;
 
 #endif
target-alpha/cpu.h +41 -1

59 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#4 lore raw

[Qemu-devel] [PULL 08/52] target-cris: make cpu-qom.h not target specific

In reply to Paolo Bonzini

Make CRISCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers.

---
 target-cris/cpu-qom.h | 40 +---------------------------------------
 target-cris/cpu.h     | 41 ++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 41 insertions(+), 40 deletions(-)
target-cris/cpu-qom.h +1 -39
index df4c0b5..7556e9f 100644
@@ -50,44 +50,6 @@ typedef struct CRISCPUClass {
     uint32_t vr;
 } CRISCPUClass;
 
-/**
- * CRISCPU:
- * @env: #CPUCRISState
- *
- * A CRIS CPU.
- */
-typedef struct CRISCPU {
-    /*< private >*/
-    CPUState parent_obj;
-    /*< public >*/
-
-    CPUCRISState env;
-} CRISCPU;
-
-static inline CRISCPU *cris_env_get_cpu(CPUCRISState *env)
-{
-    return container_of(env, CRISCPU, env);
-}
-
-#define ENV_GET_CPU(e) CPU(cris_env_get_cpu(e))
-
-#define ENV_OFFSET offsetof(CRISCPU, env)
-
-#ifndef CONFIG_USER_ONLY
-extern const struct VMStateDescription vmstate_cris_cpu;
-#endif
-
-void cris_cpu_do_interrupt(CPUState *cpu);
-void crisv10_cpu_do_interrupt(CPUState *cpu);
-bool cris_cpu_exec_interrupt(CPUState *cpu, int int_req);
-
-void cris_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,
-                         int flags);
-
-hwaddr cris_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
-
-int crisv10_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
-int cris_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
-int cris_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
+typedef struct CRISCPU CRISCPU;
 
 #endif
target-cris/cpu.h +40 -1

53 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#5 lore raw

[Qemu-devel] [PULL 03/52] include: move CPU-related definitions out of qemu-common.h

In reply to Paolo Bonzini
---
 include/qemu-common.h  | 24 ------------------------
 include/qemu/timer.h   |  1 +
 include/qom/cpu.h      |  9 +++++++++
 include/sysemu/cpus.h  | 13 +++++++++++++
 stubs/cpu-get-icount.c |  1 +
 translate-common.c     |  1 +
 vl.c                   |  1 +
 7 files changed, 26 insertions(+), 24 deletions(-)
include/qemu-common.h +0 -24
index 163bcbb..f0d74076 100644
@@ -23,17 +23,6 @@
 #include "qemu/option.h"
 #include "qemu/host-utils.h"
 
-void cpu_ticks_init(void);
-
-/* icount */
-void configure_icount(QemuOpts *opts, Error **errp);
-extern int use_icount;
-extern int icount_align_option;
-/* drift information for info jit command */
-extern int64_t max_delay;
-extern int64_t max_advance;
-void dump_drift_info(FILE *f, fprintf_function cpu_fprintf);
-
 #include "qemu/bswap.h"
 
 /* FIXME: Remove NEED_CPU_H.  */
@@ -100,19 +89,6 @@ bool tcg_enabled(void);
 
 void cpu_exec_init_all(void);
 
-/* Unblock cpu */
-void qemu_cpu_kick_self(void);
-
-/* work queue */
-struct qemu_work_item {
-    struct qemu_work_item *next;
-    void (*func)(void *data);
-    void *data;
-    int done;
-    bool free;
-};
-
-
 /**
  * Sends a (part of) iovec down a socket, yielding when the socket is full, or
  * Receives data into a (part of) iovec from a socket,
include/qemu/timer.h +1 -0
index 471969a..309f3d0 100644
@@ -4,6 +4,7 @@
 #include "qemu-common.h"
 #include "qemu/notify.h"
 #include "qemu/host-utils.h"
+#include "sysemu/cpus.h"
 
 #define NANOSECONDS_PER_SECOND 1000000000LL
 
include/qom/cpu.h +9 -0
index 4349c46..b8d9fb1 100644
@@ -222,6 +222,15 @@ struct kvm_run;
 #define TB_JMP_CACHE_BITS 12
 #define TB_JMP_CACHE_SIZE (1 << TB_JMP_CACHE_BITS)
 
+/* work queue */
+struct qemu_work_item {
+    struct qemu_work_item *next;
+    void (*func)(void *data);
+    void *data;
+    int done;
+    bool free;
+};
+
 /**
  * CPUState:
  * @cpu_index: CPU index (informative).
include/sysemu/cpus.h +13 -0
index 3d1e5ba..fe992a8 100644
@@ -7,6 +7,19 @@ void qemu_init_cpu_loop(void);
 void resume_all_vcpus(void);
 void pause_all_vcpus(void);
 void cpu_stop_current(void);
+void cpu_ticks_init(void);
+
+void configure_icount(QemuOpts *opts, Error **errp);
+extern int use_icount;
+extern int icount_align_option;
+
+/* drift information for info jit command */
+extern int64_t max_delay;
+extern int64_t max_advance;
+void dump_drift_info(FILE *f, fprintf_function cpu_fprintf);
+
+/* Unblock cpu */
+void qemu_cpu_kick_self(void);
 
 void cpu_synchronize_all_states(void);
 void cpu_synchronize_all_post_reset(void);
stubs/cpu-get-icount.c +1 -0
index 3a6f2ab..2e8b63b 100644
@@ -1,6 +1,7 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/timer.h"
+#include "sysemu/cpus.h"
 
 int use_icount;
 
translate-common.c +1 -0
index ffbfe85..5e989cd 100644
@@ -20,6 +20,7 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qom/cpu.h"
+#include "sysemu/cpus.h"
 
 uintptr_t qemu_real_host_page_size;
 intptr_t qemu_real_host_page_mask;
vl.c +1 -0
index e789ce7..bf61983 100644
@@ -87,6 +87,7 @@ int main(int argc, char **argv)
 #include "sysemu/dma.h"
 #include "audio/audio.h"
 #include "migration/migration.h"
+#include "sysemu/cpus.h"
 #include "sysemu/kvm.h"
 #include "qapi/qmp/qjson.h"
 #include "qemu/option.h"
Signature · 1 line
1.8.3.1
#6 lore raw

[Qemu-devel] [PULL 01/52] scripts: add script to build QEMU and analyze inclusions

In reply to Paolo Bonzini
---
 scripts/analyze-inclusions | 102 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 102 insertions(+)
 create mode 100644 scripts/analyze-inclusions
scripts/analyze-inclusions new file +102 -0
new file mode 100644
index 0000000..a8108d9
@@ -0,0 +1,102 @@
+#! /bin/sh
+#
+# Copyright (C) 2016 Red Hat, Inc.
+#
+# Author: Paolo Bonzini <[email protected]>
+#
+# Print statistics about header file inclusions.
+#
+# The script has two modes of execution:
+#
+# 1) if invoked with a path on the command line (possibly
+# preceded by a "--" argument), it will run the analysis on
+# an existing build directory
+#
+# 2) otherwise, it will configure and builds QEMU itself in a
+# "+build" subdirectory which is left around when the script
+# exits.  In this case the command line is passed directly to
+# "make" (typically used for a "-j" argument suitable for your
+# system).
+#
+# Inspired by a post by Markus Armbruster.
+
+case "x$1" in
+x--)
+  shift
+  cd "$1" || exit $?
+  ;;
+x-* | x)
+  mkdir -p +build
+  cd +build
+  test -f Makefile && make distclean
+  ../configure
+  make "$@"
+  ;;
+*)
+  cd "$1" || exit $?
+esac
+
+QEMU_CFLAGS=$(sed -n s/^QEMU_CFLAGS=//p config-host.mak)
+QEMU_INCLUDES=$(sed -n s/^QEMU_INCLUDES=//p config-host.mak | \
+    sed 's/$(SRC_PATH)/../g' )
+CFLAGS=$(sed -n s/^CFLAGS=//p config-host.mak)
+
+grep_include() {
+  find . -name "*.d" -exec grep -l "$@" {} + | wc -l
+}
+
+echo Found $(find . -name "*.d" | wc -l) object files
+echo $(grep_include -F 'include/qemu-common.h') files include qemu-common.h
+echo $(grep_include -F 'hw/hw.h') files include hw/hw.h
+echo $(grep_include 'target-[a-z0-9]*/cpu\.h') files include cpu.h
+echo $(grep_include -F 'qapi-types.h') files include qapi-types.h
+echo $(grep_include -F 'trace/generated-tracers.h') files include generated-tracers.h
+echo $(grep_include -F 'qapi/error.h') files include qapi/error.h
+echo $(grep_include -F 'qom/object.h') files include qom/object.h
+echo $(grep_include -F 'block/aio.h') files include block/aio.h
+echo $(grep_include -F 'exec/memory.h') files include exec/memory.h
+echo $(grep_include -F 'fpu/softfloat.h') files include fpu/softfloat.h
+echo $(grep_include -F 'qemu/bswap.h') files include qemu/bswap.h
+echo
+
+awk1='
+    /^# / { file = $3;next }
+    NR>1 { bytes[file]+=length()+1; lines[file]++ }
+    END { for(i in lines) print i,lines[i],bytes[i] }'
+
+awk2='
+    {tot_l+=$2;tot_b+=$3;tot_f++}
+    /\/usr.*\/glib/ {glib_l+=$2;glib_b+=$3;glib_f++;next}
+    /\/usr/ {sys_l+=$2;sys_b+=$3;sys_f++;next}
+    {qemu_l+=$2;qemu_b+=$3;qemu_f++;next}
+    END {
+      printf "%s\t %s\t %s\t %s\n", "lines", "bytes", "files", "source"
+      printf "%s\t %s\t %s\t %s\n", qemu_l, qemu_b, qemu_f, "QEMU"
+      printf "%s\t %s\t %s\t %s\n", sys_l, sys_b, sys_f, "system"
+      printf "%s\t %s\t %s\t %s\n", glib_l, glib_b, glib_f, "glib"
+      printf "%s\t %s\t %s\t %s\n", tot_l, tot_b, tot_f, "total"
+    }'
+
+analyze() {
+  cc $QEMU_CFLAGS $QEMU_INCLUDES $CFLAGS  -E -o - "$@" | \
+    awk "$awk1" | awk "$awk2"
+  echo
+}
+
+echo osdep.h:
+analyze ../include/qemu/osdep.h
+
+echo qemu-common.h:
+analyze  -include ../include/qemu/osdep.h ../include/qemu-common.h
+
+echo hw/hw.h:
+analyze -include ../include/qemu/osdep.h ../include/hw/hw.h
+
+echo trace/generated-tracers.h:
+analyze -include ../include/qemu/osdep.h trace/generated-tracers.h
+
+echo target-i386/cpu.h:
+analyze -DNEED_CPU_H -I../target-i386 -Ii386-softmmu -include ../include/qemu/osdep.h ../target-i386/cpu.h
+
+echo hw/hw.h + NEED_CPU_H:
+analyze -DNEED_CPU_H -I../target-i386 -Ii386-softmmu -include ../include/qemu/osdep.h ../include/hw/hw.h
Signature · 1 line
1.8.3.1
#7 lore raw

[Qemu-devel] [PULL 07/52] target-arm: make cpu-qom.h not target specific

In reply to Paolo Bonzini

Make ARMCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers.

---
 target-arm/cpu-qom.h | 178 +-------------------------------------------------
 target-arm/cpu.h     | 179 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 179 insertions(+), 178 deletions(-)
target-arm/cpu-qom.h +3 -175
index 1061c08..3991173 100644
@@ -22,6 +22,8 @@
 
 #include "qom/cpu.h"
 
+struct arm_boot_info;
+
 #define TYPE_ARM_CPU "arm-cpu"
 
 #define ARM_CPU_CLASS(klass) \
@@ -47,145 +49,7 @@ typedef struct ARMCPUClass {
     void (*parent_reset)(CPUState *cpu);
 } ARMCPUClass;
 
-/**
- * ARMCPU:
- * @env: #CPUARMState
- *
- * An ARM CPU core.
- */
-typedef struct ARMCPU {
-    /*< private >*/
-    CPUState parent_obj;
-    /*< public >*/
-
-    CPUARMState env;
-
-    /* Coprocessor information */
-    GHashTable *cp_regs;
-    /* For marshalling (mostly coprocessor) register state between the
-     * kernel and QEMU (for KVM) and between two QEMUs (for migration),
-     * we use these arrays.
-     */
-    /* List of register indexes managed via these arrays; (full KVM style
-     * 64 bit indexes, not CPRegInfo 32 bit indexes)
-     */
-    uint64_t *cpreg_indexes;
-    /* Values of the registers (cpreg_indexes[i]'s value is cpreg_values[i]) */
-    uint64_t *cpreg_values;
-    /* Length of the indexes, values, reset_values arrays */
-    int32_t cpreg_array_len;
-    /* These are used only for migration: incoming data arrives in
-     * these fields and is sanity checked in post_load before copying
-     * to the working data structures above.
-     */
-    uint64_t *cpreg_vmstate_indexes;
-    uint64_t *cpreg_vmstate_values;
-    int32_t cpreg_vmstate_array_len;
-
-    /* Timers used by the generic (architected) timer */
-    QEMUTimer *gt_timer[NUM_GTIMERS];
-    /* GPIO outputs for generic timer */
-    qemu_irq gt_timer_outputs[NUM_GTIMERS];
-
-    /* MemoryRegion to use for secure physical accesses */
-    MemoryRegion *secure_memory;
-
-    /* 'compatible' string for this CPU for Linux device trees */
-    const char *dtb_compatible;
-
-    /* PSCI version for this CPU
-     * Bits[31:16] = Major Version
-     * Bits[15:0] = Minor Version
-     */
-    uint32_t psci_version;
-
-    /* Should CPU start in PSCI powered-off state? */
-    bool start_powered_off;
-    /* CPU currently in PSCI powered-off state */
-    bool powered_off;
-    /* CPU has security extension */
-    bool has_el3;
-
-    /* CPU has memory protection unit */
-    bool has_mpu;
-    /* PMSAv7 MPU number of supported regions */
-    uint32_t pmsav7_dregion;
-
-    /* PSCI conduit used to invoke PSCI methods
-     * 0 - disabled, 1 - smc, 2 - hvc
-     */
-    uint32_t psci_conduit;
-
-    /* [QEMU_]KVM_ARM_TARGET_* constant for this CPU, or
-     * QEMU_KVM_ARM_TARGET_NONE if the kernel doesn't support this CPU type.
-     */
-    uint32_t kvm_target;
-
-    /* KVM init features for this CPU */
-    uint32_t kvm_init_features[7];
-
-    /* Uniprocessor system with MP extensions */
-    bool mp_is_up;
-
-    /* The instance init functions for implementation-specific subclasses
-     * set these fields to specify the implementation-dependent values of
-     * various constant registers and reset values of non-constant
-     * registers.
-     * Some of these might become QOM properties eventually.
-     * Field names match the official register names as defined in the
-     * ARMv7AR ARM Architecture Reference Manual. A reset_ prefix
-     * is used for reset values of non-constant registers; no reset_
-     * prefix means a constant register.
-     */
-    uint32_t midr;
-    uint32_t revidr;
-    uint32_t reset_fpsid;
-    uint32_t mvfr0;
-    uint32_t mvfr1;
-    uint32_t mvfr2;
-    uint32_t ctr;
-    uint32_t reset_sctlr;
-    uint32_t id_pfr0;
-    uint32_t id_pfr1;
-    uint32_t id_dfr0;
-    uint32_t pmceid0;
-    uint32_t pmceid1;
-    uint32_t id_afr0;
-    uint32_t id_mmfr0;
-    uint32_t id_mmfr1;
-    uint32_t id_mmfr2;
-    uint32_t id_mmfr3;
-    uint32_t id_mmfr4;
-    uint32_t id_isar0;
-    uint32_t id_isar1;
-    uint32_t id_isar2;
-    uint32_t id_isar3;
-    uint32_t id_isar4;
-    uint32_t id_isar5;
-    uint64_t id_aa64pfr0;
-    uint64_t id_aa64pfr1;
-    uint64_t id_aa64dfr0;
-    uint64_t id_aa64dfr1;
-    uint64_t id_aa64afr0;
-    uint64_t id_aa64afr1;
-    uint64_t id_aa64isar0;
-    uint64_t id_aa64isar1;
-    uint64_t id_aa64mmfr0;
-    uint64_t id_aa64mmfr1;
-    uint32_t dbgdidr;
-    uint32_t clidr;
-    uint64_t mp_affinity; /* MP ID without feature bits */
-    /* The elements of this array are the CCSIDR values for each cache,
-     * in the order L1DCache, L1ICache, L2DCache, L2ICache, etc.
-     */
-    uint32_t ccsidr[16];
-    uint64_t reset_cbar;
-    uint32_t reset_auxcr;
-    bool reset_hivecs;
-    /* DCZ blocksize, in log_2(words), ie low 4 bits of DCZID_EL0 */
-    uint32_t dcz_blocksize;
-    uint64_t rvbar;
-} ARMCPU;
+typedef struct ARMCPU ARMCPU;
 
 #define TYPE_AARCH64_CPU "aarch64-cpu"
 #define AARCH64_CPU_CLASS(klass) \
@@ -199,40 +63,9 @@ typedef struct AArch64CPUClass {
     /*< public >*/
 } AArch64CPUClass;
 
-static inline ARMCPU *arm_env_get_cpu(CPUARMState *env)
-{
-    return container_of(env, ARMCPU, env);
-}
-
-#define ENV_GET_CPU(e) CPU(arm_env_get_cpu(e))
-
-#define ENV_OFFSET offsetof(ARMCPU, env)
-
-#ifndef CONFIG_USER_ONLY
-extern const struct VMStateDescription vmstate_arm_cpu;
-#endif
-
 void register_cp_regs_for_features(ARMCPU *cpu);
 void init_cpreg_list(ARMCPU *cpu);
 
-void arm_cpu_do_interrupt(CPUState *cpu);
-void arm_v7m_cpu_do_interrupt(CPUState *cpu);
-bool arm_cpu_exec_interrupt(CPUState *cpu, int int_req);
-
-void arm_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,
-                        int flags);
-
-hwaddr arm_cpu_get_phys_page_attrs_debug(CPUState *cpu, vaddr addr,
-                                         MemTxAttrs *attrs);
-
-int arm_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
-int arm_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
-
-int arm_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs,
-                             int cpuid, void *opaque);
-int arm_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs,
-                             int cpuid, void *opaque);
-
 /* Callback functions for the generic timer's timers. */
 void arm_gt_ptimer_cb(void *opaque);
 void arm_gt_vtimer_cb(void *opaque);
@@ -252,9 +85,4 @@ void arm_gt_stimer_cb(void *opaque);
 #define ARM64_AFFINITY_MASK \
     (ARM_AFF0_MASK|ARM_AFF1_MASK|ARM_AFF2_MASK|ARM_AFF3_MASK)
 
-#ifdef TARGET_AARCH64
-int aarch64_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
-int aarch64_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
-#endif
-
 #endif
target-arm/cpu.h +176 -3

197 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#8 lore raw

[Qemu-devel] [PULL 09/52] target-i386: make cpu-qom.h not target specific

In reply to Paolo Bonzini

Make X86CPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers.

---
 target-i386/cpu-qom.h | 97 +-------------------------------------------------
 target-i386/cpu.h     | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 98 insertions(+), 97 deletions(-)
target-i386/cpu-qom.h +1 -96
index 2ca7b9e..5dde658 100644
@@ -67,101 +67,6 @@ typedef struct X86CPUClass {
     void (*parent_reset)(CPUState *cpu);
 } X86CPUClass;
 
-/**
- * X86CPU:
- * @env: #CPUX86State
- * @migratable: If set, only migratable flags will be accepted when "enforce"
- * mode is used, and only migratable flags will be included in the "host"
- * CPU model.
- *
- * An x86 CPU.
- */
-typedef struct X86CPU {
-    /*< private >*/
-    CPUState parent_obj;
-    /*< public >*/
-
-    CPUX86State env;
-
-    bool hyperv_vapic;
-    bool hyperv_relaxed_timing;
-    int hyperv_spinlock_attempts;
-    char *hyperv_vendor_id;
-    bool hyperv_time;
-    bool hyperv_crash;
-    bool hyperv_reset;
-    bool hyperv_vpindex;
-    bool hyperv_runtime;
-    bool hyperv_synic;
-    bool hyperv_stimer;
-    bool check_cpuid;
-    bool enforce_cpuid;
-    bool expose_kvm;
-    bool migratable;
-    bool host_features;
-    int64_t apic_id;
-
-    /* if true the CPUID code directly forward host cache leaves to the guest */
-    bool cache_info_passthrough;
-
-    /* Features that were filtered out because of missing host capabilities */
-    uint32_t filtered_features[FEATURE_WORDS];
-
-    /* Enable PMU CPUID bits. This can't be enabled by default yet because
-     * it doesn't have ABI stability guarantees, as it passes all PMU CPUID
-     * bits returned by GET_SUPPORTED_CPUID (that depend on host CPU and kernel
-     * capabilities) directly to the guest.
-     */
-    bool enable_pmu;
-
-    /* in order to simplify APIC support, we leave this pointer to the
-       user */
-    struct DeviceState *apic_state;
-    struct MemoryRegion *cpu_as_root, *cpu_as_mem, *smram;
-    Notifier machine_done;
-} X86CPU;
-
-static inline X86CPU *x86_env_get_cpu(CPUX86State *env)
-{
-    return container_of(env, X86CPU, env);
-}
-
-#define ENV_GET_CPU(e) CPU(x86_env_get_cpu(e))
-
-#define ENV_OFFSET offsetof(X86CPU, env)
-
-#ifndef CONFIG_USER_ONLY
-extern struct VMStateDescription vmstate_x86_cpu;
-#endif
-
-/**
- * x86_cpu_do_interrupt:
- * @cpu: vCPU the interrupt is to be handled by.
- */
-void x86_cpu_do_interrupt(CPUState *cpu);
-bool x86_cpu_exec_interrupt(CPUState *cpu, int int_req);
-
-int x86_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cpu,
-                             int cpuid, void *opaque);
-int x86_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cpu,
-                             int cpuid, void *opaque);
-int x86_cpu_write_elf64_qemunote(WriteCoreDumpFunction f, CPUState *cpu,
-                                 void *opaque);
-int x86_cpu_write_elf32_qemunote(WriteCoreDumpFunction f, CPUState *cpu,
-                                 void *opaque);
-
-void x86_cpu_get_memory_mapping(CPUState *cpu, MemoryMappingList *list,
-                                Error **errp);
-
-void x86_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,
-                        int flags);
-
-hwaddr x86_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
-
-int x86_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
-int x86_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
-
-void x86_cpu_exec_enter(CPUState *cpu);
-void x86_cpu_exec_exit(CPUState *cpu);
+typedef struct X86CPU X86CPU;
 
 #endif
target-i386/cpu.h +97 -1

110 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#9 lore raw

[Qemu-devel] [PULL 02/52] s390x: move .needed functions for subsections to machine.c

In reply to Paolo Bonzini

These functions are only used when defining subsections, so move them there.

---
 target-s390x/cpu.h     | 26 --------------------------
 target-s390x/machine.c | 20 ++++++++++++++++++++
 2 files changed, 20 insertions(+), 26 deletions(-)
target-s390x/cpu.h +0 -26
index 996b790..00e9f69 100644
@@ -1271,32 +1271,6 @@ static inline void s390_crypto_reset(void)
     }
 }
 
-#ifdef CONFIG_KVM
-static inline bool vregs_needed(void *opaque)
-{
-    if (kvm_enabled()) {
-        return kvm_check_extension(kvm_state, KVM_CAP_S390_VECTOR_REGISTERS);
-    }
-    return 0;
-}
-static inline bool riccb_needed(void *opaque)
-{
-    if (kvm_enabled()) {
-        return kvm_s390_get_ri();
-    }
-    return 0;
-}
-#else
-static inline bool vregs_needed(void *opaque)
-{
-    return 0;
-}
-static inline bool riccb_needed(void *opaque)
-{
-    return 0;
-}
-#endif
-
 /* machine check interruption code */
 
 /* subclasses */
target-s390x/machine.c +20 -0
index a30b16f..aa39e5d 100644
@@ -76,6 +76,16 @@ static const VMStateDescription vmstate_fpu = {
     }
 };
 
+static bool vregs_needed(void *opaque)
+{
+#ifdef CONFIG_KVM
+    if (kvm_enabled()) {
+        return kvm_check_extension(kvm_state, KVM_CAP_S390_VECTOR_REGISTERS);
+    }
+#endif
+    return 0;
+}
+
 static const VMStateDescription vmstate_vregs = {
     .name = "cpu/vregs",
     .version_id = 1,
@@ -135,6 +145,16 @@ static const VMStateDescription vmstate_vregs = {
     }
 };
 
+static bool riccb_needed(void *opaque)
+{
+#ifdef CONFIG_KVM
+    if (kvm_enabled()) {
+        return kvm_s390_get_ri();
+    }
+#endif
+    return 0;
+}
+
 const VMStateDescription vmstate_riccb = {
     .name = "cpu/riccb",
     .version_id = 1,
Signature · 1 line
1.8.3.1
#10 lore raw

[Qemu-devel] [PULL 13/52] target-mips: make cpu-qom.h not target specific

In reply to Paolo Bonzini

Make MIPSCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers.

---
 target-mips/cpu-qom.h | 37 +------------------------------------
 target-mips/cpu.h     | 38 +++++++++++++++++++++++++++++++++++++-
 2 files changed, 38 insertions(+), 37 deletions(-)
target-mips/cpu-qom.h +1 -36
index 4d6f9de..3f5bf23 100644
@@ -51,41 +51,6 @@ typedef struct MIPSCPUClass {
     void (*parent_reset)(CPUState *cpu);
 } MIPSCPUClass;
 
-/**
- * MIPSCPU:
- * @env: #CPUMIPSState
- *
- * A MIPS CPU.
- */
-typedef struct MIPSCPU {
-    /*< private >*/
-    CPUState parent_obj;
-    /*< public >*/
-
-    CPUMIPSState env;
-} MIPSCPU;
-
-static inline MIPSCPU *mips_env_get_cpu(CPUMIPSState *env)
-{
-    return container_of(env, MIPSCPU, env);
-}
-
-#define ENV_GET_CPU(e) CPU(mips_env_get_cpu(e))
-
-#define ENV_OFFSET offsetof(MIPSCPU, env)
-
-#ifndef CONFIG_USER_ONLY
-extern const struct VMStateDescription vmstate_mips_cpu;
-#endif
-
-void mips_cpu_do_interrupt(CPUState *cpu);
-bool mips_cpu_exec_interrupt(CPUState *cpu, int int_req);
-void mips_cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf,
-                         int flags);
-hwaddr mips_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
-int mips_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
-int mips_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
-void mips_cpu_do_unaligned_access(CPUState *cpu, vaddr addr,
-                                  int is_write, int is_user, uintptr_t retaddr);
+typedef struct MIPSCPU MIPSCPU;
 
 #endif
target-mips/cpu.h +37 -1
index 53e8262..c65f84e 100644
@@ -8,6 +8,7 @@
 #define CPUArchState struct CPUMIPSState
 
 #include "qemu-common.h"
+#include "cpu-qom.h"
 #include "mips-defs.h"
 #include "exec/cpu-defs.h"
 #include "fpu/softfloat.h"
@@ -615,7 +616,42 @@ struct CPUMIPSState {
     MemoryRegion *itc_tag; /* ITC Configuration Tags */
 };
 
-#include "cpu-qom.h"
+/**
+ * MIPSCPU:
+ * @env: #CPUMIPSState
+ *
+ * A MIPS CPU.
+ */
+struct MIPSCPU {
+    /*< private >*/
+    CPUState parent_obj;
+    /*< public >*/
+
+    CPUMIPSState env;
+};
+
+static inline MIPSCPU *mips_env_get_cpu(CPUMIPSState *env)
+{
+    return container_of(env, MIPSCPU, env);
+}
+
+#define ENV_GET_CPU(e) CPU(mips_env_get_cpu(e))
+
+#define ENV_OFFSET offsetof(MIPSCPU, env)
+
+#ifndef CONFIG_USER_ONLY
+extern const struct VMStateDescription vmstate_mips_cpu;
+#endif
+
+void mips_cpu_do_interrupt(CPUState *cpu);
+bool mips_cpu_exec_interrupt(CPUState *cpu, int int_req);
+void mips_cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf,
+                         int flags);
+hwaddr mips_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
+int mips_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
+int mips_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
+void mips_cpu_do_unaligned_access(CPUState *cpu, vaddr addr,
+                                  int is_write, int is_user, uintptr_t retaddr);
 
 #if !defined(CONFIG_USER_ONLY)
 int no_mmu_map_address (CPUMIPSState *env, hwaddr *physical, int *prot,
Signature · 1 line
1.8.3.1
#11 lore raw

[Qemu-devel] [PULL 14/52] target-ppc: do not use target_ulong in cpu-qom.h

In reply to Paolo Bonzini

Bring the PowerPCCPUClass handle_mmu_fault method type into line with the one in CPUClass.

Using vaddr also makes the cpu-qom.h file target independent.

---
 target-ppc/cpu-qom.h    | 3 +--
 target-ppc/mmu-hash32.c | 2 +-
 target-ppc/mmu-hash32.h | 2 +-
 target-ppc/mmu-hash64.c | 2 +-
 target-ppc/mmu-hash64.h | 2 +-
 5 files changed, 5 insertions(+), 6 deletions(-)
target-ppc/cpu-qom.h +1 -2
index eb822a3..bab501f 100644
@@ -73,8 +73,7 @@ typedef struct PowerPCCPUClass {
     void (*init_proc)(CPUPPCState *env);
     int  (*check_pow)(CPUPPCState *env);
 #if defined(CONFIG_SOFTMMU)
-    int (*handle_mmu_fault)(PowerPCCPU *cpu, target_ulong eaddr, int rwx,
-                            int mmu_idx);
+    int (*handle_mmu_fault)(PowerPCCPU *cpu, vaddr eaddr, int rwx, int mmu_idx);
 #endif
     bool (*interrupts_big_endian)(PowerPCCPU *cpu);
 } PowerPCCPUClass;
target-ppc/mmu-hash32.c +1 -1
index 39abb2f..06ce4d6 100644
@@ -383,7 +383,7 @@ static hwaddr ppc_hash32_pte_raddr(target_ulong sr, ppc_hash_pte32_t pte,
     return (rpn & ~mask) | (eaddr & mask);
 }
 
-int ppc_hash32_handle_mmu_fault(PowerPCCPU *cpu, target_ulong eaddr, int rwx,
+int ppc_hash32_handle_mmu_fault(PowerPCCPU *cpu, vaddr eaddr, int rwx,
                                 int mmu_idx)
 {
     CPUState *cs = CPU(cpu);
target-ppc/mmu-hash32.h +1 -1
index afbb9dd..aaceacd 100644
@@ -5,7 +5,7 @@
 
 hwaddr get_pteg_offset32(PowerPCCPU *cpu, hwaddr hash);
 hwaddr ppc_hash32_get_phys_page_debug(PowerPCCPU *cpu, target_ulong addr);
-int ppc_hash32_handle_mmu_fault(PowerPCCPU *cpu, target_ulong address, int rw,
+int ppc_hash32_handle_mmu_fault(PowerPCCPU *cpu, vaddr address, int rw,
                                 int mmu_idx);
 
 /*
target-ppc/mmu-hash64.c +1 -1
index 72c4ab5..5184626 100644
@@ -589,7 +589,7 @@ unsigned ppc_hash64_hpte_page_shift_noslb(PowerPCCPU *cpu,
     return 0;
 }
 
-int ppc_hash64_handle_mmu_fault(PowerPCCPU *cpu, target_ulong eaddr,
+int ppc_hash64_handle_mmu_fault(PowerPCCPU *cpu, vaddr eaddr,
                                 int rwx, int mmu_idx)
 {
     CPUState *cs = CPU(cpu);
target-ppc/mmu-hash64.h +1 -1
index 9bf8b9b..6423b9f 100644
@@ -9,7 +9,7 @@ void dump_slb(FILE *f, fprintf_function cpu_fprintf, PowerPCCPU *cpu);
 int ppc_store_slb(PowerPCCPU *cpu, target_ulong slot,
                   target_ulong esid, target_ulong vsid);
 hwaddr ppc_hash64_get_phys_page_debug(PowerPCCPU *cpu, target_ulong addr);
-int ppc_hash64_handle_mmu_fault(PowerPCCPU *cpu, target_ulong address, int rw,
+int ppc_hash64_handle_mmu_fault(PowerPCCPU *cpu, vaddr address, int rw,
                                 int mmu_idx);
 void ppc_hash64_store_hpte(PowerPCCPU *cpu, target_ulong index,
                            target_ulong pte0, target_ulong pte1);
Signature · 1 line
1.8.3.1
#12 lore raw

[Qemu-devel] [PULL 18/52] target-sh4: make cpu-qom.h not target specific

In reply to Paolo Bonzini

Make SuperHCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers.

---
 target-sh4/cpu-qom.h | 31 +------------------------------
 target-sh4/cpu.h     | 32 +++++++++++++++++++++++++++++++-
 2 files changed, 32 insertions(+), 31 deletions(-)
target-sh4/cpu-qom.h +1 -30
index 6341238..01abb20 100644
@@ -60,35 +60,6 @@ typedef struct SuperHCPUClass {
     uint32_t cvr;
 } SuperHCPUClass;
 
-/**
- * SuperHCPU:
- * @env: #CPUSH4State
- *
- * A SuperH CPU.
- */
-typedef struct SuperHCPU {
-    /*< private >*/
-    CPUState parent_obj;
-    /*< public >*/
-
-    CPUSH4State env;
-} SuperHCPU;
-
-static inline SuperHCPU *sh_env_get_cpu(CPUSH4State *env)
-{
-    return container_of(env, SuperHCPU, env);
-}
-
-#define ENV_GET_CPU(e) CPU(sh_env_get_cpu(e))
-
-#define ENV_OFFSET offsetof(SuperHCPU, env)
-
-void superh_cpu_do_interrupt(CPUState *cpu);
-bool superh_cpu_exec_interrupt(CPUState *cpu, int int_req);
-void superh_cpu_dump_state(CPUState *cpu, FILE *f,
-                           fprintf_function cpu_fprintf, int flags);
-hwaddr superh_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
-int superh_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
-int superh_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
+typedef struct SuperHCPU SuperHCPU;
 
 #endif
target-sh4/cpu.h +31 -1
index 10c0191..9bd15b8 100644
@@ -20,6 +20,7 @@
 #define _CPU_SH4_H
 
 #include "qemu-common.h"
+#include "cpu-qom.h"
 
 #define TARGET_LONG_BITS 32
 
@@ -187,7 +188,36 @@ typedef struct CPUSH4State {
     memory_content **movcal_backup_tail;
 } CPUSH4State;
 
-#include "cpu-qom.h"
+/**
+ * SuperHCPU:
+ * @env: #CPUSH4State
+ *
+ * A SuperH CPU.
+ */
+struct SuperHCPU {
+    /*< private >*/
+    CPUState parent_obj;
+    /*< public >*/
+
+    CPUSH4State env;
+};
+
+static inline SuperHCPU *sh_env_get_cpu(CPUSH4State *env)
+{
+    return container_of(env, SuperHCPU, env);
+}
+
+#define ENV_GET_CPU(e) CPU(sh_env_get_cpu(e))
+
+#define ENV_OFFSET offsetof(SuperHCPU, env)
+
+void superh_cpu_do_interrupt(CPUState *cpu);
+bool superh_cpu_exec_interrupt(CPUState *cpu, int int_req);
+void superh_cpu_dump_state(CPUState *cpu, FILE *f,
+                           fprintf_function cpu_fprintf, int flags);
+hwaddr superh_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
+int superh_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
+int superh_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
 
 void sh4_translate_init(void);
 SuperHCPU *cpu_sh4_init(const char *cpu_model);
Signature · 1 line
1.8.3.1
#13 lore raw

[Qemu-devel] [PULL 17/52] target-s390x: make cpu-qom.h not target specific

In reply to Paolo Bonzini

Make S390XCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers.

---
 target-s390x/cpu-qom.h | 45 +--------------------------------------------
 target-s390x/cpu.h     | 47 ++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 47 insertions(+), 45 deletions(-)
target-s390x/cpu-qom.h +1 -44
index 681e370..66b5d18 100644
@@ -55,49 +55,6 @@ typedef struct S390CPUClass {
     void (*initial_cpu_reset)(CPUState *cpu);
 } S390CPUClass;
 
-/**
- * S390CPU:
- * @env: #CPUS390XState.
- *
- * An S/390 CPU.
- */
-typedef struct S390CPU {
-    /*< private >*/
-    CPUState parent_obj;
-    /*< public >*/
-
-    CPUS390XState env;
-    int64_t id;
-    /* needed for live migration */
-    void *irqstate;
-    uint32_t irqstate_saved_size;
-} S390CPU;
-
-static inline S390CPU *s390_env_get_cpu(CPUS390XState *env)
-{
-    return container_of(env, S390CPU, env);
-}
-
-#define ENV_GET_CPU(e) CPU(s390_env_get_cpu(e))
-
-#define ENV_OFFSET offsetof(S390CPU, env)
-
-#ifndef CONFIG_USER_ONLY
-extern const struct VMStateDescription vmstate_s390_cpu;
-#endif
-
-void s390_cpu_do_interrupt(CPUState *cpu);
-bool s390_cpu_exec_interrupt(CPUState *cpu, int int_req);
-void s390_cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf,
-                         int flags);
-int s390_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs,
-                              int cpuid, void *opaque);
-
-hwaddr s390_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
-hwaddr s390_cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr);
-int s390_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
-int s390_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
-void s390_cpu_gdb_init(CPUState *cs);
-void s390x_cpu_debug_excp_handler(CPUState *cs);
+typedef struct S390CPU S390CPU;
 
 #endif
target-s390x/cpu.h +46 -1

59 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#14 lore raw

[Qemu-devel] [PULL 23/52] arm: include cpu-qom.h in files that require ARMCPU

In reply to Paolo Bonzini

This will keep things working when cpu.h will not be included indirectly almost everywhere (either directly or through qemu-common.h).

---
 hw/arm/stm32f205_soc.c      | 1 -
 hw/arm/strongarm.h          | 1 +
 include/hw/arm/arm.h        | 2 +-
 include/hw/arm/exynos4210.h | 1 +
 include/hw/arm/omap.h       | 1 +
 include/hw/arm/pxa.h        | 1 +
 6 files changed, 5 insertions(+), 2 deletions(-)
hw/arm/stm32f205_soc.c +0 -1
index a5ea1e2..9c1dafb 100644
@@ -25,7 +25,6 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qemu-common.h"
-#include "cpu.h"
 #include "hw/arm/arm.h"
 #include "exec/address-spaces.h"
 #include "hw/arm/stm32f205_soc.h"
hw/arm/strongarm.h +1 -0
index 2893f94..cd32bbd 100644
@@ -2,6 +2,7 @@
 #define _STRONGARM_H
 
 #include "exec/memory.h"
+#include "target-arm/cpu-qom.h"
 
 #define SA_CS0          0x00000000
 #define SA_CS1          0x08000000
include/hw/arm/arm.h +1 -1
index b2517f9..8b49a98 100644
@@ -12,9 +12,9 @@
 #define ARM_MISC_H 1
 
 #include "exec/memory.h"
+#include "target-arm/cpu-qom.h"
 #include "hw/irq.h"
 #include "qemu/notify.h"
-#include "cpu.h"
 
 typedef enum {
     ARM_ENDIANNESS_UNKNOWN = 0,
include/hw/arm/exynos4210.h +1 -0
index 5c1820f..b6d929d 100644
@@ -28,6 +28,7 @@
 
 #include "qemu-common.h"
 #include "exec/memory.h"
+#include "target-arm/cpu-qom.h"
 
 #define EXYNOS4210_NCPUS                    2
 
include/hw/arm/omap.h +1 -0
index 0ad5fb8..f026c8d 100644
@@ -20,6 +20,7 @@
 #include "exec/memory.h"
 # define hw_omap_h		"omap.h"
 #include "hw/irq.h"
+#include "target-arm/cpu-qom.h"
 
 # define OMAP_EMIFS_BASE	0x00000000
 # define OMAP2_Q0_BASE		0x00000000
include/hw/arm/pxa.h +1 -0
index 259b852..074feac 100644
@@ -10,6 +10,7 @@
 # define PXA_H			"pxa.h"
 
 #include "exec/memory.h"
+#include "target-arm/cpu-qom.h"
 
 /* Interrupt numbers */
 # define PXA2XX_PIC_SSP3	0
Signature · 1 line
1.8.3.1
#15 lore raw

[Qemu-devel] [PULL 10/52] target-lm32: make cpu-qom.h not target specific

In reply to Paolo Bonzini

Make LM32CPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers.

---
 target-lm32/cpu-qom.h | 41 +----------------------------------------
 target-lm32/cpu.h     | 44 ++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 43 insertions(+), 42 deletions(-)
target-lm32/cpu-qom.h +1 -40
index 54989e4..b423d25 100644
@@ -47,45 +47,6 @@ typedef struct LM32CPUClass {
     void (*parent_reset)(CPUState *cpu);
 } LM32CPUClass;
 
-/**
- * LM32CPU:
- * @env: #CPULM32State
- *
- * A LatticeMico32 CPU.
- */
-typedef struct LM32CPU {
-    /*< private >*/
-    CPUState parent_obj;
-    /*< public >*/
-
-    CPULM32State env;
-
-    uint32_t revision;
-    uint8_t num_interrupts;
-    uint8_t num_breakpoints;
-    uint8_t num_watchpoints;
-    uint32_t features;
-} LM32CPU;
-
-static inline LM32CPU *lm32_env_get_cpu(CPULM32State *env)
-{
-    return container_of(env, LM32CPU, env);
-}
-
-#define ENV_GET_CPU(e) CPU(lm32_env_get_cpu(e))
-
-#define ENV_OFFSET offsetof(LM32CPU, env)
-
-#ifndef CONFIG_USER_ONLY
-extern const struct VMStateDescription vmstate_lm32_cpu;
-#endif
-
-void lm32_cpu_do_interrupt(CPUState *cpu);
-bool lm32_cpu_exec_interrupt(CPUState *cs, int int_req);
-void lm32_cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf,
-                         int flags);
-hwaddr lm32_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
-int lm32_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
-int lm32_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
+typedef struct LM32CPU LM32CPU;
 
 #endif
target-lm32/cpu.h +42 -2

62 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#16 lore raw

[Qemu-devel] [PULL 25/52] sh4: include cpu-qom.h in files that require SuperHCPU

In reply to Paolo Bonzini

This will keep things working when cpu.h will not be included indirectly almost everywhere (either directly or through qemu-common.h).

---
 include/hw/sh4/sh.h | 1 +
 1 file changed, 1 insertion(+)
include/hw/sh4/sh.h +1 -0
index e61de9a..070312d 100644
@@ -3,6 +3,7 @@
 /* Definitions for SH board emulation.  */
 
 #include "hw/sh4/sh_intc.h"
+#include "target-sh4/cpu-qom.h"
 
 #define A7ADDR(x) ((x) & 0x1fffffff)
 #define P4ADDR(x) ((x) | 0xe0000000)
Signature · 1 line
1.8.3.1
#17 lore raw

[Qemu-devel] [PULL 12/52] target-microblaze: make cpu-qom.h not target specific

In reply to Paolo Bonzini

Make MicroBlazeCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers.

---
 target-microblaze/cpu-qom.h | 44 +-------------------------------------------
 target-microblaze/cpu.h     | 45 ++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 45 insertions(+), 44 deletions(-)
target-microblaze/cpu-qom.h +1 -43
index 34f6273..1a61db7 100644
@@ -47,48 +47,6 @@ typedef struct MicroBlazeCPUClass {
     void (*parent_reset)(CPUState *cpu);
 } MicroBlazeCPUClass;
 
-/**
- * MicroBlazeCPU:
- * @env: #CPUMBState
- *
- * A MicroBlaze CPU.
- */
-typedef struct MicroBlazeCPU {
-    /*< private >*/
-    CPUState parent_obj;
-
-    /*< public >*/
-
-    /* Microblaze Configuration Settings */
-    struct {
-        bool stackprot;
-        uint32_t base_vectors;
-        uint8_t use_fpu;
-        bool use_mmu;
-        bool dcache_writeback;
-        bool endi;
-        char *version;
-        uint8_t pvr;
-    } cfg;
-
-    CPUMBState env;
-} MicroBlazeCPU;
-
-static inline MicroBlazeCPU *mb_env_get_cpu(CPUMBState *env)
-{
-    return container_of(env, MicroBlazeCPU, env);
-}
-
-#define ENV_GET_CPU(e) CPU(mb_env_get_cpu(e))
-
-#define ENV_OFFSET offsetof(MicroBlazeCPU, env)
-
-void mb_cpu_do_interrupt(CPUState *cs);
-bool mb_cpu_exec_interrupt(CPUState *cs, int int_req);
-void mb_cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf,
-                       int flags);
-hwaddr mb_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
-int mb_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
-int mb_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
+typedef struct MicroBlazeCPU MicroBlazeCPU;
 
 #endif
target-microblaze/cpu.h +44 -1

57 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#18 lore raw

[Qemu-devel] [PULL 16/52] target-ppc: make cpu-qom.h not target specific

In reply to Paolo Bonzini

Make PowerPCCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. Conversely, move all definitions needed to define a class to cpu-qom.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers.

---
 target-ppc/cpu-qom.h | 159 +++++++++++++++++++++++++++++++++----------------
 target-ppc/cpu.h     | 164 ++++++++++++++++-----------------------------------
 2 files changed, 161 insertions(+), 162 deletions(-)
target-ppc/cpu-qom.h +109 -50
index 6f4e929..07358aa 100644
@@ -38,6 +38,115 @@
     OBJECT_GET_CLASS(PowerPCCPUClass, (obj), TYPE_POWERPC_CPU)
 
 typedef struct PowerPCCPU PowerPCCPU;
+typedef struct CPUPPCState CPUPPCState;
+typedef struct ppc_tb_t ppc_tb_t;
+typedef struct ppc_dcr_t ppc_dcr_t;
+
+/*****************************************************************************/
+/* MMU model                                                                 */
+typedef enum powerpc_mmu_t powerpc_mmu_t;
+enum powerpc_mmu_t {
+    POWERPC_MMU_UNKNOWN    = 0x00000000,
+    /* Standard 32 bits PowerPC MMU                            */
+    POWERPC_MMU_32B        = 0x00000001,
+    /* PowerPC 6xx MMU with software TLB                       */
+    POWERPC_MMU_SOFT_6xx   = 0x00000002,
+    /* PowerPC 74xx MMU with software TLB                      */
+    POWERPC_MMU_SOFT_74xx  = 0x00000003,
+    /* PowerPC 4xx MMU with software TLB                       */
+    POWERPC_MMU_SOFT_4xx   = 0x00000004,
+    /* PowerPC 4xx MMU with software TLB and zones protections */
+    POWERPC_MMU_SOFT_4xx_Z = 0x00000005,
+    /* PowerPC MMU in real mode only                           */
+    POWERPC_MMU_REAL       = 0x00000006,
+    /* Freescale MPC8xx MMU model                              */
+    POWERPC_MMU_MPC8xx     = 0x00000007,
+    /* BookE MMU model                                         */
+    POWERPC_MMU_BOOKE      = 0x00000008,
+    /* BookE 2.06 MMU model                                    */
+    POWERPC_MMU_BOOKE206   = 0x00000009,
+    /* PowerPC 601 MMU model (specific BATs format)            */
+    POWERPC_MMU_601        = 0x0000000A,
+#define POWERPC_MMU_64       0x00010000
+#define POWERPC_MMU_1TSEG    0x00020000
+#define POWERPC_MMU_AMR      0x00040000
+    /* 64 bits PowerPC MMU                                     */
+    POWERPC_MMU_64B        = POWERPC_MMU_64 | 0x00000001,
+    /* Architecture 2.03 and later (has LPCR) */
+    POWERPC_MMU_2_03       = POWERPC_MMU_64 | 0x00000002,
+    /* Architecture 2.06 variant                               */
+    POWERPC_MMU_2_06       = POWERPC_MMU_64 | POWERPC_MMU_1TSEG
+                             | POWERPC_MMU_AMR | 0x00000003,
+    /* Architecture 2.06 "degraded" (no 1T segments)           */
+    POWERPC_MMU_2_06a      = POWERPC_MMU_64 | POWERPC_MMU_AMR
+                             | 0x00000003,
+    /* Architecture 2.07 variant                               */
+    POWERPC_MMU_2_07       = POWERPC_MMU_64 | POWERPC_MMU_1TSEG
+                             | POWERPC_MMU_AMR | 0x00000004,
+    /* Architecture 2.07 "degraded" (no 1T segments)           */
+    POWERPC_MMU_2_07a      = POWERPC_MMU_64 | POWERPC_MMU_AMR
+                             | 0x00000004,
+};
+
+/*****************************************************************************/
+/* Exception model                                                           */
+typedef enum powerpc_excp_t powerpc_excp_t;
+enum powerpc_excp_t {
+    POWERPC_EXCP_UNKNOWN   = 0,
+    /* Standard PowerPC exception model */
+    POWERPC_EXCP_STD,
+    /* PowerPC 40x exception model      */
+    POWERPC_EXCP_40x,
+    /* PowerPC 601 exception model      */
+    POWERPC_EXCP_601,
+    /* PowerPC 602 exception model      */
+    POWERPC_EXCP_602,
+    /* PowerPC 603 exception model      */
+    POWERPC_EXCP_603,
+    /* PowerPC 603e exception model     */
+    POWERPC_EXCP_603E,
+    /* PowerPC G2 exception model       */
+    POWERPC_EXCP_G2,
+    /* PowerPC 604 exception model      */
+    POWERPC_EXCP_604,
+    /* PowerPC 7x0 exception model      */
+    POWERPC_EXCP_7x0,
+    /* PowerPC 7x5 exception model      */
+    POWERPC_EXCP_7x5,
+    /* PowerPC 74xx exception model     */
+    POWERPC_EXCP_74xx,
+    /* BookE exception model            */
+    POWERPC_EXCP_BOOKE,
+    /* PowerPC 970 exception model      */
+    POWERPC_EXCP_970,
+    /* POWER7 exception model           */
+    POWERPC_EXCP_POWER7,
+    /* POWER8 exception model           */
+    POWERPC_EXCP_POWER8,
+};
+
+/*****************************************************************************/
+/* Input pins model                                                          */
+typedef enum powerpc_input_t powerpc_input_t;
+enum powerpc_input_t {
+    PPC_FLAGS_INPUT_UNKNOWN = 0,
+    /* PowerPC 6xx bus                  */
+    PPC_FLAGS_INPUT_6xx,
+    /* BookE bus                        */
+    PPC_FLAGS_INPUT_BookE,
+    /* PowerPC 405 bus                  */
+    PPC_FLAGS_INPUT_405,
+    /* PowerPC 970 bus                  */
+    PPC_FLAGS_INPUT_970,
+    /* PowerPC POWER7 bus               */
+    PPC_FLAGS_INPUT_POWER7,
+    /* PowerPC 401 bus                  */
+    PPC_FLAGS_INPUT_401,
+    /* Freescale RCPU bus               */
+    PPC_FLAGS_INPUT_RCPU,
+};
+
+struct ppc_segment_page_sizes;
 
 /**
  * PowerPCCPUClass:
@@ -74,57 +183,7 @@ typedef struct PowerPCCPUClass {
     bool (*interrupts_big_endian)(PowerPCCPU *cpu);
 } PowerPCCPUClass;
 
-/**
- * PowerPCCPU:
- * @env: #CPUPPCState
- * @cpu_dt_id: CPU index used in the device tree. KVM uses this index too
- * @max_compat: Maximal supported logical PVR from the command line
- * @cpu_version: Current logical PVR, zero if in "raw" mode
- *
- * A PowerPC CPU.
- */
-struct PowerPCCPU {
-    /*< private >*/
-    CPUState parent_obj;
-    /*< public >*/
-
-    CPUPPCState env;
-    int cpu_dt_id;
-    uint32_t max_compat;
-    uint32_t cpu_version;
-};
-
-static inline PowerPCCPU *ppc_env_get_cpu(CPUPPCState *env)
-{
-    return container_of(env, PowerPCCPU, env);
-}
-
-#define ENV_GET_CPU(e) CPU(ppc_env_get_cpu(e))
-
-#define ENV_OFFSET offsetof(PowerPCCPU, env)
-
-PowerPCCPUClass *ppc_cpu_class_by_pvr(uint32_t pvr);
-PowerPCCPUClass *ppc_cpu_class_by_pvr_mask(uint32_t pvr);
-
-void ppc_cpu_do_interrupt(CPUState *cpu);
-bool ppc_cpu_exec_interrupt(CPUState *cpu, int int_req);
-void ppc_cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf,
-                        int flags);
-void ppc_cpu_dump_statistics(CPUState *cpu, FILE *f,
-                             fprintf_function cpu_fprintf, int flags);
-int ppc_cpu_get_monitor_def(CPUState *cs, const char *name,
-                            uint64_t *pval);
-hwaddr ppc_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
-int ppc_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
-int ppc_cpu_gdb_read_register_apple(CPUState *cpu, uint8_t *buf, int reg);
-int ppc_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
-int ppc_cpu_gdb_write_register_apple(CPUState *cpu, uint8_t *buf, int reg);
-int ppc64_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs,
-                               int cpuid, void *opaque);
 #ifndef CONFIG_USER_ONLY
-void ppc_cpu_do_system_reset(CPUState *cs);
-extern const struct VMStateDescription vmstate_ppc_cpu;
-
 typedef struct PPCTimebase {
     uint64_t guest_timebase;
     int64_t time_of_the_day_ns;
target-ppc/cpu.h +52 -112

195 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#19 lore raw

[Qemu-devel] [PULL 11/52] target-m68k: make cpu-qom.h not target specific

In reply to Paolo Bonzini

Make M68KCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers.

---
 target-m68k/cpu-qom.h | 34 +---------------------------------
 target-m68k/cpu.h     | 36 ++++++++++++++++++++++++++++++++++--
 2 files changed, 35 insertions(+), 35 deletions(-)
target-m68k/cpu-qom.h +1 -33
index c28e55d..9885bba 100644
@@ -47,38 +47,6 @@ typedef struct M68kCPUClass {
     void (*parent_reset)(CPUState *cpu);
 } M68kCPUClass;
 
-/**
- * M68kCPU:
- * @env: #CPUM68KState
- *
- * A Motorola 68k CPU.
- */
-typedef struct M68kCPU {
-    /*< private >*/
-    CPUState parent_obj;
-    /*< public >*/
-
-    CPUM68KState env;
-} M68kCPU;
-
-static inline M68kCPU *m68k_env_get_cpu(CPUM68KState *env)
-{
-    return container_of(env, M68kCPU, env);
-}
-
-#define ENV_GET_CPU(e) CPU(m68k_env_get_cpu(e))
-
-#define ENV_OFFSET offsetof(M68kCPU, env)
-
-void m68k_cpu_do_interrupt(CPUState *cpu);
-bool m68k_cpu_exec_interrupt(CPUState *cpu, int int_req);
-void m68k_cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf,
-                         int flags);
-hwaddr m68k_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
-int m68k_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
-int m68k_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
-
-void m68k_cpu_exec_enter(CPUState *cs);
-void m68k_cpu_exec_exit(CPUState *cs);
+typedef struct M68kCPU M68kCPU;
 
 #endif
target-m68k/cpu.h +34 -2
index d2f467c..86a1ff0 100644
@@ -26,7 +26,7 @@
 
 #include "qemu-common.h"
 #include "exec/cpu-defs.h"
-
+#include "cpu-qom.h"
 #include "fpu/softfloat.h"
 
 #define MAX_QREGS 32
@@ -109,7 +109,39 @@ typedef struct CPUM68KState {
     uint32_t features;
 } CPUM68KState;
 
-#include "cpu-qom.h"
+/**
+ * M68kCPU:
+ * @env: #CPUM68KState
+ *
+ * A Motorola 68k CPU.
+ */
+struct M68kCPU {
+    /*< private >*/
+    CPUState parent_obj;
+    /*< public >*/
+
+    CPUM68KState env;
+};
+
+static inline M68kCPU *m68k_env_get_cpu(CPUM68KState *env)
+{
+    return container_of(env, M68kCPU, env);
+}
+
+#define ENV_GET_CPU(e) CPU(m68k_env_get_cpu(e))
+
+#define ENV_OFFSET offsetof(M68kCPU, env)
+
+void m68k_cpu_do_interrupt(CPUState *cpu);
+bool m68k_cpu_exec_interrupt(CPUState *cpu, int int_req);
+void m68k_cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf,
+                         int flags);
+hwaddr m68k_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
+int m68k_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
+int m68k_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
+
+void m68k_cpu_exec_enter(CPUState *cs);
+void m68k_cpu_exec_exit(CPUState *cs);
 
 void m68k_tcg_init(void);
 void m68k_cpu_init_gdb(M68kCPU *cpu);
Signature · 1 line
1.8.3.1
#20 lore raw

[Qemu-devel] [PULL 15/52] target-ppc: do not make PowerPCCPUClass depend on target-specific symbols

In reply to Paolo Bonzini

Just leave some members in even if they are unused on e.g. 32-bit PPC or user-mode emulation. This avoids complications when using PowerPCCPUClass in code that is compiled just once (because it applies to both 32-bit and 64-bit PPC for example) but still needs to peek at PPC-specific members.

---
 target-ppc/cpu-qom.h | 4 ----
 1 file changed, 4 deletions(-)
target-ppc/cpu-qom.h +0 -4
index bab501f..6f4e929 100644
@@ -67,14 +67,10 @@ typedef struct PowerPCCPUClass {
     uint32_t flags;
     int bfd_mach;
     uint32_t l1_dcache_size, l1_icache_size;
-#if defined(TARGET_PPC64)
     const struct ppc_segment_page_sizes *sps;
-#endif
     void (*init_proc)(CPUPPCState *env);
     int  (*check_pow)(CPUPPCState *env);
-#if defined(CONFIG_SOFTMMU)
     int (*handle_mmu_fault)(PowerPCCPU *cpu, vaddr eaddr, int rwx, int mmu_idx);
-#endif
     bool (*interrupts_big_endian)(PowerPCCPU *cpu);
 } PowerPCCPUClass;
 
Signature · 1 line
1.8.3.1
#21 lore raw

[Qemu-devel] [PULL 24/52] m68k: include cpu-qom.h in files that require M68KCPU

In reply to Paolo Bonzini

This will keep things working when cpu.h will not be included indirectly almost everywhere (either directly or through qemu-common.h).

---
 include/hw/m68k/mcf.h | 2 ++
 1 file changed, 2 insertions(+)
include/hw/m68k/mcf.h +2 -0
index fbc8dc2..0f0d228 100644
@@ -2,6 +2,8 @@
 #define HW_MCF_H
 /* Motorola ColdFire device prototypes.  */
 
+#include "target-m68k/cpu-qom.h"
+
 struct MemoryRegion;
 
 /* mcf_uart.c */
Signature · 1 line
1.8.3.1
#22 lore raw

[Qemu-devel] [PULL 26/52] alpha: include cpu-qom.h in files that require AlphaCPU

In reply to Paolo Bonzini

This will keep things working when cpu.h will not be included indirectly almost everywhere (either directly or through qemu-common.h).

---
 hw/alpha/alpha_sys.h | 1 +
 hw/alpha/pci.c       | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
hw/alpha/alpha_sys.h +1 -0
index e11025b..fcaeb2b 100644
@@ -3,6 +3,7 @@
 #ifndef HW_ALPHA_H
 #define HW_ALPHA_H 1
 
+#include "target-alpha/cpu-qom.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_host.h"
 #include "hw/ide.h"
hw/alpha/pci.c +0 -1
index 5baa0ea..8dde637 100644
@@ -8,7 +8,6 @@
 
 #include "qemu/osdep.h"
 #include "qemu-common.h"
-#include "cpu.h"
 #include "alpha_sys.h"
 #include "qemu/log.h"
 #include "sysemu/sysemu.h"
Signature · 1 line
1.8.3.1
#23 lore raw

[Qemu-devel] [PULL 32/52] explicitly include linux/kvm.h

In reply to Paolo Bonzini
---
 hw/i386/kvm/i8254.c      | 1 +
 hw/i386/kvm/pci-assign.c | 1 +
 hw/intc/xics_kvm.c       | 1 +
 hw/vfio/common.c         | 3 +++
 4 files changed, 6 insertions(+)
hw/i386/kvm/i8254.c +1 -0
index a4462e5..734992e 100644
@@ -29,6 +29,7 @@
 #include "hw/timer/i8254.h"
 #include "hw/timer/i8254_internal.h"
 #include "sysemu/kvm.h"
+#include "linux/kvm.h"
 
 #define KVM_PIT_REINJECT_BIT 0
 
hw/i386/kvm/pci-assign.c +1 -0
index bf425a2..db2cbd2 100644
@@ -33,6 +33,7 @@
 #include "sysemu/sysemu.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/msi.h"
+#include "linux/kvm.h"
 #include "kvm_i386.h"
 #include "hw/pci/pci-assign.h"
 
hw/intc/xics_kvm.c +1 -0
index 9029d9e..b40292d 100644
@@ -31,6 +31,7 @@
 #include "cpu.h"
 #include "hw/hw.h"
 #include "trace.h"
+#include "linux/kvm.h"
 #include "hw/ppc/spapr.h"
 #include "hw/ppc/xics.h"
 #include "kvm_ppc.h"
hw/vfio/common.c +3 -0
index f27db36..88154a1 100644
@@ -30,6 +30,9 @@
 #include "hw/hw.h"
 #include "qemu/error-report.h"
 #include "sysemu/kvm.h"
+#ifdef CONFIG_KVM
+#include "linux/kvm.h"
+#endif
 #include "trace.h"
 
 struct vfio_group_head vfio_group_list =
Signature · 1 line
1.8.3.1
#24 lore raw

[Qemu-devel] [PULL 28/52] ppc: use PowerPCCPU instead of CPUPPCState

In reply to Paolo Bonzini

This changes a cpu.h dependency for hw/ppc/ppc.h into a cpu-qom.h dependency. For it to compile we also need to clean up a few unused definitions.

---
 hw/ppc/ppc.c                | 20 +++++-----
 include/hw/ppc/ppc.h        | 24 +++++++-----
 target-ppc/translate_init.c | 92 +++++++++++++++++++--------------------------
 3 files changed, 63 insertions(+), 73 deletions(-)
hw/ppc/ppc.c +10 -10
index 38ff2e1..cdf9f25 100644
@@ -164,9 +164,9 @@ static void ppc6xx_set_irq(void *opaque, int pin, int level)
     }
 }
 
-void ppc6xx_irq_init(CPUPPCState *env)
+void ppc6xx_irq_init(PowerPCCPU *cpu)
 {
-    PowerPCCPU *cpu = ppc_env_get_cpu(env);
+    CPUPPCState *env = &cpu->env;
 
     env->irq_inputs = (void **)qemu_allocate_irqs(&ppc6xx_set_irq, cpu,
                                                   PPC6xx_INPUT_NB);
@@ -251,9 +251,9 @@ static void ppc970_set_irq(void *opaque, int pin, int level)
     }
 }
 
-void ppc970_irq_init(CPUPPCState *env)
+void ppc970_irq_init(PowerPCCPU *cpu)
 {
-    PowerPCCPU *cpu = ppc_env_get_cpu(env);
+    CPUPPCState *env = &cpu->env;
 
     env->irq_inputs = (void **)qemu_allocate_irqs(&ppc970_set_irq, cpu,
                                                   PPC970_INPUT_NB);
@@ -287,9 +287,9 @@ static void power7_set_irq(void *opaque, int pin, int level)
     }
 }
 
-void ppcPOWER7_irq_init(CPUPPCState *env)
+void ppcPOWER7_irq_init(PowerPCCPU *cpu)
 {
-    PowerPCCPU *cpu = ppc_env_get_cpu(env);
+    CPUPPCState *env = &cpu->env;
 
     env->irq_inputs = (void **)qemu_allocate_irqs(&power7_set_irq, cpu,
                                                   POWER7_INPUT_NB);
@@ -372,9 +372,9 @@ static void ppc40x_set_irq(void *opaque, int pin, int level)
     }
 }
 
-void ppc40x_irq_init(CPUPPCState *env)
+void ppc40x_irq_init(PowerPCCPU *cpu)
 {
-    PowerPCCPU *cpu = ppc_env_get_cpu(env);
+    CPUPPCState *env = &cpu->env;
 
     env->irq_inputs = (void **)qemu_allocate_irqs(&ppc40x_set_irq,
                                                   cpu, PPC40x_INPUT_NB);
@@ -436,9 +436,9 @@ static void ppce500_set_irq(void *opaque, int pin, int level)
     }
 }
 
-void ppce500_irq_init(CPUPPCState *env)
+void ppce500_irq_init(PowerPCCPU *cpu)
 {
-    PowerPCCPU *cpu = ppc_env_get_cpu(env);
+    CPUPPCState *env = &cpu->env;
 
     env->irq_inputs = (void **)qemu_allocate_irqs(&ppce500_set_irq,
                                                   cpu, PPCE500_INPUT_NB);
include/hw/ppc/ppc.h +15 -9
index 14efd0c..5617dc4 100644
@@ -1,6 +1,8 @@
 #ifndef HW_PPC_H
 #define HW_PPC_H 1
 
+#include "target-ppc/cpu-qom.h"
+
 void ppc_set_irq(PowerPCCPU *cpu, int n_IRQ, int level);
 
 /* PowerPC hardware exceptions management helpers */
@@ -64,17 +66,21 @@ clk_setup_cb ppc_40x_timers_init (CPUPPCState *env, uint32_t freq,
 void ppc40x_core_reset(PowerPCCPU *cpu);
 void ppc40x_chip_reset(PowerPCCPU *cpu);
 void ppc40x_system_reset(PowerPCCPU *cpu);
-void PREP_debug_write (void *opaque, uint32_t addr, uint32_t val);
-
-extern CPUWriteMemoryFunc * const PPC_io_write[];
-extern CPUReadMemoryFunc * const PPC_io_read[];
 void PPC_debug_write (void *opaque, uint32_t addr, uint32_t val);
 
-void ppc40x_irq_init (CPUPPCState *env);
-void ppce500_irq_init (CPUPPCState *env);
-void ppc6xx_irq_init (CPUPPCState *env);
-void ppc970_irq_init (CPUPPCState *env);
-void ppcPOWER7_irq_init (CPUPPCState *env);
+#if defined(CONFIG_USER_ONLY)
+static inline void ppc40x_irq_init(PowerPCCPU *cpu) {}
+static inline void ppc6xx_irq_init(PowerPCCPU *cpu) {}
+static inline void ppc970_irq_init(PowerPCCPU *cpu) {}
+static inline void ppcPOWER7_irq_init(PowerPCCPU *cpu) {}
+static inline void ppce500_irq_init(PowerPCCPU *cpu) {}
+#else
+void ppc40x_irq_init(PowerPCCPU *cpu);
+void ppce500_irq_init(PowerPCCPU *cpu);
+void ppc6xx_irq_init(PowerPCCPU *cpu);
+void ppc970_irq_init(PowerPCCPU *cpu);
+void ppcPOWER7_irq_init(PowerPCCPU *cpu);
+#endif
 
 /* PPC machines for OpenBIOS */
 enum {
target-ppc/translate_init.c +38 -54

324 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#25 lore raw

[Qemu-devel] [PULL 35/52] hw: do not use VMSTATE_*TL

In reply to Paolo Bonzini

Reserve this to CPU state serialization.

Luckily, they were only used by sPAPR devices and these are ppc64 only. So there is no change to migration format.

---
 hw/net/spapr_llan.c        | 8 ++++----
 hw/ppc/spapr_vio.c         | 2 +-
 include/hw/ppc/spapr_vio.h | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
hw/net/spapr_llan.c +4 -4
index a647f25..db97da3 100644
@@ -106,9 +106,9 @@ typedef struct VIOsPAPRVLANDevice {
     NICConf nicconf;
     NICState *nic;
     bool isopen;
-    target_ulong buf_list;
+    hwaddr buf_list;
     uint32_t add_buf_ptr, use_buf_ptr, rx_bufs;
-    target_ulong rxq_ptr;
+    hwaddr rxq_ptr;
     uint32_t compat_flags;             /* Compatability flags for migration */
     RxBufPool *rx_pool[RX_MAX_POOLS];  /* Receive buffer descriptor pools */
 } VIOsPAPRVLANDevice;
@@ -765,11 +765,11 @@ static const VMStateDescription vmstate_spapr_llan = {
         VMSTATE_SPAPR_VIO(sdev, VIOsPAPRVLANDevice),
         /* LLAN state */
         VMSTATE_BOOL(isopen, VIOsPAPRVLANDevice),
-        VMSTATE_UINTTL(buf_list, VIOsPAPRVLANDevice),
+        VMSTATE_UINT64(buf_list, VIOsPAPRVLANDevice),
         VMSTATE_UINT32(add_buf_ptr, VIOsPAPRVLANDevice),
         VMSTATE_UINT32(use_buf_ptr, VIOsPAPRVLANDevice),
         VMSTATE_UINT32(rx_bufs, VIOsPAPRVLANDevice),
-        VMSTATE_UINTTL(rxq_ptr, VIOsPAPRVLANDevice),
+        VMSTATE_UINT64(rxq_ptr, VIOsPAPRVLANDevice),
 
         VMSTATE_END_OF_LIST()
     },
hw/ppc/spapr_vio.c +1 -1
index 8aa021f..6b20b40 100644
@@ -584,7 +584,7 @@ const VMStateDescription vmstate_spapr_vio = {
         VMSTATE_UINT32_EQUAL(irq, VIOsPAPRDevice),
 
         /* General VIO device state */
-        VMSTATE_UINTTL(signal_state, VIOsPAPRDevice),
+        VMSTATE_UINT64(signal_state, VIOsPAPRDevice),
         VMSTATE_UINT64(crq.qladdr, VIOsPAPRDevice),
         VMSTATE_UINT32(crq.qsize, VIOsPAPRDevice),
         VMSTATE_UINT32(crq.qnext, VIOsPAPRDevice),
include/hw/ppc/spapr_vio.h +1 -1
index c9733e7..5f8b042 100644
@@ -61,7 +61,7 @@ struct VIOsPAPRDevice {
     DeviceState qdev;
     uint32_t reg;
     uint32_t irq;
-    target_ulong signal_state;
+    uint64_t signal_state;
     VIOsPAPR_CRQ crq;
     AddressSpace as;
     MemoryRegion mrroot;
Signature · 1 line
1.8.3.1
#26 lore raw

[Qemu-devel] [PULL 19/52] target-sparc: make cpu-qom.h not target specific

In reply to Paolo Bonzini

Make SPARCCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers.

---
 target-sparc/cpu-qom.h | 37 +------------------------------------
 target-sparc/cpu.h     | 38 +++++++++++++++++++++++++++++++++++++-
 2 files changed, 38 insertions(+), 37 deletions(-)
target-sparc/cpu-qom.h +1 -36
index 174dfd3..f63af72 100644
@@ -51,41 +51,6 @@ typedef struct SPARCCPUClass {
     void (*parent_reset)(CPUState *cpu);
 } SPARCCPUClass;
 
-/**
- * SPARCCPU:
- * @env: #CPUSPARCState
- *
- * A SPARC CPU.
- */
-typedef struct SPARCCPU {
-    /*< private >*/
-    CPUState parent_obj;
-    /*< public >*/
-
-    CPUSPARCState env;
-} SPARCCPU;
-
-static inline SPARCCPU *sparc_env_get_cpu(CPUSPARCState *env)
-{
-    return container_of(env, SPARCCPU, env);
-}
-
-#define ENV_GET_CPU(e) CPU(sparc_env_get_cpu(e))
-
-#define ENV_OFFSET offsetof(SPARCCPU, env)
-
-#ifndef CONFIG_USER_ONLY
-extern const struct VMStateDescription vmstate_sparc_cpu;
-#endif
-
-void sparc_cpu_do_interrupt(CPUState *cpu);
-void sparc_cpu_dump_state(CPUState *cpu, FILE *f,
-                          fprintf_function cpu_fprintf, int flags);
-hwaddr sparc_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
-int sparc_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
-int sparc_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
-void QEMU_NORETURN sparc_cpu_do_unaligned_access(CPUState *cpu,
-                                                 vaddr addr, int is_write,
-                                                 int is_user, uintptr_t retaddr);
+typedef struct SPARCCPU SPARCCPU;
 
 #endif
target-sparc/cpu.h +37 -1
index 59ec7ca..0141994 100644
@@ -3,6 +3,7 @@
 
 #include "qemu-common.h"
 #include "qemu/bswap.h"
+#include "cpu-qom.h"
 
 #define ALIGNED_ONLY
 
@@ -506,7 +507,42 @@ struct CPUSPARCState {
     uint32_t cache_control;
 };
 
-#include "cpu-qom.h"
+/**
+ * SPARCCPU:
+ * @env: #CPUSPARCState
+ *
+ * A SPARC CPU.
+ */
+struct SPARCCPU {
+    /*< private >*/
+    CPUState parent_obj;
+    /*< public >*/
+
+    CPUSPARCState env;
+};
+
+static inline SPARCCPU *sparc_env_get_cpu(CPUSPARCState *env)
+{
+    return container_of(env, SPARCCPU, env);
+}
+
+#define ENV_GET_CPU(e) CPU(sparc_env_get_cpu(e))
+
+#define ENV_OFFSET offsetof(SPARCCPU, env)
+
+#ifndef CONFIG_USER_ONLY
+extern const struct VMStateDescription vmstate_sparc_cpu;
+#endif
+
+void sparc_cpu_do_interrupt(CPUState *cpu);
+void sparc_cpu_dump_state(CPUState *cpu, FILE *f,
+                          fprintf_function cpu_fprintf, int flags);
+hwaddr sparc_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
+int sparc_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
+int sparc_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
+void QEMU_NORETURN sparc_cpu_do_unaligned_access(CPUState *cpu,
+                                                 vaddr addr, int is_write,
+                                                 int is_user, uintptr_t retaddr);
 
 #ifndef NO_CPU_IO_DEFS
 /* cpu_init.c */
Signature · 1 line
1.8.3.1
#27 lore raw

[Qemu-devel] [PULL 20/52] target-tricore: make cpu-qom.h not target specific

In reply to Paolo Bonzini

Make TriCoreCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers.

---
 target-tricore/cpu-qom.h | 28 +---------------------------
 target-tricore/cpu.h     | 30 +++++++++++++++++++++++++++++-
 2 files changed, 30 insertions(+), 28 deletions(-)
target-tricore/cpu-qom.h +1 -27
index 66c9664..399c98f 100644
@@ -39,32 +39,6 @@ typedef struct TriCoreCPUClass {
     void (*parent_reset)(CPUState *cpu);
 } TriCoreCPUClass;
 
-/**
- * TriCoreCPU:
- * @env: #CPUTriCoreState
- *
- * A TriCore CPU.
- */
-typedef struct TriCoreCPU {
-    /*< private >*/
-    CPUState parent_obj;
-    /*< public >*/
-
-    CPUTriCoreState env;
-} TriCoreCPU;
-
-static inline TriCoreCPU *tricore_env_get_cpu(CPUTriCoreState *env)
-{
-    return TRICORE_CPU(container_of(env, TriCoreCPU, env));
-}
-
-#define ENV_GET_CPU(e) CPU(tricore_env_get_cpu(e))
-
-#define ENV_OFFSET offsetof(TriCoreCPU, env)
-
-hwaddr tricore_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
-void tricore_cpu_dump_state(CPUState *cpu, FILE *f,
-                            fprintf_function cpu_fprintf, int flags);
-
+typedef struct TriCoreCPU TriCoreCPU;
 
 #endif /*QEMU_TRICORE_CPU_QOM_H */
target-tricore/cpu.h +29 -1
index eaebdd2..a48340f 100644
@@ -21,6 +21,7 @@
 
 #include "tricore-defs.h"
 #include "qemu-common.h"
+#include "cpu-qom.h"
 #include "exec/cpu-defs.h"
 #include "fpu/softfloat.h"
 
@@ -198,6 +199,34 @@ struct CPUTriCoreState {
     struct QEMUTimer *timer; /* Internal timer */
 };
 
+/**
+ * TriCoreCPU:
+ * @env: #CPUTriCoreState
+ *
+ * A TriCore CPU.
+ */
+struct TriCoreCPU {
+    /*< private >*/
+    CPUState parent_obj;
+    /*< public >*/
+
+    CPUTriCoreState env;
+};
+
+static inline TriCoreCPU *tricore_env_get_cpu(CPUTriCoreState *env)
+{
+    return TRICORE_CPU(container_of(env, TriCoreCPU, env));
+}
+
+#define ENV_GET_CPU(e) CPU(tricore_env_get_cpu(e))
+
+#define ENV_OFFSET offsetof(TriCoreCPU, env)
+
+hwaddr tricore_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
+void tricore_cpu_dump_state(CPUState *cpu, FILE *f,
+                            fprintf_function cpu_fprintf, int flags);
+
+
 #define MASK_PCXI_PCPN 0xff000000
 #define MASK_PCXI_PIE  0x00800000
 #define MASK_PCXI_UL   0x00400000
@@ -341,7 +370,6 @@ void psw_write(CPUTriCoreState *env, uint32_t val);
 
 void fpu_set_state(CPUTriCoreState *env);
 
-#include "cpu-qom.h"
 #define MMU_USER_IDX 2
 
 void tricore_cpu_list(FILE *f, fprintf_function cpu_fprintf);
Signature · 1 line
1.8.3.1
#28 lore raw

[Qemu-devel] [PULL 21/52] target-unicore32: make cpu-qom.h not target specific

In reply to Paolo Bonzini

Make UniCore32CPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers.

---
 target-unicore32/cpu-qom.h | 29 +----------------------------
 target-unicore32/cpu.h     | 31 ++++++++++++++++++++++++++++++-
 2 files changed, 31 insertions(+), 29 deletions(-)
target-unicore32/cpu-qom.h +1 -28
index e554f1f..bc68e78 100644
@@ -36,33 +36,6 @@ typedef struct UniCore32CPUClass {
     DeviceRealize parent_realize;
 } UniCore32CPUClass;
 
-/**
- * UniCore32CPU:
- * @env: #CPUUniCore32State
- *
- * A UniCore32 CPU.
- */
-typedef struct UniCore32CPU {
-    /*< private >*/
-    CPUState parent_obj;
-    /*< public >*/
-
-    CPUUniCore32State env;
-} UniCore32CPU;
-
-static inline UniCore32CPU *uc32_env_get_cpu(CPUUniCore32State *env)
-{
-    return container_of(env, UniCore32CPU, env);
-}
-
-#define ENV_GET_CPU(e) CPU(uc32_env_get_cpu(e))
-
-#define ENV_OFFSET offsetof(UniCore32CPU, env)
-
-void uc32_cpu_do_interrupt(CPUState *cpu);
-bool uc32_cpu_exec_interrupt(CPUState *cpu, int int_req);
-void uc32_cpu_dump_state(CPUState *cpu, FILE *f,
-                         fprintf_function cpu_fprintf, int flags);
-hwaddr uc32_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
+typedef struct UniCore32CPU UniCore32CPU;
 
 #endif
target-unicore32/cpu.h +30 -1
index e64cb7e..7099509 100644
@@ -20,6 +20,7 @@
 #define CPUArchState                struct CPUUniCore32State
 
 #include "qemu-common.h"
+#include "cpu-qom.h"
 #include "exec/cpu-defs.h"
 #include "fpu/softfloat.h"
 
@@ -71,6 +72,35 @@ typedef struct CPUUniCore32State {
 
 } CPUUniCore32State;
 
+/**
+ * UniCore32CPU:
+ * @env: #CPUUniCore32State
+ *
+ * A UniCore32 CPU.
+ */
+struct UniCore32CPU {
+    /*< private >*/
+    CPUState parent_obj;
+    /*< public >*/
+
+    CPUUniCore32State env;
+};
+
+static inline UniCore32CPU *uc32_env_get_cpu(CPUUniCore32State *env)
+{
+    return container_of(env, UniCore32CPU, env);
+}
+
+#define ENV_GET_CPU(e) CPU(uc32_env_get_cpu(e))
+
+#define ENV_OFFSET offsetof(UniCore32CPU, env)
+
+void uc32_cpu_do_interrupt(CPUState *cpu);
+bool uc32_cpu_exec_interrupt(CPUState *cpu, int int_req);
+void uc32_cpu_dump_state(CPUState *cpu, FILE *f,
+                         fprintf_function cpu_fprintf, int flags);
+hwaddr uc32_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
+
 #define ASR_M                   (0x1f)
 #define ASR_MODE_USER           (0x10)
 #define ASR_MODE_INTR           (0x12)
@@ -134,7 +164,6 @@ static inline int cpu_mmu_index(CPUUniCore32State *env, bool ifetch)
 }
 
 #include "exec/cpu-all.h"
-#include "cpu-qom.h"
 #include "exec/exec-all.h"
 
 int uc32_cpu_exec(CPUState *s);
Signature · 1 line
1.8.3.1
#29 lore raw

[Qemu-devel] [PULL 22/52] target-xtensa: make cpu-qom.h not target specific

In reply to Paolo Bonzini

Make XtensaCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. Conversely, move all definitions needed to define a class to cpu-qom.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers.

---
 target-xtensa/cpu-qom.h | 38 +++-----------------------------------
 target-xtensa/cpu.h     | 37 ++++++++++++++++++++++++++++++++++++-
 2 files changed, 39 insertions(+), 36 deletions(-)
target-xtensa/cpu-qom.h +3 -35
index f5d9b9f..403bd95 100644
@@ -40,6 +40,8 @@
 #define XTENSA_CPU_GET_CLASS(obj) \
     OBJECT_GET_CLASS(XtensaCPUClass, (obj), TYPE_XTENSA_CPU)
 
+typedef struct XtensaConfig XtensaConfig;
+
 /**
  * XtensaCPUClass:
  * @parent_realize: The parent class' realize handler.
@@ -59,40 +61,6 @@ typedef struct XtensaCPUClass {
     const XtensaConfig *config;
 } XtensaCPUClass;
 
-/**
- * XtensaCPU:
- * @env: #CPUXtensaState
- *
- * An Xtensa CPU.
- */
-typedef struct XtensaCPU {
-    /*< private >*/
-    CPUState parent_obj;
-    /*< public >*/
-
-    CPUXtensaState env;
-} XtensaCPU;
-
-static inline XtensaCPU *xtensa_env_get_cpu(const CPUXtensaState *env)
-{
-    return container_of(env, XtensaCPU, env);
-}
-
-#define ENV_GET_CPU(e) CPU(xtensa_env_get_cpu(e))
-
-#define ENV_OFFSET offsetof(XtensaCPU, env)
-
-void xtensa_cpu_do_interrupt(CPUState *cpu);
-bool xtensa_cpu_exec_interrupt(CPUState *cpu, int interrupt_request);
-void xtensa_cpu_do_unassigned_access(CPUState *cpu, hwaddr addr,
-                                     bool is_write, bool is_exec, int opaque,
-                                     unsigned size);
-void xtensa_cpu_dump_state(CPUState *cpu, FILE *f,
-                           fprintf_function cpu_fprintf, int flags);
-hwaddr xtensa_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
-int xtensa_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
-int xtensa_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
-void xtensa_cpu_do_unaligned_access(CPUState *cpu, vaddr addr,
-                                    int is_write, int is_user, uintptr_t retaddr);
+typedef struct XtensaCPU XtensaCPU;
 
 #endif
target-xtensa/cpu.h +36 -1
index 7bfc9c8..98dd3e1 100644
@@ -34,6 +34,7 @@
 #define CPUArchState struct CPUXtensaState
 
 #include "qemu-common.h"
+#include "cpu-qom.h"
 #include "exec/cpu-defs.h"
 #include "fpu/softfloat.h"
 
@@ -379,7 +380,41 @@ typedef struct CPUXtensaState {
     CPU_COMMON
 } CPUXtensaState;
 
-#include "cpu-qom.h"
+/**
+ * XtensaCPU:
+ * @env: #CPUXtensaState
+ *
+ * An Xtensa CPU.
+ */
+struct XtensaCPU {
+    /*< private >*/
+    CPUState parent_obj;
+    /*< public >*/
+
+    CPUXtensaState env;
+};
+
+static inline XtensaCPU *xtensa_env_get_cpu(const CPUXtensaState *env)
+{
+    return container_of(env, XtensaCPU, env);
+}
+
+#define ENV_GET_CPU(e) CPU(xtensa_env_get_cpu(e))
+
+#define ENV_OFFSET offsetof(XtensaCPU, env)
+
+void xtensa_cpu_do_interrupt(CPUState *cpu);
+bool xtensa_cpu_exec_interrupt(CPUState *cpu, int interrupt_request);
+void xtensa_cpu_do_unassigned_access(CPUState *cpu, hwaddr addr,
+                                     bool is_write, bool is_exec, int opaque,
+                                     unsigned size);
+void xtensa_cpu_dump_state(CPUState *cpu, FILE *f,
+                           fprintf_function cpu_fprintf, int flags);
+hwaddr xtensa_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
+int xtensa_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
+int xtensa_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
+void xtensa_cpu_do_unaligned_access(CPUState *cpu, vaddr addr,
+                                    int is_write, int is_user, uintptr_t retaddr);
 
 #define cpu_exec cpu_xtensa_exec
 #define cpu_signal_handler cpu_xtensa_signal_handler
Signature · 1 line
1.8.3.1
#30 lore raw

[Qemu-devel] [PULL 27/52] mips: use MIPSCPU instead of CPUMIPSState

In reply to Paolo Bonzini

This changes a cpu.h dependency into a cpu-qom.h dependency.

---
 hw/mips/cps.c             | 7 ++++---
 hw/mips/cputimer.c        | 4 +++-
 hw/mips/mips_fulong2e.c   | 4 ++--
 hw/mips/mips_int.c        | 3 ++-
 hw/mips/mips_jazz.c       | 4 ++--
 hw/mips/mips_malta.c      | 5 ++---
 hw/mips/mips_mipssim.c    | 4 ++--
 hw/mips/mips_r4k.c        | 4 ++--
 include/hw/mips/cpudevs.h | 7 +++++--
 9 files changed, 24 insertions(+), 18 deletions(-)
hw/mips/cps.c +4 -3
index 1bafbbb..61208f8 100644
@@ -81,11 +81,12 @@ static void mips_cps_realize(DeviceState *dev, Error **errp)
             error_setg(errp, "%s: CPU initialization failed\n",  __func__);
             return;
         }
-        env = &cpu->env;
 
         /* Init internal devices */
-        cpu_mips_irq_init_cpu(env);
-        cpu_mips_clock_init(env);
+        cpu_mips_irq_init_cpu(cpu);
+        cpu_mips_clock_init(cpu);
+
+        env = &cpu->env;
         if (cpu_mips_itu_supported(env)) {
             itu_present = true;
             /* Attach ITC Tag to the VP */
hw/mips/cputimer.c +3 -1
index efb227d..8a166b3 100644
@@ -151,8 +151,10 @@ static void mips_timer_cb (void *opaque)
     env->CP0_Count--;
 }
 
-void cpu_mips_clock_init (CPUMIPSState *env)
+void cpu_mips_clock_init (MIPSCPU *cpu)
 {
+    CPUMIPSState *env = &cpu->env;
+
     /*
      * If we're in KVM mode, don't create the periodic timer, that is handled in
      * kernel.
hw/mips/mips_fulong2e.c +2 -2
index bdb716e7..889cdc7 100644
@@ -334,8 +334,8 @@ static void mips_fulong2e_init(MachineState *machine)
     }
 
     /* Init internal devices */
-    cpu_mips_irq_init_cpu(env);
-    cpu_mips_clock_init(env);
+    cpu_mips_irq_init_cpu(cpu);
+    cpu_mips_clock_init(cpu);
 
     /* North bridge, Bonito --> IP2 */
     pci_bus = bonito_init((qemu_irq *)&(env->irq[2]));
hw/mips/mips_int.c +2 -1
index 59081f9..48192d2 100644
@@ -58,8 +58,9 @@ static void cpu_mips_irq_request(void *opaque, int irq, int level)
     }
 }
 
-void cpu_mips_irq_init_cpu(CPUMIPSState *env)
+void cpu_mips_irq_init_cpu(MIPSCPU *cpu)
 {
+    CPUMIPSState *env = &cpu->env;
     qemu_irq *qi;
     int i;
 
hw/mips/mips_jazz.c +2 -2
index ac7c641..73f6c9f 100644
@@ -201,8 +201,8 @@ static void mips_jazz_init(MachineState *machine,
     }
 
     /* Init CPU internal devices */
-    cpu_mips_irq_init_cpu(env);
-    cpu_mips_clock_init(env);
+    cpu_mips_irq_init_cpu(cpu);
+    cpu_mips_clock_init(cpu);
 
     /* Chipset */
     rc4030 = rc4030_init(&dmas, &rc4030_dma_mr);
hw/mips/mips_malta.c +2 -3
index fa769e5..5c8ba44 100644
@@ -923,11 +923,10 @@ static void create_cpu_without_cps(const char *cpu_model,
             fprintf(stderr, "Unable to find CPU definition\n");
             exit(1);
         }
-        env = &cpu->env;
 
         /* Init internal devices */
-        cpu_mips_irq_init_cpu(env);
-        cpu_mips_clock_init(env);
+        cpu_mips_irq_init_cpu(cpu);
+        cpu_mips_clock_init(cpu);
         qemu_register_reset(main_cpu_reset, cpu);
     }
 
hw/mips/mips_mipssim.c +2 -2
index a2c2a16..1b91195 100644
@@ -216,8 +216,8 @@ mips_mipssim_init(MachineState *machine)
     }
 
     /* Init CPU internal devices. */
-    cpu_mips_irq_init_cpu(env);
-    cpu_mips_clock_init(env);
+    cpu_mips_irq_init_cpu(cpu);
+    cpu_mips_clock_init(cpu);
 
     /* Register 64 KB of ISA IO space at 0x1fd00000. */
     memory_region_init_alias(isa, NULL, "isa_mmio",
hw/mips/mips_r4k.c +2 -2
index 21aca98..16a59c7 100644
@@ -267,8 +267,8 @@ void mips_r4k_init(MachineState *machine)
     }
 
     /* Init CPU internal devices */
-    cpu_mips_irq_init_cpu(env);
-    cpu_mips_clock_init(env);
+    cpu_mips_irq_init_cpu(cpu);
+    cpu_mips_clock_init(cpu);
 
     /* ISA bus: IO space at 0x14000000, mem space at 0x10000000 */
     memory_region_init_alias(isa_io, NULL, "isa-io",
include/hw/mips/cpudevs.h +5 -2
index b2626f2..8673daa 100644
@@ -1,5 +1,8 @@
 #ifndef HW_MIPS_CPUDEVS_H
 #define HW_MIPS_CPUDEVS_H
+
+#include "target-mips/cpu-qom.h"
+
 /* Definitions for MIPS CPU internal devices.  */
 
 /* mips_addr.c */
@@ -9,9 +12,9 @@ uint64_t cpu_mips_kvm_um_phys_to_kseg0(void *opaque, uint64_t addr);
 
 
 /* mips_int.c */
-void cpu_mips_irq_init_cpu(CPUMIPSState *env);
+void cpu_mips_irq_init_cpu(MIPSCPU *cpu);
 
 /* mips_timer.c */
-void cpu_mips_clock_init(CPUMIPSState *);
+void cpu_mips_clock_init(MIPSCPU *cpu);
 
 #endif
Signature · 1 line
1.8.3.1
#31 lore raw

[Qemu-devel] [PULL 33/52] apic: move target-dependent definitions to cpu.h

In reply to Paolo Bonzini
---
 hw/intc/ioapic.c       | 1 +
 include/hw/i386/apic.h | 5 -----
 target-i386/cpu.h      | 7 +++++++
 3 files changed, 8 insertions(+), 5 deletions(-)
hw/intc/ioapic.c +1 -0
index 378e663..4f42b91 100644
@@ -24,6 +24,7 @@
 #include "monitor/monitor.h"
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
+#include "hw/i386/apic.h"
 #include "hw/i386/ioapic.h"
 #include "hw/i386/ioapic_internal.h"
 #include "include/hw/pci/msi.h"
include/hw/i386/apic.h +0 -5
index 51eb6d3..ea48ea9 100644
@@ -18,15 +18,10 @@ void cpu_set_apic_tpr(DeviceState *s, uint8_t val);
 uint8_t cpu_get_apic_tpr(DeviceState *s);
 void apic_init_reset(DeviceState *s);
 void apic_sipi(DeviceState *s);
-void apic_handle_tpr_access_report(DeviceState *d, target_ulong ip,
-                                   TPRAccess access);
 void apic_poll_irq(DeviceState *d);
 void apic_designate_bsp(DeviceState *d, bool bsp);
 
 /* pc.c */
 DeviceState *cpu_get_current_apic(void);
 
-/* cpu.c */
-bool cpu_is_bsp(X86CPU *cpu);
-
 #endif
target-i386/cpu.h +7 -0
index 93b5cd0..bc8c3fb 100644
@@ -1455,7 +1455,11 @@ void do_interrupt_x86_hardirq(CPUX86State *env, int intno, int is_hw);
 void do_smm_enter(X86CPU *cpu);
 void cpu_smm_update(X86CPU *cpu);
 
+/* apic.c */
 void cpu_report_tpr_access(CPUX86State *env, TPRAccess access);
+void apic_handle_tpr_access_report(DeviceState *d, target_ulong ip,
+                                   TPRAccess access);
+
 
 /* Change the value of a KVM-specific default
  *
@@ -1481,4 +1485,7 @@ void enable_compat_apic_id_mode(void);
 void x86_cpu_dump_local_apic_state(CPUState *cs, FILE *f,
                                    fprintf_function cpu_fprintf, int flags);
 
+/* cpu.c */
+bool cpu_is_bsp(X86CPU *cpu);
+
 #endif /* CPU_I386_H */
Signature · 1 line
1.8.3.1
#32 lore raw

[Qemu-devel] [PULL 34/52] include: poison symbols in osdep.h

In reply to Paolo Bonzini

Ensure that all target-independent files ignore poisoned symbols, and fix the fallout.

---
 hw/core/Makefile.objs      |  2 +-
 include/exec/cpu-common.h  |  4 ----
 include/exec/helper-head.h | 23 +++++++++++++----------
 include/qemu/osdep.h       |  2 ++
 scripts/create_config      |  2 +-
 5 files changed, 17 insertions(+), 16 deletions(-)
hw/core/Makefile.objs +1 -1
index abb3560..70951d4 100644
@@ -4,7 +4,7 @@ common-obj-y += fw-path-provider.o
 # irq.o needed for qdev GPIO handling:
 common-obj-y += irq.o
 common-obj-y += hotplug.o
-common-obj-y += nmi.o
+obj-y += nmi.o
 
 common-obj-$(CONFIG_EMPTY_SLOT) += empty_slot.o
 common-obj-$(CONFIG_XILINX_AXI) += stream.o
include/exec/cpu-common.h +0 -4
index 9e839e5..4f59034 100644
@@ -7,10 +7,6 @@
 #include "exec/hwaddr.h"
 #endif
 
-#ifndef NEED_CPU_H
-#include "exec/poison.h"
-#endif
-
 #include "qemu/bswap.h"
 #include "qemu/queue.h"
 #include "qemu/fprintf-fn.h"
include/exec/helper-head.h +13 -10
index ec79043..74f8f03 100644
@@ -33,17 +33,9 @@
 #define dh_alias_s64 i64
 #define dh_alias_f32 i32
 #define dh_alias_f64 i64
-#ifdef TARGET_LONG_BITS
-# if TARGET_LONG_BITS == 32
-#  define dh_alias_tl i32
-# else
-#  define dh_alias_tl i64
-# endif
-#endif
 #define dh_alias_ptr ptr
 #define dh_alias_void void
 #define dh_alias_noreturn noreturn
-#define dh_alias_env ptr
 #define dh_alias(t) glue(dh_alias_, t)
 
 #define dh_ctype_i32 uint32_t
@@ -53,13 +45,24 @@
 #define dh_ctype_s64 int64_t
 #define dh_ctype_f32 float32
 #define dh_ctype_f64 float64
-#define dh_ctype_tl target_ulong
 #define dh_ctype_ptr void *
 #define dh_ctype_void void
 #define dh_ctype_noreturn void QEMU_NORETURN
-#define dh_ctype_env CPUArchState *
 #define dh_ctype(t) dh_ctype_##t
 
+#ifdef NEED_CPU_H
+# ifdef TARGET_LONG_BITS
+#  if TARGET_LONG_BITS == 32
+#   define dh_alias_tl i32
+#  else
+#   define dh_alias_tl i64
+#  endif
+# endif
+# define dh_alias_env ptr
+# define dh_ctype_tl target_ulong
+# define dh_ctype_env CPUArchState *
+#endif
+
 /* We can't use glue() here because it falls foul of C preprocessor
    recursive expansion rules.  */
 #define dh_retvar_decl0_void void
include/qemu/osdep.h +2 -0
index 2e930a9..268ec66 100644
@@ -30,6 +30,8 @@
 #include "config-host.h"
 #ifdef NEED_CPU_H
 #include "config-target.h"
+#else
+#include "exec/poison.h"
 #endif
 #include "qemu/compiler.h"
 
scripts/create_config +1 -1
index 9cb176f..b2d2ebb 100755
@@ -52,7 +52,7 @@ case $line in
     done
     echo "    NULL"
     ;;
- CONFIG_*=y) # configuration
+ CONFIG_*='$(CONFIG_SOFTMMU)'|CONFIG_*=y) # configuration
     name=${line%=*}
     echo "#define $name 1"
     ;;
Signature · 1 line
1.8.3.1
#33 lore raw

[Qemu-devel] [PULL 37/52] hw: cannot include hw/hw.h from user emulation

In reply to Paolo Bonzini

All qdev definitions are available from other headers, user-mode emulation does not need hw/hw.h.

By considering system emulation only, it is simpler to disentangle hw/hw.h from NEED_CPU_H.

---
 exec.c                     | 21 +++++++++++----------
 include/hw/hw.h            |  5 +++--
 include/hw/ppc/openpic.h   |  2 +-
 kvm-stub.c                 |  1 -
 target-i386/cpu.c          |  2 +-
 target-s390x/cpu.c         |  3 ++-
 target-s390x/mem_helper.c  |  3 +++
 target-s390x/misc_helper.c |  2 +-
 8 files changed, 22 insertions(+), 17 deletions(-)
exec.c +11 -10
index ee45472..ed10ba1 100644
@@ -25,23 +25,23 @@
 #include "qemu/cutils.h"
 #include "cpu.h"
 #include "tcg.h"
-#include "hw/hw.h"
+#include "hw/qdev-core.h"
 #if !defined(CONFIG_USER_ONLY)
 #include "hw/boards.h"
 #endif
-#include "hw/qdev.h"
 #include "sysemu/kvm.h"
 #include "sysemu/sysemu.h"
 #include "hw/xen/xen.h"
 #include "qemu/timer.h"
 #include "qemu/config-file.h"
 #include "qemu/error-report.h"
-#include "exec/memory.h"
-#include "sysemu/dma.h"
-#include "exec/address-spaces.h"
 #if defined(CONFIG_USER_ONLY)
 #include <qemu.h>
 #else /* !CONFIG_USER_ONLY */
+#include "hw/hw.h"
+#include "exec/memory.h"
+#include "sysemu/dma.h"
+#include "exec/address-spaces.h"
 #include "sysemu/xen-mapcache.h"
 #include "trace.h"
 #endif
@@ -641,7 +641,6 @@ void cpu_exec_exit(CPUState *cpu)
 void cpu_exec_init(CPUState *cpu, Error **errp)
 {
     CPUClass *cc = CPU_GET_CLASS(cpu);
-    int cpu_index;
     Error *local_err = NULL;
 
     cpu->as = NULL;
@@ -668,7 +667,7 @@ void cpu_exec_init(CPUState *cpu, Error **errp)
 #if defined(CONFIG_USER_ONLY)
     cpu_list_lock();
 #endif
-    cpu_index = cpu->cpu_index = cpu_get_free_index(&local_err);
+    cpu->cpu_index = cpu_get_free_index(&local_err);
     if (local_err) {
         error_propagate(errp, local_err);
 #if defined(CONFIG_USER_ONLY)
@@ -678,14 +677,16 @@ void cpu_exec_init(CPUState *cpu, Error **errp)
     }
     QTAILQ_INSERT_TAIL(&cpus, cpu, node);
 #if defined(CONFIG_USER_ONLY)
+    (void) cc;
     cpu_list_unlock();
-#endif
+#else
     if (qdev_get_vmsd(DEVICE(cpu)) == NULL) {
-        vmstate_register(NULL, cpu_index, &vmstate_cpu_common, cpu);
+        vmstate_register(NULL, cpu->cpu_index, &vmstate_cpu_common, cpu);
     }
     if (cc->vmsd != NULL) {
-        vmstate_register(NULL, cpu_index, cc->vmsd, cpu);
+        vmstate_register(NULL, cpu->cpu_index, cc->vmsd, cpu);
     }
+#endif
 }
 
 #if defined(CONFIG_USER_ONLY)
include/hw/hw.h +3 -2
index 0456fc3..29931d1 100644
@@ -3,10 +3,11 @@
 #define QEMU_HW_H
 
 
-#if !defined(CONFIG_USER_ONLY) && !defined(NEED_CPU_H)
-#include "exec/cpu-common.h"
+#ifdef CONFIG_USER_ONLY
+#error Cannot include hw/hw.h from user emulation
 #endif
 
+#include "exec/cpu-common.h"
 #include "exec/ioport.h"
 #include "hw/irq.h"
 #include "block/aio.h"
include/hw/ppc/openpic.h +1 -1
index 1cf188d..afe950b 100644
@@ -2,7 +2,7 @@
 #define __OPENPIC_H__
 
 #include "qemu-common.h"
-#include "hw/qdev.h"
+#include "hw/qdev-core.h"
 #include "qom/cpu.h"
 
 #define TYPE_OPENPIC "openpic"
kvm-stub.c +0 -1
index b962b24..63735a8 100644
@@ -12,7 +12,6 @@
 
 #include "qemu/osdep.h"
 #include "qemu-common.h"
-#include "hw/hw.h"
 #include "cpu.h"
 #include "sysemu/kvm.h"
 
target-i386/cpu.c +1 -1
index da5d081..b6a3caa 100644
@@ -34,7 +34,6 @@
 #include "qapi/visitor.h"
 #include "sysemu/arch_init.h"
 
-#include "hw/hw.h"
 #if defined(CONFIG_KVM)
 #include <linux/kvm_para.h>
 #endif
@@ -43,6 +42,7 @@
 #include "hw/qdev-properties.h"
 #ifndef CONFIG_USER_ONLY
 #include "exec/address-spaces.h"
+#include "hw/hw.h"
 #include "hw/xen/xen.h"
 #include "hw/i386/apic_internal.h"
 #endif
target-s390x/cpu.c +2 -1
index 4bfff34..e665165 100644
@@ -30,10 +30,11 @@
 #include "qemu/cutils.h"
 #include "qemu/timer.h"
 #include "qemu/error-report.h"
-#include "hw/hw.h"
 #include "trace.h"
 #include "qapi/visitor.h"
+#include "migration/vmstate.h"
 #ifndef CONFIG_USER_ONLY
+#include "hw/hw.h"
 #include "sysemu/arch_init.h"
 #include "sysemu/sysemu.h"
 #include "hw/s390x/sclp.h"
target-s390x/mem_helper.c +3 -0
index 7078622..9d206a9 100644
@@ -22,7 +22,10 @@
 #include "cpu.h"
 #include "exec/helper-proto.h"
 #include "exec/cpu_ldst.h"
+
+#if !defined(CONFIG_USER_ONLY)
 #include "hw/s390x/storage-keys.h"
+#endif
 
 /*****************************************************************************/
 /* Softmmu support */
target-s390x/misc_helper.c +1 -1
index 462cfc8..93280d0 100644
@@ -30,9 +30,9 @@
 #include <linux/kvm.h>
 #endif
 #include "exec/cpu_ldst.h"
-#include "hw/watchdog/wdt_diag288.h"
 
 #if !defined(CONFIG_USER_ONLY)
+#include "hw/watchdog/wdt_diag288.h"
 #include "sysemu/cpus.h"
 #include "sysemu/sysemu.h"
 #include "hw/s390x/ebcdic.h"
Signature · 1 line
1.8.3.1
#34 lore raw

[Qemu-devel] [PULL 36/52] hw: move CPU state serialization to migration/cpu.h

In reply to Paolo Bonzini

Remove usage of NEED_CPU_H from hw/hw.h.

---
 include/hw/hw.h           | 49 -----------------------------------------------
 include/migration/cpu.h   | 48 ++++++++++++++++++++++++++++++++++++++++++++++
 target-alpha/machine.c    |  1 +
 target-arm/machine.c      |  1 +
 target-cris/machine.c     |  1 +
 target-i386/machine.c     |  1 +
 target-lm32/machine.c     |  1 +
 target-mips/machine.c     |  2 +-
 target-moxie/machine.c    |  1 +
 target-openrisc/machine.c |  1 +
 target-ppc/machine.c      |  1 +
 target-sparc/machine.c    |  1 +
 12 files changed, 58 insertions(+), 50 deletions(-)
 create mode 100644 include/migration/cpu.h
include/hw/hw.h +0 -49
index 2cb69d5..0456fc3 100644
@@ -14,28 +14,6 @@
 #include "qemu/log.h"
 #include "qemu/module.h"
 
-#ifdef NEED_CPU_H
-#if TARGET_LONG_BITS == 64
-#define qemu_put_betl qemu_put_be64
-#define qemu_get_betl qemu_get_be64
-#define qemu_put_betls qemu_put_be64s
-#define qemu_get_betls qemu_get_be64s
-#define qemu_put_sbetl qemu_put_sbe64
-#define qemu_get_sbetl qemu_get_sbe64
-#define qemu_put_sbetls qemu_put_sbe64s
-#define qemu_get_sbetls qemu_get_sbe64s
-#else
-#define qemu_put_betl qemu_put_be32
-#define qemu_get_betl qemu_get_be32
-#define qemu_put_betls qemu_put_be32s
-#define qemu_get_betls qemu_get_be32s
-#define qemu_put_sbetl qemu_put_sbe32
-#define qemu_get_sbetl qemu_get_sbe32
-#define qemu_put_sbetls qemu_put_sbe32s
-#define qemu_get_sbetls qemu_get_sbe32s
-#endif
-#endif
-
 typedef void QEMUResetHandler(void *opaque);
 
 void qemu_register_reset(QEMUResetHandler *func, void *opaque);
@@ -43,31 +21,4 @@ void qemu_unregister_reset(QEMUResetHandler *func, void *opaque);
 
 void QEMU_NORETURN hw_error(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
 
-#ifdef NEED_CPU_H
-#if TARGET_LONG_BITS == 64
-#define VMSTATE_UINTTL_V(_f, _s, _v)                                  \
-    VMSTATE_UINT64_V(_f, _s, _v)
-#define VMSTATE_UINTTL_EQUAL_V(_f, _s, _v)                            \
-    VMSTATE_UINT64_EQUAL_V(_f, _s, _v)
-#define VMSTATE_UINTTL_ARRAY_V(_f, _s, _n, _v)                        \
-    VMSTATE_UINT64_ARRAY_V(_f, _s, _n, _v)
-#define vmstate_info_uinttl vmstate_info_uint64
-#else
-#define VMSTATE_UINTTL_V(_f, _s, _v)                                  \
-    VMSTATE_UINT32_V(_f, _s, _v)
-#define VMSTATE_UINTTL_EQUAL_V(_f, _s, _v)                            \
-    VMSTATE_UINT32_EQUAL_V(_f, _s, _v)
-#define VMSTATE_UINTTL_ARRAY_V(_f, _s, _n, _v)                        \
-    VMSTATE_UINT32_ARRAY_V(_f, _s, _n, _v)
-#define vmstate_info_uinttl vmstate_info_uint32
-#endif
-#define VMSTATE_UINTTL(_f, _s)                                        \
-    VMSTATE_UINTTL_V(_f, _s, 0)
-#define VMSTATE_UINTTL_EQUAL(_f, _s)                                  \
-    VMSTATE_UINTTL_EQUAL_V(_f, _s, 0)
-#define VMSTATE_UINTTL_ARRAY(_f, _s, _n)                              \
-    VMSTATE_UINTTL_ARRAY_V(_f, _s, _n, 0)
-
-#endif
-
 #endif
include/migration/cpu.h new file +48 -0

48 lines not on this page · raw message

target-alpha/machine.c +1 -0
index 9ab0928..3f72943 100644
@@ -1,6 +1,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/boards.h"
+#include "migration/cpu.h"
 
 static int get_fpcr(QEMUFile *f, void *opaque, size_t size)
 {
target-arm/machine.c +1 -0
index 03a73d9..c23feb1 100644
@@ -5,6 +5,7 @@
 #include "sysemu/kvm.h"
 #include "kvm_arm.h"
 #include "internals.h"
+#include "migration/cpu.h"
 
 static bool vfp_needed(void *opaque)
 {
target-cris/machine.c +1 -0
index 9cc2820..4c9287f 100644
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "migration/cpu.h"
 
 static const VMStateDescription vmstate_tlbset = {
     .name = "cpu/tlbset",
target-i386/machine.c +1 -0
index ee5b949..57203b2 100644
@@ -3,6 +3,7 @@
 #include "hw/boards.h"
 #include "hw/i386/pc.h"
 #include "hw/isa/isa.h"
+#include "migration/cpu.h"
 
 #include "cpu.h"
 #include "sysemu/kvm.h"
target-lm32/machine.c +1 -0
index 91c943d..6f56216 100644
@@ -1,6 +1,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/boards.h"
+#include "migration/cpu.h"
 
 static const VMStateDescription vmstate_env = {
     .name = "env",
target-mips/machine.c +1 -1
index 22bca18..eb3d916 100644
@@ -1,7 +1,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
-
 #include "cpu.h"
+#include "migration/cpu.h"
 
 static int cpu_post_load(void *opaque, int version_id)
 {
target-moxie/machine.c +1 -0
index 912b791..7810e1c 100644
@@ -2,6 +2,7 @@
 #include "hw/hw.h"
 #include "hw/boards.h"
 #include "machine.h"
+#include "migration/cpu.h"
 
 const VMStateDescription vmstate_moxie_cpu = {
     .name = "cpu",
target-openrisc/machine.c +1 -0
index b4dc08d..bd5d50f 100644
@@ -20,6 +20,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/boards.h"
+#include "migration/cpu.h"
 
 static const VMStateDescription vmstate_env = {
     .name = "env",
target-ppc/machine.c +1 -0
index 46684fb..c0b9182 100644
@@ -4,6 +4,7 @@
 #include "sysemu/kvm.h"
 #include "helper_regs.h"
 #include "mmu-hash64.h"
+#include "migration/cpu.h"
 
 static int cpu_load_old(QEMUFile *f, void *opaque, int version_id)
 {
target-sparc/machine.c +1 -0
index 1046016..04806f6 100644
@@ -4,6 +4,7 @@
 #include "qemu/timer.h"
 
 #include "cpu.h"
+#include "migration/cpu.h"
 
 #ifdef TARGET_SPARC64
 static const VMStateDescription vmstate_cpu_timer = {
Signature · 1 line
1.8.3.1
#35 lore raw

[Qemu-devel] [PULL 30/52] explicitly include qom/cpu.h

In reply to Paolo Bonzini

exec/cpu-all.h includes qom/cpu.h. Explicit inclusion will keep things working when cpu.h will not be included indirectly almost everywhere (either directly or through qemu-common.h).

---
 hw/acpi/piix4.c          | 1 +
 hw/arm/collie.c          | 1 +
 hw/cpu/a9mpcore.c        | 1 +
 hw/isa/lpc_ich9.c        | 1 +
 include/hw/ppc/openpic.h | 1 +
 5 files changed, 5 insertions(+)
hw/acpi/piix4.c +1 -0
index 16abdf1..b3e3bb3 100644
@@ -39,6 +39,7 @@
 #include "hw/acpi/memory_hotplug.h"
 #include "hw/acpi/acpi_dev_interface.h"
 #include "hw/xen/xen.h"
+#include "qom/cpu.h"
 
 //#define DEBUG
 
hw/arm/collie.c +1 -0
index 8bb308a..2e69531 100644
@@ -18,6 +18,7 @@
 #include "hw/block/flash.h"
 #include "sysemu/block-backend.h"
 #include "exec/address-spaces.h"
+#include "qom/cpu.h"
 
 static struct arm_boot_info collie_binfo = {
     .loader_start = SA_SDCS0,
hw/cpu/a9mpcore.c +1 -0
index 5459ae8..f17f292 100644
@@ -11,6 +11,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "hw/cpu/a9mpcore.h"
+#include "qom/cpu.h"
 
 static void a9mp_priv_set_irq(void *opaque, int irq, int level)
 {
hw/isa/lpc_ich9.c +1 -0
index 99cd3ba..4f8ca45 100644
@@ -47,6 +47,7 @@
 #include "hw/pci/pci_bus.h"
 #include "exec/address-spaces.h"
 #include "sysemu/sysemu.h"
+#include "qom/cpu.h"
 
 static int ich9_lpc_sci_irq(ICH9LPCState *lpc);
 
include/hw/ppc/openpic.h +1 -0
index ee67098..1cf188d 100644
@@ -3,6 +3,7 @@
 
 #include "qemu-common.h"
 #include "hw/qdev.h"
+#include "qom/cpu.h"
 
 #define TYPE_OPENPIC "openpic"
 
Signature · 1 line
1.8.3.1
#36 lore raw

[Qemu-devel] [PULL 29/52] arm: remove useless cpu.h inclusion

In reply to Paolo Bonzini
---
 include/hw/arm/digic.h | 2 --
 1 file changed, 2 deletions(-)
include/hw/arm/digic.h +0 -2
index a739d6a..aaefe0b 100644
@@ -18,8 +18,6 @@
 #ifndef HW_ARM_DIGIC_H
 #define HW_ARM_DIGIC_H
 
-#include "cpu.h"
-
 #include "hw/timer/digic-timer.h"
 #include "hw/char/digic-uart.h"
 
Signature · 1 line
1.8.3.1
#37 lore raw

[Qemu-devel] [PULL 31/52] explicitly include hw/qdev-core.h

In reply to Paolo Bonzini

exec/cpu-all.h includes qom/cpu.h, which includes hw/qdev-core.h. Explicit inclusion will keep things working when cpu.h will not be included indirectly almost everywhere (either directly or through qemu-common.h).

---
 bootdevice.c | 1 +
 1 file changed, 1 insertion(+)
bootdevice.c +1 -0
index 2e83ff0..bb9c08e 100644
@@ -28,6 +28,7 @@
 #include "qapi/visitor.h"
 #include "qemu/error-report.h"
 #include "hw/hw.h"
+#include "hw/qdev-core.h"
 
 typedef struct FWBootEntry FWBootEntry;
 
Signature · 1 line
1.8.3.1
#38 lore raw

[Qemu-devel] [PULL 42/52] dma: do not depend on kvm_enabled()

In reply to Paolo Bonzini

Memory barriers are needed also by Xen and, when the ioeventfd bugs are fixed, by TCG as well.

sysemu/kvm.h is not anymore needed in sysemu/dma.h, move it to the actual users.

---
 hw/intc/arm_gicv2m.c  | 1 +
 hw/intc/xics_kvm.c    | 2 +-
 hw/misc/pci-testdev.c | 1 +
 hw/ppc/e500plat.c     | 1 +
 hw/ppc/spapr_hcall.c  | 1 +
 hw/ppc/spapr_pci.c    | 1 +
 hw/ppc/spapr_rtas.c   | 1 +
 include/sysemu/dma.h  | 5 +----
 8 files changed, 8 insertions(+), 5 deletions(-)
hw/intc/arm_gicv2m.c +1 -0
index e8b5177..589d315 100644
@@ -29,6 +29,7 @@
 #include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "hw/pci/msi.h"
+#include "sysemu/kvm.h"
 
 #define TYPE_ARM_GICV2M "arm-gicv2m"
 #define ARM_GICV2M(obj) OBJECT_CHECK(ARMGICv2mState, (obj), TYPE_ARM_GICV2M)
hw/intc/xics_kvm.c +1 -1
index b40292d..55fd801 100644
@@ -31,7 +31,7 @@
 #include "cpu.h"
 #include "hw/hw.h"
 #include "trace.h"
-#include "linux/kvm.h"
+#include "sysemu/kvm.h"
 #include "hw/ppc/spapr.h"
 #include "hw/ppc/xics.h"
 #include "kvm_ppc.h"
hw/misc/pci-testdev.c +1 -0
index 2f2e989..7d59902 100644
@@ -21,6 +21,7 @@
 #include "hw/hw.h"
 #include "hw/pci/pci.h"
 #include "qemu/event_notifier.h"
+#include "sysemu/kvm.h"
 
 typedef struct PCITestDevHdr {
     uint8_t test;
hw/ppc/e500plat.c +1 -0
index b00565c..94b4545 100644
@@ -14,6 +14,7 @@
 #include "e500.h"
 #include "hw/boards.h"
 #include "sysemu/device_tree.h"
+#include "sysemu/kvm.h"
 #include "hw/pci/pci.h"
 #include "hw/ppc/openpic.h"
 #include "kvm_ppc.h"
hw/ppc/spapr_hcall.c +1 -0
index 8f40602..4426a50 100644
@@ -7,6 +7,7 @@
 #include "mmu-hash64.h"
 #include "cpu-models.h"
 #include "trace.h"
+#include "sysemu/kvm.h"
 #include "kvm_ppc.h"
 
 struct SPRSyncState {
hw/ppc/spapr_pci.c +1 -0
index 573e635..e55b505 100644
@@ -44,6 +44,7 @@
 #include "hw/pci/pci_bus.h"
 #include "hw/ppc/spapr_drc.h"
 #include "sysemu/device_tree.h"
+#include "sysemu/kvm.h"
 
 #include "hw/vfio/vfio.h"
 
hw/ppc/spapr_rtas.c +1 -0
index f073258..580829e 100644
@@ -31,6 +31,7 @@
 #include "hw/qdev.h"
 #include "sysemu/device_tree.h"
 #include "sysemu/cpus.h"
+#include "sysemu/kvm.h"
 
 #include "hw/ppc/spapr.h"
 #include "hw/ppc/spapr_vio.h"
include/sysemu/dma.h +1 -4
index 0f7cd4d..d6e96a4 100644
@@ -15,7 +15,6 @@
 #include "hw/hw.h"
 #include "block/block.h"
 #include "block/accounting.h"
-#include "sysemu/kvm.h"
 
 typedef struct ScatterGatherEntry ScatterGatherEntry;
 
@@ -67,9 +66,7 @@ static inline void dma_barrier(AddressSpace *as, DMADirection dir)
      * use lighter barriers based on the direction of the
      * transfer, the DMA context, etc...
      */
-    if (kvm_enabled()) {
-        smp_mb();
-    }
+    smp_mb();
 }
 
 /* Checks that the given range of addresses is valid for DMA.  This is
Signature · 1 line
1.8.3.1
#39 lore raw

[Qemu-devel] [PULL 44/52] acpi: do not use TARGET_PAGE_SIZE

In reply to Paolo Bonzini

This is a #define used by the CPU. NVDIMM can just use 4K unconditionally.

---
 hw/acpi/nvdimm.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
hw/acpi/nvdimm.c +11 -11
index 9531340..fb925dc 100644
@@ -378,17 +378,19 @@ struct NvdimmDsmIn {
     uint32_t function;
     /* the remaining size in the page is used by arg3. */
     union {
-        uint8_t arg3[0];
+        uint8_t arg3[4084];
     };
 } QEMU_PACKED;
 typedef struct NvdimmDsmIn NvdimmDsmIn;
+QEMU_BUILD_BUG_ON(sizeof(NvdimmDsmIn) != 4096);
 
 struct NvdimmDsmOut {
     /* the size of buffer filled by QEMU. */
     uint32_t len;
-    uint8_t data[0];
+    uint8_t data[4092];
 } QEMU_PACKED;
 typedef struct NvdimmDsmOut NvdimmDsmOut;
+QEMU_BUILD_BUG_ON(sizeof(NvdimmDsmOut) != 4096);
 
 struct NvdimmDsmFunc0Out {
     /* the size of buffer filled by QEMU. */
@@ -424,8 +426,8 @@ nvdimm_dsm_write(void *opaque, hwaddr addr, uint64_t val, unsigned size)
      * can change its content while we are doing DSM emulation. Avoid
      * this by copying DSM memory to QEMU local memory.
      */
-    in = g_malloc(TARGET_PAGE_SIZE);
-    cpu_physical_memory_read(dsm_mem_addr, in, TARGET_PAGE_SIZE);
+    in = g_new(NvdimmDsmIn, 1);
+    cpu_physical_memory_read(dsm_mem_addr, in, sizeof(*in));
 
     le32_to_cpus(&in->revision);
     le32_to_cpus(&in->function);
@@ -475,7 +477,7 @@ void nvdimm_init_acpi_state(AcpiNVDIMMState *state, MemoryRegion *io,
     memory_region_add_subregion(io, NVDIMM_ACPI_IO_BASE, &state->io_mr);
 
     state->dsm_mem = g_array_new(false, true /* clear */, 1);
-    acpi_data_push(state->dsm_mem, TARGET_PAGE_SIZE);
+    acpi_data_push(state->dsm_mem, sizeof(NvdimmDsmIn));
     fw_cfg_add_file(fw_cfg, NVDIMM_DSM_MEM_FILE, state->dsm_mem->data,
                     state->dsm_mem->len);
 }
@@ -608,7 +610,7 @@ static void nvdimm_build_ssdt(GSList *device_list, GArray *table_offsets,
     aml_append(dev, aml_operation_region("NPIO", AML_SYSTEM_IO,
                aml_int(NVDIMM_ACPI_IO_BASE), NVDIMM_ACPI_IO_LEN));
     aml_append(dev, aml_operation_region("NRAM", AML_SYSTEM_MEMORY,
-               aml_name(NVDIMM_ACPI_MEM_ADDR), TARGET_PAGE_SIZE));
+               aml_name(NVDIMM_ACPI_MEM_ADDR), sizeof(NvdimmDsmIn)));
 
     /*
      * DSM notifier:
@@ -642,8 +644,7 @@ static void nvdimm_build_ssdt(GSList *device_list, GArray *table_offsets,
     aml_append(field, aml_named_field("FUNC",
                sizeof(typeof_field(NvdimmDsmIn, function)) * BITS_PER_BYTE));
     aml_append(field, aml_named_field("ARG3",
-               (TARGET_PAGE_SIZE - offsetof(NvdimmDsmIn, arg3)) *
-                BITS_PER_BYTE));
+               (sizeof(NvdimmDsmIn) - offsetof(NvdimmDsmIn, arg3)) * BITS_PER_BYTE));
     aml_append(dev, field);
 
     /*
@@ -659,8 +660,7 @@ static void nvdimm_build_ssdt(GSList *device_list, GArray *table_offsets,
     aml_append(field, aml_named_field("RLEN",
                sizeof(typeof_field(NvdimmDsmOut, len)) * BITS_PER_BYTE));
     aml_append(field, aml_named_field("ODAT",
-               (TARGET_PAGE_SIZE - offsetof(NvdimmDsmOut, data)) *
-                     BITS_PER_BYTE));
+               (sizeof(NvdimmDsmOut) - offsetof(NvdimmDsmOut, data)) * BITS_PER_BYTE));
     aml_append(dev, field);
 
     nvdimm_build_common_dsm(dev);
@@ -678,7 +678,7 @@ static void nvdimm_build_ssdt(GSList *device_list, GArray *table_offsets,
     mem_addr_offset = build_append_named_dword(table_data,
                                                NVDIMM_ACPI_MEM_ADDR);
 
-    bios_linker_loader_alloc(linker, NVDIMM_DSM_MEM_FILE, TARGET_PAGE_SIZE,
+    bios_linker_loader_alloc(linker, NVDIMM_DSM_MEM_FILE, sizeof(NvdimmDsmIn),
                              false /* high memory */);
     bios_linker_loader_add_pointer(linker, ACPI_BUILD_TABLE_FILE,
                                    NVDIMM_DSM_MEM_FILE, table_data,
Signature · 1 line
1.8.3.1
#40 lore raw

[Qemu-devel] [PULL 41/52] gdbstub: remove unnecessary includes from gdbstub-xml.c

In reply to Paolo Bonzini

gdbstub-xml.c defines a bunch of arrays of strings; there is no need to include anything. Keep osdep.h for consistency, but remove the rest.

---
 scripts/feature_to_c.sh | 2 --
 1 file changed, 2 deletions(-)
scripts/feature_to_c.sh +0 -2
index fb1f336..e4387b7 100644
@@ -37,8 +37,6 @@ for input; do
 
   ${AWK:-awk} 'BEGIN { n = 0
       printf "#include \"qemu/osdep.h\"\n"
-      printf "#include \"qemu-common.h\"\n"
-      printf "#include \"exec/gdbstub.h\"\n"
       print "static const char '$arrayname'[] = {"
       for (i = 0; i < 255; i++)
         _ord_[sprintf("%c", i)] = i
Signature · 1 line
1.8.3.1
#41 lore raw

[Qemu-devel] [PULL 45/52] qemu-common: push cpu.h inclusion out of qemu-common.h

In reply to Paolo Bonzini
---
 arch_init.c                              |  2 ++
 cpus.c                                   |  3 ++-
 exec.c                                   |  2 +-
 gdbstub.c                                |  2 +-
 hw/arm/nseries.c                         |  1 +
 hw/arm/pxa2xx_gpio.c                     |  1 +
 hw/core/nmi.c                            |  5 +++++
 hw/display/cg3.c                         |  1 +
 hw/i386/kvm/apic.c                       |  2 ++
 hw/i386/kvm/clock.c                      |  1 +
 hw/i386/kvmvapic.c                       |  2 ++
 hw/intc/apic.c                           |  2 ++
 hw/intc/apic_common.c                    |  2 ++
 hw/intc/arm_gic_kvm.c                    |  2 ++
 hw/intc/armv7m_nvic.c                    |  1 +
 hw/intc/openpic_kvm.c                    |  2 ++
 hw/intc/s390_flic_kvm.c                  |  2 ++
 hw/misc/mips_cpc.c                       |  1 +
 hw/misc/mips_itu.c                       |  1 +
 hw/ppc/ppc4xx_devs.c                     |  1 +
 hw/ppc/prep.c                            |  1 +
 hw/ppc/virtex_ml507.c                    |  1 +
 hw/xtensa/pic_cpu.c                      |  1 +
 include/disas/disas.h                    |  2 ++
 include/exec/gdbstub.h                   |  2 ++
 include/exec/hwaddr.h                    |  2 ++
 include/hw/arm/digic.h                   |  1 +
 include/hw/arm/fsl-imx6.h                |  1 +
 include/hw/arm/virt-acpi-build.h         |  1 +
 include/hw/arm/virt.h                    |  1 +
 include/hw/hw.h                          |  1 -
 include/hw/sd/sd.h                       |  2 ++
 include/hw/xen/xen.h                     |  7 ++++---
 include/qemu-common.h                    |  5 -----
 include/sysemu/kvm.h                     |  1 +
 ioport.c                                 |  2 ++
 memory.c                                 |  2 ++
 migration/ram.c                          |  2 ++
 migration/savevm.c                       |  1 +
 monitor.c                                |  2 ++
 qtest.c                                  |  2 ++
 scripts/tracetool/format/tcg_helper_c.py |  1 +
 target-alpha/gdbstub.c                   |  1 +
 target-alpha/machine.c                   |  2 ++
 target-arm/gdbstub.c                     |  1 +
 target-arm/gdbstub64.c                   |  1 +
 target-arm/kvm-stub.c                    |  1 +
 target-arm/kvm32.c                       |  2 +-
 target-arm/kvm64.c                       |  2 +-
 target-arm/machine.c                     |  2 ++
 target-cris/gdbstub.c                    |  1 +
 target-cris/machine.c                    |  2 ++
 target-i386/gdbstub.c                    |  1 +
 target-i386/kvm-stub.c                   |  1 +
 target-i386/kvm.c                        |  2 +-
 target-i386/machine.c                    |  2 ++
 target-lm32/gdbstub.c                    |  1 +
 target-lm32/machine.c                    |  2 ++
 target-m68k/gdbstub.c                    |  1 +
 target-microblaze/gdbstub.c              |  1 +
 target-mips/cpu.h                        | 18 ++----------------
 target-mips/gdbstub.c                    |  1 +
 target-mips/helper.c                     | 17 +++++++++++++++++
 target-mips/kvm.c                        |  2 +-
 target-mips/machine.c                    |  2 ++
 target-moxie/machine.c                   |  2 ++
 target-openrisc/gdbstub.c                |  1 +
 target-openrisc/machine.c                |  2 ++
 target-ppc/gdbstub.c                     |  1 +
 target-ppc/kvm-stub.c                    |  1 +
 target-ppc/kvm.c                         |  2 +-
 target-ppc/machine.c                     |  2 ++
 target-s390x/gdbstub.c                   |  1 +
 target-s390x/kvm.c                       |  2 +-
 target-sh4/gdbstub.c                     |  1 +
 target-sparc/gdbstub.c                   |  1 +
 target-sparc/machine.c                   |  2 ++
 target-xtensa/gdbstub.c                  |  1 +
 tcg/optimize.c                           |  3 +--
 tcg/tcg-op.c                             |  2 ++
 tcg/tcg.h                                |  1 +
 xen-hvm.c                                |  1 +
 82 files changed, 133 insertions(+), 36 deletions(-)
arch_init.c +2 -0
index e3bb1b3..07f047f 100644
@@ -22,6 +22,8 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "cpu.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/arch_init.h"
 #include "hw/pci/pci.h"
cpus.c +2 -1
index cbeb1f6..7b6ebeb 100644
@@ -24,7 +24,8 @@
 
 /* Needed early for CONFIG_BSD etc. */
 #include "qemu/osdep.h"
-
+#include "qemu-common.h"
+#include "cpu.h"
 #include "monitor/monitor.h"
 #include "qapi/qmp/qerror.h"
 #include "qemu/error-report.h"
exec.c +1 -1
index ed10ba1..d26df55 100644
@@ -28,10 +28,10 @@
 #include "hw/qdev-core.h"
 #if !defined(CONFIG_USER_ONLY)
 #include "hw/boards.h"
+#include "hw/xen/xen.h"
 #endif
 #include "sysemu/kvm.h"
 #include "sysemu/sysemu.h"
-#include "hw/xen/xen.h"
 #include "qemu/timer.h"
 #include "qemu/config-file.h"
 #include "qemu/error-report.h"
gdbstub.c +1 -1
index 0e431fd..c19ce39 100644
@@ -19,7 +19,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qemu/cutils.h"
-
+#include "cpu.h"
 #ifdef CONFIG_USER_ONLY
 #include "qemu.h"
 #else
hw/arm/nseries.c +1 -0
index f3a9b1a..6131c34 100644
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
+#include "cpu.h"
 #include "qemu/cutils.h"
 #include "qemu/bswap.h"
 #include "sysemu/sysemu.h"
hw/arm/pxa2xx_gpio.c +1 -0
index 67e7e70..8c9626e 100644
@@ -8,6 +8,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "cpu.h"
 #include "hw/hw.h"
 #include "hw/sysbus.h"
 #include "hw/arm/pxa.h"
hw/core/nmi.c +5 -0
index e8bcc41..f616a79 100644
@@ -20,11 +20,16 @@
  */
 
 #include "qemu/osdep.h"
+#include "qom/cpu.h"
 #include "hw/nmi.h"
 #include "qapi/error.h"
 #include "qapi/qmp/qerror.h"
 #include "monitor/monitor.h"
 
+#if defined(TARGET_I386)
+#include "cpu.h"
+#endif
+
 struct do_nmi_s {
     int cpu_index;
     Error *err;
hw/display/cg3.c +1 -0
index fc0d97f..eb0e71a 100644
@@ -26,6 +26,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qemu-common.h"
+#include "cpu.h"
 #include "qemu/error-report.h"
 #include "ui/console.h"
 #include "hw/sysbus.h"
hw/i386/kvm/apic.c +2 -0
index 3c7c8fa..c5983c7 100644
@@ -10,6 +10,8 @@
  * See the COPYING file in the top-level directory.
  */
 #include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "cpu.h"
 #include "hw/i386/apic_internal.h"
 #include "hw/pci/msi.h"
 #include "sysemu/kvm.h"
hw/i386/kvm/clock.c +1 -0
index a3b300c..0f75dd3 100644
@@ -15,6 +15,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "cpu.h"
 #include "qemu/host-utils.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/kvm.h"
hw/i386/kvmvapic.c +2 -0
index f14445d..466c3c4 100644
@@ -9,6 +9,8 @@
  * top-level directory.
  */
 #include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "cpu.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/cpus.h"
 #include "sysemu/kvm.h"
hw/intc/apic.c +2 -0
index 28c2ea5..e1ab935 100644
@@ -17,6 +17,8 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>
  */
 #include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "cpu.h"
 #include "qemu/thread.h"
 #include "hw/i386/apic_internal.h"
 #include "hw/i386/apic.h"
hw/intc/apic_common.c +2 -0
index 4abe145..e6eb694 100644
@@ -19,6 +19,8 @@
  */
 #include "qemu/osdep.h"
 #include "qapi/error.h"
+#include "qemu-common.h"
+#include "cpu.h"
 #include "hw/i386/apic.h"
 #include "hw/i386/apic_internal.h"
 #include "trace.h"
hw/intc/arm_gic_kvm.c +2 -0
index bc85ab7..5593cdb 100644
@@ -21,6 +21,8 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
+#include "qemu-common.h"
+#include "cpu.h"
 #include "hw/sysbus.h"
 #include "migration/migration.h"
 #include "sysemu/kvm.h"
hw/intc/armv7m_nvic.c +1 -0
index 669e82a..4d584ef 100644
@@ -13,6 +13,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qemu-common.h"
+#include "cpu.h"
 #include "hw/sysbus.h"
 #include "qemu/timer.h"
 #include "hw/arm/arm.h"
hw/intc/openpic_kvm.c +2 -0
index e47e94f..0518e01 100644
@@ -24,6 +24,8 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
+#include "qemu-common.h"
+#include "cpu.h"
 #include <sys/ioctl.h>
 #include "exec/address-spaces.h"
 #include "hw/hw.h"
hw/intc/s390_flic_kvm.c +2 -0
index 02449b3..eed6325 100644
@@ -11,6 +11,8 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "cpu.h"
 #include <sys/ioctl.h>
 #include "qemu/error-report.h"
 #include "hw/sysbus.h"
hw/misc/mips_cpc.c +1 -0
index d2b8e42..05688b7 100644
@@ -19,6 +19,7 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
+#include "cpu.h"
 #include "hw/sysbus.h"
 
 #include "hw/misc/mips_cpc.h"
hw/misc/mips_itu.c +1 -0
index da54550..c1a4453 100644
@@ -19,6 +19,7 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
+#include "cpu.h"
 #include "hw/hw.h"
 #include "hw/sysbus.h"
 #include "sysemu/sysemu.h"
hw/ppc/ppc4xx_devs.c +1 -0
index 7d59018..e7f413e 100644
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "cpu.h"
 #include "hw/hw.h"
 #include "hw/ppc/ppc.h"
 #include "hw/ppc/ppc4xx.h"
hw/ppc/prep.c +1 -0
index 3ffb85e..07ffe72 100644
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "cpu.h"
 #include "hw/hw.h"
 #include "hw/timer/m48t59.h"
 #include "hw/i386/pc.h"
hw/ppc/virtex_ml507.c +1 -0
index b807a08..b97d966 100644
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "cpu.h"
 #include "hw/sysbus.h"
 #include "hw/hw.h"
 #include "hw/char/serial.h"
hw/xtensa/pic_cpu.c +1 -0
index c835bd0..ccf65fd 100644
@@ -26,6 +26,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "cpu.h"
 #include "hw/hw.h"
 #include "qemu/log.h"
 #include "qemu/timer.h"
include/disas/disas.h +2 -0
index 2b9293b..4930d78 100644
@@ -4,6 +4,8 @@
 #include "qemu-common.h"
 
 #ifdef NEED_CPU_H
+#include "cpu.h"
+
 /* Disassemble this for me please... (debugging). */
 void disas(FILE *out, void *code, unsigned long size);
 void target_disas(FILE *out, CPUState *cpu, target_ulong code,
include/exec/gdbstub.h +2 -0
index d9e8cf7..8e3f8d8 100644
@@ -11,6 +11,8 @@
 #define GDB_WATCHPOINT_ACCESS    4
 
 #ifdef NEED_CPU_H
+#include "cpu.h"
+
 typedef void (*gdb_syscall_complete_cb)(CPUState *cpu,
                                         target_ulong ret, target_ulong err);
 
include/exec/hwaddr.h +2 -0
index c9eb78f..bb41588 100644
@@ -3,6 +3,8 @@
 #ifndef HWADDR_H
 #define HWADDR_H
 
+#include <inttypes.h>
+
 #define HWADDR_BITS 64
 /* hwaddr is the type of a physical address (its size can
    be different from 'target_ulong').  */
include/hw/arm/digic.h +1 -0
index aaefe0b..63785ba 100644
@@ -18,6 +18,7 @@
 #ifndef HW_ARM_DIGIC_H
 #define HW_ARM_DIGIC_H
 
+#include "cpu.h"
 #include "hw/timer/digic-timer.h"
 #include "hw/char/digic-uart.h"
 
include/hw/arm/fsl-imx6.h +1 -0
index d24aaee..e9157ea 100644
@@ -29,6 +29,7 @@
 #include "hw/sd/sdhci.h"
 #include "hw/ssi/imx_spi.h"
 #include "exec/memory.h"
+#include "cpu.h"
 
 #define TYPE_FSL_IMX6 "fsl,imx6"
 #define FSL_IMX6(obj) OBJECT_CHECK(FslIMX6State, (obj), TYPE_FSL_IMX6)
include/hw/arm/virt-acpi-build.h +1 -0
index 7d3700e..e43330a 100644
@@ -22,6 +22,7 @@
 
 #include "qemu-common.h"
 #include "hw/arm/virt.h"
+#include "qemu/notify.h"
 
 #define ACPI_GICC_ENABLED 1
 
include/hw/arm/virt.h +1 -0
index ecd8589..82703d2 100644
@@ -31,6 +31,7 @@
 #define QEMU_ARM_VIRT_H
 
 #include "qemu-common.h"
+#include "exec/hwaddr.h"
 
 #define NUM_GICV2M_SPIS       64
 #define NUM_VIRTIO_TRANSPORTS 32
include/hw/hw.h +0 -1
index 29931d1..a20321b 100644
@@ -2,7 +2,6 @@
 #ifndef QEMU_HW_H
 #define QEMU_HW_H
 
-
 #ifdef CONFIG_USER_ONLY
 #error Cannot include hw/hw.h from user emulation
 #endif
include/hw/sd/sd.h +2 -0
index d5d273a..c8a4b98 100644
@@ -29,6 +29,8 @@
 #ifndef __hw_sd_h
 #define __hw_sd_h		1
 
+#include "hw/qdev.h"
+
 #define OUT_OF_RANGE		(1 << 31)
 #define ADDRESS_ERROR		(1 << 30)
 #define BLOCK_LEN_ERROR		(1 << 29)
include/hw/xen/xen.h +4 -3
index 6eb815a..6365483 100644
@@ -7,8 +7,10 @@
  *   /usr/include/xen, so it can be included unconditionally.
  */
 
-#include "hw/irq.h"
 #include "qemu-common.h"
+#include "qemu/typedefs.h"
+#include "exec/cpu-common.h"
+#include "hw/irq.h"
 
 /* xen-machine.c */
 enum xen_mode {
@@ -37,12 +39,11 @@ qemu_irq *xen_interrupt_controller_init(void);
 
 void xenstore_store_pv_console_info(int i, struct CharDriverState *chr);
 
-#if defined(NEED_CPU_H) && !defined(CONFIG_USER_ONLY)
 void xen_hvm_init(PCMachineState *pcms, MemoryRegion **ram_memory);
+
 void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size,
                    struct MemoryRegion *mr, Error **errp);
 void xen_modified_memory(ram_addr_t start, ram_addr_t length);
-#endif
 
 void xen_register_framebuffer(struct MemoryRegion *mr);
 
include/qemu-common.h +0 -5
index cd3139b..835cbc6 100644
@@ -22,11 +22,6 @@
 
 #include "qemu/option.h"
 
-/* FIXME: Remove NEED_CPU_H.  */
-#ifdef NEED_CPU_H
-#include "cpu.h"
-#endif /* !defined(NEED_CPU_H) */
-
 /* main function, renamed */
 #if defined(CONFIG_COCOA)
 int qemu_main(int argc, char **argv, char **envp);
include/sysemu/kvm.h +1 -0
index 0e18f15..f9f00e2 100644
@@ -218,6 +218,7 @@ int kvm_init_vcpu(CPUState *cpu);
 int kvm_cpu_exec(CPUState *cpu);
 
 #ifdef NEED_CPU_H
+#include "cpu.h"
 
 void kvm_setup_guest_memory(void *start, size_t size);
 void kvm_flush_coalesced_mmio_buffer(void);
ioport.c +2 -0
index 7a84d54..901a997 100644
@@ -26,6 +26,8 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "cpu.h"
 #include "exec/ioport.h"
 #include "trace.h"
 #include "exec/memory.h"
memory.c +2 -0
index f76f85d..a8ef852 100644
@@ -15,6 +15,8 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
+#include "qemu-common.h"
+#include "cpu.h"
 #include "exec/memory.h"
 #include "exec/address-spaces.h"
 #include "exec/ioport.h"
migration/ram.c +2 -0
index 88fbffc..5e88080 100644
@@ -26,6 +26,8 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "cpu.h"
 #include <zlib.h>
 #include "qapi-event.h"
 #include "qemu/cutils.h"
migration/savevm.c +1 -0
index 16ba443..bfb3d91 100644
@@ -27,6 +27,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "cpu.h"
 #include "hw/boards.h"
 #include "hw/hw.h"
 #include "hw/qdev.h"
monitor.c +2 -0
index d1c1930..812383f 100644
@@ -23,6 +23,8 @@
  */
 #include "qemu/osdep.h"
 #include <dirent.h>
+#include "qemu-common.h"
+#include "cpu.h"
 #include "hw/hw.h"
 #include "monitor/qdev.h"
 #include "hw/usb.h"
qtest.c +2 -0
index 87575bc..da4826c 100644
@@ -13,6 +13,8 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
+#include "qemu-common.h"
+#include "cpu.h"
 #include "sysemu/qtest.h"
 #include "hw/qdev.h"
 #include "sysemu/char.h"
scripts/tracetool/format/tcg_helper_c.py +1 -0
index a089b0b..e3485b7 100644
@@ -48,6 +48,7 @@ def generate(events, backend):
         '',
         '#include "qemu/osdep.h"',
         '#include "qemu-common.h"',
+        '#include "cpu.h"',
         '#include "trace.h"',
         '#include "exec/helper-proto.h"',
         '',
target-alpha/gdbstub.c +1 -0
index 199f028..d64bccc 100644
@@ -19,6 +19,7 @@
  */
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "cpu.h"
 #include "exec/gdbstub.h"
 
 int alpha_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
target-alpha/machine.c +2 -0
index 3f72943..710b783 100644
@@ -1,4 +1,6 @@
 #include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "cpu.h"
 #include "hw/hw.h"
 #include "hw/boards.h"
 #include "migration/cpu.h"
target-arm/gdbstub.c +1 -0
index 3ba9aad..04c1208 100644
@@ -19,6 +19,7 @@
  */
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "cpu.h"
 #include "exec/gdbstub.h"
 
 /* Old gdb always expect FPA registers.  Newer (xml-aware) gdb only expect
target-arm/gdbstub64.c +1 -0
index 634c6bc..49bc3fc 100644
@@ -18,6 +18,7 @@
  */
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "cpu.h"
 #include "exec/gdbstub.h"
 
 int aarch64_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
target-arm/kvm-stub.c +1 -0
index 38bf433..b2c66df 100644
@@ -11,6 +11,7 @@
  */
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "cpu.h"
 #include "kvm_arm.h"
 
 bool write_kvmstate_to_list(ARMCPU *cpu)
target-arm/kvm32.c +1 -1
index d44a7f9..7f5935a 100644
@@ -15,11 +15,11 @@
 #include <linux/kvm.h>
 
 #include "qemu-common.h"
+#include "cpu.h"
 #include "qemu/timer.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/kvm.h"
 #include "kvm_arm.h"
-#include "cpu.h"
 #include "internals.h"
 #include "hw/arm/arm.h"
 
target-arm/kvm64.c +1 -1
index e8527bf..e2a34f6 100644
@@ -18,6 +18,7 @@
 #include <linux/kvm.h>
 
 #include "qemu-common.h"
+#include "cpu.h"
 #include "qemu/timer.h"
 #include "qemu/error-report.h"
 #include "qemu/host-utils.h"
@@ -25,7 +26,6 @@
 #include "sysemu/sysemu.h"
 #include "sysemu/kvm.h"
 #include "kvm_arm.h"
-#include "cpu.h"
 #include "internals.h"
 #include "hw/arm/arm.h"
 
target-arm/machine.c +2 -0
index c23feb1..2f45260 100644
@@ -1,4 +1,6 @@
 #include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "cpu.h"
 #include "hw/hw.h"
 #include "hw/boards.h"
 #include "qemu/error-report.h"
target-cris/gdbstub.c +1 -0
index 1bbf17b..3a72ee2 100644
@@ -19,6 +19,7 @@
  */
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "cpu.h"
 #include "exec/gdbstub.h"
 
 int crisv10_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
target-cris/machine.c +2 -0
index 4c9287f..6b797e8 100644
@@ -19,6 +19,8 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "cpu.h"
 #include "hw/hw.h"
 #include "migration/cpu.h"
 
target-i386/gdbstub.c +1 -0
index 4b50713..c494535 100644
@@ -19,6 +19,7 @@
  */
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "cpu.h"
 #include "exec/gdbstub.h"
 
 #ifdef TARGET_X86_64
target-i386/kvm-stub.c +1 -0
index 8df9c59..cdf1506 100644
@@ -11,6 +11,7 @@
  */
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "cpu.h"
 #include "kvm_i386.h"
 
 bool kvm_allows_irq0_override(void)
target-i386/kvm.c +1 -1
index 799fdfa..c76e7bb 100644
@@ -22,10 +22,10 @@
 #include <linux/kvm_para.h>
 
 #include "qemu-common.h"
+#include "cpu.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/kvm_int.h"
 #include "kvm_i386.h"
-#include "cpu.h"
 #include "hyperv.h"
 
 #include "exec/gdbstub.h"
target-i386/machine.c +2 -0
index 57203b2..658b066 100644
@@ -1,4 +1,6 @@
 #include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "cpu.h"
 #include "hw/hw.h"
 #include "hw/boards.h"
 #include "hw/i386/pc.h"
target-lm32/gdbstub.c +1 -0
index 8ac1288..cf929dd 100644
@@ -19,6 +19,7 @@
  */
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "cpu.h"
 #include "exec/gdbstub.h"
 #include "hw/lm32/lm32_pic.h"
 
target-lm32/machine.c +2 -0
index 6f56216..3c258a4 100644
@@ -1,4 +1,6 @@
 #include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "cpu.h"
 #include "hw/hw.h"
 #include "hw/boards.h"
 #include "migration/cpu.h"
target-m68k/gdbstub.c +1 -0
index f02bb5c..c7f44c9 100644
@@ -19,6 +19,7 @@
  */
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "cpu.h"
 #include "exec/gdbstub.h"
 
 int m68k_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
target-microblaze/gdbstub.c +1 -0
index 89d3898..7fb076c 100644
@@ -19,6 +19,7 @@
  */
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "cpu.h"
 #include "exec/gdbstub.h"
 
 int mb_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
target-mips/cpu.h +2 -16
index c65f84e..a7c8660 100644
@@ -1145,22 +1145,8 @@ static inline void cpu_mips_store_cause(CPUMIPSState *env, target_ulong val)
 }
 #endif
 
-static inline void QEMU_NORETURN do_raise_exception_err(CPUMIPSState *env,
-                                                        uint32_t exception,
-                                                        int error_code,
-                                                        uintptr_t pc)
-{
-    CPUState *cs = CPU(mips_env_get_cpu(env));
-
-    if (exception < EXCP_SC) {
-        qemu_log_mask(CPU_LOG_INT, "%s: %d %d\n",
-                      __func__, exception, error_code);
-    }
-    cs->exception_index = exception;
-    env->error_code = error_code;
-
-    cpu_loop_exit_restore(cs, pc);
-}
+void QEMU_NORETURN do_raise_exception_err(CPUMIPSState *env, uint32_t exception,
+                                          int error_code, uintptr_t pc);
 
 static inline void QEMU_NORETURN do_raise_exception(CPUMIPSState *env,
                                                     uint32_t exception,
target-mips/gdbstub.c +1 -0
index b0b4a32..2707ff5 100644
@@ -19,6 +19,7 @@
  */
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "cpu.h"
 #include "exec/gdbstub.h"
 
 int mips_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
target-mips/helper.c +17 -0
index cfea177..1f35e7f 100644
@@ -840,3 +840,20 @@ void r4k_invalidate_tlb (CPUMIPSState *env, int idx, int use_extra)
     }
 }
 #endif
+
+void QEMU_NORETURN do_raise_exception_err(CPUMIPSState *env,
+                                          uint32_t exception,
+                                          int error_code,
+                                          uintptr_t pc)
+{
+    CPUState *cs = CPU(mips_env_get_cpu(env));
+
+    if (exception < EXCP_SC) {
+        qemu_log_mask(CPU_LOG_INT, "%s: %d %d\n",
+                      __func__, exception, error_code);
+    }
+    cs->exception_index = exception;
+    env->error_code = error_code;
+
+    cpu_loop_exit_restore(cs, pc);
+}
target-mips/kvm.c +1 -1
index 950bc05..a854e4d 100644
@@ -16,11 +16,11 @@
 #include <linux/kvm.h>
 
 #include "qemu-common.h"
+#include "cpu.h"
 #include "qemu/error-report.h"
 #include "qemu/timer.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/kvm.h"
-#include "cpu.h"
 #include "sysemu/cpus.h"
 #include "kvm_mips.h"
 #include "exec/memattrs.h"
target-mips/machine.c +2 -0
index eb3d916..7314cfe 100644
@@ -1,4 +1,6 @@
 #include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "cpu.h"
 #include "hw/hw.h"
 #include "cpu.h"
 #include "migration/cpu.h"
target-moxie/machine.c +2 -0
index 7810e1c..282dcd8 100644
@@ -1,4 +1,6 @@
 #include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "cpu.h"
 #include "hw/hw.h"
 #include "hw/boards.h"
 #include "machine.h"
target-openrisc/gdbstub.c +1 -0
index edc301a..cb16e76 100644
@@ -19,6 +19,7 @@
  */
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "cpu.h"
 #include "exec/gdbstub.h"
 
 int openrisc_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
target-openrisc/machine.c +2 -0
index bd5d50f..17b0c77 100644
@@ -18,6 +18,8 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "cpu.h"
 #include "hw/hw.h"
 #include "hw/boards.h"
 #include "migration/cpu.h"
target-ppc/gdbstub.c +1 -0
index 569c380..7a33813 100644
@@ -19,6 +19,7 @@
  */
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "cpu.h"
 #include "exec/gdbstub.h"
 
 static int ppc_gdb_register_len_apple(int n)
target-ppc/kvm-stub.c +1 -0
index 627bcb4..efeafca 100644
@@ -11,6 +11,7 @@
  */
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "cpu.h"
 #include "hw/ppc/openpic.h"
 
 int kvm_openpic_connect_vcpu(DeviceState *d, CPUState *cs)
target-ppc/kvm.c +1 -1
index c4c8146..24d6032 100644
@@ -24,11 +24,11 @@
 
 #include "qemu-common.h"
 #include "qemu/error-report.h"
+#include "cpu.h"
 #include "qemu/timer.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/kvm.h"
 #include "kvm_ppc.h"
-#include "cpu.h"
 #include "sysemu/cpus.h"
 #include "sysemu/device_tree.h"
 #include "mmu-hash64.h"
target-ppc/machine.c +2 -0
index c0b9182..4911cb7 100644
@@ -1,4 +1,6 @@
 #include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "cpu.h"
 #include "hw/hw.h"
 #include "hw/boards.h"
 #include "sysemu/kvm.h"
target-s390x/gdbstub.c +1 -0
index 9fc36cb..0992ae7 100644
@@ -19,6 +19,7 @@
  */
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "cpu.h"
 #include "exec/gdbstub.h"
 #include "qemu/bitops.h"
 
target-s390x/kvm.c +1 -1
index 55ae6d3..8f46fd0 100644
@@ -29,12 +29,12 @@
 #include <asm/ptrace.h>
 
 #include "qemu-common.h"
+#include "cpu.h"
 #include "qemu/error-report.h"
 #include "qemu/timer.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/kvm.h"
 #include "hw/hw.h"
-#include "cpu.h"
 #include "sysemu/device_tree.h"
 #include "qapi/qmp/qjson.h"
 #include "exec/gdbstub.h"
target-sh4/gdbstub.c +1 -0
index 1b59ea8..13bea00 100644
@@ -19,6 +19,7 @@
  */
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "cpu.h"
 #include "exec/gdbstub.h"
 
 /* Hint: Use "set architecture sh4" in GDB to see fpu registers */
target-sparc/gdbstub.c +1 -0
index e530dc5..ffc2baa 100644
@@ -19,6 +19,7 @@
  */
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "cpu.h"
 #include "exec/gdbstub.h"
 
 #ifdef TARGET_ABI32
target-sparc/machine.c +2 -0
index 04806f6..c8823af 100644
@@ -1,4 +1,6 @@
 #include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "cpu.h"
 #include "hw/hw.h"
 #include "hw/boards.h"
 #include "qemu/timer.h"
target-xtensa/gdbstub.c +1 -0
index 51d4db0..bfcd591 100644
@@ -19,6 +19,7 @@
  */
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "cpu.h"
 #include "exec/gdbstub.h"
 
 int xtensa_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
tcg/optimize.c +1 -2
index f011608..def4ba6 100644
@@ -24,9 +24,8 @@
  */
 
 #include "qemu/osdep.h"
-
-
 #include "qemu-common.h"
+#include "cpu.h"
 #include "tcg-op.h"
 
 #define CASE_OP_32_64(x)                        \
tcg/tcg-op.c +2 -0
index f554b86..7a15914 100644
@@ -23,6 +23,8 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "cpu.h"
 #include "tcg.h"
 #include "tcg-op.h"
 
tcg/tcg.h +1 -0
index a013d77..8abf318 100644
@@ -26,6 +26,7 @@
 #define TCG_H
 
 #include "qemu-common.h"
+#include "cpu.h"
 #include "qemu/bitops.h"
 #include "tcg-target.h"
 
xen-hvm.c +1 -0
index 039680a..4236f78 100644
@@ -11,6 +11,7 @@
 #include "qemu/osdep.h"
 #include <sys/mman.h>
 
+#include "cpu.h"
 #include "hw/pci/pci.h"
 #include "hw/i386/pc.h"
 #include "hw/i386/apic-msidef.h"
Signature · 1 line
1.8.3.1
#42 lore raw

[Qemu-devel] [PULL 46/52] arm: move arm_log_exception into .c file

In reply to Paolo Bonzini

Avoid need for qemu/log.h inclusion, and make the function static too.

---
 target-arm/helper.c    | 15 +++++++++++++++
 target-arm/internals.h | 15 ---------------
 2 files changed, 15 insertions(+), 15 deletions(-)
target-arm/helper.c +15 -0
index a2ab701..d721c0c 100644
@@ -5819,6 +5819,21 @@ static void do_v7m_exception_exit(CPUARMState *env)
        pointer.  */
 }
 
+static void arm_log_exception(int idx)
+{
+    if (qemu_loglevel_mask(CPU_LOG_INT)) {
+        const char *exc = NULL;
+
+        if (idx >= 0 && idx < ARRAY_SIZE(excnames)) {
+            exc = excnames[idx];
+        }
+        if (!exc) {
+            exc = "unknown";
+        }
+        qemu_log_mask(CPU_LOG_INT, "Taking exception %d [%s]\n", idx, exc);
+    }
+}
+
 void arm_v7m_cpu_do_interrupt(CPUState *cs)
 {
     ARMCPU *cpu = ARM_CPU(cs);
target-arm/internals.h +0 -15
index 54a0fb1..a125873 100644
@@ -72,21 +72,6 @@ static const char * const excnames[] = {
     [EXCP_SEMIHOST] = "Semihosting call",
 };
 
-static inline void arm_log_exception(int idx)
-{
-    if (qemu_loglevel_mask(CPU_LOG_INT)) {
-        const char *exc = NULL;
-
-        if (idx >= 0 && idx < ARRAY_SIZE(excnames)) {
-            exc = excnames[idx];
-        }
-        if (!exc) {
-            exc = "unknown";
-        }
-        qemu_log_mask(CPU_LOG_INT, "Taking exception %d [%s]\n", idx, exc);
-    }
-}
-
 /* Scale factor for generic timers, ie number of ns per tick.
  * This gives a 62.5MHz timer.
  */
Signature · 1 line
1.8.3.1
#43 lore raw

[Qemu-devel] [PULL 49/52] exec: extract exec/tb-context.h

In reply to Paolo Bonzini

TCG backends do not need most of exec-all.h; extract what they actually need to a separate file or move it directly to tcg.h. The next patch will stop including exec-all.h from everywhere.

---
 include/exec/exec-all.h   | 45 +--------------------------------------------
 include/exec/tb-context.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 tcg/optimize.c            |  2 +-
 tcg/tcg-common.c          |  2 ++
 tcg/tcg.h                 | 22 ++++++++++++++++++++++
 5 files changed, 72 insertions(+), 45 deletions(-)
 create mode 100644 include/exec/tb-context.h
include/exec/exec-all.h +1 -44
index 85528f9..fd30a0c 100644
@@ -21,6 +21,7 @@
 #define _EXEC_ALL_H_
 
 #include "qemu-common.h"
+#include "exec/tb-context.h"
 
 /* allow to see translation results - the slowdown should be negligible, so we leave it */
 #define DEBUG_DISAS
@@ -40,30 +41,6 @@ typedef ram_addr_t tb_page_addr_t;
 #define DISAS_UPDATE  2 /* cpu state was modified dynamically */
 #define DISAS_TB_JUMP 3 /* only pc was modified statically */
 
-struct TranslationBlock;
-typedef struct TranslationBlock TranslationBlock;
-
-/* XXX: make safe guess about sizes */
-#define MAX_OP_PER_INSTR 266
-
-#if HOST_LONG_BITS == 32
-#define MAX_OPC_PARAM_PER_ARG 2
-#else
-#define MAX_OPC_PARAM_PER_ARG 1
-#endif
-#define MAX_OPC_PARAM_IARGS 5
-#define MAX_OPC_PARAM_OARGS 1
-#define MAX_OPC_PARAM_ARGS (MAX_OPC_PARAM_IARGS + MAX_OPC_PARAM_OARGS)
-
-/* A Call op needs up to 4 + 2N parameters on 32-bit archs,
- * and up to 4 + N parameters on 64-bit archs
- * (N = number of input arguments + output arguments).  */
-#define MAX_OPC_PARAM (4 + (MAX_OPC_PARAM_PER_ARG * MAX_OPC_PARAM_ARGS))
-#define OPC_BUF_SIZE 640
-#define OPC_MAX_SIZE (OPC_BUF_SIZE - MAX_OP_PER_INSTR)
-
-#define OPPARAM_BUF_SIZE (OPC_BUF_SIZE * MAX_OPC_PARAM)
-
 #include "qemu/log.h"
 
 void gen_intermediate_code(CPUArchState *env, struct TranslationBlock *tb);
@@ -212,9 +189,6 @@ static inline void tlb_flush_by_mmuidx(CPUState *cpu, ...)
 
 #define CODE_GEN_ALIGN           16 /* must be >= of the size of a icache line */
 
-#define CODE_GEN_PHYS_HASH_BITS     15
-#define CODE_GEN_PHYS_HASH_SIZE     (1 << CODE_GEN_PHYS_HASH_BITS)
-
 /* Estimated block size for TB allocation.  */
 /* ??? The following is based on a 2015 survey of x86_64 host output.
    Better would seem to be some sort of dynamically sized TB array,
@@ -289,23 +263,6 @@ struct TranslationBlock {
     uintptr_t jmp_list_first;
 };
 
-#include "qemu/thread.h"
-
-typedef struct TBContext TBContext;
-
-struct TBContext {
-
-    TranslationBlock *tbs;
-    TranslationBlock *tb_phys_hash[CODE_GEN_PHYS_HASH_SIZE];
-    int nb_tbs;
-    /* any access to the tbs or the page table must use this lock */
-    QemuMutex tb_lock;
-
-    /* statistics */
-    int tb_flush_count;
-    int tb_phys_invalidate_count;
-};
-
 void tb_free(TranslationBlock *tb);
 void tb_flush(CPUState *cpu);
 void tb_phys_invalidate(TranslationBlock *tb, tb_page_addr_t page_addr);
include/exec/tb-context.h new file +46 -0

46 lines not on this page · raw message

tcg/optimize.c +1 -1
index def4ba6..c0d975b 100644
@@ -25,7 +25,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu-common.h"
-#include "cpu.h"
+#include "exec/cpu-common.h"
 #include "tcg-op.h"
 
 #define CASE_OP_32_64(x)                        \
tcg/tcg-common.c +2 -0
index 97305a3..2f139de 100644
@@ -23,6 +23,8 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "exec/cpu-common.h"
 #include "tcg/tcg.h"
 
 #if defined(CONFIG_TCG_INTERPRETER)
tcg/tcg.h +22 -0
index 8abf318..909db3f 100644
@@ -27,9 +27,31 @@
 
 #include "qemu-common.h"
 #include "cpu.h"
+#include "exec/tb-context.h"
 #include "qemu/bitops.h"
 #include "tcg-target.h"
 
+/* XXX: make safe guess about sizes */
+#define MAX_OP_PER_INSTR 266
+
+#if HOST_LONG_BITS == 32
+#define MAX_OPC_PARAM_PER_ARG 2
+#else
+#define MAX_OPC_PARAM_PER_ARG 1
+#endif
+#define MAX_OPC_PARAM_IARGS 5
+#define MAX_OPC_PARAM_OARGS 1
+#define MAX_OPC_PARAM_ARGS (MAX_OPC_PARAM_IARGS + MAX_OPC_PARAM_OARGS)
+
+/* A Call op needs up to 4 + 2N parameters on 32-bit archs,
+ * and up to 4 + N parameters on 64-bit archs
+ * (N = number of input arguments + output arguments).  */
+#define MAX_OPC_PARAM (4 + (MAX_OPC_PARAM_PER_ARG * MAX_OPC_PARAM_ARGS))
+#define OPC_BUF_SIZE 640
+#define OPC_MAX_SIZE (OPC_BUF_SIZE - MAX_OP_PER_INSTR)
+
+#define OPPARAM_BUF_SIZE (OPC_BUF_SIZE * MAX_OPC_PARAM)
+
 #define CPU_TEMP_BUF_NLONGS 128
 
 /* Default target word size to pointer size.  */
Signature · 1 line
1.8.3.1
#44 lore raw

[Qemu-devel] [PULL 39/52] qemu-common: stop including qemu/bswap.h from qemu-common.h

In reply to Paolo Bonzini

Move it to the actual users. There are still a few includes of qemu/bswap.h in headers; removing them is left for future work.

---
 audio/mixeng.c         | 1 +
 block/bochs.c          | 1 +
 block/cloop.c          | 1 +
 block/parallels.c      | 1 +
 block/qcow.c           | 1 +
 block/qcow2-cluster.c  | 1 +
 block/qcow2-refcount.c | 1 +
 block/qcow2-snapshot.c | 1 +
 block/qcow2.c          | 1 +
 block/qed-table.c      | 1 +
 block/qed.c            | 1 +
 block/vdi.c            | 1 +
 block/vhdx-endian.c    | 1 +
 block/vhdx-log.c       | 1 +
 block/vhdx.c           | 1 +
 block/vmdk.c           | 1 +
 block/vpc.c            | 1 +
 block/vvfat.c          | 1 +
 crypto/afsplit.c       | 1 +
 crypto/block-luks.c    | 1 +
 device_tree.c          | 1 +
 hw/arm/nseries.c       | 1 +
 hw/block/hd-geometry.c | 1 +
 hw/bt/hci-csr.c        | 1 +
 hw/bt/l2cap.c          | 1 +
 include/qemu-common.h  | 2 --
 io/channel-websock.c   | 1 +
 nbd/nbd-internal.h     | 1 +
 qemu-nbd.c             | 1 +
 tests/ide-test.c       | 1 +
 ui/vnc-ws.c            | 1 +
 31 files changed, 30 insertions(+), 2 deletions(-)
audio/mixeng.c +1 -0
index 61ef869..66c0328 100644
@@ -24,6 +24,7 @@
  */
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "qemu/bswap.h"
 #include "audio.h"
 
 #define AUDIO_CAP "mixeng"
block/bochs.c +1 -0
index f0e18c0..6c8d0f3 100644
@@ -27,6 +27,7 @@
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/module.h"
+#include "qemu/bswap.h"
 
 /**************************************************************/
 
block/cloop.c +1 -0
index fc1ca3a..ea5a92b 100644
@@ -26,6 +26,7 @@
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/module.h"
+#include "qemu/bswap.h"
 #include <zlib.h>
 
 /* Maximum compressed block size */
block/parallels.c +1 -0
index cddbfc4..88cface 100644
@@ -33,6 +33,7 @@
 #include "block/block_int.h"
 #include "sysemu/block-backend.h"
 #include "qemu/module.h"
+#include "qemu/bswap.h"
 #include "qemu/bitmap.h"
 #include "qapi/util.h"
 
block/qcow.c +1 -0
index d6dc1b0..cb4bf02 100644
@@ -28,6 +28,7 @@
 #include "block/block_int.h"
 #include "sysemu/block-backend.h"
 #include "qemu/module.h"
+#include "qemu/bswap.h"
 #include <zlib.h>
 #include "qapi/qmp/qerror.h"
 #include "crypto/cipher.h"
block/qcow2-cluster.c +1 -0
index 31ecc10..892e0fb 100644
@@ -29,6 +29,7 @@
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "block/qcow2.h"
+#include "qemu/bswap.h"
 #include "trace.h"
 
 int qcow2_grow_l1_table(BlockDriverState *bs, uint64_t min_size,
block/qcow2-refcount.c +1 -0
index ca6094f..7fa972a 100644
@@ -28,6 +28,7 @@
 #include "block/block_int.h"
 #include "block/qcow2.h"
 #include "qemu/range.h"
+#include "qemu/bswap.h"
 
 static int64_t alloc_clusters_noref(BlockDriverState *bs, uint64_t size);
 static int QEMU_WARN_UNUSED_RESULT update_refcount(BlockDriverState *bs,
block/qcow2-snapshot.c +1 -0
index 5f4a17e..242fb21 100644
@@ -26,6 +26,7 @@
 #include "qapi/error.h"
 #include "block/block_int.h"
 #include "block/qcow2.h"
+#include "qemu/bswap.h"
 #include "qemu/error-report.h"
 #include "qemu/cutils.h"
 
block/qcow2.c +1 -0
index 62febfc..49d7cff 100644
@@ -36,6 +36,7 @@
 #include "trace.h"
 #include "qemu/option_int.h"
 #include "qemu/cutils.h"
+#include "qemu/bswap.h"
 
 /*
   Differences with QCOW:
block/qed-table.c +1 -0
index 802945f..c841ad1 100644
@@ -16,6 +16,7 @@
 #include "trace.h"
 #include "qemu/sockets.h" /* for EINPROGRESS on Windows */
 #include "qed.h"
+#include "qemu/bswap.h"
 
 typedef struct {
     GenericCB gencb;
block/qed.c +1 -0
index 10ce18e..b591d4a 100644
@@ -15,6 +15,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qemu/timer.h"
+#include "qemu/bswap.h"
 #include "trace.h"
 #include "qed.h"
 #include "qapi/qmp/qerror.h"
block/vdi.c +1 -0
index 54e1144..7d9ab9c 100644
@@ -54,6 +54,7 @@
 #include "block/block_int.h"
 #include "sysemu/block-backend.h"
 #include "qemu/module.h"
+#include "qemu/bswap.h"
 #include "migration/migration.h"
 #include "qemu/coroutine.h"
 #include "qemu/cutils.h"
block/vhdx-endian.c +1 -0
index da33cd3..c306b90 100644
@@ -18,6 +18,7 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
+#include "qemu/bswap.h"
 #include "block/vhdx.h"
 
 #include <uuid/uuid.h>
block/vhdx-log.c +1 -0
index 7ea7187..8ab7d22 100644
@@ -23,6 +23,7 @@
 #include "block/block_int.h"
 #include "qemu/error-report.h"
 #include "qemu/module.h"
+#include "qemu/bswap.h"
 #include "block/vhdx.h"
 
 
block/vhdx.c +1 -0
index ec778fe..c0d24a2 100644
@@ -22,6 +22,7 @@
 #include "sysemu/block-backend.h"
 #include "qemu/module.h"
 #include "qemu/crc32c.h"
+#include "qemu/bswap.h"
 #include "block/vhdx.h"
 #include "migration/migration.h"
 
block/vmdk.c +1 -0
index e6c97c2..1cb4b85 100644
@@ -30,6 +30,7 @@
 #include "qapi/qmp/qerror.h"
 #include "qemu/error-report.h"
 #include "qemu/module.h"
+#include "qemu/bswap.h"
 #include "migration/migration.h"
 #include "qemu/cutils.h"
 #include <zlib.h>
block/vpc.c +1 -0
index 0379813..076a7ce 100644
@@ -29,6 +29,7 @@
 #include "sysemu/block-backend.h"
 #include "qemu/module.h"
 #include "migration/migration.h"
+#include "qemu/bswap.h"
 #if defined(CONFIG_UUID)
 #include <uuid/uuid.h>
 #endif
block/vvfat.c +1 -0
index 5b0c8dd..3e484a1 100644
@@ -27,6 +27,7 @@
 #include "qapi/error.h"
 #include "block/block_int.h"
 #include "qemu/module.h"
+#include "qemu/bswap.h"
 #include "migration/migration.h"
 #include "qapi/qmp/qint.h"
 #include "qapi/qmp/qbool.h"
crypto/afsplit.c +1 -0
index 8074913..825e2cf 100644
@@ -24,6 +24,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/bswap.h"
 #include "crypto/afsplit.h"
 #include "crypto/random.h"
 
crypto/block-luks.c +1 -0
index 439f892..17c4300 100644
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
+#include "qemu/bswap.h"
 
 #include "crypto/block-luks.h"
 
device_tree.c +1 -0
index ccba1fd..6e06320 100644
@@ -20,6 +20,7 @@
 #include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/error-report.h"
+#include "qemu/bswap.h"
 #include "sysemu/device_tree.h"
 #include "sysemu/sysemu.h"
 #include "hw/loader.h"
hw/arm/nseries.c +1 -0
index c7068c0..f3a9b1a 100644
@@ -21,6 +21,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qemu/cutils.h"
+#include "qemu/bswap.h"
 #include "sysemu/sysemu.h"
 #include "hw/arm/omap.h"
 #include "hw/arm/arm.h"
hw/block/hd-geometry.c +1 -0
index d388f13..57ad501 100644
@@ -32,6 +32,7 @@
 
 #include "qemu/osdep.h"
 #include "sysemu/block-backend.h"
+#include "qemu/bswap.h"
 #include "hw/block/block.h"
 #include "trace.h"
 
hw/bt/hci-csr.c +1 -0
index 2e970b6..e6b8998 100644
@@ -22,6 +22,7 @@
 #include "qemu-common.h"
 #include "sysemu/char.h"
 #include "qemu/timer.h"
+#include "qemu/bswap.h"
 #include "hw/irq.h"
 #include "sysemu/bt.h"
 #include "hw/bt.h"
hw/bt/l2cap.c +1 -0
index 8065251..dfc95ed 100644
@@ -20,6 +20,7 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/timer.h"
+#include "qemu/bswap.h"
 #include "hw/bt.h"
 
 #define L2CAP_CID_MAX	0x100	/* Between 0x40 and 0x10000 */
include/qemu-common.h +0 -2
index f0d74076..dc041fc 100644
@@ -23,8 +23,6 @@
 #include "qemu/option.h"
 #include "qemu/host-utils.h"
 
-#include "qemu/bswap.h"
-
 /* FIXME: Remove NEED_CPU_H.  */
 #ifdef NEED_CPU_H
 #include "cpu.h"
io/channel-websock.c +1 -0
index 7081787..239c75a 100644
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
+#include "qemu/bswap.h"
 #include "io/channel-websock.h"
 #include "crypto/hash.h"
 #include "trace.h"
nbd/nbd-internal.h +1 -0
index 3791535..26a9f4d 100644
@@ -27,6 +27,7 @@
 #include <linux/fs.h>
 #endif
 
+#include "qemu/bswap.h"
 #include "qemu/queue.h"
 #include "qemu/main-loop.h"
 
qemu-nbd.c +1 -0
index 3e54113..d59b187 100644
@@ -26,6 +26,7 @@
 #include "qemu/main-loop.h"
 #include "qemu/error-report.h"
 #include "qemu/config-file.h"
+#include "qemu/bswap.h"
 #include "block/snapshot.h"
 #include "qapi/util.h"
 #include "qapi/qmp/qstring.h"
tests/ide-test.c +1 -0
index 0d9ab4d..67e5c1f 100644
@@ -32,6 +32,7 @@
 #include "libqos/malloc-pc.h"
 
 #include "qemu-common.h"
+#include "qemu/bswap.h"
 #include "hw/pci/pci_ids.h"
 #include "hw/pci/pci_regs.h"
 
ui/vnc-ws.c +1 -0
index 7c79a4c..3bac46e 100644
@@ -22,6 +22,7 @@
 #include "qapi/error.h"
 #include "vnc.h"
 #include "io/channel-websock.h"
+#include "qemu/bswap.h"
 
 static void vncws_tls_handshake_done(Object *source,
                                      Error *err,
Signature · 1 line
1.8.3.1
#45 lore raw

[Qemu-devel] [PULL 40/52] qemu-common: stop including qemu/host-utils.h from qemu-common.h

In reply to Paolo Bonzini

Move it to the actual users. There are some inclusions of qemu/host-utils.h in headers, but they are all necessary.

---
 audio/noaudio.c                         | 1 +
 audio/spiceaudio.c                      | 1 +
 audio/wavaudio.c                        | 2 +-
 contrib/ivshmem-server/ivshmem-server.c | 1 +
 hw/acpi/core.c                          | 6 ++++++
 hw/bt/sdp.c                             | 1 +
 hw/display/tc6393xb.c                   | 1 +
 include/exec/cpu-defs.h                 | 1 +
 include/hw/acpi/acpi.h                  | 7 -------
 include/qemu-common.h                   | 1 -
 page_cache.c                            | 1 +
 slirp/slirp.h                           | 1 +
 stubs/slirp.c                           | 1 +
 tests/libqos/malloc.c                   | 1 +
 util/buffer.c                           | 1 +
 15 files changed, 18 insertions(+), 9 deletions(-)
audio/noaudio.c +1 -0
index b360c19..9ca9eaf 100644
@@ -23,6 +23,7 @@
  */
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "qemu/host-utils.h"
 #include "audio.h"
 #include "qemu/timer.h"
 
audio/spiceaudio.c +1 -0
index dea71d3..5580e76 100644
@@ -19,6 +19,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "qemu/host-utils.h"
 #include "qemu/error-report.h"
 #include "qemu/timer.h"
 #include "ui/qemu-spice.h"
audio/wavaudio.c +1 -1
index 345952e..341eec3 100644
@@ -22,7 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
-#include "hw/hw.h"
+#include "qemu/host-utils.h"
 #include "qemu/timer.h"
 #include "audio.h"
 
contrib/ivshmem-server/ivshmem-server.c +1 -0
index 172db78..bf4ee0b 100644
@@ -7,6 +7,7 @@
  */
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "qemu/host-utils.h"
 #include "qemu/sockets.h"
 
 #include <sys/mman.h>
hw/acpi/core.c +6 -0
index 6a2f452..1ffd155 100644
@@ -491,6 +491,12 @@ void acpi_pm_tmr_update(ACPIREGS *ar, bool enable)
     }
 }
 
+static inline int64_t acpi_pm_tmr_get_clock(void)
+{
+    return muldiv64(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL), PM_TIMER_FREQUENCY,
+                    NANOSECONDS_PER_SECOND);
+}
+
 void acpi_pm_tmr_calc_overflow_time(ACPIREGS *ar)
 {
     int64_t d = acpi_pm_tmr_get_clock();
hw/bt/sdp.c +1 -0
index be26009..f67b3b8 100644
@@ -19,6 +19,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "qemu/host-utils.h"
 #include "hw/bt.h"
 
 struct bt_l2cap_sdp_state_s {
hw/display/tc6393xb.c +1 -0
index da3cece..92f7120 100644
@@ -12,6 +12,7 @@
  */
 #include "qemu/osdep.h"
 #include "qapi/error.h"
+#include "qemu/host-utils.h"
 #include "hw/hw.h"
 #include "hw/devices.h"
 #include "hw/block/flash.h"
include/exec/cpu-defs.h +1 -0
index 854e7e3..5f4e303 100644
@@ -23,6 +23,7 @@
 #error cpu.h included from common code
 #endif
 
+#include "qemu/host-utils.h"
 #include "qemu/queue.h"
 #include "tcg-target.h"
 #ifndef CONFIG_USER_ONLY
include/hw/acpi/acpi.h +0 -7
index e0978c8..dc6ee00 100644
@@ -150,13 +150,6 @@ void acpi_pm_tmr_init(ACPIREGS *ar, acpi_update_sci_fn update_sci,
                       MemoryRegion *parent);
 void acpi_pm_tmr_reset(ACPIREGS *ar);
 
-#include "qemu/timer.h"
-static inline int64_t acpi_pm_tmr_get_clock(void)
-{
-    return muldiv64(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL), PM_TIMER_FREQUENCY,
-                    NANOSECONDS_PER_SECOND);
-}
-
 /* PM1a_EVT: piix and ich9 don't implement PM1b. */
 uint16_t acpi_pm1_evt_get_sts(ACPIREGS *ar);
 void acpi_pm1_evt_power_down(ACPIREGS *ar);
include/qemu-common.h +0 -1
index dc041fc..cd3139b 100644
@@ -21,7 +21,6 @@
 #define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR)
 
 #include "qemu/option.h"
-#include "qemu/host-utils.h"
 
 /* FIXME: Remove NEED_CPU_H.  */
 #ifdef NEED_CPU_H
page_cache.c +1 -0
index cb8a69e..37a66e4 100644
@@ -16,6 +16,7 @@
 #include <glib.h>
 
 #include "qemu-common.h"
+#include "qemu/host-utils.h"
 #include "migration/page_cache.h"
 
 #ifdef DEBUG_CACHE
slirp/slirp.h +1 -0
index e373876..5df755e 100644
@@ -1,6 +1,7 @@
 #ifndef __COMMON_H__
 #define __COMMON_H__
 
+#include "qemu/host-utils.h"
 #include "slirp_config.h"
 
 #ifdef _WIN32
stubs/slirp.c +1 -0
index dcae51f..42f7e1a 100644
@@ -1,5 +1,6 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "qemu/host-utils.h"
 #include "slirp/slirp.h"
 
 void slirp_pollfds_fill(GArray *pollfds, uint32_t *timeout)
tests/libqos/malloc.c +1 -0
index c0df52f..793fe69 100644
@@ -13,6 +13,7 @@
 #include "qemu/osdep.h"
 #include "libqos/malloc.h"
 #include "qemu-common.h"
+#include "qemu/host-utils.h"
 #include <glib.h>
 
 typedef QTAILQ_HEAD(MemList, MemBlock) MemList;
util/buffer.c +1 -0
index 33e94d1..d8bb874 100644
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/host-utils.h"
 #include "qemu/buffer.h"
 #include "trace.h"
 
Signature · 1 line
1.8.3.1
#46 lore raw

[Qemu-devel] [PULL 38/52] cpu: move endian-dependent load/store functions to cpu-all.h

In reply to Paolo Bonzini

Disentangle cpu-common.h and memory.h from NEED_CPU_H. Prototypes are not defined for !NEED_CPU_H, so remove them from poison.h too. Only macros need poisoning.

---
 include/exec/cpu-all.h    | 25 +++++++++++++++++++++++++
 include/exec/cpu-common.h | 10 ----------
 include/exec/memory.h     | 17 -----------------
 include/exec/poison.h     |  8 --------
 4 files changed, 25 insertions(+), 35 deletions(-)
include/exec/cpu-all.h +25 -0
index 08e5093..3911576 100644
@@ -165,6 +165,31 @@ extern unsigned long reserved_va;
 
 #define GUEST_ADDR_MAX (reserved_va ? reserved_va : \
                                     (1ul << TARGET_VIRT_ADDR_SPACE_BITS) - 1)
+#else
+
+#include "exec/hwaddr.h"
+uint32_t lduw_phys(AddressSpace *as, hwaddr addr);
+uint32_t ldl_phys(AddressSpace *as, hwaddr addr);
+uint64_t ldq_phys(AddressSpace *as, hwaddr addr);
+void stl_phys_notdirty(AddressSpace *as, hwaddr addr, uint32_t val);
+void stw_phys(AddressSpace *as, hwaddr addr, uint32_t val);
+void stl_phys(AddressSpace *as, hwaddr addr, uint32_t val);
+void stq_phys(AddressSpace *as, hwaddr addr, uint64_t val);
+
+uint32_t address_space_lduw(AddressSpace *as, hwaddr addr,
+                            MemTxAttrs attrs, MemTxResult *result);
+uint32_t address_space_ldl(AddressSpace *as, hwaddr addr,
+                            MemTxAttrs attrs, MemTxResult *result);
+uint64_t address_space_ldq(AddressSpace *as, hwaddr addr,
+                            MemTxAttrs attrs, MemTxResult *result);
+void address_space_stl_notdirty(AddressSpace *as, hwaddr addr, uint32_t val,
+                            MemTxAttrs attrs, MemTxResult *result);
+void address_space_stw(AddressSpace *as, hwaddr addr, uint32_t val,
+                            MemTxAttrs attrs, MemTxResult *result);
+void address_space_stl(AddressSpace *as, hwaddr addr, uint32_t val,
+                            MemTxAttrs attrs, MemTxResult *result);
+void address_space_stq(AddressSpace *as, hwaddr addr, uint64_t val,
+                            MemTxAttrs attrs, MemTxResult *result);
 #endif
 
 /* page related stuff */
include/exec/cpu-common.h +0 -10
index 4f59034..04eade5 100644
@@ -109,16 +109,6 @@ void stl_be_phys(AddressSpace *as, hwaddr addr, uint32_t val);
 void stq_le_phys(AddressSpace *as, hwaddr addr, uint64_t val);
 void stq_be_phys(AddressSpace *as, hwaddr addr, uint64_t val);
 
-#ifdef NEED_CPU_H
-uint32_t lduw_phys(AddressSpace *as, hwaddr addr);
-uint32_t ldl_phys(AddressSpace *as, hwaddr addr);
-uint64_t ldq_phys(AddressSpace *as, hwaddr addr);
-void stl_phys_notdirty(AddressSpace *as, hwaddr addr, uint32_t val);
-void stw_phys(AddressSpace *as, hwaddr addr, uint32_t val);
-void stl_phys(AddressSpace *as, hwaddr addr, uint32_t val);
-void stq_phys(AddressSpace *as, hwaddr addr, uint64_t val);
-#endif
-
 void cpu_physical_memory_write_rom(AddressSpace *as, hwaddr addr,
                                    const uint8_t *buf, int len);
 void cpu_flush_icache_range(hwaddr start, int len);
include/exec/memory.h +0 -17
index e2a3e99..7fb9188 100644
@@ -1292,23 +1292,6 @@ void address_space_stq_le(AddressSpace *as, hwaddr addr, uint64_t val,
 void address_space_stq_be(AddressSpace *as, hwaddr addr, uint64_t val,
                             MemTxAttrs attrs, MemTxResult *result);
 
-#ifdef NEED_CPU_H
-uint32_t address_space_lduw(AddressSpace *as, hwaddr addr,
-                            MemTxAttrs attrs, MemTxResult *result);
-uint32_t address_space_ldl(AddressSpace *as, hwaddr addr,
-                            MemTxAttrs attrs, MemTxResult *result);
-uint64_t address_space_ldq(AddressSpace *as, hwaddr addr,
-                            MemTxAttrs attrs, MemTxResult *result);
-void address_space_stl_notdirty(AddressSpace *as, hwaddr addr, uint32_t val,
-                            MemTxAttrs attrs, MemTxResult *result);
-void address_space_stw(AddressSpace *as, hwaddr addr, uint32_t val,
-                            MemTxAttrs attrs, MemTxResult *result);
-void address_space_stl(AddressSpace *as, hwaddr addr, uint32_t val,
-                            MemTxAttrs attrs, MemTxResult *result);
-void address_space_stq(AddressSpace *as, hwaddr addr, uint64_t val,
-                            MemTxAttrs attrs, MemTxResult *result);
-#endif
-
 /* address_space_translate: translate an address range into an address space
  * into a MemoryRegion and an address range into that section.  Should be
  * called from an RCU critical section, to avoid that the last reference
include/exec/poison.h +0 -8
index a4b1eca..3ca7929 100644
@@ -37,14 +37,6 @@
 
 #pragma GCC poison CPUArchState
 
-#pragma GCC poison lduw_phys
-#pragma GCC poison ldl_phys
-#pragma GCC poison ldq_phys
-#pragma GCC poison stl_phys_notdirty
-#pragma GCC poison stw_phys
-#pragma GCC poison stl_phys
-#pragma GCC poison stq_phys
-
 #pragma GCC poison CPU_INTERRUPT_HARD
 #pragma GCC poison CPU_INTERRUPT_EXITTB
 #pragma GCC poison CPU_INTERRUPT_HALT
Signature · 1 line
1.8.3.1
#47 lore raw

[Qemu-devel] [PULL 43/52] s390x: reorganize CSS bits between cpu.h and other headers

In reply to Paolo Bonzini

Move cpu_inject_* to the only C file where they are used.

Move ioinst.h declarations that need S390CPU to cpu.h, to make ioinst.h independent of cpu.h.

Move channel declarations that only need SubchDev from cpu.h to css.h, to make more channel users independent of cpu.h.

---
 hw/s390x/css.c                              |   4 +-
 hw/s390x/s390-skeys.c                       |   1 +
 hw/s390x/s390-virtio-ccw.c                  |   4 +-
 hw/s390x/virtio-ccw.c                       |   5 +-
 hw/s390x/virtio-ccw.h                       |   3 +-
 {hw => include/hw}/s390x/css.h              |  34 ++++++++-
 {target-s390x => include/hw/s390x}/ioinst.h |  16 +---
 target-s390x/cpu.h                          | 113 +++++-----------------------
 target-s390x/helper.c                       |   1 +
 target-s390x/interrupt.c                    |  66 +++++++++++++++-
 target-s390x/ioinst.c                       |   2 +-
 11 files changed, 129 insertions(+), 120 deletions(-)
 rename {hw => include/hw}/s390x/css.h (76%)
 rename {target-s390x => include/hw/s390x}/ioinst.h (87%)
hw/s390x/css.c +2 -2
index 3a1d919..1675a19 100644
@@ -14,8 +14,8 @@
 #include "qemu/bitops.h"
 #include "exec/address-spaces.h"
 #include "cpu.h"
-#include "ioinst.h"
-#include "css.h"
+#include "hw/s390x/ioinst.h"
+#include "hw/s390x/css.h"
 #include "trace.h"
 #include "hw/s390x/s390_flic.h"
 
hw/s390x/s390-skeys.c +1 -0
index 6528ffe..d772cfc 100644
@@ -15,6 +15,7 @@
 #include "migration/qemu-file.h"
 #include "hw/s390x/storage-keys.h"
 #include "qemu/error-report.h"
+#include "sysemu/kvm.h"
 
 #define S390_SKEYS_BUFFER_SIZE 131072  /* Room for 128k storage keys */
 #define S390_SKEYS_SAVE_FLAG_EOS 0x01
hw/s390x/s390-virtio-ccw.c +2 -2
index 4456fce..18bbbfb 100644
@@ -18,8 +18,8 @@
 #include "s390-virtio.h"
 #include "hw/s390x/sclp.h"
 #include "hw/s390x/s390_flic.h"
-#include "ioinst.h"
-#include "css.h"
+#include "hw/s390x/ioinst.h"
+#include "hw/s390x/css.h"
 #include "virtio-ccw.h"
 #include "qemu/config-file.h"
 #include "s390-pci-bus.h"
hw/s390x/virtio-ccw.c +3 -2
index d51642d..a1c1ed9 100644
@@ -16,6 +16,7 @@
 #include "sysemu/block-backend.h"
 #include "sysemu/blockdev.h"
 #include "sysemu/sysemu.h"
+#include "sysemu/kvm.h"
 #include "net/net.h"
 #include "hw/virtio/virtio.h"
 #include "hw/virtio/virtio-serial.h"
@@ -28,8 +29,8 @@
 #include "hw/s390x/adapter.h"
 #include "hw/s390x/s390_flic.h"
 
-#include "ioinst.h"
-#include "css.h"
+#include "hw/s390x/ioinst.h"
+#include "hw/s390x/css.h"
 #include "virtio-ccw.h"
 #include "trace.h"
 
hw/s390x/virtio-ccw.h +2 -1
index 66c831b..86b9edb 100644
@@ -24,7 +24,8 @@
 #include <hw/virtio/virtio-rng.h>
 #include <hw/virtio/virtio-bus.h>
 
-#include "css.h"
+#include <hw/s390x/s390_flic.h>
+#include <hw/s390x/css.h>
 
 #define VIRTUAL_CSSID 0xfe
 
include/hw/s390x/css.h renamed from hw/s390x/css.h +31 -3
similarity index 76%
rename from hw/s390x/css.h
rename to include/hw/s390x/css.h
index a320eea..423acaa 100644
@@ -14,7 +14,7 @@
 
 #include "hw/s390x/adapter.h"
 #include "hw/s390x/s390_flic.h"
-#include "ioinst.h"
+#include "hw/s390x/ioinst.h"
 
 /* Channel subsystem constants. */
 #define MAX_SCHID 65535
@@ -67,7 +67,7 @@ typedef struct CMBE {
     uint32_t reserved[7];
 } QEMU_PACKED CMBE;
 
-struct SubchDev {
+typedef struct SubchDev {
     /* channel-subsystem related things: */
     uint8_t cssid;
     uint8_t ssid;
@@ -86,7 +86,7 @@ struct SubchDev {
     void (*disable_cb)(SubchDev *);
     SenseId id;
     void *driver_data;
-};
+} SubchDev;
 
 typedef struct IndAddr {
     hwaddr addr;
@@ -123,4 +123,32 @@ void css_adapter_interrupt(uint8_t isc);
 #define CSS_IO_ADAPTER_VIRTIO 1
 int css_register_io_adapter(uint8_t type, uint8_t isc, bool swap,
                             bool maskable, uint32_t *id);
+
+#ifndef CONFIG_USER_ONLY
+SubchDev *css_find_subch(uint8_t m, uint8_t cssid, uint8_t ssid,
+                         uint16_t schid);
+bool css_subch_visible(SubchDev *sch);
+void css_conditional_io_interrupt(SubchDev *sch);
+int css_do_stsch(SubchDev *sch, SCHIB *schib);
+bool css_schid_final(int m, uint8_t cssid, uint8_t ssid, uint16_t schid);
+int css_do_msch(SubchDev *sch, const SCHIB *schib);
+int css_do_xsch(SubchDev *sch);
+int css_do_csch(SubchDev *sch);
+int css_do_hsch(SubchDev *sch);
+int css_do_ssch(SubchDev *sch, ORB *orb);
+int css_do_tsch_get_irb(SubchDev *sch, IRB *irb, int *irb_len);
+void css_do_tsch_update_subch(SubchDev *sch);
+int css_do_stcrw(CRW *crw);
+void css_undo_stcrw(CRW *crw);
+int css_do_tpi(IOIntCode *int_code, int lowcore);
+int css_collect_chp_desc(int m, uint8_t cssid, uint8_t f_chpid, uint8_t l_chpid,
+                         int rfmt, void *buf);
+void css_do_schm(uint8_t mbk, int update, int dct, uint64_t mbo);
+int css_enable_mcsse(void);
+int css_enable_mss(void);
+int css_do_rsch(SubchDev *sch);
+int css_do_rchp(uint8_t cssid, uint8_t chpid);
+bool css_present(uint8_t cssid);
+#endif
+
 #endif
include/hw/s390x/ioinst.h renamed from target-s390x/ioinst.h +1 -15
similarity index 87%
rename from target-s390x/ioinst.h
rename to include/hw/s390x/ioinst.h
index 013cc91..12d44c8 100644
@@ -11,6 +11,7 @@
 
 #ifndef IOINST_S390X_H
 #define IOINST_S390X_H
+
 /*
  * Channel I/O related definitions, as defined in the Principles
  * Of Operation (and taken from the Linux implementation).
@@ -227,20 +228,5 @@ typedef struct IOIntCode {
 
 int ioinst_disassemble_sch_ident(uint32_t value, int *m, int *cssid, int *ssid,
                                  int *schid);
-void ioinst_handle_xsch(S390CPU *cpu, uint64_t reg1);
-void ioinst_handle_csch(S390CPU *cpu, uint64_t reg1);
-void ioinst_handle_hsch(S390CPU *cpu, uint64_t reg1);
-void ioinst_handle_msch(S390CPU *cpu, uint64_t reg1, uint32_t ipb);
-void ioinst_handle_ssch(S390CPU *cpu, uint64_t reg1, uint32_t ipb);
-void ioinst_handle_stcrw(S390CPU *cpu, uint32_t ipb);
-void ioinst_handle_stsch(S390CPU *cpu, uint64_t reg1, uint32_t ipb);
-int ioinst_handle_tsch(S390CPU *cpu, uint64_t reg1, uint32_t ipb);
-void ioinst_handle_chsc(S390CPU *cpu, uint32_t ipb);
-int ioinst_handle_tpi(S390CPU *cpu, uint32_t ipb);
-void ioinst_handle_schm(S390CPU *cpu, uint64_t reg1, uint64_t reg2,
-                        uint32_t ipb);
-void ioinst_handle_rsch(S390CPU *cpu, uint64_t reg1);
-void ioinst_handle_rchp(S390CPU *cpu, uint64_t reg1);
-void ioinst_handle_sal(S390CPU *cpu, uint64_t reg1);
 
 #endif
target-s390x/cpu.h +20 -93

138 lines not on this page · raw message

target-s390x/helper.c +1 -0
index 92abe7e..423dd72 100644
@@ -24,6 +24,7 @@
 #include "exec/gdbstub.h"
 #include "qemu/timer.h"
 #include "exec/cpu_ldst.h"
+#include "hw/s390x/ioinst.h"
 #ifndef CONFIG_USER_ONLY
 #include "sysemu/sysemu.h"
 #endif
target-s390x/interrupt.c +65 -1

78 lines not on this page · raw message

target-s390x/ioinst.c +1 -1
index f5498aa..a5a288b 100644
@@ -12,7 +12,7 @@
 #include "qemu/osdep.h"
 
 #include "cpu.h"
-#include "ioinst.h"
+#include "hw/s390x/ioinst.h"
 #include "trace.h"
 #include "hw/s390x/s390-pci-bus.h"
 
Signature · 1 line
1.8.3.1
#48 lore raw

[Qemu-devel] [PULL 51/52] hw: remove pio_addr_t

In reply to Paolo Bonzini

pio_addr_t is almost unused, because these days I/O ports are simply accessed through the address space. cpu_{in,out}[bwl] themselves are almost unused; monitor.c and xen-hvm.c could use address_space_read/write directly, since they have an integer size at hand. This leaves qtest as the only user of those functions.

On the other hand even portio_* functions use this type; the only interesting use of pio_addr_t thus is include/hw/sysbus.h. I guess I could move it there, but I don't see much benefit in that either. Using uint32_t is enough and avoids the need to include ioport.h everywhere.

---
 hw/core/sysbus.c      |  4 ++--
 include/exec/ioport.h | 15 ++++++---------
 include/hw/sysbus.h   |  4 ++--
 ioport.c              | 12 ++++++------
 xen-hvm.c             |  8 ++++----
 5 files changed, 20 insertions(+), 23 deletions(-)
hw/core/sysbus.c +2 -2
index a7dbe2b..c0f560b 100644
@@ -190,9 +190,9 @@ MemoryRegion *sysbus_mmio_get_region(SysBusDevice *dev, int n)
     return dev->mmio[n].memory;
 }
 
-void sysbus_init_ioports(SysBusDevice *dev, pio_addr_t ioport, pio_addr_t size)
+void sysbus_init_ioports(SysBusDevice *dev, uint32_t ioport, uint32_t size)
 {
-    pio_addr_t i;
+    uint32_t i;
 
     for (i = 0; i < size; i++) {
         assert(dev->num_pio < QDEV_MAX_PIO);
include/exec/ioport.h +6 -9
index 3bd6722..6a9639c 100644
@@ -28,9 +28,6 @@
 #include "qom/object.h"
 #include "exec/memory.h"
 
-typedef uint32_t pio_addr_t;
-#define FMT_pioaddr     PRIx32
-
 #define MAX_IOPORTS     (64 * 1024)
 #define IOPORTS_MASK    (MAX_IOPORTS - 1)
 
@@ -49,12 +46,12 @@ typedef struct MemoryRegionPortio {
 extern const MemoryRegionOps unassigned_io_ops;
 #endif
 
-void cpu_outb(pio_addr_t addr, uint8_t val);
-void cpu_outw(pio_addr_t addr, uint16_t val);
-void cpu_outl(pio_addr_t addr, uint32_t val);
-uint8_t cpu_inb(pio_addr_t addr);
-uint16_t cpu_inw(pio_addr_t addr);
-uint32_t cpu_inl(pio_addr_t addr);
+void cpu_outb(uint32_t addr, uint8_t val);
+void cpu_outw(uint32_t addr, uint16_t val);
+void cpu_outl(uint32_t addr, uint32_t val);
+uint8_t cpu_inb(uint32_t addr);
+uint16_t cpu_inw(uint32_t addr);
+uint32_t cpu_inl(uint32_t addr);
 
 typedef struct PortioList {
     const struct MemoryRegionPortio *ports;
include/hw/sysbus.h +2 -2
index cc1dba4..a495937 100644
@@ -72,7 +72,7 @@ struct SysBusDevice {
         MemoryRegion *memory;
     } mmio[QDEV_MAX_MMIO];
     int num_pio;
-    pio_addr_t pio[QDEV_MAX_PIO];
+    uint32_t pio[QDEV_MAX_PIO];
 };
 
 typedef int FindSysbusDeviceFunc(SysBusDevice *sbdev, void *opaque);
@@ -81,7 +81,7 @@ void sysbus_init_mmio(SysBusDevice *dev, MemoryRegion *memory);
 MemoryRegion *sysbus_mmio_get_region(SysBusDevice *dev, int n);
 void sysbus_init_irq(SysBusDevice *dev, qemu_irq *p);
 void sysbus_pass_irq(SysBusDevice *dev, SysBusDevice *target);
-void sysbus_init_ioports(SysBusDevice *dev, pio_addr_t ioport, pio_addr_t size);
+void sysbus_init_ioports(SysBusDevice *dev, uint32_t ioport, uint32_t size);
 
 
 bool sysbus_has_irq(SysBusDevice *dev, int n);
ioport.c +6 -6
index 901a997..94e08ab 100644
@@ -55,14 +55,14 @@ const MemoryRegionOps unassigned_io_ops = {
     .endianness = DEVICE_NATIVE_ENDIAN,
 };
 
-void cpu_outb(pio_addr_t addr, uint8_t val)
+void cpu_outb(uint32_t addr, uint8_t val)
 {
     trace_cpu_out(addr, 'b', val);
     address_space_write(&address_space_io, addr, MEMTXATTRS_UNSPECIFIED,
                         &val, 1);
 }
 
-void cpu_outw(pio_addr_t addr, uint16_t val)
+void cpu_outw(uint32_t addr, uint16_t val)
 {
     uint8_t buf[2];
 
@@ -72,7 +72,7 @@ void cpu_outw(pio_addr_t addr, uint16_t val)
                         buf, 2);
 }
 
-void cpu_outl(pio_addr_t addr, uint32_t val)
+void cpu_outl(uint32_t addr, uint32_t val)
 {
     uint8_t buf[4];
 
@@ -82,7 +82,7 @@ void cpu_outl(pio_addr_t addr, uint32_t val)
                         buf, 4);
 }
 
-uint8_t cpu_inb(pio_addr_t addr)
+uint8_t cpu_inb(uint32_t addr)
 {
     uint8_t val;
 
@@ -92,7 +92,7 @@ uint8_t cpu_inb(pio_addr_t addr)
     return val;
 }
 
-uint16_t cpu_inw(pio_addr_t addr)
+uint16_t cpu_inw(uint32_t addr)
 {
     uint8_t buf[2];
     uint16_t val;
@@ -103,7 +103,7 @@ uint16_t cpu_inw(pio_addr_t addr)
     return val;
 }
 
-uint32_t cpu_inl(pio_addr_t addr)
+uint32_t cpu_inl(uint32_t addr)
 {
     uint8_t buf[4];
     uint32_t val;
xen-hvm.c +4 -4
index 4236f78..c14e778 100644
@@ -726,7 +726,7 @@ static ioreq_t *cpu_get_ioreq(XenIOState *state)
     return NULL;
 }
 
-static uint32_t do_inp(pio_addr_t addr, unsigned long size)
+static uint32_t do_inp(uint32_t addr, unsigned long size)
 {
     switch (size) {
         case 1:
@@ -736,11 +736,11 @@ static uint32_t do_inp(pio_addr_t addr, unsigned long size)
         case 4:
             return cpu_inl(addr);
         default:
-            hw_error("inp: bad size: %04"FMT_pioaddr" %lx", addr, size);
+            hw_error("inp: bad size: %04x %lx", addr, size);
     }
 }
 
-static void do_outp(pio_addr_t addr,
+static void do_outp(uint32_t addr,
         unsigned long size, uint32_t val)
 {
     switch (size) {
@@ -751,7 +751,7 @@ static void do_outp(pio_addr_t addr,
         case 4:
             return cpu_outl(addr, val);
         default:
-            hw_error("outp: bad size: %04"FMT_pioaddr" %lx", addr, size);
+            hw_error("outp: bad size: %04x %lx", addr, size);
     }
 }
 
Signature · 1 line
1.8.3.1
#49 lore raw

[Qemu-devel] [PULL 47/52] mips: move CP0 functions out of cpu.h

In reply to Paolo Bonzini

These are here for historical reasons: they are needed from both gdbstub.c and op_helper.c, and the latter was compiled with fixed AREG0. It is not needed anymore, so uninline them.

---
 target-mips/cpu.h    | 113 ++-------------------------------------------------
 target-mips/helper.c | 108 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 112 insertions(+), 109 deletions(-)
target-mips/cpu.h +4 -109
index a7c8660..3cacf37 100644
@@ -1035,115 +1035,10 @@ static inline void compute_hflags(CPUMIPSState *env)
     }
 }
 
-#ifndef CONFIG_USER_ONLY
-static inline void cpu_mips_tlb_flush(CPUMIPSState *env, int flush_global)
-{
-    MIPSCPU *cpu = mips_env_get_cpu(env);
-
-    /* Flush qemu's TLB and discard all shadowed entries.  */
-    tlb_flush(CPU(cpu), flush_global);
-    env->tlb->tlb_in_use = env->tlb->nb_tlb;
-}
-
-/* Called for updates to CP0_Status.  */
-static inline void sync_c0_status(CPUMIPSState *env, CPUMIPSState *cpu, int tc)
-{
-    int32_t tcstatus, *tcst;
-    uint32_t v = cpu->CP0_Status;
-    uint32_t cu, mx, asid, ksu;
-    uint32_t mask = ((1 << CP0TCSt_TCU3)
-                       | (1 << CP0TCSt_TCU2)
-                       | (1 << CP0TCSt_TCU1)
-                       | (1 << CP0TCSt_TCU0)
-                       | (1 << CP0TCSt_TMX)
-                       | (3 << CP0TCSt_TKSU)
-                       | (0xff << CP0TCSt_TASID));
-
-    cu = (v >> CP0St_CU0) & 0xf;
-    mx = (v >> CP0St_MX) & 0x1;
-    ksu = (v >> CP0St_KSU) & 0x3;
-    asid = env->CP0_EntryHi & 0xff;
-
-    tcstatus = cu << CP0TCSt_TCU0;
-    tcstatus |= mx << CP0TCSt_TMX;
-    tcstatus |= ksu << CP0TCSt_TKSU;
-    tcstatus |= asid;
-
-    if (tc == cpu->current_tc) {
-        tcst = &cpu->active_tc.CP0_TCStatus;
-    } else {
-        tcst = &cpu->tcs[tc].CP0_TCStatus;
-    }
-
-    *tcst &= ~mask;
-    *tcst |= tcstatus;
-    compute_hflags(cpu);
-}
-
-static inline void cpu_mips_store_status(CPUMIPSState *env, target_ulong val)
-{
-    uint32_t mask = env->CP0_Status_rw_bitmask;
-    target_ulong old = env->CP0_Status;
-
-    if (env->insn_flags & ISA_MIPS32R6) {
-        bool has_supervisor = extract32(mask, CP0St_KSU, 2) == 0x3;
-#if defined(TARGET_MIPS64)
-        uint32_t ksux = (1 << CP0St_KX) & val;
-        ksux |= (ksux >> 1) & val; /* KX = 0 forces SX to be 0 */
-        ksux |= (ksux >> 1) & val; /* SX = 0 forces UX to be 0 */
-        val = (val & ~(7 << CP0St_UX)) | ksux;
-#endif
-        if (has_supervisor && extract32(val, CP0St_KSU, 2) == 0x3) {
-            mask &= ~(3 << CP0St_KSU);
-        }
-        mask &= ~(((1 << CP0St_SR) | (1 << CP0St_NMI)) & val);
-    }
-
-    env->CP0_Status = (old & ~mask) | (val & mask);
-#if defined(TARGET_MIPS64)
-    if ((env->CP0_Status ^ old) & (old & (7 << CP0St_UX))) {
-        /* Access to at least one of the 64-bit segments has been disabled */
-        cpu_mips_tlb_flush(env, 1);
-    }
-#endif
-    if (env->CP0_Config3 & (1 << CP0C3_MT)) {
-        sync_c0_status(env, env, env->current_tc);
-    } else {
-        compute_hflags(env);
-    }
-}
-
-static inline void cpu_mips_store_cause(CPUMIPSState *env, target_ulong val)
-{
-    uint32_t mask = 0x00C00300;
-    uint32_t old = env->CP0_Cause;
-    int i;
-
-    if (env->insn_flags & ISA_MIPS32R2) {
-        mask |= 1 << CP0Ca_DC;
-    }
-    if (env->insn_flags & ISA_MIPS32R6) {
-        mask &= ~((1 << CP0Ca_WP) & val);
-    }
-
-    env->CP0_Cause = (env->CP0_Cause & ~mask) | (val & mask);
-
-    if ((old ^ env->CP0_Cause) & (1 << CP0Ca_DC)) {
-        if (env->CP0_Cause & (1 << CP0Ca_DC)) {
-            cpu_mips_stop_count(env);
-        } else {
-            cpu_mips_start_count(env);
-        }
-    }
-
-    /* Set/reset software interrupts */
-    for (i = 0 ; i < 2 ; i++) {
-        if ((old ^ env->CP0_Cause) & (1 << (CP0Ca_IP + i))) {
-            cpu_mips_soft_irq(env, i, env->CP0_Cause & (1 << (CP0Ca_IP + i)));
-        }
-    }
-}
-#endif
+void cpu_mips_tlb_flush(CPUMIPSState *env, int flush_global);
+void sync_c0_status(CPUMIPSState *env, CPUMIPSState *cpu, int tc);
+void cpu_mips_store_status(CPUMIPSState *env, target_ulong val);
+void cpu_mips_store_cause(CPUMIPSState *env, target_ulong val);
 
 void QEMU_NORETURN do_raise_exception_err(CPUMIPSState *env, uint32_t exception,
                                           int error_code, uintptr_t pc);
target-mips/helper.c +108 -0

114 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#50 lore raw

[Qemu-devel] [PULL 48/52] hw: explicitly include qemu/log.h

In reply to Paolo Bonzini

Move the inclusion out of hw/hw.h, most files do not need it.

---
 hw/arm/ast2400.c               | 1 +
 hw/arm/nseries.c               | 1 +
 hw/arm/palmetto-bmc.c          | 1 +
 hw/arm/pxa2xx_gpio.c           | 1 +
 hw/arm/stellaris.c             | 1 +
 hw/arm/strongarm.c             | 1 +
 hw/arm/xlnx-ep108.c            | 1 +
 hw/audio/pl041.c               | 1 +
 hw/block/m25p80.c              | 1 +
 hw/block/pflash_cfi01.c        | 1 +
 hw/char/bcm2835_aux.c          | 1 +
 hw/char/cadence_uart.c         | 4 ++++
 hw/char/digic-uart.c           | 1 +
 hw/char/imx_serial.c           | 1 +
 hw/char/pl011.c                | 1 +
 hw/char/stm32f2xx_usart.c      | 1 +
 hw/display/bcm2835_fb.c        | 1 +
 hw/display/cg3.c               | 1 +
 hw/display/pl110.c             | 1 +
 hw/display/virtio-gpu.c        | 1 +
 hw/dma/bcm2835_dma.c           | 1 +
 hw/dma/pl080.c                 | 1 +
 hw/dma/pl330.c                 | 1 +
 hw/dma/rc4030.c                | 1 +
 hw/gpio/imx_gpio.c             | 1 +
 hw/gpio/pl061.c                | 1 +
 hw/i2c/imx_i2c.c               | 1 +
 hw/i2c/versatile_i2c.c         | 1 +
 hw/input/pl050.c               | 1 +
 hw/intc/allwinner-a10-pic.c    | 1 +
 hw/intc/arm_gic.c              | 1 +
 hw/intc/arm_gicv2m.c           | 1 +
 hw/intc/armv7m_nvic.c          | 1 +
 hw/intc/bcm2835_ic.c           | 1 +
 hw/intc/bcm2836_control.c      | 1 +
 hw/intc/i8259.c                | 1 +
 hw/intc/imx_avic.c             | 1 +
 hw/intc/openpic.c              | 1 +
 hw/intc/pl190.c                | 1 +
 hw/misc/arm11scu.c             | 1 +
 hw/misc/arm_integrator_debug.c | 1 +
 hw/misc/arm_l2x0.c             | 1 +
 hw/misc/arm_sysctl.c           | 1 +
 hw/misc/bcm2835_mbox.c         | 1 +
 hw/misc/bcm2835_property.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             | 1 +
 hw/misc/imx_ccm.c              | 1 +
 hw/misc/macio/cuda.c           | 1 +
 hw/misc/macio/mac_dbdma.c      | 1 +
 hw/misc/mips_cmgcr.c           | 1 +
 hw/misc/mips_cpc.c             | 1 +
 hw/misc/mips_itu.c             | 1 +
 hw/misc/stm32f2xx_syscfg.c     | 1 +
 hw/misc/zynq-xadc.c            | 1 +
 hw/misc/zynq_slcr.c            | 1 +
 hw/net/allwinner_emac.c        | 1 +
 hw/net/fsl_etsec/etsec.c       | 1 +
 hw/net/fsl_etsec/rings.c       | 2 +-
 hw/net/imx_fec.c               | 1 +
 hw/net/lan9118.c               | 1 +
 hw/net/spapr_llan.c            | 1 +
 hw/pci-host/apb.c              | 1 +
 hw/pci-host/versatile.c        | 1 +
 hw/ppc/spapr.c                 | 1 +
 hw/ppc/spapr_hcall.c           | 1 +
 hw/ppc/spapr_iommu.c           | 1 +
 hw/ppc/spapr_rtas.c            | 1 +
 hw/ppc/spapr_vio.c             | 1 +
 hw/sd/pl181.c                  | 1 +
 hw/sd/sd.c                     | 1 +
 hw/sd/sdhci.c                  | 1 +
 hw/ssi/imx_spi.c               | 1 +
 hw/ssi/pl022.c                 | 1 +
 hw/timer/allwinner-a10-pit.c   | 1 +
 hw/timer/arm_timer.c           | 1 +
 hw/timer/digic-timer.c         | 1 +
 hw/timer/imx_epit.c            | 1 +
 hw/timer/imx_gpt.c             | 1 +
 hw/timer/pl031.c               | 1 +
 hw/timer/stm32f2xx_timer.c     | 1 +
 hw/watchdog/wdt_diag288.c      | 1 +
 include/hw/hw.h                | 1 -
 monitor.c                      | 1 +
 target-arm/arm-powerctl.c      | 1 +
 target-arm/kvm.c               | 1 +
 target-arm/kvm32.c             | 1 +
 vl.c                           | 1 +
 90 files changed, 92 insertions(+), 2 deletions(-)
hw/arm/ast2400.c +1 -0
index 03f9938..5510a8a 100644
@@ -17,6 +17,7 @@
 #include "exec/address-spaces.h"
 #include "hw/arm/ast2400.h"
 #include "hw/char/serial.h"
+#include "qemu/log.h"
 
 #define AST2400_UART_5_BASE      0x00184000
 #define AST2400_IOMEM_SIZE       0x00200000
hw/arm/nseries.c +1 -0
index 6131c34..d4eb141 100644
@@ -37,6 +37,7 @@
 #include "hw/loader.h"
 #include "sysemu/block-backend.h"
 #include "hw/sysbus.h"
+#include "qemu/log.h"
 #include "exec/address-spaces.h"
 
 /* Nokia N8x0 support */
hw/arm/palmetto-bmc.c +1 -0
index 89ebd92..a51d960 100644
@@ -17,6 +17,7 @@
 #include "hw/arm/arm.h"
 #include "hw/arm/ast2400.h"
 #include "hw/boards.h"
+#include "qemu/log.h"
 
 static struct arm_boot_info palmetto_bmc_binfo = {
     .loader_start = AST2400_SDRAM_BASE,
hw/arm/pxa2xx_gpio.c +1 -0
index 8c9626e..576a8eb 100644
@@ -12,6 +12,7 @@
 #include "hw/hw.h"
 #include "hw/sysbus.h"
 #include "hw/arm/pxa.h"
+#include "qemu/log.h"
 
 #define PXA2XX_GPIO_BANKS	4
 
hw/arm/stellaris.c +1 -0
index f90b9fd..4459171 100644
@@ -17,6 +17,7 @@
 #include "hw/i2c/i2c.h"
 #include "net/net.h"
 #include "hw/boards.h"
+#include "qemu/log.h"
 #include "exec/address-spaces.h"
 #include "sysemu/sysemu.h"
 
hw/arm/strongarm.c +1 -0
index 3bc8a98..f1b2c6c 100644
@@ -38,6 +38,7 @@
 #include "sysemu/sysemu.h"
 #include "hw/ssi/ssi.h"
 #include "qemu/cutils.h"
+#include "qemu/log.h"
 
 //#define DEBUG
 
hw/arm/xlnx-ep108.c +1 -0
index 5f48018..40f7cc1 100644
@@ -23,6 +23,7 @@
 #include "hw/boards.h"
 #include "qemu/error-report.h"
 #include "exec/address-spaces.h"
+#include "qemu/log.h"
 
 typedef struct XlnxEP108 {
     XlnxZynqMPState soc;
hw/audio/pl041.c +1 -0
index 4717bc9..6e9c104 100644
@@ -22,6 +22,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
+#include "qemu/log.h"
 
 #include "pl041.h"
 #include "lm4549.h"
hw/block/m25p80.c +1 -0
index 5d30863..4c856f5 100644
@@ -27,6 +27,7 @@
 #include "sysemu/blockdev.h"
 #include "hw/ssi/ssi.h"
 #include "qemu/bitops.h"
+#include "qemu/log.h"
 
 #ifndef M25P80_ERR_DEBUG
 #define M25P80_ERR_DEBUG 0
hw/block/pflash_cfi01.c +1 -0
index 3a1f85d..31585e3 100644
@@ -45,6 +45,7 @@
 #include "qemu/bitops.h"
 #include "exec/address-spaces.h"
 #include "qemu/host-utils.h"
+#include "qemu/log.h"
 #include "hw/sysbus.h"
 #include "sysemu/sysemu.h"
 
hw/char/bcm2835_aux.c +1 -0
index 0394d11..319f165 100644
@@ -22,6 +22,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/char/bcm2835_aux.h"
+#include "qemu/log.h"
 
 #define AUX_IRQ         0x0
 #define AUX_ENABLES     0x4
hw/char/cadence_uart.c +4 -0
index 7977878..442dac5 100644
@@ -17,6 +17,10 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/sysbus.h"
+#include "sysemu/char.h"
+#include "qemu/timer.h"
+#include "qemu/log.h"
 #include "hw/char/cadence_uart.h"
 
 #ifdef CADENCE_UART_ERR_DEBUG
hw/char/digic-uart.c +1 -0
index d3bc533..0e44878 100644
@@ -30,6 +30,7 @@
 #include "hw/hw.h"
 #include "hw/sysbus.h"
 #include "sysemu/char.h"
+#include "qemu/log.h"
 
 #include "hw/char/digic-uart.h"
 
hw/char/imx_serial.c +1 -0
index 6df74ac..44856d6 100644
@@ -22,6 +22,7 @@
 #include "hw/char/imx_serial.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/char.h"
+#include "qemu/log.h"
 
 #ifndef DEBUG_IMX_UART
 #define DEBUG_IMX_UART 0
hw/char/pl011.c +1 -0
index 210c87b..6876ea6 100644
@@ -10,6 +10,7 @@
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
 #include "sysemu/char.h"
+#include "qemu/log.h"
 
 #define TYPE_PL011 "pl011"
 #define PL011(obj) OBJECT_CHECK(PL011State, (obj), TYPE_PL011)
hw/char/stm32f2xx_usart.c +1 -0
index a94d61c..72305ec 100644
@@ -24,6 +24,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/char/stm32f2xx_usart.h"
+#include "qemu/log.h"
 
 #ifndef STM_USART_ERR_DEBUG
 #define STM_USART_ERR_DEBUG 0
hw/display/bcm2835_fb.c +1 -0
index 506f1d3..7eab927 100644
@@ -29,6 +29,7 @@
 #include "hw/display/framebuffer.h"
 #include "ui/pixel_ops.h"
 #include "hw/misc/bcm2835_mbox_defs.h"
+#include "qemu/log.h"
 
 #define DEFAULT_VCRAM_SIZE 0x4000000
 #define BCM2835_FB_OFFSET  0x00100000
hw/display/cg3.c +1 -0
index eb0e71a..1174220 100644
@@ -31,6 +31,7 @@
 #include "ui/console.h"
 #include "hw/sysbus.h"
 #include "hw/loader.h"
+#include "qemu/log.h"
 
 /* Change to 1 to enable debugging */
 #define DEBUG_CG3 0
hw/display/pl110.c +1 -0
index d589959..c069c0b 100644
@@ -12,6 +12,7 @@
 #include "ui/console.h"
 #include "framebuffer.h"
 #include "ui/pixel_ops.h"
+#include "qemu/log.h"
 
 #define PL110_CR_EN   0x001
 #define PL110_CR_BGR  0x100
hw/display/virtio-gpu.c +1 -0
index c181fb3..91345bd 100644
@@ -19,6 +19,7 @@
 #include "hw/virtio/virtio.h"
 #include "hw/virtio/virtio-gpu.h"
 #include "hw/virtio/virtio-bus.h"
+#include "qemu/log.h"
 
 static struct virtio_gpu_simple_resource*
 virtio_gpu_find_resource(VirtIOGPU *g, uint32_t resource_id);
hw/dma/bcm2835_dma.c +1 -0
index 5421175..5d144a2 100644
@@ -6,6 +6,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "hw/dma/bcm2835_dma.h"
+#include "qemu/log.h"
 
 /* DMA CS Control and Status bits */
 #define BCM2708_DMA_ACTIVE      (1 << 0)
hw/dma/pl080.c +1 -0
index 9318108..3bed5c3 100644
@@ -10,6 +10,7 @@
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
 #include "exec/address-spaces.h"
+#include "qemu/log.h"
 
 #define PL080_MAX_CHANNELS 8
 #define PL080_CONF_E    0x1
hw/dma/pl330.c +1 -0
index ea89ecb..c0bd9fe 100644
@@ -19,6 +19,7 @@
 #include "qapi/error.h"
 #include "qemu/timer.h"
 #include "sysemu/dma.h"
+#include "qemu/log.h"
 
 #ifndef PL330_ERR_DEBUG
 #define PL330_ERR_DEBUG 0
hw/dma/rc4030.c +1 -0
index a06c235..2f2576f 100644
@@ -27,6 +27,7 @@
 #include "hw/mips/mips.h"
 #include "hw/sysbus.h"
 #include "qemu/timer.h"
+#include "qemu/log.h"
 #include "exec/address-spaces.h"
 #include "trace.h"
 
hw/gpio/imx_gpio.c +1 -0
index ed7e247..f3574aa 100644
@@ -19,6 +19,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/gpio/imx_gpio.h"
+#include "qemu/log.h"
 
 #ifndef DEBUG_IMX_GPIO
 #define DEBUG_IMX_GPIO 0
hw/gpio/pl061.c +1 -0
index 29dc7fc..44faeb2 100644
@@ -10,6 +10,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
+#include "qemu/log.h"
 
 //#define DEBUG_PL061 1
 
hw/i2c/imx_i2c.c +1 -0
index e19d4fa..37e5a62 100644
@@ -21,6 +21,7 @@
 #include "qemu/osdep.h"
 #include "hw/i2c/imx_i2c.h"
 #include "hw/i2c/i2c.h"
+#include "qemu/log.h"
 
 #ifndef DEBUG_IMX_I2C
 #define DEBUG_IMX_I2C 0
hw/i2c/versatile_i2c.c +1 -0
index fee3bc7..0bce524 100644
@@ -24,6 +24,7 @@
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
 #include "bitbang_i2c.h"
+#include "qemu/log.h"
 
 #define TYPE_VERSATILE_I2C "versatile_i2c"
 #define VERSATILE_I2C(obj) \
hw/input/pl050.c +1 -0
index 3092b0f..be9cd57 100644
@@ -10,6 +10,7 @@
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
 #include "hw/input/ps2.h"
+#include "qemu/log.h"
 
 #define TYPE_PL050 "pl050"
 #define PL050(obj) OBJECT_CHECK(PL050State, (obj), TYPE_PL050)
hw/intc/allwinner-a10-pic.c +1 -0
index dc971a1..11f1366 100644
@@ -20,6 +20,7 @@
 #include "hw/devices.h"
 #include "sysemu/sysemu.h"
 #include "hw/intc/allwinner-a10-pic.h"
+#include "qemu/log.h"
 
 static void aw_a10_pic_update(AwA10PICState *s)
 {
hw/intc/arm_gic.c +1 -0
index 5ee79b8..06a22e0 100644
@@ -23,6 +23,7 @@
 #include "gic_internal.h"
 #include "qapi/error.h"
 #include "qom/cpu.h"
+#include "qemu/log.h"
 #include "trace.h"
 
 //#define DEBUG_GIC
hw/intc/arm_gicv2m.c +1 -0
index 589d315..3922fbc 100644
@@ -30,6 +30,7 @@
 #include "hw/sysbus.h"
 #include "hw/pci/msi.h"
 #include "sysemu/kvm.h"
+#include "qemu/log.h"
 
 #define TYPE_ARM_GICV2M "arm-gicv2m"
 #define ARM_GICV2M(obj) OBJECT_CHECK(ARMGICv2mState, (obj), TYPE_ARM_GICV2M)
hw/intc/armv7m_nvic.c +1 -0
index 4d584ef..890d5d7 100644
@@ -19,6 +19,7 @@
 #include "hw/arm/arm.h"
 #include "exec/address-spaces.h"
 #include "gic_internal.h"
+#include "qemu/log.h"
 
 typedef struct {
     GICState gic;
hw/intc/bcm2835_ic.c +1 -0
index 80513b2..00d2530 100644
@@ -14,6 +14,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/intc/bcm2835_ic.h"
+#include "qemu/log.h"
 
 #define GPU_IRQS 64
 #define ARM_IRQS 8
hw/intc/bcm2836_control.c +1 -0
index d027181..cfa5bc7 100644
@@ -15,6 +15,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/intc/bcm2836_control.h"
+#include "qemu/log.h"
 
 #define REG_GPU_ROUTE           0x0c
 #define REG_TIMERCONTROL        0x40
hw/intc/i8259.c +1 -0
index bb43669..c2607a5 100644
@@ -27,6 +27,7 @@
 #include "hw/isa/isa.h"
 #include "monitor/monitor.h"
 #include "qemu/timer.h"
+#include "qemu/log.h"
 #include "hw/isa/i8259_internal.h"
 
 /* debug PIC */
hw/intc/imx_avic.c +1 -0
index d21cb97..813e587 100644
@@ -17,6 +17,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/intc/imx_avic.h"
+#include "qemu/log.h"
 
 #ifndef DEBUG_IMX_AVIC
 #define DEBUG_IMX_AVIC 0
hw/intc/openpic.c +1 -0
index 2d37693..4349e45 100644
@@ -44,6 +44,7 @@
 #include "qapi/error.h"
 #include "qemu/bitops.h"
 #include "qapi/qmp/qerror.h"
+#include "qemu/log.h"
 
 //#define DEBUG_OPENPIC
 
hw/intc/pl190.c +1 -0
index 1e50baf..55ea15d 100644
@@ -9,6 +9,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
+#include "qemu/log.h"
 
 /* The number of virtual priority levels.  16 user vectors plus the
    unvectored IRQ.  Chained interrupts would require an additional level
hw/misc/arm11scu.c +1 -0
index 5e54b49..7042ce1 100644
@@ -10,6 +10,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/misc/arm11scu.h"
+#include "qemu/log.h"
 
 static uint64_t mpcore_scu_read(void *opaque, hwaddr offset,
                                 unsigned size)
hw/misc/arm_integrator_debug.c +1 -0
index 902605f..8a5f295 100644
@@ -19,6 +19,7 @@
 #include "hw/sysbus.h"
 #include "exec/address-spaces.h"
 #include "hw/misc/arm_integrator_debug.h"
+#include "qemu/log.h"
 
 #define INTEGRATOR_DEBUG(obj) \
     OBJECT_CHECK(IntegratorDebugState, (obj), TYPE_INTEGRATOR_DEBUG)
hw/misc/arm_l2x0.c +1 -0
index 7e179f1..4442227 100644
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
+#include "qemu/log.h"
 
 /* L2C-310 r3p2 */
 #define CACHE_ID 0x410000c8
hw/misc/arm_sysctl.c +1 -0
index 34d90d5..8524008 100644
@@ -14,6 +14,7 @@
 #include "hw/sysbus.h"
 #include "hw/arm/primecell.h"
 #include "sysemu/sysemu.h"
+#include "qemu/log.h"
 
 #define LOCK_VALUE 0xa05f
 
hw/misc/bcm2835_mbox.c +1 -0
index 263280f..e97cc81 100644
@@ -11,6 +11,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "hw/misc/bcm2835_mbox.h"
+#include "qemu/log.h"
 
 #define MAIL0_PEEK   0x90
 #define MAIL0_SENDER 0x94
hw/misc/bcm2835_property.c +1 -0
index 3447346..70eaafd 100644
@@ -8,6 +8,7 @@
 #include "hw/misc/bcm2835_property.h"
 #include "hw/misc/bcm2835_mbox_defs.h"
 #include "sysemu/dma.h"
+#include "qemu/log.h"
 
 /* https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface */
 
hw/misc/imx25_ccm.c +1 -0
index 225604d..5cd8c0a 100644
@@ -13,6 +13,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/misc/imx25_ccm.h"
+#include "qemu/log.h"
 
 #ifndef DEBUG_IMX25_CCM
 #define DEBUG_IMX25_CCM 0
hw/misc/imx31_ccm.c +1 -0
index 80c1647..1c03e52 100644
@@ -13,6 +13,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/misc/imx31_ccm.h"
+#include "qemu/log.h"
 
 #define CKIH_FREQ 26000000 /* 26MHz crystal input */
 
hw/misc/imx6_ccm.c +1 -0
index 4e1d49d..ec58eef 100644
@@ -12,6 +12,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/misc/imx6_ccm.h"
+#include "qemu/log.h"
 
 #ifndef DEBUG_IMX6_CCM
 #define DEBUG_IMX6_CCM 0
hw/misc/imx6_src.c +1 -0
index 6b026b4..8bb6829 100644
@@ -12,6 +12,7 @@
 #include "hw/misc/imx6_src.h"
 #include "sysemu/sysemu.h"
 #include "qemu/bitops.h"
+#include "qemu/log.h"
 #include "arm-powerctl.h"
 
 #ifndef DEBUG_IMX6_SRC
hw/misc/imx_ccm.c +1 -0
index 986d890..7f239a4 100644
@@ -13,6 +13,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/misc/imx_ccm.h"
+#include "qemu/log.h"
 
 #ifndef DEBUG_IMX_CCM
 #define DEBUG_IMX_CCM 0
hw/misc/macio/cuda.c +1 -0
index f15f301..05c02fb 100644
@@ -29,6 +29,7 @@
 #include "qemu/timer.h"
 #include "sysemu/sysemu.h"
 #include "qemu/cutils.h"
+#include "qemu/log.h"
 
 /* XXX: implement all timer modes */
 
hw/misc/macio/mac_dbdma.c +1 -0
index 6051f17..5632743 100644
@@ -41,6 +41,7 @@
 #include "hw/isa/isa.h"
 #include "hw/ppc/mac_dbdma.h"
 #include "qemu/main-loop.h"
+#include "qemu/log.h"
 
 /* debug DBDMA */
 //#define DEBUG_DBDMA
hw/misc/mips_cmgcr.c +1 -0
index 37be239..40f3464 100644
@@ -11,6 +11,7 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
+#include "qemu/log.h"
 #include "hw/hw.h"
 #include "hw/sysbus.h"
 #include "sysemu/sysemu.h"
hw/misc/mips_cpc.c +1 -0
index 05688b7..e6a35dd 100644
@@ -20,6 +20,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "cpu.h"
+#include "qemu/log.h"
 #include "hw/sysbus.h"
 
 #include "hw/misc/mips_cpc.h"
hw/misc/mips_itu.c +1 -0
index c1a4453..fda7201 100644
@@ -20,6 +20,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "cpu.h"
+#include "qemu/log.h"
 #include "hw/hw.h"
 #include "hw/sysbus.h"
 #include "sysemu/sysemu.h"
hw/misc/stm32f2xx_syscfg.c +1 -0
index d0d7076..7c45833 100644
@@ -24,6 +24,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/misc/stm32f2xx_syscfg.h"
+#include "qemu/log.h"
 
 #ifndef STM_SYSCFG_ERR_DEBUG
 #define STM_SYSCFG_ERR_DEBUG 0
hw/misc/zynq-xadc.c +1 -0
index 71fbccd..1490610 100644
@@ -18,6 +18,7 @@
 #include "hw/misc/zynq-xadc.h"
 #include "qemu/timer.h"
 #include "sysemu/sysemu.h"
+#include "qemu/log.h"
 
 enum {
     CFG                = 0x000 / 4,
hw/misc/zynq_slcr.c +1 -0
index b1b7591..7891219 100644
@@ -19,6 +19,7 @@
 #include "qemu/timer.h"
 #include "hw/sysbus.h"
 #include "sysemu/sysemu.h"
+#include "qemu/log.h"
 
 #ifndef ZYNQ_SLCR_ERR_DEBUG
 #define ZYNQ_SLCR_ERR_DEBUG 0
hw/net/allwinner_emac.c +1 -0
index 16d4b63..d575023 100644
@@ -21,6 +21,7 @@
 #include "net/net.h"
 #include "qemu/fifo8.h"
 #include "hw/net/allwinner_emac.h"
+#include "qemu/log.h"
 #include <zlib.h>
 
 static uint8_t padding[60];
hw/net/fsl_etsec/etsec.c +1 -0
index 1e35f7f..98250e0 100644
@@ -33,6 +33,7 @@
 #include "hw/ptimer.h"
 #include "etsec.h"
 #include "registers.h"
+#include "qemu/log.h"
 
 /* #define HEX_DUMP */
 /* #define DEBUG_REGISTER */
hw/net/fsl_etsec/rings.c +1 -1
index ed1de7d..79d2f14 100644
@@ -23,7 +23,7 @@
  */
 #include "qemu/osdep.h"
 #include "net/checksum.h"
-
+#include "qemu/log.h"
 #include "etsec.h"
 #include "registers.h"
 
hw/net/imx_fec.c +1 -0
index e60e338..9055ea8 100644
@@ -24,6 +24,7 @@
 #include "qemu/osdep.h"
 #include "hw/net/imx_fec.h"
 #include "sysemu/dma.h"
+#include "qemu/log.h"
 
 /* For crc32 */
 #include <zlib.h>
hw/net/lan9118.c +1 -0
index 08dc474..2052073 100644
@@ -16,6 +16,7 @@
 #include "hw/devices.h"
 #include "sysemu/sysemu.h"
 #include "hw/ptimer.h"
+#include "qemu/log.h"
 /* For crc32 */
 #include <zlib.h>
 
hw/net/spapr_llan.c +1 -0
index db97da3..a8266f8 100644
@@ -28,6 +28,7 @@
 #include "qemu-common.h"
 #include "cpu.h"
 #include "hw/hw.h"
+#include "qemu/log.h"
 #include "net/net.h"
 #include "hw/qdev.h"
 #include "hw/ppc/spapr.h"
hw/pci-host/apb.c +1 -0
index aaef7bb..babbbef 100644
@@ -36,6 +36,7 @@
 #include "hw/pci-host/apb.h"
 #include "sysemu/sysemu.h"
 #include "exec/address-spaces.h"
+#include "qemu/log.h"
 
 /* debug APB */
 //#define DEBUG_APB
hw/pci-host/versatile.c +1 -0
index 339ec2c..0792c45 100644
@@ -13,6 +13,7 @@
 #include "hw/pci/pci_bus.h"
 #include "hw/pci/pci_host.h"
 #include "exec/address-spaces.h"
+#include "qemu/log.h"
 
 /* Old and buggy versions of QEMU used the wrong mapping from
  * PCI IRQs to system interrupt lines. Unfortunately the Linux
hw/ppc/spapr.c +1 -0
index b69995e..de1de1d 100644
@@ -29,6 +29,7 @@
 #include "sysemu/sysemu.h"
 #include "sysemu/numa.h"
 #include "hw/hw.h"
+#include "qemu/log.h"
 #include "hw/fw-path-provider.h"
 #include "elf.h"
 #include "net/net.h"
hw/ppc/spapr_hcall.c +1 -0
index 4426a50..c5fecb5 100644
@@ -1,6 +1,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "sysemu/sysemu.h"
+#include "qemu/log.h"
 #include "cpu.h"
 #include "helper_regs.h"
 #include "hw/ppc/spapr.h"
hw/ppc/spapr_iommu.c +1 -0
index 7dd4588..722db91 100644
@@ -18,6 +18,7 @@
  */
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "qemu/log.h"
 #include "sysemu/kvm.h"
 #include "hw/qdev.h"
 #include "kvm_ppc.h"
hw/ppc/spapr_rtas.c +1 -0
index 580829e..43e2c68 100644
@@ -26,6 +26,7 @@
  */
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "qemu/log.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/char.h"
 #include "hw/qdev.h"
hw/ppc/spapr_vio.c +1 -0
index 6b20b40..d084aed 100644
@@ -22,6 +22,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "hw/hw.h"
+#include "qemu/log.h"
 #include "sysemu/sysemu.h"
 #include "hw/boards.h"
 #include "hw/loader.h"
hw/sd/pl181.c +1 -0
index e87abb2..eb783c6 100644
@@ -12,6 +12,7 @@
 #include "sysemu/blockdev.h"
 #include "hw/sysbus.h"
 #include "hw/sd/sd.h"
+#include "qemu/log.h"
 
 //#define DEBUG_PL181 1
 
hw/sd/sd.c +1 -0
index 87e3d23..87c6dc1 100644
@@ -39,6 +39,7 @@
 #include "hw/qdev-properties.h"
 #include "qemu/error-report.h"
 #include "qemu/timer.h"
+#include "qemu/log.h"
 
 //#define DEBUG_SD 1
 
hw/sd/sdhci.c +1 -0
index d28b587..01fbf22 100644
@@ -30,6 +30,7 @@
 #include "qemu/timer.h"
 #include "qemu/bitops.h"
 #include "sdhci-internal.h"
+#include "qemu/log.h"
 
 /* host controller debug messages */
 #ifndef SDHC_DEBUG
hw/ssi/imx_spi.c +1 -0
index d5dd42a..4226199 100644
@@ -11,6 +11,7 @@
 #include "qemu/osdep.h"
 #include "hw/ssi/imx_spi.h"
 #include "sysemu/sysemu.h"
+#include "qemu/log.h"
 
 #ifndef DEBUG_IMX_SPI
 #define DEBUG_IMX_SPI 0
hw/ssi/pl022.c +1 -0
index 564a0d3..c136801 100644
@@ -10,6 +10,7 @@
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
 #include "hw/ssi/ssi.h"
+#include "qemu/log.h"
 
 //#define DEBUG_PL022 1
 
hw/timer/allwinner-a10-pit.c +1 -0
index 51cdc98..3385e5d 100644
@@ -19,6 +19,7 @@
 #include "hw/sysbus.h"
 #include "sysemu/sysemu.h"
 #include "hw/timer/allwinner-a10-pit.h"
+#include "qemu/log.h"
 
 static void a10_pit_update_irq(AwA10PITState *s)
 {
hw/timer/arm_timer.c +1 -0
index f1ede5f..111a16d 100644
@@ -14,6 +14,7 @@
 #include "hw/qdev.h"
 #include "hw/ptimer.h"
 #include "qemu/main-loop.h"
+#include "qemu/log.h"
 
 /* Common timer implementation.  */
 
hw/timer/digic-timer.c +1 -0
index 5b97e1e..0f21faf 100644
@@ -30,6 +30,7 @@
 #include "hw/sysbus.h"
 #include "hw/ptimer.h"
 #include "qemu/main-loop.h"
+#include "qemu/log.h"
 
 #include "hw/timer/digic-timer.h"
 
hw/timer/imx_epit.c +1 -0
index f5836e2..eddf348 100644
@@ -16,6 +16,7 @@
 #include "hw/timer/imx_epit.h"
 #include "hw/misc/imx_ccm.h"
 #include "qemu/main-loop.h"
+#include "qemu/log.h"
 
 #ifndef DEBUG_IMX_EPIT
 #define DEBUG_IMX_EPIT 0
hw/timer/imx_gpt.c +1 -0
index ab2e213..3c2f01a 100644
@@ -16,6 +16,7 @@
 #include "hw/timer/imx_gpt.h"
 #include "hw/misc/imx_ccm.h"
 #include "qemu/main-loop.h"
+#include "qemu/log.h"
 
 #ifndef DEBUG_IMX_GPT
 #define DEBUG_IMX_GPT 0
hw/timer/pl031.c +1 -0
index 38e0cb5..dbbeb9b 100644
@@ -16,6 +16,7 @@
 #include "qemu/timer.h"
 #include "sysemu/sysemu.h"
 #include "qemu/cutils.h"
+#include "qemu/log.h"
 
 //#define DEBUG_PL031
 
hw/timer/stm32f2xx_timer.c +1 -0
index 55dacbb..bf0fb28 100644
@@ -24,6 +24,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/timer/stm32f2xx_timer.h"
+#include "qemu/log.h"
 
 #ifndef STM_TIMER_ERR_DEBUG
 #define STM_TIMER_ERR_DEBUG 0
hw/watchdog/wdt_diag288.c +1 -0
index f54a35a..a7b64e2 100644
@@ -16,6 +16,7 @@
 #include "hw/sysbus.h"
 #include "qemu/timer.h"
 #include "hw/watchdog/wdt_diag288.h"
+#include "qemu/log.h"
 
 static WatchdogTimerModel model = {
     .wdt_name = TYPE_WDT_DIAG288,
include/hw/hw.h +0 -1
index a20321b..029b1e8 100644
@@ -11,7 +11,6 @@
 #include "hw/irq.h"
 #include "block/aio.h"
 #include "migration/vmstate.h"
-#include "qemu/log.h"
 #include "qemu/module.h"
 
 typedef void QEMUResetHandler(void *opaque);
monitor.c +1 -0
index 812383f..a2c1ad2 100644
@@ -71,6 +71,7 @@
 #include "trace/simple.h"
 #endif
 #include "exec/memory.h"
+#include "qemu/log.h"
 #include "qmp-commands.h"
 #include "hmp.h"
 #include "qemu/thread.h"
target-arm/arm-powerctl.c +1 -0
index cb9919b..ee475d9 100644
@@ -13,6 +13,7 @@
 #include <cpu-qom.h>
 #include "internals.h"
 #include "arm-powerctl.h"
+#include "qemu/log.h"
 
 #ifndef DEBUG_ARM_POWERCTL
 #define DEBUG_ARM_POWERCTL 0
target-arm/kvm.c +1 -0
index 3671032..83da447 100644
@@ -25,6 +25,7 @@
 #include "hw/arm/arm.h"
 #include "exec/memattrs.h"
 #include "hw/boards.h"
+#include "qemu/log.h"
 
 const KVMCapabilityInfo kvm_arch_required_capabilities[] = {
     KVM_CAP_LAST_INFO
target-arm/kvm32.c +1 -0
index 7f5935a..c03e3e5 100644
@@ -22,6 +22,7 @@
 #include "kvm_arm.h"
 #include "internals.h"
 #include "hw/arm/arm.h"
+#include "qemu/log.h"
 
 static inline void set_feature(uint64_t *features, int feature)
 {
vl.c +1 -0
index bf61983..a43a3ba 100644
@@ -80,6 +80,7 @@ int main(int argc, char **argv)
 #include "qemu/timer.h"
 #include "sysemu/char.h"
 #include "qemu/bitmap.h"
+#include "qemu/log.h"
 #include "sysemu/blockdev.h"
 #include "hw/block/block.h"
 #include "migration/block.h"
Signature · 1 line
1.8.3.1
#51 lore raw

[Qemu-devel] [PULL 52/52] hw: clean up hw/hw.h includes

In reply to Paolo Bonzini

Include qom/object.h and exec/memory.h instead of exec/ioport.h; exec/ioport.h was almost everywhere required only for those two includes, not for the content of the header itself.

Remove block/aio.h, everybody is already including it through another path.

With this change, include/hw/hw.h is freed from qemu-common.h.

---
 exec.c                | 1 +
 hw/gpio/gpio_key.c    | 1 +
 include/exec/ioport.h | 4 ----
 include/hw/hw.h       | 4 ++--
 include/hw/isa/isa.h  | 2 +-
 5 files changed, 5 insertions(+), 7 deletions(-)
exec.c +1 -0
index e276ec3..2e363f0 100644
@@ -41,6 +41,7 @@
 #else /* !CONFIG_USER_ONLY */
 #include "hw/hw.h"
 #include "exec/memory.h"
+#include "exec/ioport.h"
 #include "sysemu/dma.h"
 #include "exec/address-spaces.h"
 #include "sysemu/xen-mapcache.h"
hw/gpio/gpio_key.c +1 -0
index ef28772..b34aa49 100644
@@ -24,6 +24,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
+#include "qemu/timer.h"
 
 #define TYPE_GPIOKEY "gpio-key"
 #define GPIOKEY(obj) OBJECT_CHECK(GPIOKEYState, (obj), TYPE_GPIOKEY)
include/exec/ioport.h +0 -4
index 6a9639c..a298b89 100644
@@ -24,10 +24,6 @@
 #ifndef IOPORT_H
 #define IOPORT_H
 
-#include "qemu-common.h"
-#include "qom/object.h"
-#include "exec/memory.h"
-
 #define MAX_IOPORTS     (64 * 1024)
 #define IOPORTS_MASK    (MAX_IOPORTS - 1)
 
include/hw/hw.h +2 -2
index 029b1e8..3669ebd 100644
@@ -7,9 +7,9 @@
 #endif
 
 #include "exec/cpu-common.h"
-#include "exec/ioport.h"
+#include "qom/object.h"
+#include "exec/memory.h"
 #include "hw/irq.h"
-#include "block/aio.h"
 #include "migration/vmstate.h"
 #include "qemu/module.h"
 
include/hw/isa/isa.h +1 -1
index ffb2ea7..c87fbad 100644
@@ -3,8 +3,8 @@
 
 /* ISA bus */
 
-#include "exec/ioport.h"
 #include "exec/memory.h"
+#include "exec/ioport.h"
 #include "hw/qdev.h"
 
 #define ISA_NUM_IRQS 16
Signature · 1 line
1.8.3.1
#52 lore raw

[Qemu-devel] [PULL 50/52] cpu: move exec-all.h inclusion out of cpu.h

In reply to Paolo Bonzini

exec-all.h contains TCG-specific definitions. It is not needed outside TCG-specific files such as translate.c, exec.c or *helper.c.

One generic function had snuck into include/exec/exec-all.h; move it to include/qom/cpu.h.

---
 bsd-user/main.c                    |  1 +
 bsd-user/qemu.h                    |  1 +
 cpu-exec-common.c                  |  1 +
 cpu-exec.c                         |  1 +
 cpus.c                             |  1 +
 cputlb.c                           |  1 +
 disas/tci.c                        |  1 +
 exec.c                             |  1 +
 gdbstub.c                          |  1 +
 hw/i386/kvmvapic.c                 |  1 +
 hw/misc/mips_itu.c                 |  1 +
 hw/ppc/spapr_hcall.c               |  1 +
 hw/sh4/sh7750.c                    |  1 +
 include/exec/exec-all.h            |  9 ---------
 include/qom/cpu.h                  | 10 ++++++++++
 linux-user/main.c                  |  1 +
 linux-user/qemu.h                  |  1 +
 monitor.c                          |  1 +
 target-alpha/cpu.c                 |  1 +
 target-alpha/cpu.h                 |  2 --
 target-alpha/fpu_helper.c          |  1 +
 target-alpha/helper.c              |  1 +
 target-alpha/int_helper.c          |  1 +
 target-alpha/mem_helper.c          |  1 +
 target-alpha/sys_helper.c          |  1 +
 target-alpha/translate.c           |  1 +
 target-alpha/vax_helper.c          |  1 +
 target-arm/arm-powerctl.c          |  1 +
 target-arm/arm_ldst.h              |  1 +
 target-arm/cpu.c                   |  1 +
 target-arm/cpu.h                   |  2 --
 target-arm/helper-a64.c            |  1 +
 target-arm/helper.c                |  1 +
 target-arm/op_helper.c             |  1 +
 target-arm/psci.c                  |  1 +
 target-arm/translate-a64.c         |  1 +
 target-arm/translate.c             |  1 +
 target-cris/cpu.c                  |  1 +
 target-cris/cpu.h                  |  2 --
 target-cris/helper.c               |  1 +
 target-cris/mmu.c                  |  1 +
 target-cris/op_helper.c            |  1 +
 target-cris/translate.c            |  1 +
 target-i386/bpt_helper.c           |  1 +
 target-i386/cpu.c                  |  1 +
 target-i386/cpu.h                  |  2 --
 target-i386/excp_helper.c          |  1 +
 target-i386/fpu_helper.c           |  1 +
 target-i386/helper.c               |  1 +
 target-i386/int_helper.c           |  1 +
 target-i386/machine.c              |  3 +++
 target-i386/mem_helper.c           |  1 +
 target-i386/misc_helper.c          |  1 +
 target-i386/mpx_helper.c           |  1 +
 target-i386/seg_helper.c           |  1 +
 target-i386/svm_helper.c           |  1 +
 target-i386/translate.c            |  1 +
 target-lm32/cpu.c                  |  1 +
 target-lm32/cpu.h                  |  2 --
 target-lm32/helper.c               |  1 +
 target-lm32/op_helper.c            |  1 +
 target-lm32/translate.c            |  1 +
 target-m68k/cpu.c                  |  1 +
 target-m68k/cpu.h                  |  2 --
 target-m68k/helper.c               |  1 +
 target-m68k/m68k-semi.c            |  1 +
 target-m68k/op_helper.c            |  1 +
 target-m68k/translate.c            |  1 +
 target-microblaze/cpu.c            |  1 +
 target-microblaze/cpu.h            |  2 --
 target-microblaze/helper.c         |  1 +
 target-microblaze/mmu.c            |  1 +
 target-microblaze/op_helper.c      |  1 +
 target-microblaze/translate.c      |  1 +
 target-mips/cpu.c                  |  1 +
 target-mips/cpu.h                  |  2 --
 target-mips/helper.c               |  1 +
 target-mips/mips-semi.c            |  1 +
 target-mips/msa_helper.c           |  1 +
 target-mips/op_helper.c            |  1 +
 target-mips/translate.c            |  1 +
 target-moxie/cpu.c                 |  1 +
 target-moxie/cpu.h                 |  1 -
 target-openrisc/cpu.c              |  1 +
 target-openrisc/cpu.h              |  2 --
 target-openrisc/exception.c        |  1 +
 target-openrisc/interrupt.c        |  1 +
 target-openrisc/interrupt_helper.c |  1 +
 target-openrisc/mmu.c              |  1 +
 target-openrisc/mmu_helper.c       |  1 +
 target-openrisc/sys_helper.c       |  1 +
 target-ppc/cpu.h                   |  2 --
 target-ppc/excp_helper.c           |  1 +
 target-ppc/int_helper.c            |  1 +
 target-ppc/machine.c               |  2 ++
 target-ppc/mem_helper.c            |  2 ++
 target-ppc/misc_helper.c           |  1 +
 target-ppc/mmu-hash32.c            |  1 +
 target-ppc/mmu-hash64.c            |  1 +
 target-ppc/mmu_helper.c            |  1 +
 target-ppc/timebase_helper.c       |  1 +
 target-ppc/translate.c             |  1 +
 target-s390x/cc_helper.c           |  1 +
 target-s390x/cpu.c                 |  1 +
 target-s390x/cpu.h                 |  2 --
 target-s390x/fpu_helper.c          |  1 +
 target-s390x/gdbstub.c             |  1 +
 target-s390x/helper.c              |  1 +
 target-s390x/int_helper.c          |  1 +
 target-s390x/mem_helper.c          |  1 +
 target-s390x/misc_helper.c         |  1 +
 target-s390x/translate.c           |  1 +
 target-sh4/cpu.c                   |  1 +
 target-sh4/cpu.h                   |  2 --
 target-sh4/helper.c                |  1 +
 target-sh4/op_helper.c             |  1 +
 target-sh4/translate.c             |  1 +
 target-sparc/cpu.c                 |  1 +
 target-sparc/cpu.h                 |  2 --
 target-sparc/helper.c              |  1 +
 target-sparc/ldst_helper.c         |  1 +
 target-sparc/machine.c             |  3 +++
 target-sparc/mmu_helper.c          |  1 +
 target-sparc/translate.c           |  1 +
 target-tilegx/cpu.c                |  1 +
 target-tilegx/cpu.h                |  2 --
 target-tilegx/helper.c             |  1 +
 target-tilegx/translate.c          |  1 +
 target-tricore/cpu.c               |  1 +
 target-tricore/cpu.h               |  2 --
 target-tricore/helper.c            |  1 +
 target-tricore/op_helper.c         |  1 +
 target-tricore/translate.c         |  1 +
 target-unicore32/cpu.c             |  1 +
 target-unicore32/cpu.h             |  1 -
 target-unicore32/helper.c          |  1 +
 target-unicore32/op_helper.c       |  1 +
 target-unicore32/softmmu.c         |  1 +
 target-unicore32/translate.c       |  1 +
 target-xtensa/cpu.c                |  1 +
 target-xtensa/cpu.h                |  1 -
 target-xtensa/gdbstub.c            |  1 +
 target-xtensa/op_helper.c          |  1 +
 target-xtensa/translate.c          |  1 +
 tcg/tcg-op.c                       |  1 +
 tcg/tcg.c                          |  5 +++++
 translate-all.c                    |  1 +
 user-exec.c                        |  1 +
 148 files changed, 148 insertions(+), 42 deletions(-)
bsd-user/main.c +1 -0
index 058eaca..8e338c7 100644
@@ -25,6 +25,7 @@
 #include "qemu/help_option.h"
 /* For tb_lock */
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "tcg.h"
 #include "qemu/timer.h"
 #include "qemu/envlist.h"
bsd-user/qemu.h +1 -0
index 03b502a..53163b8 100644
@@ -19,6 +19,7 @@
 
 
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 
 #undef DEBUG_REMAP
cpu-exec-common.c +1 -0
index 6bdda6b..132cd03 100644
@@ -20,6 +20,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "sysemu/cpus.h"
+#include "exec/exec-all.h"
 #include "exec/memory-internal.h"
 
 bool exit_request;
cpu-exec.c +1 -0
index 14df1aa..602d0c4 100644
@@ -20,6 +20,7 @@
 #include "cpu.h"
 #include "trace.h"
 #include "disas/disas.h"
+#include "exec/exec-all.h"
 #include "tcg.h"
 #include "qemu/atomic.h"
 #include "sysemu/qtest.h"
cpus.c +1 -0
index 7b6ebeb..eb34b4f 100644
@@ -35,6 +35,7 @@
 #include "sysemu/dma.h"
 #include "sysemu/kvm.h"
 #include "qmp-commands.h"
+#include "exec/exec-all.h"
 
 #include "qemu/thread.h"
 #include "sysemu/cpus.h"
cputlb.c +1 -0
index 167280a..1ff6354 100644
@@ -28,6 +28,7 @@
 
 #include "exec/memory-internal.h"
 #include "exec/ram_addr.h"
+#include "exec/exec-all.h"
 #include "tcg/tcg.h"
 
 /* DEBUG defines, enable DEBUG_TLB_LOG to log to the CPU_LOG_MMU target */
disas/tci.c +1 -0
index 1cdf5ee..7233343 100644
@@ -20,6 +20,7 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "disas/bfd.h"
+#include "exec/exec-all.h"
 #include "tcg/tcg.h"
 
 /* Disassemble TCI bytecode. */
exec.c +1 -0
index d26df55..e276ec3 100644
@@ -24,6 +24,7 @@
 
 #include "qemu/cutils.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "tcg.h"
 #include "hw/qdev-core.h"
 #if !defined(CONFIG_USER_ONLY)
gdbstub.c +1 -0
index c19ce39..b9e3710 100644
@@ -35,6 +35,7 @@
 #include "qemu/sockets.h"
 #include "sysemu/kvm.h"
 #include "exec/semihost.h"
+#include "exec/exec-all.h"
 
 #ifdef CONFIG_USER_ONLY
 #define GDB_ATTACHED "0"
hw/i386/kvmvapic.c +1 -0
index 466c3c4..8fd27ba 100644
@@ -11,6 +11,7 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/cpus.h"
 #include "sysemu/kvm.h"
hw/misc/mips_itu.c +1 -0
index fda7201..ef935b5 100644
@@ -21,6 +21,7 @@
 #include "qapi/error.h"
 #include "cpu.h"
 #include "qemu/log.h"
+#include "exec/exec-all.h"
 #include "hw/hw.h"
 #include "hw/sysbus.h"
 #include "sysemu/sysemu.h"
hw/ppc/spapr_hcall.c +1 -0
index c5fecb5..feb3629 100644
@@ -3,6 +3,7 @@
 #include "sysemu/sysemu.h"
 #include "qemu/log.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "helper_regs.h"
 #include "hw/ppc/spapr.h"
 #include "mmu-hash64.h"
hw/sh4/sh7750.c +1 -0
index a1ea760..3132d55 100644
@@ -30,6 +30,7 @@
 #include "sh7750_regnames.h"
 #include "hw/sh4/sh_intc.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "exec/address-spaces.h"
 
 #define NB_DEVICES 4
include/exec/exec-all.h +0 -9
index fd30a0c..b6a4a12 100644
@@ -81,15 +81,6 @@ void cpu_reloading_memory_map(void);
  * Note that with KVM only one address space is supported.
  */
 void cpu_address_space_init(CPUState *cpu, AddressSpace *as, int asidx);
-/**
- * cpu_get_address_space:
- * @cpu: CPU to get address space from
- * @asidx: index identifying which address space to get
- *
- * Return the requested address space of this CPU. @asidx
- * specifies which address space to read.
- */
-AddressSpace *cpu_get_address_space(CPUState *cpu, int asidx);
 /* cputlb.c */
 /**
  * tlb_flush_page:
include/qom/cpu.h +10 -0
index b8d9fb1..c9ba16c 100644
@@ -824,6 +824,16 @@ int cpu_watchpoint_remove(CPUState *cpu, vaddr addr,
 void cpu_watchpoint_remove_by_ref(CPUState *cpu, CPUWatchpoint *watchpoint);
 void cpu_watchpoint_remove_all(CPUState *cpu, int mask);
 
+/**
+ * cpu_get_address_space:
+ * @cpu: CPU to get address space from
+ * @asidx: index identifying which address space to get
+ *
+ * Return the requested address space of this CPU. @asidx
+ * specifies which address space to read.
+ */
+AddressSpace *cpu_get_address_space(CPUState *cpu, int asidx);
+
 void QEMU_NORETURN cpu_abort(CPUState *cpu, const char *fmt, ...)
     GCC_FMT_ATTR(2, 3);
 void cpu_exec_exit(CPUState *cpu);
linux-user/main.c +1 -0
index 2b7fa9c..ba38aed 100644
@@ -26,6 +26,7 @@
 #include "qemu/cutils.h"
 #include "qemu/help_option.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "tcg.h"
 #include "qemu/timer.h"
 #include "qemu/envlist.h"
linux-user/qemu.h +1 -0
index 26b0ba2..208c63e 100644
@@ -3,6 +3,7 @@
 
 
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 
 #undef DEBUG_REMAP
monitor.c +1 -0
index a2c1ad2..0129936 100644
@@ -71,6 +71,7 @@
 #include "trace/simple.h"
 #endif
 #include "exec/memory.h"
+#include "exec/exec-all.h"
 #include "qemu/log.h"
 #include "qmp-commands.h"
 #include "hmp.h"
target-alpha/cpu.c +1 -0
index 8a155ca..6d01d7f 100644
@@ -24,6 +24,7 @@
 #include "cpu.h"
 #include "qemu-common.h"
 #include "migration/vmstate.h"
+#include "exec/exec-all.h"
 
 
 static void alpha_cpu_set_pc(CPUState *cs, vaddr value)
target-alpha/cpu.h +0 -2
index d389a35..e71ea70 100644
@@ -525,6 +525,4 @@ static inline void cpu_get_tb_cpu_state(CPUAlphaState *env, target_ulong *pc,
     *pflags = flags;
 }
 
-#include "exec/exec-all.h"
-
 #endif /* !defined (__CPU_ALPHA_H__) */
target-alpha/fpu_helper.c +1 -0
index 5ab7d5e..9645978 100644
@@ -19,6 +19,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "exec/helper-proto.h"
 #include "fpu/softfloat.h"
 
target-alpha/helper.c +1 -0
index 6dec263..85168b7 100644
@@ -20,6 +20,7 @@
 #include "qemu/osdep.h"
 
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "fpu/softfloat.h"
 #include "exec/helper-proto.h"
 
target-alpha/int_helper.c +1 -0
index 777e48d..19bebfe 100644
@@ -19,6 +19,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "exec/helper-proto.h"
 #include "qemu/host-utils.h"
 
target-alpha/mem_helper.c +1 -0
index 7fee9a6..7f4d15f 100644
@@ -20,6 +20,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "exec/helper-proto.h"
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 
 /* Softmmu support */
target-alpha/sys_helper.c +1 -0
index e2dec15..bec1e17 100644
@@ -19,6 +19,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "exec/helper-proto.h"
 #include "sysemu/sysemu.h"
 #include "qemu/timer.h"
target-alpha/translate.c +1 -0
index 8c2183a..76dab15 100644
@@ -21,6 +21,7 @@
 #include "cpu.h"
 #include "disas/disas.h"
 #include "qemu/host-utils.h"
+#include "exec/exec-all.h"
 #include "tcg-op.h"
 #include "exec/cpu_ldst.h"
 
target-alpha/vax_helper.c +1 -0
index e74ac3e..2b0c178 100644
@@ -19,6 +19,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "exec/helper-proto.h"
 #include "fpu/softfloat.h"
 
target-arm/arm-powerctl.c +1 -0
index ee475d9..d452230 100644
@@ -14,6 +14,7 @@
 #include "internals.h"
 #include "arm-powerctl.h"
 #include "qemu/log.h"
+#include "exec/exec-all.h"
 
 #ifndef DEBUG_ARM_POWERCTL
 #define DEBUG_ARM_POWERCTL 0
target-arm/arm_ldst.h +1 -0
index 35c2c43..a76d89f 100644
@@ -20,6 +20,7 @@
 #ifndef ARM_LDST_H
 #define ARM_LDST_H
 
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 #include "qemu/bswap.h"
 
target-arm/cpu.c +1 -0
index e48e83a..3fd0743 100644
@@ -23,6 +23,7 @@
 #include "cpu.h"
 #include "internals.h"
 #include "qemu-common.h"
+#include "exec/exec-all.h"
 #include "hw/qdev-properties.h"
 #if !defined(CONFIG_USER_ONLY)
 #include "hw/loader.h"
target-arm/cpu.h +0 -2
index 9ff9563..c741b53 100644
@@ -2341,8 +2341,6 @@ static inline void cpu_get_tb_cpu_state(CPUARMState *env, target_ulong *pc,
     *cs_base = 0;
 }
 
-#include "exec/exec-all.h"
-
 enum {
     QEMU_PSCI_CONDUIT_DISABLED = 0,
     QEMU_PSCI_CONDUIT_SMC = 1,
target-arm/helper-a64.c +1 -0
index c7bfb4d..7c63556 100644
@@ -22,6 +22,7 @@
 #include "exec/gdbstub.h"
 #include "exec/helper-proto.h"
 #include "qemu/host-utils.h"
+#include "qemu/log.h"
 #include "sysemu/sysemu.h"
 #include "qemu/bitops.h"
 #include "internals.h"
target-arm/helper.c +1 -0
index d721c0c..e3ea26f 100644
@@ -8,6 +8,7 @@
 #include "sysemu/sysemu.h"
 #include "qemu/bitops.h"
 #include "qemu/crc32c.h"
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 #include "arm_ldst.h"
 #include <zlib.h> /* For crc32 */
target-arm/op_helper.c +1 -0
index c7fba85..0b29b9d 100644
@@ -20,6 +20,7 @@
 #include "cpu.h"
 #include "exec/helper-proto.h"
 #include "internals.h"
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 
 #define SIGNBIT (uint32_t)0x80000000
target-arm/psci.c +1 -0
index 071bbb4..4db9b8c 100644
@@ -22,6 +22,7 @@
 #include <sysemu/sysemu.h>
 #include "internals.h"
 #include "arm-powerctl.h"
+#include "exec/exec-all.h"
 
 bool arm_is_psci_call(ARMCPU *cpu, int excp_type)
 {
target-arm/translate-a64.c +1 -0
index 5526bbd..ce8141a 100644
@@ -19,6 +19,7 @@
 #include "qemu/osdep.h"
 
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "tcg-op.h"
 #include "qemu/log.h"
 #include "arm_ldst.h"
target-arm/translate.c +1 -0
index a43b1f6..e525f1e 100644
@@ -23,6 +23,7 @@
 #include "cpu.h"
 #include "internals.h"
 #include "disas/disas.h"
+#include "exec/exec-all.h"
 #include "tcg-op.h"
 #include "qemu/log.h"
 #include "qemu/bitops.h"
target-cris/cpu.c +1 -0
index 1cb79dd..c5a656b 100644
@@ -26,6 +26,7 @@
 #include "cpu.h"
 #include "qemu-common.h"
 #include "mmu.h"
+#include "exec/exec-all.h"
 
 
 static void cris_cpu_set_pc(CPUState *cs, vaddr value)
target-cris/cpu.h +0 -2
index 8cc8bf5..d8c47a6 100644
@@ -300,6 +300,4 @@ static inline void cpu_get_tb_cpu_state(CPUCRISState *env, target_ulong *pc,
 #define cpu_list cris_cpu_list
 void cris_cpu_list(FILE *f, fprintf_function cpu_fprintf);
 
-#include "exec/exec-all.h"
-
 #endif
target-cris/helper.c +1 -0
index 1eb9fd9..af78cca 100644
@@ -22,6 +22,7 @@
 #include "cpu.h"
 #include "mmu.h"
 #include "qemu/host-utils.h"
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 
 
target-cris/mmu.c +1 -0
index 4278d2d..b8db908 100644
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "mmu.h"
 
 #ifdef DEBUG
target-cris/op_helper.c +1 -0
index 320f2b8..675ab86 100644
@@ -23,6 +23,7 @@
 #include "mmu.h"
 #include "exec/helper-proto.h"
 #include "qemu/host-utils.h"
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 
 //#define CRIS_OP_HELPER_DEBUG
target-cris/translate.c +1 -0
index 420051e..2153ea7 100644
@@ -26,6 +26,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "disas/disas.h"
+#include "exec/exec-all.h"
 #include "tcg-op.h"
 #include "exec/helper-proto.h"
 #include "mmu.h"
target-i386/bpt_helper.c +1 -0
index f47df19..499a277 100644
@@ -19,6 +19,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "exec/helper-proto.h"
 
 
target-i386/cpu.c +1 -0
index b6a3caa..05bf5ed 100644
@@ -20,6 +20,7 @@
 #include "qemu/cutils.h"
 
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "sysemu/kvm.h"
 #include "sysemu/cpus.h"
 #include "kvm_i386.h"
target-i386/cpu.h +0 -2
index bc8c3fb..5cf2422 100644
@@ -1362,8 +1362,6 @@ void tcg_x86_init(void);
 #include "hw/i386/apic.h"
 #endif
 
-#include "exec/exec-all.h"
-
 static inline void cpu_get_tb_cpu_state(CPUX86State *env, target_ulong *pc,
                                         target_ulong *cs_base, uint32_t *flags)
 {
target-i386/excp_helper.c +1 -0
index ef37f42..f0dc499 100644
@@ -19,6 +19,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "qemu/log.h"
 #include "sysemu/sysemu.h"
 #include "exec/helper-proto.h"
target-i386/fpu_helper.c +1 -0
index fee5573..206e60f 100644
@@ -22,6 +22,7 @@
 #include "cpu.h"
 #include "exec/helper-proto.h"
 #include "qemu/host-utils.h"
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 
 #define FPU_RC_MASK         0xc00
target-i386/helper.c +1 -0
index bf3e762..889fdab 100644
@@ -19,6 +19,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "sysemu/kvm.h"
 #include "kvm_i386.h"
 #ifndef CONFIG_USER_ONLY
target-i386/int_helper.c +1 -0
index cf5bbb0..9e873ac 100644
@@ -19,6 +19,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "qemu/host-utils.h"
 #include "exec/helper-proto.h"
 
target-i386/machine.c +3 -0
index 658b066..cb9adf2 100644
@@ -1,13 +1,16 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "hw/hw.h"
 #include "hw/boards.h"
 #include "hw/i386/pc.h"
 #include "hw/isa/isa.h"
 #include "migration/cpu.h"
+#include "exec/exec-all.h"
 
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "sysemu/kvm.h"
 
 #include "qemu/error-report.h"
target-i386/mem_helper.c +1 -0
index 85e7516..c2f4769 100644
@@ -20,6 +20,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "exec/helper-proto.h"
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 
 /* broken thread support */
target-i386/misc_helper.c +1 -0
index e31ec97..3f666b4 100644
@@ -20,6 +20,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "exec/helper-proto.h"
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 #include "exec/address-spaces.h"
 
target-i386/mpx_helper.c +1 -0
index 4d1785e..7e44820 100644
@@ -21,6 +21,7 @@
 #include "cpu.h"
 #include "exec/helper-proto.h"
 #include "exec/cpu_ldst.h"
+#include "exec/exec-all.h"
 
 
 void cpu_sync_bndcs_hflags(CPUX86State *env)
target-i386/seg_helper.c +1 -0
index b5f3d72..97aee09 100644
@@ -22,6 +22,7 @@
 #include "cpu.h"
 #include "qemu/log.h"
 #include "exec/helper-proto.h"
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 #include "exec/log.h"
 
target-i386/svm_helper.c +1 -0
index ab472f6..782b3f1 100644
@@ -21,6 +21,7 @@
 #include "cpu.h"
 #include "exec/cpu-all.h"
 #include "exec/helper-proto.h"
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 
 /* Secure Virtual Machine helpers */
target-i386/translate.c +1 -0
index 868c262..8085467 100644
@@ -21,6 +21,7 @@
 #include "qemu/host-utils.h"
 #include "cpu.h"
 #include "disas/disas.h"
+#include "exec/exec-all.h"
 #include "tcg-op.h"
 #include "exec/cpu_ldst.h"
 
target-lm32/cpu.c +1 -0
index 6e7e1b8..a783d46 100644
@@ -22,6 +22,7 @@
 #include "qapi/error.h"
 #include "cpu.h"
 #include "qemu-common.h"
+#include "exec/exec-all.h"
 
 
 static void lm32_cpu_set_pc(CPUState *cs, vaddr value)
target-lm32/cpu.h +0 -2
index 2776179..62880f7 100644
@@ -273,6 +273,4 @@ static inline void cpu_get_tb_cpu_state(CPULM32State *env, target_ulong *pc,
     *flags = 0;
 }
 
-#include "exec/exec-all.h"
-
 #endif
target-lm32/helper.c +1 -0
index 655248f..b8f4ed9 100644
@@ -19,6 +19,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "qemu/host-utils.h"
 #include "sysemu/sysemu.h"
 #include "exec/semihost.h"
target-lm32/op_helper.c +1 -0
index b6759e0..7a550d1 100644
@@ -6,6 +6,7 @@
 #include "hw/lm32/lm32_pic.h"
 #include "hw/char/lm32_juart.h"
 
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 
 #ifndef CONFIG_USER_ONLY
target-lm32/translate.c +1 -0
index dd972f5..d09d814 100644
@@ -21,6 +21,7 @@
 #include "cpu.h"
 #include "disas/disas.h"
 #include "exec/helper-proto.h"
+#include "exec/exec-all.h"
 #include "tcg-op.h"
 
 #include "exec/cpu_ldst.h"
target-m68k/cpu.c +1 -0
index 0b5f9a5..116b784 100644
@@ -23,6 +23,7 @@
 #include "cpu.h"
 #include "qemu-common.h"
 #include "migration/vmstate.h"
+#include "exec/exec-all.h"
 
 
 static void m68k_cpu_set_pc(CPUState *cs, vaddr value)
target-m68k/cpu.h +0 -2
index 86a1ff0..008a057 100644
@@ -271,6 +271,4 @@ static inline void cpu_get_tb_cpu_state(CPUM68KState *env, target_ulong *pc,
             | ((env->macsr >> 4) & 0xf);        /* Bits 0-3 */
 }
 
-#include "exec/exec-all.h"
-
 #endif
target-m68k/helper.c +1 -0
index a8f6d9d..427cbed 100644
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "exec/gdbstub.h"
 
 #include "exec/helper-proto.h"
target-m68k/m68k-semi.c +1 -0
index f360ef3..1402145 100644
@@ -28,6 +28,7 @@
 #include "exec/gdbstub.h"
 #include "exec/softmmu-semi.h"
 #endif
+#include "qemu/log.h"
 #include "sysemu/sysemu.h"
 
 #define HOSTED_EXIT  0
target-m68k/op_helper.c +1 -0
index 17d0a11..ff32e35 100644
@@ -19,6 +19,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "exec/helper-proto.h"
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 #include "exec/semihost.h"
 
target-m68k/translate.c +1 -0
index e46356e..f90187f 100644
@@ -21,6 +21,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "disas/disas.h"
+#include "exec/exec-all.h"
 #include "tcg-op.h"
 #include "qemu/log.h"
 #include "exec/cpu_ldst.h"
target-microblaze/cpu.c +1 -0
index fdfb019..8edc00a 100644
@@ -27,6 +27,7 @@
 #include "qemu-common.h"
 #include "hw/qdev-properties.h"
 #include "migration/vmstate.h"
+#include "exec/exec-all.h"
 
 static const struct {
     const char *name;
target-microblaze/cpu.h +0 -2
index 98d9c4f..d17cf1e 100644
@@ -379,6 +379,4 @@ void mb_cpu_unassigned_access(CPUState *cpu, hwaddr addr,
                               unsigned size);
 #endif
 
-#include "exec/exec-all.h"
-
 #endif
target-microblaze/helper.c +1 -0
index 4de6bdb..da394d1 100644
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "qemu/host-utils.h"
 #include "exec/log.h"
 
target-microblaze/mmu.c +1 -0
index 4ac3040..a22a496 100644
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 
 #define D(x)
 
target-microblaze/op_helper.c +1 -0
index 9733388..0533939 100644
@@ -22,6 +22,7 @@
 #include "cpu.h"
 #include "exec/helper-proto.h"
 #include "qemu/host-utils.h"
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 
 #define D(x)
target-microblaze/translate.c +1 -0
index a7a8ac8..513f390 100644
@@ -21,6 +21,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "disas/disas.h"
+#include "exec/exec-all.h"
 #include "tcg-op.h"
 #include "exec/helper-proto.h"
 #include "microblaze-decode.h"
target-mips/cpu.c +1 -0
index 0e2ecbe..64ad112 100644
@@ -24,6 +24,7 @@
 #include "kvm_mips.h"
 #include "qemu-common.h"
 #include "sysemu/kvm.h"
+#include "exec/exec-all.h"
 
 
 static void mips_cpu_set_pc(CPUState *cs, vaddr value)
target-mips/cpu.h +0 -2
index 3cacf37..4ce9d47 100644
@@ -934,8 +934,6 @@ static inline int mips_vp_active(CPUMIPSState *env)
     return 1;
 }
 
-#include "exec/exec-all.h"
-
 static inline void compute_hflags(CPUMIPSState *env)
 {
     env->hflags &= ~(MIPS_HFLAG_COP1X | MIPS_HFLAG_64 | MIPS_HFLAG_CP0 |
target-mips/helper.c +1 -0
index 3bbc72c..65fbef0 100644
@@ -20,6 +20,7 @@
 
 #include "cpu.h"
 #include "sysemu/kvm.h"
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 #include "exec/log.h"
 
target-mips/mips-semi.c +1 -0
index ed235de..a7aefba 100644
@@ -19,6 +19,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "qemu/log.h"
 #include "exec/helper-proto.h"
 #include "exec/softmmu-semi.h"
 #include "exec/semihost.h"
target-mips/msa_helper.c +1 -0
index 654a0d2..ae92fcb 100644
@@ -19,6 +19,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "exec/helper-proto.h"
 
 /* Data format min and max values */
target-mips/op_helper.c +1 -0
index ba847ab..7cf9807 100644
@@ -20,6 +20,7 @@
 #include "cpu.h"
 #include "qemu/host-utils.h"
 #include "exec/helper-proto.h"
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 #include "sysemu/kvm.h"
 
target-mips/translate.c +1 -0
index ddfb924..3bd96aa 100644
@@ -24,6 +24,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "disas/disas.h"
+#include "exec/exec-all.h"
 #include "tcg-op.h"
 #include "exec/cpu_ldst.h"
 
target-moxie/cpu.c +1 -0
index b4ee84e..50a0899 100644
@@ -23,6 +23,7 @@
 #include "qemu-common.h"
 #include "migration/vmstate.h"
 #include "machine.h"
+#include "exec/exec-all.h"
 
 static void moxie_cpu_set_pc(CPUState *cs, vaddr value)
 {
target-moxie/cpu.h +0 -1
index 1b46e52..c10898e 100644
@@ -129,7 +129,6 @@ static inline int cpu_mmu_index(CPUMoxieState *env, bool ifetch)
 }
 
 #include "exec/cpu-all.h"
-#include "exec/exec-all.h"
 
 static inline void cpu_get_tb_cpu_state(CPUMoxieState *env, target_ulong *pc,
                                         target_ulong *cs_base, uint32_t *flags)
target-openrisc/cpu.c +1 -0
index ae6ed9e..155913f 100644
@@ -21,6 +21,7 @@
 #include "qapi/error.h"
 #include "cpu.h"
 #include "qemu-common.h"
+#include "exec/exec-all.h"
 
 static void openrisc_cpu_set_pc(CPUState *cs, vaddr value)
 {
target-openrisc/cpu.h +0 -2
index ed818af..810a280 100644
@@ -410,6 +410,4 @@ static inline int cpu_mmu_index(CPUOpenRISCState *env, bool ifetch)
 
 #define CPU_INTERRUPT_TIMER   CPU_INTERRUPT_TGT_INT_0
 
-#include "exec/exec-all.h"
-
 #endif /* CPU_OPENRISC_H */
target-openrisc/exception.c +1 -0
index ace3184..49470be 100644
@@ -19,6 +19,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "exception.h"
 
 void QEMU_NORETURN raise_exception(OpenRISCCPU *cpu, uint32_t excp)
target-openrisc/interrupt.c +1 -0
index 963eb14..5fe3f11 100644
@@ -19,6 +19,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "qemu-common.h"
 #include "exec/gdbstub.h"
 #include "qemu/host-utils.h"
target-openrisc/interrupt_helper.c +1 -0
index 11b4b20..116f910 100644
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "exec/helper-proto.h"
 
 void HELPER(rfe)(CPUOpenRISCState *env)
target-openrisc/mmu.c +1 -0
index 4ab414a..505dcdc 100644
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "qemu-common.h"
 #include "exec/gdbstub.h"
 #include "qemu/host-utils.h"
target-openrisc/mmu_helper.c +1 -0
index d7952d4..c0658c3 100644
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 
 #ifndef CONFIG_USER_ONLY
target-openrisc/sys_helper.c +1 -0
index f917be6..a719e45 100644
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "exec/helper-proto.h"
 
 #define TO_SPR(group, number) (((group) << 11) + (number))
target-ppc/cpu.h +0 -2
index 601aa4d..165293b 100644
@@ -2367,8 +2367,6 @@ static inline bool lsw_reg_in_range(int start, int nregs, int rx)
 
 extern void (*cpu_ppc_hypercall)(PowerPCCPU *);
 
-#include "exec/exec-all.h"
-
 void dump_mmu(FILE *f, fprintf_function cpu_fprintf, CPUPPCState *env);
 
 /**
target-ppc/excp_helper.c +1 -0
index ca4ffe8..288903e 100644
@@ -19,6 +19,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "exec/helper-proto.h"
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 
 #include "helper_regs.h"
target-ppc/int_helper.c +1 -0
index 27b0258..7445376 100644
@@ -18,6 +18,7 @@
  */
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "qemu/host-utils.h"
 #include "exec/helper-proto.h"
 #include "crypto/aes.h"
target-ppc/machine.c +2 -0
index 4911cb7..f6c7256 100644
@@ -1,12 +1,14 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "hw/hw.h"
 #include "hw/boards.h"
 #include "sysemu/kvm.h"
 #include "helper_regs.h"
 #include "mmu-hash64.h"
 #include "migration/cpu.h"
+#include "exec/exec-all.h"
 
 static int cpu_load_old(QEMUFile *f, void *opaque, int version_id)
 {
target-ppc/mem_helper.c +2 -0
index 6d584c9..e4de86b 100644
@@ -18,10 +18,12 @@
  */
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "qemu/host-utils.h"
 #include "exec/helper-proto.h"
 
 #include "helper_regs.h"
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 
 //#define DEBUG_OP
target-ppc/misc_helper.c +1 -0
index 73e3b05..7d41b01 100644
@@ -18,6 +18,7 @@
  */
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "exec/helper-proto.h"
 
 #include "helper_regs.h"
target-ppc/mmu-hash32.c +1 -0
index 06ce4d6..29bace6 100644
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "exec/helper-proto.h"
 #include "sysemu/kvm.h"
 #include "kvm_ppc.h"
target-ppc/mmu-hash64.c +1 -0
index 5184626..04e6932 100644
@@ -20,6 +20,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "exec/helper-proto.h"
 #include "qemu/error-report.h"
 #include "sysemu/kvm.h"
target-ppc/mmu_helper.c +1 -0
index ff21794..2e0e3ca 100644
@@ -24,6 +24,7 @@
 #include "kvm_ppc.h"
 #include "mmu-hash64.h"
 #include "mmu-hash32.h"
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 #include "exec/log.h"
 
target-ppc/timebase_helper.c +1 -0
index 3b340d7..66de313 100644
@@ -19,6 +19,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "exec/helper-proto.h"
+#include "qemu/log.h"
 
 /*****************************************************************************/
 /* SPR accesses */
target-ppc/translate.c +1 -0
index d485d7c..745f4de 100644
@@ -21,6 +21,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "disas/disas.h"
+#include "exec/exec-all.h"
 #include "tcg-op.h"
 #include "qemu/host-utils.h"
 #include "exec/cpu_ldst.h"
target-s390x/cc_helper.c +1 -0
index 0d9411b..1cf8551 100644
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "exec/helper-proto.h"
 #include "qemu/host-utils.h"
 
target-s390x/cpu.c +1 -0
index e665165..e43e2d6 100644
@@ -33,6 +33,7 @@
 #include "trace.h"
 #include "qapi/visitor.h"
 #include "migration/vmstate.h"
+#include "exec/exec-all.h"
 #ifndef CONFIG_USER_ONLY
 #include "hw/hw.h"
 #include "sysemu/arch_init.h"
target-s390x/cpu.h +0 -2
index 15fb6db..bd6b2e5 100644
@@ -633,8 +633,6 @@ extern void subsystem_reset(void);
 void s390_cpu_list(FILE *f, fprintf_function cpu_fprintf);
 #define cpu_list s390_cpu_list
 
-#include "exec/exec-all.h"
-
 #define EXCP_EXT 1 /* external interrupt */
 #define EXCP_SVC 2 /* supervisor call (syscall) */
 #define EXCP_PGM 3 /* program interruption */
target-s390x/fpu_helper.c +1 -0
index 1c7f673..4ddb388 100644
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 #include "exec/helper-proto.h"
 
target-s390x/gdbstub.c +1 -0
index 0992ae7..3d223de 100644
@@ -20,6 +20,7 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "exec/gdbstub.h"
 #include "qemu/bitops.h"
 
target-s390x/helper.c +1 -0
index 423dd72..ad8f797 100644
@@ -23,6 +23,7 @@
 #include "cpu.h"
 #include "exec/gdbstub.h"
 #include "qemu/timer.h"
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 #include "hw/s390x/ioinst.h"
 #ifndef CONFIG_USER_ONLY
target-s390x/int_helper.c +1 -0
index cc1071e..370c94d 100644
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "qemu/host-utils.h"
 #include "exec/helper-proto.h"
 
target-s390x/mem_helper.c +1 -0
index 9d206a9..ec8059a 100644
@@ -21,6 +21,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "exec/helper-proto.h"
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 
 #if !defined(CONFIG_USER_ONLY)
target-s390x/misc_helper.c +1 -0
index 93280d0..86da194 100644
@@ -29,6 +29,7 @@
 #ifdef CONFIG_KVM
 #include <linux/kvm.h>
 #endif
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 
 #if !defined(CONFIG_USER_ONLY)
target-s390x/translate.c +1 -0
index e99eb5c..2bbd102 100644
@@ -31,6 +31,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "disas/disas.h"
+#include "exec/exec-all.h"
 #include "tcg-op.h"
 #include "qemu/log.h"
 #include "qemu/host-utils.h"
target-sh4/cpu.c +1 -0
index 86ba388..794b625 100644
@@ -24,6 +24,7 @@
 #include "cpu.h"
 #include "qemu-common.h"
 #include "migration/vmstate.h"
+#include "exec/exec-all.h"
 
 
 static void superh_cpu_set_pc(CPUState *cs, vaddr value)
target-sh4/cpu.h +0 -2
index 9bd15b8..3f5c689 100644
@@ -389,6 +389,4 @@ static inline void cpu_get_tb_cpu_state(CPUSH4State *env, target_ulong *pc,
             | (env->movcal_backup ? TB_FLAG_PENDING_MOVCA : 0); /* Bit 4 */
 }
 
-#include "exec/exec-all.h"
-
 #endif				/* _CPU_SH4_H */
target-sh4/helper.c +1 -0
index 6438338..a33ac69 100644
@@ -19,6 +19,7 @@
 #include "qemu/osdep.h"
 
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "exec/log.h"
 
 #if !defined(CONFIG_USER_ONLY)
target-sh4/op_helper.c +1 -0
index 368e687..303e83e 100644
@@ -19,6 +19,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "exec/helper-proto.h"
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 
 #ifndef CONFIG_USER_ONLY
target-sh4/translate.c +1 -0
index 53f782c..ff5222b 100644
@@ -22,6 +22,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "disas/disas.h"
+#include "exec/exec-all.h"
 #include "tcg-op.h"
 #include "exec/cpu_ldst.h"
 
target-sparc/cpu.c +1 -0
index fe4119e..5b74cfc 100644
@@ -21,6 +21,7 @@
 #include "qapi/error.h"
 #include "cpu.h"
 #include "qemu/error-report.h"
+#include "exec/exec-all.h"
 
 //#define DEBUG_FEATURES
 
target-sparc/cpu.h +0 -2
index 0141994..ba37f4b 100644
@@ -768,6 +768,4 @@ static inline bool tb_am_enabled(int tb_flags)
 #endif
 }
 
-#include "exec/exec-all.h"
-
 #endif
target-sparc/helper.c +1 -0
index 8349cbe..bedc672 100644
@@ -19,6 +19,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "qemu/host-utils.h"
 #include "exec/helper-proto.h"
 #include "sysemu/sysemu.h"
target-sparc/ldst_helper.c +1 -0
index 658e7d8..f73cf6d 100644
@@ -20,6 +20,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "exec/helper-proto.h"
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 
 //#define DEBUG_MMU
target-sparc/machine.c +3 -0
index c8823af..59c92f7 100644
@@ -1,12 +1,15 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "hw/hw.h"
 #include "hw/boards.h"
 #include "qemu/timer.h"
 
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "migration/cpu.h"
+#include "exec/exec-all.h"
 
 #ifdef TARGET_SPARC64
 static const VMStateDescription vmstate_cpu_timer = {
target-sparc/mmu_helper.c +1 -0
index aa80c48..32b629f 100644
@@ -19,6 +19,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "trace.h"
 #include "exec/address-spaces.h"
 
target-sparc/translate.c +1 -0
index d154e3f..21760b9 100644
@@ -23,6 +23,7 @@
 #include "cpu.h"
 #include "disas/disas.h"
 #include "exec/helper-proto.h"
+#include "exec/exec-all.h"
 #include "tcg-op.h"
 #include "exec/cpu_ldst.h"
 
target-tilegx/cpu.c +1 -0
index d2d0912..7017cb6 100644
@@ -25,6 +25,7 @@
 #include "hw/qdev-properties.h"
 #include "migration/vmstate.h"
 #include "linux-user/syscall_defs.h"
+#include "exec/exec-all.h"
 
 static void tilegx_cpu_dump_state(CPUState *cs, FILE *f,
                                   fprintf_function cpu_fprintf, int flags)
target-tilegx/cpu.h +0 -2
index c9dda12..b9b588d 100644
@@ -176,6 +176,4 @@ static inline void cpu_get_tb_cpu_state(CPUTLGState *env, target_ulong *pc,
     *flags = 0;
 }
 
-#include "exec/exec-all.h"
-
 #endif
target-tilegx/helper.c +1 -0
index 616c5c7..b4fba9c 100644
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "qemu-common.h"
 #include "exec/helper-proto.h"
 #include <zlib.h> /* For crc32 */
target-tilegx/translate.c +1 -0
index 03918eb..bdea673 100644
@@ -23,6 +23,7 @@
 #include "qemu/log.h"
 #include "exec/log.h"
 #include "disas/disas.h"
+#include "exec/exec-all.h"
 #include "tcg-op.h"
 #include "exec/cpu_ldst.h"
 #include "linux-user/syscall_defs.h"
target-tricore/cpu.c +1 -0
index 69fca8c..35d4ee4 100644
@@ -21,6 +21,7 @@
 #include "qapi/error.h"
 #include "cpu.h"
 #include "qemu-common.h"
+#include "exec/exec-all.h"
 
 static inline void set_feature(CPUTriCoreState *env, int feature)
 {
target-tricore/cpu.h +0 -2
index a48340f..3c6f7b7 100644
@@ -422,6 +422,4 @@ int cpu_tricore_handle_mmu_fault(CPUState *cpu, target_ulong address,
                                  int rw, int mmu_idx);
 #define cpu_handle_mmu_fault cpu_tricore_handle_mmu_fault
 
-#include "exec/exec-all.h"
-
 #endif /*__TRICORE_CPU_H__ */
target-tricore/helper.c +1 -0
index 71b31cd..3118905 100644
@@ -18,6 +18,7 @@
 #include "qemu/osdep.h"
 
 #include "cpu.h"
+#include "exec/exec-all.h"
 
 enum {
     TLBRET_DIRTY = -4,
target-tricore/op_helper.c +1 -0
index 40656c3..a73ed53 100644
@@ -18,6 +18,7 @@
 #include "cpu.h"
 #include "qemu/host-utils.h"
 #include "exec/helper-proto.h"
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 #include <zlib.h> /* for crc32 */
 
target-tricore/translate.c +1 -0
index 2d17aeb..83fa4fc 100644
@@ -21,6 +21,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "disas/disas.h"
+#include "exec/exec-all.h"
 #include "tcg-op.h"
 #include "exec/cpu_ldst.h"
 
target-unicore32/cpu.c +1 -0
index 66f43ac..3990433 100644
@@ -17,6 +17,7 @@
 #include "cpu.h"
 #include "qemu-common.h"
 #include "migration/vmstate.h"
+#include "exec/exec-all.h"
 
 static void uc32_cpu_set_pc(CPUState *cs, vaddr value)
 {
target-unicore32/cpu.h +0 -1
index 7099509..f3e877b 100644
@@ -164,7 +164,6 @@ static inline int cpu_mmu_index(CPUUniCore32State *env, bool ifetch)
 }
 
 #include "exec/cpu-all.h"
-#include "exec/exec-all.h"
 
 int uc32_cpu_exec(CPUState *s);
 
target-unicore32/helper.c +1 -0
index 21f5f35..d603bde 100644
@@ -11,6 +11,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "exec/gdbstub.h"
 #include "exec/helper-proto.h"
 #include "qemu/host-utils.h"
target-unicore32/op_helper.c +1 -0
index f584730..a782d33 100644
@@ -11,6 +11,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "exec/helper-proto.h"
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 
 #define SIGNBIT (uint32_t)0x80000000
target-unicore32/softmmu.c +1 -0
index d267fed..a34026a 100644
@@ -14,6 +14,7 @@
 
 #include "qemu/osdep.h"
 #include <cpu.h>
+#include "exec/exec-all.h"
 
 #undef DEBUG_UC32
 
target-unicore32/translate.c +1 -0
index 307f7b2..b04d22c 100644
@@ -12,6 +12,7 @@
 
 #include "cpu.h"
 #include "disas/disas.h"
+#include "exec/exec-all.h"
 #include "tcg-op.h"
 #include "qemu/log.h"
 #include "exec/cpu_ldst.h"
target-xtensa/cpu.c +1 -0
index 01b251f..5ad08a2 100644
@@ -33,6 +33,7 @@
 #include "cpu.h"
 #include "qemu-common.h"
 #include "migration/vmstate.h"
+#include "exec/exec-all.h"
 
 
 static void xtensa_cpu_set_pc(CPUState *cs, vaddr value)
target-xtensa/cpu.h +0 -1
index 98dd3e1..4769038 100644
@@ -584,6 +584,5 @@ static inline void cpu_get_tb_cpu_state(CPUXtensaState *env, target_ulong *pc,
 }
 
 #include "exec/cpu-all.h"
-#include "exec/exec-all.h"
 
 #endif
target-xtensa/gdbstub.c +1 -0
index bfcd591..fa5469a 100644
@@ -21,6 +21,7 @@
 #include "qemu-common.h"
 #include "cpu.h"
 #include "exec/gdbstub.h"
+#include "qemu/log.h"
 
 int xtensa_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
 {
target-xtensa/op_helper.c +1 -0
index 62fa33d..bc3667f 100644
@@ -29,6 +29,7 @@
 #include "cpu.h"
 #include "exec/helper-proto.h"
 #include "qemu/host-utils.h"
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 #include "exec/address-spaces.h"
 #include "qemu/timer.h"
target-xtensa/translate.c +1 -0
index 9eac56e..67efb32 100644
@@ -36,6 +36,7 @@
 #include "tcg-op.h"
 #include "qemu/log.h"
 #include "sysemu/sysemu.h"
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 #include "exec/semihost.h"
 
tcg/tcg-op.c +1 -0
index 7a15914..54c0277 100644
@@ -25,6 +25,7 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "cpu.h"
+#include "exec/exec-all.h"
 #include "tcg.h"
 #include "tcg-op.h"
 
tcg/tcg.c +5 -0
index 796addd..254427b 100644
@@ -41,6 +41,11 @@
 #define NO_CPU_IO_DEFS
 #include "cpu.h"
 
+#include "qemu/host-utils.h"
+#include "qemu/timer.h"
+#include "exec/cpu-common.h"
+#include "exec/exec-all.h"
+
 #include "tcg-op.h"
 
 #if UINTPTR_MAX == UINT32_MAX
translate-all.c +1 -0
index b54f472..1c1c855 100644
@@ -29,6 +29,7 @@
 #include "cpu.h"
 #include "trace.h"
 #include "disas/disas.h"
+#include "exec/exec-all.h"
 #include "tcg.h"
 #if defined(CONFIG_USER_ONLY)
 #include "qemu.h"
user-exec.c +1 -0
index d8d597b..c809daa 100644
@@ -19,6 +19,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "disas/disas.h"
+#include "exec/exec-all.h"
 #include "tcg.h"
 #include "qemu/bitops.h"
 #include "exec/cpu_ldst.h"
Signature · 1 line
1.8.3.1
#53 lore raw
In reply to Paolo Bonzini
Quoted 7 lines · Paolo Bonzini

The following changes since commit 8ec4fe0a4bed4fa27e6f28a746bcf77b27cd05a3:

Merge remote-tracking branch 'remotes/mjt/tags/pull-trivial-patches-2016-05-18' into staging (2016-05-19 09:27:28 +0100)

are available in the git repository at:

Quoted 8 lines

git://github.com/bonzini/qemu.git tags/for-upstream

for you to fetch changes up to 9a4292cfb84fc62435800086e5cecc7b0a4f7005:

hw: clean up hw/hw.h includes (2016-05-19 13:08:08 +0200)

----------------------------------------------------------------
NEED_CPU_H cleanups, big enough to deserve their own pull request.

I'm afraid this fails to build (all platforms):

In file included from /home/petmay01/linaro/qemu-for-merges/hw/s390x/s390-pci-bus.h:21:0,

                 from /home/petmay01/linaro/qemu-for-merges/hw/s390x/sclp.c:25:
/home/petmay01/linaro/qemu-for-merges/include/hw/s390x/css.h:85:20:
error: unknown type name ‘SubchDev’
     int (*ccw_cb) (SubchDev *, CCW1);
                    ^
/home/petmay01/linaro/qemu-for-merges/include/hw/s390x/css.h:86:24:
error: unknown type name ‘SubchDev’
     void (*disable_cb)(SubchDev *);
                        ^

thanks
-- PMM

#54 lore raw
Quoted 10 lines · Peter Maydell
Quoted 9 lines · Paolo Bonzini

The following changes since commit 8ec4fe0a4bed4fa27e6f28a746bcf77b27cd05a3:

Merge remote-tracking branch 'remotes/mjt/tags/pull-trivial-patches-2016-05-18' into staging (2016-05-19 09:27:28 +0100)

are available in the git repository at:

git://github.com/bonzini/qemu.git tags/for-upstream

Quoted 8 lines
Quoted 6 lines

for you to fetch changes up to 9a4292cfb84fc62435800086e5cecc7b0a4f7005:

hw: clean up hw/hw.h includes (2016-05-19 13:08:08 +0200)

----------------------------------------------------------------
NEED_CPU_H cleanups, big enough to deserve their own pull request.

I'm afraid this fails to build (all platforms):

Gah, so much for doing obvious changes to appease maintainers. :)

Will send v2.

Paolo

Quoted 15 lines

In file included from /home/petmay01/linaro/qemu-for-merges/hw/s390x/s390-pci-bus.h:21:0,

                 from /home/petmay01/linaro/qemu-for-merges/hw/s390x/sclp.c:25:
/home/petmay01/linaro/qemu-for-merges/include/hw/s390x/css.h:85:20:
error: unknown type name ‘SubchDev’
     int (*ccw_cb) (SubchDev *, CCW1);
                    ^
/home/petmay01/linaro/qemu-for-merges/include/hw/s390x/css.h:86:24:
error: unknown type name ‘SubchDev’
     void (*disable_cb)(SubchDev *);
                        ^

thanks
-- PMM