Skip to contentSkip to conversation

Move some machine core code to proper places

PATCH In review Markus Armbruster 2 participants 5 messages Jul 9, 2019 – Aug 12, 2019

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

cover Move some machine core code to proper places

This is a follow-up to my "Move QOM, qdev, machine core and dump code" series, merged in commit 374f63f6810.

Markus Armbruster (2):
hw/core: Move cpu.c, cpu.h from qom/ to hw/core/
qapi: Move query-target from misc.json to machine.json

 MAINTAINERS                    |  6 ++---
 accel/tcg/user-exec-stub.c     |  2 +-
 arch_init.c                    | 11 --------
 cpus-common.c                  |  2 +-
 docs/interop/firmware.json     |  2 +-
 hw/acpi/cpu_hotplug.c          |  2 +-
 hw/acpi/piix4.c                |  2 +-
 hw/arm/smmu-common.c           |  2 +-
 hw/arm/virt-acpi-build.c       |  2 +-
 hw/core/Makefile.objs          |  1 +
 {qom => hw/core}/cpu.c         |  2 +-
 hw/core/generic-loader.c       |  2 +-
 hw/core/machine-qmp-cmds.c     | 10 +++++++
 hw/core/null-machine.c         |  2 +-
 hw/cpu/a9mpcore.c              |  2 +-
 hw/cpu/cluster.c               |  2 +-
 hw/i386/acpi-build.c           |  2 +-
 hw/i386/pc.c                   |  2 +-
 hw/intc/arm_gic.c              |  2 +-
 hw/intc/arm_gicv3_common.c     |  2 +-
 hw/isa/lpc_ich9.c              |  2 +-
 hw/misc/imx6_src.c             |  2 +-
 hw/ppc/spapr.c                 |  2 +-
 hw/timer/a9gtimer.c            |  2 +-
 hw/timer/arm_mptimer.c         |  2 +-
 include/exec/cpu-all.h         |  2 +-
 include/exec/cpu-defs.h        |  2 +-
 include/exec/log.h             |  2 +-
 include/hw/boards.h            |  2 +-
 include/{qom => hw/core}/cpu.h |  0
 include/hw/ppc/openpic.h       |  2 +-
 include/sysemu/hw_accel.h      |  2 +-
 include/sysemu/kvm.h           |  2 +-
 qapi/common.json               | 25 ------------------
 qapi/machine.json              | 48 +++++++++++++++++++++++++++++++++-
 qapi/misc.json                 | 23 ----------------
 qom/Makefile.objs              |  1 -
 target/alpha/cpu-qom.h         |  2 +-
 target/arm/cpu-qom.h           |  2 +-
 target/cris/cpu-qom.h          |  2 +-
 target/hppa/cpu-qom.h          |  2 +-
 target/hppa/int_helper.c       |  2 +-
 target/hppa/mem_helper.c       |  2 +-
 target/i386/cpu-qom.h          |  2 +-
 target/lm32/cpu-qom.h          |  2 +-
 target/m68k/cpu-qom.h          |  2 +-
 target/microblaze/cpu-qom.h    |  2 +-
 target/mips/cpu-qom.h          |  2 +-
 target/moxie/cpu.h             |  2 +-
 target/nios2/cpu.h             |  2 +-
 target/openrisc/cpu.h          |  2 +-
 target/ppc/cpu-qom.h           |  2 +-
 target/riscv/cpu.h             |  2 +-
 target/s390x/cpu-qom.h         |  2 +-
 target/s390x/cpu_models.h      |  2 +-
 target/sh4/cpu-qom.h           |  2 +-
 target/sparc/cpu-qom.h         |  2 +-
 target/tilegx/cpu.h            |  2 +-
 target/tricore/cpu-qom.h       |  2 +-
 target/unicore32/cpu-qom.h     |  2 +-
 target/xtensa/cpu-qom.h        |  2 +-
 trace/control-internal.h       |  2 +-
 ui/cocoa.m                     |  2 +-
 63 files changed, 114 insertions(+), 119 deletions(-)
 rename {qom => hw/core}/cpu.c (99%)
 rename include/{qom => hw/core}/cpu.h (100%)
Signature · 1 line
2.21.0
#1 lore raw

PATCH 1/2 hw/core: Move cpu.c, cpu.h from qom/ to hw/core/

---
 MAINTAINERS                    | 6 ++----
 accel/tcg/user-exec-stub.c     | 2 +-
 cpus-common.c                  | 2 +-
 hw/acpi/cpu_hotplug.c          | 2 +-
 hw/acpi/piix4.c                | 2 +-
 hw/arm/smmu-common.c           | 2 +-
 hw/arm/virt-acpi-build.c       | 2 +-
 hw/core/Makefile.objs          | 1 +
 {qom => hw/core}/cpu.c         | 2 +-
 hw/core/generic-loader.c       | 2 +-
 hw/core/null-machine.c         | 2 +-
 hw/cpu/a9mpcore.c              | 2 +-
 hw/cpu/cluster.c               | 2 +-
 hw/i386/acpi-build.c           | 2 +-
 hw/i386/pc.c                   | 2 +-
 hw/intc/arm_gic.c              | 2 +-
 hw/intc/arm_gicv3_common.c     | 2 +-
 hw/isa/lpc_ich9.c              | 2 +-
 hw/misc/imx6_src.c             | 2 +-
 hw/ppc/spapr.c                 | 2 +-
 hw/timer/a9gtimer.c            | 2 +-
 hw/timer/arm_mptimer.c         | 2 +-
 include/exec/cpu-all.h         | 2 +-
 include/exec/cpu-defs.h        | 2 +-
 include/exec/log.h             | 2 +-
 include/hw/boards.h            | 2 +-
 include/{qom => hw/core}/cpu.h | 0
 include/hw/ppc/openpic.h       | 2 +-
 include/sysemu/hw_accel.h      | 2 +-
 include/sysemu/kvm.h           | 2 +-
 qom/Makefile.objs              | 1 -
 target/alpha/cpu-qom.h         | 2 +-
 target/arm/cpu-qom.h           | 2 +-
 target/cris/cpu-qom.h          | 2 +-
 target/hppa/cpu-qom.h          | 2 +-
 target/hppa/int_helper.c       | 2 +-
 target/hppa/mem_helper.c       | 2 +-
 target/i386/cpu-qom.h          | 2 +-
 target/lm32/cpu-qom.h          | 2 +-
 target/m68k/cpu-qom.h          | 2 +-
 target/microblaze/cpu-qom.h    | 2 +-
 target/mips/cpu-qom.h          | 2 +-
 target/moxie/cpu.h             | 2 +-
 target/nios2/cpu.h             | 2 +-
 target/openrisc/cpu.h          | 2 +-
 target/ppc/cpu-qom.h           | 2 +-
 target/riscv/cpu.h             | 2 +-
 target/s390x/cpu-qom.h         | 2 +-
 target/s390x/cpu_models.h      | 2 +-
 target/sh4/cpu-qom.h           | 2 +-
 target/sparc/cpu-qom.h         | 2 +-
 target/tilegx/cpu.h            | 2 +-
 target/tricore/cpu-qom.h       | 2 +-
 target/unicore32/cpu-qom.h     | 2 +-
 target/xtensa/cpu-qom.h        | 2 +-
 trace/control-internal.h       | 2 +-
 ui/cocoa.m                     | 2 +-
 57 files changed, 56 insertions(+), 58 deletions(-)
 rename {qom => hw/core}/cpu.c (99%)
 rename include/{qom => hw/core}/cpu.h (100%)
