Skip to contentSkip to conversation

Misc patches for QEMU 6.1 soft freeze

GIT PULL Paolo Bonzini 4 participants 54 messages Jul 8, 2021 – Jul 23, 2021

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

The following changes since commit 9aef0954195cc592e86846dbbe7f3c2c5603690a:

Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging (2021-07-06 11:24:58 +0100)

are available in the Git repository at:

https://gitlab.com/bonzini/qemu.git tags/for-upstream

for you to fetch changes up to 81224eaca6675978489cd7c6172f17ca1f54b494:

configure: allow the selection of alternate config in the build (2021-07-08 14:01:52 +0200)

----------------------------------------------------------------
* More SVM fixes (Lara)
* Module annotation database (Gerd)
* Memory leak fixes (myself)
* Build fixes (myself)
* --with-devices-* support (Alex)

----------------------------------------------------------------
Alex Bennée (4):
hw/arm: add dependency on OR_IRQ for XLNX_VERSAL hw/arm: move CONFIG_V7M out of default-devices
configs: rename default-configs to configs and reorganise
configure: allow the selection of alternate config in the build

Gerd Hoffmann (33):
modules: add modinfo macros
modules: collect module meta-data
modules: generate modinfo.c
modules: add qxl module annotations
modules: add virtio-gpu module annotations
modules: add chardev module annotations
modules: add audio module annotations
modules: add usb-redir module annotations
modules: add ccid module annotations
modules: add ui module annotations
modules: add s390x module annotations
modules: add block module annotations
modules: use modinfo for dependencies
modules: use modinfo for qom load
modules: use modinfo for qemu opts load
modules: add tracepoints
modules: check arch and block load on mismatch
modules: check arch on qom lookup
modules: target-specific module build infrastructure
modules: add documentation for module sourcesets
modules: add module_obj() note to QOM docs
modules: module.h kerneldoc annotations
modules: hook up modules.h to docs build
accel: autoload modules
accel: add qtest module annotations
accel: build qtest modular
accel: add tcg module annotations
accel: build tcg modular
monitor: allow register hmp commands
usb: drop usb_host_dev_is_scsi_storage hook
monitor/usb: register 'info usbhost' dynamically
usb: build usb-host as module
monitor/tcg: move tcg hmp commands to accel/tcg, register them dynamically

Jose R. Ziviani (1):
modules: check if all dependencies can be satisfied

Lara Lazier (2):
target/i386: Added MSRPM and IOPM size check target/i386: Added DR6 and DR7 consistency checks

Miroslav Rezanina (2):
configure: fix libdaxctl options
configure: fix libpmem configuration option

Paolo Bonzini (5):
meson: fix missing preprocessor symbols
osdep: fix HAVE_BROKEN_SIZE_MAX case target/i386: fix exceptions for MOV to DR
vl: fix leak of qdict_crumple return value
meson: switch function tests from compilation to linking

Philippe Mathieu-Daudé (1):
meson: Introduce target-specific Kconfig

 Kconfig                                            |   1 +
 MAINTAINERS                                        |  22 ++-
 accel/accel-common.c                               |   2 +-
 accel/accel-softmmu.c                              |   2 +-
 accel/qtest/meson.build                            |   8 +-
 accel/qtest/qtest.c                                |   2 +
 accel/tcg/hmp.c                                    |  29 +++
 accel/tcg/meson.build                              |   6 +-
 accel/tcg/tcg-accel-ops.c                          |   1 +
 accel/tcg/tcg-all.c                                |   1 +
 audio/spiceaudio.c                                 |   2 +
 block/iscsi-opts.c                                 |   1 +
 chardev/baum.c                                     |   1 +
 chardev/spice.c                                    |   4 +
 .../devices/aarch64-softmmu/default.mak            |   2 +-
 configs/devices/aarch64-softmmu/minimal.mak        |   9 +
 .../devices/alpha-softmmu/default.mak              |   0
 .../devices/arm-softmmu/default.mak                |   3 -
 .../devices/avr-softmmu/default.mak                |   0
 .../devices/cris-softmmu/default.mak               |   0
 .../devices/hppa-softmmu/default.mak               |   0
 .../devices/i386-softmmu/default.mak               |   0
 .../devices/m68k-softmmu/default.mak               |   0
 .../devices/microblaze-softmmu/default.mak         |   0
 .../devices/microblazeel-softmmu/default.mak       |   2 +-
 .../devices/mips-softmmu/common.mak                |   0
 .../devices/mips-softmmu/default.mak               |   2 +-
 .../devices/mips64-softmmu/default.mak             |   2 +-
 .../devices/mips64el-softmmu/default.mak           |   2 +-
 .../devices/mipsel-softmmu/default.mak             |   2 +-
 .../devices/nios2-softmmu/default.mak              |   0
 .../devices/or1k-softmmu/default.mak               |   0
 .../devices/ppc-softmmu/default.mak                |   0
 .../devices/ppc64-softmmu/default.mak              |   2 +-
 .../devices/riscv32-softmmu/default.mak            |   0
 .../devices/riscv64-softmmu/default.mak            |   0
 .../devices/rx-softmmu/default.mak                 |   0
 .../devices/s390x-softmmu/default.mak              |   0
 .../devices/sh4-softmmu/default.mak                |   0
 .../devices/sh4eb-softmmu/default.mak              |   2 +-
 .../devices/sparc-softmmu/default.mak              |   0
 .../devices/sparc64-softmmu/default.mak            |   0
 .../devices/tricore-softmmu/default.mak            |   0
 .../devices/x86_64-softmmu/default.mak             |   2 +-
 .../devices/xtensa-softmmu/default.mak             |   0
 configs/devices/xtensaeb-softmmu/default.mak       |   3 +
 .../targets/aarch64-linux-user.mak                 |   0
 .../targets/aarch64-softmmu.mak                    |   0
 .../targets/aarch64_be-linux-user.mak              |   0
 .../targets/alpha-linux-user.mak                   |   0
 .../targets/alpha-softmmu.mak                      |   0
 .../targets/arm-linux-user.mak                     |   0
 .../targets/arm-softmmu.mak                        |   0
 .../targets/armeb-linux-user.mak                   |   0
 .../targets/avr-softmmu.mak                        |   0
 .../targets/cris-linux-user.mak                    |   0
 .../targets/cris-softmmu.mak                       |   0
 .../targets/hexagon-linux-user.mak                 |   0
 .../targets/hppa-linux-user.mak                    |   0
 .../targets/hppa-softmmu.mak                       |   0
 .../targets/i386-bsd-user.mak                      |   0
 .../targets/i386-linux-user.mak                    |   0
 .../targets/i386-softmmu.mak                       |   0
 .../targets/m68k-linux-user.mak                    |   0
 .../targets/m68k-softmmu.mak                       |   0
 .../targets/microblaze-linux-user.mak              |   0
 .../targets/microblaze-softmmu.mak                 |   0
 .../targets/microblazeel-linux-user.mak            |   0
 .../targets/microblazeel-softmmu.mak               |   0
 .../targets/mips-linux-user.mak                    |   0
 .../targets/mips-softmmu.mak                       |   0
 .../targets/mips64-linux-user.mak                  |   0
 .../targets/mips64-softmmu.mak                     |   0
 .../targets/mips64el-linux-user.mak                |   0
 .../targets/mips64el-softmmu.mak                   |   0
 .../targets/mipsel-linux-user.mak                  |   0
 .../targets/mipsel-softmmu.mak                     |   0
 .../targets/mipsn32-linux-user.mak                 |   0
 .../targets/mipsn32el-linux-user.mak               |   0
 .../targets/nios2-linux-user.mak                   |   0
 .../targets/nios2-softmmu.mak                      |   0
 .../targets/or1k-linux-user.mak                    |   0
 .../targets/or1k-softmmu.mak                       |   0
 .../targets/ppc-linux-user.mak                     |   0
 .../targets/ppc-softmmu.mak                        |   0
 .../targets/ppc64-linux-user.mak                   |   0
 .../targets/ppc64-softmmu.mak                      |   0
 .../targets/ppc64abi32-linux-user.mak              |   0
 .../targets/ppc64le-linux-user.mak                 |   0
 .../targets/riscv32-linux-user.mak                 |   0
 .../targets/riscv32-softmmu.mak                    |   0
 .../targets/riscv64-linux-user.mak                 |   0
 .../targets/riscv64-softmmu.mak                    |   0
 .../targets/rx-softmmu.mak                         |   0
 .../targets/s390x-linux-user.mak                   |   0
 .../targets/s390x-softmmu.mak                      |   0
 .../targets/sh4-linux-user.mak                     |   0
 .../targets/sh4-softmmu.mak                        |   0
 .../targets/sh4eb-linux-user.mak                   |   0
 .../targets/sh4eb-softmmu.mak                      |   0
 .../targets/sparc-linux-user.mak                   |   0
 .../targets/sparc-softmmu.mak                      |   0
 .../targets/sparc32plus-linux-user.mak             |   0
 .../targets/sparc64-linux-user.mak                 |   0
 .../targets/sparc64-softmmu.mak                    |   0
 .../targets/tricore-softmmu.mak                    |   0
 .../targets/x86_64-bsd-user.mak                    |   0
 .../targets/x86_64-linux-user.mak                  |   0
 .../targets/x86_64-softmmu.mak                     |   0
 .../targets/xtensa-linux-user.mak                  |   0
 .../targets/xtensa-softmmu.mak                     |   0
 .../targets/xtensaeb-linux-user.mak                |   0
 .../targets/xtensaeb-softmmu.mak                   |   0
 configure                                          |  44 +++--
 contrib/vhost-user-gpu/meson.build                 |   2 +-
 default-configs/devices/xtensaeb-softmmu.mak       |   3 -
 docs/devel/build-system.rst                        |  17 ++
 docs/devel/index.rst                               |   1 +
 docs/devel/modules.rst                             |   5 +
 docs/devel/qom.rst                                 |   8 +
 hmp-commands-info.hx                               |   3 -
 hw/arm/Kconfig                                     |   4 +
 hw/display/qxl.c                                   |   4 +
 hw/display/vhost-user-gpu-pci.c                    |   1 +
 hw/display/vhost-user-gpu.c                        |   1 +
 hw/display/vhost-user-vga.c                        |   1 +
 hw/display/virtio-gpu-base.c                       |   1 +
 hw/display/virtio-gpu-gl.c                         |   3 +
 hw/display/virtio-gpu-pci-gl.c                     |   3 +
 hw/display/virtio-gpu-pci.c                        |   2 +
 hw/display/virtio-gpu.c                            |   1 +
 hw/display/virtio-vga-gl.c                         |   3 +
 hw/display/virtio-vga.c                            |   2 +
 hw/ppc/spapr.c                                     |   2 +-
 hw/s390x/virtio-ccw-gpu.c                          |   3 +
 hw/usb/ccid-card-emulated.c                        |   1 +
 hw/usb/ccid-card-passthru.c                        |   1 +
 hw/usb/dev-storage-bot.c                           |   1 +
 hw/usb/dev-storage-classic.c                       |   1 +
 hw/usb/dev-uas.c                                   |   1 +
 hw/usb/host-libusb.c                               |  38 +---
 hw/usb/host-stub.c                                 |  45 -----
 hw/usb/meson.build                                 |  10 +-
 hw/usb/redirect.c                                  |   1 +
 include/hw/usb.h                                   |   7 +-
 include/monitor/monitor.h                          |   3 +
 include/qemu/module.h                              |  74 ++++++++
 include/qemu/osdep.h                               |   2 +-
 meson.build                                        | 112 ++++++++++--
 monitor/hmp.c                                      |   7 +
 monitor/misc.c                                     |  34 ++--
 scripts/modinfo-collect.py                         |  67 +++++++
 scripts/modinfo-generate.py                        |  97 ++++++++++
 softmmu/vl.c                                       |  37 ++--
 stubs/module-opts.c                                |   4 -
 target/Kconfig                                     |  19 ++
 target/alpha/Kconfig                               |   2 +
 target/arm/Kconfig                                 |   6 +
 target/avr/Kconfig                                 |   2 +
 target/cris/Kconfig                                |   2 +
 target/hppa/Kconfig                                |   2 +
 target/i386/Kconfig                                |   5 +
 target/i386/cpu.h                                  |   2 +
 target/i386/helper.h                               |   3 +-
 target/i386/svm.h                                  |   3 +
 target/i386/tcg/bpt_helper.c                       |  21 ---
 target/i386/tcg/sysemu/bpt_helper.c                |  47 +++--
 target/i386/tcg/sysemu/svm_helper.c                |  24 ++-
 target/i386/tcg/translate.c                        |   1 +
 target/m68k/Kconfig                                |   2 +
 target/microblaze/Kconfig                          |   2 +
 target/mips/Kconfig                                |   6 +
 target/nios2/Kconfig                               |   2 +
 target/openrisc/Kconfig                            |   2 +
 target/ppc/Kconfig                                 |   5 +
 target/riscv/Kconfig                               |   5 +
 target/rx/Kconfig                                  |   2 +
 target/s390x/Kconfig                               |   2 +
 target/sh4/Kconfig                                 |   2 +
 target/sparc/Kconfig                               |   5 +
 target/tricore/Kconfig                             |   2 +
 target/xtensa/Kconfig                              |   2 +
 tests/Makefile.include                             |   2 +-
 ui/egl-headless.c                                  |   4 +
 ui/gtk.c                                           |   4 +
 ui/sdl2.c                                          |   4 +
 ui/spice-app.c                                     |   3 +
 ui/spice-core.c                                    |   5 +
 util/module.c                                      | 200 ++++++++++++---------
 util/trace-events                                  |   4 +
 190 files changed, 856 insertions(+), 320 deletions(-)
 create mode 100644 accel/tcg/hmp.c
 rename default-configs/devices/aarch64-softmmu.mak => configs/devices/aarch64-softmmu/default.mak (82%)
 create mode 100644 configs/devices/aarch64-softmmu/minimal.mak
 rename default-configs/devices/alpha-softmmu.mak => configs/devices/alpha-softmmu/default.mak (100%)
 rename default-configs/devices/arm-softmmu.mak => configs/devices/arm-softmmu/default.mak (89%)
 rename default-configs/devices/avr-softmmu.mak => configs/devices/avr-softmmu/default.mak (100%)
 rename default-configs/devices/cris-softmmu.mak => configs/devices/cris-softmmu/default.mak (100%)
 rename default-configs/devices/hppa-softmmu.mak => configs/devices/hppa-softmmu/default.mak (100%)
 rename default-configs/devices/i386-softmmu.mak => configs/devices/i386-softmmu/default.mak (100%)
 rename default-configs/devices/m68k-softmmu.mak => configs/devices/m68k-softmmu/default.mak (100%)
 rename default-configs/devices/microblaze-softmmu.mak => configs/devices/microblaze-softmmu/default.mak (100%)
 rename default-configs/devices/microblazeel-softmmu.mak => configs/devices/microblazeel-softmmu/default.mak (54%)
 rename default-configs/devices/mips-softmmu-common.mak => configs/devices/mips-softmmu/common.mak (100%)
 rename default-configs/devices/mips-softmmu.mak => configs/devices/mips-softmmu/default.mak (56%)
 rename default-configs/devices/mips64-softmmu.mak => configs/devices/mips64-softmmu/default.mak (62%)
 rename default-configs/devices/mips64el-softmmu.mak => configs/devices/mips64el-softmmu/default.mak (88%)
 rename default-configs/devices/mipsel-softmmu.mak => configs/devices/mipsel-softmmu/default.mak (55%)
 rename default-configs/devices/nios2-softmmu.mak => configs/devices/nios2-softmmu/default.mak (100%)
 rename default-configs/devices/or1k-softmmu.mak => configs/devices/or1k-softmmu/default.mak (100%)
 rename default-configs/devices/ppc-softmmu.mak => configs/devices/ppc-softmmu/default.mak (100%)
 rename default-configs/devices/ppc64-softmmu.mak => configs/devices/ppc64-softmmu/default.mak (79%)
 rename default-configs/devices/riscv32-softmmu.mak => configs/devices/riscv32-softmmu/default.mak (100%)
 rename default-configs/devices/riscv64-softmmu.mak => configs/devices/riscv64-softmmu/default.mak (100%)
 rename default-configs/devices/rx-softmmu.mak => configs/devices/rx-softmmu/default.mak (100%)
 rename default-configs/devices/s390x-softmmu.mak => configs/devices/s390x-softmmu/default.mak (100%)
 rename default-configs/devices/sh4-softmmu.mak => configs/devices/sh4-softmmu/default.mak (100%)
 rename default-configs/devices/sh4eb-softmmu.mak => configs/devices/sh4eb-softmmu/default.mak (55%)
 rename default-configs/devices/sparc-softmmu.mak => configs/devices/sparc-softmmu/default.mak (100%)
 rename default-configs/devices/sparc64-softmmu.mak => configs/devices/sparc64-softmmu/default.mak (100%)
 rename default-configs/devices/tricore-softmmu.mak => configs/devices/tricore-softmmu/default.mak (100%)
 rename default-configs/devices/x86_64-softmmu.mak => configs/devices/x86_64-softmmu/default.mak (55%)
 rename default-configs/devices/xtensa-softmmu.mak => configs/devices/xtensa-softmmu/default.mak (100%)
 create mode 100644 configs/devices/xtensaeb-softmmu/default.mak
 rename {default-configs => configs}/targets/aarch64-linux-user.mak (100%)
 rename {default-configs => configs}/targets/aarch64-softmmu.mak (100%)
 rename {default-configs => configs}/targets/aarch64_be-linux-user.mak (100%)
 rename {default-configs => configs}/targets/alpha-linux-user.mak (100%)
 rename {default-configs => configs}/targets/alpha-softmmu.mak (100%)
 rename {default-configs => configs}/targets/arm-linux-user.mak (100%)
 rename {default-configs => configs}/targets/arm-softmmu.mak (100%)
 rename {default-configs => configs}/targets/armeb-linux-user.mak (100%)
 rename {default-configs => configs}/targets/avr-softmmu.mak (100%)
 rename {default-configs => configs}/targets/cris-linux-user.mak (100%)
 rename {default-configs => configs}/targets/cris-softmmu.mak (100%)
 rename {default-configs => configs}/targets/hexagon-linux-user.mak (100%)
 rename {default-configs => configs}/targets/hppa-linux-user.mak (100%)
 rename {default-configs => configs}/targets/hppa-softmmu.mak (100%)
 rename {default-configs => configs}/targets/i386-bsd-user.mak (100%)
 rename {default-configs => configs}/targets/i386-linux-user.mak (100%)
 rename {default-configs => configs}/targets/i386-softmmu.mak (100%)
 rename {default-configs => configs}/targets/m68k-linux-user.mak (100%)
 rename {default-configs => configs}/targets/m68k-softmmu.mak (100%)
 rename {default-configs => configs}/targets/microblaze-linux-user.mak (100%)
 rename {default-configs => configs}/targets/microblaze-softmmu.mak (100%)
 rename {default-configs => configs}/targets/microblazeel-linux-user.mak (100%)
 rename {default-configs => configs}/targets/microblazeel-softmmu.mak (100%)
 rename {default-configs => configs}/targets/mips-linux-user.mak (100%)
 rename {default-configs => configs}/targets/mips-softmmu.mak (100%)
 rename {default-configs => configs}/targets/mips64-linux-user.mak (100%)
 rename {default-configs => configs}/targets/mips64-softmmu.mak (100%)
 rename {default-configs => configs}/targets/mips64el-linux-user.mak (100%)
 rename {default-configs => configs}/targets/mips64el-softmmu.mak (100%)
 rename {default-configs => configs}/targets/mipsel-linux-user.mak (100%)
 rename {default-configs => configs}/targets/mipsel-softmmu.mak (100%)
 rename {default-configs => configs}/targets/mipsn32-linux-user.mak (100%)
 rename {default-configs => configs}/targets/mipsn32el-linux-user.mak (100%)
 rename {default-configs => configs}/targets/nios2-linux-user.mak (100%)
 rename {default-configs => configs}/targets/nios2-softmmu.mak (100%)
 rename {default-configs => configs}/targets/or1k-linux-user.mak (100%)
 rename {default-configs => configs}/targets/or1k-softmmu.mak (100%)
 rename {default-configs => configs}/targets/ppc-linux-user.mak (100%)
 rename {default-configs => configs}/targets/ppc-softmmu.mak (100%)
 rename {default-configs => configs}/targets/ppc64-linux-user.mak (100%)
 rename {default-configs => configs}/targets/ppc64-softmmu.mak (100%)
 rename {default-configs => configs}/targets/ppc64abi32-linux-user.mak (100%)
 rename {default-configs => configs}/targets/ppc64le-linux-user.mak (100%)
 rename {default-configs => configs}/targets/riscv32-linux-user.mak (100%)
 rename {default-configs => configs}/targets/riscv32-softmmu.mak (100%)
 rename {default-configs => configs}/targets/riscv64-linux-user.mak (100%)
 rename {default-configs => configs}/targets/riscv64-softmmu.mak (100%)
 rename {default-configs => configs}/targets/rx-softmmu.mak (100%)
 rename {default-configs => configs}/targets/s390x-linux-user.mak (100%)
 rename {default-configs => configs}/targets/s390x-softmmu.mak (100%)
 rename {default-configs => configs}/targets/sh4-linux-user.mak (100%)
 rename {default-configs => configs}/targets/sh4-softmmu.mak (100%)
 rename {default-configs => configs}/targets/sh4eb-linux-user.mak (100%)
 rename {default-configs => configs}/targets/sh4eb-softmmu.mak (100%)
 rename {default-configs => configs}/targets/sparc-linux-user.mak (100%)
 rename {default-configs => configs}/targets/sparc-softmmu.mak (100%)
 rename {default-configs => configs}/targets/sparc32plus-linux-user.mak (100%)
 rename {default-configs => configs}/targets/sparc64-linux-user.mak (100%)
 rename {default-configs => configs}/targets/sparc64-softmmu.mak (100%)
 rename {default-configs => configs}/targets/tricore-softmmu.mak (100%)
 rename {default-configs => configs}/targets/x86_64-bsd-user.mak (100%)
 rename {default-configs => configs}/targets/x86_64-linux-user.mak (100%)
 rename {default-configs => configs}/targets/x86_64-softmmu.mak (100%)
 rename {default-configs => configs}/targets/xtensa-linux-user.mak (100%)
 rename {default-configs => configs}/targets/xtensa-softmmu.mak (100%)
 rename {default-configs => configs}/targets/xtensaeb-linux-user.mak (100%)
 rename {default-configs => configs}/targets/xtensaeb-softmmu.mak (100%)
 delete mode 100644 default-configs/devices/xtensaeb-softmmu.mak
 create mode 100644 docs/devel/modules.rst
 delete mode 100644 hw/usb/host-stub.c
 create mode 100755 scripts/modinfo-collect.py
 create mode 100755 scripts/modinfo-generate.py
 create mode 100644 target/Kconfig
 create mode 100644 target/alpha/Kconfig
 create mode 100644 target/arm/Kconfig
 create mode 100644 target/avr/Kconfig
 create mode 100644 target/cris/Kconfig
 create mode 100644 target/hppa/Kconfig
 create mode 100644 target/i386/Kconfig
 create mode 100644 target/m68k/Kconfig
 create mode 100644 target/microblaze/Kconfig
 create mode 100644 target/mips/Kconfig
 create mode 100644 target/nios2/Kconfig
 create mode 100644 target/openrisc/Kconfig
 create mode 100644 target/ppc/Kconfig
 create mode 100644 target/riscv/Kconfig
 create mode 100644 target/rx/Kconfig
 create mode 100644 target/s390x/Kconfig
 create mode 100644 target/sh4/Kconfig
 create mode 100644 target/sparc/Kconfig
 create mode 100644 target/tricore/Kconfig
 create mode 100644 target/xtensa/Kconfig
