aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Kconfig1
-rw-r--r--MAINTAINERS22
-rw-r--r--accel/accel-common.c2
-rw-r--r--accel/accel-softmmu.c2
-rw-r--r--accel/qtest/meson.build8
-rw-r--r--accel/qtest/qtest.c2
-rw-r--r--accel/tcg/hmp.c29
-rw-r--r--accel/tcg/meson.build6
-rw-r--r--accel/tcg/tcg-accel-ops.c1
-rw-r--r--accel/tcg/tcg-all.c1
-rw-r--r--audio/spiceaudio.c2
-rw-r--r--block/iscsi-opts.c1
-rw-r--r--block/meson.build2
-rw-r--r--chardev/baum.c1
-rw-r--r--chardev/spice.c4
-rw-r--r--configs/devices/aarch64-softmmu/default.mak (renamed from default-configs/devices/aarch64-softmmu.mak)2
-rw-r--r--configs/devices/aarch64-softmmu/minimal.mak9
-rw-r--r--configs/devices/alpha-softmmu/default.mak (renamed from default-configs/devices/alpha-softmmu.mak)0
-rw-r--r--configs/devices/arm-softmmu/default.mak (renamed from default-configs/devices/arm-softmmu.mak)3
-rw-r--r--configs/devices/avr-softmmu/default.mak (renamed from default-configs/devices/avr-softmmu.mak)0
-rw-r--r--configs/devices/cris-softmmu/default.mak (renamed from default-configs/devices/cris-softmmu.mak)0
-rw-r--r--configs/devices/hppa-softmmu/default.mak (renamed from default-configs/devices/hppa-softmmu.mak)0
-rw-r--r--configs/devices/i386-softmmu/default.mak (renamed from default-configs/devices/i386-softmmu.mak)0
-rw-r--r--configs/devices/m68k-softmmu/default.mak (renamed from default-configs/devices/m68k-softmmu.mak)0
-rw-r--r--configs/devices/microblaze-softmmu/default.mak (renamed from default-configs/devices/microblaze-softmmu.mak)0
-rw-r--r--configs/devices/microblazeel-softmmu/default.mak (renamed from default-configs/devices/microblazeel-softmmu.mak)2
-rw-r--r--configs/devices/mips-softmmu/common.mak (renamed from default-configs/devices/mips-softmmu-common.mak)0
-rw-r--r--configs/devices/mips-softmmu/default.mak (renamed from default-configs/devices/mips-softmmu.mak)2
-rw-r--r--configs/devices/mips64-softmmu/default.mak (renamed from default-configs/devices/mips64-softmmu.mak)2
-rw-r--r--configs/devices/mips64el-softmmu/default.mak (renamed from default-configs/devices/mips64el-softmmu.mak)2
-rw-r--r--configs/devices/mipsel-softmmu/default.mak (renamed from default-configs/devices/mipsel-softmmu.mak)2
-rw-r--r--configs/devices/nios2-softmmu/default.mak (renamed from default-configs/devices/nios2-softmmu.mak)0
-rw-r--r--configs/devices/or1k-softmmu/default.mak (renamed from default-configs/devices/or1k-softmmu.mak)0
-rw-r--r--configs/devices/ppc-softmmu/default.mak (renamed from default-configs/devices/ppc-softmmu.mak)0
-rw-r--r--configs/devices/ppc64-softmmu/default.mak (renamed from default-configs/devices/ppc64-softmmu.mak)2
-rw-r--r--configs/devices/riscv32-softmmu/default.mak (renamed from default-configs/devices/riscv32-softmmu.mak)0
-rw-r--r--configs/devices/riscv64-softmmu/default.mak (renamed from default-configs/devices/riscv64-softmmu.mak)0
-rw-r--r--configs/devices/rx-softmmu/default.mak (renamed from default-configs/devices/rx-softmmu.mak)0
-rw-r--r--configs/devices/s390x-softmmu/default.mak (renamed from default-configs/devices/s390x-softmmu.mak)0
-rw-r--r--configs/devices/sh4-softmmu/default.mak (renamed from default-configs/devices/sh4-softmmu.mak)0
-rw-r--r--configs/devices/sh4eb-softmmu/default.mak (renamed from default-configs/devices/sh4eb-softmmu.mak)2
-rw-r--r--configs/devices/sparc-softmmu/default.mak (renamed from default-configs/devices/sparc-softmmu.mak)0
-rw-r--r--configs/devices/sparc64-softmmu/default.mak (renamed from default-configs/devices/sparc64-softmmu.mak)0
-rw-r--r--configs/devices/tricore-softmmu/default.mak (renamed from default-configs/devices/tricore-softmmu.mak)0
-rw-r--r--configs/devices/x86_64-softmmu/default.mak (renamed from default-configs/devices/x86_64-softmmu.mak)2
-rw-r--r--configs/devices/xtensa-softmmu/default.mak (renamed from default-configs/devices/xtensa-softmmu.mak)0
-rw-r--r--configs/devices/xtensaeb-softmmu/default.mak3
-rw-r--r--configs/targets/aarch64-linux-user.mak (renamed from default-configs/targets/aarch64-linux-user.mak)0
-rw-r--r--configs/targets/aarch64-softmmu.mak (renamed from default-configs/targets/aarch64-softmmu.mak)0
-rw-r--r--configs/targets/aarch64_be-linux-user.mak (renamed from default-configs/targets/aarch64_be-linux-user.mak)0
-rw-r--r--configs/targets/alpha-linux-user.mak (renamed from default-configs/targets/alpha-linux-user.mak)0
-rw-r--r--configs/targets/alpha-softmmu.mak (renamed from default-configs/targets/alpha-softmmu.mak)0
-rw-r--r--configs/targets/arm-linux-user.mak (renamed from default-configs/targets/arm-linux-user.mak)0
-rw-r--r--configs/targets/arm-softmmu.mak (renamed from default-configs/targets/arm-softmmu.mak)0
-rw-r--r--configs/targets/armeb-linux-user.mak (renamed from default-configs/targets/armeb-linux-user.mak)0
-rw-r--r--configs/targets/avr-softmmu.mak (renamed from default-configs/targets/avr-softmmu.mak)0
-rw-r--r--configs/targets/cris-linux-user.mak (renamed from default-configs/targets/cris-linux-user.mak)0
-rw-r--r--configs/targets/cris-softmmu.mak (renamed from default-configs/targets/cris-softmmu.mak)0
-rw-r--r--configs/targets/hexagon-linux-user.mak (renamed from default-configs/targets/hexagon-linux-user.mak)0
-rw-r--r--configs/targets/hppa-linux-user.mak (renamed from default-configs/targets/hppa-linux-user.mak)0
-rw-r--r--configs/targets/hppa-softmmu.mak (renamed from default-configs/targets/hppa-softmmu.mak)0
-rw-r--r--configs/targets/i386-bsd-user.mak (renamed from default-configs/targets/i386-bsd-user.mak)0
-rw-r--r--configs/targets/i386-linux-user.mak (renamed from default-configs/targets/i386-linux-user.mak)0
-rw-r--r--configs/targets/i386-softmmu.mak (renamed from default-configs/targets/i386-softmmu.mak)0
-rw-r--r--configs/targets/m68k-linux-user.mak (renamed from default-configs/targets/m68k-linux-user.mak)0
-rw-r--r--configs/targets/m68k-softmmu.mak (renamed from default-configs/targets/m68k-softmmu.mak)0
-rw-r--r--configs/targets/microblaze-linux-user.mak (renamed from default-configs/targets/microblaze-linux-user.mak)0
-rw-r--r--configs/targets/microblaze-softmmu.mak (renamed from default-configs/targets/microblaze-softmmu.mak)0
-rw-r--r--configs/targets/microblazeel-linux-user.mak (renamed from default-configs/targets/microblazeel-linux-user.mak)0
-rw-r--r--configs/targets/microblazeel-softmmu.mak (renamed from default-configs/targets/microblazeel-softmmu.mak)0
-rw-r--r--configs/targets/mips-linux-user.mak (renamed from default-configs/targets/mips-linux-user.mak)0
-rw-r--r--configs/targets/mips-softmmu.mak (renamed from default-configs/targets/mips-softmmu.mak)0
-rw-r--r--configs/targets/mips64-linux-user.mak (renamed from default-configs/targets/mips64-linux-user.mak)0
-rw-r--r--configs/targets/mips64-softmmu.mak (renamed from default-configs/targets/mips64-softmmu.mak)0
-rw-r--r--configs/targets/mips64el-linux-user.mak (renamed from default-configs/targets/mips64el-linux-user.mak)0
-rw-r--r--configs/targets/mips64el-softmmu.mak (renamed from default-configs/targets/mips64el-softmmu.mak)0
-rw-r--r--configs/targets/mipsel-linux-user.mak (renamed from default-configs/targets/mipsel-linux-user.mak)0
-rw-r--r--configs/targets/mipsel-softmmu.mak (renamed from default-configs/targets/mipsel-softmmu.mak)0
-rw-r--r--configs/targets/mipsn32-linux-user.mak (renamed from default-configs/targets/mipsn32-linux-user.mak)0
-rw-r--r--configs/targets/mipsn32el-linux-user.mak (renamed from default-configs/targets/mipsn32el-linux-user.mak)0
-rw-r--r--configs/targets/nios2-linux-user.mak (renamed from default-configs/targets/nios2-linux-user.mak)0
-rw-r--r--configs/targets/nios2-softmmu.mak (renamed from default-configs/targets/nios2-softmmu.mak)0
-rw-r--r--configs/targets/or1k-linux-user.mak (renamed from default-configs/targets/or1k-linux-user.mak)0
-rw-r--r--configs/targets/or1k-softmmu.mak (renamed from default-configs/targets/or1k-softmmu.mak)0
-rw-r--r--configs/targets/ppc-linux-user.mak (renamed from default-configs/targets/ppc-linux-user.mak)0
-rw-r--r--configs/targets/ppc-softmmu.mak (renamed from default-configs/targets/ppc-softmmu.mak)0
-rw-r--r--configs/targets/ppc64-linux-user.mak (renamed from default-configs/targets/ppc64-linux-user.mak)0
-rw-r--r--configs/targets/ppc64-softmmu.mak (renamed from default-configs/targets/ppc64-softmmu.mak)0
-rw-r--r--configs/targets/ppc64abi32-linux-user.mak (renamed from default-configs/targets/ppc64abi32-linux-user.mak)0
-rw-r--r--configs/targets/ppc64le-linux-user.mak (renamed from default-configs/targets/ppc64le-linux-user.mak)0
-rw-r--r--configs/targets/riscv32-linux-user.mak (renamed from default-configs/targets/riscv32-linux-user.mak)0
-rw-r--r--configs/targets/riscv32-softmmu.mak (renamed from default-configs/targets/riscv32-softmmu.mak)0
-rw-r--r--configs/targets/riscv64-linux-user.mak (renamed from default-configs/targets/riscv64-linux-user.mak)0
-rw-r--r--configs/targets/riscv64-softmmu.mak (renamed from default-configs/targets/riscv64-softmmu.mak)0
-rw-r--r--configs/targets/rx-softmmu.mak (renamed from default-configs/targets/rx-softmmu.mak)0
-rw-r--r--configs/targets/s390x-linux-user.mak (renamed from default-configs/targets/s390x-linux-user.mak)0
-rw-r--r--configs/targets/s390x-softmmu.mak (renamed from default-configs/targets/s390x-softmmu.mak)0
-rw-r--r--configs/targets/sh4-linux-user.mak (renamed from default-configs/targets/sh4-linux-user.mak)0
-rw-r--r--configs/targets/sh4-softmmu.mak (renamed from default-configs/targets/sh4-softmmu.mak)0
-rw-r--r--configs/targets/sh4eb-linux-user.mak (renamed from default-configs/targets/sh4eb-linux-user.mak)0
-rw-r--r--configs/targets/sh4eb-softmmu.mak (renamed from default-configs/targets/sh4eb-softmmu.mak)0
-rw-r--r--configs/targets/sparc-linux-user.mak (renamed from default-configs/targets/sparc-linux-user.mak)0
-rw-r--r--configs/targets/sparc-softmmu.mak (renamed from default-configs/targets/sparc-softmmu.mak)0
-rw-r--r--configs/targets/sparc32plus-linux-user.mak (renamed from default-configs/targets/sparc32plus-linux-user.mak)0
-rw-r--r--configs/targets/sparc64-linux-user.mak (renamed from default-configs/targets/sparc64-linux-user.mak)0
-rw-r--r--configs/targets/sparc64-softmmu.mak (renamed from default-configs/targets/sparc64-softmmu.mak)0
-rw-r--r--configs/targets/tricore-softmmu.mak (renamed from default-configs/targets/tricore-softmmu.mak)0
-rw-r--r--configs/targets/x86_64-bsd-user.mak (renamed from default-configs/targets/x86_64-bsd-user.mak)0
-rw-r--r--configs/targets/x86_64-linux-user.mak (renamed from default-configs/targets/x86_64-linux-user.mak)0
-rw-r--r--configs/targets/x86_64-softmmu.mak (renamed from default-configs/targets/x86_64-softmmu.mak)0
-rw-r--r--configs/targets/xtensa-linux-user.mak (renamed from default-configs/targets/xtensa-linux-user.mak)0
-rw-r--r--configs/targets/xtensa-softmmu.mak (renamed from default-configs/targets/xtensa-softmmu.mak)0
-rw-r--r--configs/targets/xtensaeb-linux-user.mak (renamed from default-configs/targets/xtensaeb-linux-user.mak)0
-rw-r--r--configs/targets/xtensaeb-softmmu.mak (renamed from default-configs/targets/xtensaeb-softmmu.mak)0
-rwxr-xr-xconfigure44
-rw-r--r--contrib/vhost-user-gpu/meson.build2
-rw-r--r--default-configs/devices/xtensaeb-softmmu.mak3
-rw-r--r--docs/devel/build-system.rst17
-rw-r--r--docs/devel/index.rst1
-rw-r--r--docs/devel/modules.rst5
-rw-r--r--docs/devel/qom.rst8
-rw-r--r--hmp-commands-info.hx3
-rw-r--r--hw/arm/Kconfig4
-rw-r--r--hw/display/qxl.c4
-rw-r--r--hw/display/vhost-user-gpu-pci.c1
-rw-r--r--hw/display/vhost-user-gpu.c1
-rw-r--r--hw/display/vhost-user-vga.c1
-rw-r--r--hw/display/virtio-gpu-base.c1
-rw-r--r--hw/display/virtio-gpu-gl.c3
-rw-r--r--hw/display/virtio-gpu-pci-gl.c3
-rw-r--r--hw/display/virtio-gpu-pci.c2
-rw-r--r--hw/display/virtio-gpu.c1
-rw-r--r--hw/display/virtio-vga-gl.c3
-rw-r--r--hw/display/virtio-vga.c2
-rw-r--r--hw/ppc/spapr.c2
-rw-r--r--hw/s390x/virtio-ccw-gpu.c3
-rw-r--r--hw/usb/ccid-card-emulated.c1
-rw-r--r--hw/usb/ccid-card-passthru.c1
-rw-r--r--hw/usb/dev-storage-bot.c1
-rw-r--r--hw/usb/dev-storage-classic.c1
-rw-r--r--hw/usb/dev-uas.c1
-rw-r--r--hw/usb/host-libusb.c38
-rw-r--r--hw/usb/host-stub.c45
-rw-r--r--hw/usb/meson.build10
-rw-r--r--hw/usb/redirect.c1
-rw-r--r--include/hw/usb.h7
-rw-r--r--include/monitor/monitor.h3
-rw-r--r--include/qemu/module.h79
-rw-r--r--include/qemu/osdep.h2
-rw-r--r--meson.build142
-rw-r--r--monitor/hmp.c7
-rw-r--r--monitor/misc.c34
-rwxr-xr-xscripts/entitlement.sh10
-rwxr-xr-xscripts/modinfo-collect.py67
-rwxr-xr-xscripts/modinfo-generate.py97
-rw-r--r--softmmu/vl.c37
-rw-r--r--stubs/module-opts.c4
-rw-r--r--target/Kconfig19
-rw-r--r--target/alpha/Kconfig2
-rw-r--r--target/arm/Kconfig6
-rw-r--r--target/avr/Kconfig2
-rw-r--r--target/cris/Kconfig2
-rw-r--r--target/hppa/Kconfig2
-rw-r--r--target/i386/Kconfig5
-rw-r--r--target/i386/cpu.h2
-rw-r--r--target/i386/helper.h3
-rw-r--r--target/i386/svm.h3
-rw-r--r--target/i386/tcg/bpt_helper.c21
-rw-r--r--target/i386/tcg/sysemu/bpt_helper.c47
-rw-r--r--target/i386/tcg/sysemu/svm_helper.c24
-rw-r--r--target/i386/tcg/translate.c1
-rw-r--r--target/m68k/Kconfig2
-rw-r--r--target/microblaze/Kconfig2
-rw-r--r--target/mips/Kconfig6
-rw-r--r--target/nios2/Kconfig2
-rw-r--r--target/openrisc/Kconfig2
-rw-r--r--target/ppc/Kconfig5
-rw-r--r--target/riscv/Kconfig5
-rw-r--r--target/rx/Kconfig2
-rw-r--r--target/s390x/Kconfig2
-rw-r--r--target/sh4/Kconfig2
-rw-r--r--target/sparc/Kconfig5
-rw-r--r--target/tricore/Kconfig2
-rw-r--r--target/xtensa/Kconfig2
-rw-r--r--tests/Makefile.include2
-rw-r--r--ui/egl-headless.c4
-rw-r--r--ui/gtk.c4
-rw-r--r--ui/sdl2.c4
-rw-r--r--ui/spice-app.c3
-rw-r--r--ui/spice-core.c5
-rw-r--r--util/meson.build2
-rw-r--r--util/module.c200
-rw-r--r--util/trace-events4
193 files changed, 885 insertions, 340 deletions
diff --git a/Kconfig b/Kconfig
index d52ebd839b..fb6a24a2de 100644
--- a/Kconfig
+++ b/Kconfig
@@ -1,5 +1,6 @@
source Kconfig.host
source backends/Kconfig
source accel/Kconfig
+source target/Kconfig
source hw/Kconfig
source semihosting/Kconfig
diff --git a/MAINTAINERS b/MAINTAINERS
index 40d095dbbd..3026b979b7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -87,7 +87,7 @@ S390 general architecture support
M: Cornelia Huck <cohuck@redhat.com>
M: Thomas Huth <thuth@redhat.com>
S: Supported
-F: default-configs/*/s390x-softmmu.mak
+F: configs/devices/s390x-softmmu/default.mak
F: gdb-xml/s390*.xml
F: hw/char/sclp*.[hc]
F: hw/char/terminal3270.c
@@ -196,7 +196,7 @@ F: target/hexagon/
F: linux-user/hexagon/
F: tests/tcg/hexagon/
F: disas/hexagon.c
-F: default-configs/targets/hexagon-linux-user.mak
+F: configs/targets/hexagon-linux-user/default.mak
F: docker/dockerfiles/debian-hexagon-cross.docker
F: docker/dockerfiles/debian-hexagon-cross.docker.d/build-toolchain.sh
@@ -229,7 +229,7 @@ R: Jiaxun Yang <jiaxun.yang@flygoat.com>
R: Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>
S: Odd Fixes
F: target/mips/
-F: default-configs/*/*mips*
+F: configs/devices/mips*/*
F: disas/mips.c
F: docs/system/cpu-models-mips.rst.inc
F: hw/intc/mips_gic.c
@@ -255,7 +255,7 @@ S: Maintained
F: target/nios2/
F: hw/nios2/
F: disas/nios2.c
-F: default-configs/*/nios2-softmmu.mak
+F: configs/devices/nios2-softmmu/default.mak
OpenRISC TCG CPUs
M: Stafford Horne <shorne@gmail.com>
@@ -342,7 +342,7 @@ F: hw/xtensa/
F: tests/tcg/xtensa/
F: disas/xtensa.c
F: include/hw/xtensa/xtensa-isa.h
-F: default-configs/*/xtensa*.mak
+F: configs/devices/xtensa*/default.mak
TriCore TCG CPUs
M: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
@@ -1057,7 +1057,7 @@ AVR Machines
AVR MCUs
M: Michael Rolnik <mrolnik@gmail.com>
S: Maintained
-F: default-configs/*/avr-softmmu.mak
+F: configs/devices/avr-softmmu/default.mak
F: hw/avr/
F: include/hw/char/avr_usart.h
F: hw/char/avr_usart.c
@@ -1085,7 +1085,7 @@ HP B160L
M: Richard Henderson <richard.henderson@linaro.org>
R: Helge Deller <deller@gmx.de>
S: Odd Fixes
-F: default-configs/*/hppa-softmmu.mak
+F: configs/devices/hppa-softmmu/default.mak
F: hw/hppa/
F: pc-bios/hppa-firmware.img
@@ -1524,7 +1524,7 @@ F: hw/s390x/
F: include/hw/s390x/
F: hw/watchdog/wdt_diag288.c
F: include/hw/watchdog/wdt_diag288.h
-F: default-configs/*/s390x-softmmu.mak
+F: configs/devices/s390x-softmmu/default.mak
F: tests/acceptance/machine_s390_ccw_virtio.py
T: git https://gitlab.com/cohuck/qemu.git s390-next
T: git https://github.com/borntraeger/qemu.git s390-next
@@ -1731,7 +1731,6 @@ F: hw/pci-bridge/*
F: qapi/pci.json
F: docs/pci*
F: docs/specs/*pci*
-F: default-configs/pci.mak
ACPI/SMBIOS
M: Michael S. Tsirkin <mst@redhat.com>
@@ -1836,7 +1835,6 @@ F: docs/usb2.txt
F: docs/usb-storage.txt
F: include/hw/usb.h
F: include/hw/usb/
-F: default-configs/usb.mak
USB (serial adapter)
M: Gerd Hoffmann <kraxel@redhat.com>
@@ -2995,14 +2993,14 @@ M: Warner Losh <imp@bsdimp.com>
R: Kyle Evans <kevans@freebsd.org>
S: Maintained
F: bsd-user/
-F: default-configs/targets/*-bsd-user.mak
+F: configs/targets/*-bsd-user.mak
T: git https://github.com/qemu-bsd-user/qemu-bsd-user bsd-user-rebase-3.1
Linux user
M: Laurent Vivier <laurent@vivier.eu>
S: Maintained
F: linux-user/
-F: default-configs/targets/*linux-user.mak
+F: configs/targets/*linux-user.mak
F: scripts/qemu-binfmt-conf.sh
F: scripts/update-syscalltbl.sh
F: scripts/update-mips-syscall-args.sh
diff --git a/accel/accel-common.c b/accel/accel-common.c
index cf07f78421..7b8ec7e0f7 100644
--- a/accel/accel-common.c
+++ b/accel/accel-common.c
@@ -44,7 +44,7 @@ static const TypeInfo accel_type = {
AccelClass *accel_find(const char *opt_name)
{
char *class_name = g_strdup_printf(ACCEL_CLASS_NAME("%s"), opt_name);
- AccelClass *ac = ACCEL_CLASS(object_class_by_name(class_name));
+ AccelClass *ac = ACCEL_CLASS(module_object_class_by_name(class_name));
g_free(class_name);
return ac;
}
diff --git a/accel/accel-softmmu.c b/accel/accel-softmmu.c
index 50fa5acaa4..67276e4f52 100644
--- a/accel/accel-softmmu.c
+++ b/accel/accel-softmmu.c
@@ -72,7 +72,7 @@ void accel_init_ops_interfaces(AccelClass *ac)
g_assert(ac_name != NULL);
ops_name = g_strdup_printf("%s" ACCEL_OPS_SUFFIX, ac_name);
- ops = ACCEL_OPS_CLASS(object_class_by_name(ops_name));
+ ops = ACCEL_OPS_CLASS(module_object_class_by_name(ops_name));
g_free(ops_name);
/*
diff --git a/accel/qtest/meson.build b/accel/qtest/meson.build
index a2f3276459..4c65600293 100644
--- a/accel/qtest/meson.build
+++ b/accel/qtest/meson.build
@@ -1,6 +1,2 @@
-qtest_ss = ss.source_set()
-qtest_ss.add(files(
- 'qtest.c',
-))
-
-specific_ss.add_all(when: ['CONFIG_SOFTMMU', 'CONFIG_POSIX'], if_true: qtest_ss)
+qtest_module_ss.add(when: ['CONFIG_SOFTMMU', 'CONFIG_POSIX'],
+ if_true: files('qtest.c'))
diff --git a/accel/qtest/qtest.c b/accel/qtest/qtest.c
index edb29f6fa4..7e6b8110d5 100644
--- a/accel/qtest/qtest.c
+++ b/accel/qtest/qtest.c
@@ -45,6 +45,7 @@ static const TypeInfo qtest_accel_type = {
.parent = TYPE_ACCEL,
.class_init = qtest_accel_class_init,
};
+module_obj(TYPE_QTEST_ACCEL);
static void qtest_accel_ops_class_init(ObjectClass *oc, void *data)
{
@@ -61,6 +62,7 @@ static const TypeInfo qtest_accel_ops_type = {
.class_init = qtest_accel_ops_class_init,
.abstract = true,
};
+module_obj(ACCEL_OPS_NAME("qtest"));
static void qtest_type_init(void)
{
diff --git a/accel/tcg/hmp.c b/accel/tcg/hmp.c
new file mode 100644
index 0000000000..a6e72fdb3e
--- /dev/null
+++ b/accel/tcg/hmp.c
@@ -0,0 +1,29 @@
+#include "qemu/osdep.h"
+#include "qemu/error-report.h"
+#include "exec/exec-all.h"
+#include "monitor/monitor.h"
+#include "sysemu/tcg.h"
+
+static void hmp_info_jit(Monitor *mon, const QDict *qdict)
+{
+ if (!tcg_enabled()) {
+ error_report("JIT information is only available with accel=tcg");
+ return;
+ }
+
+ dump_exec_info();
+ dump_drift_info();
+}
+
+static void hmp_info_opcount(Monitor *mon, const QDict *qdict)
+{
+ dump_opcount_info();
+}
+
+static void hmp_tcg_register(void)
+{
+ monitor_register_hmp("jit", true, hmp_info_jit);
+ monitor_register_hmp("opcount", true, hmp_info_opcount);
+}
+
+type_init(hmp_tcg_register);
diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build
index 1236ac7b91..137a1a44cc 100644
--- a/accel/tcg/meson.build
+++ b/accel/tcg/meson.build
@@ -15,8 +15,12 @@ specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_ss)
specific_ss.add(when: ['CONFIG_SOFTMMU', 'CONFIG_TCG'], if_true: files(
'cputlb.c',
+ 'hmp.c',
+))
+
+tcg_module_ss.add(when: ['CONFIG_SOFTMMU', 'CONFIG_TCG'], if_true: files(
'tcg-accel-ops.c',
'tcg-accel-ops-mttcg.c',
'tcg-accel-ops-icount.c',
- 'tcg-accel-ops-rr.c'
+ 'tcg-accel-ops-rr.c',
))
diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c
index 7191315aee..1a8e8390bd 100644
--- a/accel/tcg/tcg-accel-ops.c
+++ b/accel/tcg/tcg-accel-ops.c
@@ -124,6 +124,7 @@ static const TypeInfo tcg_accel_ops_type = {
.class_init = tcg_accel_ops_class_init,
.abstract = true,
};
+module_obj(ACCEL_OPS_NAME("tcg"));
static void tcg_accel_ops_register_types(void)
{
diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c
index 00803f76d8..d6336a9c96 100644
--- a/accel/tcg/tcg-all.c
+++ b/accel/tcg/tcg-all.c
@@ -238,6 +238,7 @@ static const TypeInfo tcg_accel_type = {
.class_init = tcg_accel_class_init,
.instance_size = sizeof(TCGState),
};
+module_obj(TYPE_TCG_ACCEL);
static void register_accel_types(void)
{
diff --git a/audio/spiceaudio.c b/audio/spiceaudio.c
index 999bfbde47..a8d370fe6f 100644
--- a/audio/spiceaudio.c
+++ b/audio/spiceaudio.c
@@ -317,3 +317,5 @@ static void register_audio_spice(void)
audio_driver_register(&spice_audio_driver);
}
type_init(register_audio_spice);
+
+module_dep("ui-spice-core");
diff --git a/block/iscsi-opts.c b/block/iscsi-opts.c
index afaf8837d6..4f2da405e6 100644
--- a/block/iscsi-opts.c
+++ b/block/iscsi-opts.c
@@ -68,3 +68,4 @@ static void iscsi_block_opts_init(void)
}
block_init(iscsi_block_opts_init);
+module_opts("iscsi");
diff --git a/block/meson.build b/block/meson.build
index ef1ba3d973..0450914c7a 100644
--- a/block/meson.build
+++ b/block/meson.build
@@ -66,7 +66,7 @@ block_ss.add(when: libiscsi, if_true: files('iscsi-opts.c'))
block_ss.add(when: 'CONFIG_LINUX', if_true: files('nvme.c'))
block_ss.add(when: 'CONFIG_REPLICATION', if_true: files('replication.c'))
block_ss.add(when: ['CONFIG_LINUX_AIO', libaio], if_true: files('linux-aio.c'))
-block_ss.add(when: ['CONFIG_LINUX_IO_URING', linux_io_uring], if_true: files('io_uring.c'))
+block_ss.add(when: linux_io_uring, if_true: files('io_uring.c'))
block_modules = {}
diff --git a/chardev/baum.c b/chardev/baum.c
index 5deca778bc..79d618e350 100644
--- a/chardev/baum.c
+++ b/chardev/baum.c
@@ -680,6 +680,7 @@ static const TypeInfo char_braille_type_info = {
.instance_finalize = char_braille_finalize,
.class_init = char_braille_class_init,
};
+module_obj(TYPE_CHARDEV_BRAILLE);
static void register_types(void)
{
diff --git a/chardev/spice.c b/chardev/spice.c
index 1104426e3a..3ffb3fdc0d 100644
--- a/chardev/spice.c
+++ b/chardev/spice.c
@@ -366,6 +366,7 @@ static const TypeInfo char_spice_type_info = {
.class_init = char_spice_class_init,
.abstract = true,
};
+module_obj(TYPE_CHARDEV_SPICE);
static void char_spicevmc_class_init(ObjectClass *oc, void *data)
{
@@ -396,6 +397,7 @@ static const TypeInfo char_spiceport_type_info = {
.parent = TYPE_CHARDEV_SPICE,
.class_init = char_spiceport_class_init,
};
+module_obj(TYPE_CHARDEV_SPICEPORT);
static void register_types(void)
{
@@ -405,3 +407,5 @@ static void register_types(void)
}
type_init(register_types);
+
+module_dep("ui-spice-core");
diff --git a/default-configs/devices/aarch64-softmmu.mak b/configs/devices/aarch64-softmmu/default.mak
index 958b1e08e4..cf43ac8da1 100644
--- a/default-configs/devices/aarch64-softmmu.mak
+++ b/configs/devices/aarch64-softmmu/default.mak
@@ -1,7 +1,7 @@
# Default configuration for aarch64-softmmu
# We support all the 32 bit boards so need all their config
-include arm-softmmu.mak
+include ../arm-softmmu/default.mak
CONFIG_XLNX_ZYNQMP_ARM=y
CONFIG_XLNX_VERSAL=y
diff --git a/configs/devices/aarch64-softmmu/minimal.mak b/configs/devices/aarch64-softmmu/minimal.mak
new file mode 100644
index 0000000000..0ebc1dca56
--- /dev/null
+++ b/configs/devices/aarch64-softmmu/minimal.mak
@@ -0,0 +1,9 @@
+#
+# A minimal version of the config that only supports only a few
+# virtual machines. This avoids bringing in any of numerous legacy
+# features from the 32bit platform (although virt still supports 32bit
+# itself)
+#
+
+CONFIG_ARM_VIRT=y
+CONFIG_SBSA_REF=y
diff --git a/default-configs/devices/alpha-softmmu.mak b/configs/devices/alpha-softmmu/default.mak
index d186fe8e9b..d186fe8e9b 100644
--- a/default-configs/devices/alpha-softmmu.mak
+++ b/configs/devices/alpha-softmmu/default.mak
diff --git a/default-configs/devices/arm-softmmu.mak b/configs/devices/arm-softmmu/default.mak
index cdc0e97f9d..6985a25377 100644
--- a/default-configs/devices/arm-softmmu.mak
+++ b/configs/devices/arm-softmmu/default.mak
@@ -1,8 +1,5 @@
# Default configuration for arm-softmmu
-# TODO: ARM_V7M is currently always required - make this more flexible!
-CONFIG_ARM_V7M=y
-
# CONFIG_PCI_DEVICES=n
# CONFIG_TEST_DEVICES=n
diff --git a/default-configs/devices/avr-softmmu.mak b/configs/devices/avr-softmmu/default.mak
index 80218add98..80218add98 100644
--- a/default-configs/devices/avr-softmmu.mak
+++ b/configs/devices/avr-softmmu/default.mak
diff --git a/default-configs/devices/cris-softmmu.mak b/configs/devices/cris-softmmu/default.mak
index 5932cf4d06..5932cf4d06 100644
--- a/default-configs/devices/cris-softmmu.mak
+++ b/configs/devices/cris-softmmu/default.mak
diff --git a/default-configs/devices/hppa-softmmu.mak b/configs/devices/hppa-softmmu/default.mak
index b64c5eb3ff..b64c5eb3ff 100644
--- a/default-configs/devices/hppa-softmmu.mak
+++ b/configs/devices/hppa-softmmu/default.mak
diff --git a/default-configs/devices/i386-softmmu.mak b/configs/devices/i386-softmmu/default.mak
index 84d1a2487c..84d1a2487c 100644
--- a/default-configs/devices/i386-softmmu.mak
+++ b/configs/devices/i386-softmmu/default.mak
diff --git a/default-configs/devices/m68k-softmmu.mak b/configs/devices/m68k-softmmu/default.mak
index 7f8619e427..7f8619e427 100644
--- a/default-configs/devices/m68k-softmmu.mak
+++ b/configs/devices/m68k-softmmu/default.mak
diff --git a/default-configs/devices/microblaze-softmmu.mak b/configs/devices/microblaze-softmmu/default.mak
index db8c6e4bba..db8c6e4bba 100644
--- a/default-configs/devices/microblaze-softmmu.mak
+++ b/configs/devices/microblaze-softmmu/default.mak
diff --git a/default-configs/devices/microblazeel-softmmu.mak b/configs/devices/microblazeel-softmmu/default.mak
index 2fcf442fc7..29f7f13816 100644
--- a/default-configs/devices/microblazeel-softmmu.mak
+++ b/configs/devices/microblazeel-softmmu/default.mak
@@ -1,3 +1,3 @@
# Default configuration for microblazeel-softmmu
-include microblaze-softmmu.mak
+include ../microblaze-softmmu/default.mak
diff --git a/default-configs/devices/mips-softmmu-common.mak b/configs/devices/mips-softmmu/common.mak
index ea78fe7275..ea78fe7275 100644
--- a/default-configs/devices/mips-softmmu-common.mak
+++ b/configs/devices/mips-softmmu/common.mak
diff --git a/default-configs/devices/mips-softmmu.mak b/configs/devices/mips-softmmu/default.mak
index 9fede6e00f..c23d95a83a 100644
--- a/default-configs/devices/mips-softmmu.mak
+++ b/configs/devices/mips-softmmu/default.mak
@@ -1,3 +1,3 @@
# Default configuration for mips-softmmu
-include mips-softmmu-common.mak
+include common.mak
diff --git a/default-configs/devices/mips64-softmmu.mak b/configs/devices/mips64-softmmu/default.mak
index a169738635..566672f3c2 100644
--- a/default-configs/devices/mips64-softmmu.mak
+++ b/configs/devices/mips64-softmmu/default.mak
@@ -1,4 +1,4 @@
# Default configuration for mips64-softmmu
-include mips-softmmu-common.mak
+include ../mips-softmmu/common.mak
CONFIG_JAZZ=y
diff --git a/default-configs/devices/mips64el-softmmu.mak b/configs/devices/mips64el-softmmu/default.mak
index 26c660a05c..c511a061ba 100644
--- a/default-configs/devices/mips64el-softmmu.mak
+++ b/configs/devices/mips64el-softmmu/default.mak
@@ -1,6 +1,6 @@
# Default configuration for mips64el-softmmu
-include mips-softmmu-common.mak
+include ../mips-softmmu/common.mak
CONFIG_IDE_VIA=y
CONFIG_FULOONG=y
CONFIG_LOONGSON3V=y
diff --git a/default-configs/devices/mipsel-softmmu.mak b/configs/devices/mipsel-softmmu/default.mak
index a7f6059484..009ccb0e2d 100644
--- a/default-configs/devices/mipsel-softmmu.mak
+++ b/configs/devices/mipsel-softmmu/default.mak
@@ -1,3 +1,3 @@
# Default configuration for mipsel-softmmu
-include mips-softmmu-common.mak
+include ../mips-softmmu/common.mak
diff --git a/default-configs/devices/nios2-softmmu.mak b/configs/devices/nios2-softmmu/default.mak
index 1bc4082ea9..1bc4082ea9 100644
--- a/default-configs/devices/nios2-softmmu.mak
+++ b/configs/devices/nios2-softmmu/default.mak
diff --git a/default-configs/devices/or1k-softmmu.mak b/configs/devices/or1k-softmmu/default.mak
index 168101c39a..168101c39a 100644
--- a/default-configs/devices/or1k-softmmu.mak
+++ b/configs/devices/or1k-softmmu/default.mak
diff --git a/default-configs/devices/ppc-softmmu.mak b/configs/devices/ppc-softmmu/default.mak
index 4535993d8d..4535993d8d 100644
--- a/default-configs/devices/ppc-softmmu.mak
+++ b/configs/devices/ppc-softmmu/default.mak
diff --git a/default-configs/devices/ppc64-softmmu.mak b/configs/devices/ppc64-softmmu/default.mak
index cca52665d9..b90e5bf455 100644
--- a/default-configs/devices/ppc64-softmmu.mak
+++ b/configs/devices/ppc64-softmmu/default.mak
@@ -1,7 +1,7 @@
# Default configuration for ppc64-softmmu
# Include all 32-bit boards
-include ppc-softmmu.mak
+include ../ppc-softmmu/default.mak
# For PowerNV
CONFIG_POWERNV=y
diff --git a/default-configs/devices/riscv32-softmmu.mak b/configs/devices/riscv32-softmmu/default.mak
index d847bd5692..d847bd5692 100644
--- a/default-configs/devices/riscv32-softmmu.mak
+++ b/configs/devices/riscv32-softmmu/default.mak
diff --git a/default-configs/devices/riscv64-softmmu.mak b/configs/devices/riscv64-softmmu/default.mak
index bc69301fa4..bc69301fa4 100644
--- a/default-configs/devices/riscv64-softmmu.mak
+++ b/configs/devices/riscv64-softmmu/default.mak
diff --git a/default-configs/devices/rx-softmmu.mak b/configs/devices/rx-softmmu/default.mak
index df2b4e4f42..df2b4e4f42 100644
--- a/default-configs/devices/rx-softmmu.mak
+++ b/configs/devices/rx-softmmu/default.mak
diff --git a/default-configs/devices/s390x-softmmu.mak b/configs/devices/s390x-softmmu/default.mak
index f2287a133f..f2287a133f 100644
--- a/default-configs/devices/s390x-softmmu.mak
+++ b/configs/devices/s390x-softmmu/default.mak
diff --git a/default-configs/devices/sh4-softmmu.mak b/configs/devices/sh4-softmmu/default.mak
index 565e8b0b5d..565e8b0b5d 100644
--- a/default-configs/devices/sh4-softmmu.mak
+++ b/configs/devices/sh4-softmmu/default.mak
diff --git a/default-configs/devices/sh4eb-softmmu.mak b/configs/devices/sh4eb-softmmu/default.mak
index 522a7a50fa..f18d1f6519 100644
--- a/default-configs/devices/sh4eb-softmmu.mak
+++ b/configs/devices/sh4eb-softmmu/default.mak
@@ -1,3 +1,3 @@
# Default configuration for sh4eb-softmmu
-include sh4-softmmu.mak
+include ../sh4-softmmu/default.mak
diff --git a/default-configs/devices/sparc-softmmu.mak b/configs/devices/sparc-softmmu/default.mak
index ee85218115..ee85218115 100644
--- a/default-configs/devices/sparc-softmmu.mak
+++ b/configs/devices/sparc-softmmu/default.mak
diff --git a/default-configs/devices/sparc64-softmmu.mak b/configs/devices/sparc64-softmmu/default.mak
index e50030a229..e50030a229 100644
--- a/default-configs/devices/sparc64-softmmu.mak
+++ b/configs/devices/sparc64-softmmu/default.mak
diff --git a/default-configs/devices/tricore-softmmu.mak b/configs/devices/tricore-softmmu/default.mak
index 5cc91cebce..5cc91cebce 100644
--- a/default-configs/devices/tricore-softmmu.mak
+++ b/configs/devices/tricore-softmmu/default.mak
diff --git a/default-configs/devices/x86_64-softmmu.mak b/configs/devices/x86_64-softmmu/default.mak
index 64b2ee2960..ddfc2ea626 100644
--- a/default-configs/devices/x86_64-softmmu.mak
+++ b/configs/devices/x86_64-softmmu/default.mak
@@ -1,3 +1,3 @@
# Default configuration for x86_64-softmmu
-include i386-softmmu.mak
+include ../i386-softmmu/default.mak
diff --git a/default-configs/devices/xtensa-softmmu.mak b/configs/devices/xtensa-softmmu/default.mak
index 4fe1bf00c9..4fe1bf00c9 100644
--- a/default-configs/devices/xtensa-softmmu.mak
+++ b/configs/devices/xtensa-softmmu/default.mak
diff --git a/configs/devices/xtensaeb-softmmu/default.mak b/configs/devices/xtensaeb-softmmu/default.mak
new file mode 100644
index 0000000000..00eafcc292
--- /dev/null
+++ b/configs/devices/xtensaeb-softmmu/default.mak
@@ -0,0 +1,3 @@
+# Default configuration for Xtensa
+
+include ../xtensa-softmmu/default.mak
diff --git a/default-configs/targets/aarch64-linux-user.mak b/configs/targets/aarch64-linux-user.mak
index 4713253709..4713253709 100644
--- a/default-configs/targets/aarch64-linux-user.mak
+++ b/configs/targets/aarch64-linux-user.mak
diff --git a/default-configs/targets/aarch64-softmmu.mak b/configs/targets/aarch64-softmmu.mak
index 7703127674..7703127674 100644
--- a/default-configs/targets/aarch64-softmmu.mak
+++ b/configs/targets/aarch64-softmmu.mak
diff --git a/default-configs/targets/aarch64_be-linux-user.mak b/configs/targets/aarch64_be-linux-user.mak
index fae831558d..fae831558d 100644
--- a/default-configs/targets/aarch64_be-linux-user.mak
+++ b/configs/targets/aarch64_be-linux-user.mak
diff --git a/default-configs/targets/alpha-linux-user.mak b/configs/targets/alpha-linux-user.mak
index 7e62fd796a..7e62fd796a 100644
--- a/default-configs/targets/alpha-linux-user.mak
+++ b/configs/targets/alpha-linux-user.mak
diff --git a/default-configs/targets/alpha-softmmu.mak b/configs/targets/alpha-softmmu.mak
index e4b874a19e..e4b874a19e 100644
--- a/default-configs/targets/alpha-softmmu.mak
+++ b/configs/targets/alpha-softmmu.mak
diff --git a/default-configs/targets/arm-linux-user.mak b/configs/targets/arm-linux-user.mak
index e741ffd4d3..e741ffd4d3 100644
--- a/default-configs/targets/arm-linux-user.mak
+++ b/configs/targets/arm-linux-user.mak
diff --git a/default-configs/targets/arm-softmmu.mak b/configs/targets/arm-softmmu.mak
index 84a98f4818..84a98f4818 100644
--- a/default-configs/targets/arm-softmmu.mak
+++ b/configs/targets/arm-softmmu.mak
diff --git a/default-configs/targets/armeb-linux-user.mak b/configs/targets/armeb-linux-user.mak
index 255e44e8b0..255e44e8b0 100644
--- a/default-configs/targets/armeb-linux-user.mak
+++ b/configs/targets/armeb-linux-user.mak
diff --git a/default-configs/targets/avr-softmmu.mak b/configs/targets/avr-softmmu.mak
index e3f921c019..e3f921c019 100644
--- a/default-configs/targets/avr-softmmu.mak
+++ b/configs/targets/avr-softmmu.mak
diff --git a/default-configs/targets/cris-linux-user.mak b/configs/targets/cris-linux-user.mak
index e483c42066..e483c42066 100644
--- a/default-configs/targets/cris-linux-user.mak
+++ b/configs/targets/cris-linux-user.mak
diff --git a/default-configs/targets/cris-softmmu.mak b/configs/targets/cris-softmmu.mak
index e483c42066..e483c42066 100644
--- a/default-configs/targets/cris-softmmu.mak
+++ b/configs/targets/cris-softmmu.mak
diff --git a/default-configs/targets/hexagon-linux-user.mak b/configs/targets/hexagon-linux-user.mak
index 003ed0a408..003ed0a408 100644
--- a/default-configs/targets/hexagon-linux-user.mak
+++ b/configs/targets/hexagon-linux-user.mak
diff --git a/default-configs/targets/hppa-linux-user.mak b/configs/targets/hppa-linux-user.mak
index f01e0a7b9e..f01e0a7b9e 100644
--- a/default-configs/targets/hppa-linux-user.mak
+++ b/configs/targets/hppa-linux-user.mak
diff --git a/default-configs/targets/hppa-softmmu.mak b/configs/targets/hppa-softmmu.mak
index e3e71eb21b..e3e71eb21b 100644
--- a/default-configs/targets/hppa-softmmu.mak
+++ b/configs/targets/hppa-softmmu.mak
diff --git a/default-configs/targets/i386-bsd-user.mak b/configs/targets/i386-bsd-user.mak
index 0283bb62a0..0283bb62a0 100644
--- a/default-configs/targets/i386-bsd-user.mak
+++ b/configs/targets/i386-bsd-user.mak
diff --git a/default-configs/targets/i386-linux-user.mak b/configs/targets/i386-linux-user.mak
index 5b2546a430..5b2546a430 100644
--- a/default-configs/targets/i386-linux-user.mak
+++ b/configs/targets/i386-linux-user.mak
diff --git a/default-configs/targets/i386-softmmu.mak b/configs/targets/i386-softmmu.mak
index 5babf71895..5babf71895 100644
--- a/default-configs/targets/i386-softmmu.mak
+++ b/configs/targets/i386-softmmu.mak
diff --git a/default-configs/targets/m68k-linux-user.mak b/configs/targets/m68k-linux-user.mak
index 805d16c6ab..805d16c6ab 100644
--- a/default-configs/targets/m68k-linux-user.mak
+++ b/configs/targets/m68k-linux-user.mak
diff --git a/default-configs/targets/m68k-softmmu.mak b/configs/targets/m68k-softmmu.mak
index 5df1a2b7d7..5df1a2b7d7 100644
--- a/default-configs/targets/m68k-softmmu.mak
+++ b/configs/targets/m68k-softmmu.mak
diff --git a/default-configs/targets/microblaze-linux-user.mak b/configs/targets/microblaze-linux-user.mak
index 2a25bf2fa3..2a25bf2fa3 100644
--- a/default-configs/targets/microblaze-linux-user.mak
+++ b/configs/targets/microblaze-linux-user.mak
diff --git a/default-configs/targets/microblaze-softmmu.mak b/configs/targets/microblaze-softmmu.mak
index 33f2a00402..33f2a00402 100644
--- a/default-configs/targets/microblaze-softmmu.mak
+++ b/configs/targets/microblaze-softmmu.mak
diff --git a/default-configs/targets/microblazeel-linux-user.mak b/configs/targets/microblazeel-linux-user.mak
index d0e775d840..d0e775d840 100644
--- a/default-configs/targets/microblazeel-linux-user.mak
+++ b/configs/targets/microblazeel-linux-user.mak
diff --git a/default-configs/targets/microblazeel-softmmu.mak b/configs/targets/microblazeel-softmmu.mak
index af40391f2f..af40391f2f 100644
--- a/default-configs/targets/microblazeel-softmmu.mak
+++ b/configs/targets/microblazeel-softmmu.mak
diff --git a/default-configs/targets/mips-linux-user.mak b/configs/targets/mips-linux-user.mak
index 19f5779831..19f5779831 100644
--- a/default-configs/targets/mips-linux-user.mak
+++ b/configs/targets/mips-linux-user.mak
diff --git a/default-configs/targets/mips-softmmu.mak b/configs/targets/mips-softmmu.mak
index 8a49999a47..8a49999a47 100644
--- a/default-configs/targets/mips-softmmu.mak
+++ b/configs/targets/mips-softmmu.mak
diff --git a/default-configs/targets/mips64-linux-user.mak b/configs/targets/mips64-linux-user.mak
index 32fd1acdf2..32fd1acdf2 100644
--- a/default-configs/targets/mips64-linux-user.mak
+++ b/configs/targets/mips64-linux-user.mak
diff --git a/default-configs/targets/mips64-softmmu.mak b/configs/targets/mips64-softmmu.mak
index ece25b9624..ece25b9624 100644
--- a/default-configs/targets/mips64-softmmu.mak
+++ b/configs/targets/mips64-softmmu.mak
diff --git a/default-configs/targets/mips64el-linux-user.mak b/configs/targets/mips64el-linux-user.mak
index f348f35997..f348f35997 100644
--- a/default-configs/targets/mips64el-linux-user.mak
+++ b/configs/targets/mips64el-linux-user.mak
diff --git a/default-configs/targets/mips64el-softmmu.mak b/configs/targets/mips64el-softmmu.mak
index 5a52aa4b64..5a52aa4b64 100644
--- a/default-configs/targets/mips64el-softmmu.mak
+++ b/configs/targets/mips64el-softmmu.mak
diff --git a/default-configs/targets/mipsel-linux-user.mak b/configs/targets/mipsel-linux-user.mak
index e23793070c..e23793070c 100644
--- a/default-configs/targets/mipsel-linux-user.mak
+++ b/configs/targets/mipsel-linux-user.mak
diff --git a/default-configs/targets/mipsel-softmmu.mak b/configs/targets/mipsel-softmmu.mak
index c7c41f4fb7..c7c41f4fb7 100644
--- a/default-configs/targets/mipsel-softmmu.mak
+++ b/configs/targets/mipsel-softmmu.mak
diff --git a/default-configs/targets/mipsn32-linux-user.mak b/configs/targets/mipsn32-linux-user.mak
index b8c2441ad0..b8c2441ad0 100644
--- a/default-configs/targets/mipsn32-linux-user.mak
+++ b/configs/targets/mipsn32-linux-user.mak
diff --git a/default-configs/targets/mipsn32el-linux-user.mak b/configs/targets/mipsn32el-linux-user.mak
index f31a9c394b..f31a9c394b 100644
--- a/default-configs/targets/mipsn32el-linux-user.mak
+++ b/configs/targets/mipsn32el-linux-user.mak
diff --git a/default-configs/targets/nios2-linux-user.mak b/configs/targets/nios2-linux-user.mak
index 9a372f0717..9a372f0717 100644
--- a/default-configs/targets/nios2-linux-user.mak
+++ b/configs/targets/nios2-linux-user.mak
diff --git a/default-configs/targets/nios2-softmmu.mak b/configs/targets/nios2-softmmu.mak
index 9a372f0717..9a372f0717 100644
--- a/default-configs/targets/nios2-softmmu.mak
+++ b/configs/targets/nios2-softmmu.mak
diff --git a/default-configs/targets/or1k-linux-user.mak b/configs/targets/or1k-linux-user.mak
index 1dfb93e46d..1dfb93e46d 100644
--- a/default-configs/targets/or1k-linux-user.mak
+++ b/configs/targets/or1k-linux-user.mak
diff --git a/default-configs/targets/or1k-softmmu.mak b/configs/targets/or1k-softmmu.mak
index 1dfb93e46d..1dfb93e46d 100644
--- a/default-configs/targets/or1k-softmmu.mak
+++ b/configs/targets/or1k-softmmu.mak
diff --git a/default-configs/targets/ppc-linux-user.mak b/configs/targets/ppc-linux-user.mak
index ca4187e4aa..ca4187e4aa 100644
--- a/default-configs/targets/ppc-linux-user.mak
+++ b/configs/targets/ppc-linux-user.mak
diff --git a/default-configs/targets/ppc-softmmu.mak b/configs/targets/ppc-softmmu.mak
index f4eef1819a..f4eef1819a 100644
--- a/default-configs/targets/ppc-softmmu.mak
+++ b/configs/targets/ppc-softmmu.mak
diff --git a/default-configs/targets/ppc64-linux-user.mak b/configs/targets/ppc64-linux-user.mak
index 3133346676..3133346676 100644
--- a/default-configs/targets/ppc64-linux-user.mak
+++ b/configs/targets/ppc64-linux-user.mak
diff --git a/default-configs/targets/ppc64-softmmu.mak b/configs/targets/ppc64-softmmu.mak
index 84fbf46be9..84fbf46be9 100644
--- a/default-configs/targets/ppc64-softmmu.mak
+++ b/configs/targets/ppc64-softmmu.mak
diff --git a/default-configs/targets/ppc64abi32-linux-user.mak b/configs/targets/ppc64abi32-linux-user.mak
index 0945451081..0945451081 100644
--- a/default-configs/targets/ppc64abi32-linux-user.mak
+++ b/configs/targets/ppc64abi32-linux-user.mak
diff --git a/default-configs/targets/ppc64le-linux-user.mak b/configs/targets/ppc64le-linux-user.mak
index 426d5a28d6..426d5a28d6 100644
--- a/default-configs/targets/ppc64le-linux-user.mak
+++ b/configs/targets/ppc64le-linux-user.mak
diff --git a/default-configs/targets/riscv32-linux-user.mak b/configs/targets/riscv32-linux-user.mak
index bd2f1fd497..bd2f1fd497 100644
--- a/default-configs/targets/riscv32-linux-user.mak
+++ b/configs/targets/riscv32-linux-user.mak
diff --git a/default-configs/targets/riscv32-softmmu.mak b/configs/targets/riscv32-softmmu.mak
index d8b71cddcd..d8b71cddcd 100644
--- a/default-configs/targets/riscv32-softmmu.mak
+++ b/configs/targets/riscv32-softmmu.mak
diff --git a/default-configs/targets/riscv64-linux-user.mak b/configs/targets/riscv64-linux-user.mak
index 4aca7662ce..4aca7662ce 100644
--- a/default-configs/targets/riscv64-linux-user.mak
+++ b/configs/targets/riscv64-linux-user.mak
diff --git a/default-configs/targets/riscv64-softmmu.mak b/configs/targets/riscv64-softmmu.mak
index 7c0e7eeb42..7c0e7eeb42 100644
--- a/default-configs/targets/riscv64-softmmu.mak
+++ b/configs/targets/riscv64-softmmu.mak
diff --git a/default-configs/targets/rx-softmmu.mak b/configs/targets/rx-softmmu.mak
index 0c458b2d07..0c458b2d07 100644
--- a/default-configs/targets/rx-softmmu.mak
+++ b/configs/targets/rx-softmmu.mak
diff --git a/default-configs/targets/s390x-linux-user.mak b/configs/targets/s390x-linux-user.mak
index 9e31ce6457..9e31ce6457 100644
--- a/default-configs/targets/s390x-linux-user.mak
+++ b/configs/targets/s390x-linux-user.mak
diff --git a/default-configs/targets/s390x-softmmu.mak b/configs/targets/s390x-softmmu.mak
index fd9fbd870d..fd9fbd870d 100644
--- a/default-configs/targets/s390x-softmmu.mak
+++ b/configs/targets/s390x-softmmu.mak
diff --git a/default-configs/targets/sh4-linux-user.mak b/configs/targets/sh4-linux-user.mak
index 0152d6621e..0152d6621e 100644
--- a/default-configs/targets/sh4-linux-user.mak
+++ b/configs/targets/sh4-linux-user.mak
diff --git a/default-configs/targets/sh4-softmmu.mak b/configs/targets/sh4-softmmu.mak
index 95896376c4..95896376c4 100644
--- a/default-configs/targets/sh4-softmmu.mak
+++ b/configs/targets/sh4-softmmu.mak
diff --git a/default-configs/targets/sh4eb-linux-user.mak b/configs/targets/sh4eb-linux-user.mak
index 9b6fb4c1bb..9b6fb4c1bb 100644
--- a/default-configs/targets/sh4eb-linux-user.mak
+++ b/configs/targets/sh4eb-linux-user.mak
diff --git a/default-configs/targets/sh4eb-softmmu.mak b/configs/targets/sh4eb-softmmu.mak
index 382e9a80f8..382e9a80f8 100644
--- a/default-configs/targets/sh4eb-softmmu.mak
+++ b/configs/targets/sh4eb-softmmu.mak
diff --git a/default-configs/targets/sparc-linux-user.mak b/configs/targets/sparc-linux-user.mak
index 53dc7aaed5..53dc7aaed5 100644
--- a/default-configs/targets/sparc-linux-user.mak
+++ b/configs/targets/sparc-linux-user.mak
diff --git a/default-configs/targets/sparc-softmmu.mak b/configs/targets/sparc-softmmu.mak
index 9ba3d7b07f..9ba3d7b07f 100644
--- a/default-configs/targets/sparc-softmmu.mak
+++ b/configs/targets/sparc-softmmu.mak
diff --git a/default-configs/targets/sparc32plus-linux-user.mak b/configs/targets/sparc32plus-linux-user.mak
index e4c51df3dc..e4c51df3dc 100644
--- a/default-configs/targets/sparc32plus-linux-user.mak
+++ b/configs/targets/sparc32plus-linux-user.mak
diff --git a/default-configs/targets/sparc64-linux-user.mak b/configs/targets/sparc64-linux-user.mak
index 9d23ab4a26..9d23ab4a26 100644
--- a/default-configs/targets/sparc64-linux-user.mak
+++ b/configs/targets/sparc64-linux-user.mak
diff --git a/default-configs/targets/sparc64-softmmu.mak b/configs/targets/sparc64-softmmu.mak
index 8dd3217800..8dd3217800 100644
--- a/default-configs/targets/sparc64-softmmu.mak
+++ b/configs/targets/sparc64-softmmu.mak
diff --git a/default-configs/targets/tricore-softmmu.mak b/configs/targets/tricore-softmmu.mak
index 96b10af853..96b10af853 100644
--- a/default-configs/targets/tricore-softmmu.mak
+++ b/configs/targets/tricore-softmmu.mak
diff --git a/default-configs/targets/x86_64-bsd-user.mak b/configs/targets/x86_64-bsd-user.mak
index 799cd4acd4..799cd4acd4 100644
--- a/default-configs/targets/x86_64-bsd-user.mak
+++ b/configs/targets/x86_64-bsd-user.mak
diff --git a/default-configs/targets/x86_64-linux-user.mak b/configs/targets/x86_64-linux-user.mak
index 9ceefbb615..9ceefbb615 100644
--- a/default-configs/targets/x86_64-linux-user.mak
+++ b/configs/targets/x86_64-linux-user.mak
diff --git a/default-configs/targets/x86_64-softmmu.mak b/configs/targets/x86_64-softmmu.mak
index 75e42bc840..75e42bc840 100644
--- a/default-configs/targets/x86_64-softmmu.mak
+++ b/configs/targets/x86_64-softmmu.mak
diff --git a/default-configs/targets/xtensa-linux-user.mak b/configs/targets/xtensa-linux-user.mak
index 420b30a68d..420b30a68d 100644
--- a/default-configs/targets/xtensa-linux-user.mak
+++ b/configs/targets/xtensa-linux-user.mak
diff --git a/default-configs/targets/xtensa-softmmu.mak b/configs/targets/xtensa-softmmu.mak
index f075557bfa..f075557bfa 100644
--- a/default-configs/targets/xtensa-softmmu.mak
+++ b/configs/targets/xtensa-softmmu.mak
diff --git a/default-configs/targets/xtensaeb-linux-user.mak b/configs/targets/xtensaeb-linux-user.mak
index 1ea0f1ba91..1ea0f1ba91 100644
--- a/default-configs/targets/xtensaeb-linux-user.mak
+++ b/configs/targets/xtensaeb-linux-user.mak
diff --git a/default-configs/targets/xtensaeb-softmmu.mak b/configs/targets/xtensaeb-softmmu.mak
index 405cf5acbb..405cf5acbb 100644
--- a/default-configs/targets/xtensaeb-softmmu.mak
+++ b/configs/targets/xtensaeb-softmmu.mak
diff --git a/configure b/configure
index 650d9c0735..85db248ac1 100755
--- a/configure
+++ b/configure
@@ -915,6 +915,18 @@ for opt do
;;
--without-default-devices) default_devices="false"
;;
+ --with-devices-*[!a-zA-Z0-9_-]*=*) error_exit "Passed bad --with-devices-FOO option"
+ ;;
+ --with-devices-*) device_arch=${opt#--with-devices-};
+ device_arch=${device_arch%%=*}
+ cf=$source_path/configs/devices/$device_arch-softmmu/$optarg.mak
+ if test -f "$cf"; then
+ device_archs="$device_archs $device_arch"
+ eval "devices_${device_arch}=\$optarg"
+ else
+ error_exit "File $cf does not exist"
+ fi
+ ;;
--without-default-features) # processed above
;;
--enable-gprof) gprof="yes"
@@ -1501,9 +1513,9 @@ for opt do
;;
--disable-debug-mutex) debug_mutex=no
;;
- --enable-libpmem) libpmem=disabled
+ --enable-libpmem) libpmem="enabled"
;;
- --disable-libpmem) libpmem=enabled
+ --disable-libpmem) libpmem="disabled"
;;
--enable-xkbcommon) xkbcommon="enabled"
;;
@@ -1531,9 +1543,9 @@ for opt do
;;
--disable-keyring) secret_keyring="no"
;;
- --enable-libdaxctl) libdaxctl=disabled
+ --enable-libdaxctl) libdaxctl="enabled"
;;
- --disable-libdaxctl) libdaxctl=enabled
+ --disable-libdaxctl) libdaxctl="disabled"
;;
--enable-fuse) fuse="enabled"
;;
@@ -1677,13 +1689,13 @@ deprecated_features=""
mak_wilds=""
if [ "$softmmu" = "yes" ]; then
- mak_wilds="${mak_wilds} $source_path/default-configs/targets/*-softmmu.mak"
+ mak_wilds="${mak_wilds} $source_path/configs/targets/*-softmmu.mak"
fi
if [ "$linux_user" = "yes" ]; then
- mak_wilds="${mak_wilds} $source_path/default-configs/targets/*-linux-user.mak"
+ mak_wilds="${mak_wilds} $source_path/configs/targets/*-linux-user.mak"
fi
if [ "$bsd_user" = "yes" ]; then
- mak_wilds="${mak_wilds} $source_path/default-configs/targets/*-bsd-user.mak"
+ mak_wilds="${mak_wilds} $source_path/configs/targets/*-bsd-user.mak"
fi
# If the user doesn't explicitly specify a deprecated target we will
@@ -1764,7 +1776,8 @@ Advanced options (experts only):
--without-default-features default all --enable-* options to "disabled"
--without-default-devices do not include any device that is not needed to
start the emulator (only use if you are including
- desired devices in default-configs/devices/)
+ desired devices in configs/devices/)
+ --with-devices-ARCH=NAME override default configs/devices
--enable-debug enable common debug build options
--enable-sanitizers enable default sanitizers
--enable-tsan enable thread sanitizer
@@ -4818,12 +4831,6 @@ elif test "$pthread_setname_np_wo_tid" = "yes" ; then
echo "CONFIG_PTHREAD_SETNAME_NP_WO_TID=y" >> $config_host_mak
fi
-if test "$libpmem" = "yes" ; then
- echo "CONFIG_LIBPMEM=y" >> $config_host_mak
- echo "LIBPMEM_LIBS=$libpmem_libs" >> $config_host_mak
- echo "LIBPMEM_CFLAGS=$libpmem_cflags" >> $config_host_mak
-fi
-
if test "$bochs" = "yes" ; then
echo "CONFIG_BOCHS=y" >> $config_host_mak
fi
@@ -5088,6 +5095,15 @@ if test "$skip_meson" = no; then
echo "# Automatically generated by configure - do not modify" > $cross
echo "[properties]" >> $cross
+
+ # unroll any custom device configs
+ if test -n "$device_archs"; then
+ for a in $device_archs; do
+ eval "c=\$devices_${a}"
+ echo "${a}-softmmu = '$c'" >> $cross
+ done
+ fi
+
test -z "$cxx" && echo "link_language = 'c'" >> $cross
echo "[built-in options]" >> $cross
echo "c_args = [${CFLAGS:+$(meson_quote $CFLAGS)}]" >> $cross
diff --git a/contrib/vhost-user-gpu/meson.build b/contrib/vhost-user-gpu/meson.build
index 0ce1515a10..4cb52a91d7 100644
--- a/contrib/vhost-user-gpu/meson.build
+++ b/contrib/vhost-user-gpu/meson.build
@@ -1,4 +1,4 @@
-if 'CONFIG_TOOLS' in config_host and 'CONFIG_VIRGL' in config_host \
+if 'CONFIG_TOOLS' in config_host and virgl.found() \
and 'CONFIG_GBM' in config_host and 'CONFIG_LINUX' in config_host \
and pixman.found()
executable('vhost-user-gpu', files('vhost-user-gpu.c', 'virgl.c', 'vugbm.c'),
diff --git a/default-configs/devices/xtensaeb-softmmu.mak b/default-configs/devices/xtensaeb-softmmu.mak
deleted file mode 100644
index f7e48c750c..0000000000
--- a/default-configs/devices/xtensaeb-softmmu.mak
+++ /dev/null
@@ -1,3 +0,0 @@
-# Default configuration for Xtensa
-
-include xtensa-softmmu.mak
diff --git a/docs/devel/build-system.rst b/docs/devel/build-system.rst
index 7ef36f42d0..fd1650442e 100644
--- a/docs/devel/build-system.rst
+++ b/docs/devel/build-system.rst
@@ -272,6 +272,23 @@ Target-dependent emulator sourcesets:
target_arch += {'arm': arm_ss}
target_softmmu_arch += {'arm': arm_softmmu_ss}
+Module sourcesets:
+ There are two dictionaries for modules: `modules` is used for
+ target-independent modules and `target_modules` is used for
+ target-dependent modules. When modules are disabled the `module`
+ source sets are added to `softmmu_ss` and the `target_modules`
+ source sets are added to `specific_ss`.
+
+ Both dictionaries are nested. One dictionary is created per
+ subdirectory, and these per-subdirectory dictionaries are added to
+ the toplevel dictionaries. For example::
+
+ hw_display_modules = {}
+ qxl_ss = ss.source_set()
+ ...
+ hw_display_modules += { 'qxl': qxl_ss }
+ modules += { 'hw-display': hw_display_modules }
+
Utility sourcesets:
All binaries link with a static library `libqemuutil.a`. This library
is built from several sourcesets; most of them however host generated
diff --git a/docs/devel/index.rst b/docs/devel/index.rst
index 977c3893bd..ba90badbbd 100644
--- a/docs/devel/index.rst
+++ b/docs/devel/index.rst
@@ -41,6 +41,7 @@ Contents:
s390-dasd-ipl
clocks
qom
+ modules
block-coroutine-wrapper
multi-process
ebpf_rss
diff --git a/docs/devel/modules.rst b/docs/devel/modules.rst
new file mode 100644
index 0000000000..066f347b89
--- /dev/null
+++ b/docs/devel/modules.rst
@@ -0,0 +1,5 @@
+============
+Qemu modules
+============
+
+.. kernel-doc:: include/qemu/module.h
diff --git a/docs/devel/qom.rst b/docs/devel/qom.rst
index 42d0dc4f4d..e5fe3597cd 100644
--- a/docs/devel/qom.rst
+++ b/docs/devel/qom.rst
@@ -87,6 +87,14 @@ specific type:
#define MY_DEVICE(obj) \
OBJECT_CHECK(MyDevice, obj, TYPE_MY_DEVICE)
+In case the ObjectClass implementation can be built as module a
+module_obj() line must be added to make sure qemu loads the module
+when the object is needed.
+
+.. code-block:: c
+
+ module_obj(TYPE_MY_DEVICE);
+
Class Initialization
====================
diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx
index fb59c27200..27206ac049 100644
--- a/hmp-commands-info.hx
+++ b/hmp-commands-info.hx
@@ -274,7 +274,6 @@ ERST
.args_type = "",
.params = "",
.help = "show dynamic compiler info",
- .cmd = hmp_info_jit,
},
#endif
@@ -289,7 +288,6 @@ ERST
.args_type = "",
.params = "",
.help = "show dynamic compiler opcode counters",
- .cmd = hmp_info_opcount,
},
#endif
@@ -368,7 +366,6 @@ ERST
.args_type = "",
.params = "",
.help = "show host USB devices",
- .cmd = hmp_info_usbhost,
},
SRST
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index afe13e9d67..90b19c0861 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -300,7 +300,10 @@ config ZYNQ
config ARM_V7M
bool
+ # currently v7M must be included in a TCG build due to translate.c
+ default y if TCG && (ARM || AARCH64)
select PTIMER
+ select ARM_COMPATIBLE_SEMIHOSTING
config ALLWINNER_A10
bool
@@ -378,6 +381,7 @@ config XLNX_VERSAL
select UNIMP
select XLNX_ZDMA
select XLNX_ZYNQMP
+ select OR_IRQ
config NPCM7XX
bool
diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index 6e1f8ff1b2..84f99088e0 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -2522,6 +2522,7 @@ static const TypeInfo qxl_primary_info = {
.parent = TYPE_PCI_QXL,
.class_init = qxl_primary_class_init,
};
+module_obj("qxl-vga");
static void qxl_secondary_class_init(ObjectClass *klass, void *data)
{
@@ -2538,6 +2539,7 @@ static const TypeInfo qxl_secondary_info = {
.parent = TYPE_PCI_QXL,
.class_init = qxl_secondary_class_init,
};
+module_obj("qxl");
static void qxl_register_types(void)
{
@@ -2547,3 +2549,5 @@ static void qxl_register_types(void)
}
type_init(qxl_register_types)
+
+module_dep("ui-spice-core");
diff --git a/hw/display/vhost-user-gpu-pci.c b/hw/display/vhost-user-gpu-pci.c
index a02b23ecaf..daefcf7101 100644
--- a/hw/display/vhost-user-gpu-pci.c
+++ b/hw/display/vhost-user-gpu-pci.c
@@ -43,6 +43,7 @@ static const VirtioPCIDeviceTypeInfo vhost_user_gpu_pci_info = {
.instance_size = sizeof(VhostUserGPUPCI),
.instance_init = vhost_user_gpu_pci_initfn,
};
+module_obj(TYPE_VHOST_USER_GPU_PCI);
static void vhost_user_gpu_pci_register_types(void)
{
diff --git a/hw/display/vhost-user-gpu.c b/hw/display/vhost-user-gpu.c
index 389199e6ca..49df56cd14 100644
--- a/hw/display/vhost-user-gpu.c
+++ b/hw/display/vhost-user-gpu.c
@@ -598,6 +598,7 @@ static const TypeInfo vhost_user_gpu_info = {
.instance_finalize = vhost_user_gpu_instance_finalize,
.class_init = vhost_user_gpu_class_init,
};
+module_obj(TYPE_VHOST_USER_GPU);
static void vhost_user_gpu_register_types(void)
{
diff --git a/hw/display/vhost-user-vga.c b/hw/display/vhost-user-vga.c
index a34a99856d..072c9c65bc 100644
--- a/hw/display/vhost-user-vga.c
+++ b/hw/display/vhost-user-vga.c
@@ -44,6 +44,7 @@ static const VirtioPCIDeviceTypeInfo vhost_user_vga_info = {
.instance_size = sizeof(VhostUserVGA),
.instance_init = vhost_user_vga_inst_initfn,
};
+module_obj(TYPE_VHOST_USER_VGA);
static void vhost_user_vga_register_types(void)
{
diff --git a/hw/display/virtio-gpu-base.c b/hw/display/virtio-gpu-base.c
index dd294276cb..c8da4806e0 100644
--- a/hw/display/virtio-gpu-base.c
+++ b/hw/display/virtio-gpu-base.c
@@ -256,6 +256,7 @@ static const TypeInfo virtio_gpu_base_info = {
.class_init = virtio_gpu_base_class_init,
.abstract = true
};
+module_obj(TYPE_VIRTIO_GPU_BASE);
static void
virtio_register_types(void)
diff --git a/hw/display/virtio-gpu-gl.c b/hw/display/virtio-gpu-gl.c
index d971b48080..7ab93bf8c8 100644
--- a/hw/display/virtio-gpu-gl.c
+++ b/hw/display/virtio-gpu-gl.c
@@ -154,6 +154,7 @@ static const TypeInfo virtio_gpu_gl_info = {
.instance_size = sizeof(VirtIOGPUGL),
.class_init = virtio_gpu_gl_class_init,
};
+module_obj(TYPE_VIRTIO_GPU_GL);
static void virtio_register_types(void)
{
@@ -161,3 +162,5 @@ static void virtio_register_types(void)
}
type_init(virtio_register_types)
+
+module_dep("hw-display-virtio-gpu");
diff --git a/hw/display/virtio-gpu-pci-gl.c b/hw/display/virtio-gpu-pci-gl.c
index 902dda3452..99b14a0718 100644
--- a/hw/display/virtio-gpu-pci-gl.c
+++ b/hw/display/virtio-gpu-pci-gl.c
@@ -46,6 +46,7 @@ static const VirtioPCIDeviceTypeInfo virtio_gpu_gl_pci_info = {
.instance_size = sizeof(VirtIOGPUGLPCI),
.instance_init = virtio_gpu_gl_initfn,
};
+module_obj(TYPE_VIRTIO_GPU_GL_PCI);
static void virtio_gpu_gl_pci_register_types(void)
{
@@ -53,3 +54,5 @@ static void virtio_gpu_gl_pci_register_types(void)
}
type_init(virtio_gpu_gl_pci_register_types)
+
+module_dep("hw-display-virtio-gpu-pci");
diff --git a/hw/display/virtio-gpu-pci.c b/hw/display/virtio-gpu-pci.c
index d742a30aec..e36eee0c40 100644
--- a/hw/display/virtio-gpu-pci.c
+++ b/hw/display/virtio-gpu-pci.c
@@ -64,6 +64,7 @@ static const TypeInfo virtio_gpu_pci_base_info = {
.class_init = virtio_gpu_pci_base_class_init,
.abstract = true
};
+module_obj(TYPE_VIRTIO_GPU_PCI_BASE);
#define TYPE_VIRTIO_GPU_PCI "virtio-gpu-pci"
typedef struct VirtIOGPUPCI VirtIOGPUPCI;
@@ -90,6 +91,7 @@ static const VirtioPCIDeviceTypeInfo virtio_gpu_pci_info = {
.instance_size = sizeof(VirtIOGPUPCI),
.instance_init = virtio_gpu_initfn,
};
+module_obj(TYPE_VIRTIO_GPU_PCI);
static void virtio_gpu_pci_register_types(void)
{
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index e183f4ecda..6b7f643951 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -1427,6 +1427,7 @@ static const TypeInfo virtio_gpu_info = {
.class_size = sizeof(VirtIOGPUClass),
.class_init = virtio_gpu_class_init,
};
+module_obj(TYPE_VIRTIO_GPU);
static void virtio_register_types(void)
{
diff --git a/hw/display/virtio-vga-gl.c b/hw/display/virtio-vga-gl.c
index c971340ebb..f22549097c 100644
--- a/hw/display/virtio-vga-gl.c
+++ b/hw/display/virtio-vga-gl.c
@@ -36,6 +36,7 @@ static VirtioPCIDeviceTypeInfo virtio_vga_gl_info = {
.instance_size = sizeof(VirtIOVGAGL),
.instance_init = virtio_vga_gl_inst_initfn,
};
+module_obj(TYPE_VIRTIO_VGA_GL);
static void virtio_vga_register_types(void)
{
@@ -45,3 +46,5 @@ static void virtio_vga_register_types(void)
}
type_init(virtio_vga_register_types)
+
+module_dep("hw-display-virtio-vga");
diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c
index d3c6404061..9e57f61e9e 100644
--- a/hw/display/virtio-vga.c
+++ b/hw/display/virtio-vga.c
@@ -239,6 +239,7 @@ static TypeInfo virtio_vga_base_info = {
.class_init = virtio_vga_base_class_init,
.abstract = true,
};
+module_obj(TYPE_VIRTIO_VGA_BASE);
#define TYPE_VIRTIO_VGA "virtio-vga"
@@ -268,6 +269,7 @@ static VirtioPCIDeviceTypeInfo virtio_vga_info = {
.instance_size = sizeof(VirtIOVGA),
.instance_init = virtio_vga_inst_initfn,
};
+module_obj(TYPE_VIRTIO_VGA);
static void virtio_vga_register_types(void)
{
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index a007be471e..81699d4f8b 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -3128,7 +3128,7 @@ static char *spapr_get_fw_dev_path(FWPathProvider *p, BusState *bus,
*/
if (strcmp("usb-host", qdev_fw_name(dev)) == 0) {
USBDevice *usbdev = CAST(USBDevice, dev, TYPE_USB_DEVICE);
- if (usb_host_dev_is_scsi_storage(usbdev)) {
+ if (usb_device_is_scsi_storage(usbdev)) {
return g_strdup_printf("storage@%s/disk", usbdev->port->path);
}
}
diff --git a/hw/s390x/virtio-ccw-gpu.c b/hw/s390x/virtio-ccw-gpu.c
index 75a9e4bb39..5868a2a070 100644
--- a/hw/s390x/virtio-ccw-gpu.c
+++ b/hw/s390x/virtio-ccw-gpu.c
@@ -59,6 +59,7 @@ static const TypeInfo virtio_ccw_gpu = {
.instance_init = virtio_ccw_gpu_instance_init,
.class_init = virtio_ccw_gpu_class_init,
};
+module_obj(TYPE_VIRTIO_GPU_CCW);
static void virtio_ccw_gpu_register(void)
{
@@ -68,3 +69,5 @@ static void virtio_ccw_gpu_register(void)
}
type_init(virtio_ccw_gpu_register)
+
+module_arch("s390x");
diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c
index 5c76bed77a..6c8c0355e0 100644
--- a/hw/usb/ccid-card-emulated.c
+++ b/hw/usb/ccid-card-emulated.c
@@ -612,6 +612,7 @@ static const TypeInfo emulated_card_info = {
.instance_size = sizeof(EmulatedState),
.class_init = emulated_class_initfn,
};
+module_obj(TYPE_EMULATED_CCID);
static void ccid_card_emulated_register_types(void)
{
diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c
index 7212d0d7fb..fa3040fb71 100644
--- a/hw/usb/ccid-card-passthru.c
+++ b/hw/usb/ccid-card-passthru.c
@@ -414,6 +414,7 @@ static const TypeInfo passthru_card_info = {
.instance_size = sizeof(PassthruState),
.class_init = passthru_class_initfn,
};
+module_obj(TYPE_CCID_PASSTHRU);
static void ccid_card_passthru_register_types(void)
{
diff --git a/hw/usb/dev-storage-bot.c b/hw/usb/dev-storage-bot.c
index 6aad026d11..68ebaca10c 100644
--- a/hw/usb/dev-storage-bot.c
+++ b/hw/usb/dev-storage-bot.c
@@ -32,6 +32,7 @@ static void usb_msd_bot_realize(USBDevice *dev, Error **errp)
usb_desc_create_serial(dev);
usb_desc_init(dev);
+ dev->flags |= (1 << USB_DEV_FLAG_IS_SCSI_STORAGE);
if (d->hotplugged) {
s->dev.auto_attach = 0;
}
diff --git a/hw/usb/dev-storage-classic.c b/hw/usb/dev-storage-classic.c
index 00cb34b22f..3d017a4e67 100644
--- a/hw/usb/dev-storage-classic.c
+++ b/hw/usb/dev-storage-classic.c
@@ -64,6 +64,7 @@ static void usb_msd_storage_realize(USBDevice *dev, Error **errp)
usb_desc_create_serial(dev);
usb_desc_init(dev);
+ dev->flags |= (1 << USB_DEV_FLAG_IS_SCSI_STORAGE);
scsi_bus_new(&s->bus, sizeof(s->bus), DEVICE(dev),
&usb_msd_scsi_info_storage, NULL);
scsi_dev = scsi_bus_legacy_add_drive(&s->bus, blk, 0, !!s->removable,
diff --git a/hw/usb/dev-uas.c b/hw/usb/dev-uas.c
index d2bd85d3f6..263056231c 100644
--- a/hw/usb/dev-uas.c
+++ b/hw/usb/dev-uas.c
@@ -926,6 +926,7 @@ static void usb_uas_realize(USBDevice *dev, Error **errp)
QTAILQ_INIT(&uas->requests);
uas->status_bh = qemu_bh_new(usb_uas_send_status_bh, uas);
+ dev->flags |= (1 << USB_DEV_FLAG_IS_SCSI_STORAGE);
scsi_bus_new(&uas->bus, sizeof(uas->bus), DEVICE(dev),
&usb_uas_scsi_info, NULL);
}
diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
index 2518306f52..c0f314462a 100644
--- a/hw/usb/host-libusb.c
+++ b/hw/usb/host-libusb.c
@@ -770,6 +770,13 @@ static void usb_host_speed_compat(USBHostDevice *s)
for (i = 0; i < conf->bNumInterfaces; i++) {
for (a = 0; a < conf->interface[i].num_altsetting; a++) {
intf = &conf->interface[i].altsetting[a];
+
+ if (intf->bInterfaceClass == LIBUSB_CLASS_MASS_STORAGE &&
+ intf->bInterfaceSubClass == 6) { /* SCSI */
+ udev->flags |= (1 << USB_DEV_FLAG_IS_SCSI_STORAGE);
+ break;
+ }
+
for (e = 0; e < intf->bNumEndpoints; e++) {
endp = &intf->endpoint[e];
type = endp->bmAttributes & 0x3;
@@ -1770,10 +1777,12 @@ static TypeInfo usb_host_dev_info = {
.class_init = usb_host_class_initfn,
.instance_init = usb_host_instance_init,
};
+module_obj(TYPE_USB_HOST_DEVICE);
static void usb_host_register_types(void)
{
type_register_static(&usb_host_dev_info);
+ monitor_register_hmp("usbhost", true, hmp_info_usbhost);
}
type_init(usb_host_register_types)
@@ -1893,35 +1902,6 @@ static void usb_host_auto_check(void *unused)
timer_mod(usb_auto_timer, qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + 2000);
}
-/**
- * Check whether USB host device has a USB mass storage SCSI interface
- */
-bool usb_host_dev_is_scsi_storage(USBDevice *ud)
-{
- USBHostDevice *uhd = USB_HOST_DEVICE(ud);
- struct libusb_config_descriptor *conf;
- const struct libusb_interface_descriptor *intf;
- bool is_scsi_storage = false;
- int i;
-
- if (!uhd || libusb_get_active_config_descriptor(uhd->dev, &conf) != 0) {
- return false;
- }
-
- for (i = 0; i < conf->bNumInterfaces; i++) {
- intf = &conf->interface[i].altsetting[ud->altsetting[i]];
- if (intf->bInterfaceClass == LIBUSB_CLASS_MASS_STORAGE &&
- intf->bInterfaceSubClass == 6) { /* 6 means SCSI */
- is_scsi_storage = true;
- break;
- }
- }
-
- libusb_free_config_descriptor(conf);
-
- return is_scsi_storage;
-}
-
void hmp_info_usbhost(Monitor *mon, const QDict *qdict)
{
libusb_device **devs = NULL;
diff --git a/hw/usb/host-stub.c b/hw/usb/host-stub.c
deleted file mode 100644
index 80809ceba5..0000000000
--- a/hw/usb/host-stub.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Stub host USB redirector
- *
- * Copyright (c) 2005 Fabrice Bellard
- *
- * Copyright (c) 2008 Max Krasnyansky
- * Support for host device auto connect & disconnect
- * Major rewrite to support fully async operation
- *
- * Copyright 2008 TJ <linux@tjworld.net>
- * Added flexible support for /dev/bus/usb /sys/bus/usb/devices in addition
- * to the legacy /proc/bus/usb USB device discovery and handling
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-#include "qemu/osdep.h"
-#include "hw/usb.h"
-#include "monitor/monitor.h"
-
-void hmp_info_usbhost(Monitor *mon, const QDict *qdict)
-{
- monitor_printf(mon, "USB host devices not supported\n");
-}
-
-bool usb_host_dev_is_scsi_storage(USBDevice *ud)
-{
- return false;
-}
diff --git a/hw/usb/meson.build b/hw/usb/meson.build
index 4f24b5274d..3ca6127937 100644
--- a/hw/usb/meson.build
+++ b/hw/usb/meson.build
@@ -72,10 +72,12 @@ if usbredir.found()
endif
# usb pass-through
-softmmu_ss.add(when: ['CONFIG_USB', libusb],
- if_true: files('host-libusb.c'),
- if_false: files('host-stub.c'))
-softmmu_ss.add(when: 'CONFIG_ALL', if_true: files('host-stub.c'))
+if config_host.has_key('CONFIG_USB_LIBUSB')
+ usbhost_ss = ss.source_set()
+ usbhost_ss.add(when: ['CONFIG_USB', libusb],
+ if_true: files('host-libusb.c'))
+ hw_usb_modules += {'host': usbhost_ss}
+endif
softmmu_ss.add(when: ['CONFIG_USB', 'CONFIG_XEN', libusb], if_true: files('xen-usb.c'))
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index 6a75b0dc4a..4ec9326e05 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -2608,6 +2608,7 @@ static const TypeInfo usbredir_dev_info = {
.class_init = usbredir_class_initfn,
.instance_init = usbredir_instance_init,
};
+module_obj(TYPE_USB_REDIR);
static void usbredir_register_types(void)
{
diff --git a/include/hw/usb.h b/include/hw/usb.h
index 436e07b304..33668dd0a9 100644
--- a/include/hw/usb.h
+++ b/include/hw/usb.h
@@ -219,6 +219,7 @@ enum USBDeviceFlags {
USB_DEV_FLAG_IS_HOST,
USB_DEV_FLAG_MSOS_DESC_ENABLE,
USB_DEV_FLAG_MSOS_DESC_IN_USE,
+ USB_DEV_FLAG_IS_SCSI_STORAGE,
};
/* definition of a USB device */
@@ -465,7 +466,6 @@ void usb_generic_async_ctrl_complete(USBDevice *s, USBPacket *p);
/* usb-linux.c */
void hmp_info_usbhost(Monitor *mon, const QDict *qdict);
-bool usb_host_dev_is_scsi_storage(USBDevice *usbdev);
/* usb ports of the VM */
@@ -561,6 +561,11 @@ const char *usb_device_get_product_desc(USBDevice *dev);
const USBDesc *usb_device_get_usb_desc(USBDevice *dev);
+static inline bool usb_device_is_scsi_storage(USBDevice *dev)
+{
+ return dev->flags & (1 << USB_DEV_FLAG_IS_SCSI_STORAGE);
+}
+
/* quirks.c */
/* In bulk endpoints are streaming data sources (iow behave like isoc eps) */
diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h
index 1211d6e6d6..1a8a369b50 100644
--- a/include/monitor/monitor.h
+++ b/include/monitor/monitor.h
@@ -51,4 +51,7 @@ int monitor_fdset_dup_fd_add(int64_t fdset_id, int flags);
void monitor_fdset_dup_fd_remove(int dup_fd);
int64_t monitor_fdset_dup_fd_find(int dup_fd);
+void monitor_register_hmp(const char *name, bool info,
+ void (*cmd)(Monitor *mon, const QDict *qdict));
+
#endif /* MONITOR_H */
diff --git a/include/qemu/module.h b/include/qemu/module.h
index 944d403cbd..3deac0078b 100644
--- a/include/qemu/module.h
+++ b/include/qemu/module.h
@@ -72,5 +72,84 @@ void module_call_init(module_init_type type);
bool module_load_one(const char *prefix, const char *lib_name, bool mayfail);
void module_load_qom_one(const char *type);
void module_load_qom_all(void);
+void module_allow_arch(const char *arch);
+
+/**
+ * DOC: module info annotation macros
+ *
+ * `scripts/modinfo-collect.py` will collect module info,
+ * using the preprocessor and -DQEMU_MODINFO.
+ *
+ * `scripts/modinfo-generate.py` will create a module meta-data database
+ * from the collected information so qemu knows about module
+ * dependencies and QOM objects implemented by modules.
+ *
+ * See `*.modinfo` and `modinfo.c` in the build directory to check the
+ * script results.
+ */
+#ifdef QEMU_MODINFO
+# define modinfo(kind, value) \
+ MODINFO_START kind value MODINFO_END
+#else
+# define modinfo(kind, value)
+#endif
+
+/**
+ * module_obj
+ *
+ * @name: QOM type.
+ *
+ * This module implements QOM type @name.
+ */
+#define module_obj(name) modinfo(obj, name)
+
+/**
+ * module_dep
+ *
+ * @name: module name
+ *
+ * This module depends on module @name.
+ */
+#define module_dep(name) modinfo(dep, name)
+
+/**
+ * module_arch
+ *
+ * @name: target architecture
+ *
+ * This module is for target architecture @arch.
+ *
+ * Note that target-dependent modules are tagged automatically, so
+ * this is only needed in case target-independent modules should be
+ * restricted. Use case example: the ccw bus is implemented by s390x
+ * only.
+ */
+#define module_arch(name) modinfo(arch, name)
+
+/**
+ * module_opts
+ *
+ * @name: QemuOpts name
+ *
+ * This module registers QemuOpts @name.
+ */
+#define module_opts(name) modinfo(opts, name)
+
+/*
+ * module info database
+ *
+ * scripts/modinfo-generate.c will build this using the data collected
+ * by scripts/modinfo-collect.py
+ */
+typedef struct QemuModinfo QemuModinfo;
+struct QemuModinfo {
+ const char *name;
+ const char *arch;
+ const char **objs;
+ const char **deps;
+ const char **opts;
+};
+extern const QemuModinfo qemu_modinfo[];
+void module_init_info(const QemuModinfo *info);
#endif
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index c91a78b5e6..60718fc342 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -256,7 +256,7 @@ extern "C" {
/* Mac OSX has a <stdint.h> bug that incorrectly defines SIZE_MAX with
* the wrong type. Our replacement isn't usable in preprocessor
* expressions, but it is sufficient for our needs. */
-#if defined(HAVE_BROKEN_SIZE_MAX) && HAVE_BROKEN_SIZE_MAX
+#ifdef HAVE_BROKEN_SIZE_MAX
#undef SIZE_MAX
#define SIZE_MAX ((size_t)-1)
#endif
diff --git a/meson.build b/meson.build
index eb362ee5eb..dd7f9ed6a8 100644
--- a/meson.build
+++ b/meson.build
@@ -92,6 +92,8 @@ if cpu in ['x86', 'x86_64']
}
endif
+modular_tcg = ['i386-softmmu', 'x86_64-softmmu']
+
edk2_targets = [ 'arm-softmmu', 'aarch64-softmmu', 'i386-softmmu', 'x86_64-softmmu' ]
install_edk2_blobs = false
if get_option('install_blobs')
@@ -1226,8 +1228,11 @@ config_host_data.set('CONFIG_VTE', vte.found())
config_host_data.set('CONFIG_LIBATTR', have_old_libattr)
config_host_data.set('CONFIG_LIBCAP_NG', libcap_ng.found())
config_host_data.set('CONFIG_EBPF', libbpf.found())
+config_host_data.set('CONFIG_LIBDAXCTL', libdaxctl.found())
config_host_data.set('CONFIG_LIBISCSI', libiscsi.found())
config_host_data.set('CONFIG_LIBNFS', libnfs.found())
+config_host_data.set('CONFIG_LINUX_IO_URING', linux_io_uring.found())
+config_host_data.set('CONFIG_LIBPMEM', libpmem.found())
config_host_data.set('CONFIG_RBD', rbd.found())
config_host_data.set('CONFIG_SDL', sdl.found())
config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found())
@@ -1240,6 +1245,7 @@ config_host_data.set('CONFIG_VNC_JPEG', jpeg.found())
config_host_data.set('CONFIG_VNC_PNG', png.found())
config_host_data.set('CONFIG_VNC_SASL', sasl.found())
config_host_data.set('CONFIG_VIRTFS', have_virtfs)
+config_host_data.set('CONFIG_VTE', vte.found())
config_host_data.set('CONFIG_XKBCOMMON', xkbcommon.found())
config_host_data.set('CONFIG_KEYUTILS', keyutils.found())
config_host_data.set('CONFIG_GETTID', has_gettid)
@@ -1337,10 +1343,10 @@ config_host_data.set('HAVE_STRUCT_STAT_ST_ATIM',
cc.has_member('struct stat', 'st_atim',
prefix: '#include <sys/stat.h>'))
-config_host_data.set('CONFIG_EVENTFD', cc.compiles('''
+config_host_data.set('CONFIG_EVENTFD', cc.links('''
#include <sys/eventfd.h>
int main(void) { return eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC); }'''))
-config_host_data.set('CONFIG_FDATASYNC', cc.compiles(gnu_source_prefix + '''
+config_host_data.set('CONFIG_FDATASYNC', cc.links(gnu_source_prefix + '''
#include <unistd.h>
int main(void) {
#if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0
@@ -1349,22 +1355,22 @@ config_host_data.set('CONFIG_FDATASYNC', cc.compiles(gnu_source_prefix + '''
#error Not supported
#endif
}'''))
-config_host_data.set('CONFIG_MADVISE', cc.compiles(gnu_source_prefix + '''
+config_host_data.set('CONFIG_MADVISE', cc.links(gnu_source_prefix + '''
#include <sys/types.h>
#include <sys/mman.h>
#include <stddef.h>
int main(void) { return madvise(NULL, 0, MADV_DONTNEED); }'''))
-config_host_data.set('CONFIG_MEMFD', cc.compiles(gnu_source_prefix + '''
+config_host_data.set('CONFIG_MEMFD', cc.links(gnu_source_prefix + '''
#include <sys/mman.h>
int main(void) { return memfd_create("foo", MFD_ALLOW_SEALING); }'''))
-config_host_data.set('CONFIG_OPEN_BY_HANDLE', cc.compiles(gnu_source_prefix + '''
+config_host_data.set('CONFIG_OPEN_BY_HANDLE', cc.links(gnu_source_prefix + '''
#include <fcntl.h>
#if !defined(AT_EMPTY_PATH)
# error missing definition
#else
int main(void) { struct file_handle fh; return open_by_handle_at(0, &fh, 0); }
#endif'''))
-config_host_data.set('CONFIG_PIPE2', cc.compiles(gnu_source_prefix + '''
+config_host_data.set('CONFIG_PIPE2', cc.links(gnu_source_prefix + '''
#include <unistd.h>
#include <fcntl.h>
@@ -1373,16 +1379,16 @@ config_host_data.set('CONFIG_PIPE2', cc.compiles(gnu_source_prefix + '''
int pipefd[2];
return pipe2(pipefd, O_CLOEXEC);
}'''))
-config_host_data.set('CONFIG_POSIX_MADVISE', cc.compiles(gnu_source_prefix + '''
+config_host_data.set('CONFIG_POSIX_MADVISE', cc.links(gnu_source_prefix + '''
#include <sys/mman.h>
#include <stddef.h>
int main(void) { return posix_madvise(NULL, 0, POSIX_MADV_DONTNEED); }'''))
-config_host_data.set('CONFIG_SIGNALFD', cc.compiles(gnu_source_prefix + '''
+config_host_data.set('CONFIG_SIGNALFD', cc.links(gnu_source_prefix + '''
#include <unistd.h>
#include <sys/syscall.h>
#include <signal.h>
int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); }'''))
-config_host_data.set('CONFIG_SPLICE', cc.compiles(gnu_source_prefix + '''
+config_host_data.set('CONFIG_SPLICE', cc.links(gnu_source_prefix + '''
#include <unistd.h>
#include <fcntl.h>
#include <limits.h>
@@ -1530,6 +1536,11 @@ foreach target : target_dirs
elif sym == 'CONFIG_XEN' and have_xen_pci_passthrough
config_target += { 'CONFIG_XEN_PCI_PASSTHROUGH': 'y' }
endif
+ if target in modular_tcg
+ config_target += { 'CONFIG_TCG_MODULAR': 'y' }
+ else
+ config_target += { 'CONFIG_TCG_BUILTIN': 'y' }
+ endif
accel_kconfig += [ sym + '=y' ]
endif
endforeach
@@ -1541,7 +1552,7 @@ foreach target : target_dirs
endif
actual_target_dirs += target
- config_target += keyval.load('default-configs/targets' / target + '.mak')
+ config_target += keyval.load('configs/targets' / target + '.mak')
config_target += { 'TARGET_' + config_target['TARGET_ARCH'].to_upper(): 'y' }
if 'TARGET_NEED_FDT' in config_target
@@ -1587,16 +1598,18 @@ foreach target : target_dirs
configuration: config_target_data)}
if target.endswith('-softmmu')
+ config_input = meson.get_external_property(target, 'default')
config_devices_mak = target + '-config-devices.mak'
config_devices_mak = configure_file(
- input: ['default-configs/devices' / target + '.mak', 'Kconfig'],
+ input: ['configs/devices' / target / config_input + '.mak', 'Kconfig'],
output: config_devices_mak,
depfile: config_devices_mak + '.d',
capture: true,
command: [minikconf,
get_option('default_devices') ? '--defconfig' : '--allnoconfig',
config_devices_mak, '@DEPFILE@', '@INPUT@',
- host_kconfig, accel_kconfig])
+ host_kconfig, accel_kconfig,
+ 'CONFIG_' + config_target['TARGET_ARCH'].to_upper() + '=y'])
config_devices_data = configuration_data()
config_devices = keyval.load(config_devices_mak)
@@ -1999,7 +2012,12 @@ trace_ss = ss.source_set()
user_ss = ss.source_set()
util_ss = ss.source_set()
+# accel modules
+qtest_module_ss = ss.source_set()
+tcg_module_ss = ss.source_set()
+
modules = {}
+target_modules = {}
hw_arch = {}
target_arch = {}
target_softmmu_arch = {}
@@ -2236,10 +2254,21 @@ specific_ss.add_all(when: 'CONFIG_LINUX_USER', if_true: linux_user_ss)
subdir('tests/qtest/libqos')
subdir('tests/qtest/fuzz')
+# accel modules
+tcg_real_module_ss = ss.source_set()
+tcg_real_module_ss.add_all(when: 'CONFIG_TCG_MODULAR', if_true: tcg_module_ss)
+specific_ss.add_all(when: 'CONFIG_TCG_BUILTIN', if_true: tcg_module_ss)
+target_modules += { 'accel' : { 'qtest': qtest_module_ss,
+ 'tcg': tcg_real_module_ss }}
+
########################
# Library dependencies #
########################
+modinfo_collect = find_program('scripts/modinfo-collect.py')
+modinfo_generate = find_program('scripts/modinfo-generate.py')
+modinfo_files = []
+
block_mods = []
softmmu_mods = []
foreach d, list : modules
@@ -2253,6 +2282,18 @@ foreach d, list : modules
else
softmmu_mods += sl
endif
+ if module_ss.sources() != []
+ # FIXME: Should use sl.extract_all_objects(recursive: true) as
+ # input. Sources can be used multiple times but objects are
+ # unique when it comes to lookup in compile_commands.json.
+ # Depnds on a mesion version with
+ # https://github.com/mesonbuild/meson/pull/8900
+ modinfo_files += custom_target(d + '-' + m + '.modinfo',
+ output: d + '-' + m + '.modinfo',
+ input: module_ss.sources(),
+ capture: true,
+ command: [modinfo_collect, '@INPUT@'])
+ endif
else
if d == 'block'
block_ss.add_all(module_ss)
@@ -2263,6 +2304,53 @@ foreach d, list : modules
endforeach
endforeach
+foreach d, list : target_modules
+ foreach m, module_ss : list
+ if enable_modules and targetos != 'windows'
+ foreach target : target_dirs
+ if target.endswith('-softmmu')
+ config_target = config_target_mak[target]
+ config_target += config_host
+ target_inc = [include_directories('target' / config_target['TARGET_BASE_ARCH'])]
+ c_args = ['-DNEED_CPU_H',
+ '-DCONFIG_TARGET="@0@-config-target.h"'.format(target),
+ '-DCONFIG_DEVICES="@0@-config-devices.h"'.format(target)]
+ target_module_ss = module_ss.apply(config_target, strict: false)
+ if target_module_ss.sources() != []
+ module_name = d + '-' + m + '-' + config_target['TARGET_NAME']
+ sl = static_library(module_name,
+ [genh, target_module_ss.sources()],
+ dependencies: [modulecommon, target_module_ss.dependencies()],
+ include_directories: target_inc,
+ c_args: c_args,
+ pic: true)
+ softmmu_mods += sl
+ # FIXME: Should use sl.extract_all_objects(recursive: true) too.
+ modinfo_files += custom_target(module_name + '.modinfo',
+ output: module_name + '.modinfo',
+ input: target_module_ss.sources(),
+ capture: true,
+ command: [modinfo_collect, '--target', target, '@INPUT@'])
+ endif
+ endif
+ endforeach
+ else
+ specific_ss.add_all(module_ss)
+ endif
+ endforeach
+endforeach
+
+if enable_modules
+ modinfo_src = custom_target('modinfo.c',
+ output: 'modinfo.c',
+ input: modinfo_files,
+ command: [modinfo_generate, '@INPUT@'],
+ capture: true)
+ modinfo_lib = static_library('modinfo', modinfo_src)
+ modinfo_dep = declare_dependency(link_whole: modinfo_lib)
+ softmmu_ss.add(modinfo_dep)
+endif
+
nm = find_program('nm')
undefsym = find_program('scripts/undefsym.py')
block_syms = custom_target('block.syms', output: 'block.syms',
@@ -2524,28 +2612,32 @@ foreach target : target_dirs
link_args: link_args,
gui_app: exe['gui'])
- if 'CONFIG_HVF' in config_target
- entitlements = meson.current_source_dir() / 'accel/hvf/entitlements.plist'
- else
- entitlements = '/dev/null'
- endif
if targetos == 'darwin'
- icon = meson.current_source_dir() / 'pc-bios/qemu.rsrc'
+ icon = 'pc-bios/qemu.rsrc'
+ build_input = [emulator, files(icon)]
+ install_input = [
+ get_option('bindir') / exe_name,
+ meson.current_source_dir() / icon
+ ]
+ if 'CONFIG_HVF' in config_target
+ entitlements = 'accel/hvf/entitlements.plist'
+ build_input += files(entitlements)
+ install_input += meson.current_source_dir() / entitlements
+ endif
+
emulators += {exe['name'] : custom_target(exe['name'],
- depends: emulator,
+ input: build_input,
output: exe['name'],
command: [
- meson.current_source_dir() / 'scripts/entitlement.sh',
- meson.current_build_dir() / exe_name,
- meson.current_build_dir() / exe['name'],
- entitlements, icon
+ files('scripts/entitlement.sh'),
+ '@OUTPUT@',
+ '@INPUT@'
])
}
meson.add_install_script('scripts/entitlement.sh', '--install',
- get_option('bindir') / exe_name,
get_option('bindir') / exe['name'],
- entitlements, icon)
+ install_input)
else
emulators += {exe['name']: emulator}
endif
diff --git a/monitor/hmp.c b/monitor/hmp.c
index 6c0b33a0b1..d50c3124e1 100644
--- a/monitor/hmp.c
+++ b/monitor/hmp.c
@@ -1089,6 +1089,13 @@ void handle_hmp_command(MonitorHMP *mon, const char *cmdline)
return;
}
+ if (!cmd->cmd) {
+ /* FIXME: is it useful to try autoload modules here ??? */
+ monitor_printf(&mon->common, "Command \"%.*s\" is not available.\n",
+ (int)(cmdline - cmd_start), cmd_start);
+ return;
+ }
+
qdict = monitor_parse_arguments(&mon->common, &cmdline, cmd);
if (!qdict) {
while (cmdline > cmd_start && qemu_isspace(cmdline[-1])) {
diff --git a/monitor/misc.c b/monitor/misc.c
index 1539e18557..b28874d6dc 100644
--- a/monitor/misc.c
+++ b/monitor/misc.c
@@ -320,24 +320,6 @@ static void hmp_info_registers(Monitor *mon, const QDict *qdict)
}
}
-#ifdef CONFIG_TCG
-static void hmp_info_jit(Monitor *mon, const QDict *qdict)
-{
- if (!tcg_enabled()) {
- error_report("JIT information is only available with accel=tcg");
- return;
- }
-
- dump_exec_info();
- dump_drift_info();
-}
-
-static void hmp_info_opcount(Monitor *mon, const QDict *qdict)
-{
- dump_opcount_info();
-}
-#endif
-
static void hmp_info_sync_profile(Monitor *mon, const QDict *qdict)
{
int64_t max = qdict_get_try_int(qdict, "max", 10);
@@ -1974,6 +1956,22 @@ static void sortcmdlist(void)
compare_mon_cmd);
}
+void monitor_register_hmp(const char *name, bool info,
+ void (*cmd)(Monitor *mon, const QDict *qdict))
+{
+ HMPCommand *table = info ? hmp_info_cmds : hmp_cmds;
+
+ while (table->name != NULL) {
+ if (strcmp(table->name, name) == 0) {
+ g_assert(table->cmd == NULL);
+ table->cmd = cmd;
+ return;
+ }
+ table++;
+ }
+ g_assert_not_reached();
+}
+
void monitor_init_globals(void)
{
monitor_init_globals_core();
diff --git a/scripts/entitlement.sh b/scripts/entitlement.sh
index d2a7079ce3..e2c956a3ac 100755
--- a/scripts/entitlement.sh
+++ b/scripts/entitlement.sh
@@ -8,10 +8,10 @@ if [ "$1" = --install ]; then
in_place=false
fi
-SRC="$1"
-DST="$2"
-ENTITLEMENT="$3"
-ICON="$4"
+DST="$1"
+SRC="$2"
+ICON="$3"
+ENTITLEMENT="$4"
if $in_place; then
trap 'rm "$DST.tmp"' exit
@@ -21,7 +21,7 @@ else
cd "$MESON_INSTALL_DESTDIR_PREFIX"
fi
-if test "$ENTITLEMENT" != '/dev/null'; then
+if test -n "$ENTITLEMENT"; then
codesign --entitlements "$ENTITLEMENT" --force -s - "$SRC"
fi
diff --git a/scripts/modinfo-collect.py b/scripts/modinfo-collect.py
new file mode 100755
index 0000000000..4acb188c3e
--- /dev/null
+++ b/scripts/modinfo-collect.py
@@ -0,0 +1,67 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+import os
+import sys
+import json
+import shlex
+import subprocess
+
+def find_command(src, target, compile_commands):
+ for command in compile_commands:
+ if command['file'] != src:
+ continue
+ if target != '' and command['command'].find(target) == -1:
+ continue
+ return command['command']
+ return 'false'
+
+def process_command(src, command):
+ skip = False
+ arg = False
+ out = []
+ for item in shlex.split(command):
+ if arg:
+ out.append(x)
+ arg = False
+ continue
+ if skip:
+ skip = False
+ continue
+ if item == '-MF' or item == '-MQ' or item == '-o':
+ skip = True
+ continue
+ if item == '-c':
+ skip = True
+ continue
+ out.append(item)
+ out.append('-DQEMU_MODINFO')
+ out.append('-E')
+ out.append(src)
+ return out
+
+def main(args):
+ target = ''
+ if args[0] == '--target':
+ args.pop(0)
+ target = args.pop(0)
+ print("MODINFO_DEBUG target %s" % target)
+ arch = target[:-8] # cut '-softmmu'
+ print("MODINFO_START arch \"%s\" MODINFO_END" % arch)
+ with open('compile_commands.json') as f:
+ compile_commands = json.load(f)
+ for src in args:
+ print("MODINFO_DEBUG src %s" % src)
+ command = find_command(src, target, compile_commands)
+ cmdline = process_command(src, command)
+ print("MODINFO_DEBUG cmd", cmdline)
+ result = subprocess.run(cmdline, stdout = subprocess.PIPE,
+ universal_newlines = True)
+ if result.returncode != 0:
+ sys.exit(result.returncode)
+ for line in result.stdout.split('\n'):
+ if line.find('MODINFO') != -1:
+ print(line)
+
+if __name__ == "__main__":
+ main(sys.argv[1:])
diff --git a/scripts/modinfo-generate.py b/scripts/modinfo-generate.py
new file mode 100755
index 0000000000..f559eed007
--- /dev/null
+++ b/scripts/modinfo-generate.py
@@ -0,0 +1,97 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+import os
+import sys
+
+def print_array(name, values):
+ if len(values) == 0:
+ return
+ list = ", ".join(values)
+ print(" .%s = ((const char*[]){ %s, NULL })," % (name, list))
+
+def parse_line(line):
+ kind = ""
+ data = ""
+ get_kind = False
+ get_data = False
+ for item in line.split():
+ if item == "MODINFO_START":
+ get_kind = True
+ continue
+ if item.startswith("MODINFO_END"):
+ get_data = False
+ continue
+ if get_kind:
+ kind = item
+ get_kind = False
+ get_data = True
+ continue
+ if get_data:
+ data += " " + item
+ continue
+ return (kind, data)
+
+def generate(name, lines):
+ arch = ""
+ objs = []
+ deps = []
+ opts = []
+ for line in lines:
+ if line.find("MODINFO_START") != -1:
+ (kind, data) = parse_line(line)
+ if kind == 'obj':
+ objs.append(data)
+ elif kind == 'dep':
+ deps.append(data)
+ elif kind == 'opts':
+ opts.append(data)
+ elif kind == 'arch':
+ arch = data;
+ else:
+ print("unknown:", kind)
+ exit(1)
+
+ print(" .name = \"%s\"," % name)
+ if arch != "":
+ print(" .arch = %s," % arch)
+ print_array("objs", objs)
+ print_array("deps", deps)
+ print_array("opts", opts)
+ print("},{");
+ return deps
+
+def print_pre():
+ print("/* generated by scripts/modinfo-generate.py */")
+ print("#include \"qemu/osdep.h\"")
+ print("#include \"qemu/module.h\"")
+ print("const QemuModinfo qemu_modinfo[] = {{")
+
+def print_post():
+ print(" /* end of list */")
+ print("}};")
+
+def main(args):
+ deps = {}
+ print_pre()
+ for modinfo in args:
+ with open(modinfo) as f:
+ lines = f.readlines()
+ print(" /* %s */" % modinfo)
+ (basename, ext) = os.path.splitext(modinfo)
+ deps[basename] = generate(basename, lines)
+ print_post()
+
+ flattened_deps = {flat.strip('" ') for dep in deps.values() for flat in dep}
+ error = False
+ for dep in flattened_deps:
+ if dep not in deps.keys():
+ print("Dependency {} cannot be satisfied".format(dep),
+ file=sys.stderr)
+ error = True
+
+ if error:
+ exit(1)
+
+if __name__ == "__main__":
+ main(sys.argv[1:])
diff --git a/softmmu/vl.c b/softmmu/vl.c
index a50c8575a1..4df1496101 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -126,6 +126,8 @@
#include "sysemu/iothread.h"
#include "qemu/guest-random.h"
+#include "config-host.h"
+
#define MAX_VIRTIO_CONSOLES 1
typedef struct BlockdevOptionsQueueEntry {
@@ -2191,12 +2193,17 @@ static void qemu_parse_config_group(const char *group, QDict *qdict,
if (!crumpled) {
return;
}
- if (qobject_type(crumpled) != QTYPE_QDICT) {
- assert(qobject_type(crumpled) == QTYPE_QLIST);
+ switch (qobject_type(crumpled)) {
+ case QTYPE_QDICT:
+ qemu_record_config_group(group, qobject_to(QDict, crumpled), false, errp);
+ break;
+ case QTYPE_QLIST:
error_setg(errp, "Lists cannot be at top level of a configuration section");
- return;
+ break;
+ default:
+ g_assert_not_reached();
}
- qemu_record_config_group(group, qobject_to(QDict, crumpled), false, errp);
+ qobject_unref(crumpled);
}
static void qemu_read_default_config_file(Error **errp)
@@ -2691,23 +2698,6 @@ void qmp_x_exit_preconfig(Error **errp)
}
}
-#ifdef CONFIG_MODULES
-void qemu_load_module_for_opts(const char *group)
-{
- static bool spice_tried;
- if (g_str_equal(group, "spice") && !spice_tried) {
- ui_module_load_one("spice-core");
- spice_tried = true;
- }
-
- static bool iscsi_tried;
- if (g_str_equal(group, "iscsi") && !iscsi_tried) {
- block_module_load_one("iscsi");
- iscsi_tried = true;
- }
-}
-#endif
-
void qemu_init(int argc, char **argv, char **envp)
{
QemuOpts *opts;
@@ -2755,6 +2745,11 @@ void qemu_init(int argc, char **argv, char **envp)
error_init(argv[0]);
qemu_init_exec_dir(argv[0]);
+#ifdef CONFIG_MODULES
+ module_init_info(qemu_modinfo);
+ module_allow_arch(TARGET_NAME);
+#endif
+
qemu_init_subsystems();
/* first pass of option parsing */
diff --git a/stubs/module-opts.c b/stubs/module-opts.c
index a7d0e4ad6e..5412429ea8 100644
--- a/stubs/module-opts.c
+++ b/stubs/module-opts.c
@@ -1,6 +1,2 @@
#include "qemu/osdep.h"
#include "qemu/config-file.h"
-
-void qemu_load_module_for_opts(const char *group)
-{
-}
diff --git a/target/Kconfig b/target/Kconfig
new file mode 100644
index 0000000000..ae7f24fc66
--- /dev/null
+++ b/target/Kconfig
@@ -0,0 +1,19 @@
+source alpha/Kconfig
+source arm/Kconfig
+source avr/Kconfig
+source cris/Kconfig
+source hppa/Kconfig
+source i386/Kconfig
+source m68k/Kconfig
+source microblaze/Kconfig
+source mips/Kconfig
+source nios2/Kconfig
+source openrisc/Kconfig
+source ppc/Kconfig
+source riscv/Kconfig
+source rx/Kconfig
+source s390x/Kconfig
+source sh4/Kconfig
+source sparc/Kconfig
+source tricore/Kconfig
+source xtensa/Kconfig
diff --git a/target/alpha/Kconfig b/target/alpha/Kconfig
new file mode 100644
index 0000000000..267222c05b
--- /dev/null
+++ b/target/alpha/Kconfig
@@ -0,0 +1,2 @@
+config ALPHA
+ bool
diff --git a/target/arm/Kconfig b/target/arm/Kconfig
new file mode 100644
index 0000000000..3f3394a22b
--- /dev/null
+++ b/target/arm/Kconfig
@@ -0,0 +1,6 @@
+config ARM
+ bool
+
+config AARCH64
+ bool
+ select ARM
diff --git a/target/avr/Kconfig b/target/avr/Kconfig
new file mode 100644
index 0000000000..155592d353
--- /dev/null
+++ b/target/avr/Kconfig
@@ -0,0 +1,2 @@
+config AVR
+ bool
diff --git a/target/cris/Kconfig b/target/cris/Kconfig
new file mode 100644
index 0000000000..3fdc309fbb
--- /dev/null
+++ b/target/cris/Kconfig
@@ -0,0 +1,2 @@
+config CRIS
+ bool
diff --git a/target/hppa/Kconfig b/target/hppa/Kconfig
new file mode 100644
index 0000000000..395a35d799
--- /dev/null
+++ b/target/hppa/Kconfig
@@ -0,0 +1,2 @@
+config HPPA
+ bool
diff --git a/target/i386/Kconfig b/target/i386/Kconfig
new file mode 100644
index 0000000000..ce6968906e
--- /dev/null
+++ b/target/i386/Kconfig
@@ -0,0 +1,5 @@
+config I386
+ bool
+
+config X86_64
+ bool
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 0f7ddbfeae..8f3747dd28 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -268,6 +268,8 @@ typedef enum X86Seg {
#define DR7_TYPE_IO_RW 0x2
#define DR7_TYPE_DATA_RW 0x3
+#define DR_RESERVED_MASK 0xffffffff00000000ULL
+
#define PG_PRESENT_BIT 0
#define PG_RW_BIT 1
#define PG_USER_BIT 2
diff --git a/target/i386/helper.h b/target/i386/helper.h
index f3d8c3f949..574ff75615 100644
--- a/target/i386/helper.h
+++ b/target/i386/helper.h
@@ -46,9 +46,8 @@ DEF_HELPER_1(clts, void, env)
#ifndef CONFIG_USER_ONLY
DEF_HELPER_FLAGS_3(set_dr, TCG_CALL_NO_WG, void, env, int, tl)
-#endif /* !CONFIG_USER_ONLY */
-
DEF_HELPER_FLAGS_2(get_dr, TCG_CALL_NO_WG, tl, env, int)
+#endif /* !CONFIG_USER_ONLY */
DEF_HELPER_1(sysenter, void, env)
DEF_HELPER_2(sysexit, void, env, int)
diff --git a/target/i386/svm.h b/target/i386/svm.h
index 5098733053..adc058dc76 100644
--- a/target/i386/svm.h
+++ b/target/i386/svm.h
@@ -137,6 +137,9 @@
#define SVM_CR0_RESERVED_MASK 0xffffffff00000000U
+#define SVM_MSRPM_SIZE (1ULL << 13)
+#define SVM_IOPM_SIZE ((1ULL << 13) + 1)
+
struct QEMU_PACKED vmcb_control_area {
uint16_t intercept_cr_read;
uint16_t intercept_cr_write;
diff --git a/target/i386/tcg/bpt_helper.c b/target/i386/tcg/bpt_helper.c
index 83cd89581e..b6c1fff16e 100644
--- a/target/i386/tcg/bpt_helper.c
+++ b/target/i386/tcg/bpt_helper.c
@@ -37,24 +37,3 @@ void helper_rechecking_single_step(CPUX86State *env)
helper_single_step(env);
}
}
-
-target_ulong helper_get_dr(CPUX86State *env, int reg)
-{
- switch (reg) {
- case 0: case 1: case 2: case 3: case 6: case 7:
- return env->dr[reg];
- case 4:
- if (env->cr[4] & CR4_DE_MASK) {
- break;
- } else {
- return env->dr[6];
- }
- case 5:
- if (env->cr[4] & CR4_DE_MASK) {
- break;
- } else {
- return env->dr[7];
- }
- }
- raise_exception_err_ra(env, EXCP06_ILLOP, 0, GETPC());
-}
diff --git a/target/i386/tcg/sysemu/bpt_helper.c b/target/i386/tcg/sysemu/bpt_helper.c
index 9bdf7e170b..805118c6b5 100644
--- a/target/i386/tcg/sysemu/bpt_helper.c
+++ b/target/i386/tcg/sysemu/bpt_helper.c
@@ -234,10 +234,30 @@ void breakpoint_handler(CPUState *cs)
}
}
+target_ulong helper_get_dr(CPUX86State *env, int reg)
+{
+ if (reg >= 4 && reg < 6) {
+ if (env->cr[4] & CR4_DE_MASK) {
+ raise_exception_ra(env, EXCP06_ILLOP, GETPC());
+ } else {
+ reg += 2;
+ }
+ }
+
+ return env->dr[reg];
+}
+
void helper_set_dr(CPUX86State *env, int reg, target_ulong t0)
{
- switch (reg) {
- case 0: case 1: case 2: case 3:
+ if (reg >= 4 && reg < 6) {
+ if (env->cr[4] & CR4_DE_MASK) {
+ raise_exception_ra(env, EXCP06_ILLOP, GETPC());
+ } else {
+ reg += 2;
+ }
+ }
+
+ if (reg < 4) {
if (hw_breakpoint_enabled(env->dr[7], reg)
&& hw_breakpoint_type(env->dr[7], reg) != DR7_TYPE_IO_RW) {
hw_breakpoint_remove(env, reg);
@@ -246,25 +266,16 @@ void helper_set_dr(CPUX86State *env, int reg, target_ulong t0)
} else {
env->dr[reg] = t0;
}
- return;
- case 4:
- if (env->cr[4] & CR4_DE_MASK) {
- break;
+ } else {
+ if (t0 & DR_RESERVED_MASK) {
+ raise_exception_err_ra(env, EXCP0D_GPF, 0, GETPC());
}
- /* fallthru */
- case 6:
- env->dr[6] = t0 | DR6_FIXED_1;
- return;
- case 5:
- if (env->cr[4] & CR4_DE_MASK) {
- break;
+ if (reg == 6) {
+ env->dr[6] = t0 | DR6_FIXED_1;
+ } else {
+ cpu_x86_update_dr7(env, t0);
}
- /* fallthru */
- case 7:
- cpu_x86_update_dr7(env, t0);
- return;
}
- raise_exception_err_ra(env, EXCP06_ILLOP, 0, GETPC());
}
/* Check if Port I/O is trapped by a breakpoint. */
diff --git a/target/i386/tcg/sysemu/svm_helper.c b/target/i386/tcg/sysemu/svm_helper.c
index 1c2dbc1862..00618cff23 100644
--- a/target/i386/tcg/sysemu/svm_helper.c
+++ b/target/i386/tcg/sysemu/svm_helper.c
@@ -68,6 +68,7 @@ static inline void svm_load_seg_cache(CPUX86State *env, hwaddr addr,
void helper_vmrun(CPUX86State *env, int aflag, int next_eip_addend)
{
CPUState *cs = env_cpu(env);
+ X86CPU *cpu = env_archcpu(env);
target_ulong addr;
uint64_t nested_ctl;
uint32_t event_inj;
@@ -159,6 +160,20 @@ void helper_vmrun(CPUX86State *env, int aflag, int next_eip_addend)
asid = x86_ldq_phys(cs, env->vm_vmcb + offsetof(struct vmcb,
control.asid));
+ uint64_t msrpm_base_pa = x86_ldq_phys(cs, env->vm_vmcb +
+ offsetof(struct vmcb,
+ control.msrpm_base_pa));
+ uint64_t iopm_base_pa = x86_ldq_phys(cs, env->vm_vmcb +
+ offsetof(struct vmcb, control.iopm_base_pa));
+
+ if ((msrpm_base_pa & ~0xfff) >= (1ull << cpu->phys_bits) - SVM_MSRPM_SIZE) {
+ cpu_vmexit(env, SVM_EXIT_ERR, 0, GETPC());
+ }
+
+ if ((iopm_base_pa & ~0xfff) >= (1ull << cpu->phys_bits) - SVM_IOPM_SIZE) {
+ cpu_vmexit(env, SVM_EXIT_ERR, 0, GETPC());
+ }
+
env->nested_pg_mode = 0;
if (!cpu_svm_has_intercept(env, SVM_EXIT_VMRUN)) {
@@ -254,7 +269,14 @@ void helper_vmrun(CPUX86State *env, int aflag, int next_eip_addend)
env->dr[6] = x86_ldq_phys(cs,
env->vm_vmcb + offsetof(struct vmcb, save.dr6));
- /* FIXME: guest state consistency checks */
+#ifdef TARGET_X86_64
+ if (env->dr[6] & DR_RESERVED_MASK) {
+ cpu_vmexit(env, SVM_EXIT_ERR, 0, GETPC());
+ }
+ if (env->dr[7] & DR_RESERVED_MASK) {
+ cpu_vmexit(env, SVM_EXIT_ERR, 0, GETPC());
+ }
+#endif
switch (x86_ldub_phys(cs,
env->vm_vmcb + offsetof(struct vmcb, control.tlb_ctl))) {
diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
index b21873ed23..9e445b9bf0 100644
--- a/target/i386/tcg/translate.c
+++ b/target/i386/tcg/translate.c
@@ -206,6 +206,7 @@ STUB_HELPER(outw, TCGv_env env, TCGv_i32 port, TCGv_i32 val)
STUB_HELPER(outl, TCGv_env env, TCGv_i32 port, TCGv_i32 val)
STUB_HELPER(rdmsr, TCGv_env env)
STUB_HELPER(read_crN, TCGv ret, TCGv_env env, TCGv_i32 reg)
+STUB_HELPER(get_dr, TCGv ret, TCGv_env env, TCGv_i32 reg)
STUB_HELPER(set_dr, TCGv_env env, TCGv_i32 reg, TCGv val)
STUB_HELPER(stgi, TCGv_env env)
STUB_HELPER(svm_check_intercept, TCGv_env env, TCGv_i32 type)
diff --git a/target/m68k/Kconfig b/target/m68k/Kconfig
new file mode 100644
index 0000000000..23debad519
--- /dev/null
+++ b/target/m68k/Kconfig
@@ -0,0 +1,2 @@
+config M68K
+ bool
diff --git a/target/microblaze/Kconfig b/target/microblaze/Kconfig
new file mode 100644
index 0000000000..a5410d9218
--- /dev/null
+++ b/target/microblaze/Kconfig
@@ -0,0 +1,2 @@
+config MICROBLAZE
+ bool
diff --git a/target/mips/Kconfig b/target/mips/Kconfig
new file mode 100644
index 0000000000..6adf145354
--- /dev/null
+++ b/target/mips/Kconfig
@@ -0,0 +1,6 @@
+config MIPS
+ bool
+
+config MIPS64
+ bool
+ select MIPS
diff --git a/target/nios2/Kconfig b/target/nios2/Kconfig
new file mode 100644
index 0000000000..1529ab8950
--- /dev/null
+++ b/target/nios2/Kconfig
@@ -0,0 +1,2 @@
+config NIOS2
+ bool
diff --git a/target/openrisc/Kconfig b/target/openrisc/Kconfig
new file mode 100644
index 0000000000..e0da4ac1df
--- /dev/null
+++ b/target/openrisc/Kconfig
@@ -0,0 +1,2 @@
+config OPENRISC
+ bool
diff --git a/target/ppc/Kconfig b/target/ppc/Kconfig
new file mode 100644
index 0000000000..3ff152051a
--- /dev/null
+++ b/target/ppc/Kconfig
@@ -0,0 +1,5 @@
+config PPC
+ bool
+
+config PPC64
+ bool
diff --git a/target/riscv/Kconfig b/target/riscv/Kconfig
new file mode 100644
index 0000000000..b9e5932f13
--- /dev/null
+++ b/target/riscv/Kconfig
@@ -0,0 +1,5 @@
+config RISCV32
+ bool
+
+config RISCV64
+ bool
diff --git a/target/rx/Kconfig b/target/rx/Kconfig
new file mode 100644
index 0000000000..aceb5ed28f
--- /dev/null
+++ b/target/rx/Kconfig
@@ -0,0 +1,2 @@
+config RX
+ bool
diff --git a/target/s390x/Kconfig b/target/s390x/Kconfig
new file mode 100644
index 0000000000..72da48136c
--- /dev/null
+++ b/target/s390x/Kconfig
@@ -0,0 +1,2 @@
+config S390X
+ bool
diff --git a/target/sh4/Kconfig b/target/sh4/Kconfig
new file mode 100644
index 0000000000..2397c86028
--- /dev/null
+++ b/target/sh4/Kconfig
@@ -0,0 +1,2 @@
+config SH4
+ bool
diff --git a/target/sparc/Kconfig b/target/sparc/Kconfig
new file mode 100644
index 0000000000..70cc0f3a21
--- /dev/null
+++ b/target/sparc/Kconfig
@@ -0,0 +1,5 @@
+config SPARC
+ bool
+
+config SPARC64
+ bool
diff --git a/target/tricore/Kconfig b/target/tricore/Kconfig
new file mode 100644
index 0000000000..9313409309
--- /dev/null
+++ b/target/tricore/Kconfig
@@ -0,0 +1,2 @@
+config TRICORE
+ bool
diff --git a/target/xtensa/Kconfig b/target/xtensa/Kconfig
new file mode 100644
index 0000000000..a3c8dc7f6d
--- /dev/null
+++ b/target/xtensa/Kconfig
@@ -0,0 +1,2 @@
+config XTENSA
+ bool
diff --git a/tests/Makefile.include b/tests/Makefile.include
index 8f220e15d1..e4dcb17329 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -36,7 +36,7 @@ export SRC_PATH
# Get the list of all supported sysemu targets
SYSEMU_TARGET_LIST := $(subst -softmmu.mak,,$(notdir \
- $(wildcard $(SRC_PATH)/default-configs/*-softmmu.mak)))
+ $(wildcard $(SRC_PATH)/configs/*-softmmu.mak)))
SPEED = quick
diff --git a/ui/egl-headless.c b/ui/egl-headless.c
index da377a74af..75404e0e87 100644
--- a/ui/egl-headless.c
+++ b/ui/egl-headless.c
@@ -213,3 +213,7 @@ static void register_egl(void)
}
type_init(register_egl);
+
+#ifdef CONFIG_OPENGL
+module_dep("ui-opengl");
+#endif
diff --git a/ui/gtk.c b/ui/gtk.c
index 98046f577b..376b4d528d 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -2333,3 +2333,7 @@ static void register_gtk(void)
}
type_init(register_gtk);
+
+#ifdef CONFIG_OPENGL
+module_dep("ui-opengl");
+#endif
diff --git a/ui/sdl2.c b/ui/sdl2.c
index a203cb0239..36d9010cb6 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -918,3 +918,7 @@ static void register_sdl1(void)
}
type_init(register_sdl1);
+
+#ifdef CONFIG_OPENGL
+module_dep("ui-opengl");
+#endif
diff --git a/ui/spice-app.c b/ui/spice-app.c
index 4325ac2d9c..641f4a9d53 100644
--- a/ui/spice-app.c
+++ b/ui/spice-app.c
@@ -221,3 +221,6 @@ static void register_spice_app(void)
}
type_init(register_spice_app);
+
+module_dep("ui-spice-core");
+module_dep("chardev-spice");
diff --git a/ui/spice-core.c b/ui/spice-core.c
index 272d19b0c1..86d43783ac 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -1037,3 +1037,8 @@ static void spice_register_config(void)
qemu_add_opts(&qemu_spice_opts);
}
opts_init(spice_register_config);
+module_opts("spice");
+
+#ifdef CONFIG_OPENGL
+module_dep("ui-opengl");
+#endif
diff --git a/util/meson.build b/util/meson.build
index 0ffd7f4bde..779f413c86 100644
--- a/util/meson.build
+++ b/util/meson.build
@@ -5,7 +5,7 @@ util_ss.add(when: 'CONFIG_POSIX', if_true: files('fdmon-poll.c'))
if config_host_data.get('CONFIG_EPOLL_CREATE1')
util_ss.add(files('fdmon-epoll.c'))
endif
-util_ss.add(when: ['CONFIG_LINUX_IO_URING', linux_io_uring], if_true: files('fdmon-io_uring.c'))
+util_ss.add(when: linux_io_uring, if_true: files('fdmon-io_uring.c'))
util_ss.add(when: 'CONFIG_POSIX', if_true: files('compatfd.c'))
util_ss.add(when: 'CONFIG_POSIX', if_true: files('event_notifier-posix.c'))
util_ss.add(when: 'CONFIG_POSIX', if_true: files('mmap-alloc.c'))
diff --git a/util/module.c b/util/module.c
index eee8ff2de1..6bb4ad915a 100644
--- a/util/module.c
+++ b/util/module.c
@@ -20,9 +20,11 @@
#include "qemu/queue.h"
#include "qemu/module.h"
#include "qemu/cutils.h"
+#include "qemu/config-file.h"
#ifdef CONFIG_MODULE_UPGRADES
#include "qemu-version.h"
#endif
+#include "trace.h"
typedef struct ModuleEntry
{
@@ -110,6 +112,38 @@ void module_call_init(module_init_type type)
}
#ifdef CONFIG_MODULES
+
+static const QemuModinfo module_info_stub[] = { {
+ /* end of list */
+} };
+static const QemuModinfo *module_info = module_info_stub;
+static const char *module_arch;
+
+void module_init_info(const QemuModinfo *info)
+{
+ module_info = info;
+}
+
+void module_allow_arch(const char *arch)
+{
+ module_arch = arch;
+}
+
+static bool module_check_arch(const QemuModinfo *modinfo)
+{
+ if (modinfo->arch) {
+ if (!module_arch) {
+ /* no arch set -> ignore all */
+ return false;
+ }
+ if (strcmp(module_arch, modinfo->arch) != 0) {
+ /* mismatch */
+ return false;
+ }
+ }
+ return true;
+}
+
static int module_load_file(const char *fname, bool mayfail, bool export_symbols)
{
GModule *g_module;
@@ -164,6 +198,7 @@ static int module_load_file(const char *fname, bool mayfail, bool export_symbols
ret = 0;
}
+ trace_module_load_module(fname);
QTAILQ_FOREACH_SAFE(e, &dso_init_list, node, next) {
QTAILQ_REMOVE(&dso_init_list, e, node);
g_free(e);
@@ -171,28 +206,6 @@ static int module_load_file(const char *fname, bool mayfail, bool export_symbols
out:
return ret;
}
-
-static const struct {
- const char *name;
- const char *dep;
-} module_deps[] = {
- { "audio-spice", "ui-spice-core" },
- { "chardev-spice", "ui-spice-core" },
- { "hw-display-qxl", "ui-spice-core" },
- { "ui-spice-app", "ui-spice-core" },
- { "ui-spice-app", "chardev-spice" },
-
- { "hw-display-virtio-gpu-gl", "hw-display-virtio-gpu" },
- { "hw-display-virtio-gpu-pci-gl", "hw-display-virtio-gpu-pci" },
- { "hw-display-virtio-vga-gl", "hw-display-virtio-vga" },
-
-#ifdef CONFIG_OPENGL
- { "ui-egl-headless", "ui-opengl" },
- { "ui-gtk", "ui-opengl" },
- { "ui-sdl", "ui-opengl" },
- { "ui-spice-core", "ui-opengl" },
-#endif
-};
#endif
bool module_load_one(const char *prefix, const char *lib_name, bool mayfail)
@@ -208,9 +221,11 @@ bool module_load_one(const char *prefix, const char *lib_name, bool mayfail)
char *dirs[5];
char *module_name;
int i = 0, n_dirs = 0;
- int ret, dep;
+ int ret;
bool export_symbols = false;
static GHashTable *loaded_modules;
+ const QemuModinfo *modinfo;
+ const char **sl;
if (!g_module_supported()) {
fprintf(stderr, "Module is not supported by system.\n");
@@ -223,23 +238,37 @@ bool module_load_one(const char *prefix, const char *lib_name, bool mayfail)
module_name = g_strdup_printf("%s%s", prefix, lib_name);
- for (dep = 0; dep < ARRAY_SIZE(module_deps); dep++) {
- if (strcmp(module_name, module_deps[dep].name) == 0) {
- /* we depend on another module */
- module_load_one("", module_deps[dep].dep, false);
- }
- if (strcmp(module_name, module_deps[dep].dep) == 0) {
- /* another module depends on us */
- export_symbols = true;
- }
- }
-
if (g_hash_table_contains(loaded_modules, module_name)) {
g_free(module_name);
return true;
}
g_hash_table_add(loaded_modules, module_name);
+ for (modinfo = module_info; modinfo->name != NULL; modinfo++) {
+ if (modinfo->arch) {
+ if (strcmp(modinfo->name, module_name) == 0) {
+ if (!module_check_arch(modinfo)) {
+ return false;
+ }
+ }
+ }
+ if (modinfo->deps) {
+ if (strcmp(modinfo->name, module_name) == 0) {
+ /* we depend on other module(s) */
+ for (sl = modinfo->deps; *sl != NULL; sl++) {
+ module_load_one("", *sl, false);
+ }
+ } else {
+ for (sl = modinfo->deps; *sl != NULL; sl++) {
+ if (strcmp(module_name, *sl) == 0) {
+ /* another module depends on us */
+ export_symbols = true;
+ }
+ }
+ }
+ }
+ }
+
search_dir = getenv("QEMU_MODULE_DIR");
if (search_dir != NULL) {
dirs[n_dirs++] = g_strdup_printf("%s", search_dir);
@@ -282,80 +311,77 @@ bool module_load_one(const char *prefix, const char *lib_name, bool mayfail)
return success;
}
-/*
- * Building devices and other qom objects modular is mostly useful in
- * case they have dependencies to external shared libraries, so we can
- * cut down the core qemu library dependencies. Which is the case for
- * only a very few devices & objects.
- *
- * So with the expectation that this will be rather the exception than
- * the rule and the list will not gain that many entries, go with a
- * simple manually maintained list for now.
- *
- * The list must be sorted by module (module_load_qom_all() needs this).
- */
-static struct {
- const char *type;
- const char *prefix;
- const char *module;
-} const qom_modules[] = {
- { "ccid-card-passthru", "hw-", "usb-smartcard" },
- { "ccid-card-emulated", "hw-", "usb-smartcard" },
- { "usb-redir", "hw-", "usb-redirect" },
- { "qxl-vga", "hw-", "display-qxl" },
- { "qxl", "hw-", "display-qxl" },
- { "virtio-gpu-device", "hw-", "display-virtio-gpu" },
- { "virtio-gpu-gl-device", "hw-", "display-virtio-gpu-gl" },
- { "vhost-user-gpu", "hw-", "display-virtio-gpu" },
- { "virtio-gpu-pci-base", "hw-", "display-virtio-gpu-pci" },
- { "virtio-gpu-pci", "hw-", "display-virtio-gpu-pci" },
- { "virtio-gpu-gl-pci", "hw-", "display-virtio-gpu-pci-gl" },
- { "vhost-user-gpu-pci", "hw-", "display-virtio-gpu-pci" },
- { "virtio-gpu-ccw", "hw-", "s390x-virtio-gpu-ccw" },
- { "virtio-vga-base", "hw-", "display-virtio-vga" },
- { "virtio-vga", "hw-", "display-virtio-vga" },
- { "virtio-vga-gl", "hw-", "display-virtio-vga-gl" },
- { "vhost-user-vga", "hw-", "display-virtio-vga" },
- { "chardev-braille", "chardev-", "baum" },
- { "chardev-spicevmc", "chardev-", "spice" },
- { "chardev-spiceport", "chardev-", "spice" },
-};
+#ifdef CONFIG_MODULES
static bool module_loaded_qom_all;
void module_load_qom_one(const char *type)
{
- int i;
+ const QemuModinfo *modinfo;
+ const char **sl;
if (!type) {
return;
}
- for (i = 0; i < ARRAY_SIZE(qom_modules); i++) {
- if (strcmp(qom_modules[i].type, type) == 0) {
- module_load_one(qom_modules[i].prefix,
- qom_modules[i].module,
- false);
- return;
+
+ trace_module_lookup_object_type(type);
+ for (modinfo = module_info; modinfo->name != NULL; modinfo++) {
+ if (!modinfo->objs) {
+ continue;
+ }
+ if (!module_check_arch(modinfo)) {
+ continue;
+ }
+ for (sl = modinfo->objs; *sl != NULL; sl++) {
+ if (strcmp(type, *sl) == 0) {
+ module_load_one("", modinfo->name, false);
+ }
}
}
}
void module_load_qom_all(void)
{
- int i;
+ const QemuModinfo *modinfo;
if (module_loaded_qom_all) {
return;
}
- for (i = 0; i < ARRAY_SIZE(qom_modules); i++) {
- if (i > 0 && (strcmp(qom_modules[i - 1].module,
- qom_modules[i].module) == 0 &&
- strcmp(qom_modules[i - 1].prefix,
- qom_modules[i].prefix) == 0)) {
- /* one module implementing multiple types -> load only once */
+
+ for (modinfo = module_info; modinfo->name != NULL; modinfo++) {
+ if (!modinfo->objs) {
+ continue;
+ }
+ if (!module_check_arch(modinfo)) {
continue;
}
- module_load_one(qom_modules[i].prefix, qom_modules[i].module, true);
+ module_load_one("", modinfo->name, false);
}
module_loaded_qom_all = true;
}
+
+void qemu_load_module_for_opts(const char *group)
+{
+ const QemuModinfo *modinfo;
+ const char **sl;
+
+ for (modinfo = module_info; modinfo->name != NULL; modinfo++) {
+ if (!modinfo->opts) {
+ continue;
+ }
+ for (sl = modinfo->opts; *sl != NULL; sl++) {
+ if (strcmp(group, *sl) == 0) {
+ module_load_one("", modinfo->name, false);
+ }
+ }
+ }
+}
+
+#else
+
+void module_allow_arch(const char *arch) {}
+void qemu_load_module_for_opts(const char *group) {}
+void module_load_qom_one(const char *type) {}
+void module_load_qom_all(void) {}
+
+#endif
diff --git a/util/trace-events b/util/trace-events
index 806cac14a7..c8f53d7d9f 100644
--- a/util/trace-events
+++ b/util/trace-events
@@ -100,3 +100,7 @@ uffd_create_fd_api_failed(int err) "errno: %i"
uffd_create_fd_api_noioctl(uint64_t ioctl_req, uint64_t ioctl_supp) "ioctl_req: 0x%" PRIx64 "ioctl_supp: 0x%" PRIx64
uffd_register_memory_failed(void *addr, uint64_t length, uint64_t mode, int err) "addr: %p length: %" PRIu64 " mode: 0x%" PRIx64 " errno: %i"
uffd_unregister_memory_failed(void *addr, uint64_t length, int err) "addr: %p length: %" PRIu64 " errno: %i"
+
+# module.c
+module_load_module(const char *name) "file %s"
+module_lookup_object_type(const char *name) "name %s"