MAINTAINERS +2 -4
index cc9636b43a..4c687d88d1 100644
@@ -1274,6 +1274,7 @@ Machine core
 M: Eduardo Habkost <[email protected]>
 M: Marcel Apfelbaum <[email protected]>
 S: Supported
+F: hw/core/cpu.c
 F: hw/core/machine-qmp-cmds.c
 F: hw/core/machine.c
 F: hw/core/null-machine.c
@@ -1281,10 +1282,9 @@ F: hw/core/numa.c
 F: hw/cpu/cluster.c
 F: qapi/machine.json
 F: qapi/machine-target.json
-F: qom/cpu.c
 F: include/hw/boards.h
+F: include/hw/core/cpu.h
 F: include/hw/cpu/cluster.h
-F: include/qom/cpu.h
 F: include/sysemu/numa.h
 T: git https://github.com/ehabkost/qemu.git machine-next
 
@@ -2046,12 +2046,10 @@ F: hw/core/qdev*
 F: include/hw/qdev*
 F: include/monitor/qdev.h
 F: include/qom/
-X: include/qom/cpu.h
 F: qapi/qom.json
 F: qapi/qdev.json
 F: qdev-monitor.c
 F: qom/
-X: qom/cpu.c
 F: tests/check-qom-interface.c
 F: tests/check-qom-proplist.c
 F: tests/test-qdev-global-props.c
accel/tcg/user-exec-stub.c +1 -1
index 4bf00b8496..f6d8c8fb6f 100644
@@ -1,5 +1,5 @@
 #include "qemu/osdep.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "sysemu/replay.h"
 #include "sysemu/sysemu.h"
 
cpus-common.c +1 -1
index 3ca58c64e8..e742658e75 100644
@@ -20,7 +20,7 @@
 #include "qemu/osdep.h"
 #include "qemu/main-loop.h"
 #include "exec/cpu-common.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "sysemu/cpus.h"
 
 static QemuMutex qemu_cpu_list_lock;
hw/acpi/cpu_hotplug.c +1 -1
index 5243918125..92b2c09f5a 100644
@@ -13,7 +13,7 @@
 #include "hw/hw.h"
 #include "hw/acpi/cpu_hotplug.h"
 #include "qapi/error.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "hw/i386/pc.h"
 #include "qemu/error-report.h"
 
hw/acpi/piix4.c +1 -1
index ec4e186cec..16d113a676 100644
@@ -38,7 +38,7 @@
 #include "hw/acpi/memory_hotplug.h"
 #include "hw/acpi/acpi_dev_interface.h"
 #include "hw/xen/xen.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "trace.h"
 
 #define GPE_BASE 0xafe0
hw/arm/smmu-common.c +1 -1
index 717d22bcbe..c7d7d0fee1 100644
@@ -21,7 +21,7 @@
 #include "exec/address-spaces.h"
 #include "trace.h"
 #include "exec/target_page.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "hw/qdev-properties.h"
 #include "qapi/error.h"
 #include "qemu/jhash.h"
hw/arm/virt-acpi-build.c +1 -1
index 0afb372769..c3a6e98cd7 100644
@@ -30,7 +30,7 @@
 #include "qapi/error.h"
 #include "qemu/bitmap.h"
 #include "trace.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "target/arm/cpu.h"
 #include "hw/acpi/acpi-defs.h"
 #include "hw/acpi/acpi.h"
hw/core/Makefile.objs +1 -0
index f8481d959f..1421a73df6 100644
@@ -8,6 +8,7 @@ common-obj-y += irq.o
 common-obj-y += hotplug.o
 common-obj-$(CONFIG_SOFTMMU) += nmi.o
 common-obj-$(CONFIG_SOFTMMU) += vm-change-state-handler.o
+common-obj-y += cpu.o
 
 common-obj-$(CONFIG_EMPTY_SLOT) += empty_slot.o
 common-obj-$(CONFIG_XILINX_AXI) += stream.o
hw/core/cpu.c renamed from qom/cpu.c +1 -1
similarity index 99%
rename from qom/cpu.c
rename to hw/core/cpu.c
index f376f782d8..f3ceac8500 100644
@@ -20,7 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "sysemu/hw_accel.h"
 #include "qemu/notify.h"
 #include "qemu/log.h"
hw/core/generic-loader.c +1 -1
index 79a493e577..eb963e2a32 100644
@@ -31,7 +31,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "hw/sysbus.h"
 #include "sysemu/dma.h"
 #include "hw/loader.h"