Signature · 1 line
2.31.1
#1 lore raw

[PULL 01/48] configure: fix libdaxctl options

From: Miroslav Rezanina <[email protected]>

For some reason, libdaxctl option setting was set to work in an opposite way (--enable-libdaxctl disabled it and vice versa). Fixing this so configuration works properly.

Message-Id: <[email protected]>

Fixes 83ef16821a ("configure, meson: convert libdaxctl detection to meson", 2021-07-06)
---
 configure | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
configure +2 -2
index 650d9c0735..4f51528a77 100755
@@ -1531,9 +1531,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"
   ;;
Signature · 1 line
2.31.1
#2 lore raw

[PULL 02/48] configure: fix libpmem configuration option

In reply to Paolo Bonzini

From: Miroslav Rezanina <[email protected]>

For some reason, libpmem option setting was set to work in an opposite way (--enable-libpmem disabled it and vice versa). Fixing this so configuration works properly.

Message-Id: <[email protected]>

Fixes e36e8c70f6 ("configure, meson: convert libpmem detection to meson", 2021-07-06)
---
 configure | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
configure +2 -2
index 4f51528a77..a172c83e15 100755
@@ -1501,9 +1501,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"
   ;;
Signature · 1 line
2.31.1
#3 lore raw

[PULL 03/48] meson: fix missing preprocessor symbols

In reply to Paolo Bonzini

While most libraries do not need a CONFIG_* symbol because the "when:" clauses are enough, some do. Add them back or stop using them if possible.

In the case of libpmem, the statement to add the CONFIG_* symbol was still in configure, but could not be triggered because it checked for "no" instead of "disabled" (and it would be wrong anyway since the test for the library has not been done yet).

Fixes 587d59d6cc ("configure, meson: convert virgl detection to meson", 2021-07-06)
Fixes 83ef16821a ("configure, meson: convert libdaxctl detection to meson", 2021-07-06)
Fixes e36e8c70f6 ("configure, meson: convert libpmem detection to meson", 2021-07-06)
Fixes 53c22b68e3 ("configure, meson: convert liburing detection to meson", 2021-07-06)
---
 configure                          | 6 ------
 contrib/vhost-user-gpu/meson.build | 2 +-
 meson.build                        | 4 ++++
 3 files changed, 5 insertions(+), 7 deletions(-)
configure +0 -6
index a172c83e15..a04b1e075c 100755
@@ -4818,12 +4818,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
contrib/vhost-user-gpu/meson.build +1 -1
index 0ce1515a10..4cb52a91d7 100644
@@ -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'),
meson.build +4 -0
index 7e12de01be..9cd966a86b 100644
@@ -1223,8 +1223,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())
@@ -1237,6 +1240,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)
Signature · 1 line
2.31.1
#4 lore raw

[PULL 10/48] modules: add virtio-gpu module annotations

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

Message-Id: <[email protected]>

---
 hw/display/vhost-user-gpu-pci.c | 1 +
 hw/display/vhost-user-gpu.c     | 1 +
 hw/display/vhost-user-vga.c     | 1 +
 hw/display/virtio-gpu-base.c    | 1 +
 hw/display/virtio-gpu-gl.c      | 3 +++
 hw/display/virtio-gpu-pci-gl.c  | 3 +++
 hw/display/virtio-gpu-pci.c     | 2 ++
 hw/display/virtio-gpu.c         | 1 +
 hw/display/virtio-vga-gl.c      | 3 +++
 hw/display/virtio-vga.c         | 2 ++
 10 files changed, 18 insertions(+)
hw/display/vhost-user-gpu-pci.c +1 -0
index a02b23ecaf..daefcf7101 100644
@@ -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)
 {
hw/display/vhost-user-gpu.c +1 -0
index 389199e6ca..49df56cd14 100644
@@ -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)
 {
hw/display/vhost-user-vga.c +1 -0
index a34a99856d..072c9c65bc 100644
@@ -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)
 {
hw/display/virtio-gpu-base.c +1 -0
index dd294276cb..c8da4806e0 100644
@@ -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)
hw/display/virtio-gpu-gl.c +3 -0
index d971b48080..7ab93bf8c8 100644
@@ -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");
hw/display/virtio-gpu-pci-gl.c +3 -0
index 902dda3452..99b14a0718 100644
@@ -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");
hw/display/virtio-gpu-pci.c +2 -0
index d742a30aec..e36eee0c40 100644
@@ -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)
 {
hw/display/virtio-gpu.c +1 -0
index e183f4ecda..6b7f643951 100644
@@ -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)
 {
hw/display/virtio-vga-gl.c +3 -0
index c971340ebb..f22549097c 100644
@@ -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");
hw/display/virtio-vga.c +2 -0
index d3c6404061..9e57f61e9e 100644
@@ -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)
 {
Signature · 1 line
2.31.1
#5 lore raw

[PULL 04/48] osdep: fix HAVE_BROKEN_SIZE_MAX case

In reply to Paolo Bonzini

While config-host.mak entries are expanded to "1" for compatibility with create-config.sh, tests done directly in meson.build expand to the empty string and cannot be placed to the right of the && operator. Adjust osdep.h after commit e46bd55d9c ("configure: convert HAVE_BROKEN_SIZE_MAX to meson", 2021-07-06) changed the way HAVE_BROKEN_SIZE_MAX is defined.

Fixes e46bd55d9c ("configure: convert HAVE_BROKEN_SIZE_MAX to meson", 2021-07-06)

Resolves: #463

---
 include/qemu/osdep.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/qemu/osdep.h +1 -1
index c91a78b5e6..60718fc342 100644
@@ -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
Signature · 1 line
2.31.1
#6 lore raw

[PULL 07/48] modules: generate modinfo.c

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

Add script to generate C source with a small
database containing the module meta-data.

Message-Id: <[email protected]>

---
 include/qemu/module.h       | 17 ++++++++
 meson.build                 | 13 +++++-
 scripts/modinfo-generate.py | 84 +++++++++++++++++++++++++++++++++++++
 softmmu/vl.c                |  4 ++
 util/module.c               | 11 +++++
 5 files changed, 128 insertions(+), 1 deletion(-)
 create mode 100755 scripts/modinfo-generate.py
include/qemu/module.h +17 -0
index 81ef086da0..a98748d501 100644
@@ -98,4 +98,21 @@ void module_load_qom_all(void);
 /* 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
meson.build +12 -1
index ff580f1f80..7b827f7caa 100644
@@ -2242,6 +2242,7 @@ subdir('tests/qtest/fuzz')
 ########################
 
 modinfo_collect = find_program('scripts/modinfo-collect.py')
+modinfo_generate = find_program('scripts/modinfo-generate.py')
 modinfo_files = []
 
 block_mods = []
@@ -2267,7 +2268,6 @@ foreach d, list : modules
                                        output: d + '-' + m + '.modinfo',
                                        input: module_ss.sources(),
                                        capture: true,
-                                       build_by_default: true, # to be removed when added to a target
                                        command: [modinfo_collect, '@INPUT@'])
       endif
     else
@@ -2280,6 +2280,17 @@ foreach d, list : modules
   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',
scripts/modinfo-generate.py new file +84 -0

84 lines not on this page · raw message

softmmu/vl.c +4 -0
index a50c8575a1..7cef3423a7 100644
@@ -2755,6 +2755,10 @@ 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);
+#endif
+
     qemu_init_subsystems();
 
     /* first pass of option parsing */
util/module.c +11 -0
index eee8ff2de1..8d3e8275b9 100644
@@ -110,6 +110,17 @@ 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;
+
+void module_init_info(const QemuModinfo *info)
+{
+    module_info = info;
+}
+
 static int module_load_file(const char *fname, bool mayfail, bool export_symbols)
 {
     GModule *g_module;
Signature · 1 line
2.31.1
#7 lore raw

[PULL 05/48] modules: add modinfo macros

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

Add macros for module info annotations.

Instead of having that module meta-data stored in lists in util/module.c place directly in the module source code.

Message-Id: <[email protected]>

---
 include/qemu/module.h | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
include/qemu/module.h +25 -0
index 944d403cbd..81ef086da0 100644
@@ -73,4 +73,29 @@ 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);
 
+/*
+ * module info annotation macros
+ *
+ * scripts/modinfo-collect.py will collect module info,
+ * using the preprocessor and -DQEMU_MODINFO
+ */
+#ifdef QEMU_MODINFO
+# define modinfo(kind, value) \
+    MODINFO_START kind value MODINFO_END
+#else
+# define modinfo(kind, value)
+#endif
+
+/* module implements QOM type <name> */
+#define module_obj(name) modinfo(obj, name)
+
+/* module has a dependency on <name> */
+#define module_dep(name) modinfo(dep, name)
+
+/* module is for target architecture <name> */
+#define module_arch(name) modinfo(arch, name)
+
+/* module registers QemuOpts <name> */
+#define module_opts(name) modinfo(opts, name)
+
 #endif
Signature · 1 line
2.31.1
#8 lore raw

[PULL 11/48] modules: add chardev module annotations

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

Message-Id: <[email protected]>

---
 chardev/baum.c  | 1 +
 chardev/spice.c | 4 ++++
 2 files changed, 5 insertions(+)
chardev/baum.c +1 -0
index 5deca778bc..79d618e350 100644
@@ -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)
 {
chardev/spice.c +4 -0
index 1104426e3a..3ffb3fdc0d 100644
@@ -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");
Signature · 1 line
2.31.1
#9 lore raw

[PULL 13/48] modules: add usb-redir module annotations

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

Message-Id: <[email protected]>

---
 hw/usb/redirect.c | 1 +
 1 file changed, 1 insertion(+)
hw/usb/redirect.c +1 -0
index 6a75b0dc4a..4ec9326e05 100644
@@ -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)
 {
Signature · 1 line
2.31.1
#10 lore raw

[PULL 06/48] modules: collect module meta-data

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

Add script to collect the module meta-data from the source code, store the results in *.modinfo files.

Message-Id: <[email protected]>

---
 meson.build                | 16 +++++++++
 scripts/modinfo-collect.py | 67 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 83 insertions(+)
 create mode 100755 scripts/modinfo-collect.py
meson.build +16 -0
index 9cd966a86b..ff580f1f80 100644
@@ -2241,6 +2241,9 @@ subdir('tests/qtest/fuzz')
 # Library dependencies #
 ########################
 
+modinfo_collect = find_program('scripts/modinfo-collect.py')
+modinfo_files = []
+
 block_mods = []
 softmmu_mods = []
 foreach d, list : modules
@@ -2254,6 +2257,19 @@ 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,
+                                       build_by_default: true, # to be removed when added to a target
+                                       command: [modinfo_collect, '@INPUT@'])
+      endif
     else
       if d == 'block'
         block_ss.add_all(module_ss)
scripts/modinfo-collect.py new file +67 -0

67 lines not on this page · raw message

Signature · 1 line
2.31.1
#11 lore raw

[PULL 08/48] modules: check if all dependencies can be satisfied

In reply to Paolo Bonzini

From: "Jose R. Ziviani" <[email protected]>

Verifies if all dependencies are correctly listed in the modinfo.c too and stop the builds if they're not.

Message-Id: <[email protected]>

---
 scripts/modinfo-generate.py | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
scripts/modinfo-generate.py +14 -1
index a6d98a6bc4..f559eed007 100755
@@ -59,6 +59,7 @@ def generate(name, lines):
     print_array("deps", deps)
     print_array("opts", opts)
     print("},{");
+    return deps
 
 def print_pre():
     print("/* generated by scripts/modinfo-generate.py */")
@@ -71,14 +72,26 @@ def print_post():
     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)
-        generate(basename, lines)
+        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:])
Signature · 1 line
2.31.1
#12 lore raw

[PULL 12/48] modules: add audio module annotations

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

Message-Id: <[email protected]>

---
 audio/spiceaudio.c | 2 ++
 1 file changed, 2 insertions(+)
audio/spiceaudio.c +2 -0
index 999bfbde47..a8d370fe6f 100644
@@ -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");
Signature · 1 line
2.31.1
#13 lore raw

[PULL 09/48] modules: add qxl module annotations

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

Message-Id: <[email protected]>

---
 hw/display/qxl.c | 4 ++++
 1 file changed, 4 insertions(+)
hw/display/qxl.c +4 -0
index 6e1f8ff1b2..84f99088e0 100644
@@ -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");
Signature · 1 line
2.31.1
#14 lore raw

[PULL 14/48] modules: add ccid module annotations

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

Message-Id: <[email protected]>

---
 hw/usb/ccid-card-emulated.c | 1 +
 hw/usb/ccid-card-passthru.c | 1 +
 2 files changed, 2 insertions(+)
hw/usb/ccid-card-emulated.c +1 -0
index 5c76bed77a..6c8c0355e0 100644
@@ -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)
 {
hw/usb/ccid-card-passthru.c +1 -0
index 7212d0d7fb..fa3040fb71 100644
@@ -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)
 {
Signature · 1 line
2.31.1
#15 lore raw

[PULL 16/48] modules: add s390x module annotations

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

Message-Id: <[email protected]>

---
 hw/s390x/virtio-ccw-gpu.c | 3 +++
 1 file changed, 3 insertions(+)
hw/s390x/virtio-ccw-gpu.c +3 -0
index 75a9e4bb39..5868a2a070 100644
@@ -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");
Signature · 1 line
2.31.1
#16 lore raw

[PULL 15/48] modules: add ui module annotations

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

Message-Id: <[email protected]>

---
 ui/egl-headless.c | 4 ++++
 ui/gtk.c          | 4 ++++
 ui/sdl2.c         | 4 ++++
 ui/spice-app.c    | 3 +++
 ui/spice-core.c   | 5 +++++
 5 files changed, 20 insertions(+)
ui/egl-headless.c +4 -0
index da377a74af..75404e0e87 100644
@@ -213,3 +213,7 @@ static void register_egl(void)
 }
 
 type_init(register_egl);
+
+#ifdef CONFIG_OPENGL
+module_dep("ui-opengl");
+#endif
ui/gtk.c +4 -0
index 98046f577b..376b4d528d 100644
@@ -2333,3 +2333,7 @@ static void register_gtk(void)
 }
 
 type_init(register_gtk);
+
+#ifdef CONFIG_OPENGL
+module_dep("ui-opengl");
+#endif
ui/sdl2.c +4 -0
index a203cb0239..36d9010cb6 100644
@@ -918,3 +918,7 @@ static void register_sdl1(void)
 }
 
 type_init(register_sdl1);
+
+#ifdef CONFIG_OPENGL
+module_dep("ui-opengl");
+#endif
ui/spice-app.c +3 -0
index 4325ac2d9c..641f4a9d53 100644
@@ -221,3 +221,6 @@ static void register_spice_app(void)
 }
 
 type_init(register_spice_app);
+
+module_dep("ui-spice-core");
+module_dep("chardev-spice");
ui/spice-core.c +5 -0
index 272d19b0c1..86d43783ac 100644
@@ -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
Signature · 1 line
2.31.1
#17 lore raw

[PULL 22/48] modules: check arch and block load on mismatch

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

Add module_allow_arch() to set the target architecture. In case a module is limited to some arch verify arches match and ignore the module if not.

Message-Id: <[email protected]>

---
 include/qemu/module.h |  1 +
 softmmu/vl.c          |  3 +++
 util/module.c         | 29 +++++++++++++++++++++++++++++
 3 files changed, 33 insertions(+)
include/qemu/module.h +1 -0
index a98748d501..7f4b1af819 100644
@@ -72,6 +72,7 @@ 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);
 
 /*
  * module info annotation macros
softmmu/vl.c +3 -0
index 190b71a0f2..2004d57108 100644
@@ -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 {
@@ -2740,6 +2742,7 @@ void qemu_init(int argc, char **argv, char **envp)
 
 #ifdef CONFIG_MODULES
     module_init_info(qemu_modinfo);
+    module_allow_arch(TARGET_NAME);
 #endif
 
     qemu_init_subsystems();
util/module.c +29 -0
index acaaecad56..065aed09ff 100644
@@ -117,12 +117,33 @@ 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;
@@ -224,6 +245,13 @@ bool module_load_one(const char *prefix, const char *lib_name, bool mayfail)
     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) */
@@ -345,6 +373,7 @@ void qemu_load_module_for_opts(const char *group)
 
 #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) {}
Signature · 1 line
2.31.1
#18 lore raw

[PULL 20/48] modules: use modinfo for qemu opts load

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

Use module database to figure which module adds given QemuOpts group.

Message-Id: <[email protected]>

---
 softmmu/vl.c        | 17 -----------------
 stubs/module-opts.c |  4 ----
 util/module.c       | 19 +++++++++++++++++++
 3 files changed, 19 insertions(+), 21 deletions(-)
softmmu/vl.c +0 -17
index 7cef3423a7..190b71a0f2 100644
@@ -2691,23 +2691,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;
stubs/module-opts.c +0 -4
index a7d0e4ad6e..5412429ea8 100644
@@ -1,6 +1,2 @@
 #include "qemu/osdep.h"
 #include "qemu/config-file.h"
-
-void qemu_load_module_for_opts(const char *group)
-{
-}
util/module.c +19 -0
index 745ae0fb20..a9ec2da997 100644
@@ -20,6 +20,7 @@
 #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
@@ -322,8 +323,26 @@ void module_load_qom_all(void)
     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 qemu_load_module_for_opts(const char *group) {}
 void module_load_qom_one(const char *type) {}
 void module_load_qom_all(void) {}
 
Signature · 1 line
2.31.1
#19 lore raw

[PULL 17/48] modules: add block module annotations

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

Message-Id: <[email protected]>

---
 block/iscsi-opts.c | 1 +
 1 file changed, 1 insertion(+)
block/iscsi-opts.c +1 -0
index afaf8837d6..4f2da405e6 100644
@@ -68,3 +68,4 @@ static void iscsi_block_opts_init(void)
 }
 
 block_init(iscsi_block_opts_init);
+module_opts("iscsi");
Signature · 1 line
2.31.1
#20 lore raw

[PULL 27/48] modules: module.h kerneldoc annotations

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

Message-Id: <[email protected]>

---
 include/qemu/module.h | 59 +++++++++++++++++++++++++++++++++----------
 1 file changed, 45 insertions(+), 14 deletions(-)
include/qemu/module.h +45 -14
index 7f4b1af819..8bc80535a4 100644
@@ -74,11 +74,18 @@ void module_load_qom_one(const char *type);
 void module_load_qom_all(void);
 void module_allow_arch(const char *arch);
 
-/*
- * module info annotation macros
+/**
+ * DOC: module info annotation macros
  *
- * scripts/modinfo-collect.py will collect module info,
- * using the preprocessor and -DQEMU_MODINFO
+ * `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) \
@@ -87,24 +94,48 @@ void module_allow_arch(const char *arch);
 # define modinfo(kind, value)
 #endif
 
-/* module implements QOM type <name> */
+/**
+ * module_obj
+ *
+ * @name: QOM type.
+ *
+ * This module implements QOM type @name.
+ */
 #define module_obj(name) modinfo(obj, name)
 
-/* module has a dependency on <name> */
+/**
+ * module_dep
+ *
+ * @name: module name
+ *
+ * This module depends on module @name.
+ */
 #define module_dep(name) modinfo(dep, name)
 
-/* module is for target architecture <name> */
+/**
+ * module_arch
+ *
+ * @arch: 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 registers QemuOpts <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
- */
+/* module info database (created by scripts/modinfo-generate.py) */
 typedef struct QemuModinfo QemuModinfo;
 struct QemuModinfo {
     const char *name;
Signature · 1 line
2.31.1
#21 lore raw

[PULL 24/48] modules: target-specific module build infrastructure

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

Message-Id: <[email protected]>

---
 meson.build | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
meson.build +37 -0
index 7b827f7caa..7babef4de4 100644
@@ -2001,6 +2001,7 @@ user_ss = ss.source_set()
 util_ss = ss.source_set()
 
 modules = {}
+target_modules = {}
 hw_arch = {}
 target_arch = {}
 target_softmmu_arch = {}
@@ -2280,6 +2281,42 @@ 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="@[email protected]"'.format(target),
+                    '-DCONFIG_DEVICES="@[email protected]"'.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',
Signature · 1 line
2.31.1
#22 lore raw

[PULL 19/48] modules: use modinfo for qom load

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

Use module database to figure which module implements a given QOM type. Drop hard-coded object list.

Message-Id: <[email protected]>

---
 util/module.c | 77 ++++++++++++++++-----------------------------------
 1 file changed, 24 insertions(+), 53 deletions(-)
util/module.c +24 -53
index 7d7b69cbda..745ae0fb20 100644
@@ -280,80 +280,51 @@ 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;
+
+    for (modinfo = module_info; modinfo->name != NULL; modinfo++) {
+        if (!modinfo->objs) {
+            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;
         }
-        module_load_one(qom_modules[i].prefix, qom_modules[i].module, true);
+        module_load_one("", modinfo->name, false);
     }
     module_loaded_qom_all = true;
 }
+
+#else
+
+void module_load_qom_one(const char *type) {}
+void module_load_qom_all(void) {}
+
+#endif
Signature · 1 line
2.31.1
#23 lore raw

[PULL 18/48] modules: use modinfo for dependencies

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

Use module database for module dependencies. Drop hard-coded dependency list.

Message-Id: <[email protected]>

---
 util/module.c | 55 ++++++++++++++++++++-------------------------------
 1 file changed, 21 insertions(+), 34 deletions(-)