hw/core/null-machine.c +1 -1
index 04a1e2b02a..194dac56fd 100644
@@ -17,7 +17,7 @@
 #include "hw/boards.h"
 #include "sysemu/sysemu.h"
 #include "exec/address-spaces.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 static void machine_none_init(MachineState *mch)
 {
hw/cpu/a9mpcore.c +1 -1
index 187e4d939e..71103485c5 100644
@@ -12,7 +12,7 @@
 #include "qapi/error.h"
 #include "qemu/module.h"
 #include "hw/cpu/a9mpcore.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 static void a9mp_priv_set_irq(void *opaque, int irq, int level)
 {
hw/cpu/cluster.c +1 -1
index 6f5f037b3c..c9a02fbbaf 100644
@@ -20,7 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/cpu/cluster.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "qapi/error.h"
 #include "qemu/module.h"
 #include "qemu/cutils.h"
hw/i386/acpi-build.c +1 -1
index d281ffa89e..5b25f256dd 100644
@@ -27,7 +27,7 @@
 #include "qemu/bitmap.h"
 #include "qemu/error-report.h"
 #include "hw/pci/pci.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "target/i386/cpu.h"
 #include "hw/misc/pvpanic.h"
 #include "hw/timer/hpet.h"
hw/i386/pc.c +1 -1
index c33ce47578..599658b83a 100644
@@ -73,7 +73,7 @@
 #include "qapi/error.h"
 #include "qapi/qapi-visit-common.h"
 #include "qapi/visitor.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "hw/nmi.h"
 #include "hw/usb.h"
 #include "hw/i386/intel_iommu.h"
hw/intc/arm_gic.c +1 -1
index 77427a4188..1a4a559925 100644
@@ -22,7 +22,7 @@
 #include "hw/sysbus.h"
 #include "gic_internal.h"
 #include "qapi/error.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
 #include "trace.h"
hw/intc/arm_gicv3_common.c +1 -1
index 5edabb928f..49edb08f3c 100644
@@ -24,7 +24,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qemu/module.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "hw/intc/arm_gicv3_common.h"
 #include "gicv3_internal.h"
 #include "hw/arm/linux-boot-if.h"
hw/isa/lpc_ich9.c +1 -1
index a7081bd52d..a54f8c6cad 100644
@@ -45,7 +45,7 @@
 #include "hw/pci/pci_bus.h"
 #include "exec/address-spaces.h"
 #include "sysemu/sysemu.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "hw/nvram/fw_cfg.h"
 #include "qemu/cutils.h"
 
hw/misc/imx6_src.c +1 -1
index 878ffcdc71..c1d0c614ef 100644
@@ -15,7 +15,7 @@
 #include "qemu/log.h"
 #include "qemu/module.h"
 #include "arm-powerctl.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #ifndef DEBUG_IMX6_SRC
 #define DEBUG_IMX6_SRC 0
hw/ppc/spapr.c +1 -1
index 821f0d4a49..e46d52224b 100644
@@ -46,7 +46,7 @@
 #include "mmu-hash64.h"
 #include "mmu-book3s-v3.h"
 #include "cpu-models.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #include "hw/boards.h"
 #include "hw/ppc/ppc.h"
hw/timer/a9gtimer.c +1 -1
index 09e2a7b7bf..d35dd61696 100644
@@ -27,7 +27,7 @@
 #include "qemu/bitops.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #ifndef A9_GTIMER_ERR_DEBUG
 #define A9_GTIMER_ERR_DEBUG 0
hw/timer/arm_mptimer.c +1 -1
index 93044aacfd..75ebf047b8 100644
@@ -25,7 +25,7 @@
 #include "qapi/error.h"
 #include "qemu/main-loop.h"
 #include "qemu/module.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #define PTIMER_POLICY                       \
     (PTIMER_POLICY_WRAP_AFTER_ONE_PERIOD |  \
include/exec/cpu-all.h +1 -1
index 536ea58f81..8323094648 100644
@@ -22,7 +22,7 @@
 #include "exec/cpu-common.h"
 #include "exec/memory.h"
 #include "qemu/thread.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "qemu/rcu.h"
 
 #define EXCP_INTERRUPT 	0x10000 /* async interruption */
include/exec/cpu-defs.h +1 -1
index 9bc713a70b..1b06865a24 100644
@@ -33,7 +33,7 @@
 #include "exec/hwaddr.h"
 #endif
 #include "exec/memattrs.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #include "cpu-param.h"
 
include/exec/log.h +1 -1
index de067f173b..e2cfd436e6 100644
@@ -2,7 +2,7 @@
 #define QEMU_EXEC_LOG_H
 
 #include "qemu/log.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "disas/disas.h"
 
 /* cpu_dump_state() logging functions: */
include/hw/boards.h +1 -1
index a71d1a53a5..07a848cb10 100644
@@ -9,7 +9,7 @@
 #include "qapi/qapi-types-machine.h"
 #include "qemu/module.h"
 #include "qom/object.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 /**
  * memory_region_allocate_system_memory - Allocate a board's main memory
include/hw/core/cpu.h renamed from include/qom/cpu.h +0 -0
similarity index 100%
rename from include/qom/cpu.h
rename to include/hw/core/cpu.h
include/hw/ppc/openpic.h +1 -1
index 7642a8ea1d..6931e7ccc4 100644
@@ -3,7 +3,7 @@
 
 #include "hw/sysbus.h"
 #include "hw/qdev-core.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #define MAX_CPU     32
 #define MAX_MSI     8
include/sysemu/hw_accel.h +1 -1
index d2ddfb5ad0..0ec2372477 100644
@@ -11,7 +11,7 @@
 #ifndef QEMU_HW_ACCEL_H
 #define QEMU_HW_ACCEL_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "sysemu/hax.h"
 #include "sysemu/kvm.h"
 #include "sysemu/whpx.h"
include/sysemu/kvm.h +1 -1
index acd90aebb6..9e6b485945 100644
@@ -15,7 +15,7 @@
 #define QEMU_KVM_H
 
 #include "qemu/queue.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "exec/memattrs.h"
 #include "hw/irq.h"
 
qom/Makefile.objs +0 -1
index aae478fc21..f9d77350ac 100644
@@ -1,5 +1,4 @@
 qom-obj-y = object.o container.o qom-qobject.o
 qom-obj-y += object_interfaces.o
 
-common-obj-y = cpu.o
 common-obj-$(CONFIG_SOFTMMU) += qom-hmp-cmds.o qom-qmp-cmds.o
target/alpha/cpu-qom.h +1 -1
index bae4945344..6f0a0adb9e 100644
@@ -20,7 +20,7 @@
 #ifndef QEMU_ALPHA_CPU_QOM_H
 #define QEMU_ALPHA_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #define TYPE_ALPHA_CPU "alpha-cpu"
 
target/arm/cpu-qom.h +1 -1
index 2049fa9612..7f5b244bde 100644
@@ -20,7 +20,7 @@
 #ifndef QEMU_ARM_CPU_QOM_H
 #define QEMU_ARM_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 struct arm_boot_info;
 
target/cris/cpu-qom.h +1 -1
index 7556e9f97e..308c1f95bd 100644
@@ -20,7 +20,7 @@
 #ifndef QEMU_CRIS_CPU_QOM_H
 #define QEMU_CRIS_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #define TYPE_CRIS_CPU "cris-cpu"
 
target/hppa/cpu-qom.h +1 -1
index 9084e4701d..6367dc4793 100644
@@ -20,7 +20,7 @@
 #ifndef QEMU_HPPA_CPU_QOM_H
 #define QEMU_HPPA_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #define TYPE_HPPA_CPU "hppa-cpu"
 
target/hppa/int_helper.c +1 -1
index 89241c31e7..462747baf8 100644
@@ -22,7 +22,7 @@
 #include "qemu/log.h"
 #include "cpu.h"
 #include "exec/helper-proto.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #ifndef CONFIG_USER_ONLY
 static void eval_interrupt(HPPACPU *cpu)
target/hppa/mem_helper.c +1 -1
index b12c5b5054..5a465db0dd 100644
@@ -21,7 +21,7 @@
 #include "cpu.h"
 #include "exec/exec-all.h"
 #include "exec/helper-proto.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "trace.h"
 
 #ifdef CONFIG_USER_ONLY
target/i386/cpu-qom.h +1 -1
index 1a52f02a4c..0efab2fc67 100644
@@ -20,7 +20,7 @@
 #ifndef QEMU_I386_CPU_QOM_H
 #define QEMU_I386_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "qemu/notify.h"
 
 #ifdef TARGET_X86_64
target/lm32/cpu-qom.h +1 -1
index b423d2564b..dc9ac9ac9f 100644
@@ -20,7 +20,7 @@
 #ifndef QEMU_LM32_CPU_QOM_H
 #define QEMU_LM32_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #define TYPE_LM32_CPU "lm32-cpu"
 
target/m68k/cpu-qom.h +1 -1
index 0c157251a2..b56da8a213 100644
@@ -20,7 +20,7 @@
 #ifndef QEMU_M68K_CPU_QOM_H
 #define QEMU_M68K_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #define TYPE_M68K_CPU "m68k-cpu"
 
target/microblaze/cpu-qom.h +1 -1
index 1a61db77d0..49b07cc697 100644
@@ -20,7 +20,7 @@
 #ifndef QEMU_MICROBLAZE_CPU_QOM_H
 #define QEMU_MICROBLAZE_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #define TYPE_MICROBLAZE_CPU "microblaze-cpu"
 
target/mips/cpu-qom.h +1 -1
index ee58606afe..a430c0fe4b 100644
@@ -20,7 +20,7 @@
 #ifndef QEMU_MIPS_CPU_QOM_H
 #define QEMU_MIPS_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #ifdef TARGET_MIPS64
 #define TYPE_MIPS_CPU "mips64-cpu"
target/moxie/cpu.h +1 -1
index 91ef2dc25e..01dca548e5 100644
@@ -46,7 +46,7 @@ typedef struct CPUMoxieState {
     struct {} end_reset_fields;
 } CPUMoxieState;
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #define TYPE_MOXIE_CPU "moxie-cpu"
 
target/nios2/cpu.h +1 -1
index 5d44b76389..361b06ffeb 100644
@@ -22,7 +22,7 @@
 #define NIOS2_CPU_H
 
 #include "exec/cpu-defs.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 typedef struct CPUNios2State CPUNios2State;
 #if !defined(CONFIG_USER_ONLY)
target/openrisc/cpu.h +1 -1
index f23b25262d..b4312c9dbb 100644
@@ -21,7 +21,7 @@
 #define OPENRISC_CPU_H
 
 #include "exec/cpu-defs.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 /* cpu_openrisc_map_address_* in CPUOpenRISCTLBContext need this decl.  */
 struct OpenRISCCPU;
target/ppc/cpu-qom.h +1 -1
index be9b4c30c3..e7e7c4d1bf 100644
@@ -20,7 +20,7 @@
 #ifndef QEMU_PPC_CPU_QOM_H
 #define QEMU_PPC_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #ifdef TARGET_PPC64
 #define TYPE_POWERPC_CPU "powerpc64-cpu"
target/riscv/cpu.h +1 -1
index 0adb307f32..a97d01a07c 100644
@@ -20,7 +20,7 @@
 #ifndef RISCV_CPU_H
 #define RISCV_CPU_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "exec/cpu-defs.h"
 #include "fpu/softfloat.h"
 
target/s390x/cpu-qom.h +1 -1
index b46217dc31..b809ec8418 100644
@@ -20,7 +20,7 @@
 #ifndef QEMU_S390_CPU_QOM_H
 #define QEMU_S390_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #define TYPE_S390_CPU "s390x-cpu"
 
target/s390x/cpu_models.h +1 -1
index 174a99e561..88bd01a616 100644
@@ -15,7 +15,7 @@
 
 #include "cpu_features.h"
 #include "gen-features.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 /* static CPU definition */
 struct S390CPUDef {
target/sh4/cpu-qom.h +1 -1
index 0f9fb4dd31..0c56d055ba 100644
@@ -20,7 +20,7 @@
 #ifndef QEMU_SUPERH_CPU_QOM_H
 #define QEMU_SUPERH_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #define TYPE_SUPERH_CPU "superh-cpu"
 
target/sparc/cpu-qom.h +1 -1
index af6d57a9e0..7442e2768e 100644
@@ -20,7 +20,7 @@
 #ifndef QEMU_SPARC_CPU_QOM_H
 #define QEMU_SPARC_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #ifdef TARGET_SPARC64
 #define TYPE_SPARC_CPU "sparc64-cpu"
target/tilegx/cpu.h +1 -1
index 6fcec06a9b..9cbec247d2 100644
@@ -94,7 +94,7 @@ typedef struct CPUTLGState {
     struct {} end_reset_fields;
 } CPUTLGState;
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #define TYPE_TILEGX_CPU "tilegx-cpu"
 
target/tricore/cpu-qom.h +1 -1
index 93c9d77fe3..7c1e130b4e 100644
@@ -18,7 +18,7 @@
 #ifndef QEMU_TRICORE_CPU_QOM_H
 #define QEMU_TRICORE_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 
 #define TYPE_TRICORE_CPU "tricore-cpu"
target/unicore32/cpu-qom.h +1 -1
index bc68e78045..7dd04515cb 100644
@@ -11,7 +11,7 @@
 #ifndef QEMU_UC32_CPU_QOM_H
 #define QEMU_UC32_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #define TYPE_UNICORE32_CPU "unicore32-cpu"
 
target/xtensa/cpu-qom.h +1 -1
index 403bd95721..9ac54241bd 100644
@@ -29,7 +29,7 @@
 #ifndef QEMU_XTENSA_CPU_QOM_H
 #define QEMU_XTENSA_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #define TYPE_XTENSA_CPU "xtensa-cpu"
 
trace/control-internal.h +1 -1
index c7fbe2d3bf..fe104b6f36 100644
@@ -10,7 +10,7 @@
 #ifndef TRACE__CONTROL_INTERNAL_H
 #define TRACE__CONTROL_INTERNAL_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 
 extern int trace_events_enabled_count;
ui/cocoa.m +1 -1
index c2984028c5..41ceb94bfc 100644
@@ -38,7 +38,7 @@
 #include "qemu-version.h"
 #include "qemu/module.h"
 #include <Carbon/Carbon.h>
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #ifndef MAC_OS_X_VERSION_10_5
 #define MAC_OS_X_VERSION_10_5 1050
Signature · 1 line
2.21.0
Reviewed-by Tested-by on v1 1/2
#2 lore raw

Re: [Qemu-devel] [PATCH 1/2] hw/core: Move cpu.c, cpu.h from qom/ to hw/core/

Quoted 2 lines · Markus Armbruster
Quoted 816 lines
---
 MAINTAINERS                    | 6 ++----
 accel/tcg/user-exec-stub.c     | 2 +-
 cpus-common.c                  | 2 +-
 hw/acpi/cpu_hotplug.c          | 2 +-
 hw/acpi/piix4.c                | 2 +-
 hw/arm/smmu-common.c           | 2 +-
 hw/arm/virt-acpi-build.c       | 2 +-
 hw/core/Makefile.objs          | 1 +
 {qom => hw/core}/cpu.c         | 2 +-
 hw/core/generic-loader.c       | 2 +-
 hw/core/null-machine.c         | 2 +-
 hw/cpu/a9mpcore.c              | 2 +-
 hw/cpu/cluster.c               | 2 +-
 hw/i386/acpi-build.c           | 2 +-
 hw/i386/pc.c                   | 2 +-
 hw/intc/arm_gic.c              | 2 +-
 hw/intc/arm_gicv3_common.c     | 2 +-
 hw/isa/lpc_ich9.c              | 2 +-
 hw/misc/imx6_src.c             | 2 +-
 hw/ppc/spapr.c                 | 2 +-
 hw/timer/a9gtimer.c            | 2 +-
 hw/timer/arm_mptimer.c         | 2 +-
 include/exec/cpu-all.h         | 2 +-
 include/exec/cpu-defs.h        | 2 +-
 include/exec/log.h             | 2 +-
 include/hw/boards.h            | 2 +-
 include/{qom => hw/core}/cpu.h | 0
 include/hw/ppc/openpic.h       | 2 +-
 include/sysemu/hw_accel.h      | 2 +-
 include/sysemu/kvm.h           | 2 +-
 qom/Makefile.objs              | 1 -
 target/alpha/cpu-qom.h         | 2 +-
 target/arm/cpu-qom.h           | 2 +-
 target/cris/cpu-qom.h          | 2 +-
 target/hppa/cpu-qom.h          | 2 +-
 target/hppa/int_helper.c       | 2 +-
 target/hppa/mem_helper.c       | 2 +-
 target/i386/cpu-qom.h          | 2 +-
 target/lm32/cpu-qom.h          | 2 +-
 target/m68k/cpu-qom.h          | 2 +-
 target/microblaze/cpu-qom.h    | 2 +-
 target/mips/cpu-qom.h          | 2 +-
 target/moxie/cpu.h             | 2 +-
 target/nios2/cpu.h             | 2 +-
 target/openrisc/cpu.h          | 2 +-
 target/ppc/cpu-qom.h           | 2 +-
 target/riscv/cpu.h             | 2 +-
 target/s390x/cpu-qom.h         | 2 +-
 target/s390x/cpu_models.h      | 2 +-
 target/sh4/cpu-qom.h           | 2 +-
 target/sparc/cpu-qom.h         | 2 +-
 target/tilegx/cpu.h            | 2 +-
 target/tricore/cpu-qom.h       | 2 +-
 target/unicore32/cpu-qom.h     | 2 +-
 target/xtensa/cpu-qom.h        | 2 +-
 trace/control-internal.h       | 2 +-
 ui/cocoa.m                     | 2 +-
 57 files changed, 56 insertions(+), 58 deletions(-)
 rename {qom => hw/core}/cpu.c (99%)
 rename include/{qom => hw/core}/cpu.h (100%)
MAINTAINERS +2 -4
index cc9636b43a..4c687d88d1 100644
@@ -1274,6 +1274,7 @@ Machine core
 M: Eduardo Habkost <[email protected]>
 M: Marcel Apfelbaum <[email protected]>
 S: Supported
+F: hw/core/cpu.c
 F: hw/core/machine-qmp-cmds.c
 F: hw/core/machine.c
 F: hw/core/null-machine.c
@@ -1281,10 +1282,9 @@ F: hw/core/numa.c
 F: hw/cpu/cluster.c
 F: qapi/machine.json
 F: qapi/machine-target.json
-F: qom/cpu.c
 F: include/hw/boards.h
+F: include/hw/core/cpu.h
 F: include/hw/cpu/cluster.h
-F: include/qom/cpu.h
 F: include/sysemu/numa.h
 T: git https://github.com/ehabkost/qemu.git machine-next
 
@@ -2046,12 +2046,10 @@ F: hw/core/qdev*
 F: include/hw/qdev*
 F: include/monitor/qdev.h
 F: include/qom/
-X: include/qom/cpu.h
 F: qapi/qom.json
 F: qapi/qdev.json
 F: qdev-monitor.c
 F: qom/
-X: qom/cpu.c
 F: tests/check-qom-interface.c
 F: tests/check-qom-proplist.c
 F: tests/test-qdev-global-props.c
accel/tcg/user-exec-stub.c +1 -1
index 4bf00b8496..f6d8c8fb6f 100644
@@ -1,5 +1,5 @@
 #include "qemu/osdep.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "sysemu/replay.h"
 #include "sysemu/sysemu.h"
 
cpus-common.c +1 -1
index 3ca58c64e8..e742658e75 100644
@@ -20,7 +20,7 @@
 #include "qemu/osdep.h"
 #include "qemu/main-loop.h"
 #include "exec/cpu-common.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "sysemu/cpus.h"
 
 static QemuMutex qemu_cpu_list_lock;
hw/acpi/cpu_hotplug.c +1 -1
index 5243918125..92b2c09f5a 100644
@@ -13,7 +13,7 @@
 #include "hw/hw.h"
 #include "hw/acpi/cpu_hotplug.h"
 #include "qapi/error.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "hw/i386/pc.h"
 #include "qemu/error-report.h"
 
hw/acpi/piix4.c +1 -1
index ec4e186cec..16d113a676 100644
@@ -38,7 +38,7 @@
 #include "hw/acpi/memory_hotplug.h"
 #include "hw/acpi/acpi_dev_interface.h"
 #include "hw/xen/xen.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "trace.h"
 
 #define GPE_BASE 0xafe0
hw/arm/smmu-common.c +1 -1
index 717d22bcbe..c7d7d0fee1 100644
@@ -21,7 +21,7 @@
 #include "exec/address-spaces.h"
 #include "trace.h"
 #include "exec/target_page.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "hw/qdev-properties.h"
 #include "qapi/error.h"
 #include "qemu/jhash.h"
hw/arm/virt-acpi-build.c +1 -1
index 0afb372769..c3a6e98cd7 100644
@@ -30,7 +30,7 @@
 #include "qapi/error.h"
 #include "qemu/bitmap.h"
 #include "trace.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "target/arm/cpu.h"
 #include "hw/acpi/acpi-defs.h"
 #include "hw/acpi/acpi.h"
hw/core/Makefile.objs +1 -0
index f8481d959f..1421a73df6 100644
@@ -8,6 +8,7 @@ common-obj-y += irq.o
 common-obj-y += hotplug.o
 common-obj-$(CONFIG_SOFTMMU) += nmi.o
 common-obj-$(CONFIG_SOFTMMU) += vm-change-state-handler.o
+common-obj-y += cpu.o
 
 common-obj-$(CONFIG_EMPTY_SLOT) += empty_slot.o
 common-obj-$(CONFIG_XILINX_AXI) += stream.o
hw/core/cpu.c renamed from qom/cpu.c +1 -1
similarity index 99%
rename from qom/cpu.c
rename to hw/core/cpu.c
index f376f782d8..f3ceac8500 100644
@@ -20,7 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "sysemu/hw_accel.h"
 #include "qemu/notify.h"
 #include "qemu/log.h"
hw/core/generic-loader.c +1 -1
index 79a493e577..eb963e2a32 100644
@@ -31,7 +31,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "hw/sysbus.h"
 #include "sysemu/dma.h"
 #include "hw/loader.h"
hw/core/null-machine.c +1 -1
index 04a1e2b02a..194dac56fd 100644
@@ -17,7 +17,7 @@
 #include "hw/boards.h"
 #include "sysemu/sysemu.h"
 #include "exec/address-spaces.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 static void machine_none_init(MachineState *mch)
 {
hw/cpu/a9mpcore.c +1 -1
index 187e4d939e..71103485c5 100644
@@ -12,7 +12,7 @@
 #include "qapi/error.h"
 #include "qemu/module.h"
 #include "hw/cpu/a9mpcore.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 static void a9mp_priv_set_irq(void *opaque, int irq, int level)
 {
hw/cpu/cluster.c +1 -1
index 6f5f037b3c..c9a02fbbaf 100644
@@ -20,7 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/cpu/cluster.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "qapi/error.h"
 #include "qemu/module.h"
 #include "qemu/cutils.h"
hw/i386/acpi-build.c +1 -1
index d281ffa89e..5b25f256dd 100644
@@ -27,7 +27,7 @@
 #include "qemu/bitmap.h"
 #include "qemu/error-report.h"
 #include "hw/pci/pci.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "target/i386/cpu.h"
 #include "hw/misc/pvpanic.h"
 #include "hw/timer/hpet.h"
hw/i386/pc.c +1 -1
index c33ce47578..599658b83a 100644
@@ -73,7 +73,7 @@
 #include "qapi/error.h"
 #include "qapi/qapi-visit-common.h"
 #include "qapi/visitor.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "hw/nmi.h"
 #include "hw/usb.h"
 #include "hw/i386/intel_iommu.h"
hw/intc/arm_gic.c +1 -1
index 77427a4188..1a4a559925 100644
@@ -22,7 +22,7 @@
 #include "hw/sysbus.h"
 #include "gic_internal.h"
 #include "qapi/error.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
 #include "trace.h"
hw/intc/arm_gicv3_common.c +1 -1
index 5edabb928f..49edb08f3c 100644
@@ -24,7 +24,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qemu/module.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "hw/intc/arm_gicv3_common.h"
 #include "gicv3_internal.h"
 #include "hw/arm/linux-boot-if.h"
hw/isa/lpc_ich9.c +1 -1
index a7081bd52d..a54f8c6cad 100644
@@ -45,7 +45,7 @@
 #include "hw/pci/pci_bus.h"
 #include "exec/address-spaces.h"
 #include "sysemu/sysemu.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "hw/nvram/fw_cfg.h"
 #include "qemu/cutils.h"
 
hw/misc/imx6_src.c +1 -1
index 878ffcdc71..c1d0c614ef 100644
@@ -15,7 +15,7 @@
 #include "qemu/log.h"
 #include "qemu/module.h"
 #include "arm-powerctl.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #ifndef DEBUG_IMX6_SRC
 #define DEBUG_IMX6_SRC 0
hw/ppc/spapr.c +1 -1
index 821f0d4a49..e46d52224b 100644
@@ -46,7 +46,7 @@
 #include "mmu-hash64.h"
 #include "mmu-book3s-v3.h"
 #include "cpu-models.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #include "hw/boards.h"
 #include "hw/ppc/ppc.h"
hw/timer/a9gtimer.c +1 -1
index 09e2a7b7bf..d35dd61696 100644
@@ -27,7 +27,7 @@
 #include "qemu/bitops.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #ifndef A9_GTIMER_ERR_DEBUG
 #define A9_GTIMER_ERR_DEBUG 0
hw/timer/arm_mptimer.c +1 -1
index 93044aacfd..75ebf047b8 100644
@@ -25,7 +25,7 @@
 #include "qapi/error.h"
 #include "qemu/main-loop.h"
 #include "qemu/module.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #define PTIMER_POLICY                       \
     (PTIMER_POLICY_WRAP_AFTER_ONE_PERIOD |  \
include/exec/cpu-all.h +1 -1
index 536ea58f81..8323094648 100644
@@ -22,7 +22,7 @@
 #include "exec/cpu-common.h"
 #include "exec/memory.h"
 #include "qemu/thread.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "qemu/rcu.h"
 
 #define EXCP_INTERRUPT 	0x10000 /* async interruption */
include/exec/cpu-defs.h +1 -1
index 9bc713a70b..1b06865a24 100644
@@ -33,7 +33,7 @@
 #include "exec/hwaddr.h"
 #endif
 #include "exec/memattrs.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #include "cpu-param.h"
 
include/exec/log.h +1 -1
index de067f173b..e2cfd436e6 100644
@@ -2,7 +2,7 @@
 #define QEMU_EXEC_LOG_H
 
 #include "qemu/log.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "disas/disas.h"
 
 /* cpu_dump_state() logging functions: */
include/hw/boards.h +1 -1
index a71d1a53a5..07a848cb10 100644
@@ -9,7 +9,7 @@
 #include "qapi/qapi-types-machine.h"
 #include "qemu/module.h"
 #include "qom/object.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 /**
  * memory_region_allocate_system_memory - Allocate a board's main memory
include/hw/core/cpu.h renamed from include/qom/cpu.h +0 -0
similarity index 100%
rename from include/qom/cpu.h
rename to include/hw/core/cpu.h
include/hw/ppc/openpic.h +1 -1
index 7642a8ea1d..6931e7ccc4 100644
@@ -3,7 +3,7 @@
 
 #include "hw/sysbus.h"
 #include "hw/qdev-core.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #define MAX_CPU     32
 #define MAX_MSI     8
include/sysemu/hw_accel.h +1 -1
index d2ddfb5ad0..0ec2372477 100644
@@ -11,7 +11,7 @@
 #ifndef QEMU_HW_ACCEL_H
 #define QEMU_HW_ACCEL_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "sysemu/hax.h"
 #include "sysemu/kvm.h"
 #include "sysemu/whpx.h"
include/sysemu/kvm.h +1 -1
index acd90aebb6..9e6b485945 100644
@@ -15,7 +15,7 @@
 #define QEMU_KVM_H
 
 #include "qemu/queue.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "exec/memattrs.h"
 #include "hw/irq.h"
 
qom/Makefile.objs +0 -1
index aae478fc21..f9d77350ac 100644
@@ -1,5 +1,4 @@
 qom-obj-y = object.o container.o qom-qobject.o
 qom-obj-y += object_interfaces.o
 
-common-obj-y = cpu.o
 common-obj-$(CONFIG_SOFTMMU) += qom-hmp-cmds.o qom-qmp-cmds.o
target/alpha/cpu-qom.h +1 -1
index bae4945344..6f0a0adb9e 100644
@@ -20,7 +20,7 @@
 #ifndef QEMU_ALPHA_CPU_QOM_H
 #define QEMU_ALPHA_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #define TYPE_ALPHA_CPU "alpha-cpu"
 
target/arm/cpu-qom.h +1 -1
index 2049fa9612..7f5b244bde 100644
@@ -20,7 +20,7 @@
 #ifndef QEMU_ARM_CPU_QOM_H
 #define QEMU_ARM_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 struct arm_boot_info;
 
target/cris/cpu-qom.h +1 -1
index 7556e9f97e..308c1f95bd 100644
@@ -20,7 +20,7 @@
 #ifndef QEMU_CRIS_CPU_QOM_H
 #define QEMU_CRIS_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #define TYPE_CRIS_CPU "cris-cpu"
 
target/hppa/cpu-qom.h +1 -1
index 9084e4701d..6367dc4793 100644
@@ -20,7 +20,7 @@
 #ifndef QEMU_HPPA_CPU_QOM_H
 #define QEMU_HPPA_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #define TYPE_HPPA_CPU "hppa-cpu"
 
target/hppa/int_helper.c +1 -1
index 89241c31e7..462747baf8 100644
@@ -22,7 +22,7 @@
 #include "qemu/log.h"
 #include "cpu.h"
 #include "exec/helper-proto.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #ifndef CONFIG_USER_ONLY
 static void eval_interrupt(HPPACPU *cpu)
target/hppa/mem_helper.c +1 -1
index b12c5b5054..5a465db0dd 100644
@@ -21,7 +21,7 @@
 #include "cpu.h"
 #include "exec/exec-all.h"
 #include "exec/helper-proto.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "trace.h"
 
 #ifdef CONFIG_USER_ONLY
target/i386/cpu-qom.h +1 -1
index 1a52f02a4c..0efab2fc67 100644
@@ -20,7 +20,7 @@
 #ifndef QEMU_I386_CPU_QOM_H
 #define QEMU_I386_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "qemu/notify.h"
 
 #ifdef TARGET_X86_64
target/lm32/cpu-qom.h +1 -1
index b423d2564b..dc9ac9ac9f 100644
@@ -20,7 +20,7 @@
 #ifndef QEMU_LM32_CPU_QOM_H
 #define QEMU_LM32_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #define TYPE_LM32_CPU "lm32-cpu"
 
target/m68k/cpu-qom.h +1 -1
index 0c157251a2..b56da8a213 100644
@@ -20,7 +20,7 @@
 #ifndef QEMU_M68K_CPU_QOM_H
 #define QEMU_M68K_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #define TYPE_M68K_CPU "m68k-cpu"
 
target/microblaze/cpu-qom.h +1 -1
index 1a61db77d0..49b07cc697 100644
@@ -20,7 +20,7 @@
 #ifndef QEMU_MICROBLAZE_CPU_QOM_H
 #define QEMU_MICROBLAZE_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #define TYPE_MICROBLAZE_CPU "microblaze-cpu"
 
target/mips/cpu-qom.h +1 -1
index ee58606afe..a430c0fe4b 100644
@@ -20,7 +20,7 @@
 #ifndef QEMU_MIPS_CPU_QOM_H
 #define QEMU_MIPS_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #ifdef TARGET_MIPS64
 #define TYPE_MIPS_CPU "mips64-cpu"
target/moxie/cpu.h +1 -1
index 91ef2dc25e..01dca548e5 100644
@@ -46,7 +46,7 @@ typedef struct CPUMoxieState {
     struct {} end_reset_fields;
 } CPUMoxieState;
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #define TYPE_MOXIE_CPU "moxie-cpu"
 
target/nios2/cpu.h +1 -1
index 5d44b76389..361b06ffeb 100644
@@ -22,7 +22,7 @@
 #define NIOS2_CPU_H
 
 #include "exec/cpu-defs.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 typedef struct CPUNios2State CPUNios2State;
 #if !defined(CONFIG_USER_ONLY)
target/openrisc/cpu.h +1 -1
index f23b25262d..b4312c9dbb 100644
@@ -21,7 +21,7 @@
 #define OPENRISC_CPU_H
 
 #include "exec/cpu-defs.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 /* cpu_openrisc_map_address_* in CPUOpenRISCTLBContext need this decl.  */
 struct OpenRISCCPU;
target/ppc/cpu-qom.h +1 -1
index be9b4c30c3..e7e7c4d1bf 100644
@@ -20,7 +20,7 @@
 #ifndef QEMU_PPC_CPU_QOM_H
 #define QEMU_PPC_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #ifdef TARGET_PPC64
 #define TYPE_POWERPC_CPU "powerpc64-cpu"
target/riscv/cpu.h +1 -1
index 0adb307f32..a97d01a07c 100644
@@ -20,7 +20,7 @@
 #ifndef RISCV_CPU_H
 #define RISCV_CPU_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 #include "exec/cpu-defs.h"
 #include "fpu/softfloat.h"
 
target/s390x/cpu-qom.h +1 -1
index b46217dc31..b809ec8418 100644
@@ -20,7 +20,7 @@
 #ifndef QEMU_S390_CPU_QOM_H
 #define QEMU_S390_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #define TYPE_S390_CPU "s390x-cpu"
 
target/s390x/cpu_models.h +1 -1
index 174a99e561..88bd01a616 100644
@@ -15,7 +15,7 @@
 
 #include "cpu_features.h"
 #include "gen-features.h"
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 /* static CPU definition */
 struct S390CPUDef {
target/sh4/cpu-qom.h +1 -1
index 0f9fb4dd31..0c56d055ba 100644
@@ -20,7 +20,7 @@
 #ifndef QEMU_SUPERH_CPU_QOM_H
 #define QEMU_SUPERH_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #define TYPE_SUPERH_CPU "superh-cpu"
 
target/sparc/cpu-qom.h +1 -1
index af6d57a9e0..7442e2768e 100644
@@ -20,7 +20,7 @@
 #ifndef QEMU_SPARC_CPU_QOM_H
 #define QEMU_SPARC_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #ifdef TARGET_SPARC64
 #define TYPE_SPARC_CPU "sparc64-cpu"
target/tilegx/cpu.h +1 -1
index 6fcec06a9b..9cbec247d2 100644
@@ -94,7 +94,7 @@ typedef struct CPUTLGState {
     struct {} end_reset_fields;
 } CPUTLGState;
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #define TYPE_TILEGX_CPU "tilegx-cpu"
 
target/tricore/cpu-qom.h +1 -1
index 93c9d77fe3..7c1e130b4e 100644
@@ -18,7 +18,7 @@
 #ifndef QEMU_TRICORE_CPU_QOM_H
 #define QEMU_TRICORE_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 
 #define TYPE_TRICORE_CPU "tricore-cpu"
target/unicore32/cpu-qom.h +1 -1
index bc68e78045..7dd04515cb 100644
@@ -11,7 +11,7 @@
 #ifndef QEMU_UC32_CPU_QOM_H
 #define QEMU_UC32_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #define TYPE_UNICORE32_CPU "unicore32-cpu"
 
target/xtensa/cpu-qom.h +1 -1
index 403bd95721..9ac54241bd 100644
@@ -29,7 +29,7 @@
 #ifndef QEMU_XTENSA_CPU_QOM_H
 #define QEMU_XTENSA_CPU_QOM_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #define TYPE_XTENSA_CPU "xtensa-cpu"
 
trace/control-internal.h +1 -1
index c7fbe2d3bf..fe104b6f36 100644
@@ -10,7 +10,7 @@
 #ifndef TRACE__CONTROL_INTERNAL_H
 #define TRACE__CONTROL_INTERNAL_H
 
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 
 extern int trace_events_enabled_count;
ui/cocoa.m +1 -1
index c2984028c5..41ceb94bfc 100644
@@ -38,7 +38,7 @@
 #include "qemu-version.h"
 #include "qemu/module.h"
 #include <Carbon/Carbon.h>
-#include "qom/cpu.h"
+#include "hw/core/cpu.h"
 
 #ifndef MAC_OS_X_VERSION_10_5
 #define MAC_OS_X_VERSION_10_5 1050
#3 lore raw

PATCH 2/2 qapi: Move query-target from misc.json to machine.json

In reply to Markus Armbruster

Move query-target and its return type TargetInfo from misc.json to machine.json, where they are covered by MAINTAINERS section "Machine core". Also move its implementation from arch_init.c to hw/core/machine-qmp-cmds, where it is likewise covered.

All users of SysEmuTarget are now in machine.json. Move it there from common.json.

---
 arch_init.c                | 11 ---------
 docs/interop/firmware.json |  2 +-
 hw/core/machine-qmp-cmds.c | 10 ++++++++
 qapi/common.json           | 25 --------------------
 qapi/machine.json          | 48 +++++++++++++++++++++++++++++++++++++-
 qapi/misc.json             | 23 ------------------
 6 files changed, 58 insertions(+), 61 deletions(-)
arch_init.c +0 -11
index 74b0708634..0a1531124c 100644
@@ -106,14 +106,3 @@ int xen_available(void)
     return 0;
 #endif
 }
-
-
-TargetInfo *qmp_query_target(Error **errp)
-{
-    TargetInfo *info = g_malloc0(sizeof(*info));
-
-    info->arch = qapi_enum_parse(&SysEmuTarget_lookup, TARGET_NAME, -1,
-                                 &error_abort);
-
-    return info;
-}
docs/interop/firmware.json +1 -1
index ff8c2ce5f2..8ffb7856d2 100644
@@ -13,7 +13,7 @@
 # = Firmware
 ##
 
-{ 'include' : 'common.json' }
+{ 'include' : 'machine.json' }
 { 'include' : 'block-core.json' }
 
 ##
hw/core/machine-qmp-cmds.c +10 -0
index 5bd95b8ab0..ac2dd8b56e 100644
@@ -247,6 +247,16 @@ CurrentMachineParams *qmp_query_current_machine(Error **errp)
     return params;
 }
 
+TargetInfo *qmp_query_target(Error **errp)
+{
+    TargetInfo *info = g_malloc0(sizeof(*info));
+
+    info->arch = qapi_enum_parse(&SysEmuTarget_lookup, TARGET_NAME, -1,
+                                 &error_abort);
+
+    return info;
+}
+
 HotpluggableCPUList *qmp_query_hotpluggable_cpus(Error **errp)
 {
     MachineState *ms = MACHINE(qdev_get_machine());
qapi/common.json +0 -25
index 99d313ef3b..3083e7005b 100644
@@ -168,28 +168,3 @@
 ##
 { 'enum': 'PCIELinkWidth',
   'data': [ '1', '2', '4', '8', '12', '16', '32' ] }
-
-##
-# @SysEmuTarget:
-#
-# The comprehensive enumeration of QEMU system emulation ("softmmu")
-# targets. Run "./configure --help" in the project root directory, and
-# look for the *-softmmu targets near the "--target-list" option. The
-# individual target constants are not documented here, for the time
-# being.
-#
-# Notes: The resulting QMP strings can be appended to the "qemu-system-"
-#        prefix to produce the corresponding QEMU executable name. This
-#        is true even for "qemu-system-x86_64".
-#
-# ppcemb: dropped in 3.1
-#
-# Since: 3.0
-##
-{ 'enum' : 'SysEmuTarget',
-  'data' : [ 'aarch64', 'alpha', 'arm', 'cris', 'hppa', 'i386', 'lm32',
-             'm68k', 'microblaze', 'microblazeel', 'mips', 'mips64',
-             'mips64el', 'mipsel', 'moxie', 'nios2', 'or1k', 'ppc',
-             'ppc64', 'riscv32', 'riscv64', 's390x', 'sh4',
-             'sh4eb', 'sparc', 'sparc64', 'tricore', 'unicore32',
-             'x86_64', 'xtensa', 'xtensaeb' ] }
qapi/machine.json +47 -1

60 lines not on this page · raw message

qapi/misc.json +0 -23
index a7fba7230c..6bd11f50e6 100644
@@ -1341,29 +1341,6 @@
 ##
 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
 
-##
-# @TargetInfo:
-#
-# Information describing the QEMU target.
-#
-# @arch: the target architecture
-#
-# Since: 1.2.0
-##
-{ 'struct': 'TargetInfo',
-  'data': { 'arch': 'SysEmuTarget' } }
-
-##
-# @query-target:
-#
-# Return information about the target for this QEMU
-#
-# Returns: TargetInfo
-#
-# Since: 1.2.0
-##
-{ 'command': 'query-target', 'returns': 'TargetInfo' }
-
 ##
 # @AcpiTableOptions:
 #
Signature · 1 line
2.21.0