util/module.c +21 -34
index 8d3e8275b9..7d7b69cbda 100644
@@ -182,28 +182,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)
@@ -219,9 +197,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");
@@ -234,23 +214,30 @@ 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->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);
Signature · 1 line
2.31.1
#24 lore raw

[PULL 30/48] accel: add qtest module annotations

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

Add module annotations for qtest so autoloading works.

Message-Id: <[email protected]>

---
 accel/qtest/qtest.c | 2 ++
 1 file changed, 2 insertions(+)
accel/qtest/qtest.c +2 -0
index edb29f6fa4..7e6b8110d5 100644
@@ -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)
 {
Signature · 1 line
2.31.1
#25 lore raw

[PULL 29/48] accel: autoload modules

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

Call module_object_class_by_name() instead of object_class_by_name() for objects possibly implemented as module

Message-Id: <[email protected]>

---
 accel/accel-common.c  | 2 +-
 accel/accel-softmmu.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
accel/accel-common.c +1 -1
index cf07f78421..7b8ec7e0f7 100644
@@ -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;
 }
accel/accel-softmmu.c +1 -1
index 50fa5acaa4..67276e4f52 100644
@@ -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);
 
     /*
Signature · 1 line
2.31.1
#26 lore raw

[PULL 23/48] modules: check arch on qom lookup

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

With target-specific modules we can have multiple modules implementing the same object. Therefore we have to check the target arch on lookup to find the correct module.

Message-Id: <[email protected]>

---
 util/module.c | 6 ++++++
 1 file changed, 6 insertions(+)
util/module.c +6 -0
index 065aed09ff..6bb4ad915a 100644
@@ -329,6 +329,9 @@ void module_load_qom_one(const char *type)
         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);
@@ -349,6 +352,9 @@ void module_load_qom_all(void)
         if (!modinfo->objs) {
             continue;
         }
+        if (!module_check_arch(modinfo)) {
+            continue;
+        }
         module_load_one("", modinfo->name, false);
     }
     module_loaded_qom_all = true;
Signature · 1 line
2.31.1
#27 lore raw

[PULL 21/48] modules: add tracepoints

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

One for module load and one for qom type lookup.

Message-Id: <[email protected]>

---
 util/module.c     | 3 +++
 util/trace-events | 4 ++++
 2 files changed, 7 insertions(+)
util/module.c +3 -0
index a9ec2da997..acaaecad56 100644
@@ -24,6 +24,7 @@
 #ifdef CONFIG_MODULE_UPGRADES
 #include "qemu-version.h"
 #endif
+#include "trace.h"
 
 typedef struct ModuleEntry
 {
@@ -176,6 +177,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);
@@ -294,6 +296,7 @@ void module_load_qom_one(const char *type)
         return;
     }
 
+    trace_module_lookup_object_type(type);
     for (modinfo = module_info; modinfo->name != NULL; modinfo++) {
         if (!modinfo->objs) {
             continue;
util/trace-events +4 -0
index 806cac14a7..c8f53d7d9f 100644
@@ -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"
Signature · 1 line
2.31.1
#28 lore raw

[PULL 31/48] accel: build qtest modular

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

Allow building accelerators as module.
Start with qtest as first user.

Message-Id: <[email protected]>

---
 accel/qtest/meson.build | 8 ++------
 meson.build             | 6 ++++++
 2 files changed, 8 insertions(+), 6 deletions(-)
accel/qtest/meson.build +2 -6
index a2f3276459..4c65600293 100644
@@ -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'))
meson.build +6 -0
index 7babef4de4..c943e44975 100644
@@ -2000,6 +2000,9 @@ trace_ss = ss.source_set()
 user_ss = ss.source_set()
 util_ss = ss.source_set()
 
+# accel modules
+qtest_module_ss = ss.source_set()
+
 modules = {}
 target_modules = {}
 hw_arch = {}
@@ -2238,6 +2241,9 @@ specific_ss.add_all(when: 'CONFIG_LINUX_USER', if_true: linux_user_ss)
 subdir('tests/qtest/libqos')
 subdir('tests/qtest/fuzz')
 
+# accel modules
+target_modules += { 'accel' : { 'qtest': qtest_module_ss }}
+
 ########################
 # Library dependencies #
 ########################
Signature · 1 line
2.31.1
#29 lore raw

[PULL 33/48] accel: build tcg modular

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

Build tcg accel ops as module.
Which is only a small fraction of tcg. Also only x86 for now.

Message-Id: <[email protected]>

---
 accel/tcg/meson.build |  5 ++++-
 meson.build           | 14 +++++++++++++-
 2 files changed, 17 insertions(+), 2 deletions(-)
accel/tcg/meson.build +4 -1
index 1236ac7b91..0ae9180282 100644
@@ -15,8 +15,11 @@ specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_ss)
 
 specific_ss.add(when: ['CONFIG_SOFTMMU', 'CONFIG_TCG'], if_true: files(
   'cputlb.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',
 ))
meson.build +13 -1
index c943e44975..d9aa2d7820 100644
@@ -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')
@@ -1531,6 +1533,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
@@ -2002,6 +2009,7 @@ util_ss = ss.source_set()
 
 # accel modules
 qtest_module_ss = ss.source_set()
+tcg_module_ss = ss.source_set()
 
 modules = {}
 target_modules = {}
@@ -2242,7 +2250,11 @@ subdir('tests/qtest/libqos')
 subdir('tests/qtest/fuzz')
 
 # accel modules
-target_modules += { 'accel' : { 'qtest': qtest_module_ss }}
+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 #
Signature · 1 line
2.31.1
#30 lore raw

[PULL 32/48] accel: add tcg module annotations

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

Add module annotations for tcg so autoloading works.

Message-Id: <[email protected]>

---
 accel/tcg/tcg-accel-ops.c | 1 +
 accel/tcg/tcg-all.c       | 1 +
 2 files changed, 2 insertions(+)
accel/tcg/tcg-accel-ops.c +1 -0
index 7191315aee..1a8e8390bd 100644
@@ -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)
 {
accel/tcg/tcg-all.c +1 -0
index 00803f76d8..d6336a9c96 100644
@@ -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)
 {
Signature · 1 line
2.31.1
#31 lore raw

[PULL 26/48] modules: add module_obj() note to QOM docs

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

Message-Id: <[email protected]>

---
 docs/devel/qom.rst | 8 ++++++++
 1 file changed, 8 insertions(+)
docs/devel/qom.rst +8 -0
index 42d0dc4f4d..e5fe3597cd 100644
@@ -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
 ====================
 
Signature · 1 line
2.31.1
#32 lore raw

[PULL 38/48] monitor/tcg: move tcg hmp commands to accel/tcg, register them dynamically

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

One more little step towards modular tcg ...

Message-Id: <[email protected]>

---
 accel/tcg/hmp.c       | 29 +++++++++++++++++++++++++++++
 accel/tcg/meson.build |  1 +
 hmp-commands-info.hx  |  2 --
 monitor/misc.c        | 18 ------------------
 4 files changed, 30 insertions(+), 20 deletions(-)
 create mode 100644 accel/tcg/hmp.c
accel/tcg/hmp.c new file +29 -0
new file mode 100644
index 0000000000..a6e72fdb3e
@@ -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);
accel/tcg/meson.build +1 -0
index 0ae9180282..137a1a44cc 100644
@@ -15,6 +15,7 @@ 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(
hmp-commands-info.hx +0 -2
index ce42aef47a..27206ac049 100644
@@ -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
 
monitor/misc.c +0 -18
index ad476c6e51..b28874d6dc 100644
@@ -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);
Signature · 1 line
2.31.1
#33 lore raw

[PULL 34/48] monitor: allow register hmp commands

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

Allow commands having a NULL cmd pointer, add a function to set the pointer later. Use case: allow modules implement hmp commands.

Message-Id: <[email protected]>

---
 include/monitor/monitor.h |  3 +++
 monitor/hmp.c             |  7 +++++++
 monitor/misc.c            | 16 ++++++++++++++++
 3 files changed, 26 insertions(+)
include/monitor/monitor.h +3 -0
index 1211d6e6d6..1a8a369b50 100644
@@ -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 */
monitor/hmp.c +7 -0
index 6c0b33a0b1..d50c3124e1 100644
@@ -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])) {
monitor/misc.c +16 -0
index 1539e18557..ad476c6e51 100644
@@ -1974,6 +1974,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();
Signature · 1 line
2.31.1
#34 lore raw

[PULL 36/48] monitor/usb: register 'info usbhost' dynamically

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

Message-Id: <[email protected]>

---
 hmp-commands-info.hx |  1 -
 hw/usb/host-libusb.c |  1 +
 hw/usb/host-stub.c   | 40 ----------------------------------------
 hw/usb/meson.build   |  4 +---
 4 files changed, 2 insertions(+), 44 deletions(-)
 delete mode 100644 hw/usb/host-stub.c
hmp-commands-info.hx +0 -1
index fb59c27200..ce42aef47a 100644
@@ -368,7 +368,6 @@ ERST
         .args_type  = "",
         .params     = "",
         .help       = "show host USB devices",
-        .cmd        = hmp_info_usbhost,
     },
 
 SRST
hw/usb/host-libusb.c +1 -0
index e6d21aa8e1..2b7f87872c 100644
@@ -1781,6 +1781,7 @@ static TypeInfo usb_host_dev_info = {
 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)
hw/usb/host-stub.c deleted +0 -40
deleted file mode 100644
index bbe69baa39..0000000000
@@ -1,40 +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 <[email protected]>
- *      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");
-}
hw/usb/meson.build +1 -3
index 4f24b5274d..817f3e027a 100644
@@ -73,9 +73,7 @@ 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_true: files('host-libusb.c'))
 
 softmmu_ss.add(when: ['CONFIG_USB', 'CONFIG_XEN', libusb], if_true: files('xen-usb.c'))
 
Signature · 1 line
2.31.1
#35 lore raw

[PULL 28/48] modules: hook up modules.h to docs build

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

Message-Id: <[email protected]>

---
 docs/devel/index.rst   | 1 +
 docs/devel/modules.rst | 5 +++++
 2 files changed, 6 insertions(+)
 create mode 100644 docs/devel/modules.rst
docs/devel/index.rst +1 -0
index 977c3893bd..ba90badbbd 100644
@@ -41,6 +41,7 @@ Contents:
    s390-dasd-ipl
    clocks
    qom
+   modules
    block-coroutine-wrapper
    multi-process
    ebpf_rss
docs/devel/modules.rst new file +5 -0
new file mode 100644
index 0000000000..066f347b89
@@ -0,0 +1,5 @@
+============
+Qemu modules
+============
+
+.. kernel-doc:: include/qemu/module.h
Signature · 1 line
2.31.1
#36 lore raw

[PULL 40/48] target/i386: Added DR6 and DR7 consistency checks

In reply to Paolo Bonzini

From: Lara Lazier <[email protected]>

DR6[63:32] and DR7[63:32] are reserved and need to be zero. (AMD64 Architecture Programmer's Manual, V2, 15.5)

Message-Id: <[email protected]>

[Ignore for 32-bit builds. - Paolo]
---
 target/i386/svm.h                   | 2 ++
 target/i386/tcg/sysemu/svm_helper.c | 9 ++++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)
target/i386/svm.h +2 -0
index adc058dc76..4bde9f3475 100644
@@ -140,6 +140,8 @@
 #define SVM_MSRPM_SIZE		(1ULL << 13)
 #define SVM_IOPM_SIZE		((1ULL << 13) + 1)
 
+#define SVM_DR_RESERVED_MASK 0xffffffff00000000ULL
+
 struct QEMU_PACKED vmcb_control_area {
 	uint16_t intercept_cr_read;
 	uint16_t intercept_cr_write;
target/i386/tcg/sysemu/svm_helper.c +8 -1
index fa701829e5..047f31628e 100644
@@ -269,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] & SVM_DR_RESERVED_MASK) {
+        cpu_vmexit(env, SVM_EXIT_ERR, 0, GETPC());
+    }
+    if (env->dr[7] & SVM_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))) {
Signature · 1 line
2.31.1
#37 lore raw

[PULL 35/48] usb: drop usb_host_dev_is_scsi_storage hook

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

Introduce an usb device flag instead, set it when usb-host looks at the device descriptors anyway. Also set it for emulated storage devices, for consistency. Add an inline helper function to check the flag.

Message-Id: <[email protected]>

---
 hw/ppc/spapr.c               |  2 +-
 hw/usb/dev-storage-bot.c     |  1 +
 hw/usb/dev-storage-classic.c |  1 +
 hw/usb/dev-uas.c             |  1 +
 hw/usb/host-libusb.c         | 36 +++++++-----------------------------
 hw/usb/host-stub.c           |  5 -----
 include/hw/usb.h             |  7 ++++++-
 7 files changed, 17 insertions(+), 36 deletions(-)
hw/ppc/spapr.c +1 -1
index 4dd90b75cc..f83a081af0 100644
@@ -3106,7 +3106,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);
         }
     }
hw/usb/dev-storage-bot.c +1 -0
index 6aad026d11..68ebaca10c 100644
@@ -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;
     }
hw/usb/dev-storage-classic.c +1 -0
index 00cb34b22f..3d017a4e67 100644
@@ -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,
hw/usb/dev-uas.c +1 -0
index d2bd85d3f6..263056231c 100644
@@ -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);
 }
hw/usb/host-libusb.c +7 -29
index 2518306f52..e6d21aa8e1 100644
@@ -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;
@@ -1893,35 +1900,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;
hw/usb/host-stub.c +0 -5
index 80809ceba5..bbe69baa39 100644
@@ -38,8 +38,3 @@ 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;
-}
include/hw/usb.h +6 -1
index 436e07b304..33668dd0a9 100644
@@ -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) */
Signature · 1 line
2.31.1
#38 lore raw

[PULL 37/48] usb: build usb-host as module

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

Drop one more shared library dependency (libusb) from core qemu.

Message-Id: <[email protected]>

---
 hw/usb/host-libusb.c | 1 +
 hw/usb/meson.build   | 8 ++++++--
 2 files changed, 7 insertions(+), 2 deletions(-)
hw/usb/host-libusb.c +1 -0
index 2b7f87872c..c0f314462a 100644
@@ -1777,6 +1777,7 @@ 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)
 {
hw/usb/meson.build +6 -2
index 817f3e027a..3ca6127937 100644
@@ -72,8 +72,12 @@ if usbredir.found()
 endif
 
 # usb pass-through
-softmmu_ss.add(when: ['CONFIG_USB', libusb],
-               if_true: files('host-libusb.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'))
 
Signature · 1 line
2.31.1
#39 lore raw

Re: [PULL 37/48] usb: build usb-host as module

adding libvirt-list

Quoted 4 lines · Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

Drop one more shared library dependency (libusb) from core qemu.

Quoted 8 lines

Message-Id: <[email protected]>

---
 hw/usb/host-libusb.c | 1 +
 hw/usb/meson.build   | 8 ++++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

After this commit libvirt is no longer detecting the 'hostdevice' property of 'usb-host'. In fact 'device-list-properties' is returning:

"desc": "Device 'usb-host' not found"

Quoted 17 lines
hw/usb/host-libusb.c +1 -0
index 2b7f87872c..c0f314462a 100644
@@ -1777,6 +1777,7 @@ 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)
 {
hw/usb/meson.build +0 -0
index 817f3e027a..3ca6127937 100644

hw/usb/meson.build if usbredir.found() · line 75

Quoted 6 lines
hw/usb/meson.build +1 -2
@@ -72,8 +72,12 @@ if usbredir.found()
 endif
 
 # usb pass-through
-softmmu_ss.add(when: ['CONFIG_USB', libusb],
-               if_true: files('host-libusb.c'))
+if config_host.has_key('CONFIG_USB_LIBUSB')

The problem is in this condition as it's evaluated as false. When I replace it with libusb.found(), everything works as it used to.

Unfortunately I don't know what the real goa behind using CONFIG_USB_LIBUSB here was to see whether my approach is good.

Quoted 13 lines
hw/usb/meson.build +5 -0
+  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'))
 
Signature · 1 line
2.31.1
#40 lore raw

Re: [PULL 37/48] usb: build usb-host as module

Quoted 4 lines
Quoted 1 line

+if config_host.has_key('CONFIG_USB_LIBUSB')

The problem is in this condition as it's evaluated as false. When I replace it with libusb.found(), everything works as it used to.

Correct fix, paolo has a pending pull request containing it.

Quoted 2 lines

Unfortunately I don't know what the real goa behind using CONFIG_USB_LIBUSB here was to see whether my approach is good.

Used to be the correct approach before libusb detection was switched from configure to meson.

take care,
Gerd

#41 lore raw

[PULL 25/48] modules: add documentation for module sourcesets

In reply to Paolo Bonzini

From: Gerd Hoffmann <[email protected]>

Message-Id: <[email protected]>

---
 docs/devel/build-system.rst | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
docs/devel/build-system.rst +17 -0
index 7ef36f42d0..fd1650442e 100644
@@ -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
Signature · 1 line
2.31.1
#42 lore raw

[PULL 43/48] meson: switch function tests from compilation to linking

In reply to Paolo Bonzini

Some tests for glibc functions cause compilation to emit warnings but still succeed even if the function is not there. Therefore, change from cc.compiles to cc.links.

---
 meson.build | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
meson.build +9 -9
index d9aa2d7820..5a56e3fe2f 100644
@@ -1340,10 +1340,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
@@ -1352,22 +1352,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>
 
@@ -1376,16 +1376,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>
Signature · 1 line
2.31.1
#43 lore raw

[PULL 39/48] target/i386: Added MSRPM and IOPM size check

In reply to Paolo Bonzini

From: Lara Lazier <[email protected]>

The address of the last entry in the MSRPM and
in the IOPM must be smaller than the largest physical address. (APM2 15.10-15.11)

Message-Id: <[email protected]>

---
 target/i386/svm.h                   |  3 +++
 target/i386/tcg/sysemu/svm_helper.c | 15 +++++++++++++++
 2 files changed, 18 insertions(+)
target/i386/svm.h +3 -0
index 5098733053..adc058dc76 100644
@@ -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;
target/i386/tcg/sysemu/svm_helper.c +15 -0
index 1c2dbc1862..fa701829e5 100644
@@ -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)) {
Signature · 1 line
2.31.1
#44 lore raw

[PULL 41/48] target/i386: fix exceptions for MOV to DR

In reply to Paolo Bonzini

Use raise_exception_ra (without error code) when raising the illegal opcode operation; raise #GP when setting bits 63:32 of DR6 or DR7.

Move helper_get_dr to sysemu/ since it is a privileged instruction that is not needed on user-mode emulators.

---
 target/i386/cpu.h                   |  2 ++
 target/i386/helper.h                |  3 +-
 target/i386/svm.h                   |  2 --
 target/i386/tcg/bpt_helper.c        | 21 -------------
 target/i386/tcg/sysemu/bpt_helper.c | 47 ++++++++++++++++++-----------
 target/i386/tcg/sysemu/svm_helper.c |  4 +--
 target/i386/tcg/translate.c         |  1 +
 7 files changed, 35 insertions(+), 45 deletions(-)
target/i386/cpu.h +2 -0
index 0f7ddbfeae..8f3747dd28 100644
@@ -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
target/i386/helper.h +1 -2
index f3d8c3f949..574ff75615 100644
@@ -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)
target/i386/svm.h +0 -2
index 4bde9f3475..adc058dc76 100644
@@ -140,8 +140,6 @@
 #define SVM_MSRPM_SIZE		(1ULL << 13)
 #define SVM_IOPM_SIZE		((1ULL << 13) + 1)
 
-#define SVM_DR_RESERVED_MASK 0xffffffff00000000ULL
-
 struct QEMU_PACKED vmcb_control_area {
 	uint16_t intercept_cr_read;
 	uint16_t intercept_cr_write;
target/i386/tcg/bpt_helper.c +0 -21
index 83cd89581e..b6c1fff16e 100644
@@ -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());
-}
target/i386/tcg/sysemu/bpt_helper.c +29 -18

64 lines not on this page · raw message

target/i386/tcg/sysemu/svm_helper.c +2 -2
index 047f31628e..00618cff23 100644
@@ -270,10 +270,10 @@ void helper_vmrun(CPUX86State *env, int aflag, int next_eip_addend)
                           env->vm_vmcb + offsetof(struct vmcb, save.dr6));
 
 #ifdef TARGET_X86_64
-    if (env->dr[6] & SVM_DR_RESERVED_MASK) {
+    if (env->dr[6] & DR_RESERVED_MASK) {
         cpu_vmexit(env, SVM_EXIT_ERR, 0, GETPC());
     }
-    if (env->dr[7] & SVM_DR_RESERVED_MASK) {
+    if (env->dr[7] & DR_RESERVED_MASK) {
         cpu_vmexit(env, SVM_EXIT_ERR, 0, GETPC());
     }
 #endif
target/i386/tcg/translate.c +1 -0
index b21873ed23..9e445b9bf0 100644
@@ -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)
Signature · 1 line
2.31.1
#45 lore raw

[PULL 42/48] vl: fix leak of qdict_crumple return value

In reply to Paolo Bonzini

Coverity reports that qemu_parse_config_group is returning without unrefing the "crumpled" dictionary in case its top level item is a list. But actually the contract with qemu_record_config_group is the same as for qemu_parse_config_group itself: if those function need to stash the dictionary they get, they have to take a reference themselves (currently this is never the case for either function). Therefore, just add an unconditional qobject_unref(crumpled) to qemu_parse_config_group.

---
 softmmu/vl.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
softmmu/vl.c +9 -4
index 2004d57108..4df1496101 100644
@@ -2193,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)
Signature · 1 line
2.31.1
#46 lore raw

[PULL 44/48] meson: Introduce target-specific Kconfig

In reply to Paolo Bonzini

From: Philippe Mathieu-Daudé <[email protected]>

Add a target-specific Kconfig. We need the definitions in Kconfig so the minikconf tool can verify they exits. However CONFIG_FOO is only enabled for target foo via the meson.build rules.

Two architecture have a particularity, ARM and MIPS. As their translators have been split you can potentially build a plain 32 bit build along with a 64-bit version including the 32-bit subset.

Message-Id: <[email protected]>

Message-Id: <[email protected]>

---
 Kconfig                   |  1 +
 meson.build               |  3 ++-
 target/Kconfig            | 19 +++++++++++++++++++
 target/alpha/Kconfig      |  2 ++
 target/arm/Kconfig        |  6 ++++++
 target/avr/Kconfig        |  2 ++
 target/cris/Kconfig       |  2 ++
 target/hppa/Kconfig       |  2 ++
 target/i386/Kconfig       |  5 +++++
 target/m68k/Kconfig       |  2 ++
 target/microblaze/Kconfig |  2 ++
 target/mips/Kconfig       |  6 ++++++
 target/nios2/Kconfig      |  2 ++
 target/openrisc/Kconfig   |  2 ++
 target/ppc/Kconfig        |  5 +++++
 target/riscv/Kconfig      |  5 +++++
 target/rx/Kconfig         |  2 ++
 target/s390x/Kconfig      |  2 ++
 target/sh4/Kconfig        |  2 ++
 target/sparc/Kconfig      |  5 +++++
 target/tricore/Kconfig    |  2 ++
 target/xtensa/Kconfig     |  2 ++
 22 files changed, 80 insertions(+), 1 deletion(-)
 create mode 100644 target/Kconfig
 create mode 100644 target/alpha/Kconfig
 create mode 100644 target/arm/Kconfig
 create mode 100644 target/avr/Kconfig
 create mode 100644 target/cris/Kconfig
 create mode 100644 target/hppa/Kconfig
 create mode 100644 target/i386/Kconfig
 create mode 100644 target/m68k/Kconfig
 create mode 100644 target/microblaze/Kconfig
 create mode 100644 target/mips/Kconfig
 create mode 100644 target/nios2/Kconfig
 create mode 100644 target/openrisc/Kconfig
 create mode 100644 target/ppc/Kconfig
 create mode 100644 target/riscv/Kconfig
 create mode 100644 target/rx/Kconfig
 create mode 100644 target/s390x/Kconfig
 create mode 100644 target/sh4/Kconfig
 create mode 100644 target/sparc/Kconfig
 create mode 100644 target/tricore/Kconfig
 create mode 100644 target/xtensa/Kconfig
Kconfig +1 -0
index d52ebd839b..fb6a24a2de 100644
@@ -1,5 +1,6 @@
 source Kconfig.host
 source backends/Kconfig
 source accel/Kconfig
+source target/Kconfig
 source hw/Kconfig
 source semihosting/Kconfig
meson.build +2 -1
index 5a56e3fe2f..d82f7a789d 100644
@@ -1604,7 +1604,8 @@ foreach target : target_dirs
       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)
target/Kconfig new file +19 -0
new file mode 100644
index 0000000000..ae7f24fc66
@@ -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
target/alpha/Kconfig new file +2 -0
new file mode 100644
index 0000000000..267222c05b
@@ -0,0 +1,2 @@
+config ALPHA
+    bool
target/arm/Kconfig new file +6 -0
new file mode 100644
index 0000000000..3f3394a22b
@@ -0,0 +1,6 @@
+config ARM
+    bool
+
+config AARCH64
+    bool
+    select ARM
target/avr/Kconfig new file +2 -0
new file mode 100644
index 0000000000..155592d353
@@ -0,0 +1,2 @@
+config AVR
+    bool
target/cris/Kconfig new file +2 -0
new file mode 100644
index 0000000000..3fdc309fbb
@@ -0,0 +1,2 @@
+config CRIS
+    bool
target/hppa/Kconfig new file +2 -0
new file mode 100644
index 0000000000..395a35d799
@@ -0,0 +1,2 @@
+config HPPA
+    bool
target/i386/Kconfig new file +5 -0
new file mode 100644
index 0000000000..ce6968906e
@@ -0,0 +1,5 @@
+config I386
+    bool
+
+config X86_64
+    bool
target/m68k/Kconfig new file +2 -0
new file mode 100644
index 0000000000..23debad519
@@ -0,0 +1,2 @@
+config M68K
+    bool
target/microblaze/Kconfig new file +2 -0
new file mode 100644
index 0000000000..a5410d9218
@@ -0,0 +1,2 @@
+config MICROBLAZE
+    bool
target/mips/Kconfig new file +6 -0
new file mode 100644
index 0000000000..6adf145354
@@ -0,0 +1,6 @@
+config MIPS
+    bool
+
+config MIPS64
+    bool
+    select MIPS
target/nios2/Kconfig new file +2 -0
new file mode 100644
index 0000000000..1529ab8950
@@ -0,0 +1,2 @@
+config NIOS2
+    bool
target/openrisc/Kconfig new file +2 -0
new file mode 100644
index 0000000000..e0da4ac1df
@@ -0,0 +1,2 @@
+config OPENRISC
+    bool
target/ppc/Kconfig new file +5 -0
new file mode 100644
index 0000000000..3ff152051a
@@ -0,0 +1,5 @@
+config PPC
+    bool
+
+config PPC64
+    bool
target/riscv/Kconfig new file +5 -0
new file mode 100644
index 0000000000..b9e5932f13
@@ -0,0 +1,5 @@
+config RISCV32
+    bool
+
+config RISCV64
+    bool
target/rx/Kconfig new file +2 -0
new file mode 100644
index 0000000000..aceb5ed28f
@@ -0,0 +1,2 @@
+config RX
+    bool
target/s390x/Kconfig new file +2 -0
new file mode 100644
index 0000000000..72da48136c
@@ -0,0 +1,2 @@
+config S390X
+    bool
target/sh4/Kconfig new file +2 -0
new file mode 100644
index 0000000000..2397c86028
@@ -0,0 +1,2 @@
+config SH4
+    bool
target/sparc/Kconfig new file +5 -0
new file mode 100644
index 0000000000..70cc0f3a21
@@ -0,0 +1,5 @@
+config SPARC
+    bool
+
+config SPARC64
+    bool
target/tricore/Kconfig new file +2 -0
new file mode 100644
index 0000000000..9313409309
@@ -0,0 +1,2 @@
+config TRICORE
+    bool
target/xtensa/Kconfig new file +2 -0
new file mode 100644
index 0000000000..a3c8dc7f6d
@@ -0,0 +1,2 @@
+config XTENSA
+    bool
Signature · 1 line
2.31.1
#47 lore raw

Re: [PULL 44/48] meson: Introduce target-specific Kconfig

Quoted 11 lines · Paolo Bonzini

From: Philippe Mathieu-Daudé <[email protected]>

Add a target-specific Kconfig. We need the definitions in Kconfig so the minikconf tool can verify they exits. However CONFIG_FOO is only enabled for target foo via the meson.build rules.

Two architecture have a particularity, ARM and MIPS. As their translators have been split you can potentially build a plain 32 bit build along with a 64-bit version including the 32-bit subset.

Quoted 6 lines

Message-Id: <[email protected]>

Message-Id: <[email protected]>

Hi; this change (commit f4063f9c319e392 in master) seems to have resulted in qemu-system-tricore no longer building the 'tricore_testboard'. Before this commit:

$ ./build/tricore/qemu-system-tricore -M help
Supported machines are:
KIT_AURIX_TC277_TRB  Infineon AURIX TriBoard TC277 (D-Step)
none                 empty machine
tricore_testboard    a minimal TriCore board

After this commit, 'tricore_testboard' no longer appears in the list. The hw/tricore/meson.build uses "when: 'CONFIG_TRICORE'" to compile the source files for the board, so presumably that CONFIG switch is no longer being defined ?

This in turn breaks 'make check-tcg' for builds which build tricore-softmmu, because some of the tests there want to run code on the tricore_testboard:

[...]
RUN tests for tricore
TEST test_abs.tst on tricore
qemu-system-tricore: unsupported machine type
Use -machine help to list supported machines ../Makefile.target:168: recipe for target 'run-test_abs.tst' failed

(I guess we're not running "check-tcg" in gitlab CI. I do run it locally, but only on a linux-user-only build tree, which is why I didn't see this earlier.)

thanks
-- PMM

#48 lore raw

Re: [PULL 44/48] meson: Introduce target-specific Kconfig

Quoted 30 lines · Peter Maydell
Quoted 11 lines · Paolo Bonzini

From: Philippe Mathieu-Daudé <[email protected]>

Add a target-specific Kconfig. We need the definitions in Kconfig so the minikconf tool can verify they exits. However CONFIG_FOO is only enabled for target foo via the meson.build rules.

Two architecture have a particularity, ARM and MIPS. As their translators have been split you can potentially build a plain 32 bit build along with a 64-bit version including the 32-bit subset.

Quoted 6 lines

Message-Id: <[email protected]>

Message-Id: <[email protected]>

Hi; this change (commit f4063f9c319e392 in master) seems to have resulted in qemu-system-tricore no longer building the 'tricore_testboard'. Before this commit:

$ ./build/tricore/qemu-system-tricore -M help
Supported machines are:
KIT_AURIX_TC277_TRB  Infineon AURIX TriBoard TC277 (D-Step)
none                 empty machine
tricore_testboard    a minimal TriCore board
Quoted 4 lines

After this commit, 'tricore_testboard' no longer appears in the list. The hw/tricore/meson.build uses "when: 'CONFIG_TRICORE'" to compile the source files for the board, so presumably that CONFIG switch is no longer being defined ?

This seems to be caused because when "CONFIG_FOO=y" is passed on the minikconf commandline it doesn't appear in the output (though it is not ignored entirely, because other config options that FOO selects do appear in the output). For example from my meson-logs/meson-log.txt:

Configuring arm-softmmu-config-devices.mak with command
Running command: /usr/bin/python3 /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/scripts/minikconf.py
--defconfig arm-softmmu-config-devices.mak /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/x86/meson-private/arm-softmmu-config-devices.mak.d /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/configs/devices/arm-softmmu/default.mak /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/Kconfig CONFIG_TPM=y
CONFIG_SPICE=y CONFIG_IVSHMEM=y CONFIG_OPENGL=y CONFIG_X11=y
CONFIG_VHOST_USER=y CONFIG_VHOST_VDPA=y CONFIG_VHOST_KERNEL=y
CONFIG_VIRTFS=y CONFIG_LINUX=y CONFIG_MULTIPROCESS_ALLOWED=y
CONFIG_TCG=y CONFIG_ARM=y
--- stdout ---
CONFIG_A15MPCORE=y
CONFIG_A9MPCORE=y
[etc]

CONFIG_ARM doesn't apper in the stdout, and so it's not possible to use it to select something in meson. None of the other CONFIG_* passed on the commandline appear in stdout either.

If you look at the aarch64 version:
Running command: /usr/bin/python3 /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/scripts/minikconf.py
--defconfig aarch64-softmmu-config-devices.mak /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/x86/meson-private/aarch64-softmmu-config-devices.mak.d /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/configs/devices/aarch64-softmmu/default.mak /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/Kconfig CONFIG_TPM=y
CONFIG_SPICE=y CONFIG_IVSHMEM=y CONFIG_OPENGL=y CONFIG_X11=y
CONFIG_VHOST_USER=y CONFIG_VHOST_VDPA=y CONFIG_VHOST_KERNEL=y
CONFIG_VIRTFS=y CONFIG_LINUX=y CONFIG_MULTIPROCESS_ALLOWED=y
CONFIG_TCG=y CONFIG_AARCH64=y

CONFIG_AARCH64 doesn't appear in the output, but CONFIG_ARM does (because AARCH64 selects it).

The only board that gets hit by this is tricore, because as it happens we don't try to gate anything else on CONFIG_$ARCH. (Which raises the question of what these CONFIG flags are for in the first place...)

thanks
-- PMM

#49 lore raw

[PULL 46/48] hw/arm: move CONFIG_V7M out of default-devices

In reply to Paolo Bonzini

From: Alex Bennée <[email protected]>

We currently select CONFIG_V7M for a bunch of our m-profile devices. The last sticking point is translate.c which cannot be compiled without expecting v7m support. Express this dependency in Kconfig rather than in default devices as a stepping stone to a fully configurable translate.c.

While we are at it we also need to select ARM_COMPATIBLE_SEMIHOSTING as that is implied for M profile machines.

Message-Id: <[email protected]>

---
 default-configs/devices/arm-softmmu.mak | 3 ---
 hw/arm/Kconfig                          | 3 +++
 2 files changed, 3 insertions(+), 3 deletions(-)
default-configs/devices/arm-softmmu.mak +0 -3
index 0500156a0c..4114aa9e35 100644
@@ -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
 
hw/arm/Kconfig +3 -0
index 528f71bb9d..062fe94b64 100644
@@ -296,7 +296,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
Signature · 1 line
2.31.1
#50 lore raw

[PULL 45/48] hw/arm: add dependency on OR_IRQ for XLNX_VERSAL

In reply to Paolo Bonzini

From: Alex Bennée <[email protected]>

We need this functionality due to:

    /* XRAM IRQs get ORed into a single line.  */
    object_initialize_child(OBJECT(s), "xram-irq-orgate",
                            &s->lpd.xram.irq_orgate, TYPE_OR_IRQ);
Fixes a55b441b2ca ("hw/arm: versal: Add support for the XRAMs")

Message-Id: <[email protected]>

---
 hw/arm/Kconfig | 1 +
 1 file changed, 1 insertion(+)
hw/arm/Kconfig +1 -0
index 647b5c8b43..528f71bb9d 100644
@@ -368,6 +368,7 @@ config XLNX_VERSAL
     select UNIMP
     select XLNX_ZDMA
     select XLNX_ZYNQMP
+    select OR_IRQ
 
 config NPCM7XX
     bool
Signature · 1 line
2.31.1
#51 lore raw

[PULL 48/48] configure: allow the selection of alternate config in the build

In reply to Paolo Bonzini

From: Alex Bennée <[email protected]>

While the default config works well enough it does end up enabling a lot of stuff. For more minimal builds we can select a different list of devices and let Kconfig work out what we want. For example:

  ../../configure --without-default-features \
    --target-list=arm-softmmu,aarch64-softmmu \
    --with-devices-aarch64=minimal

will override the aarch64-softmmu default set of devices with a more minimal set of devices that just enables the virt and sbsa-ref models.

Cc Philippe Mathieu-Daudé <[email protected]>
Cc Paolo Bonzini <[email protected]>

Message-Id: <[email protected]>

---
 configs/devices/aarch64-softmmu/minimal.mak |  9 ++++++++
 configure                                   | 24 ++++++++++++++++++++-
 meson.build                                 |  3 ++-
 3 files changed, 34 insertions(+), 2 deletions(-)
 create mode 100644 configs/devices/aarch64-softmmu/minimal.mak
configs/devices/aarch64-softmmu/minimal.mak new file +9 -0
new file mode 100644
index 0000000000..0ebc1dca56
@@ -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
configure +23 -1
index 4eba89f823..85db248ac1 100755
@@ -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"
@@ -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
@@ -5082,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
meson.build +2 -1
index 71c7462e89..651c3b114b 100644
@@ -1595,9 +1595,10 @@ 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: ['configs/devices' / target / 'default.mak', 'Kconfig'],
+      input: ['configs/devices' / target / config_input + '.mak', 'Kconfig'],
       output: config_devices_mak,
       depfile: config_devices_mak + '.d',
       capture: true,
Signature · 1 line
2.31.1
#52 lore raw

[PULL 47/48] configs: rename default-configs to configs and reorganise

In reply to Paolo Bonzini

From: Alex Bennée <[email protected]>

In preparation for offering variation to our build configurations lets move everything and rename it to default. Common included base configs are also renamed.

During the cleanup the stale usb.mak and pci.mak references were removed from MAINTAINERS.

Message-Id: <[email protected]>

---
 MAINTAINERS                                   | 22 +++++++++----------
 .../devices/aarch64-softmmu/default.mak       |  2 +-
 .../devices/alpha-softmmu/default.mak         |  0
 .../devices/arm-softmmu/default.mak           |  0
 .../devices/avr-softmmu/default.mak           |  0
 .../devices/cris-softmmu/default.mak          |  0
 .../devices/hppa-softmmu/default.mak          |  0
 .../devices/i386-softmmu/default.mak          |  0
 .../devices/m68k-softmmu/default.mak          |  0
 .../devices/microblaze-softmmu/default.mak    |  0
 .../devices/microblazeel-softmmu/default.mak  |  2 +-
 .../devices/mips-softmmu/common.mak           |  0
 .../devices/mips-softmmu/default.mak          |  2 +-
 .../devices/mips64-softmmu/default.mak        |  2 +-
 .../devices/mips64el-softmmu/default.mak      |  2 +-
 .../devices/mipsel-softmmu/default.mak        |  2 +-
 .../devices/nios2-softmmu/default.mak         |  0
 .../devices/or1k-softmmu/default.mak          |  0
 .../devices/ppc-softmmu/default.mak           |  0
 .../devices/ppc64-softmmu/default.mak         |  2 +-
 .../devices/riscv32-softmmu/default.mak       |  0
 .../devices/riscv64-softmmu/default.mak       |  0
 .../devices/rx-softmmu/default.mak            |  0
 .../devices/s390x-softmmu/default.mak         |  0
 .../devices/sh4-softmmu/default.mak           |  0
 .../devices/sh4eb-softmmu/default.mak         |  2 +-
 .../devices/sparc-softmmu/default.mak         |  0
 .../devices/sparc64-softmmu/default.mak       |  0
 .../devices/tricore-softmmu/default.mak       |  0
 .../devices/x86_64-softmmu/default.mak        |  2 +-
 .../devices/xtensa-softmmu/default.mak        |  0
 configs/devices/xtensaeb-softmmu/default.mak  |  3 +++
 .../targets/aarch64-linux-user.mak            |  0
 .../targets/aarch64-softmmu.mak               |  0
 .../targets/aarch64_be-linux-user.mak         |  0
 .../targets/alpha-linux-user.mak              |  0
 .../targets/alpha-softmmu.mak                 |  0
 .../targets/arm-linux-user.mak                |  0
 .../targets/arm-softmmu.mak                   |  0
 .../targets/armeb-linux-user.mak              |  0
 .../targets/avr-softmmu.mak                   |  0
 .../targets/cris-linux-user.mak               |  0
 .../targets/cris-softmmu.mak                  |  0
 .../targets/hexagon-linux-user.mak            |  0
 .../targets/hppa-linux-user.mak               |  0
 .../targets/hppa-softmmu.mak                  |  0
 .../targets/i386-bsd-user.mak                 |  0
 .../targets/i386-linux-user.mak               |  0
 .../targets/i386-softmmu.mak                  |  0
 .../targets/m68k-linux-user.mak               |  0
 .../targets/m68k-softmmu.mak                  |  0
 .../targets/microblaze-linux-user.mak         |  0
 .../targets/microblaze-softmmu.mak            |  0
 .../targets/microblazeel-linux-user.mak       |  0
 .../targets/microblazeel-softmmu.mak          |  0
 .../targets/mips-linux-user.mak               |  0
 .../targets/mips-softmmu.mak                  |  0
 .../targets/mips64-linux-user.mak             |  0
 .../targets/mips64-softmmu.mak                |  0
 .../targets/mips64el-linux-user.mak           |  0
 .../targets/mips64el-softmmu.mak              |  0
 .../targets/mipsel-linux-user.mak             |  0
 .../targets/mipsel-softmmu.mak                |  0
 .../targets/mipsn32-linux-user.mak            |  0
 .../targets/mipsn32el-linux-user.mak          |  0
 .../targets/nios2-linux-user.mak              |  0
 .../targets/nios2-softmmu.mak                 |  0
 .../targets/or1k-linux-user.mak               |  0
 .../targets/or1k-softmmu.mak                  |  0
 .../targets/ppc-linux-user.mak                |  0
 .../targets/ppc-softmmu.mak                   |  0
 .../targets/ppc64-linux-user.mak              |  0
 .../targets/ppc64-softmmu.mak                 |  0
 .../targets/ppc64abi32-linux-user.mak         |  0
 .../targets/ppc64le-linux-user.mak            |  0
 .../targets/riscv32-linux-user.mak            |  0
 .../targets/riscv32-softmmu.mak               |  0
 .../targets/riscv64-linux-user.mak            |  0
 .../targets/riscv64-softmmu.mak               |  0
 .../targets/rx-softmmu.mak                    |  0
 .../targets/s390x-linux-user.mak              |  0
 .../targets/s390x-softmmu.mak                 |  0
 .../targets/sh4-linux-user.mak                |  0
 .../targets/sh4-softmmu.mak                   |  0
 .../targets/sh4eb-linux-user.mak              |  0
 .../targets/sh4eb-softmmu.mak                 |  0
 .../targets/sparc-linux-user.mak              |  0
 .../targets/sparc-softmmu.mak                 |  0
 .../targets/sparc32plus-linux-user.mak        |  0
 .../targets/sparc64-linux-user.mak            |  0
 .../targets/sparc64-softmmu.mak               |  0
 .../targets/tricore-softmmu.mak               |  0
 .../targets/x86_64-bsd-user.mak               |  0
 .../targets/x86_64-linux-user.mak             |  0
 .../targets/x86_64-softmmu.mak                |  0
 .../targets/xtensa-linux-user.mak             |  0
 .../targets/xtensa-softmmu.mak                |  0
 .../targets/xtensaeb-linux-user.mak           |  0
 .../targets/xtensaeb-softmmu.mak              |  0
 configure                                     |  6 ++---
 default-configs/devices/xtensaeb-softmmu.mak  |  3 ---
 meson.build                                   |  4 ++--
 tests/Makefile.include                        |  2 +-
 103 files changed, 28 insertions(+), 30 deletions(-)
 rename default-configs/devices/aarch64-softmmu.mak => configs/devices/aarch64-softmmu/default.mak (82%)
 rename default-configs/devices/alpha-softmmu.mak => configs/devices/alpha-softmmu/default.mak (100%)
 rename default-configs/devices/arm-softmmu.mak => configs/devices/arm-softmmu/default.mak (100%)
 rename default-configs/devices/avr-softmmu.mak => configs/devices/avr-softmmu/default.mak (100%)
 rename default-configs/devices/cris-softmmu.mak => configs/devices/cris-softmmu/default.mak (100%)
 rename default-configs/devices/hppa-softmmu.mak => configs/devices/hppa-softmmu/default.mak (100%)
 rename default-configs/devices/i386-softmmu.mak => configs/devices/i386-softmmu/default.mak (100%)
 rename default-configs/devices/m68k-softmmu.mak => configs/devices/m68k-softmmu/default.mak (100%)
 rename default-configs/devices/microblaze-softmmu.mak => configs/devices/microblaze-softmmu/default.mak (100%)
 rename default-configs/devices/microblazeel-softmmu.mak => configs/devices/microblazeel-softmmu/default.mak (54%)
 rename default-configs/devices/mips-softmmu-common.mak => configs/devices/mips-softmmu/common.mak (100%)
 rename default-configs/devices/mips-softmmu.mak => configs/devices/mips-softmmu/default.mak (56%)
 rename default-configs/devices/mips64-softmmu.mak => configs/devices/mips64-softmmu/default.mak (62%)
 rename default-configs/devices/mips64el-softmmu.mak => configs/devices/mips64el-softmmu/default.mak (88%)
 rename default-configs/devices/mipsel-softmmu.mak => configs/devices/mipsel-softmmu/default.mak (55%)
 rename default-configs/devices/nios2-softmmu.mak => configs/devices/nios2-softmmu/default.mak (100%)
 rename default-configs/devices/or1k-softmmu.mak => configs/devices/or1k-softmmu/default.mak (100%)
 rename default-configs/devices/ppc-softmmu.mak => configs/devices/ppc-softmmu/default.mak (100%)
 rename default-configs/devices/ppc64-softmmu.mak => configs/devices/ppc64-softmmu/default.mak (79%)
 rename default-configs/devices/riscv32-softmmu.mak => configs/devices/riscv32-softmmu/default.mak (100%)
 rename default-configs/devices/riscv64-softmmu.mak => configs/devices/riscv64-softmmu/default.mak (100%)
 rename default-configs/devices/rx-softmmu.mak => configs/devices/rx-softmmu/default.mak (100%)
 rename default-configs/devices/s390x-softmmu.mak => configs/devices/s390x-softmmu/default.mak (100%)
 rename default-configs/devices/sh4-softmmu.mak => configs/devices/sh4-softmmu/default.mak (100%)
 rename default-configs/devices/sh4eb-softmmu.mak => configs/devices/sh4eb-softmmu/default.mak (55%)
 rename default-configs/devices/sparc-softmmu.mak => configs/devices/sparc-softmmu/default.mak (100%)
 rename default-configs/devices/sparc64-softmmu.mak => configs/devices/sparc64-softmmu/default.mak (100%)
 rename default-configs/devices/tricore-softmmu.mak => configs/devices/tricore-softmmu/default.mak (100%)
 rename default-configs/devices/x86_64-softmmu.mak => configs/devices/x86_64-softmmu/default.mak (55%)
 rename default-configs/devices/xtensa-softmmu.mak => configs/devices/xtensa-softmmu/default.mak (100%)
 create mode 100644 configs/devices/xtensaeb-softmmu/default.mak
 rename {default-configs => configs}/targets/aarch64-linux-user.mak (100%)
 rename {default-configs => configs}/targets/aarch64-softmmu.mak (100%)
 rename {default-configs => configs}/targets/aarch64_be-linux-user.mak (100%)
 rename {default-configs => configs}/targets/alpha-linux-user.mak (100%)
 rename {default-configs => configs}/targets/alpha-softmmu.mak (100%)
 rename {default-configs => configs}/targets/arm-linux-user.mak (100%)
 rename {default-configs => configs}/targets/arm-softmmu.mak (100%)
 rename {default-configs => configs}/targets/armeb-linux-user.mak (100%)
 rename {default-configs => configs}/targets/avr-softmmu.mak (100%)
 rename {default-configs => configs}/targets/cris-linux-user.mak (100%)
 rename {default-configs => configs}/targets/cris-softmmu.mak (100%)
 rename {default-configs => configs}/targets/hexagon-linux-user.mak (100%)
 rename {default-configs => configs}/targets/hppa-linux-user.mak (100%)
 rename {default-configs => configs}/targets/hppa-softmmu.mak (100%)
 rename {default-configs => configs}/targets/i386-bsd-user.mak (100%)
 rename {default-configs => configs}/targets/i386-linux-user.mak (100%)
 rename {default-configs => configs}/targets/i386-softmmu.mak (100%)
 rename {default-configs => configs}/targets/m68k-linux-user.mak (100%)
 rename {default-configs => configs}/targets/m68k-softmmu.mak (100%)
 rename {default-configs => configs}/targets/microblaze-linux-user.mak (100%)
 rename {default-configs => configs}/targets/microblaze-softmmu.mak (100%)
 rename {default-configs => configs}/targets/microblazeel-linux-user.mak (100%)
 rename {default-configs => configs}/targets/microblazeel-softmmu.mak (100%)
 rename {default-configs => configs}/targets/mips-linux-user.mak (100%)
 rename {default-configs => configs}/targets/mips-softmmu.mak (100%)
 rename {default-configs => configs}/targets/mips64-linux-user.mak (100%)
 rename {default-configs => configs}/targets/mips64-softmmu.mak (100%)
 rename {default-configs => configs}/targets/mips64el-linux-user.mak (100%)
 rename {default-configs => configs}/targets/mips64el-softmmu.mak (100%)
 rename {default-configs => configs}/targets/mipsel-linux-user.mak (100%)
 rename {default-configs => configs}/targets/mipsel-softmmu.mak (100%)
 rename {default-configs => configs}/targets/mipsn32-linux-user.mak (100%)
 rename {default-configs => configs}/targets/mipsn32el-linux-user.mak (100%)
 rename {default-configs => configs}/targets/nios2-linux-user.mak (100%)
 rename {default-configs => configs}/targets/nios2-softmmu.mak (100%)
 rename {default-configs => configs}/targets/or1k-linux-user.mak (100%)
 rename {default-configs => configs}/targets/or1k-softmmu.mak (100%)
 rename {default-configs => configs}/targets/ppc-linux-user.mak (100%)
 rename {default-configs => configs}/targets/ppc-softmmu.mak (100%)
 rename {default-configs => configs}/targets/ppc64-linux-user.mak (100%)
 rename {default-configs => configs}/targets/ppc64-softmmu.mak (100%)
 rename {default-configs => configs}/targets/ppc64abi32-linux-user.mak (100%)
 rename {default-configs => configs}/targets/ppc64le-linux-user.mak (100%)
 rename {default-configs => configs}/targets/riscv32-linux-user.mak (100%)
 rename {default-configs => configs}/targets/riscv32-softmmu.mak (100%)
 rename {default-configs => configs}/targets/riscv64-linux-user.mak (100%)
 rename {default-configs => configs}/targets/riscv64-softmmu.mak (100%)
 rename {default-configs => configs}/targets/rx-softmmu.mak (100%)
 rename {default-configs => configs}/targets/s390x-linux-user.mak (100%)
 rename {default-configs => configs}/targets/s390x-softmmu.mak (100%)
 rename {default-configs => configs}/targets/sh4-linux-user.mak (100%)
 rename {default-configs => configs}/targets/sh4-softmmu.mak (100%)
 rename {default-configs => configs}/targets/sh4eb-linux-user.mak (100%)
 rename {default-configs => configs}/targets/sh4eb-softmmu.mak (100%)
 rename {default-configs => configs}/targets/sparc-linux-user.mak (100%)
 rename {default-configs => configs}/targets/sparc-softmmu.mak (100%)
 rename {default-configs => configs}/targets/sparc32plus-linux-user.mak (100%)
 rename {default-configs => configs}/targets/sparc64-linux-user.mak (100%)
 rename {default-configs => configs}/targets/sparc64-softmmu.mak (100%)
 rename {default-configs => configs}/targets/tricore-softmmu.mak (100%)
 rename {default-configs => configs}/targets/x86_64-bsd-user.mak (100%)
 rename {default-configs => configs}/targets/x86_64-linux-user.mak (100%)
 rename {default-configs => configs}/targets/x86_64-softmmu.mak (100%)
 rename {default-configs => configs}/targets/xtensa-linux-user.mak (100%)
 rename {default-configs => configs}/targets/xtensa-softmmu.mak (100%)
 rename {default-configs => configs}/targets/xtensaeb-linux-user.mak (100%)
 rename {default-configs => configs}/targets/xtensaeb-softmmu.mak (100%)
 delete mode 100644 default-configs/devices/xtensaeb-softmmu.mak
MAINTAINERS +10 -12
index 684142e12e..1810c082ca 100644
@@ -87,7 +87,7 @@ S390 general architecture support
 M: Cornelia Huck <[email protected]>
 M: Thomas Huth <[email protected]>
 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 <[email protected]>
 R: Aleksandar Rikalo <[email protected]>
 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 <[email protected]>
@@ -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 <[email protected]>
@@ -1041,7 +1041,7 @@ AVR Machines
 AVR MCUs
 M: Michael Rolnik <[email protected]>
 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
@@ -1069,7 +1069,7 @@ HP B160L
 M: Richard Henderson <[email protected]>
 R: Helge Deller <[email protected]>
 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
 
@@ -1496,7 +1496,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
@@ -1703,7 +1703,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 <[email protected]>
@@ -1808,7 +1807,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 <[email protected]>
@@ -2958,14 +2956,14 @@ M: Warner Losh <[email protected]>
 R: Kyle Evans <[email protected]>
 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 <[email protected]>
 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
configs/devices/aarch64-softmmu/default.mak renamed from default-configs/devices/aarch64-softmmu.mak +1 -1
similarity index 82%
rename from default-configs/devices/aarch64-softmmu.mak
rename to configs/devices/aarch64-softmmu/default.mak
index 958b1e08e4..cf43ac8da1 100644
@@ -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
configs/devices/alpha-softmmu/default.mak renamed from default-configs/devices/alpha-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/devices/alpha-softmmu.mak
rename to configs/devices/alpha-softmmu/default.mak
configs/devices/arm-softmmu/default.mak renamed from default-configs/devices/arm-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/devices/arm-softmmu.mak
rename to configs/devices/arm-softmmu/default.mak
configs/devices/avr-softmmu/default.mak renamed from default-configs/devices/avr-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/devices/avr-softmmu.mak
rename to configs/devices/avr-softmmu/default.mak
configs/devices/cris-softmmu/default.mak renamed from default-configs/devices/cris-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/devices/cris-softmmu.mak
rename to configs/devices/cris-softmmu/default.mak
configs/devices/hppa-softmmu/default.mak renamed from default-configs/devices/hppa-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/devices/hppa-softmmu.mak
rename to configs/devices/hppa-softmmu/default.mak
configs/devices/i386-softmmu/default.mak renamed from default-configs/devices/i386-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/devices/i386-softmmu.mak
rename to configs/devices/i386-softmmu/default.mak
configs/devices/m68k-softmmu/default.mak renamed from default-configs/devices/m68k-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/devices/m68k-softmmu.mak
rename to configs/devices/m68k-softmmu/default.mak
configs/devices/microblaze-softmmu/default.mak renamed from default-configs/devices/microblaze-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/devices/microblaze-softmmu.mak
rename to configs/devices/microblaze-softmmu/default.mak
configs/devices/microblazeel-softmmu/default.mak renamed from default-configs/devices/microblazeel-softmmu.mak +1 -1
similarity index 54%
rename from default-configs/devices/microblazeel-softmmu.mak
rename to configs/devices/microblazeel-softmmu/default.mak
index 2fcf442fc7..29f7f13816 100644
@@ -1,3 +1,3 @@
 # Default configuration for microblazeel-softmmu
 
-include microblaze-softmmu.mak
+include ../microblaze-softmmu/default.mak
configs/devices/mips-softmmu/common.mak renamed from default-configs/devices/mips-softmmu-common.mak +0 -0
similarity index 100%
rename from default-configs/devices/mips-softmmu-common.mak
rename to configs/devices/mips-softmmu/common.mak
configs/devices/mips-softmmu/default.mak renamed from default-configs/devices/mips-softmmu.mak +1 -1
similarity index 56%
rename from default-configs/devices/mips-softmmu.mak
rename to configs/devices/mips-softmmu/default.mak
index 9fede6e00f..c23d95a83a 100644
@@ -1,3 +1,3 @@
 # Default configuration for mips-softmmu
 
-include mips-softmmu-common.mak
+include common.mak
configs/devices/mips64-softmmu/default.mak renamed from default-configs/devices/mips64-softmmu.mak +1 -1
similarity index 62%
rename from default-configs/devices/mips64-softmmu.mak
rename to configs/devices/mips64-softmmu/default.mak
index a169738635..566672f3c2 100644
@@ -1,4 +1,4 @@
 # Default configuration for mips64-softmmu
 
-include mips-softmmu-common.mak
+include ../mips-softmmu/common.mak
 CONFIG_JAZZ=y
configs/devices/mips64el-softmmu/default.mak renamed from default-configs/devices/mips64el-softmmu.mak +1 -1
similarity index 88%
rename from default-configs/devices/mips64el-softmmu.mak
rename to configs/devices/mips64el-softmmu/default.mak
index 26c660a05c..c511a061ba 100644
@@ -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
configs/devices/mipsel-softmmu/default.mak renamed from default-configs/devices/mipsel-softmmu.mak +1 -1
similarity index 55%
rename from default-configs/devices/mipsel-softmmu.mak
rename to configs/devices/mipsel-softmmu/default.mak
index a7f6059484..009ccb0e2d 100644
@@ -1,3 +1,3 @@
 # Default configuration for mipsel-softmmu
 
-include mips-softmmu-common.mak
+include ../mips-softmmu/common.mak
configs/devices/nios2-softmmu/default.mak renamed from default-configs/devices/nios2-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/devices/nios2-softmmu.mak
rename to configs/devices/nios2-softmmu/default.mak
configs/devices/or1k-softmmu/default.mak renamed from default-configs/devices/or1k-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/devices/or1k-softmmu.mak
rename to configs/devices/or1k-softmmu/default.mak
configs/devices/ppc-softmmu/default.mak renamed from default-configs/devices/ppc-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/devices/ppc-softmmu.mak
rename to configs/devices/ppc-softmmu/default.mak
configs/devices/ppc64-softmmu/default.mak renamed from default-configs/devices/ppc64-softmmu.mak +1 -1
similarity index 79%
rename from default-configs/devices/ppc64-softmmu.mak
rename to configs/devices/ppc64-softmmu/default.mak
index cca52665d9..b90e5bf455 100644
@@ -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
configs/devices/riscv32-softmmu/default.mak renamed from default-configs/devices/riscv32-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/devices/riscv32-softmmu.mak
rename to configs/devices/riscv32-softmmu/default.mak
configs/devices/riscv64-softmmu/default.mak renamed from default-configs/devices/riscv64-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/devices/riscv64-softmmu.mak
rename to configs/devices/riscv64-softmmu/default.mak
configs/devices/rx-softmmu/default.mak renamed from default-configs/devices/rx-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/devices/rx-softmmu.mak
rename to configs/devices/rx-softmmu/default.mak
configs/devices/s390x-softmmu/default.mak renamed from default-configs/devices/s390x-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/devices/s390x-softmmu.mak
rename to configs/devices/s390x-softmmu/default.mak
configs/devices/sh4-softmmu/default.mak renamed from default-configs/devices/sh4-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/devices/sh4-softmmu.mak
rename to configs/devices/sh4-softmmu/default.mak
configs/devices/sh4eb-softmmu/default.mak renamed from default-configs/devices/sh4eb-softmmu.mak +1 -1
similarity index 55%
rename from default-configs/devices/sh4eb-softmmu.mak
rename to configs/devices/sh4eb-softmmu/default.mak
index 522a7a50fa..f18d1f6519 100644
@@ -1,3 +1,3 @@
 # Default configuration for sh4eb-softmmu
 
-include sh4-softmmu.mak
+include ../sh4-softmmu/default.mak
configs/devices/sparc-softmmu/default.mak renamed from default-configs/devices/sparc-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/devices/sparc-softmmu.mak
rename to configs/devices/sparc-softmmu/default.mak
configs/devices/sparc64-softmmu/default.mak renamed from default-configs/devices/sparc64-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/devices/sparc64-softmmu.mak
rename to configs/devices/sparc64-softmmu/default.mak
configs/devices/tricore-softmmu/default.mak renamed from default-configs/devices/tricore-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/devices/tricore-softmmu.mak
rename to configs/devices/tricore-softmmu/default.mak
configs/devices/x86_64-softmmu/default.mak renamed from default-configs/devices/x86_64-softmmu.mak +1 -1
similarity index 55%
rename from default-configs/devices/x86_64-softmmu.mak
rename to configs/devices/x86_64-softmmu/default.mak
index 64b2ee2960..ddfc2ea626 100644
@@ -1,3 +1,3 @@
 # Default configuration for x86_64-softmmu
 
-include i386-softmmu.mak
+include ../i386-softmmu/default.mak
configs/devices/xtensa-softmmu/default.mak renamed from default-configs/devices/xtensa-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/devices/xtensa-softmmu.mak
rename to configs/devices/xtensa-softmmu/default.mak
configs/devices/xtensaeb-softmmu/default.mak new file +3 -0
new file mode 100644
index 0000000000..00eafcc292
@@ -0,0 +1,3 @@
+# Default configuration for Xtensa
+
+include ../xtensa-softmmu/default.mak
configs/targets/aarch64-linux-user.mak renamed from default-configs/targets/aarch64-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/aarch64-linux-user.mak
rename to configs/targets/aarch64-linux-user.mak
configs/targets/aarch64-softmmu.mak renamed from default-configs/targets/aarch64-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/targets/aarch64-softmmu.mak
rename to configs/targets/aarch64-softmmu.mak
configs/targets/aarch64_be-linux-user.mak renamed from default-configs/targets/aarch64_be-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/aarch64_be-linux-user.mak
rename to configs/targets/aarch64_be-linux-user.mak
configs/targets/alpha-linux-user.mak renamed from default-configs/targets/alpha-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/alpha-linux-user.mak
rename to configs/targets/alpha-linux-user.mak
configs/targets/alpha-softmmu.mak renamed from default-configs/targets/alpha-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/targets/alpha-softmmu.mak
rename to configs/targets/alpha-softmmu.mak
configs/targets/arm-linux-user.mak renamed from default-configs/targets/arm-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/arm-linux-user.mak
rename to configs/targets/arm-linux-user.mak
configs/targets/arm-softmmu.mak renamed from default-configs/targets/arm-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/targets/arm-softmmu.mak
rename to configs/targets/arm-softmmu.mak
configs/targets/armeb-linux-user.mak renamed from default-configs/targets/armeb-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/armeb-linux-user.mak
rename to configs/targets/armeb-linux-user.mak
configs/targets/avr-softmmu.mak renamed from default-configs/targets/avr-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/targets/avr-softmmu.mak
rename to configs/targets/avr-softmmu.mak
configs/targets/cris-linux-user.mak renamed from default-configs/targets/cris-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/cris-linux-user.mak
rename to configs/targets/cris-linux-user.mak
configs/targets/cris-softmmu.mak renamed from default-configs/targets/cris-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/targets/cris-softmmu.mak
rename to configs/targets/cris-softmmu.mak
configs/targets/hexagon-linux-user.mak renamed from default-configs/targets/hexagon-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/hexagon-linux-user.mak
rename to configs/targets/hexagon-linux-user.mak
configs/targets/hppa-linux-user.mak renamed from default-configs/targets/hppa-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/hppa-linux-user.mak
rename to configs/targets/hppa-linux-user.mak
configs/targets/hppa-softmmu.mak renamed from default-configs/targets/hppa-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/targets/hppa-softmmu.mak
rename to configs/targets/hppa-softmmu.mak
configs/targets/i386-bsd-user.mak renamed from default-configs/targets/i386-bsd-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/i386-bsd-user.mak
rename to configs/targets/i386-bsd-user.mak
configs/targets/i386-linux-user.mak renamed from default-configs/targets/i386-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/i386-linux-user.mak
rename to configs/targets/i386-linux-user.mak
configs/targets/i386-softmmu.mak renamed from default-configs/targets/i386-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/targets/i386-softmmu.mak
rename to configs/targets/i386-softmmu.mak
configs/targets/m68k-linux-user.mak renamed from default-configs/targets/m68k-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/m68k-linux-user.mak
rename to configs/targets/m68k-linux-user.mak
configs/targets/m68k-softmmu.mak renamed from default-configs/targets/m68k-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/targets/m68k-softmmu.mak
rename to configs/targets/m68k-softmmu.mak
configs/targets/microblaze-linux-user.mak renamed from default-configs/targets/microblaze-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/microblaze-linux-user.mak
rename to configs/targets/microblaze-linux-user.mak
configs/targets/microblaze-softmmu.mak renamed from default-configs/targets/microblaze-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/targets/microblaze-softmmu.mak
rename to configs/targets/microblaze-softmmu.mak
configs/targets/microblazeel-linux-user.mak renamed from default-configs/targets/microblazeel-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/microblazeel-linux-user.mak
rename to configs/targets/microblazeel-linux-user.mak
configs/targets/microblazeel-softmmu.mak renamed from default-configs/targets/microblazeel-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/targets/microblazeel-softmmu.mak
rename to configs/targets/microblazeel-softmmu.mak
configs/targets/mips-linux-user.mak renamed from default-configs/targets/mips-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/mips-linux-user.mak
rename to configs/targets/mips-linux-user.mak
configs/targets/mips-softmmu.mak renamed from default-configs/targets/mips-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/targets/mips-softmmu.mak
rename to configs/targets/mips-softmmu.mak
configs/targets/mips64-linux-user.mak renamed from default-configs/targets/mips64-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/mips64-linux-user.mak
rename to configs/targets/mips64-linux-user.mak
configs/targets/mips64-softmmu.mak renamed from default-configs/targets/mips64-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/targets/mips64-softmmu.mak
rename to configs/targets/mips64-softmmu.mak
configs/targets/mips64el-linux-user.mak renamed from default-configs/targets/mips64el-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/mips64el-linux-user.mak
rename to configs/targets/mips64el-linux-user.mak
configs/targets/mips64el-softmmu.mak renamed from default-configs/targets/mips64el-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/targets/mips64el-softmmu.mak
rename to configs/targets/mips64el-softmmu.mak
configs/targets/mipsel-linux-user.mak renamed from default-configs/targets/mipsel-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/mipsel-linux-user.mak
rename to configs/targets/mipsel-linux-user.mak
configs/targets/mipsel-softmmu.mak renamed from default-configs/targets/mipsel-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/targets/mipsel-softmmu.mak
rename to configs/targets/mipsel-softmmu.mak
configs/targets/mipsn32-linux-user.mak renamed from default-configs/targets/mipsn32-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/mipsn32-linux-user.mak
rename to configs/targets/mipsn32-linux-user.mak
configs/targets/mipsn32el-linux-user.mak renamed from default-configs/targets/mipsn32el-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/mipsn32el-linux-user.mak
rename to configs/targets/mipsn32el-linux-user.mak
configs/targets/nios2-linux-user.mak renamed from default-configs/targets/nios2-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/nios2-linux-user.mak
rename to configs/targets/nios2-linux-user.mak
configs/targets/nios2-softmmu.mak renamed from default-configs/targets/nios2-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/targets/nios2-softmmu.mak
rename to configs/targets/nios2-softmmu.mak
configs/targets/or1k-linux-user.mak renamed from default-configs/targets/or1k-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/or1k-linux-user.mak
rename to configs/targets/or1k-linux-user.mak
configs/targets/or1k-softmmu.mak renamed from default-configs/targets/or1k-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/targets/or1k-softmmu.mak
rename to configs/targets/or1k-softmmu.mak
configs/targets/ppc-linux-user.mak renamed from default-configs/targets/ppc-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/ppc-linux-user.mak
rename to configs/targets/ppc-linux-user.mak
configs/targets/ppc-softmmu.mak renamed from default-configs/targets/ppc-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/targets/ppc-softmmu.mak
rename to configs/targets/ppc-softmmu.mak
configs/targets/ppc64-linux-user.mak renamed from default-configs/targets/ppc64-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/ppc64-linux-user.mak
rename to configs/targets/ppc64-linux-user.mak
configs/targets/ppc64-softmmu.mak renamed from default-configs/targets/ppc64-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/targets/ppc64-softmmu.mak
rename to configs/targets/ppc64-softmmu.mak
configs/targets/ppc64abi32-linux-user.mak renamed from default-configs/targets/ppc64abi32-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/ppc64abi32-linux-user.mak
rename to configs/targets/ppc64abi32-linux-user.mak
configs/targets/ppc64le-linux-user.mak renamed from default-configs/targets/ppc64le-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/ppc64le-linux-user.mak
rename to configs/targets/ppc64le-linux-user.mak
configs/targets/riscv32-linux-user.mak renamed from default-configs/targets/riscv32-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/riscv32-linux-user.mak
rename to configs/targets/riscv32-linux-user.mak
configs/targets/riscv32-softmmu.mak renamed from default-configs/targets/riscv32-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/targets/riscv32-softmmu.mak
rename to configs/targets/riscv32-softmmu.mak
configs/targets/riscv64-linux-user.mak renamed from default-configs/targets/riscv64-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/riscv64-linux-user.mak
rename to configs/targets/riscv64-linux-user.mak
configs/targets/riscv64-softmmu.mak renamed from default-configs/targets/riscv64-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/targets/riscv64-softmmu.mak
rename to configs/targets/riscv64-softmmu.mak
configs/targets/rx-softmmu.mak renamed from default-configs/targets/rx-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/targets/rx-softmmu.mak
rename to configs/targets/rx-softmmu.mak
configs/targets/s390x-linux-user.mak renamed from default-configs/targets/s390x-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/s390x-linux-user.mak
rename to configs/targets/s390x-linux-user.mak
configs/targets/s390x-softmmu.mak renamed from default-configs/targets/s390x-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/targets/s390x-softmmu.mak
rename to configs/targets/s390x-softmmu.mak
configs/targets/sh4-linux-user.mak renamed from default-configs/targets/sh4-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/sh4-linux-user.mak
rename to configs/targets/sh4-linux-user.mak
configs/targets/sh4-softmmu.mak renamed from default-configs/targets/sh4-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/targets/sh4-softmmu.mak
rename to configs/targets/sh4-softmmu.mak
configs/targets/sh4eb-linux-user.mak renamed from default-configs/targets/sh4eb-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/sh4eb-linux-user.mak
rename to configs/targets/sh4eb-linux-user.mak
configs/targets/sh4eb-softmmu.mak renamed from default-configs/targets/sh4eb-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/targets/sh4eb-softmmu.mak
rename to configs/targets/sh4eb-softmmu.mak
configs/targets/sparc-linux-user.mak renamed from default-configs/targets/sparc-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/sparc-linux-user.mak
rename to configs/targets/sparc-linux-user.mak
configs/targets/sparc-softmmu.mak renamed from default-configs/targets/sparc-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/targets/sparc-softmmu.mak
rename to configs/targets/sparc-softmmu.mak
configs/targets/sparc32plus-linux-user.mak renamed from default-configs/targets/sparc32plus-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/sparc32plus-linux-user.mak
rename to configs/targets/sparc32plus-linux-user.mak
configs/targets/sparc64-linux-user.mak renamed from default-configs/targets/sparc64-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/sparc64-linux-user.mak
rename to configs/targets/sparc64-linux-user.mak
configs/targets/sparc64-softmmu.mak renamed from default-configs/targets/sparc64-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/targets/sparc64-softmmu.mak
rename to configs/targets/sparc64-softmmu.mak
configs/targets/tricore-softmmu.mak renamed from default-configs/targets/tricore-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/targets/tricore-softmmu.mak
rename to configs/targets/tricore-softmmu.mak
configs/targets/x86_64-bsd-user.mak renamed from default-configs/targets/x86_64-bsd-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/x86_64-bsd-user.mak
rename to configs/targets/x86_64-bsd-user.mak
configs/targets/x86_64-linux-user.mak renamed from default-configs/targets/x86_64-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/x86_64-linux-user.mak
rename to configs/targets/x86_64-linux-user.mak
configs/targets/x86_64-softmmu.mak renamed from default-configs/targets/x86_64-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/targets/x86_64-softmmu.mak
rename to configs/targets/x86_64-softmmu.mak
configs/targets/xtensa-linux-user.mak renamed from default-configs/targets/xtensa-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/xtensa-linux-user.mak
rename to configs/targets/xtensa-linux-user.mak
configs/targets/xtensa-softmmu.mak renamed from default-configs/targets/xtensa-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/targets/xtensa-softmmu.mak
rename to configs/targets/xtensa-softmmu.mak
configs/targets/xtensaeb-linux-user.mak renamed from default-configs/targets/xtensaeb-linux-user.mak +0 -0
similarity index 100%
rename from default-configs/targets/xtensaeb-linux-user.mak
rename to configs/targets/xtensaeb-linux-user.mak
configs/targets/xtensaeb-softmmu.mak renamed from default-configs/targets/xtensaeb-softmmu.mak +0 -0
similarity index 100%
rename from default-configs/targets/xtensaeb-softmmu.mak
rename to configs/targets/xtensaeb-softmmu.mak
configure +3 -3
index a04b1e075c..4eba89f823 100755
@@ -1677,13 +1677,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
default-configs/devices/xtensaeb-softmmu.mak deleted +0 -3
deleted file mode 100644
index f7e48c750c..0000000000
@@ -1,3 +0,0 @@
-# Default configuration for Xtensa
-
-include xtensa-softmmu.mak
meson.build +2 -2
index d82f7a789d..71c7462e89 100644
@@ -1549,7 +1549,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
@@ -1597,7 +1597,7 @@ foreach target : target_dirs
   if target.endswith('-softmmu')
     config_devices_mak = target + '-config-devices.mak'
     config_devices_mak = configure_file(
-      input: ['default-configs/devices' / target + '.mak', 'Kconfig'],
+      input: ['configs/devices' / target / 'default.mak', 'Kconfig'],
       output: config_devices_mak,
       depfile: config_devices_mak + '.d',
       capture: true,
tests/Makefile.include +1 -1
index 8f220e15d1..e4dcb17329 100644
@@ -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
 
Signature · 1 line
2.31.1
#53 lore raw
In reply to Paolo Bonzini
Quoted 11 lines · Paolo Bonzini

The following changes since commit 9aef0954195cc592e86846dbbe7f3c2c5603690a:

Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging (2021-07-06 11:24:58 +0100)

are available in the Git repository at:

https://gitlab.com/bonzini/qemu.git tags/for-upstream

for you to fetch changes up to 81224eaca6675978489cd7c6172f17ca1f54b494:

Quoted 9 lines

configure: allow the selection of alternate config in the build (2021-07-08 14:01:52 +0200)

----------------------------------------------------------------
* More SVM fixes (Lara)
* Module annotation database (Gerd)
* Memory leak fixes (myself)
* Build fixes (myself)
* --with-devices-* support (Alex)

New warnings in the docs build:

/home/pm/qemu/docs/../include/qemu/module.h:127: warning: Function parameter or member 'name' not described in 'module_arch' /home/pm/qemu/docs/../include/qemu/module.h:127: warning: Excess function parameter 'arch' description in 'module_arch'

The macro parameter and the name used in the doc comment don't match.

thanks
-- PMM