diff options
936 files changed, 21968 insertions, 9041 deletions
diff --git a/.editorconfig b/.editorconfig index a001f340bd..22681d91c6 100644 --- a/.editorconfig +++ b/.editorconfig @@ -22,9 +22,10 @@ indent_style = tab indent_size = 8 file_type_emacs = makefile -[*.{c,h}] +[*.{c,h,c.inc,h.inc}] indent_style = space indent_size = 4 +file_type_emacs = c [*.sh] indent_style = space diff --git a/.gitignore b/.gitignore index 2992d15931..4ccb9ed975 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +/GNUmakefile +/build/ /.doctrees /config-devices.* /config-all-devices.* @@ -18,7 +20,7 @@ /ui/shader/texture-blit-frag.h /ui/shader/texture-blit-vert.h /ui/shader/texture-blit-flip-vert.h -/ui/input-keymap-*.c +/ui/input-keymap-*.c.inc *-timestamp /*-softmmu /*-darwin-user @@ -78,7 +80,6 @@ *.msi *.dll *.so -*.mo *.fn *.ky *.log @@ -146,7 +147,6 @@ docker-src.* *~ *.ast_raw *.depend_raw -trace.h trace.c trace-ust.h trace-ust.h @@ -162,4 +162,4 @@ trace-dtrace-root.h trace-dtrace-root.dtrace trace-ust-all.h trace-ust-all.c -/target/arm/decode-sve.inc.c +/target/arm/decode-sve.c.inc diff --git a/.gitlab-ci.d/opensbi.yml b/.gitlab-ci.d/opensbi.yml index 62088ec5ec..5b13047e2a 100644 --- a/.gitlab-ci.d/opensbi.yml +++ b/.gitlab-ci.d/opensbi.yml @@ -35,18 +35,14 @@ build-opensbi: when: always artifacts: paths: # 'artifacts.zip' will contains the following files: - - pc-bios/opensbi-riscv32-sifive_u-fw_jump.bin - - pc-bios/opensbi-riscv32-virt-fw_jump.bin - - pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin - - pc-bios/opensbi-riscv64-virt-fw_jump.bin - - opensbi32-virt-stdout.log - - opensbi32-virt-stderr.log - - opensbi64-virt-stdout.log - - opensbi64-virt-stderr.log - - opensbi32-sifive_u-stdout.log - - opensbi32-sifive_u-stderr.log - - opensbi64-sifive_u-stdout.log - - opensbi64-sifive_u-stderr.log + - pc-bios/opensbi-riscv32-generic-fw_dynamic.bin + - pc-bios/opensbi-riscv32-generic-fw_dynamic.elf + - pc-bios/opensbi-riscv64-generic-fw_dynamic.bin + - pc-bios/opensbi-riscv64-generic-fw_dynamic.elf + - opensbi32-generic-stdout.log + - opensbi32-generic-stderr.log + - opensbi64-generic-stdout.log + - opensbi64-generic-stderr.log image: $CI_REGISTRY_IMAGE:opensbi-cross-build variables: GIT_DEPTH: 3 @@ -55,10 +51,6 @@ build-opensbi: - export JOBS=$(($(getconf _NPROCESSORS_ONLN) + 1)) - echo "=== Using ${JOBS} simultaneous jobs ===" - make -j${JOBS} -C roms/opensbi clean - - make -j${JOBS} -C roms opensbi32-virt 2>&1 1>opensbi32-virt-stdout.log | tee -a opensbi32-virt-stderr.log >&2 + - make -j${JOBS} -C roms opensbi32-generic 2>&1 1>opensbi32-generic-stdout.log | tee -a opensbi32-generic-stderr.log >&2 - make -j${JOBS} -C roms/opensbi clean - - make -j${JOBS} -C roms opensbi64-virt 2>&1 1>opensbi64-virt-stdout.log | tee -a opensbi64-virt-stderr.log >&2 - - make -j${JOBS} -C roms/opensbi clean - - make -j${JOBS} -C roms opensbi32-sifive_u 2>&1 1>opensbi32-sifive_u-stdout.log | tee -a opensbi32-sifive_u-stderr.log >&2 - - make -j${JOBS} -C roms/opensbi clean - - make -j${JOBS} -C roms opensbi64-sifive_u 2>&1 1>opensbi64-sifive_u-stdout.log | tee -a opensbi64-sifive_u-stderr.log >&2 + - make -j${JOBS} -C roms opensbi64-generic 2>&1 1>opensbi64-generic-stdout.log | tee -a opensbi64-generic-stderr.log >&2 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9820066379..b7967b9a13 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -265,9 +265,9 @@ build-tci: - make run-tcg-tests-x86_64-softmmu - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test - for tg in $TARGETS ; do - export QTEST_QEMU_BINARY="${tg}-softmmu/qemu-system-${tg}" ; + export QTEST_QEMU_BINARY="./qemu-system-${tg}" ; ./tests/qtest/boot-serial-test || exit 1 ; ./tests/qtest/cdrom-test || exit 1 ; done - - QTEST_QEMU_BINARY="x86_64-softmmu/qemu-system-x86_64" ./tests/qtest/pxe-test - - QTEST_QEMU_BINARY="s390x-softmmu/qemu-system-s390x" ./tests/qtest/pxe-test -m slow + - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test + - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow diff --git a/.gitmodules b/.gitmodules index 9c0501a4d4..ce979398a8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -58,3 +58,6 @@ [submodule "roms/qboot"] path = roms/qboot url = https://github.com/bonzini/qboot +[submodule "meson"] + path = meson + url = https://github.com/mesonbuild/meson/ diff --git a/MAINTAINERS b/MAINTAINERS index 0886eb3d2b..5a22c8be42 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -894,7 +894,7 @@ F: hw/misc/zynq* F: include/hw/misc/zynq* X: hw/ssi/xilinx_* -Xilinx ZynqMP +Xilinx ZynqMP and Versal M: Alistair Francis <alistair@alistair23.me> M: Edgar E. Iglesias <edgar.iglesias@gmail.com> M: Peter Maydell <peter.maydell@linaro.org> @@ -905,6 +905,7 @@ F: include/hw/*/xlnx*.h F: include/hw/ssi/xilinx_spips.h F: hw/display/dpcd.c F: include/hw/display/dpcd.h +F: docs/system/arm/xlnx-versal-virt.rst ARM ACPI Subsystem M: Shannon Zhao <shannon.zhaosl@gmail.com> @@ -11,7 +11,6 @@ BUILD_DIR=$(CURDIR) SRC_PATH=. UNCHECKED_GOALS := %clean TAGS cscope ctags dist \ - html info pdf txt \ help check-help print-% \ docker docker-% vm-help vm-test vm-build-% @@ -49,6 +48,33 @@ git-submodule-update: endif endif +export NINJA=./ninjatool + +# Running meson regenerates both build.ninja and ninjatool, and that is +# enough to prime the rest of the build. +ninjatool: build.ninja + +# Only needed in case Makefile.ninja does not exist. +.PHONY: ninja-clean ninja-distclean clean-ctlist +clean-ctlist: +ninja-clean:: +ninja-distclean:: +build.ninja: config-host.mak + +Makefile.ninja: build.ninja ninjatool + ./ninjatool -t ninja2make --omit clean dist uninstall < $< > $@ +-include Makefile.ninja + +${ninja-targets-c_COMPILER} ${ninja-targets-cpp_COMPILER}: .var.command += -MP + +# If MESON is empty, the rule will be re-evaluated after Makefiles are +# reread (and MESON won't be empty anymore). +ifneq ($(MESON),) +Makefile.mtest: build.ninja scripts/mtest2make.py + $(MESON) introspect --tests | $(PYTHON) scripts/mtest2make.py > $@ +-include Makefile.mtest +endif + .git-submodule-status: git-submodule-update config-host.mak # Check that we're not trying to do an out-of-tree build from @@ -70,7 +96,11 @@ CONFIG_ALL=y config-host.mak: $(SRC_PATH)/configure $(SRC_PATH)/pc-bios $(SRC_PATH)/VERSION @echo $@ is out-of-date, running configure - @./config.status + @if test -f meson-private/coredata.dat; then \ + ./config.status --skip-meson; \ + else \ + ./config.status; \ + fi # Force configure to re-run if the API symbols are updated ifeq ($(CONFIG_PLUGIN),y) @@ -90,441 +120,30 @@ include $(SRC_PATH)/rules.mak # lor is defined in rules.mak CONFIG_BLOCK := $(call lor,$(CONFIG_SOFTMMU),$(CONFIG_TOOLS)) -# Create QEMU_PKGVERSION and FULL_VERSION strings -# If PKGVERSION is set, use that; otherwise get version and -dirty status from git -QEMU_PKGVERSION := $(if $(PKGVERSION),$(PKGVERSION),$(shell \ - cd $(SRC_PATH); \ - if test -e .git; then \ - git describe --match 'v*' 2>/dev/null | tr -d '\n'; \ - if ! git diff-index --quiet HEAD &>/dev/null; then \ - echo "-dirty"; \ - fi; \ - fi)) - -# Either "version (pkgversion)", or just "version" if pkgversion not set -FULL_VERSION := $(if $(QEMU_PKGVERSION),$(VERSION) ($(QEMU_PKGVERSION)),$(VERSION)) - -generated-files-y = qemu-version.h config-host.h qemu-options.def - -GENERATED_QAPI_FILES = qapi/qapi-builtin-types.h qapi/qapi-builtin-types.c -GENERATED_QAPI_FILES += qapi/qapi-types.h qapi/qapi-types.c -GENERATED_QAPI_FILES += $(QAPI_MODULES:%=qapi/qapi-types-%.h) -GENERATED_QAPI_FILES += $(QAPI_MODULES:%=qapi/qapi-types-%.c) -GENERATED_QAPI_FILES += qapi/qapi-builtin-visit.h qapi/qapi-builtin-visit.c -GENERATED_QAPI_FILES += qapi/qapi-visit.h qapi/qapi-visit.c -GENERATED_QAPI_FILES += $(QAPI_MODULES:%=qapi/qapi-visit-%.h) -GENERATED_QAPI_FILES += $(QAPI_MODULES:%=qapi/qapi-visit-%.c) -GENERATED_QAPI_FILES += qapi/qapi-init-commands.h qapi/qapi-init-commands.c -GENERATED_QAPI_FILES += qapi/qapi-commands.h qapi/qapi-commands.c -GENERATED_QAPI_FILES += $(QAPI_MODULES:%=qapi/qapi-commands-%.h) -GENERATED_QAPI_FILES += $(QAPI_MODULES:%=qapi/qapi-commands-%.c) -GENERATED_QAPI_FILES += qapi/qapi-emit-events.h qapi/qapi-emit-events.c -GENERATED_QAPI_FILES += qapi/qapi-events.h qapi/qapi-events.c -GENERATED_QAPI_FILES += $(QAPI_MODULES:%=qapi/qapi-events-%.h) -GENERATED_QAPI_FILES += $(QAPI_MODULES:%=qapi/qapi-events-%.c) -GENERATED_QAPI_FILES += qapi/qapi-introspect.c qapi/qapi-introspect.h -GENERATED_QAPI_FILES += qapi/qapi-doc.texi - -# The following list considers only the storage daemon main module. All other -# modules are currently shared with the main schema, so we don't actually -# generate additional files. - -GENERATED_STORAGE_DAEMON_QAPI_FILES = storage-daemon/qapi/qapi-commands.h -GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-commands.c -GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-emit-events.h -GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-emit-events.c -GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-events.h -GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-events.c -GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-init-commands.h -GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-init-commands.c -GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-introspect.h -GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-introspect.c -GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-types.h -GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-types.c -GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-visit.h -GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-visit.c -GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-doc.texi - -generated-files-y += $(GENERATED_QAPI_FILES) -generated-files-y += $(GENERATED_STORAGE_DAEMON_QAPI_FILES) - -generated-files-y += trace/generated-tcg-tracers.h - -generated-files-y += trace/generated-helpers-wrappers.h -generated-files-y += trace/generated-helpers.h -generated-files-y += trace/generated-helpers.c - -generated-files-$(CONFIG_TRACE_UST) += trace-ust-all.h -generated-files-$(CONFIG_TRACE_UST) += trace-ust-all.c - -generated-files-y += module_block.h - -TRACE_HEADERS = trace-root.h $(trace-events-subdirs:%=%/trace.h) -TRACE_SOURCES = trace-root.c $(trace-events-subdirs:%=%/trace.c) -TRACE_DTRACE = -ifdef CONFIG_TRACE_DTRACE -TRACE_HEADERS += trace-dtrace-root.h $(trace-events-subdirs:%=%/trace-dtrace.h) -TRACE_DTRACE += trace-dtrace-root.dtrace $(trace-events-subdirs:%=%/trace-dtrace.dtrace) -endif -ifdef CONFIG_TRACE_UST -TRACE_HEADERS += trace-ust-root.h $(trace-events-subdirs:%=%/trace-ust.h) -endif - -generated-files-y += $(TRACE_HEADERS) -generated-files-y += $(TRACE_SOURCES) -generated-files-y += $(BUILD_DIR)/trace-events-all generated-files-y += .git-submodule-status -trace-group-name = $(shell dirname $1 | sed -e 's/[^a-zA-Z0-9]/_/g') - -tracetool-y = $(SRC_PATH)/scripts/tracetool.py -tracetool-y += $(shell find $(SRC_PATH)/scripts/tracetool -name "*.py") - -%/trace.h: %/trace.h-timestamp - @cmp $< $@ >/dev/null 2>&1 || cp $< $@ -%/trace.h-timestamp: $(SRC_PATH)/%/trace-events $(tracetool-y) $(BUILD_DIR)/config-host.mak - $(call quiet-command,$(TRACETOOL) \ - --group=$(call trace-group-name,$@) \ - --format=h \ - --backends=$(TRACE_BACKENDS) \ - $< > $@,"GEN","$(@:%-timestamp=%)") - -%/trace.c: %/trace.c-timestamp - @cmp $< $@ >/dev/null 2>&1 || cp $< $@ -%/trace.c-timestamp: $(SRC_PATH)/%/trace-events $(tracetool-y) $(BUILD_DIR)/config-host.mak - $(call quiet-command,$(TRACETOOL) \ - --group=$(call trace-group-name,$@) \ - --format=c \ - --backends=$(TRACE_BACKENDS) \ - $< > $@,"GEN","$(@:%-timestamp=%)") - -%/trace-ust.h: %/trace-ust.h-timestamp - @cmp $< $@ >/dev/null 2>&1 || cp $< $@ -%/trace-ust.h-timestamp: $(SRC_PATH)/%/trace-events $(tracetool-y) $(BUILD_DIR)/config-host.mak - $(call quiet-command,$(TRACETOOL) \ - --group=$(call trace-group-name,$@) \ - --format=ust-events-h \ - --backends=$(TRACE_BACKENDS) \ - $< > $@,"GEN","$(@:%-timestamp=%)") - -%/trace-dtrace.dtrace: %/trace-dtrace.dtrace-timestamp - @cmp $< $@ >/dev/null 2>&1 || cp $< $@ -%/trace-dtrace.dtrace-timestamp: $(SRC_PATH)/%/trace-events $(BUILD_DIR)/config-host.mak $(tracetool-y) - $(call quiet-command,$(TRACETOOL) \ - --group=$(call trace-group-name,$@) \ - --format=d \ - --backends=$(TRACE_BACKENDS) \ - $< > $@,"GEN","$(@:%-timestamp=%)") - -%/trace-dtrace.h: %/trace-dtrace.dtrace $(tracetool-y) - $(call quiet-command,dtrace -o $@ -h -s $<, "GEN","$@") - -%/trace-dtrace.o: %/trace-dtrace.dtrace $(tracetool-y) - - -trace-root.h: trace-root.h-timestamp - @cmp $< $@ >/dev/null 2>&1 || cp $< $@ -trace-root.h-timestamp: $(SRC_PATH)/trace-events $(tracetool-y) $(BUILD_DIR)/config-host.mak - $(call quiet-command,$(TRACETOOL) \ - --group=root \ - --format=h \ - --backends=$(TRACE_BACKENDS) \ - $< > $@,"GEN","$(@:%-timestamp=%)") - -trace-root.c: trace-root.c-timestamp - @cmp $< $@ >/dev/null 2>&1 || cp $< $@ -trace-root.c-timestamp: $(SRC_PATH)/trace-events $(tracetool-y) $(BUILD_DIR)/config-host.mak - $(call quiet-command,$(TRACETOOL) \ - --group=root \ - --format=c \ - --backends=$(TRACE_BACKENDS) \ - $< > $@,"GEN","$(@:%-timestamp=%)") - -trace-ust-root.h: trace-ust-root.h-timestamp - @cmp $< $@ >/dev/null 2>&1 || cp $< $@ -trace-ust-root.h-timestamp: $(SRC_PATH)/trace-events $(tracetool-y) $(BUILD_DIR)/config-host.mak - $(call quiet-command,$(TRACETOOL) \ - --group=root \ - --format=ust-events-h \ - --backends=$(TRACE_BACKENDS) \ - $< > $@,"GEN","$(@:%-timestamp=%)") - -trace-ust-all.h: trace-ust-all.h-timestamp - @cmp $< $@ >/dev/null 2>&1 || cp $< $@ -trace-ust-all.h-timestamp: $(trace-events-files) $(tracetool-y) $(BUILD_DIR)/config-host.mak - $(call quiet-command,$(TRACETOOL) \ - --group=all \ - --format=ust-events-h \ - --backends=$(TRACE_BACKENDS) \ - $(trace-events-files) > $@,"GEN","$(@:%-timestamp=%)") - -trace-ust-all.c: trace-ust-all.c-timestamp - @cmp $< $@ >/dev/null 2>&1 || cp $< $@ -trace-ust-all.c-timestamp: $(trace-events-files) $(tracetool-y) $(BUILD_DIR)/config-host.mak - $(call quiet-command,$(TRACETOOL) \ - --group=all \ - --format=ust-events-c \ - --backends=$(TRACE_BACKENDS) \ - $(trace-events-files) > $@,"GEN","$(@:%-timestamp=%)") - -trace-dtrace-root.dtrace: trace-dtrace-root.dtrace-timestamp - @cmp $< $@ >/dev/null 2>&1 || cp $< $@ -trace-dtrace-root.dtrace-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak $(tracetool-y) - $(call quiet-command,$(TRACETOOL) \ - --group=root \ - --format=d \ - --backends=$(TRACE_BACKENDS) \ - $< > $@,"GEN","$(@:%-timestamp=%)") - -trace-dtrace-root.h: trace-dtrace-root.dtrace - $(call quiet-command,dtrace -o $@ -h -s $<, "GEN","$@") - -trace-dtrace-root.o: trace-dtrace-root.dtrace - -KEYCODEMAP_GEN = $(SRC_PATH)/ui/keycodemapdb/tools/keymap-gen -KEYCODEMAP_CSV = $(SRC_PATH)/ui/keycodemapdb/data/keymaps.csv - -KEYCODEMAP_FILES = \ - ui/input-keymap-atset1-to-qcode.c \ - ui/input-keymap-linux-to-qcode.c \ - ui/input-keymap-qcode-to-atset1.c \ - ui/input-keymap-qcode-to-atset2.c \ - ui/input-keymap-qcode-to-atset3.c \ - ui/input-keymap-qcode-to-linux.c \ - ui/input-keymap-qcode-to-qnum.c \ - ui/input-keymap-qcode-to-sun.c \ - ui/input-keymap-qnum-to-qcode.c \ - ui/input-keymap-usb-to-qcode.c \ - ui/input-keymap-win32-to-qcode.c \ - ui/input-keymap-x11-to-qcode.c \ - ui/input-keymap-xorgevdev-to-qcode.c \ - ui/input-keymap-xorgkbd-to-qcode.c \ - ui/input-keymap-xorgxquartz-to-qcode.c \ - ui/input-keymap-xorgxwin-to-qcode.c \ - ui/input-keymap-osx-to-qcode.c \ - $(NULL) - -generated-files-$(CONFIG_SOFTMMU) += $(KEYCODEMAP_FILES) - -ui/input-keymap-%.c: $(KEYCODEMAP_GEN) $(KEYCODEMAP_CSV) $(SRC_PATH)/ui/Makefile.objs - $(call quiet-command,\ - stem=$* && src=$${stem%-to-*} dst=$${stem#*-to-} && \ - test -e $(KEYCODEMAP_GEN) && \ - $(PYTHON) $(KEYCODEMAP_GEN) \ - --lang glib2 \ - --varname qemu_input_map_$${src}_to_$${dst} \ - code-map $(KEYCODEMAP_CSV) $${src} $${dst} \ - > $@ || rm -f $@, "GEN", "$@") - -$(KEYCODEMAP_GEN): .git-submodule-status -$(KEYCODEMAP_CSV): .git-submodule-status - -edk2-decompressed = $(basename $(wildcard pc-bios/edk2-*.fd.bz2)) -pc-bios/edk2-%.fd: pc-bios/edk2-%.fd.bz2 - $(call quiet-command,bzip2 -d -c $< > $@,"BUNZIP2",$<) - # Don't try to regenerate Makefile or configure # We don't generate any of them Makefile: ; configure: ; -.PHONY: all clean cscope distclean html info install install-doc \ - pdf txt recurse-all dist msi FORCE +.PHONY: all clean cscope distclean install \ + recurse-all dist msi FORCE $(call set-vpath, $(SRC_PATH)) LIBS+=-lz $(LIBS_TOOLS) -vhost-user-json-y = -HELPERS-y = $(HELPERS) - -HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) += qemu-bridge-helper$(EXESUF) - -ifeq ($(CONFIG_LINUX)$(CONFIG_VIRGL)$(CONFIG_GBM)$(CONFIG_TOOLS),yyyy) -HELPERS-y += vhost-user-gpu$(EXESUF) -vhost-user-json-y += contrib/vhost-user-gpu/50-qemu-gpu.json -endif - -ifeq ($(CONFIG_SOFTMMU)$(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyyy) -HELPERS-y += virtiofsd$(EXESUF) -vhost-user-json-y += tools/virtiofsd/50-qemu-virtiofsd.json -endif - -# Sphinx does not allow building manuals into the same directory as -# the source files, so if we're doing an in-tree QEMU build we must -# build the manuals into a subdirectory (and then install them from -# there for 'make install'). For an out-of-tree build we can just -# use the docs/ subdirectory in the build tree as normal. -ifeq ($(realpath $(SRC_PATH)),$(realpath .)) -MANUAL_BUILDDIR := docs/built -else -MANUAL_BUILDDIR := docs -endif - -ifdef BUILD_DOCS -DOCS+=$(MANUAL_BUILDDIR)/system/qemu.1 -DOCS+=$(MANUAL_BUILDDIR)/tools/qemu-img.1 -DOCS+=$(MANUAL_BUILDDIR)/tools/qemu-nbd.8 -DOCS+=$(MANUAL_BUILDDIR)/interop/qemu-ga.8 -ifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyy) -DOCS+=$(MANUAL_BUILDDIR)/tools/virtiofsd.1 -endif -DOCS+=$(MANUAL_BUILDDIR)/system/qemu-block-drivers.7 -DOCS+=docs/interop/qemu-qmp-ref.html docs/interop/qemu-qmp-ref.txt docs/interop/qemu-qmp-ref.7 -DOCS+=docs/interop/qemu-ga-ref.html docs/interop/qemu-ga-ref.txt docs/interop/qemu-ga-ref.7 -DOCS+=$(MANUAL_BUILDDIR)/system/qemu-cpu-models.7 -DOCS+=$(MANUAL_BUILDDIR)/index.html -ifdef CONFIG_VIRTFS -DOCS+=$(MANUAL_BUILDDIR)/tools/virtfs-proxy-helper.1 -endif -ifdef CONFIG_TRACE_SYSTEMTAP -DOCS+=$(MANUAL_BUILDDIR)/tools/qemu-trace-stap.1 -endif -else -DOCS= -endif - SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory --quiet) BUILD_DIR=$(BUILD_DIR) -SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(filter %-softmmu, $(TARGET_DIRS))) -SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %.d, $(SUBDIR_DEVICES_MAK)) - -ifeq ($(SUBDIR_DEVICES_MAK),) -config-all-devices.mak: config-host.mak - $(call quiet-command,echo '# no devices' > $@,"GEN","$@") -else -config-all-devices.mak: $(SUBDIR_DEVICES_MAK) config-host.mak - $(call quiet-command, sed -n \ - 's|^\([^=]*\)=\(.*\)$$|\1:=$$(findstring y,$$(\1)\2)|p' \ - $(SUBDIR_DEVICES_MAK) | sort -u > $@, \ - "GEN","$@") -endif - --include $(SUBDIR_DEVICES_MAK_DEP) - -# This has to be kept in sync with Kconfig.host. -MINIKCONF_ARGS = \ - $(CONFIG_MINIKCONF_MODE) \ - $@ $*/config-devices.mak.d $< $(SRC_PATH)/Kconfig \ - CONFIG_TCG=$(CONFIG_TCG) \ - CONFIG_KVM=$(CONFIG_KVM) \ - CONFIG_SPICE=$(CONFIG_SPICE) \ - CONFIG_IVSHMEM=$(CONFIG_IVSHMEM) \ - CONFIG_TPM=$(CONFIG_TPM) \ - CONFIG_XEN=$(CONFIG_XEN) \ - CONFIG_OPENGL=$(CONFIG_OPENGL) \ - CONFIG_X11=$(CONFIG_X11) \ - CONFIG_VHOST_USER=$(CONFIG_VHOST_USER) \ - CONFIG_VHOST_KERNEL=$(CONFIG_VHOST_KERNEL) \ - CONFIG_VIRTFS=$(CONFIG_VIRTFS) \ - CONFIG_LINUX=$(CONFIG_LINUX) \ - CONFIG_PVRDMA=$(CONFIG_PVRDMA) - -MINIKCONF = $(PYTHON) $(SRC_PATH)/scripts/minikconf.py - -$(SUBDIR_DEVICES_MAK): %/config-devices.mak: default-configs/%.mak $(SRC_PATH)/Kconfig $(BUILD_DIR)/config-host.mak - $(call quiet-command, $(MINIKCONF) $(MINIKCONF_ARGS) \ - > $@.tmp, "GEN", "$@.tmp") - $(call quiet-command, if test -f $@; then \ - if cmp -s $@.old $@; then \ - mv $@.tmp $@; \ - cp -p $@ $@.old; \ - else \ - if test -f $@.old; then \ - echo "WARNING: $@ (user modified) out of date.";\ - else \ - echo "WARNING: $@ out of date.";\ - fi; \ - echo "Run \"$(MAKE) defconfig\" to regenerate."; \ - rm $@.tmp; \ - fi; \ - else \ - mv $@.tmp $@; \ - cp -p $@ $@.old; \ - fi,"GEN","$@"); - -defconfig: - rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK) ifneq ($(wildcard config-host.mak),) include $(SRC_PATH)/Makefile.objs endif -dummy := $(call unnest-vars,, \ - stub-obj-y \ - authz-obj-y \ - chardev-obj-y \ - util-obj-y \ - qga-obj-y \ - elf2dmp-obj-y \ - ivshmem-client-obj-y \ - ivshmem-server-obj-y \ - virtiofsd-obj-y \ - rdmacm-mux-obj-y \ - libvhost-user-obj-y \ - vhost-user-scsi-obj-y \ - vhost-user-blk-obj-y \ - vhost-user-input-obj-y \ - vhost-user-gpu-obj-y \ - qga-vss-dll-obj-y \ - block-obj-y \ - block-obj-m \ - storage-daemon-obj-y \ - storage-daemon-obj-m \ - crypto-obj-y \ - qom-obj-y \ - io-obj-y \ - common-obj-y \ - common-obj-m \ - trace-obj-y) - include $(SRC_PATH)/tests/Makefile.include -all: $(DOCS) $(if $(BUILD_DOCS),sphinxdocs) $(TOOLS) $(HELPERS-y) recurse-all modules $(vhost-user-json-y) - -qemu-version.h: FORCE - $(call quiet-command, \ - (printf '#define QEMU_PKGVERSION "$(QEMU_PKGVERSION)"\n'; \ - printf '#define QEMU_FULL_VERSION "$(FULL_VERSION)"\n'; \ - ) > $@.tmp) - $(call quiet-command, if ! cmp -s $@ $@.tmp; then \ - mv $@.tmp $@; \ - else \ - rm $@.tmp; \ - fi) - -config-host.h: config-host.h-timestamp -config-host.h-timestamp: config-host.mak -qemu-options.def: $(SRC_PATH)/qemu-options.hx $(SRC_PATH)/scripts/hxtool - $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"GEN","$@") - -TARGET_DIRS_RULES := $(foreach t, all fuzz clean install, $(addsuffix /$(t), $(TARGET_DIRS))) - -SOFTMMU_ALL_RULES=$(filter %-softmmu/all, $(TARGET_DIRS_RULES)) -$(SOFTMMU_ALL_RULES): $(authz-obj-y) -$(SOFTMMU_ALL_RULES): $(block-obj-y) -$(SOFTMMU_ALL_RULES): $(storage-daemon-obj-y) -$(SOFTMMU_ALL_RULES): $(chardev-obj-y) -$(SOFTMMU_ALL_RULES): $(crypto-obj-y) -$(SOFTMMU_ALL_RULES): $(io-obj-y) -$(SOFTMMU_ALL_RULES): config-all-devices.mak -ifdef DECOMPRESS_EDK2_BLOBS -$(SOFTMMU_ALL_RULES): $(edk2-decompressed) -endif - -SOFTMMU_FUZZ_RULES=$(filter %-softmmu/fuzz, $(TARGET_DIRS_RULES)) -$(SOFTMMU_FUZZ_RULES): $(authz-obj-y) -$(SOFTMMU_FUZZ_RULES): $(block-obj-y) -$(SOFTMMU_FUZZ_RULES): $(chardev-obj-y) -$(SOFTMMU_FUZZ_RULES): $(crypto-obj-y) -$(SOFTMMU_FUZZ_RULES): $(io-obj-y) -$(SOFTMMU_FUZZ_RULES): config-all-devices.mak -$(SOFTMMU_FUZZ_RULES): $(edk2-decompressed) - -.PHONY: $(TARGET_DIRS_RULES) -# The $(TARGET_DIRS_RULES) are of the form SUBDIR/GOAL, so that -# $(dir $@) yields the sub-directory, and $(notdir $@) yields the sub-goal -$(TARGET_DIRS_RULES): - $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" TARGET_DIR="$(dir $@)" $(notdir $@),) +all: recurse-all +Makefile: $(addsuffix /all, $(SUBDIRS)) # LIBFDT_lib="": avoid breaking existing trees with objects requiring -fPIC DTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_lib="" @@ -562,12 +181,6 @@ slirp/all: .git-submodule-status CC="$(CC)" AR="$(AR)" LD="$(LD)" RANLIB="$(RANLIB)" \ CFLAGS="$(QEMU_CFLAGS) $(CFLAGS)" LDFLAGS="$(QEMU_LDFLAGS)") -$(filter %/all, $(TARGET_DIRS_RULES)): libqemuutil.a $(common-obj-y) \ - $(qom-obj-y) - -$(filter %/fuzz, $(TARGET_DIRS_RULES)): libqemuutil.a $(common-obj-y) \ - $(qom-obj-y) $(crypto-user-obj-$(CONFIG_USER_ONLY)) - ROM_DIRS = $(addprefix pc-bios/, $(ROMS)) ROM_DIRS_RULES=$(foreach t, all clean, $(addsuffix /$(t), $(ROM_DIRS))) # Only keep -O and -g cflags @@ -575,253 +188,47 @@ ROM_DIRS_RULES=$(foreach t, all clean, $(addsuffix /$(t), $(ROM_DIRS))) $(ROM_DIRS_RULES): $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" TARGET_DIR="$(dir $@)" CFLAGS="$(filter -O% -g%,$(CFLAGS))" $(notdir $@),) -.PHONY: recurse-all recurse-clean recurse-install -recurse-all: $(addsuffix /all, $(TARGET_DIRS) $(ROM_DIRS)) -recurse-clean: $(addsuffix /clean, $(TARGET_DIRS) $(ROM_DIRS)) -recurse-install: $(addsuffix /install, $(TARGET_DIRS)) -$(addsuffix /install, $(TARGET_DIRS)): all - -$(BUILD_DIR)/version.o: $(SRC_PATH)/version.rc config-host.h - $(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<,"RC","version.o") - -Makefile: $(version-obj-y) +.PHONY: recurse-all recurse-clean +recurse-all: $(ROM_DIRS) +recurse-clean: $(addsuffix /clean, $(ROM_DIRS)) ###################################################################### -# Build libraries - -libqemuutil.a: $(util-obj-y) $(trace-obj-y) $(stub-obj-y) -libvhost-user.a: $(libvhost-user-obj-y) $(util-obj-y) $(stub-obj-y) - -###################################################################### - -COMMON_LDADDS = libqemuutil.a - -qemu-img.o: qemu-img-cmds.h - -qemu-img$(EXESUF): qemu-img.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS) -qemu-nbd$(EXESUF): qemu-nbd.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS) -qemu-io$(EXESUF): qemu-io.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS) -qemu-storage-daemon$(EXESUF): qemu-storage-daemon.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(chardev-obj-y) $(io-obj-y) $(qom-obj-y) $(storage-daemon-obj-y) $(COMMON_LDADDS) - -qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o $(COMMON_LDADDS) - -qemu-keymap$(EXESUF): qemu-keymap.o ui/input-keymap.o $(COMMON_LDADDS) - -qemu-edid$(EXESUF): qemu-edid.o hw/display/edid-generate.o $(COMMON_LDADDS) - -fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/9p-marshal.o fsdev/9p-iov-marshal.o $(COMMON_LDADDS) - -scsi/qemu-pr-helper$(EXESUF): scsi/qemu-pr-helper.o scsi/utils.o $(authz-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS) -ifdef CONFIG_MPATH -scsi/qemu-pr-helper$(EXESUF): LIBS += -ludev -lmultipath -lmpathpersist -endif - -qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/scripts/hxtool - $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"GEN","$@") - -qemu-ga$(EXESUF): LIBS = $(LIBS_QGA) -qemu-ga$(EXESUF): QEMU_CFLAGS += -I qga/qapi-generated - -qemu-keymap$(EXESUF): LIBS += $(XKBCOMMON_LIBS) -qemu-keymap$(EXESUF): QEMU_CFLAGS += $(XKBCOMMON_CFLAGS) - -qapi-py = $(SRC_PATH)/scripts/qapi/__init__.py \ -$(SRC_PATH)/scripts/qapi/commands.py \ -$(SRC_PATH)/scripts/qapi/common.py \ -$(SRC_PATH)/scripts/qapi/doc.py \ -$(SRC_PATH)/scripts/qapi/error.py \ -$(SRC_PATH)/scripts/qapi/events.py \ -$(SRC_PATH)/scripts/qapi/expr.py \ -$(SRC_PATH)/scripts/qapi/gen.py \ -$(SRC_PATH)/scripts/qapi/introspect.py \ -$(SRC_PATH)/scripts/qapi/parser.py \ -$(SRC_PATH)/scripts/qapi/schema.py \ -$(SRC_PATH)/scripts/qapi/source.py \ -$(SRC_PATH)/scripts/qapi/types.py \ -$(SRC_PATH)/scripts/qapi/visit.py \ -$(SRC_PATH)/scripts/qapi-gen.py - -qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h \ -qga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h \ -qga/qapi-generated/qga-qapi-commands.h qga/qapi-generated/qga-qapi-commands.c \ -qga/qapi-generated/qga-qapi-init-commands.h qga/qapi-generated/qga-qapi-init-commands.c \ -qga/qapi-generated/qga-qapi-doc.texi: \ -qga/qapi-generated/qapi-gen-timestamp ; -qga/qapi-generated/qapi-gen-timestamp: $(SRC_PATH)/qga/qapi-schema.json $(qapi-py) - $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \ - -o qga/qapi-generated -p "qga-" $<, \ - "GEN","$(@:%-timestamp=%)") - @>$@ - -qapi-modules = $(SRC_PATH)/qapi/qapi-schema.json \ - $(QAPI_MODULES:%=$(SRC_PATH)/qapi/%.json) -$(GENERATED_QAPI_FILES): qapi-gen-timestamp ; -qapi-gen-timestamp: $(qapi-modules) $(qapi-py) - $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \ - -o "qapi" -b $<, \ - "GEN","$(@:%-timestamp=%)") - @>$@ - -qapi-modules-storage-daemon = \ - $(SRC_PATH)/storage-daemon/qapi/qapi-schema.json \ - $(QAPI_MODULES_STORAGE_DAEMON:%=$(SRC_PATH)/qapi/%.json) - -$(GENERATED_STORAGE_DAEMON_QAPI_FILES): storage-daemon/qapi/qapi-gen-timestamp ; -storage-daemon/qapi/qapi-gen-timestamp: $(qapi-modules-storage-daemon) $(qapi-py) - $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \ - -o "storage-daemon/qapi" $<, \ - "GEN","$(@:%-timestamp=%)") - @>$@ - -QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qapi-commands.h qga-qapi-init-commands.h) -$(qga-obj-y): $(QGALIB_GEN) - -qemu-ga$(EXESUF): $(qga-obj-y) $(COMMON_LDADDS) - $(call LINK, $^) - -ifdef QEMU_GA_MSI_ENABLED -QEMU_GA_MSI=qemu-ga-$(ARCH).msi - -msi: $(QEMU_GA_MSI) - -$(QEMU_GA_MSI): qemu-ga.exe $(QGA_VSS_PROVIDER) - -$(QEMU_GA_MSI): config-host.mak - -$(QEMU_GA_MSI): $(SRC_PATH)/qga/installer/qemu-ga.wxs - $(call quiet-command,QEMU_GA_VERSION="$(QEMU_GA_VERSION)" QEMU_GA_MANUFACTURER="$(QEMU_GA_MANUFACTURER)" QEMU_GA_DISTRO="$(QEMU_GA_DISTRO)" BUILD_DIR="$(BUILD_DIR)" \ - wixl -o $@ $(QEMU_GA_MSI_ARCH) $(QEMU_GA_MSI_WITH_VSS) $(QEMU_GA_MSI_MINGW_DLL_PATH) $<,"WIXL","$@") -else -msi: - @echo "MSI build not configured or dependency resolution failed (reconfigure with --enable-guest-agent-msi option)" -endif - -ifneq ($(EXESUF),) -.PHONY: qemu-ga -qemu-ga: qemu-ga$(EXESUF) $(QGA_VSS_PROVIDER) $(QEMU_GA_MSI) -endif - -elf2dmp$(EXESUF): $(elf2dmp-obj-y) - $(call LINK, $^) - -ifdef CONFIG_IVSHMEM -ivshmem-client$(EXESUF): $(ivshmem-client-obj-y) $(COMMON_LDADDS) - $(call LINK, $^) -ivshmem-server$(EXESUF): $(ivshmem-server-obj-y) $(COMMON_LDADDS) - $(call LINK, $^) -endif -vhost-user-scsi$(EXESUF): $(vhost-user-scsi-obj-y) libvhost-user.a - $(call LINK, $^) -vhost-user-blk$(EXESUF): $(vhost-user-blk-obj-y) libvhost-user.a - $(call LINK, $^) - -rdmacm-mux$(EXESUF): LIBS += "-libumad" -rdmacm-mux$(EXESUF): $(rdmacm-mux-obj-y) $(COMMON_LDADDS) - $(call LINK, $^) - -# relies on Linux-specific syscalls -ifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyy) -virtiofsd$(EXESUF): $(virtiofsd-obj-y) libvhost-user.a $(COMMON_LDADDS) - $(call LINK, $^) -endif - -vhost-user-gpu$(EXESUF): $(vhost-user-gpu-obj-y) $(libvhost-user-obj-y) libqemuutil.a - $(call LINK, $^) - -ifdef CONFIG_VHOST_USER_INPUT -ifdef CONFIG_LINUX -vhost-user-input$(EXESUF): $(vhost-user-input-obj-y) libvhost-user.a libqemuutil.a - $(call LINK, $^) - -# build by default, do not install -all: vhost-user-input$(EXESUF) -endif -endif - -module_block.h: $(SRC_PATH)/scripts/modules/module_block.py config-host.mak - $(call quiet-command,$(PYTHON) $< $@ \ - $(addprefix $(SRC_PATH)/,$(patsubst %.mo,%.c,$(block-obj-m))), \ - "GEN","$@") - -ifdef CONFIG_GCOV -.PHONY: clean-coverage -clean-coverage: - $(call quiet-command, \ - find . \( -name '*.gcda' -o -name '*.gcov' \) -type f -exec rm {} +, \ - "CLEAN", "coverage files") -endif - -clean: recurse-clean +clean: recurse-clean ninja-clean clean-ctlist + -test -f ninjatool && ./ninjatool $(if $(V),-v,) -t clean # avoid old build problems by removing potentially incorrect old files rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h - rm -f qemu-options.def - rm -f *.msi - find . \( -name '*.so' -o -name '*.dll' -o -name '*.mo' -o -name '*.[oda]' \) -type f \ + find . \( -name '*.so' -o -name '*.dll' -o -name '*.[oda]' \) -type f \ ! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-aarch64.a \ ! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-arm.a \ ! -path ./roms/edk2/BaseTools/Source/Python/UPT/Dll/sqlite3.dll \ -exec rm {} + - rm -f $(edk2-decompressed) - rm -f $(filter-out %.tlb,$(TOOLS)) $(HELPERS-y) TAGS cscope.* *.pod *~ */*~ + rm -f TAGS cscope.* *.pod *~ */*~ rm -f fsdev/*.pod scsi/*.pod - rm -f qemu-img-cmds.h - rm -f ui/shader/*-vert.h ui/shader/*-frag.h - @# May not be present in generated-files-y - rm -f trace/generated-tracers-dtrace.dtrace* - rm -f trace/generated-tracers-dtrace.h* rm -f $(foreach f,$(generated-files-y),$(f) $(f)-timestamp) - rm -f qapi-gen-timestamp - rm -f storage-daemon/qapi/qapi-gen-timestamp - rm -rf qga/qapi-generated - rm -f config-all-devices.mak - rm -f $(SUBDIR_DEVICES_MAK) -VERSION ?= $(shell cat VERSION) +VERSION = $(shell cat $(SRC_PATH)/VERSION) dist: qemu-$(VERSION).tar.bz2 qemu-%.tar.bz2: $(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)" -define clean-manual = -rm -rf $(MANUAL_BUILDDIR)/$1/_static -rm -f $(MANUAL_BUILDDIR)/$1/objects.inv $(MANUAL_BUILDDIR)/$1/searchindex.js $(MANUAL_BUILDDIR)/$1/*.html -endef - -distclean: clean - rm -f config-host.mak config-host.h* $(DOCS) +distclean: clean ninja-distclean + -test -f ninjatool && ./ninjatool $(if $(V),-v,) -t clean -g + rm -f config-host.mak config-host.h* rm -f tests/tcg/config-*.mak - rm -f config-all-devices.mak config-all-disas.mak config.status - rm -f $(SUBDIR_DEVICES_MAK) - rm -f po/*.mo tests/qemu-iotests/common.env + rm -f config-all-disas.mak config.status + rm -f tests/qemu-iotests/common.env rm -f roms/seabios/config.mak roms/vgabios/config.mak rm -f qemu-plugins-ld.symbols qemu-plugins-ld64.symbols + rm -f *-config-target.h *-config-devices.mak *-config-devices.h + rm -rf meson-private meson-logs meson-info compile_commands.json + rm -f Makefile.ninja ninjatool ninjatool.stamp Makefile.mtest rm -f config.log rm -f linux-headers/asm - rm -f docs/version.texi - rm -f docs/interop/qemu-ga-qapi.texi docs/interop/qemu-qmp-qapi.texi - rm -f docs/interop/qemu-qmp-ref.7 docs/interop/qemu-ga-ref.7 - rm -f docs/interop/qemu-qmp-ref.txt docs/interop/qemu-ga-ref.txt - rm -f docs/interop/qemu-qmp-ref.pdf docs/interop/qemu-ga-ref.pdf - rm -f docs/interop/qemu-qmp-ref.html docs/interop/qemu-ga-ref.html - rm -rf .doctrees - $(call clean-manual,devel) - $(call clean-manual,interop) - $(call clean-manual,specs) - $(call clean-manual,system) - $(call clean-manual,tools) - $(call clean-manual,user) - for d in $(TARGET_DIRS); do \ - rm -rf $$d || exit 1 ; \ - done rm -Rf .sdk -KEYMAPS=da en-gb et fr fr-ch is lt no pt-br sv \ -ar de en-us fi fr-be hr it lv nl pl ru th \ -de-ch es fo fr-ca hu ja mk pt sl tr \ -bepo cz - ifdef INSTALL_BLOBS BLOBS=bios.bin bios-256k.bin bios-microvm.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \ vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin vgabios-virtio.bin \ @@ -842,70 +249,10 @@ u-boot.e500 u-boot-sam460-20100605.bin \ qemu_vga.ndrv \ edk2-licenses.txt \ hppa-firmware.img \ -opensbi-riscv32-sifive_u-fw_jump.bin opensbi-riscv32-virt-fw_jump.bin \ -opensbi-riscv64-sifive_u-fw_jump.bin opensbi-riscv64-virt-fw_jump.bin - - -DESCS=50-edk2-i386-secure.json 50-edk2-x86_64-secure.json \ -60-edk2-aarch64.json 60-edk2-arm.json 60-edk2-i386.json 60-edk2-x86_64.json +opensbi-riscv32-generic-fw_dynamic.bin opensbi-riscv64-generic-fw_dynamic.bin \ +opensbi-riscv32-generic-fw_dynamic.elf opensbi-riscv64-generic-fw_dynamic.elf else BLOBS= -DESCS= -endif - -# Note that we manually filter-out the non-Sphinx documentation which -# is currently built into the docs/interop directory in the build tree, -# and also any sphinx-built manpages. -define install-manual = -for d in $$(cd $(MANUAL_BUILDDIR) && find $1 -type d); do $(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)/$$d"; done -for f in $$(cd $(MANUAL_BUILDDIR) && find $1 -type f -a '!' '(' -name '*.[0-9]' -o -name 'qemu-*-qapi.*' -o -name 'qemu-*-ref.*' ')' ); do $(INSTALL_DATA) "$(MANUAL_BUILDDIR)/$$f" "$(DESTDIR)$(qemu_docdir)/$$f"; done -endef - -# Note that we deliberately do not install the "devel" manual: it is -# for QEMU developers, and not interesting to our users. -.PHONY: install-sphinxdocs -install-sphinxdocs: sphinxdocs - $(call install-manual,interop) - $(call install-manual,specs) - $(call install-manual,system) - $(call install-manual,tools) - $(call install-manual,user) - -install-doc: $(DOCS) install-sphinxdocs - $(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)" - $(INSTALL_DATA) $(MANUAL_BUILDDIR)/index.html "$(DESTDIR)$(qemu_docdir)" - $(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)/interop" - $(INSTALL_DATA) docs/interop/qemu-qmp-ref.html "$(DESTDIR)$(qemu_docdir)/interop" - $(INSTALL_DATA) docs/interop/qemu-qmp-ref.txt "$(DESTDIR)$(qemu_docdir)/interop" -ifdef CONFIG_POSIX - $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1" - $(INSTALL_DATA) $(MANUAL_BUILDDIR)/system/qemu.1 "$(DESTDIR)$(mandir)/man1" - $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man7" - $(INSTALL_DATA) docs/interop/qemu-qmp-ref.7 "$(DESTDIR)$(mandir)/man7" - $(INSTALL_DATA) $(MANUAL_BUILDDIR)/system/qemu-block-drivers.7 "$(DESTDIR)$(mandir)/man7" - $(INSTALL_DATA) $(MANUAL_BUILDDIR)/system/qemu-cpu-models.7 "$(DESTDIR)$(mandir)/man7" -ifeq ($(CONFIG_TOOLS),y) - $(INSTALL_DATA) $(MANUAL_BUILDDIR)/tools/qemu-img.1 "$(DESTDIR)$(mandir)/man1" - $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8" - $(INSTALL_DATA) $(MANUAL_BUILDDIR)/tools/qemu-nbd.8 "$(DESTDIR)$(mandir)/man8" -endif -ifdef CONFIG_TRACE_SYSTEMTAP - $(INSTALL_DATA) $(MANUAL_BUILDDIR)/tools/qemu-trace-stap.1 "$(DESTDIR)$(mandir)/man1" -endif -ifneq (,$(findstring qemu-ga,$(TOOLS))) - $(INSTALL_DATA) $(MANUAL_BUILDDIR)/interop/qemu-ga.8 "$(DESTDIR)$(mandir)/man8" - $(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)/interop" - $(INSTALL_DATA) docs/interop/qemu-ga-ref.html "$(DESTDIR)$(qemu_docdir)/interop" - $(INSTALL_DATA) docs/interop/qemu-ga-ref.txt "$(DESTDIR)$(qemu_docdir)/interop" - $(INSTALL_DATA) docs/interop/qemu-ga-ref.7 "$(DESTDIR)$(mandir)/man7" -endif -endif -ifdef CONFIG_VIRTFS - $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1" - $(INSTALL_DATA) $(MANUAL_BUILDDIR)/tools/virtfs-proxy-helper.1 "$(DESTDIR)$(mandir)/man1" -endif -ifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyy) - $(INSTALL_DATA) $(MANUAL_BUILDDIR)/tools/virtiofsd.1 "$(DESTDIR)$(mandir)/man1" endif install-datadir: @@ -913,40 +260,16 @@ install-datadir: install-localstatedir: ifdef CONFIG_POSIX -ifneq (,$(findstring qemu-ga,$(TOOLS))) +ifeq ($(CONFIG_GUEST_AGENT),y) $(INSTALL_DIR) "$(DESTDIR)$(qemu_localstatedir)"/run endif endif ICON_SIZES=16x16 24x24 32x32 48x48 64x64 128x128 256x256 512x512 -install-includedir: - $(INSTALL_DIR) "$(DESTDIR)$(includedir)" - -install: all $(if $(BUILD_DOCS),install-doc) \ - install-datadir install-localstatedir install-includedir \ - $(if $(INSTALL_BLOBS),$(edk2-decompressed)) \ - recurse-install -ifneq ($(TOOLS),) - $(call install-prog,$(TOOLS),$(DESTDIR)$(bindir)) -endif -ifneq ($(CONFIG_MODULES),) - $(INSTALL_DIR) "$(DESTDIR)$(qemu_moddir)" - for s in $(modules-m:.mo=$(DSOSUF)); do \ - t="$(DESTDIR)$(qemu_moddir)/$$(echo $$s | tr / -)"; \ - $(INSTALL_LIB) $$s "$$t"; \ - test -z "$(STRIP)" || $(STRIP) "$$t"; \ - done -endif -ifneq ($(HELPERS-y),) - $(call install-prog,$(HELPERS-y),$(DESTDIR)$(libexecdir)) -endif -ifneq ($(vhost-user-json-y),) - $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/vhost-user/" - for x in $(vhost-user-json-y); do \ - $(INSTALL_DATA) $$x "$(DESTDIR)$(qemu_datadir)/vhost-user/"; \ - done -endif +# Needed by "meson install" +export DESTDIR +install: all install-datadir install-localstatedir ifdef CONFIG_TRACE_SYSTEMTAP $(INSTALL_PROG) "scripts/qemu-trace-stap" $(DESTDIR)$(bindir) endif @@ -955,21 +278,6 @@ ifneq ($(BLOBS),) $(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(qemu_datadir)"; \ done endif -ifdef INSTALL_BLOBS - set -e; for x in $(edk2-decompressed); do \ - $(INSTALL_DATA) $$x "$(DESTDIR)$(qemu_datadir)"; \ - done -endif -ifneq ($(DESCS),) - $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/firmware" - set -e; tmpf=$$(mktemp); trap 'rm -f -- "$$tmpf"' EXIT; \ - for x in $(DESCS); do \ - sed -e 's,@DATADIR@,$(qemu_datadir),' \ - "$(SRC_PATH)/pc-bios/descriptors/$$x" > "$$tmpf"; \ - $(INSTALL_DATA) "$$tmpf" \ - "$(DESTDIR)$(qemu_datadir)/firmware/$$x"; \ - done -endif for s in $(ICON_SIZES); do \ mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/$${s}/apps"; \ $(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu_$${s}.png \ @@ -984,177 +292,7 @@ endif mkdir -p "$(DESTDIR)$(qemu_desktopdir)" $(INSTALL_DATA) $(SRC_PATH)/ui/qemu.desktop \ "$(DESTDIR)$(qemu_desktopdir)/qemu.desktop" -ifdef CONFIG_GTK - $(MAKE) -C po $@ -endif -ifeq ($(CONFIG_PLUGIN),y) - $(INSTALL_DATA) $(SRC_PATH)/include/qemu/qemu-plugin.h "$(DESTDIR)$(includedir)/qemu-plugin.h" -endif $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps" - set -e; for x in $(KEYMAPS); do \ - $(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \ - done - $(INSTALL_DATA) $(BUILD_DIR)/trace-events-all "$(DESTDIR)$(qemu_datadir)/trace-events-all" - -.PHONY: ctags -ctags: - rm -f tags - find "$(SRC_PATH)" -name '*.[hc]' -exec ctags --append {} + - -.PHONY: TAGS -TAGS: - rm -f TAGS - find "$(SRC_PATH)" -name '*.[hc]' -exec etags --append {} + - -cscope: - rm -f "$(SRC_PATH)"/cscope.* - find "$(SRC_PATH)/" -name "*.[chsS]" -print | sed 's,^\./,,' > "$(SRC_PATH)/cscope.files" - cscope -b -i"$(SRC_PATH)/cscope.files" - -# opengl shader programs -ui/shader/%-vert.h: $(SRC_PATH)/ui/shader/%.vert $(SRC_PATH)/scripts/shaderinclude.pl - @mkdir -p $(dir $@) - $(call quiet-command,\ - perl $(SRC_PATH)/scripts/shaderinclude.pl $< > $@,\ - "VERT","$@") - -ui/shader/%-frag.h: $(SRC_PATH)/ui/shader/%.frag $(SRC_PATH)/scripts/shaderinclude.pl - @mkdir -p $(dir $@) - $(call quiet-command,\ - perl $(SRC_PATH)/scripts/shaderinclude.pl $< > $@,\ - "FRAG","$@") - -ui/shader.o: $(SRC_PATH)/ui/shader.c \ - ui/shader/texture-blit-vert.h \ - ui/shader/texture-blit-flip-vert.h \ - ui/shader/texture-blit-frag.h - -# documentation -MAKEINFO=makeinfo -MAKEINFOINCLUDES= -I docs -I $(<D) -I $(@D) -MAKEINFOFLAGS=--no-split --number-sections $(MAKEINFOINCLUDES) -TEXI2PODFLAGS=$(MAKEINFOINCLUDES) -DVERSION="$(VERSION)" -DCONFDIR="$(qemu_confdir)" -TEXI2PDFFLAGS=$(if $(V),,--quiet) -I $(SRC_PATH) $(MAKEINFOINCLUDES) - -docs/version.texi: $(SRC_PATH)/VERSION config-host.mak - $(call quiet-command,(\ - echo "@set VERSION $(VERSION)" && \ - echo "@set CONFDIR $(qemu_confdir)" \ - )> $@,"GEN","$@") - -%.html: %.texi docs/version.texi - $(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --no-headers \ - --html $< -o $@,"GEN","$@") - -%.info: %.texi docs/version.texi - $(call quiet-command,$(MAKEINFO) $(MAKEINFOFLAGS) $< -o $@,"GEN","$@") - -%.txt: %.texi docs/version.texi - $(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --no-headers \ - --plaintext $< -o $@,"GEN","$@") - -%.pdf: %.texi docs/version.texi - $(call quiet-command,texi2pdf $(TEXI2PDFFLAGS) $< -o $@,"GEN","$@") - -# Sphinx builds all its documentation at once in one invocation -# and handles "don't rebuild things unless necessary" itself. -# The '.doctrees' files are cached information to speed this up. -.PHONY: sphinxdocs -sphinxdocs: $(MANUAL_BUILDDIR)/devel/index.html \ - $(MANUAL_BUILDDIR)/interop/index.html \ - $(MANUAL_BUILDDIR)/specs/index.html \ - $(MANUAL_BUILDDIR)/system/index.html \ - $(MANUAL_BUILDDIR)/tools/index.html \ - $(MANUAL_BUILDDIR)/user/index.html - -# Canned command to build a single manual -# Arguments: $1 = manual name, $2 = Sphinx builder ('html' or 'man') -# Note the use of different doctree for each (manual, builder) tuple; -# this works around Sphinx not handling parallel invocation on -# a single doctree: https://github.com/sphinx-doc/sphinx/issues/2946 -build-manual = $(call quiet-command,CONFDIR="$(qemu_confdir)" $(SPHINX_BUILD) $(if $(V),,-q) $(SPHINX_WERROR) -b $2 -D version=$(VERSION) -D release="$(FULL_VERSION)" -d .doctrees/$1-$2 $(SRC_PATH)/docs/$1 $(MANUAL_BUILDDIR)/$1 ,"SPHINX","$(MANUAL_BUILDDIR)/$1") -# We assume all RST files in the manual's directory are used in it -manual-deps = $(wildcard $(SRC_PATH)/docs/$1/*.rst $(SRC_PATH)/docs/$1/*/*.rst) \ - $(SRC_PATH)/docs/defs.rst.inc \ - $(SRC_PATH)/docs/$1/conf.py $(SRC_PATH)/docs/conf.py \ - $(SRC_PATH)/docs/sphinx/*.py -# Macro to write out the rule and dependencies for building manpages -# Usage: $(call define-manpage-rule,manualname,manpage1 manpage2...[,extradeps]) -# 'extradeps' is optional, and specifies extra files (eg .hx files) that -# the manual page depends on. -define define-manpage-rule -$(call atomic,$(foreach manpage,$2,$(MANUAL_BUILDDIR)/$1/$(manpage)),$(call manual-deps,$1) $3) - $(call build-manual,$1,man) -endef - -$(MANUAL_BUILDDIR)/devel/index.html: $(call manual-deps,devel) - $(call build-manual,devel,html) - -$(MANUAL_BUILDDIR)/interop/index.html: $(call manual-deps,interop) - $(call build-manual,interop,html) - -$(MANUAL_BUILDDIR)/specs/index.html: $(call manual-deps,specs) - $(call build-manual,specs,html) - -$(MANUAL_BUILDDIR)/system/index.html: $(call manual-deps,system) $(SRC_PATH)/hmp-commands.hx $(SRC_PATH)/hmp-commands-info.hx $(SRC_PATH)/qemu-options.hx - $(call build-manual,system,html) - -$(MANUAL_BUILDDIR)/tools/index.html: $(call manual-deps,tools) $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/docs/qemu-option-trace.rst.inc - $(call build-manual,tools,html) - -$(MANUAL_BUILDDIR)/user/index.html: $(call manual-deps,user) - $(call build-manual,user,html) - -$(call define-manpage-rule,interop,qemu-ga.8) - -$(call define-manpage-rule,system,qemu.1 qemu-block-drivers.7 qemu-cpu-models.7) - -$(call define-manpage-rule,tools,\ - qemu-img.1 qemu-nbd.8 qemu-trace-stap.1\ - virtiofsd.1 virtfs-proxy-helper.1,\ - $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/docs/qemu-option-trace.rst.inc) - -$(MANUAL_BUILDDIR)/index.html: $(SRC_PATH)/docs/index.html.in qemu-version.h - @mkdir -p "$(MANUAL_BUILDDIR)" - $(call quiet-command, sed "s|@@VERSION@@|${VERSION}|g" $< >$@, \ - "GEN","$@") - -docs/interop/qemu-qmp-qapi.texi: qapi/qapi-doc.texi - @cp -p $< $@ - -docs/interop/qemu-ga-qapi.texi: qga/qapi-generated/qga-qapi-doc.texi - @cp -p $< $@ - -html: docs/interop/qemu-qmp-ref.html docs/interop/qemu-ga-ref.html sphinxdocs -info: docs/interop/qemu-qmp-ref.info docs/interop/qemu-ga-ref.info -pdf: docs/interop/qemu-qmp-ref.pdf docs/interop/qemu-ga-ref.pdf -txt: docs/interop/qemu-qmp-ref.txt docs/interop/qemu-ga-ref.txt - -docs/interop/qemu-ga-ref.dvi docs/interop/qemu-ga-ref.html \ - docs/interop/qemu-ga-ref.info docs/interop/qemu-ga-ref.pdf \ - docs/interop/qemu-ga-ref.txt docs/interop/qemu-ga-ref.7: \ - docs/interop/qemu-ga-ref.texi docs/interop/qemu-ga-qapi.texi - -docs/interop/qemu-qmp-ref.dvi docs/interop/qemu-qmp-ref.html \ - docs/interop/qemu-qmp-ref.info docs/interop/qemu-qmp-ref.pdf \ - docs/interop/qemu-qmp-ref.txt docs/interop/qemu-qmp-ref.7: \ - docs/interop/qemu-qmp-ref.texi docs/interop/qemu-qmp-qapi.texi - -$(filter %.1 %.7 %.8,$(DOCS)): scripts/texi2pod.pl - -# Reports/Analysis - -%/coverage-report.html: - @mkdir -p $* - $(call quiet-command,\ - gcovr -r $(SRC_PATH) \ - $(foreach t, $(TARGET_DIRS), --object-directory $(BUILD_DIR)/$(t)) \ - --object-directory $(BUILD_DIR) \ - -p --html --html-details -o $@, \ - "GEN", "coverage-report.html") - -.PHONY: coverage-report -coverage-report: $(CURDIR)/reports/coverage/coverage-report.html ifdef CONFIG_WIN32 @@ -1178,16 +316,16 @@ installer: $(INSTALLER) INSTDIR=/tmp/qemu-nsis -$(INSTALLER): install-doc $(SRC_PATH)/qemu.nsi - $(MAKE) install prefix=${INSTDIR} +$(INSTALLER): $(SRC_PATH)/qemu.nsi + $(MAKE) install DESTDIR=${INSTDIR} ifdef SIGNCODE - (cd ${INSTDIR}; \ + (cd ${INSTDIR}/${bindir}; \ for i in *.exe; do \ $(SIGNCODE) $${i}; \ done \ ) endif # SIGNCODE - (cd ${INSTDIR}; \ + (cd ${INSTDIR}/${bindir}; \ for i in qemu-system-*.exe; do \ arch=$${i%.exe}; \ arch=$${arch#qemu-system-}; \ @@ -1196,11 +334,11 @@ endif # SIGNCODE echo File \"\$${BINDIR}\\$$i\"; \ echo SectionEnd; \ done \ - ) >${INSTDIR}/system-emulations.nsh + ) >${INSTDIR}/${bindir}/system-emulations.nsh makensis $(nsisflags) \ $(if $(BUILD_DOCS),-DCONFIG_DOCUMENTATION="y") \ $(if $(CONFIG_GTK),-DCONFIG_GTK="y") \ - -DBINDIR="${INSTDIR}" \ + -DBINDIR="${INSTDIR}/${bindir}" \ $(if $(DLL_PATH),-DDLLDIR="$(DLL_PATH)") \ -DSRCDIR="$(SRC_PATH)" \ -DOUTFILE="$(INSTALLER)" \ @@ -1220,10 +358,6 @@ Makefile: $(generated-files-y) endif endif -.SECONDARY: $(TRACE_HEADERS) $(TRACE_HEADERS:%=%-timestamp) \ - $(TRACE_SOURCES) $(TRACE_SOURCES:%=%-timestamp) \ - $(TRACE_DTRACE) $(TRACE_DTRACE:%=%-timestamp) - # Include automatically generated dependency files # Dependencies in Makefile.objs files come from our recursive subdir rules -include $(wildcard *.d tests/*.d) @@ -1238,38 +372,14 @@ print-help = $(quiet-@)$(call print-help-run,$1,$2) help: @echo 'Generic targets:' $(call print-help,all,Build all) -ifdef CONFIG_MODULES - $(call print-help,modules,Build all modules) -endif $(call print-help,dir/file.o,Build specified target only) $(call print-help,install,Install QEMU, documentation and tools) $(call print-help,ctags/TAGS,Generate tags file for editors) $(call print-help,cscope,Generate cscope index) + $(call print-help,sparse,Run sparse on the QEMU source) @echo '' - @$(if $(TARGET_DIRS), \ - echo 'Architecture specific targets:'; \ - $(foreach t, $(TARGET_DIRS), \ - $(call print-help-run,$(t)/all,Build for $(t)); \ - $(if $(CONFIG_FUZZ), \ - $(if $(findstring softmmu,$(t)), \ - $(call print-help-run,$(t)/fuzz,Build fuzzer for $(t)); \ - ))) \ - echo '') - @$(if $(HELPERS-y), \ - echo 'Helper targets:'; \ - $(foreach t, $(HELPERS-y), \ - $(call print-help-run,$(t),Build $(shell basename $(t)));) \ - echo '') - @$(if $(TOOLS), \ - echo 'Tools targets:'; \ - $(foreach t, $(TOOLS), \ - $(call print-help-run,$(t),Build $(shell basename $(t)) tool);) \ - echo '') @echo 'Cleaning targets:' $(call print-help,clean,Remove most generated files but keep the config) -ifdef CONFIG_GCOV - $(call print-help,clean-coverage,Remove coverage files) -endif $(call print-help,distclean,Remove all generated files) $(call print-help,dist,Build a distributable tarball) @echo '' @@ -1279,10 +389,7 @@ endif $(call print-help,vm-help,Help about targets running tests inside VM) @echo '' @echo 'Documentation targets:' - $(call print-help,html info pdf txt,Build documentation in specified format) -ifdef CONFIG_GCOV - $(call print-help,coverage-report,Create code coverage report) -endif + $(call print-help,html info pdf txt man,Build documentation in specified format) @echo '' ifdef CONFIG_WIN32 @echo 'Windows targets:' diff --git a/Makefile.objs b/Makefile.objs index d22b3b45d7..c351b59641 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -1,215 +1,34 @@ ####################################################################### # Common libraries for tools and emulators -stub-obj-y = stubs/ -util-obj-y = crypto/ util/ qobject/ qapi/ -qom-obj-y = qom/ +qom-obj-y = qom/libqom.fa ####################################################################### # code used by both qemu system emulation and qemu-img ifeq ($(call lor,$(CONFIG_SOFTMMU),$(CONFIG_TOOLS)),y) -chardev-obj-y = chardev/ +authz-obj-y = authz/libauthz.fa +authz/libauthz.fa-libs = $(if $(CONFIG_AUTH_PAM),-lpam) -authz-obj-y = authz/ +block-obj-y += libblock.fa -block-obj-y = block/ nbd/ scsi/ -block-obj-y += block.o blockjob.o job.o -block-obj-y += qemu-io-cmds.o -block-obj-$(CONFIG_REPLICATION) += replication.o +libblock.fa-libs = $(ZSTD_LIBS) +libblock.fa-libs += $(LIBNFS_LIBS) +libblock.fa-libs += $(LIBISCSI_LIBS) +libblock.fa-libs += $(CURL_LIBS) +libblock.fa-libs += $(RBD_LIBS) +libblock.fa-libs += $(GLUSTERFS_LIBS) +libblock.fa-libs += $(VXHS_LIBS) +libblock.fa-libs += $(LIBSSH_LIBS) +libblock.fa-libs += $(BZIP2_LIBS) +libblock.fa-libs += $(LZFSE_LIBS) +libblock.fa-libs += $(if $(CONFIG_LINUX_AIO),-laio) +libblock.fa-libs += $(LIBXML2_LIBS) -block-obj-m = block/ +chardev-obj-y = chardev/libchardev.fa -crypto-obj-y = crypto/ +crypto-obj-y = crypto/libcrypto.fa -io-obj-y = io/ +io-obj-y = io/libio.fa endif # CONFIG_SOFTMMU or CONFIG_TOOLS - -####################################################################### -# storage-daemon-obj-y is code used by qemu-storage-daemon (these objects are -# used for system emulation, too, but specified separately there) - -storage-daemon-obj-y = block/ monitor/ qapi/ qom/ storage-daemon/ -storage-daemon-obj-y += blockdev.o blockdev-nbd.o iothread.o job-qmp.o -storage-daemon-obj-$(CONFIG_WIN32) += os-win32.o -storage-daemon-obj-$(CONFIG_POSIX) += os-posix.o - -###################################################################### -# Target independent part of system emulation. The long term path is to -# suppress *all* target specific code in case of system emulation, i.e. a -# single QEMU executable should support all CPUs and machines. - -ifeq ($(CONFIG_SOFTMMU),y) -common-obj-y = blockdev.o blockdev-nbd.o block/ -common-obj-y += bootdevice.o iothread.o -common-obj-y += dump/ -common-obj-y += job-qmp.o -common-obj-y += monitor/ -common-obj-y += net/ -common-obj-y += qdev-monitor.o -common-obj-$(CONFIG_WIN32) += os-win32.o -common-obj-$(CONFIG_POSIX) += os-posix.o - -common-obj-$(CONFIG_LINUX) += fsdev/ - -common-obj-y += accel/ -common-obj-y += migration/ - -common-obj-y += audio/ -common-obj-m += audio/ -common-obj-y += hw/ -common-obj-m += hw/ - -common-obj-y += replay/ - -common-obj-y += ui/ -common-obj-m += ui/ - -common-obj-y += dma-helpers.o -common-obj-$(CONFIG_TPM) += tpm.o - -common-obj-y += backends/ -common-obj-y += chardev/ -common-obj-m += chardev/ - -common-obj-$(CONFIG_SECCOMP) += qemu-seccomp.o -qemu-seccomp.o-cflags := $(SECCOMP_CFLAGS) -qemu-seccomp.o-libs := $(SECCOMP_LIBS) - -common-obj-$(CONFIG_FDT) += device_tree.o - -common-obj-y += qapi/ - -endif # CONFIG_SOFTMMU - -####################################################################### -# Target-independent parts used in system and user emulation -common-obj-y += cpus-common.o -common-obj-y += hw/ -common-obj-y += qom/ -common-obj-y += disas/ - -###################################################################### -# Resource file for Windows executables -version-obj-$(CONFIG_WIN32) += $(BUILD_DIR)/version.o - -###################################################################### -# tracing -util-obj-y += trace/ - -###################################################################### -# guest agent - -# FIXME: a few definitions from qapi/qapi-types.o and -# qapi/qapi-visit.o are needed by libqemuutil.a. These should be -# extracted into a QAPI schema module, or perhaps a separate schema. -qga-obj-y = qga/ -qga-vss-dll-obj-y = qga/ - -###################################################################### -# contrib -elf2dmp-obj-y = contrib/elf2dmp/ -ivshmem-client-obj-$(CONFIG_IVSHMEM) = contrib/ivshmem-client/ -ivshmem-server-obj-$(CONFIG_IVSHMEM) = contrib/ivshmem-server/ -libvhost-user-obj-y = contrib/libvhost-user/ -vhost-user-scsi.o-cflags := $(LIBISCSI_CFLAGS) -vhost-user-scsi.o-libs := $(LIBISCSI_LIBS) -vhost-user-scsi-obj-y = contrib/vhost-user-scsi/ -vhost-user-blk-obj-y = contrib/vhost-user-blk/ -rdmacm-mux-obj-y = contrib/rdmacm-mux/ -vhost-user-input-obj-y = contrib/vhost-user-input/ -vhost-user-gpu-obj-y = contrib/vhost-user-gpu/ -virtiofsd-obj-y = tools/virtiofsd/ - -###################################################################### -trace-events-subdirs = -trace-events-subdirs += accel/kvm -trace-events-subdirs += accel/tcg -trace-events-subdirs += backends -trace-events-subdirs += backends/tpm -trace-events-subdirs += crypto -trace-events-subdirs += monitor -ifeq ($(CONFIG_USER_ONLY),y) -trace-events-subdirs += linux-user -endif -ifeq ($(CONFIG_BLOCK),y) -trace-events-subdirs += authz -trace-events-subdirs += block -trace-events-subdirs += io -trace-events-subdirs += nbd -trace-events-subdirs += scsi -endif -ifeq ($(CONFIG_SOFTMMU),y) -trace-events-subdirs += audio -trace-events-subdirs += chardev -trace-events-subdirs += hw/9pfs -trace-events-subdirs += hw/acpi -trace-events-subdirs += hw/alpha -trace-events-subdirs += hw/arm -trace-events-subdirs += hw/audio -trace-events-subdirs += hw/block -trace-events-subdirs += hw/block/dataplane -trace-events-subdirs += hw/char -trace-events-subdirs += hw/dma -trace-events-subdirs += hw/hppa -trace-events-subdirs += hw/hyperv -trace-events-subdirs += hw/i2c -trace-events-subdirs += hw/i386 -trace-events-subdirs += hw/i386/xen -trace-events-subdirs += hw/ide -trace-events-subdirs += hw/input -trace-events-subdirs += hw/intc -trace-events-subdirs += hw/isa -trace-events-subdirs += hw/mem -trace-events-subdirs += hw/mips -trace-events-subdirs += hw/misc -trace-events-subdirs += hw/misc/macio -trace-events-subdirs += hw/net -trace-events-subdirs += hw/nvram -trace-events-subdirs += hw/pci -trace-events-subdirs += hw/pci-host -trace-events-subdirs += hw/ppc -trace-events-subdirs += hw/rdma -trace-events-subdirs += hw/rdma/vmw -trace-events-subdirs += hw/rtc -trace-events-subdirs += hw/s390x -trace-events-subdirs += hw/scsi -trace-events-subdirs += hw/sd -trace-events-subdirs += hw/sparc -trace-events-subdirs += hw/sparc64 -trace-events-subdirs += hw/ssi -trace-events-subdirs += hw/timer -trace-events-subdirs += hw/tpm -trace-events-subdirs += hw/usb -trace-events-subdirs += hw/vfio -trace-events-subdirs += hw/virtio -trace-events-subdirs += hw/watchdog -trace-events-subdirs += hw/xen -trace-events-subdirs += hw/gpio -trace-events-subdirs += hw/riscv -trace-events-subdirs += migration -trace-events-subdirs += net -trace-events-subdirs += ui -endif -trace-events-subdirs += hw/core -trace-events-subdirs += hw/display -trace-events-subdirs += qapi -trace-events-subdirs += qom -trace-events-subdirs += target/arm -trace-events-subdirs += target/hppa -trace-events-subdirs += target/i386 -trace-events-subdirs += target/mips -trace-events-subdirs += target/ppc -trace-events-subdirs += target/riscv -trace-events-subdirs += target/s390x -trace-events-subdirs += target/sparc -trace-events-subdirs += util - -trace-events-files = $(SRC_PATH)/trace-events $(trace-events-subdirs:%=$(SRC_PATH)/%/trace-events) - -trace-obj-y = trace-root.o -trace-obj-y += $(trace-events-subdirs:%=%/trace.o) -trace-obj-$(CONFIG_TRACE_UST) += trace-ust-all.o -trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace-root.o -trace-obj-$(CONFIG_TRACE_DTRACE) += $(trace-events-subdirs:%=%/trace-dtrace.o) diff --git a/Makefile.target b/Makefile.target deleted file mode 100644 index ffa2657269..0000000000 --- a/Makefile.target +++ /dev/null @@ -1,287 +0,0 @@ -# -*- Mode: makefile -*- - -BUILD_DIR?=$(CURDIR)/.. - -include ../config-host.mak -include config-target.mak -include $(SRC_PATH)/rules.mak - -ifdef CONFIG_SOFTMMU -include config-devices.mak -endif - -$(call set-vpath, $(SRC_PATH):$(BUILD_DIR)) -ifdef CONFIG_LINUX -QEMU_CFLAGS += -isystem ../linux-headers -endif -QEMU_CFLAGS += -iquote .. -iquote $(SRC_PATH)/target/$(TARGET_BASE_ARCH) -DNEED_CPU_H - -QEMU_CFLAGS+=-iquote $(SRC_PATH)/include - -ifdef CONFIG_USER_ONLY -# user emulator name -QEMU_PROG=qemu-$(TARGET_NAME) -QEMU_PROG_BUILD = $(QEMU_PROG) -else -# system emulator name -QEMU_PROG=qemu-system-$(TARGET_NAME)$(EXESUF) -ifneq (,$(findstring -mwindows,$(SDL_LIBS))) -# Terminate program name with a 'w' because the linker builds a windows executable. -QEMU_PROGW=qemu-system-$(TARGET_NAME)w$(EXESUF) -$(QEMU_PROG): $(QEMU_PROGW) - $(call quiet-command,$(OBJCOPY) --subsystem console $(QEMU_PROGW) $(QEMU_PROG),"GEN","$(TARGET_DIR)$(QEMU_PROG)") -QEMU_PROG_BUILD = $(QEMU_PROGW) -else -QEMU_PROG_BUILD = $(QEMU_PROG) -endif -endif - -PROGS=$(QEMU_PROG) $(QEMU_PROGW) -STPFILES= - -config-target.h: config-target.h-timestamp -config-target.h-timestamp: config-target.mak - -config-devices.h: config-devices.h-timestamp -config-devices.h-timestamp: config-devices.mak - -ifdef CONFIG_TRACE_SYSTEMTAP -stap: $(QEMU_PROG).stp-installed $(QEMU_PROG).stp $(QEMU_PROG)-simpletrace.stp $(QEMU_PROG)-log.stp - -ifdef CONFIG_USER_ONLY -TARGET_TYPE=user -else -TARGET_TYPE=system -endif - -tracetool-y = $(SRC_PATH)/scripts/tracetool.py -tracetool-y += $(shell find $(SRC_PATH)/scripts/tracetool -name "*.py") - -$(QEMU_PROG).stp-installed: $(BUILD_DIR)/trace-events-all $(tracetool-y) - $(call quiet-command,$(TRACETOOL) \ - --group=all \ - --format=stap \ - --backends=$(TRACE_BACKENDS) \ - --binary=$(bindir)/$(QEMU_PROG) \ - --target-name=$(TARGET_NAME) \ - --target-type=$(TARGET_TYPE) \ - $< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG).stp-installed") - -$(QEMU_PROG).stp: $(BUILD_DIR)/trace-events-all $(tracetool-y) - $(call quiet-command,$(TRACETOOL) \ - --group=all \ - --format=stap \ - --backends=$(TRACE_BACKENDS) \ - --binary=$(realpath .)/$(QEMU_PROG) \ - --target-name=$(TARGET_NAME) \ - --target-type=$(TARGET_TYPE) \ - $< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG).stp") - -$(QEMU_PROG)-simpletrace.stp: $(BUILD_DIR)/trace-events-all $(tracetool-y) - $(call quiet-command,$(TRACETOOL) \ - --group=all \ - --format=simpletrace-stap \ - --backends=$(TRACE_BACKENDS) \ - --probe-prefix=qemu.$(TARGET_TYPE).$(TARGET_NAME) \ - $< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG)-simpletrace.stp") - -$(QEMU_PROG)-log.stp: $(BUILD_DIR)/trace-events-all $(tracetool-y) - $(call quiet-command,$(TRACETOOL) \ - --group=all \ - --format=log-stap \ - --backends=$(TRACE_BACKENDS) \ - --probe-prefix=qemu.$(TARGET_TYPE).$(TARGET_NAME) \ - $< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG)-log.stp") - -else -stap: -endif -.PHONY: stap - -all: $(PROGS) stap - -# Dummy command so that make thinks it has done something - @true - -obj-y += trace/ - -######################################################### -# cpu emulator library -obj-y += exec.o exec-vary.o -obj-y += accel/ -obj-$(CONFIG_TCG) += tcg/tcg.o tcg/tcg-op.o tcg/tcg-op-vec.o tcg/tcg-op-gvec.o -obj-$(CONFIG_TCG) += tcg/tcg-common.o tcg/optimize.o -obj-$(CONFIG_TCG_INTERPRETER) += tcg/tci.o -obj-$(CONFIG_TCG_INTERPRETER) += disas/tci.o -obj-$(CONFIG_TCG) += fpu/softfloat.o -obj-y += target/$(TARGET_BASE_ARCH)/ -obj-y += disas.o -obj-$(call notempty,$(TARGET_XML_FILES)) += gdbstub-xml.o -LIBS := $(libs_cpu) $(LIBS) - -obj-$(CONFIG_PLUGIN) += plugins/ - -######################################################### -# Linux user emulator target - -ifdef CONFIG_LINUX_USER - -QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) \ - -I$(SRC_PATH)/linux-user/host/$(ARCH) \ - -I$(SRC_PATH)/linux-user \ - -Ilinux-user/$(TARGET_ABI_DIR) - -obj-y += linux-user/ -obj-y += gdbstub.o thunk.o - -endif #CONFIG_LINUX_USER - -######################################################### -# BSD user emulator target - -ifdef CONFIG_BSD_USER - -QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ABI_DIR) \ - -I$(SRC_PATH)/bsd-user/$(HOST_VARIANT_DIR) - -obj-y += bsd-user/ -obj-y += gdbstub.o - -endif #CONFIG_BSD_USER - -######################################################### -# System emulator target -ifdef CONFIG_SOFTMMU -obj-y += softmmu/ -obj-y += gdbstub.o -obj-y += dump/ -obj-y += hw/ -obj-y += monitor/ -obj-y += qapi/ -obj-y += migration/ram.o -LIBS := $(libs_softmmu) $(LIBS) - -# Hardware support -ifeq ($(TARGET_NAME), sparc64) -obj-y += hw/sparc64/ -else -obj-y += hw/$(TARGET_BASE_ARCH)/ -endif - -generated-files-y += hmp-commands.h hmp-commands-info.h -generated-files-y += config-devices.h - -endif # CONFIG_SOFTMMU - -dummy := $(call unnest-vars,,obj-y) -all-obj-y := $(obj-y) - -# -# common-obj-m has some crap here, probably as side effect from -# unnest-vars recursing into target directories to fill obj-y and not -# properly handling the -m case. -# -# Clear common-obj-m as workaround. Fixes suspious dependency errors -# when building devices as modules. A bit hackish, but should be ok -# as long as we do not have any target-specific modules. -# -# The meson-based build system currently in development doesn't need -# unnest-vars and will obsolete this workaround. -# -common-obj-m := - -include $(SRC_PATH)/Makefile.objs -dummy := $(call unnest-vars,.., \ - authz-obj-y \ - block-obj-y \ - block-obj-m \ - chardev-obj-y \ - crypto-obj-y \ - qom-obj-y \ - io-obj-y \ - common-obj-y \ - common-obj-m) -all-obj-y += $(common-obj-y) -all-obj-y += $(qom-obj-y) -all-obj-$(CONFIG_SOFTMMU) += $(authz-obj-y) -all-obj-$(CONFIG_SOFTMMU) += $(block-obj-y) $(chardev-obj-y) -all-obj-$(CONFIG_SOFTMMU) += $(crypto-obj-y) -all-obj-$(CONFIG_SOFTMMU) += $(io-obj-y) - -ifdef CONFIG_SOFTMMU -$(QEMU_PROG_BUILD): config-devices.mak -endif - -COMMON_LDADDS = ../libqemuutil.a - -# build either PROG or PROGW -$(QEMU_PROG_BUILD): $(all-obj-y) $(COMMON_LDADDS) $(softmmu-main-y) - $(call LINK, $(filter-out %.mak, $^)) -ifdef CONFIG_DARWIN - $(call quiet-command,Rez -append $(SRC_PATH)/pc-bios/qemu.rsrc -o $@,"REZ","$(TARGET_DIR)$@") - $(call quiet-command,SetFile -a C $@,"SETFILE","$(TARGET_DIR)$@") -endif - -gdbstub-xml.c: $(TARGET_XML_FILES) $(SRC_PATH)/scripts/feature_to_c.sh - $(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/scripts/feature_to_c.sh $@ $(TARGET_XML_FILES),"GEN","$(TARGET_DIR)$@") - -hmp-commands.h: $(SRC_PATH)/hmp-commands.hx $(SRC_PATH)/scripts/hxtool - $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"GEN","$(TARGET_DIR)$@") - -hmp-commands-info.h: $(SRC_PATH)/hmp-commands-info.hx $(SRC_PATH)/scripts/hxtool - $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"GEN","$(TARGET_DIR)$@") - -clean: clean-target - rm -f *.a *~ $(PROGS) - rm -f $(shell find . -name '*.[od]') - rm -f hmp-commands.h gdbstub-xml.c - rm -f trace/generated-helpers.c trace/generated-helpers.c-timestamp -ifdef CONFIG_TRACE_SYSTEMTAP - rm -f *.stp -endif - -ifdef CONFIG_FUZZ -include $(SRC_PATH)/tests/qtest/fuzz/Makefile.include -include $(SRC_PATH)/tests/qtest/Makefile.include - -fuzz: fuzz-vars -fuzz-vars: QEMU_CFLAGS := $(FUZZ_CFLAGS) $(QEMU_CFLAGS) -fuzz-vars: QEMU_LDFLAGS := $(FUZZ_LDFLAGS) $(QEMU_LDFLAGS) -fuzz-vars: $(QEMU_PROG_FUZZ) -dummy := $(call unnest-vars,, fuzz-obj-y) - - -$(QEMU_PROG_FUZZ): config-devices.mak $(all-obj-y) $(COMMON_LDADDS) $(fuzz-obj-y) - $(call LINK, $(filter-out %.mak, $^)) - -endif - -install: all -ifneq ($(PROGS),) - $(call install-prog,$(PROGS),$(DESTDIR)$(bindir)) -endif -ifdef CONFIG_TRACE_SYSTEMTAP - $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset" - $(INSTALL_DATA) $(QEMU_PROG).stp-installed "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset/$(QEMU_PROG).stp" - $(INSTALL_DATA) $(QEMU_PROG)-simpletrace.stp "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset/$(QEMU_PROG)-simpletrace.stp" - $(INSTALL_DATA) $(QEMU_PROG)-log.stp "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset/$(QEMU_PROG)-log.stp" -endif - -generated-files-y += config-target.h -Makefile: $(generated-files-y) - -# Reports/Analysis -# -# The target specific coverage report only cares about target specific -# blobs and not the shared code. -# - -%/coverage-report.html: - @mkdir -p $* - $(call quiet-command,\ - gcovr -r $(SRC_PATH) --object-directory $(CURDIR) \ - -p --html --html-details -o $@, \ - "GEN", "coverage-report.html") - -.PHONY: coverage-report -coverage-report: $(CURDIR)/reports/coverage/coverage-report.html @@ -1 +1 @@ -5.1.0 +5.1.50 diff --git a/accel/Makefile.objs b/accel/Makefile.objs deleted file mode 100644 index ff72f0d030..0000000000 --- a/accel/Makefile.objs +++ /dev/null @@ -1,6 +0,0 @@ -common-obj-$(CONFIG_SOFTMMU) += accel.o -obj-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_POSIX)) += qtest.o -obj-$(CONFIG_KVM) += kvm/ -obj-$(CONFIG_TCG) += tcg/ -obj-$(CONFIG_XEN) += xen/ -obj-y += stubs/ diff --git a/accel/kvm/Makefile.objs b/accel/kvm/Makefile.objs deleted file mode 100644 index fdfa481578..0000000000 --- a/accel/kvm/Makefile.objs +++ /dev/null @@ -1,2 +0,0 @@ -obj-y += kvm-all.o -obj-$(call lnot,$(CONFIG_SEV)) += sev-stub.o diff --git a/accel/kvm/meson.build b/accel/kvm/meson.build new file mode 100644 index 0000000000..4db2388e2f --- /dev/null +++ b/accel/kvm/meson.build @@ -0,0 +1,5 @@ +kvm_ss = ss.source_set() +kvm_ss.add(files('kvm-all.c')) +kvm_ss.add(when: 'CONFIG_SEV', if_false: files('sev-stub.c')) + +specific_ss.add_all(when: 'CONFIG_KVM', if_true: kvm_ss) diff --git a/accel/kvm/trace.h b/accel/kvm/trace.h new file mode 100644 index 0000000000..67c935a6f7 --- /dev/null +++ b/accel/kvm/trace.h @@ -0,0 +1 @@ +#include "trace/trace-accel_kvm.h" diff --git a/accel/meson.build b/accel/meson.build new file mode 100644 index 0000000000..26c503e480 --- /dev/null +++ b/accel/meson.build @@ -0,0 +1,7 @@ +softmmu_ss.add(files('accel.c')) +specific_ss.add(when: ['CONFIG_SOFTMMU', 'CONFIG_POSIX'], if_true: files('qtest.c')) + +subdir('kvm') +subdir('tcg') +subdir('xen') +subdir('stubs') diff --git a/accel/stubs/Makefile.objs b/accel/stubs/Makefile.objs deleted file mode 100644 index bbd14e71fb..0000000000 --- a/accel/stubs/Makefile.objs +++ /dev/null @@ -1,6 +0,0 @@ -obj-$(call lnot,$(CONFIG_HAX)) += hax-stub.o -obj-$(call lnot,$(CONFIG_HVF)) += hvf-stub.o -obj-$(call lnot,$(CONFIG_WHPX)) += whpx-stub.o -obj-$(call lnot,$(CONFIG_KVM)) += kvm-stub.o -obj-$(call lnot,$(CONFIG_TCG)) += tcg-stub.o -obj-$(call lnot,$(CONFIG_XEN)) += xen-stub.o diff --git a/accel/stubs/meson.build b/accel/stubs/meson.build new file mode 100644 index 0000000000..314e3cfff4 --- /dev/null +++ b/accel/stubs/meson.build @@ -0,0 +1,6 @@ +specific_ss.add(when: 'CONFIG_HAX', if_false: files('hax-stub.c')) +specific_ss.add(when: 'CONFIG_XEN', if_false: files('xen-stub.c')) +specific_ss.add(when: 'CONFIG_HVF', if_false: files('hvf-stub.c')) +specific_ss.add(when: 'CONFIG_KVM', if_false: files('kvm-stub.c')) +specific_ss.add(when: 'CONFIG_TCG', if_false: files('tcg-stub.c')) +specific_ss.add(when: 'CONFIG_WHPX', if_false: files('whpx-stub.c')) diff --git a/accel/tcg/Makefile.objs b/accel/tcg/Makefile.objs deleted file mode 100644 index a92f2c454b..0000000000 --- a/accel/tcg/Makefile.objs +++ /dev/null @@ -1,9 +0,0 @@ -obj-$(CONFIG_SOFTMMU) += tcg-all.o -obj-$(CONFIG_SOFTMMU) += cputlb.o -obj-y += tcg-runtime.o tcg-runtime-gvec.o -obj-y += cpu-exec.o cpu-exec-common.o translate-all.o -obj-y += translator.o - -obj-$(CONFIG_USER_ONLY) += user-exec.o -obj-$(call lnot,$(CONFIG_SOFTMMU)) += user-exec-stub.o -obj-$(CONFIG_PLUGIN) += plugin-gen.o diff --git a/accel/tcg/atomic_common.inc.c b/accel/tcg/atomic_common.c.inc index 344525b0bb..344525b0bb 100644 --- a/accel/tcg/atomic_common.inc.c +++ b/accel/tcg/atomic_common.c.inc diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 5698292749..2d48281942 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -34,7 +34,7 @@ #include "qemu/atomic.h" #include "qemu/atomic128.h" #include "translate-all.h" -#include "trace-root.h" +#include "trace/trace-root.h" #include "trace/mem.h" #ifdef CONFIG_PLUGIN #include "qemu/plugin-memory.h" @@ -2354,7 +2354,7 @@ void cpu_stq_le_data(CPUArchState *env, target_ulong ptr, uint64_t val) #define ATOMIC_MMU_CLEANUP #define ATOMIC_MMU_IDX get_mmuidx(oi) -#include "atomic_common.inc.c" +#include "atomic_common.c.inc" #define DATA_SIZE 1 #include "atomic_template.h" diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build new file mode 100644 index 0000000000..2a335b50f2 --- /dev/null +++ b/accel/tcg/meson.build @@ -0,0 +1,15 @@ +tcg_ss = ss.source_set() +tcg_ss.add(files( + 'cpu-exec-common.c', + 'cpu-exec.c', + 'tcg-runtime-gvec.c', + 'tcg-runtime.c', + 'translate-all.c', + 'translator.c', +)) +tcg_ss.add(when: 'CONFIG_USER_ONLY', if_true: files('user-exec.c')) +tcg_ss.add(when: 'CONFIG_SOFTMMU', if_false: files('user-exec-stub.c')) +tcg_ss.add(when: 'CONFIG_PLUGIN', if_true: files('plugin-gen.c')) +specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_ss) + +specific_ss.add(when: ['CONFIG_SOFTMMU', 'CONFIG_TCG'], if_true: files('tcg-all.c', 'cputlb.c')) diff --git a/accel/tcg/trace.h b/accel/tcg/trace.h new file mode 100644 index 0000000000..db61fad3c6 --- /dev/null +++ b/accel/tcg/trace.h @@ -0,0 +1 @@ +#include "trace/trace-accel_tcg.h" diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index d8b027f8c1..bb039eb32d 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -26,7 +26,7 @@ #include "translate-all.h" #include "exec/helper-proto.h" #include "qemu/atomic128.h" -#include "trace-root.h" +#include "trace/trace-root.h" #include "trace/mem.h" #undef EAX @@ -1189,7 +1189,7 @@ static void *atomic_mmu_lookup(CPUArchState *env, target_ulong addr, #define ATOMIC_NAME(X) HELPER(glue(glue(atomic_ ## X, SUFFIX), END)) #define EXTRA_ARGS -#include "atomic_common.inc.c" +#include "atomic_common.c.inc" #define DATA_SIZE 1 #include "atomic_template.h" diff --git a/accel/xen/Makefile.objs b/accel/xen/Makefile.objs deleted file mode 100644 index 7482cfb436..0000000000 --- a/accel/xen/Makefile.objs +++ /dev/null @@ -1 +0,0 @@ -obj-y += xen-all.o diff --git a/accel/xen/meson.build b/accel/xen/meson.build new file mode 100644 index 0000000000..002bdb03c6 --- /dev/null +++ b/accel/xen/meson.build @@ -0,0 +1 @@ +specific_ss.add(when: 'CONFIG_XEN', if_true: files('xen-all.c')) diff --git a/audio/Makefile.objs b/audio/Makefile.objs deleted file mode 100644 index b4a4c11f31..0000000000 --- a/audio/Makefile.objs +++ /dev/null @@ -1,35 +0,0 @@ -common-obj-y = audio.o audio_legacy.o noaudio.o wavaudio.o mixeng.o -common-obj-$(CONFIG_SPICE) += spiceaudio.o -common-obj-$(CONFIG_AUDIO_COREAUDIO) += coreaudio.o -common-obj-$(CONFIG_AUDIO_DSOUND) += dsoundaudio.o -common-obj-$(CONFIG_AUDIO_WIN_INT) += audio_win_int.o -common-obj-y += wavcapture.o - -coreaudio.o-libs := $(COREAUDIO_LIBS) -dsoundaudio.o-libs := $(DSOUND_LIBS) - -# alsa module -common-obj-$(CONFIG_AUDIO_ALSA) += alsa.mo -alsa.mo-objs = alsaaudio.o -alsa.mo-libs := $(ALSA_LIBS) - -# oss module -common-obj-$(CONFIG_AUDIO_OSS) += oss.mo -oss.mo-objs = ossaudio.o -oss.mo-libs := $(OSS_LIBS) - -# pulseaudio module -common-obj-$(CONFIG_AUDIO_PA) += pa.mo -pa.mo-objs = paaudio.o -pa.mo-libs := $(PULSE_LIBS) - -# sdl module -common-obj-$(CONFIG_AUDIO_SDL) += sdl.mo -sdl.mo-objs = sdlaudio.o -sdl.mo-cflags := $(SDL_CFLAGS) -sdl.mo-libs := $(SDL_LIBS) - -# jack module -common-obj-$(CONFIG_AUDIO_JACK) += jack.mo -jack.mo-objs = jackaudio.o -jack.mo-libs := $(JACK_LIBS) diff --git a/audio/meson.build b/audio/meson.build new file mode 100644 index 0000000000..15c06ba045 --- /dev/null +++ b/audio/meson.build @@ -0,0 +1,30 @@ +softmmu_ss.add(files( + 'audio.c', + 'audio_legacy.c', + 'mixeng.c', + 'noaudio.c', + 'wavaudio.c', + 'wavcapture.c', +)) + +softmmu_ss.add(when: [spice, 'CONFIG_SPICE'], if_true: files('spiceaudio.c')) +softmmu_ss.add(when: [coreaudio, 'CONFIG_AUDIO_COREAUDIO'], if_true: files('coreaudio.c')) +softmmu_ss.add(when: [dsound, 'CONFIG_AUDIO_DSOUND'], if_true: files('dsoundaudio.c')) +softmmu_ss.add(when: ['CONFIG_AUDIO_WIN_INT'], if_true: files('audio_win_int.c')) + +audio_modules = {} +foreach m : [ + ['CONFIG_AUDIO_ALSA', 'alsa', alsa, 'alsaaudio.c'], + ['CONFIG_AUDIO_OSS', 'oss', oss, 'ossaudio.c'], + ['CONFIG_AUDIO_PA', 'pa', pulse, 'paaudio.c'], + ['CONFIG_AUDIO_SDL', 'sdl', sdl, 'sdlaudio.c'], + ['CONFIG_AUDIO_JACK', 'jack', jack, 'jackaudio.c'] +] + if config_host.has_key(m[0]) + module_ss = ss.source_set() + module_ss.add(when: m[2], if_true: files(m[3])) + audio_modules += {m[1] : module_ss} + endif +endforeach + +modules += {'audio': audio_modules} diff --git a/audio/trace.h b/audio/trace.h new file mode 100644 index 0000000000..4072a11b0f --- /dev/null +++ b/audio/trace.h @@ -0,0 +1 @@ +#include "trace/trace-audio.h" diff --git a/authz/Makefile.objs b/authz/Makefile.objs deleted file mode 100644 index ed7b273596..0000000000 --- a/authz/Makefile.objs +++ /dev/null @@ -1,7 +0,0 @@ -authz-obj-y += base.o -authz-obj-y += simple.o -authz-obj-y += list.o -authz-obj-y += listfile.o -authz-obj-$(CONFIG_AUTH_PAM) += pamacct.o - -pamacct.o-libs = -lpam diff --git a/authz/meson.build b/authz/meson.build new file mode 100644 index 0000000000..516d71f2e2 --- /dev/null +++ b/authz/meson.build @@ -0,0 +1,19 @@ +authz_ss = ss.source_set() +authz_ss.add(genh) +authz_ss.add(files( + 'base.c', + 'list.c', + 'listfile.c', + 'simple.c', +)) + +authz_ss.add(when: ['CONFIG_AUTH_PAM', pam], if_true: files('pamacct.c')) + +authz_ss = authz_ss.apply(config_host, strict: false) +libauthz = static_library('authz', authz_ss.sources() + genh, + dependencies: [authz_ss.dependencies()], + name_suffix: 'fa', + build_by_default: false) + +authz = declare_dependency(link_whole: libauthz, + dependencies: qom) diff --git a/authz/trace.h b/authz/trace.h new file mode 100644 index 0000000000..3176c127f7 --- /dev/null +++ b/authz/trace.h @@ -0,0 +1 @@ +#include "trace/trace-authz.h" diff --git a/backends/Makefile.objs b/backends/Makefile.objs deleted file mode 100644 index 22d204cb48..0000000000 --- a/backends/Makefile.objs +++ /dev/null @@ -1,23 +0,0 @@ -common-obj-y += rng.o rng-egd.o rng-builtin.o -common-obj-$(CONFIG_POSIX) += rng-random.o - -common-obj-$(CONFIG_TPM) += tpm/ - -common-obj-y += hostmem.o hostmem-ram.o -common-obj-$(CONFIG_POSIX) += hostmem-file.o - -common-obj-y += cryptodev.o -common-obj-y += cryptodev-builtin.o - -ifeq ($(CONFIG_VIRTIO_CRYPTO),y) -common-obj-y += cryptodev-vhost.o -common-obj-$(CONFIG_VHOST_CRYPTO) += cryptodev-vhost-user.o -endif - -common-obj-$(call land,$(CONFIG_VHOST_USER),$(CONFIG_VIRTIO)) += vhost-user.o - -common-obj-$(CONFIG_LINUX) += hostmem-memfd.o - -common-obj-$(CONFIG_GIO) += dbus-vmstate.o -dbus-vmstate.o-cflags = $(GIO_CFLAGS) -dbus-vmstate.o-libs = $(GIO_LIBS) diff --git a/backends/meson.build b/backends/meson.build new file mode 100644 index 0000000000..484456ece7 --- /dev/null +++ b/backends/meson.build @@ -0,0 +1,19 @@ +softmmu_ss.add([files( + 'cryptodev-builtin.c', + 'cryptodev.c', + 'hostmem-ram.c', + 'hostmem.c', + 'rng-builtin.c', + 'rng-egd.c', + 'rng.c', +), numa]) + +softmmu_ss.add(when: 'CONFIG_POSIX', if_true: files('rng-random.c')) +softmmu_ss.add(when: 'CONFIG_POSIX', if_true: files('hostmem-file.c')) +softmmu_ss.add(when: 'CONFIG_LINUX', if_true: files('hostmem-memfd.c')) +softmmu_ss.add(when: ['CONFIG_VHOST_USER', 'CONFIG_VIRTIO'], if_true: files('vhost-user.c')) +softmmu_ss.add(when: 'CONFIG_VIRTIO_CRYPTO', if_true: files('cryptodev-vhost.c')) +softmmu_ss.add(when: ['CONFIG_VIRTIO_CRYPTO', 'CONFIG_VHOST_CRYPTO'], if_true: files('cryptodev-vhost-user.c')) +softmmu_ss.add(when: 'CONFIG_GIO', if_true: [files('dbus-vmstate.c'), gio]) + +subdir('tpm') diff --git a/backends/tpm/Makefile.objs b/backends/tpm/Makefile.objs deleted file mode 100644 index db2731f634..0000000000 --- a/backends/tpm/Makefile.objs +++ /dev/null @@ -1,4 +0,0 @@ -common-obj-y += tpm_backend.o -common-obj-y += tpm_util.o -common-obj-$(CONFIG_TPM_PASSTHROUGH) += tpm_passthrough.o -common-obj-$(CONFIG_TPM_EMULATOR) += tpm_emulator.o diff --git a/backends/tpm/meson.build b/backends/tpm/meson.build new file mode 100644 index 0000000000..857929082e --- /dev/null +++ b/backends/tpm/meson.build @@ -0,0 +1,8 @@ +tpm_ss = ss.source_set() + +tpm_ss.add(files('tpm_backend.c')) +tpm_ss.add(files('tpm_util.c')) +tpm_ss.add(when: 'CONFIG_TPM_PASSTHROUGH', if_true: files('tpm_passthrough.c')) +tpm_ss.add(when: 'CONFIG_TPM_EMULATOR', if_true: files('tpm_emulator.c')) + +softmmu_ss.add_all(when: 'CONFIG_TPM', if_true: tpm_ss) diff --git a/backends/tpm/trace.h b/backends/tpm/trace.h new file mode 100644 index 0000000000..40c4729884 --- /dev/null +++ b/backends/tpm/trace.h @@ -0,0 +1 @@ +#include "trace/trace-backends_tpm.h" diff --git a/backends/trace.h b/backends/trace.h new file mode 100644 index 0000000000..77fe57f36c --- /dev/null +++ b/backends/trace.h @@ -0,0 +1 @@ +#include "trace/trace-backends.h" @@ -29,7 +29,7 @@ #include "block/nbd.h" #include "block/qdict.h" #include "qemu/error-report.h" -#include "module_block.h" +#include "block/module_block.h" #include "qemu/main-loop.h" #include "qemu/module.h" #include "qapi/error.h" @@ -433,9 +433,11 @@ static int bdrv_format_is_whitelisted(const char *format_name, bool read_only) { static const char *whitelist_rw[] = { CONFIG_BDRV_RW_WHITELIST + NULL }; static const char *whitelist_ro[] = { CONFIG_BDRV_RO_WHITELIST + NULL }; const char **p; diff --git a/block/Makefile.objs b/block/Makefile.objs deleted file mode 100644 index 19c6f371c9..0000000000 --- a/block/Makefile.objs +++ /dev/null @@ -1,75 +0,0 @@ -block-obj-y += raw-format.o vmdk.o vpc.o -block-obj-$(CONFIG_QCOW1) += qcow.o -block-obj-$(CONFIG_VDI) += vdi.o -block-obj-$(CONFIG_CLOOP) += cloop.o -block-obj-$(CONFIG_BOCHS) += bochs.o -block-obj-$(CONFIG_VVFAT) += vvfat.o -block-obj-$(CONFIG_DMG) += dmg.o - -block-obj-y += qcow2.o qcow2-refcount.o qcow2-cluster.o qcow2-snapshot.o qcow2-cache.o qcow2-bitmap.o qcow2-threads.o -block-obj-$(CONFIG_QED) += qed.o qed-l2-cache.o qed-table.o qed-cluster.o -block-obj-$(CONFIG_QED) += qed-check.o -block-obj-y += vhdx.o vhdx-endian.o vhdx-log.o -block-obj-y += quorum.o -block-obj-y += blkdebug.o blkverify.o blkreplay.o -block-obj-$(CONFIG_PARALLELS) += parallels.o -block-obj-y += blklogwrites.o -block-obj-y += block-backend.o snapshot.o qapi.o -block-obj-$(CONFIG_WIN32) += file-win32.o win32-aio.o -block-obj-$(CONFIG_POSIX) += file-posix.o -block-obj-$(CONFIG_LINUX_AIO) += linux-aio.o -block-obj-$(CONFIG_LINUX_IO_URING) += io_uring.o -block-obj-y += null.o mirror.o commit.o io.o create.o amend.o -block-obj-y += throttle-groups.o -block-obj-$(CONFIG_LINUX) += nvme.o - -block-obj-y += nbd.o -block-obj-$(CONFIG_SHEEPDOG) += sheepdog.o -block-obj-$(CONFIG_LIBISCSI) += iscsi.o -block-obj-$(if $(CONFIG_LIBISCSI),y,n) += iscsi-opts.o -block-obj-$(CONFIG_LIBNFS) += nfs.o -block-obj-$(CONFIG_CURL) += curl.o -block-obj-$(CONFIG_RBD) += rbd.o -block-obj-$(CONFIG_GLUSTERFS) += gluster.o -block-obj-$(CONFIG_LIBSSH) += ssh.o -block-obj-y += accounting.o dirty-bitmap.o -block-obj-y += write-threshold.o -block-obj-y += backup.o -block-obj-$(CONFIG_REPLICATION) += replication.o -block-obj-y += throttle.o copy-on-read.o -block-obj-y += block-copy.o - -block-obj-y += crypto.o - -block-obj-y += aio_task.o -block-obj-y += backup-top.o -block-obj-y += filter-compress.o -common-obj-y += monitor/ -block-obj-y += monitor/ - -block-obj-y += stream.o - -common-obj-y += qapi-sysemu.o - -nfs.o-libs := $(LIBNFS_LIBS) -iscsi.o-cflags := $(LIBISCSI_CFLAGS) -iscsi.o-libs := $(LIBISCSI_LIBS) -curl.o-cflags := $(CURL_CFLAGS) -curl.o-libs := $(CURL_LIBS) -rbd.o-cflags := $(RBD_CFLAGS) -rbd.o-libs := $(RBD_LIBS) -gluster.o-cflags := $(GLUSTERFS_CFLAGS) -gluster.o-libs := $(GLUSTERFS_LIBS) -ssh.o-cflags := $(LIBSSH_CFLAGS) -ssh.o-libs := $(LIBSSH_LIBS) -block-obj-dmg-bz2-$(CONFIG_BZIP2) += dmg-bz2.o -block-obj-$(if $(CONFIG_DMG),m,n) += $(block-obj-dmg-bz2-y) -dmg-bz2.o-libs := $(BZIP2_LIBS) -block-obj-$(if $(CONFIG_LZFSE),m,n) += dmg-lzfse.o -dmg-lzfse.o-libs := $(LZFSE_LIBS) -qcow.o-libs := -lz -linux-aio.o-libs := -laio -io_uring.o-cflags := $(LINUX_IO_URING_CFLAGS) -io_uring.o-libs := $(LINUX_IO_URING_LIBS) -parallels.o-cflags := $(LIBXML2_CFLAGS) -parallels.o-libs := $(LIBXML2_LIBS) diff --git a/block/block-copy.c b/block/block-copy.c index f7428a7c08..a30b9097ef 100644 --- a/block/block-copy.c +++ b/block/block-copy.c @@ -142,6 +142,9 @@ static BlockCopyTask *block_copy_task_create(BlockCopyState *s, return NULL; } + assert(QEMU_IS_ALIGNED(offset, s->cluster_size)); + bytes = QEMU_ALIGN_UP(bytes, s->cluster_size); + /* region is dirty, so no existent tasks possible in it */ assert(!find_conflicting_task(s, offset, bytes)); diff --git a/block/meson.build b/block/meson.build new file mode 100644 index 0000000000..4dbbfe60b4 --- /dev/null +++ b/block/meson.build @@ -0,0 +1,115 @@ +block_ss.add(genh) +block_ss.add(files( + 'accounting.c', + 'aio_task.c', + 'amend.c', + 'backup.c', + 'backup-top.c', + 'blkdebug.c', + 'blklogwrites.c', + 'blkreplay.c', + 'blkverify.c', + 'block-backend.c', + 'block-copy.c', + 'commit.c', + 'copy-on-read.c', + 'create.c', + 'crypto.c', + 'dirty-bitmap.c', + 'filter-compress.c', + 'io.c', + 'mirror.c', + 'nbd.c', + 'null.c', + 'qapi.c', + 'qcow2-bitmap.c', + 'qcow2-cache.c', + 'qcow2-cluster.c', + 'qcow2-refcount.c', + 'qcow2-snapshot.c', + 'qcow2-threads.c', + 'qcow2.c', + 'quorum.c', + 'raw-format.c', + 'snapshot.c', + 'throttle-groups.c', + 'throttle.c', + 'vhdx-endian.c', + 'vhdx-log.c', + 'vhdx.c', + 'vmdk.c', + 'vpc.c', + 'write-threshold.c', +), zstd) + +block_ss.add(when: [zlib, 'CONFIG_QCOW1'], if_true: files('qcow.c')) +block_ss.add(when: 'CONFIG_VDI', if_true: files('vdi.c')) +block_ss.add(when: 'CONFIG_CLOOP', if_true: files('cloop.c')) +block_ss.add(when: 'CONFIG_BOCHS', if_true: files('bochs.c')) +block_ss.add(when: 'CONFIG_VVFAT', if_true: files('vvfat.c')) +block_ss.add(when: 'CONFIG_DMG', if_true: files('dmg.c')) +block_ss.add(when: 'CONFIG_QED', if_true: files( + 'qed-check.c', + 'qed-cluster.c', + 'qed-l2-cache.c', + 'qed-table.c', + 'qed.c', +)) +block_ss.add(when: [libxml2, 'CONFIG_PARALLELS'], if_true: files('parallels.c')) +block_ss.add(when: 'CONFIG_WIN32', if_true: files('file-win32.c', 'win32-aio.c')) +block_ss.add(when: 'CONFIG_POSIX', if_true: [files('file-posix.c'), coref, iokit]) +block_ss.add(when: 'CONFIG_LIBISCSI', if_true: files('iscsi-opts.c')) +block_ss.add(when: 'CONFIG_LINUX', if_true: files('nvme.c')) +block_ss.add(when: 'CONFIG_REPLICATION', if_true: files('replication.c')) +block_ss.add(when: 'CONFIG_SHEEPDOG', if_true: files('sheepdog.c')) +block_ss.add(when: ['CONFIG_LINUX_AIO', libaio], if_true: files('linux-aio.c')) +block_ss.add(when: ['CONFIG_LINUX_IO_URING', linux_io_uring], if_true: files('io_uring.c')) + +block_modules = {} + +modsrc = [] +foreach m : [ + ['CONFIG_CURL', 'curl', [curl, glib], 'curl.c'], + ['CONFIG_GLUSTERFS', 'gluster', glusterfs, 'gluster.c'], + ['CONFIG_LIBISCSI', 'iscsi', libiscsi, 'iscsi.c'], + ['CONFIG_LIBNFS', 'nfs', libnfs, 'nfs.c'], + ['CONFIG_LIBSSH', 'ssh', libssh, 'ssh.c'], + ['CONFIG_RBD', 'rbd', rbd, 'rbd.c'], +] + if config_host.has_key(m[0]) + if enable_modules + modsrc += files(m[3]) + endif + module_ss = ss.source_set() + module_ss.add(when: m[2], if_true: files(m[3])) + block_modules += {m[1] : module_ss} + endif +endforeach + +# those are not exactly regular block modules, so treat them apart +if 'CONFIG_DMG' in config_host + foreach m : [ + ['CONFIG_LZFSE', 'dmg-lzfse', liblzfse, 'dmg-lzfse.c'], + ['CONFIG_BZIP2', 'dmg-bz2', [glib, libbzip2], 'dmg-bz2.c'] + ] + if config_host.has_key(m[0]) + module_ss = ss.source_set() + module_ss.add(when: m[2], if_true: files(m[3])) + block_modules += {m[1] : module_ss} + endif + endforeach +endif + +module_block_py = find_program('../scripts/modules/module_block.py') +module_block_h = custom_target('module_block.h', + output: 'module_block.h', + input: modsrc, + command: [module_block_py, '@OUTPUT0@', modsrc]) +block_ss.add(module_block_h) + +block_ss.add(files('stream.c')) + +softmmu_ss.add(files('qapi-sysemu.c')) +subdir('monitor') + +modules += {'block': block_modules} diff --git a/block/monitor/Makefile.objs b/block/monitor/Makefile.objs deleted file mode 100644 index 39acf85022..0000000000 --- a/block/monitor/Makefile.objs +++ /dev/null @@ -1,2 +0,0 @@ -common-obj-y += block-hmp-cmds.o -block-obj-y += bitmap-qmp-cmds.o diff --git a/block/monitor/meson.build b/block/monitor/meson.build new file mode 100644 index 0000000000..374aac1140 --- /dev/null +++ b/block/monitor/meson.build @@ -0,0 +1,2 @@ +softmmu_ss.add(files('block-hmp-cmds.c')) +block_ss.add(files('bitmap-qmp-cmds.c')) diff --git a/block/trace.h b/block/trace.h new file mode 100644 index 0000000000..3a436e6c7f --- /dev/null +++ b/block/trace.h @@ -0,0 +1 @@ +#include "trace/trace-block.h" diff --git a/bsd-user/Makefile.objs b/bsd-user/Makefile.objs deleted file mode 100644 index 5e77f57782..0000000000 --- a/bsd-user/Makefile.objs +++ /dev/null @@ -1,2 +0,0 @@ -obj-y = main.o bsdload.o elfload.o mmap.o signal.o strace.o syscall.o \ - uaccess.o diff --git a/bsd-user/meson.build b/bsd-user/meson.build new file mode 100644 index 0000000000..0369549340 --- /dev/null +++ b/bsd-user/meson.build @@ -0,0 +1,10 @@ +bsd_user_ss.add(files( + 'bsdload.c', + 'elfload.c', + 'main.c', + 'mmap.c', + 'signal.c', + 'strace.c', + 'syscall.c', + 'uaccess.c', +)) diff --git a/chardev/Makefile.objs b/chardev/Makefile.objs deleted file mode 100644 index 3783dadc4c..0000000000 --- a/chardev/Makefile.objs +++ /dev/null @@ -1,29 +0,0 @@ -chardev-obj-y += char.o -chardev-obj-$(CONFIG_SOFTMMU) += chardev-sysemu.o -chardev-obj-$(CONFIG_WIN32) += char-console.o -chardev-obj-$(CONFIG_POSIX) += char-fd.o -chardev-obj-y += char-fe.o -chardev-obj-y += char-file.o -chardev-obj-y += char-io.o -chardev-obj-y += char-mux.o -chardev-obj-y += char-null.o -chardev-obj-$(CONFIG_POSIX) += char-parallel.o -chardev-obj-y += char-pipe.o -chardev-obj-$(CONFIG_POSIX) += char-pty.o -chardev-obj-y += char-ringbuf.o -chardev-obj-y += char-serial.o -chardev-obj-y += char-socket.o -chardev-obj-y += char-stdio.o -chardev-obj-y += char-udp.o -chardev-obj-$(CONFIG_WIN32) += char-win.o -chardev-obj-$(CONFIG_WIN32) += char-win-stdio.o - -common-obj-$(CONFIG_SOFTMMU) += msmouse.o wctablet.o testdev.o - -ifeq ($(CONFIG_BRLAPI),y) -common-obj-m += baum.o -baum.o-cflags := $(SDL_CFLAGS) -baum.o-libs := $(BRLAPI_LIBS) -endif - -common-obj-$(CONFIG_SPICE) += spice.o diff --git a/chardev/meson.build b/chardev/meson.build new file mode 100644 index 0000000000..a46a6237be --- /dev/null +++ b/chardev/meson.build @@ -0,0 +1,45 @@ +chardev_ss = ss.source_set() +chardev_ss.add(files( + 'char-fe.c', + 'char-file.c', + 'char-io.c', + 'char-mux.c', + 'char-null.c', + 'char-pipe.c', + 'char-ringbuf.c', + 'char-serial.c', + 'char-socket.c', + 'char-stdio.c', + 'char-udp.c', + 'char.c', +)) +chardev_ss.add(when: 'CONFIG_POSIX', if_true: files( + 'char-fd.c', + 'char-parallel.c', + 'char-pty.c', +)) +chardev_ss.add(when: 'CONFIG_WIN32', if_true: files( + 'char-console.c', + 'char-win-stdio.c', + 'char-win.c', +)) + +chardev_ss = chardev_ss.apply(config_host, strict: false) +libchardev = static_library('chardev', chardev_ss.sources() + genh, + name_suffix: 'fa', + build_by_default: false) + +chardev = declare_dependency(link_whole: libchardev) + +softmmu_ss.add(files('chardev-sysemu.c', 'msmouse.c', 'wctablet.c', 'testdev.c')) +softmmu_ss.add(when: ['CONFIG_SPICE', spice], if_true: files('spice.c')) + +chardev_modules = {} + +if config_host.has_key('CONFIG_BRLAPI') and sdl.found() + module_ss = ss.source_set() + module_ss.add(when: [sdl, brlapi], if_true: files('baum.c')) + chardev_modules += { 'brlapi': module_ss } +endif + +modules += { 'chardev': chardev_modules } diff --git a/chardev/trace.h b/chardev/trace.h new file mode 100644 index 0000000000..eb4f9027a1 --- /dev/null +++ b/chardev/trace.h @@ -0,0 +1 @@ +#include "trace/trace-chardev.h" @@ -11,6 +11,55 @@ unset CLICOLOR_FORCE GREP_OPTIONS # Don't allow CCACHE, if present, to use cached results of compile tests! export CCACHE_RECACHE=yes +# make source path absolute +source_path=$(cd "$(dirname -- "$0")"; pwd) + +if test "$PWD" = "$source_path" +then + echo "Using './build' as the directory for build output" + + MARKER=build/auto-created-by-configure + + if test -e build + then + if test -f $MARKER + then + rm -rf build + else + echo "ERROR: ./build dir already exists and was not previously created by configure" + exit 1 + fi + fi + + mkdir build + touch $MARKER + + cat > GNUmakefile <<'EOF' +# This file is auto-generated by configure to support in-source tree +# 'make' command invocation + +ifeq ($(MAKECMDGOALS),) +recurse: all +endif + +.NOTPARALLEL: % +%: force + @echo 'changing dir to build for $(MAKE) "$(MAKECMDGOALS)"...' + @$(MAKE) -C build -f Makefile $(MAKECMDGOALS) + @if test "$(MAKECMDGOALS)" = "distclean" && \ + test -e build/auto-created-by-configure ; \ + then \ + rm -rf build GNUmakefile ; \ + fi +force: ; +.PHONY: force +GNUmakefile: ; + +EOF + cd build + exec $source_path/configure "$@" +fi + # Temporary directory used for files created while # configure runs. Since it is in the build directory # we can safely blow away any previous version of it @@ -29,7 +78,6 @@ TMPC="${TMPDIR1}/${TMPB}.c" TMPO="${TMPDIR1}/${TMPB}.o" TMPCXX="${TMPDIR1}/${TMPB}.cxx" TMPE="${TMPDIR1}/${TMPB}.exe" -TMPMO="${TMPDIR1}/${TMPB}.mo" TMPTXT="${TMPDIR1}/${TMPB}.txt" rm -f config.log @@ -107,15 +155,12 @@ update_cxxflags() { # options which some versions of GCC's C++ compiler complain about # because they only make sense for C programs. QEMU_CXXFLAGS="$QEMU_CXXFLAGS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS" - + CXXFLAGS=$(echo "$CFLAGS" | sed s/-std=gnu99/-std=gnu++11/) for arg in $QEMU_CFLAGS; do case $arg in -Wstrict-prototypes|-Wmissing-prototypes|-Wnested-externs|\ -Wold-style-declaration|-Wold-style-definition|-Wredundant-decls) ;; - -std=gnu99) - QEMU_CXXFLAGS=${QEMU_CXXFLAGS:+$QEMU_CXXFLAGS }"-std=gnu++98" - ;; *) QEMU_CXXFLAGS=${QEMU_CXXFLAGS:+$QEMU_CXXFLAGS }$arg ;; @@ -125,13 +170,13 @@ update_cxxflags() { compile_object() { local_cflags="$1" - do_cc $QEMU_CFLAGS $local_cflags -c -o $TMPO $TMPC + do_cc $CFLAGS $QEMU_CFLAGS $local_cflags -c -o $TMPO $TMPC } compile_prog() { local_cflags="$1" local_ldflags="$2" - do_cc $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $QEMU_LDFLAGS $local_ldflags + do_cc $CFLAGS $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $QEMU_LDFLAGS $local_ldflags } # symbolically link $1 to $2. Portable version of "ln -sf". @@ -177,6 +222,25 @@ path_of() { return 1 } +version_ge () { + local_ver1=`echo $1 | tr . ' '` + local_ver2=`echo $2 | tr . ' '` + while true; do + set x $local_ver1 + local_first=${2-0} + # 'shift 2' if $2 is set, or 'shift' if $2 is not set + shift ${2:+2} + local_ver1=$* + set x $local_ver2 + # the second argument finished, the first must be greater or equal + test $# = 1 && return 0 + test $local_first -lt $2 && return 1 + test $local_first -gt $2 && return 0 + shift ${2:+2} + local_ver2=$* + done +} + have_backend () { echo "$trace_backends" | grep "$1" >/dev/null } @@ -282,9 +346,6 @@ ld_has() { $ld --help 2>/dev/null | grep ".$1" >/dev/null 2>&1 } -# make source path absolute -source_path=$(cd "$(dirname -- "$0")"; pwd) - if printf %s\\n "$source_path" "$PWD" | grep -q "[[:space:]:]"; then error_exit "main directory cannot contain spaces nor colons" @@ -300,8 +361,6 @@ audio_drv_list="" block_drv_rw_whitelist="" block_drv_ro_whitelist="" host_cc="cc" -libs_cpu="" -libs_softmmu="" libs_tools="" audio_win_int="" libs_qga="" @@ -363,16 +422,16 @@ curses="" docs="" fdt="" netmap="no" -sdl="" -sdl_image="" +sdl="auto" +sdl_image="auto" virtfs="" mpath="" -vnc="yes" +vnc="enabled" sparse="no" vde="" -vnc_sasl="" -vnc_jpeg="" -vnc_png="" +vnc_sasl="auto" +vnc_jpeg="auto" +vnc_png="auto" xkbcommon="" xen="" xen_ctrl_version="" @@ -408,24 +467,13 @@ tcg_interpreter="no" bigendian="no" mingw32="no" gcov="no" -gcov_tool="gcov" EXESUF="" -DSOSUF=".so" +HOST_DSOSUF=".so" LDFLAGS_SHARED="-shared" modules="no" module_upgrades="no" prefix="/usr/local" -mandir="\${prefix}/share/man" -datadir="\${prefix}/share" firmwarepath="\${prefix}/share/qemu-firmware" -efi_aarch64="" -qemu_docdir="\${prefix}/share/doc/qemu" -bindir="\${prefix}/bin" -libdir="\${prefix}/lib" -libexecdir="\${prefix}/libexec" -includedir="\${prefix}/include" -sysconfdir="\${prefix}/etc" -local_statedir="\${prefix}/var" confsuffix="/qemu" slirp="" oss_lib="" @@ -519,9 +567,10 @@ fuzzing="no" rng_none="no" secret_keyring="" libdaxctl="" +meson="" +skip_meson=no +gettext="" -supported_cpu="no" -supported_os="no" bogus_os="no" malloc_trim="" @@ -607,15 +656,14 @@ ARFLAGS="${ARFLAGS-rv}" # left shift of signed integers is well defined and has the expected # 2s-complement style results. (Both clang and gcc agree that it # provides these semantics.) -QEMU_CFLAGS="-fno-strict-aliasing -fno-common -fwrapv -std=gnu99 $QEMU_CFLAGS" -QEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS" +QEMU_CFLAGS="-fno-strict-aliasing -fno-common -fwrapv $QEMU_CFLAGS" +QEMU_CFLAGS="-Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS" QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS" QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS" -QEMU_INCLUDES="-iquote . -iquote \$(SRC_PATH) -iquote \$(SRC_PATH)/accel/tcg -iquote \$(SRC_PATH)/include" -QEMU_INCLUDES="$QEMU_INCLUDES -iquote \$(SRC_PATH)/disas/libvixl" -if test "$debug_info" = "yes"; then - CFLAGS="-g $CFLAGS" -fi +QEMU_INCLUDES="-iquote . -iquote ${source_path} -iquote ${source_path}/accel/tcg -iquote ${source_path}/include" +QEMU_INCLUDES="$QEMU_INCLUDES -iquote ${source_path}/disas/libvixl" +CFLAGS="-std=gnu99 -Wall" + # running configure in the source tree? # we know that's the case if configure is there. @@ -761,35 +809,27 @@ ARCH= # Note that this case should only have supported host CPUs, not guests. case "$cpu" in ppc|ppc64|s390x|sparc64|x32|riscv32|riscv64) - supported_cpu="yes" ;; ppc64le) ARCH="ppc64" - supported_cpu="yes" ;; i386|i486|i586|i686|i86pc|BePC) cpu="i386" - supported_cpu="yes" ;; x86_64|amd64) cpu="x86_64" - supported_cpu="yes" ;; armv*b|armv*l|arm) cpu="arm" - supported_cpu="yes" ;; aarch64) cpu="aarch64" - supported_cpu="yes" ;; mips*) cpu="mips" - supported_cpu="yes" ;; sparc|sun4[cdmuv]) cpu="sparc" - supported_cpu="yes" ;; *) # This will result in either an error or falling back to TCI later @@ -817,7 +857,6 @@ MINGW32*) audio_drv_list="" fi supported_os="yes" - pie="no" ;; GNU/kFreeBSD) bsd="yes" @@ -831,11 +870,8 @@ FreeBSD) audio_possible_drivers="oss sdl pa" # needed for kinfo_getvmmap(3) in libutil.h LIBS="-lutil $LIBS" - # needed for kinfo_getproc - libs_qga="-lutil $libs_qga" netmap="" # enable netmap autodetect HOST_VARIANT_DIR="freebsd" - supported_os="yes" ;; DragonFly) bsd="yes" @@ -852,7 +888,6 @@ NetBSD) audio_possible_drivers="oss sdl" oss_lib="-lossaudio" HOST_VARIANT_DIR="netbsd" - supported_os="yes" ;; OpenBSD) bsd="yes" @@ -860,7 +895,6 @@ OpenBSD) audio_drv_list="try-sdl" audio_possible_drivers="sdl" HOST_VARIANT_DIR="openbsd" - supported_os="yes" ;; Darwin) bsd="yes" @@ -876,12 +910,10 @@ Darwin) audio_drv_list="coreaudio try-sdl" audio_possible_drivers="coreaudio sdl" QEMU_LDFLAGS="-framework CoreFoundation -framework IOKit $QEMU_LDFLAGS" - libs_softmmu="-F/System/Library/Frameworks -framework Cocoa -framework IOKit $libs_softmmu" # Disable attempts to use ObjectiveC features in os/object.h since they # won't work when we're compiling with gcc as a C compiler. QEMU_CFLAGS="-DOS_OBJECT_USE_OBJC=0 $QEMU_CFLAGS" HOST_VARIANT_DIR="darwin" - supported_os="yes" ;; SunOS) solaris="yes" @@ -896,10 +928,8 @@ SunOS) QEMU_CFLAGS="-D_XOPEN_SOURCE=600 $QEMU_CFLAGS" # needed for TIOCWIN* defines in termios.h QEMU_CFLAGS="-D__EXTENSIONS__ $QEMU_CFLAGS" - QEMU_CFLAGS="-std=gnu99 $QEMU_CFLAGS" solarisnetlibs="-lsocket -lnsl -lresolv" LIBS="$solarisnetlibs $LIBS" - libs_qga="$solarisnetlibs $libs_qga" ;; Haiku) haiku="yes" @@ -912,8 +942,7 @@ Linux) linux="yes" linux_user="yes" kvm="yes" - QEMU_INCLUDES="-isystem \$(SRC_PATH)/linux-headers -isystem $PWD/linux-headers $QEMU_INCLUDES" - supported_os="yes" + QEMU_INCLUDES="-isystem ${source_path}/linux-headers -I$PWD/linux-headers $QEMU_INCLUDES" libudev="yes" ;; esac @@ -930,6 +959,7 @@ fi # python 2.x, but some distros have it as python 3.x, so # we check that too python= +explicit_python=no for binary in "${PYTHON-python3}" python do if has "$binary" @@ -960,13 +990,6 @@ do fi done -# Check for existence of python3 yaml, needed to -# import yaml config files into vm-build. -python_yaml="no" -if $(python3 -c "import yaml" 2> /dev/null); then - python_yaml="yes" -fi - : ${smbd=${SMBD-/usr/sbin/smbd}} # Default objcc to clang if available, otherwise use CC @@ -978,21 +1001,15 @@ fi if test "$mingw32" = "yes" ; then EXESUF=".exe" - DSOSUF=".dll" + HOST_DSOSUF=".dll" # MinGW needs -mthreads for TLS and macro _MT. - QEMU_CFLAGS="-mthreads $QEMU_CFLAGS" + CFLAGS="-mthreads $CFLAGS" LIBS="-lwinmm -lws2_32 $LIBS" write_c_skeleton; if compile_prog "" "-liberty" ; then LIBS="-liberty $LIBS" fi prefix="c:/Program Files/QEMU" - mandir="\${prefix}" - datadir="\${prefix}" - qemu_docdir="\${prefix}" - bindir="\${prefix}" - sysconfdir="\${prefix}" - local_statedir= confsuffix="" libs_qga="-lws2_32 -lwinmm -lpowrprof -lwtsapi32 -lwininet -liphlpapi -lnetapi32 $libs_qga" fi @@ -1026,11 +1043,13 @@ for opt do ;; --install=*) install="$optarg" ;; - --python=*) python="$optarg" + --python=*) python="$optarg" ; explicit_python=yes ;; --sphinx-build=*) sphinx_build="$optarg" ;; - --gcov=*) gcov_tool="$optarg" + --skip-meson) skip_meson=yes + ;; + --meson=*) meson="$optarg" ;; --smbd=*) smbd="$optarg" ;; @@ -1109,8 +1128,6 @@ for opt do ;; --firmwarepath=*) firmwarepath="$optarg" ;; - --efi-aarch64=*) efi_aarch64="$optarg" - ;; --host=*|--build=*|\ --disable-dependency-tracking|\ --sbindir=*|--sharedstatedir=*|\ @@ -1121,13 +1138,13 @@ for opt do # configure to be used by RPM and similar macros that set # lots of directory switches by default. ;; - --disable-sdl) sdl="no" + --disable-sdl) sdl="disabled" ;; - --enable-sdl) sdl="yes" + --enable-sdl) sdl="enabled" ;; - --disable-sdl-image) sdl_image="no" + --disable-sdl-image) sdl_image="disabled" ;; - --enable-sdl-image) sdl_image="yes" + --enable-sdl-image) sdl_image="enabled" ;; --disable-qom-cast-debug) qom_cast_debug="no" ;; @@ -1141,9 +1158,13 @@ for opt do ;; --enable-mpath) mpath="yes" ;; - --disable-vnc) vnc="no" + --disable-vnc) vnc="disabled" + ;; + --enable-vnc) vnc="enabled" ;; - --enable-vnc) vnc="yes" + --disable-gettext) gettext="false" + ;; + --enable-gettext) gettext="true" ;; --oss-lib=*) oss_lib="$optarg" ;; @@ -1179,17 +1200,17 @@ for opt do ;; --disable-strip) strip_opt="no" ;; - --disable-vnc-sasl) vnc_sasl="no" + --disable-vnc-sasl) vnc_sasl="disabled" ;; - --enable-vnc-sasl) vnc_sasl="yes" + --enable-vnc-sasl) vnc_sasl="enabled" ;; - --disable-vnc-jpeg) vnc_jpeg="no" + --disable-vnc-jpeg) vnc_jpeg="disabled" ;; - --enable-vnc-jpeg) vnc_jpeg="yes" + --enable-vnc-jpeg) vnc_jpeg="enabled" ;; - --disable-vnc-png) vnc_png="no" + --disable-vnc-png) vnc_png="disabled" ;; - --enable-vnc-png) vnc_png="yes" + --enable-vnc-png) vnc_png="enabled" ;; --disable-slirp) slirp="no" ;; @@ -1648,6 +1669,26 @@ for opt do esac done +libdir="${libdir:-$prefix/lib}" +libexecdir="${libexecdir:-$prefix/libexec}" +includedir="${includedir:-$prefix/include}" + +if test "$mingw32" = "yes" ; then + mandir="$prefix" + datadir="$prefix" + qemu_docdir="$prefix" + bindir="$prefix" + sysconfdir="$prefix" + local_statedir= +else + mandir="${mandir:-$prefix/share/man}" + datadir="${datadir:-$prefix/share}" + qemu_docdir="${qemu_docdir:-$prefix/share/doc/qemu}" + bindir="${bindir:-$prefix/bin}" + sysconfdir="${sysconfdir:-$prefix/etc}" + local_statedir="${local_statedir:-$prefix/var}" +fi + case "$cpu" in ppc) CPU_CFLAGS="-m32" @@ -1777,6 +1818,7 @@ Advanced options (experts only): --install=INSTALL use specified install [$install] --python=PYTHON use specified python [$python] --sphinx-build=SPHINX use specified sphinx-build [$sphinx_build] + --meson=MESON use specified meson [$meson] --smbd=SMBD use specified smbd [$smbd] --with-git=GIT use specified git [$git] --static enable static build [$static] @@ -1819,7 +1861,6 @@ Advanced options (experts only): --with-coroutine=BACKEND coroutine backend. Supported options: ucontext, sigaltstack, windows --enable-gcov enable test coverage analysis with gcov - --gcov=GCOV use specified gcov [$gcov_tool] --disable-blobs disable installing provided firmware blobs --with-vss-sdk=SDK-path enable Windows VSS support in QEMU Guest Agent --with-win-sdk=SDK-path path to Windows Platform SDK (to build VSS .tlb) @@ -1952,20 +1993,6 @@ fi # Remove old dependency files to make sure that they get properly regenerated rm -f */config-devices.mak.d -# Remove syscall_nr.h to be sure they will be regenerated in the build -# directory, not in the source directory -for arch in alpha hppa m68k xtensa sh4 microblaze arm ppc s390x sparc sparc64 \ - i386 x86_64 mips mips64 ; do - # remove the file if it has been generated in the source directory - rm -f "${source_path}/linux-user/${arch}/syscall_nr.h" - # remove the dependency files - for target in ${arch}*-linux-user ; do - test -d "${target}" && find "${target}" -type f -name "*.d" \ - -exec grep -q "${source_path}/linux-user/${arch}/syscall_nr.h" {} \; \ - -print | while read file ; do rm "${file}" "${file%.d}.o" ; done - done -done - if test -z "$python" then error_exit "Python not found. Use --python=/path/to/python" @@ -1984,6 +2011,53 @@ python_version=$($python -c 'import sys; print("%d.%d.%d" % (sys.version_info[0] # Suppress writing compiled files python="$python -B" +if test -z "$meson"; then + if test "$explicit_python" = no && has meson && version_ge "$(meson --version)" 0.55.0; then + meson=meson + elif test -e "${source_path}/.git" && test $git_update = 'yes' ; then + meson=git + elif test -e "${source_path}/meson/meson.py" ; then + meson=internal + else + if test "$explicit_python" = yes; then + error_exit "--python requires using QEMU's embedded Meson distribution, but it was not found." + else + error_exit "Meson not found. Use --meson=/path/to/meson" + fi + fi +else + # Meson uses its own Python interpreter to invoke other Python scripts, + # but the user wants to use the one they specified with --python. + # + # We do not want to override the distro Python interpreter (and sometimes + # cannot: for example in Homebrew /usr/bin/meson is a bash script), so + # just require --meson=git|internal together with --python. + if test "$explicit_python" = yes; then + case "$meson" in + git | internal) ;; + *) error_exit "--python requires using QEMU's embedded Meson distribution." ;; + esac + fi +fi + +if test "$meson" = git; then + git_submodules="${git_submodules} meson" +fi +if test "$git_update" = yes; then + (cd "${source_path}" && GIT="$git" "./scripts/git-submodule.sh" update "$git_submodules") +fi + +case "$meson" in + git | internal) + if ! $python -c 'import pkg_resources' > /dev/null 2>&1; then + error_exit "Python setuptools not found" + fi + meson="$python ${source_path}/meson/meson.py" + ;; + *) meson=$(command -v meson) ;; +esac + + # Check that the C compiler works. Doing this here before testing # the host CPU ensures that we had a valid CC to autodetect the # $cpu var (and we should bail right here if that's not the case). @@ -2114,7 +2188,7 @@ EOF for flag in $gcc_flags; do # We need to check both a compile and a link, since some compiler # setups fail only on a .c->.o compile and some only at link time - if do_cc $QEMU_CFLAGS -Werror $flag -c -o $TMPO $TMPC && + if compile_object "-Werror $flag" && compile_prog "-Werror $flag" ""; then QEMU_CFLAGS="$QEMU_CFLAGS $flag" QEMU_LDFLAGS="$QEMU_LDFLAGS $flag" @@ -2189,7 +2263,7 @@ fi if test "$static" = "yes"; then if test "$pie" != "no" && compile_prog "-Werror -fPIE -DPIE" "-static-pie"; then - QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS" + CFLAGS="-fPIE -DPIE $CFLAGS" QEMU_LDFLAGS="-static-pie $QEMU_LDFLAGS" pie="yes" elif test "$pie" = "yes"; then @@ -2199,11 +2273,11 @@ if test "$static" = "yes"; then pie="no" fi elif test "$pie" = "no"; then - QEMU_CFLAGS="$CFLAGS_NOPIE $QEMU_CFLAGS" - QEMU_LDFLAGS="$LDFLAGS_NOPIE $QEMU_LDFLAGS" + CFLAGS="$CFLAGS_NOPIE $CFLAGS" + LDFLAGS="$LDFLAGS_NOPIE $LDFLAGS" elif compile_prog "-Werror -fPIE -DPIE" "-pie"; then - QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS" - QEMU_LDFLAGS="-pie $QEMU_LDFLAGS" + CFLAGS="-fPIE -DPIE $CFLAGS" + LDFLAGS="-pie $LDFLAGS" pie="yes" elif test "$pie" = "yes"; then error_exit "PIE not available due to missing toolchain support" @@ -2366,7 +2440,7 @@ if test "$cocoa" = "yes"; then error_exit "Cocoa and GTK UIs cannot both be enabled at once" fi gtk=no - sdl=no + sdl=disabled fi # Some versions of Mac OS X incorrectly define SIZE_MAX @@ -2532,7 +2606,7 @@ if test "$lzo" != "no" ; then int main(void) { lzo_version(); return 0; } EOF if compile_prog "" "-llzo2" ; then - libs_softmmu="$libs_softmmu -llzo2" + lzo_libs="-llzo2" lzo="yes" else if test "$lzo" = "yes"; then @@ -2551,7 +2625,7 @@ if test "$snappy" != "no" ; then int main(void) { snappy_max_compressed_length(4096); return 0; } EOF if compile_prog "" "-lsnappy" ; then - libs_softmmu="$libs_softmmu -lsnappy" + snappy_libs='-lsnappy' snappy="yes" else if test "$snappy" = "yes"; then @@ -2605,8 +2679,6 @@ if test "$zstd" != "no" ; then if $pkg_config --atleast-version=$libzstd_minver libzstd ; then zstd_cflags="$($pkg_config --cflags libzstd)" zstd_libs="$($pkg_config --libs libzstd)" - LIBS="$zstd_libs $LIBS" - QEMU_CFLAGS="$QEMU_CFLAGS $zstd_cflags" zstd="yes" else if test "$zstd" = "yes" ; then @@ -2652,7 +2724,8 @@ if test "$xen" != "no" ; then xen_pc="$xen_pc xentoolcore" fi QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags $xen_pc)" - libs_softmmu="$($pkg_config --libs $xen_pc) $libs_softmmu" + xen_cflags="$($pkg_config --cflags $xen_pc)" + xen_libs="$($pkg_config --libs $xen_pc)" else xen_libs="-lxenstore -lxenctrl -lxenguest" @@ -2933,9 +3006,8 @@ EOF if test "$xen" = yes; then if test $xen_ctrl_version -ge 40701 ; then - libs_softmmu="$xen_stable_libs $libs_softmmu" + xen_libs="$xen_libs $xen_stable_libs " fi - libs_softmmu="$xen_libs $libs_softmmu" fi fi fi @@ -2966,9 +3038,22 @@ if test "$whpx" != "no" ; then fi ########################################## +# gettext probe +if test "$gettext" != "false" ; then + if has xgettext; then + gettext=true + else + if test "$gettext" = "true" ; then + feature_not_found "gettext" "Install xgettext binary" + fi + gettext=false + fi +fi + +########################################## # Sparse probe if test "$sparse" != "no" ; then - if has cgcc; then + if has sparse; then sparse=yes else if test "$sparse" = "yes" ; then @@ -3268,125 +3353,6 @@ if test "$vte" != "no"; then fi ########################################## -# SDL probe - -# Look for sdl configuration program (pkg-config or sdl2-config). Try -# sdl2-config even without cross prefix, and favour pkg-config over sdl2-config. - -sdl_probe () -{ - if $pkg_config sdl2 --exists; then - sdlconfig="$pkg_config sdl2" - sdlversion=$($sdlconfig --modversion 2>/dev/null) - elif has "$sdl2_config"; then - sdlconfig="$sdl2_config" - sdlversion=$($sdlconfig --version) - else - if test "$sdl" = "yes" ; then - feature_not_found "sdl" "Install SDL2-devel" - fi - sdl=no - # no need to do the rest - return - fi - if test -n "$cross_prefix" && test "$(basename "$sdlconfig")" = sdl2-config; then - echo warning: using "\"$sdlconfig\"" to detect cross-compiled sdl >&2 - fi - - cat > $TMPC << EOF -#include <SDL.h> -#undef main /* We don't want SDL to override our main() */ -int main( void ) { return SDL_Init (SDL_INIT_VIDEO); } -EOF - sdl_cflags=$($sdlconfig --cflags 2>/dev/null) - sdl_cflags="$sdl_cflags -Wno-undef" # workaround 2.0.8 bug - if test "$static" = "yes" ; then - if $pkg_config sdl2 --exists; then - sdl_libs=$($pkg_config sdl2 --static --libs 2>/dev/null) - else - sdl_libs=$($sdlconfig --static-libs 2>/dev/null) - fi - else - sdl_libs=$($sdlconfig --libs 2>/dev/null) - fi - if compile_prog "$sdl_cflags" "$sdl_libs" ; then - sdl=yes - - # static link with sdl ? (note: sdl.pc's --static --libs is broken) - if test "$sdl" = "yes" && test "$static" = "yes" ; then - if test $? = 0 && echo $sdl_libs | grep -- -laa > /dev/null; then - sdl_libs="$sdl_libs $(aalib-config --static-libs 2>/dev/null)" - sdl_cflags="$sdl_cflags $(aalib-config --cflags 2>/dev/null)" - fi - if compile_prog "$sdl_cflags" "$sdl_libs" ; then - : - else - sdl=no - fi - fi # static link - else # sdl not found - if test "$sdl" = "yes" ; then - feature_not_found "sdl" "Install SDL2 devel" - fi - sdl=no - fi # sdl compile test -} - -sdl_image_probe () -{ - if test "$sdl_image" != "no" ; then - if $pkg_config SDL2_image --exists; then - if test "$static" = "yes"; then - sdl_image_libs=$($pkg_config SDL2_image --libs --static 2>/dev/null) - else - sdl_image_libs=$($pkg_config SDL2_image --libs 2>/dev/null) - fi - sdl_image_cflags=$($pkg_config SDL2_image --cflags 2>/dev/null) - sdl_image=yes - - sdl_cflags="$sdl_cflags $sdl_image_cflags" - sdl_libs="$sdl_libs $sdl_image_libs" - else - if test "$sdl_image" = "yes" ; then - feature_not_found "sdl_image" "Install SDL Image devel" - else - sdl_image=no - fi - fi - fi -} - -if test "$sdl" != "no" ; then - sdl_probe -fi - -if test "$sdl" = "yes" ; then - sdl_image_probe -else - if test "$sdl_image" = "yes"; then - echo "warning: SDL Image requested, but SDL is not available, disabling" - fi - sdl_image=no -fi - -if test "$sdl" = "yes" ; then - cat > $TMPC <<EOF -#include <SDL.h> -#if defined(SDL_VIDEO_DRIVER_X11) -#include <X11/XKBlib.h> -#else -#error No x11 support -#endif -int main(void) { return 0; } -EOF - if compile_prog "$sdl_cflags $x11_cflags" "$sdl_libs $x11_libs" ; then - need_x11=yes - sdl_cflags="$sdl_cflags $x11_cflags" - sdl_libs="$sdl_libs $x11_libs" - fi -fi - -########################################## # RDMA needs OpenFabrics libraries if test "$rdma" != "no" ; then cat > $TMPC <<EOF @@ -3396,7 +3362,6 @@ EOF rdma_libs="-lrdmacm -libverbs -libumad" if compile_prog "" "$rdma_libs" ; then rdma="yes" - libs_softmmu="$libs_softmmu $rdma_libs" else if test "$rdma" = "yes" ; then error_exit \ @@ -3482,85 +3447,6 @@ EOF fi ########################################## -# VNC SASL detection -if test "$vnc" = "yes" && test "$vnc_sasl" != "no" ; then - cat > $TMPC <<EOF -#include <sasl/sasl.h> -#include <stdio.h> -int main(void) { sasl_server_init(NULL, "qemu"); return 0; } -EOF - # Assuming Cyrus-SASL installed in /usr prefix - # QEMU defines struct iovec in "qemu/osdep.h", - # we don't want libsasl to redefine it in <sasl/sasl.h>. - vnc_sasl_cflags="-DSTRUCT_IOVEC_DEFINED" - vnc_sasl_libs="-lsasl2" - if compile_prog "$vnc_sasl_cflags" "$vnc_sasl_libs" ; then - vnc_sasl=yes - libs_softmmu="$vnc_sasl_libs $libs_softmmu" - QEMU_CFLAGS="$QEMU_CFLAGS $vnc_sasl_cflags" - else - if test "$vnc_sasl" = "yes" ; then - feature_not_found "vnc-sasl" "Install Cyrus SASL devel" - fi - vnc_sasl=no - fi -fi - -########################################## -# VNC JPEG detection -if test "$vnc" = "yes" && test "$vnc_jpeg" != "no" ; then -cat > $TMPC <<EOF -#include <stdio.h> -#include <jpeglib.h> -int main(void) { struct jpeg_compress_struct s; jpeg_create_compress(&s); return 0; } -EOF - vnc_jpeg_cflags="" - vnc_jpeg_libs="-ljpeg" - if compile_prog "$vnc_jpeg_cflags" "$vnc_jpeg_libs" ; then - vnc_jpeg=yes - libs_softmmu="$vnc_jpeg_libs $libs_softmmu" - QEMU_CFLAGS="$QEMU_CFLAGS $vnc_jpeg_cflags" - else - if test "$vnc_jpeg" = "yes" ; then - feature_not_found "vnc-jpeg" "Install libjpeg-turbo devel" - fi - vnc_jpeg=no - fi -fi - -########################################## -# VNC PNG detection -if test "$vnc" = "yes" && test "$vnc_png" != "no" ; then -cat > $TMPC <<EOF -//#include <stdio.h> -#include <png.h> -#include <stddef.h> -int main(void) { - png_structp png_ptr; - png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); - return png_ptr != 0; -} -EOF - if $pkg_config libpng --exists; then - vnc_png_cflags=$($pkg_config libpng --cflags) - vnc_png_libs=$($pkg_config libpng --libs) - else - vnc_png_cflags="" - vnc_png_libs="-lpng" - fi - if compile_prog "$vnc_png_cflags" "$vnc_png_libs" ; then - vnc_png=yes - libs_softmmu="$vnc_png_libs $libs_softmmu" - QEMU_CFLAGS="$QEMU_CFLAGS $vnc_png_cflags" - else - if test "$vnc_png" = "yes" ; then - feature_not_found "vnc-png" "Install libpng devel" - fi - vnc_png=no - fi -fi - -########################################## # xkbcommon probe if test "$xkbcommon" != "no" ; then if $pkg_config xkbcommon --exists; then @@ -3650,20 +3536,6 @@ EOF fi fi -############################################ -# efi-aarch64 probe -# Check for efi files needed by aarch64 VMs. -# By default we will use the efi included with QEMU. -# Allow user to override the path for efi also. -if ! test -f "$efi_aarch64"; then - if test -f $source_path/pc-bios/edk2-aarch64-code.fd.bz2; then - # valid after build - efi_aarch64=$PWD/pc-bios/edk2-aarch64-code.fd - else - efi_aarch64="" - fi -fi - ########################################## # libcap-ng library probe if test "$cap_ng" != "no" ; then @@ -3678,7 +3550,6 @@ int main(void) EOF if compile_prog "" "$cap_libs" ; then cap_ng=yes - libs_tools="$cap_libs $libs_tools" else if test "$cap_ng" = "yes" ; then feature_not_found "cap_ng" "Install libcap-ng devel" @@ -3696,6 +3567,8 @@ for drv in $audio_drv_list; do alsa | try-alsa) if $pkg_config alsa --exists; then alsa_libs=$($pkg_config alsa --libs) + alsa_cflags=$($pkg_config alsa --cflags) + alsa=yes if test "$drv" = "try-alsa"; then audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-alsa/alsa/') fi @@ -3711,7 +3584,9 @@ for drv in $audio_drv_list; do pa | try-pa) if $pkg_config libpulse --exists; then + libpulse=yes pulse_libs=$($pkg_config libpulse --libs) + pulse_cflags=$($pkg_config libpulse --cflags) if test "$drv" = "try-pa"; then audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-pa/pa/') fi @@ -3754,6 +3629,7 @@ for drv in $audio_drv_list; do jack | try-jack) if $pkg_config jack --exists; then + libjack=yes jack_libs=$($pkg_config jack --libs) if test "$drv" = "try-jack"; then audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-jack/jack/') @@ -3945,7 +3821,6 @@ for i in $glib_modules; do glib_libs=$($pkg_config --libs $i) QEMU_CFLAGS="$glib_cflags $QEMU_CFLAGS" LIBS="$glib_libs $LIBS" - libs_qga="$glib_libs $libs_qga" else error_exit "glib-$glib_req_ver $i is required to compile QEMU" fi @@ -4000,7 +3875,7 @@ EOF if ! compile_prog "$glib_cflags -Werror" "$glib_libs" ; then if cc_has_warning_flag "-Wno-unknown-attributes"; then glib_cflags="-Wno-unknown-attributes $glib_cflags" - CFLAGS="-Wno-unknown-attributes $CFLAGS" + QEMU_CFLAGS="-Wno-unknown-attributes $CFLAGS" fi fi @@ -4039,7 +3914,8 @@ if test "$zlib" != "no" ; then int main(void) { zlibVersion(); return 0; } EOF if compile_prog "" "-lz" ; then - LIBS="$LIBS -lz" + zlib_libs=-lz + LIBS="$LIBS $zlib_libs" else error_exit "zlib check failed" \ "Make sure to have the zlib libs and headers installed." @@ -4156,7 +4032,6 @@ else done if test "$found" = "no"; then LIBS="$pthread_lib $LIBS" - libs_qga="$pthread_lib $libs_qga" fi PTHREAD_LIB="$pthread_lib" break @@ -4317,6 +4192,7 @@ fi ########################################## # attr probe +libattr_libs= if test "$attr" != "no" ; then cat > $TMPC <<EOF #include <stdio.h> @@ -4333,7 +4209,8 @@ EOF # Older distros have <attr/xattr.h>, and need -lattr: elif compile_prog "-DCONFIG_LIBATTR" "-lattr" ; then attr=yes - LIBS="-lattr $LIBS" + libattr_libs="-lattr" + LIBS="$libattr_libs $LIBS" libattr=yes else if test "$attr" = "yes" ; then @@ -4421,8 +4298,8 @@ EOF if [ "$pwd_is_source_path" != "y" ] ; then symlink "$source_path/dtc/Makefile" "dtc/Makefile" fi - fdt_cflags="-I\$(SRC_PATH)/dtc/libfdt" - fdt_ldflags="-L\$(BUILD_DIR)/dtc/libfdt" + fdt_cflags="-I${source_path}/dtc/libfdt" + fdt_ldflags="-L$PWD/dtc/libfdt" fdt_libs="$fdt_libs" elif test "$fdt" = "yes" ; then # Not a git build & no libfdt found, prompt for system install @@ -4436,8 +4313,6 @@ EOF fi fi -libs_softmmu="$libs_softmmu $fdt_libs" - ########################################## # opengl probe (for sdl2, gtk, milkymist-tmu2) @@ -4661,7 +4536,7 @@ EOF if compile_prog "" "-lnuma" ; then numa=yes - libs_softmmu="-lnuma $libs_softmmu" + numa_libs="-lnuma" else if test "$numa" = "yes" ; then feature_not_found "numa" "install numactl devel" @@ -5165,7 +5040,6 @@ if compile_prog "" "" ; then : elif compile_prog "" "-lm" ; then LIBS="-lm $LIBS" - libs_qga="-lm $libs_qga" else error_exit "libm check failed" fi @@ -5190,7 +5064,6 @@ if compile_prog "" "" ; then # we need pthread for static linking. use previous pthread test result elif compile_prog "" "$pthread_lib -lrt" ; then LIBS="$LIBS -lrt" - libs_qga="$libs_qga -lrt" fi # Check whether we need to link libutil for openpty() @@ -5204,7 +5077,6 @@ if compile_prog "" "" ; then have_openpty="yes" else if compile_prog "" "-lutil" ; then - libs_softmmu="-lutil $libs_softmmu" libs_tools="-lutil $libs_tools" have_openpty="yes" fi @@ -5223,10 +5095,7 @@ EOF $pkg_config --atleast-version=0.12.3 spice-protocol && \ compile_prog "$spice_cflags" "$spice_libs" ; then spice="yes" - libs_softmmu="$libs_softmmu $spice_libs" QEMU_CFLAGS="$QEMU_CFLAGS $spice_cflags" - spice_protocol_version=$($pkg_config --modversion spice-protocol) - spice_server_version=$($pkg_config --modversion spice-server) else if test "$spice" = "yes" ; then feature_not_found "spice" \ @@ -5409,18 +5278,20 @@ case "$capstone" in git_submodules="${git_submodules} capstone" fi mkdir -p capstone - QEMU_CFLAGS="$QEMU_CFLAGS -I\$(SRC_PATH)/capstone/include" + QEMU_CFLAGS="$QEMU_CFLAGS -I${source_path}/capstone/include" if test "$mingw32" = "yes"; then LIBCAPSTONE=capstone.lib else LIBCAPSTONE=libcapstone.a fi - libs_cpu="-L\$(BUILD_DIR)/capstone -lcapstone $libs_cpu" + capstone_libs="-L$PWD/capstone -lcapstone" + capstone_cflags="-I${source_path}/capstone/include" ;; system) + capstone_libs="$($pkg_config --libs capstone)" + capstone_cflags="$($pkg_config --cflags capstone)" QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags capstone)" - libs_cpu="$($pkg_config --libs capstone) $libs_cpu" ;; no) @@ -5571,7 +5442,6 @@ EOF fi LIBS="$lttng_ust_libs $urcu_bp_libs $LIBS" - libs_qga="$lttng_ust_libs $urcu_bp_libs $libs_qga" else error_exit "Trace backend 'ust' missing lttng-ust header files" fi @@ -6204,31 +6074,6 @@ EOF fi fi -################################################# -# Sparc implicitly links with --relax, which is -# incompatible with -r, so --no-relax should be -# given. It does no harm to give it on other -# platforms too. - -# Note: the prototype is needed since QEMU_CFLAGS -# contains -Wmissing-prototypes -cat > $TMPC << EOF -extern int foo(void); -int foo(void) { return 0; } -EOF -if ! compile_object ""; then - error_exit "Failed to compile object file for LD_REL_FLAGS test" -fi -for i in '-Wl,-r -Wl,--no-relax' -Wl,-r -r; do - if do_cc -nostdlib $i -o $TMPMO $TMPO; then - LD_REL_FLAGS=$i - break - fi -done -if test "$modules" = "yes" && test "$LD_REL_FLAGS" = ""; then - feature_not_found "modules" "Cannot find how to build relocatable objects" -fi - ########################################## # check for sysmacros.h @@ -6338,7 +6183,10 @@ fi if test "$fuzzing" = "yes" ; then write_c_fuzzer_skeleton if compile_prog "$CPU_CFLAGS -Werror -fsanitize=fuzzer" ""; then - have_fuzzer=yes + have_fuzzer=yes + else + error_exit "Your compiler doesn't support -fsanitize=fuzzer" + exit 1 fi fi @@ -6374,7 +6222,6 @@ if test "$libpmem" != "no"; then libpmem="yes" libpmem_libs=$($pkg_config --libs libpmem) libpmem_cflags=$($pkg_config --cflags libpmem) - libs_softmmu="$libs_softmmu $libpmem_libs" QEMU_CFLAGS="$QEMU_CFLAGS $libpmem_cflags" else if test "$libpmem" = "yes" ; then @@ -6392,7 +6239,6 @@ if test "$libdaxctl" != "no"; then libdaxctl="yes" libdaxctl_libs=$($pkg_config --libs libdaxctl) libdaxctl_cflags=$($pkg_config --cflags libdaxctl) - libs_softmmu="$libs_softmmu $libdaxctl_libs" QEMU_CFLAGS="$QEMU_CFLAGS $libdaxctl_cflags" else if test "$libdaxctl" = "yes" ; then @@ -6438,8 +6284,8 @@ case "$slirp" in git_submodules="${git_submodules} slirp" fi mkdir -p slirp - slirp_cflags="-I\$(SRC_PATH)/slirp/src -I\$(BUILD_DIR)/slirp/src" - slirp_libs="-L\$(BUILD_DIR)/slirp -lslirp" + slirp_cflags="-I${source_path}/slirp/src -I$PWD/slirp/src" + slirp_libs="-L$PWD/slirp -lslirp" if test "$mingw32" = "yes" ; then slirp_libs="$slirp_libs -lws2_32 -liphlpapi" fi @@ -6522,14 +6368,31 @@ fi write_c_skeleton if test "$gcov" = "yes" ; then - QEMU_CFLAGS="-fprofile-arcs -ftest-coverage -g $QEMU_CFLAGS" - QEMU_LDFLAGS="-fprofile-arcs -ftest-coverage $QEMU_LDFLAGS" + : elif test "$fortify_source" = "yes" ; then - CFLAGS="-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS" -elif test "$debug" = "no"; then + QEMU_CFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $QEMU_CFLAGS" + debug=no +fi +if test "$debug_info" = "yes"; then + CFLAGS="-g $CFLAGS" + LDFLAGS="-g $LDFLAGS" +fi +if test "$debug" = "no"; then CFLAGS="-O2 $CFLAGS" fi +case "$ARCH" in +alpha) + # Ensure there's only a single GP + QEMU_CFLAGS="-msmall-data $QEMU_CFLAGS" +;; +esac + +if test "$gprof" = "yes" ; then + QEMU_CFLAGS="-p $QEMU_CFLAGS" + QEMU_LDFLAGS="-p $QEMU_LDFLAGS" +fi + if test "$have_asan" = "yes"; then QEMU_CFLAGS="-fsanitize=address $QEMU_CFLAGS" QEMU_LDFLAGS="-fsanitize=address $QEMU_LDFLAGS" @@ -6632,24 +6495,10 @@ if [ "$eventfd" = "yes" ]; then ivshmem=yes fi -tools="" -if test "$want_tools" = "yes" ; then - tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) qemu-edid\$(EXESUF) $tools" - if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then - tools="qemu-nbd\$(EXESUF) qemu-storage-daemon\$(EXESUF) $tools" - fi - if [ "$ivshmem" = "yes" ]; then - tools="ivshmem-client\$(EXESUF) ivshmem-server\$(EXESUF) $tools" - fi - if [ "$curl" = "yes" ]; then - tools="elf2dmp\$(EXESUF) $tools" - fi -fi if test "$softmmu" = yes ; then if test "$linux" = yes; then if test "$virtfs" != no && test "$cap_ng" = yes && test "$attr" = yes ; then virtfs=yes - helpers="$helpers fsdev/virtfs-proxy-helper\$(EXESUF)" else if test "$virtfs" = yes; then error_exit "VirtFS requires libcap-ng devel and libattr devel" @@ -6664,7 +6513,6 @@ if test "$softmmu" = yes ; then fi mpath=no fi - helpers="$helpers scsi/qemu-pr-helper\$(EXESUF)" else if test "$virtfs" = yes; then error_exit "VirtFS is supported only on Linux" @@ -6675,9 +6523,6 @@ if test "$softmmu" = yes ; then fi mpath=no fi - if test "$xkbcommon" = "yes"; then - tools="qemu-keymap\$(EXESUF) $tools" - fi fi # Probe for guest agent support/options @@ -6686,7 +6531,6 @@ if [ "$guest_agent" != "no" ]; then if [ "$softmmu" = no -a "$want_tools" = no ] ; then guest_agent=no elif [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" -o "$mingw32" = "yes" ] ; then - tools="qemu-ga\$(EXESUF) $tools" guest_agent=yes elif [ "$guest_agent" != yes ]; then guest_agent=no @@ -6801,7 +6645,7 @@ EOF update_cxxflags - if do_cxx $QEMU_CXXFLAGS -o $TMPE $TMPCXX $TMPO $QEMU_LDFLAGS; then + if do_cxx $CXXFLAGS $QEMU_CXXFLAGS -o $TMPE $TMPCXX $TMPO $QEMU_LDFLAGS; then # C++ compiler $cxx works ok with C compiler $cc : else @@ -6823,228 +6667,6 @@ echo_version() { # prepend pixman and ftd flags after all config tests are done QEMU_CFLAGS="$pixman_cflags $fdt_cflags $QEMU_CFLAGS" QEMU_LDFLAGS="$fdt_ldflags $QEMU_LDFLAGS" -libs_softmmu="$pixman_libs $libs_softmmu" - -echo "Install prefix $prefix" -echo "BIOS directory $(eval echo $qemu_datadir)" -echo "firmware path $(eval echo $firmwarepath)" -echo "binary directory $(eval echo $bindir)" -echo "library directory $(eval echo $libdir)" -echo "module directory $(eval echo $qemu_moddir)" -echo "libexec directory $(eval echo $libexecdir)" -echo "include directory $(eval echo $includedir)" -echo "config directory $(eval echo $sysconfdir)" -if test "$mingw32" = "no" ; then -echo "local state directory $(eval echo $local_statedir)" -echo "Manual directory $(eval echo $mandir)" -echo "ELF interp prefix $interp_prefix" -else -echo "local state directory queried at runtime" -echo "Windows SDK $win_sdk" -fi -echo "Build directory $(pwd)" -echo "Source path $source_path" -echo "GIT binary $git" -echo "GIT submodules $git_submodules" -echo "C compiler $cc" -echo "Host C compiler $host_cc" -echo "C++ compiler $cxx" -echo "Objective-C compiler $objcc" -echo "ARFLAGS $ARFLAGS" -echo "CFLAGS $CFLAGS" -echo "QEMU_CFLAGS $QEMU_CFLAGS" -echo "QEMU_LDFLAGS $QEMU_LDFLAGS" -echo "make $make" -echo "install $install" -echo "python $python ($python_version)" -if test "$docs" != "no"; then - echo "sphinx-build $sphinx_build" -fi -echo "genisoimage $genisoimage" -echo "efi_aarch64 $efi_aarch64" -echo "python_yaml $python_yaml" -echo "slirp support $slirp $(echo_version $slirp $slirp_version)" -if test "$slirp" != "no" ; then - echo "smbd $smbd" -fi -echo "module support $modules" -echo "alt path mod load $module_upgrades" -echo "host CPU $cpu" -echo "host big endian $bigendian" -echo "target list $target_list" -echo "gprof enabled $gprof" -echo "sparse enabled $sparse" -echo "strip binaries $strip_opt" -echo "profiler $profiler" -echo "static build $static" -echo "safe stack $safe_stack" -if test "$darwin" = "yes" ; then - echo "Cocoa support $cocoa" -fi -echo "SDL support $sdl $(echo_version $sdl $sdlversion)" -echo "SDL image support $sdl_image" -echo "GTK support $gtk $(echo_version $gtk $gtk_version)" -echo "GTK GL support $gtk_gl" -echo "VTE support $vte $(echo_version $vte $vteversion)" -echo "TLS priority $tls_priority" -echo "GNUTLS support $gnutls" -echo "libgcrypt $gcrypt" -if test "$gcrypt" = "yes" -then - echo " hmac $gcrypt_hmac" - echo " XTS $gcrypt_xts" -fi -echo "nettle $nettle $(echo_version $nettle $nettle_version)" -if test "$nettle" = "yes" -then - echo " XTS $nettle_xts" -fi -echo "libtasn1 $tasn1" -echo "PAM $auth_pam" -echo "iconv support $iconv" -echo "curses support $curses" -echo "virgl support $virglrenderer $(echo_version $virglrenderer $virgl_version)" -echo "curl support $curl" -echo "mingw32 support $mingw32" -echo "Audio drivers $audio_drv_list" -echo "Block whitelist (rw) $block_drv_rw_whitelist" -echo "Block whitelist (ro) $block_drv_ro_whitelist" -echo "VirtFS support $virtfs" -echo "Multipath support $mpath" -echo "VNC support $vnc" -if test "$vnc" = "yes" ; then - echo "VNC SASL support $vnc_sasl" - echo "VNC JPEG support $vnc_jpeg" - echo "VNC PNG support $vnc_png" -fi -echo "xen support $xen" -if test "$xen" = "yes" ; then - echo "xen ctrl version $xen_ctrl_version" -fi -echo "brlapi support $brlapi" -echo "Documentation $docs" -echo "PIE $pie" -echo "vde support $vde" -echo "netmap support $netmap" -echo "Linux AIO support $linux_aio" -echo "Linux io_uring support $linux_io_uring" -echo "ATTR/XATTR support $attr" -echo "Install blobs $blobs" -echo "KVM support $kvm" -echo "HAX support $hax" -echo "HVF support $hvf" -echo "WHPX support $whpx" -echo "TCG support $tcg" -if test "$tcg" = "yes" ; then - echo "TCG debug enabled $debug_tcg" - echo "TCG interpreter $tcg_interpreter" -fi -echo "malloc trim support $malloc_trim" -echo "RDMA support $rdma" -echo "PVRDMA support $pvrdma" -echo "fdt support $fdt" -echo "membarrier $membarrier" -echo "preadv support $preadv" -echo "fdatasync $fdatasync" -echo "madvise $madvise" -echo "posix_madvise $posix_madvise" -echo "posix_memalign $posix_memalign" -echo "libcap-ng support $cap_ng" -echo "vhost-net support $vhost_net" -echo "vhost-crypto support $vhost_crypto" -echo "vhost-scsi support $vhost_scsi" -echo "vhost-vsock support $vhost_vsock" -echo "vhost-user support $vhost_user" -echo "vhost-user-fs support $vhost_user_fs" -echo "vhost-vdpa support $vhost_vdpa" -echo "Trace backends $trace_backends" -if have_backend "simple"; then -echo "Trace output file $trace_file-<pid>" -fi -echo "spice support $spice $(echo_version $spice $spice_protocol_version/$spice_server_version)" -echo "rbd support $rbd" -echo "xfsctl support $xfs" -echo "smartcard support $smartcard" -echo "libusb $libusb" -echo "usb net redir $usb_redir" -echo "OpenGL support $opengl" -echo "OpenGL dmabufs $opengl_dmabuf" -echo "libiscsi support $libiscsi" -echo "libnfs support $libnfs" -echo "build guest agent $guest_agent" -echo "QGA VSS support $guest_agent_with_vss" -echo "QGA w32 disk info $guest_agent_ntddscsi" -echo "QGA MSI support $guest_agent_msi" -echo "seccomp support $seccomp" -echo "coroutine backend $coroutine" -echo "coroutine pool $coroutine_pool" -echo "debug stack usage $debug_stack_usage" -echo "mutex debugging $debug_mutex" -echo "crypto afalg $crypto_afalg" -echo "GlusterFS support $glusterfs" -echo "gcov $gcov_tool" -echo "gcov enabled $gcov" -echo "TPM support $tpm" -echo "libssh support $libssh" -echo "QOM debugging $qom_cast_debug" -echo "Live block migration $live_block_migration" -echo "lzo support $lzo" -echo "snappy support $snappy" -echo "bzip2 support $bzip2" -echo "lzfse support $lzfse" -echo "zstd support $zstd" -echo "NUMA host support $numa" -echo "libxml2 $libxml2" -echo "tcmalloc support $tcmalloc" -echo "jemalloc support $jemalloc" -echo "avx2 optimization $avx2_opt" -echo "avx512f optimization $avx512f_opt" -echo "replication support $replication" -echo "bochs support $bochs" -echo "cloop support $cloop" -echo "dmg support $dmg" -echo "qcow v1 support $qcow1" -echo "vdi support $vdi" -echo "vvfat support $vvfat" -echo "qed support $qed" -echo "parallels support $parallels" -echo "sheepdog support $sheepdog" -echo "capstone $capstone" -echo "libpmem support $libpmem" -echo "libdaxctl support $libdaxctl" -echo "libudev $libudev" -echo "default devices $default_devices" -echo "plugin support $plugins" -echo "fuzzing support $fuzzing" -echo "gdb $gdb_bin" -echo "rng-none $rng_none" -echo "Linux keyring $secret_keyring" - -if test "$supported_cpu" = "no"; then - echo - echo "WARNING: SUPPORT FOR THIS HOST CPU WILL GO AWAY IN FUTURE RELEASES!" - echo - echo "CPU host architecture $cpu support is not currently maintained." - echo "The QEMU project intends to remove support for this host CPU in" - echo "a future release if nobody volunteers to maintain it and to" - echo "provide a build host for our continuous integration setup." - echo "configure has succeeded and you can continue to build, but" - echo "if you care about QEMU on this platform you should contact" - echo "us upstream at qemu-devel@nongnu.org." -fi - -if test "$supported_os" = "no"; then - echo - echo "WARNING: SUPPORT FOR THIS HOST OS WILL GO AWAY IN FUTURE RELEASES!" - echo - echo "Host OS $targetos support is not currently maintained." - echo "The QEMU project intends to remove support for this host OS in" - echo "a future release if nobody volunteers to maintain it and to" - echo "provide a build host for our continuous integration setup." - echo "configure has succeeded and you can continue to build, but" - echo "if you care about QEMU on this platform you should contact" - echo "us upstream at qemu-devel@nongnu.org." -fi config_host_mak="config-host.mak" @@ -7073,17 +6695,12 @@ echo "qemu_helperdir=$libexecdir" >> $config_host_mak echo "qemu_localedir=$qemu_localedir" >> $config_host_mak echo "qemu_icondir=$qemu_icondir" >> $config_host_mak echo "qemu_desktopdir=$qemu_desktopdir" >> $config_host_mak -echo "libs_cpu=$libs_cpu" >> $config_host_mak -echo "libs_softmmu=$libs_softmmu" >> $config_host_mak echo "GIT=$git" >> $config_host_mak echo "GIT_SUBMODULES=$git_submodules" >> $config_host_mak echo "GIT_UPDATE=$git_update" >> $config_host_mak echo "ARCH=$ARCH" >> $config_host_mak -echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak -echo "GLIB_LDFLAGS=$glib_ldflags" >> $config_host_mak - if test "$default_devices" = "yes" ; then echo "CONFIG_MINIKCONF_MODE=--defconfig" >> $config_host_mak else @@ -7153,14 +6770,18 @@ fi if test "$want_tools" = "yes" ; then echo "CONFIG_TOOLS=y" >> $config_host_mak fi +if test "$guest_agent" = "yes" ; then + echo "CONFIG_GUEST_AGENT=y" >> $config_host_mak +fi if test "$slirp" != "no"; then echo "CONFIG_SLIRP=y" >> $config_host_mak echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak echo "SLIRP_CFLAGS=$slirp_cflags" >> $config_host_mak echo "SLIRP_LIBS=$slirp_libs" >> $config_host_mak fi +subdirs= if [ "$slirp" = "git" -o "$slirp" = "internal" ]; then - echo "config-host.h: slirp/all" >> $config_host_mak + subdirs="$subdirs slirp" fi if test "$vde" = "yes" ; then echo "CONFIG_VDE=y" >> $config_host_mak @@ -7177,41 +6798,37 @@ if test "$gprof" = "yes" ; then fi if test "$cap_ng" = "yes" ; then echo "CONFIG_LIBCAP_NG=y" >> $config_host_mak + echo "LIBCAP_NG_LIBS=$cap_libs" >> $config_host_mak fi echo "CONFIG_AUDIO_DRIVERS=$audio_drv_list" >> $config_host_mak for drv in $audio_drv_list; do def=CONFIG_AUDIO_$(echo $drv | LC_ALL=C tr '[a-z]' '[A-Z]') - case "$drv" in - alsa | oss | pa | sdl) - echo "$def=m" >> $config_host_mak ;; - *) - echo "$def=y" >> $config_host_mak ;; - esac + echo "$def=y" >> $config_host_mak done +if test "$alsa" = "yes" ; then + echo "CONFIG_ALSA=y" >> $config_host_mak +fi echo "ALSA_LIBS=$alsa_libs" >> $config_host_mak +echo "ALSA_CFLAGS=$alsa_cflags" >> $config_host_mak +if test "$libpulse" = "yes" ; then + echo "CONFIG_LIBPULSE=y" >> $config_host_mak +fi echo "PULSE_LIBS=$pulse_libs" >> $config_host_mak +echo "PULSE_CFLAGS=$pulse_cflags" >> $config_host_mak echo "COREAUDIO_LIBS=$coreaudio_libs" >> $config_host_mak echo "DSOUND_LIBS=$dsound_libs" >> $config_host_mak echo "OSS_LIBS=$oss_libs" >> $config_host_mak +if test "$libjack" = "yes" ; then + echo "CONFIG_LIBJACK=y" >> $config_host_mak +fi echo "JACK_LIBS=$jack_libs" >> $config_host_mak if test "$audio_win_int" = "yes" ; then echo "CONFIG_AUDIO_WIN_INT=y" >> $config_host_mak fi echo "CONFIG_BDRV_RW_WHITELIST=$block_drv_rw_whitelist" >> $config_host_mak echo "CONFIG_BDRV_RO_WHITELIST=$block_drv_ro_whitelist" >> $config_host_mak -if test "$vnc" = "yes" ; then - echo "CONFIG_VNC=y" >> $config_host_mak -fi -if test "$vnc_sasl" = "yes" ; then - echo "CONFIG_VNC_SASL=y" >> $config_host_mak -fi -if test "$vnc_jpeg" = "yes" ; then - echo "CONFIG_VNC_JPEG=y" >> $config_host_mak -fi -if test "$vnc_png" = "yes" ; then - echo "CONFIG_VNC_PNG=y" >> $config_host_mak -fi if test "$xkbcommon" = "yes" ; then + echo "CONFIG_XKBCOMMON=y" >> $config_host_mak echo "XKBCOMMON_CFLAGS=$xkbcommon_cflags" >> $config_host_mak echo "XKBCOMMON_LIBS=$xkbcommon_libs" >> $config_host_mak fi @@ -7219,7 +6836,6 @@ if test "$xfs" = "yes" ; then echo "CONFIG_XFS=y" >> $config_host_mak fi qemu_version=$(head $source_path/VERSION) -echo "VERSION=$qemu_version" >>$config_host_mak echo "PKGVERSION=$pkgversion" >>$config_host_mak echo "SRC_PATH=$source_path" >> $config_host_mak echo "TARGET_DIRS=$target_list" >> $config_host_mak @@ -7240,14 +6856,6 @@ if test "$have_x11" = "yes" && test "$need_x11" = "yes"; then echo "X11_CFLAGS=$x11_cflags" >> $config_host_mak echo "X11_LIBS=$x11_libs" >> $config_host_mak fi -if test "$sdl" = "yes" ; then - echo "CONFIG_SDL=m" >> $config_host_mak - echo "SDL_CFLAGS=$sdl_cflags" >> $config_host_mak - echo "SDL_LIBS=$sdl_libs" >> $config_host_mak - if test "$sdl_image" = "yes" ; then - echo "CONFIG_SDL_IMAGE=y" >> $config_host_mak - fi -fi if test "$cocoa" = "yes" ; then echo "CONFIG_COCOA=y" >> $config_host_mak fi @@ -7257,7 +6865,7 @@ if test "$iconv" = "yes" ; then echo "ICONV_LIBS=$iconv_lib" >> $config_host_mak fi if test "$curses" = "yes" ; then - echo "CONFIG_CURSES=m" >> $config_host_mak + echo "CONFIG_CURSES=y" >> $config_host_mak echo "CURSES_CFLAGS=$curses_inc" >> $config_host_mak echo "CURSES_LIBS=$curses_lib" >> $config_host_mak fi @@ -7352,7 +6960,7 @@ if test "$bswap_h" = "yes" ; then echo "CONFIG_MACHINE_BSWAP_H=y" >> $config_host_mak fi if test "$curl" = "yes" ; then - echo "CONFIG_CURL=m" >> $config_host_mak + echo "CONFIG_CURL=y" >> $config_host_mak echo "CURL_CFLAGS=$curl_cflags" >> $config_host_mak echo "CURL_LIBS=$curl_libs" >> $config_host_mak fi @@ -7361,7 +6969,7 @@ if test "$brlapi" = "yes" ; then echo "BRLAPI_LIBS=$brlapi_libs" >> $config_host_mak fi if test "$gtk" = "yes" ; then - echo "CONFIG_GTK=m" >> $config_host_mak + echo "CONFIG_GTK=y" >> $config_host_mak echo "GTK_CFLAGS=$gtk_cflags" >> $config_host_mak echo "GTK_LIBS=$gtk_libs" >> $config_host_mak if test "$gtk_gl" = "yes" ; then @@ -7377,6 +6985,8 @@ fi echo "CONFIG_TLS_PRIORITY=\"$tls_priority\"" >> $config_host_mak if test "$gnutls" = "yes" ; then echo "CONFIG_GNUTLS=y" >> $config_host_mak + echo "GNUTLS_CFLAGS=$gnutls_cflags" >> $config_host_mak + echo "GNUTLS_LIBS=$gnutls_libs" >> $config_host_mak fi if test "$gcrypt" = "yes" ; then echo "CONFIG_GCRYPT=y" >> $config_host_mak @@ -7387,6 +6997,8 @@ fi if test "$nettle" = "yes" ; then echo "CONFIG_NETTLE=y" >> $config_host_mak echo "CONFIG_NETTLE_VERSION_MAJOR=${nettle_version%%.*}" >> $config_host_mak + echo "NETTLE_CFLAGS=$nettle_cflags" >> $config_host_mak + echo "NETTLE_LIBS=$nettle_libs" >> $config_host_mak fi if test "$qemu_private_xts" = "yes" ; then echo "CONFIG_QEMU_PRIVATE_XTS=y" >> $config_host_mak @@ -7436,6 +7048,8 @@ fi if test "$xen" = "yes" ; then echo "CONFIG_XEN_BACKEND=y" >> $config_host_mak echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=$xen_ctrl_version" >> $config_host_mak + echo "XEN_CFLAGS=$xen_cflags" >> $config_host_mak + echo "XEN_LIBS=$xen_libs" >> $config_host_mak fi if test "$linux_aio" = "yes" ; then echo "CONFIG_LINUX_AIO=y" >> $config_host_mak @@ -7447,6 +7061,7 @@ if test "$linux_io_uring" = "yes" ; then fi if test "$attr" = "yes" ; then echo "CONFIG_ATTR=y" >> $config_host_mak + echo "LIBATTR_LIBS=$libattr_libs" >> $config_host_mak fi if test "$libattr" = "yes" ; then echo "CONFIG_LIBATTR=y" >> $config_host_mak @@ -7504,6 +7119,8 @@ if test "$preadv" = "yes" ; then fi if test "$fdt" != "no" ; then echo "CONFIG_FDT=y" >> $config_host_mak + echo "FDT_CFLAGS=$fdt_cflags" >> $config_host_mak + echo "FDT_LIBS=$fdt_ldflags $fdt_libs" >> $config_host_mak fi if test "$membarrier" = "yes" ; then echo "CONFIG_MEMBARRIER=y" >> $config_host_mak @@ -7532,9 +7149,15 @@ fi if test "$posix_memalign" = "yes" ; then echo "CONFIG_POSIX_MEMALIGN=y" >> $config_host_mak fi - +if test "$zlib" != "no" ; then + echo "CONFIG_ZLIB=y" >> $config_host_mak + echo "ZLIB_CFLAGS=$zlib_cflags" >> $config_host_mak + echo "ZLIB_LIBS=$zlib_libs" >> $config_host_mak +fi if test "$spice" = "yes" ; then echo "CONFIG_SPICE=y" >> $config_host_mak + echo "SPICE_CFLAGS=$spice_cflags" >> $config_host_mak + echo "SPICE_LIBS=$spice_libs" >> $config_host_mak fi if test "$smartcard" = "yes" ; then @@ -7584,10 +7207,12 @@ fi if test "$lzo" = "yes" ; then echo "CONFIG_LZO=y" >> $config_host_mak + echo "LZO_LIBS=$lzo_libs" >> $config_host_mak fi if test "$snappy" = "yes" ; then echo "CONFIG_SNAPPY=y" >> $config_host_mak + echo "SNAPPY_LIBS=$snappy_libs" >> $config_host_mak fi if test "$bzip2" = "yes" ; then @@ -7602,16 +7227,18 @@ fi if test "$zstd" = "yes" ; then echo "CONFIG_ZSTD=y" >> $config_host_mak + echo "ZSTD_CFLAGS=$zstd_cflags" >> $config_host_mak + echo "ZSTD_LIBS=$zstd_libs" >> $config_host_mak fi if test "$libiscsi" = "yes" ; then - echo "CONFIG_LIBISCSI=m" >> $config_host_mak + echo "CONFIG_LIBISCSI=y" >> $config_host_mak echo "LIBISCSI_CFLAGS=$libiscsi_cflags" >> $config_host_mak echo "LIBISCSI_LIBS=$libiscsi_libs" >> $config_host_mak fi if test "$libnfs" = "yes" ; then - echo "CONFIG_LIBNFS=m" >> $config_host_mak + echo "CONFIG_LIBNFS=y" >> $config_host_mak echo "LIBNFS_LIBS=$libnfs_libs" >> $config_host_mak fi @@ -7633,8 +7260,7 @@ if test "$qom_cast_debug" = "yes" ; then echo "CONFIG_QOM_CAST_DEBUG=y" >> $config_host_mak fi if test "$rbd" = "yes" ; then - echo "CONFIG_RBD=m" >> $config_host_mak - echo "RBD_CFLAGS=$rbd_cflags" >> $config_host_mak + echo "CONFIG_RBD=y" >> $config_host_mak echo "RBD_LIBS=$rbd_libs" >> $config_host_mak fi @@ -7706,7 +7332,7 @@ if test "$getauxval" = "yes" ; then fi if test "$glusterfs" = "yes" ; then - echo "CONFIG_GLUSTERFS=m" >> $config_host_mak + echo "CONFIG_GLUSTERFS=y" >> $config_host_mak echo "GLUSTERFS_CFLAGS=$glusterfs_cflags" >> $config_host_mak echo "GLUSTERFS_LIBS=$glusterfs_libs" >> $config_host_mak fi @@ -7736,7 +7362,7 @@ if test "$glusterfs_iocb_has_stat" = "yes" ; then fi if test "$libssh" = "yes" ; then - echo "CONFIG_LIBSSH=m" >> $config_host_mak + echo "CONFIG_LIBSSH=y" >> $config_host_mak echo "LIBSSH_CFLAGS=$libssh_cflags" >> $config_host_mak echo "LIBSSH_LIBS=$libssh_libs" >> $config_host_mak fi @@ -7763,6 +7389,8 @@ if have_backend "log"; then fi if have_backend "ust"; then echo "CONFIG_TRACE_UST=y" >> $config_host_mak + echo "LTTNG_UST_LIBS=$lttng_ust_libs" >> $config_host_mak + echo "URCU_BP_LIBS=$urcu_bp_libs" >> $config_host_mak fi if have_backend "dtrace"; then echo "CONFIG_TRACE_DTRACE=y" >> $config_host_mak @@ -7832,6 +7460,8 @@ if test "$ivshmem" = "yes" ; then fi if test "$capstone" != "no" ; then echo "CONFIG_CAPSTONE=y" >> $config_host_mak + echo "CAPSTONE_CFLAGS=$capstone_cflags" >> $config_host_mak + echo "CAPSTONE_LIBS=$capstone_libs" >> $config_host_mak fi if test "$debug_mutex" = "yes" ; then echo "CONFIG_DEBUG_MUTEX=y" >> $config_host_mak @@ -7852,6 +7482,8 @@ 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 "$libdaxctl" = "yes" ; then @@ -7892,14 +7524,7 @@ if test "$have_mlockall" = "yes" ; then echo "HAVE_MLOCKALL=y" >> $config_host_mak fi if test "$fuzzing" = "yes" ; then - if test "$have_fuzzer" = "yes"; then - FUZZ_LDFLAGS=" -fsanitize=fuzzer" - FUZZ_CFLAGS=" -fsanitize=fuzzer" - CFLAGS="$CFLAGS -fsanitize=fuzzer-no-link" - else - error_exit "Your compiler doesn't support -fsanitize=fuzzer" - exit 1 - fi + QEMU_CFLAGS="$QEMU_CFLAGS -fsanitize=fuzzer-no-link" fi if test "$plugins" = "yes" ; then @@ -7935,23 +7560,21 @@ if test "$secret_keyring" = "yes" ; then fi if test "$tcg_interpreter" = "yes"; then - QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/tci $QEMU_INCLUDES" + QEMU_INCLUDES="-iquote ${source_path}/tcg/tci $QEMU_INCLUDES" elif test "$ARCH" = "sparc64" ; then - QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/sparc $QEMU_INCLUDES" + QEMU_INCLUDES="-iquote ${source_path}/tcg/sparc $QEMU_INCLUDES" elif test "$ARCH" = "s390x" ; then - QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/s390 $QEMU_INCLUDES" + QEMU_INCLUDES="-iquote ${source_path}/tcg/s390 $QEMU_INCLUDES" elif test "$ARCH" = "x86_64" || test "$ARCH" = "x32" ; then - QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/i386 $QEMU_INCLUDES" + QEMU_INCLUDES="-iquote ${source_path}/tcg/i386 $QEMU_INCLUDES" elif test "$ARCH" = "ppc64" ; then - QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/ppc $QEMU_INCLUDES" + QEMU_INCLUDES="-iquote ${source_path}/tcg/ppc $QEMU_INCLUDES" elif test "$ARCH" = "riscv32" || test "$ARCH" = "riscv64" ; then - QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/riscv $QEMU_INCLUDES" + QEMU_INCLUDES="-I${source_path}/tcg/riscv $QEMU_INCLUDES" else - QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/\$(ARCH) $QEMU_INCLUDES" + QEMU_INCLUDES="-iquote ${source_path}/tcg/${ARCH} $QEMU_INCLUDES" fi -echo "HELPERS=$helpers" >> $config_host_mak -echo "TOOLS=$tools" >> $config_host_mak echo "ROMS=$roms" >> $config_host_mak echo "MAKE=$make" >> $config_host_mak echo "INSTALL=$install" >> $config_host_mak @@ -7961,15 +7584,12 @@ echo "INSTALL_PROG=$install -c -m 0755" >> $config_host_mak echo "INSTALL_LIB=$install -c -m 0644" >> $config_host_mak echo "PYTHON=$python" >> $config_host_mak echo "SPHINX_BUILD=$sphinx_build" >> $config_host_mak -echo "SPHINX_WERROR=$sphinx_werror" >> $config_host_mak echo "GENISOIMAGE=$genisoimage" >> $config_host_mak -echo "EFI_AARCH64=$efi_aarch64" >> $config_host_mak -echo "PYTHON_YAML=$python_yaml" >> $config_host_mak +echo "MESON=$meson" >> $config_host_mak echo "CC=$cc" >> $config_host_mak if $iasl -h > /dev/null 2>&1; then - echo "IASL=$iasl" >> $config_host_mak + echo "CONFIG_IASL=$iasl" >> $config_host_mak fi -echo "HOST_CC=$host_cc" >> $config_host_mak echo "CXX=$cxx" >> $config_host_mak echo "OBJCC=$objcc" >> $config_host_mak echo "AR=$ar" >> $config_host_mak @@ -7984,16 +7604,15 @@ echo "NM=$nm" >> $config_host_mak echo "PKG_CONFIG=$pkg_config_exe" >> $config_host_mak echo "WINDRES=$windres" >> $config_host_mak echo "CFLAGS=$CFLAGS" >> $config_host_mak +echo "CXXFLAGS=$CXXFLAGS" >> $config_host_mak echo "CFLAGS_NOPIE=$CFLAGS_NOPIE" >> $config_host_mak echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak echo "QEMU_CXXFLAGS=$QEMU_CXXFLAGS" >> $config_host_mak echo "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak +echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak +echo "GLIB_LIBS=$glib_libs" >> $config_host_mak if test "$sparse" = "yes" ; then - echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_host_mak - echo "CPP := REAL_CC=\"\$(CPP)\" cgcc" >> $config_host_mak - echo "CXX := REAL_CC=\"\$(CXX)\" cgcc" >> $config_host_mak - echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_host_mak - echo "QEMU_CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_host_mak + echo "SPARSE_CFLAGS = -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_host_mak fi echo "QEMU_LDFLAGS=$QEMU_LDFLAGS" >> $config_host_mak echo "LDFLAGS_NOPIE=$LDFLAGS_NOPIE" >> $config_host_mak @@ -8003,15 +7622,14 @@ echo "LIBS+=$LIBS" >> $config_host_mak echo "LIBS_TOOLS+=$libs_tools" >> $config_host_mak echo "PTHREAD_LIB=$PTHREAD_LIB" >> $config_host_mak echo "EXESUF=$EXESUF" >> $config_host_mak -echo "DSOSUF=$DSOSUF" >> $config_host_mak +echo "HOST_DSOSUF=$HOST_DSOSUF" >> $config_host_mak echo "LDFLAGS_SHARED=$LDFLAGS_SHARED" >> $config_host_mak -echo "LIBS_QGA+=$libs_qga" >> $config_host_mak +echo "LIBS_QGA=$libs_qga" >> $config_host_mak echo "TASN1_LIBS=$tasn1_libs" >> $config_host_mak echo "TASN1_CFLAGS=$tasn1_cflags" >> $config_host_mak echo "POD2MAN=$POD2MAN" >> $config_host_mak if test "$gcov" = "yes" ; then echo "CONFIG_GCOV=y" >> $config_host_mak - echo "GCOV=$gcov_tool" >> $config_host_mak fi if test "$libudev" != "no"; then @@ -8020,8 +7638,6 @@ if test "$libudev" != "no"; then fi if test "$fuzzing" != "no"; then echo "CONFIG_FUZZ=y" >> $config_host_mak - echo "FUZZ_CFLAGS=$FUZZ_CFLAGS" >> $config_host_mak - echo "FUZZ_LDFLAGS=$FUZZ_LDFLAGS" >> $config_host_mak fi if test "$edk2_blobs" = "yes" ; then @@ -8111,18 +7727,22 @@ gdb_xml_files="" TARGET_ARCH="$target_name" TARGET_BASE_ARCH="" TARGET_ABI_DIR="" +TARGET_SYSTBL_ABI="" +TARGET_SYSTBL="" case "$target_name" in i386) mttcg="yes" gdb_xml_files="i386-32bit.xml" TARGET_SYSTBL_ABI=i386 + TARGET_SYSTBL=syscall_32.tbl ;; x86_64) TARGET_BASE_ARCH=i386 TARGET_SYSTBL_ABI=common,64 + TARGET_SYSTBL=syscall_64.tbl mttcg="yes" - gdb_xml_files="i386-64bit.xml" + gdb_xml_files="i386-64bit.xml" ;; alpha) mttcg="yes" @@ -8162,6 +7782,7 @@ case "$target_name" in microblaze|microblazeel) TARGET_ARCH=microblaze TARGET_SYSTBL_ABI=common + mttcg="yes" bflt="yes" echo "TARGET_ABI32=y" >> $config_target_mak ;; @@ -8170,6 +7791,7 @@ case "$target_name" in TARGET_ARCH=mips echo "TARGET_ABI_MIPSO32=y" >> $config_target_mak TARGET_SYSTBL_ABI=o32 + TARGET_SYSTBL=syscall_o32.tbl ;; mipsn32|mipsn32el) mttcg="yes" @@ -8178,6 +7800,7 @@ case "$target_name" in echo "TARGET_ABI_MIPSN32=y" >> $config_target_mak echo "TARGET_ABI32=y" >> $config_target_mak TARGET_SYSTBL_ABI=n32 + TARGET_SYSTBL=syscall_n32.tbl ;; mips64|mips64el) mttcg="no" @@ -8185,6 +7808,7 @@ case "$target_name" in TARGET_BASE_ARCH=mips echo "TARGET_ABI_MIPSN64=y" >> $config_target_mak TARGET_SYSTBL_ABI=n64 + TARGET_SYSTBL=syscall_n64.tbl ;; moxie) ;; @@ -8283,8 +7907,9 @@ esac if [ "$TARGET_BASE_ARCH" = "" ]; then TARGET_BASE_ARCH=$TARGET_ARCH fi - -symlink "$source_path/Makefile.target" "$target_dir/Makefile" +if [ "$TARGET_SYSTBL_ABI" != "" ] && [ "$TARGET_SYSTBL" = "" ]; then + TARGET_SYSTBL=syscall.tbl +fi upper() { echo "$@"| LC_ALL=C tr '[a-z]' '[A-Z]' @@ -8303,22 +7928,17 @@ if [ "$HOST_VARIANT_DIR" != "" ]; then fi if [ "$TARGET_SYSTBL_ABI" != "" ]; then echo "TARGET_SYSTBL_ABI=$TARGET_SYSTBL_ABI" >> $config_target_mak + echo "TARGET_SYSTBL=$TARGET_SYSTBL" >> $config_target_mak fi if supported_xen_target $target; then echo "CONFIG_XEN=y" >> $config_target_mak - echo "$target/config-devices.mak: CONFIG_XEN=y" >> $config_host_mak if test "$xen_pci_passthrough" = yes; then echo "CONFIG_XEN_PCI_PASSTHROUGH=y" >> "$config_target_mak" fi -else - echo "$target/config-devices.mak: CONFIG_XEN=n" >> $config_host_mak fi if supported_kvm_target $target; then echo "CONFIG_KVM=y" >> $config_target_mak - echo "$target/config-devices.mak: CONFIG_KVM=y" >> $config_host_mak -else - echo "$target/config-devices.mak: CONFIG_KVM=n" >> $config_host_mak fi if supported_hax_target $target; then echo "CONFIG_HAX=y" >> $config_target_mak @@ -8344,6 +7964,9 @@ fi if test "$target_user_only" = "yes" ; then echo "CONFIG_USER_ONLY=y" >> $config_target_mak echo "CONFIG_QEMU_INTERP_PREFIX=\"$interp_prefix1\"" >> $config_target_mak + symlink "../qemu-$target_name" "$target_dir/qemu-$target_name" +else + symlink "../qemu-system-$target_name" "$target_dir/qemu-system-$target_name" fi if test "$target_linux_user" = "yes" ; then echo "CONFIG_LINUX_USER=y" >> $config_target_mak @@ -8351,7 +7974,7 @@ fi list="" if test ! -z "$gdb_xml_files" ; then for x in $gdb_xml_files; do - list="$list $source_path/gdb-xml/$x" + list="$list gdb-xml/$x" done echo "TARGET_XML_FILES=$list" >> $config_target_mak fi @@ -8366,9 +7989,6 @@ fi # generate QEMU_CFLAGS/QEMU_LDFLAGS for targets -cflags="" -ldflags="" - disas_config() { echo "CONFIG_${1}_DIS=y" >> $config_target_mak echo "CONFIG_${1}_DIS=y" >> config-all-disas.mak @@ -8453,59 +8073,25 @@ if test "$tcg_interpreter" = "yes" ; then disas_config "TCI" fi -case "$ARCH" in -alpha) - # Ensure there's only a single GP - cflags="-msmall-data $cflags" -;; -esac - -if test "$gprof" = "yes" ; then - if test "$target_linux_user" = "yes" ; then - cflags="-p $cflags" - ldflags="-p $ldflags" - fi - if test "$target_softmmu" = "yes" ; then - ldflags="-p $ldflags" - echo "GPROF_CFLAGS=-p" >> $config_target_mak - fi -fi - -# Newer kernels on s390 check for an S390_PGSTE program header and -# enable the pgste page table extensions in that case. This makes -# the vm.allocate_pgste sysctl unnecessary. We enable this program -# header if -# - we build on s390x -# - we build the system emulation for s390x (qemu-system-s390x) -# - KVM is enabled -# - the linker supports --s390-pgste -if test "$TARGET_ARCH" = "s390x" && test "$target_softmmu" = "yes" && \ - test "$ARCH" = "s390x" && test "$kvm" = "yes"; then - if ld_has --s390-pgste ; then - ldflags="-Wl,--s390-pgste $ldflags" - fi -fi - -echo "QEMU_LDFLAGS+=$ldflags" >> $config_target_mak -echo "QEMU_CFLAGS+=$cflags" >> $config_target_mak - done # for target in $targets echo "PIXMAN_CFLAGS=$pixman_cflags" >> $config_host_mak echo "PIXMAN_LIBS=$pixman_libs" >> $config_host_mak if [ "$fdt" = "git" ]; then - echo "config-host.h: dtc/all" >> $config_host_mak + subdirs="$subdirs dtc" fi if [ "$capstone" = "git" -o "$capstone" = "internal" ]; then - echo "config-host.h: capstone/all" >> $config_host_mak + subdirs="$subdirs capstone" fi +echo "SUBDIRS=$subdirs" >> $config_host_mak if test -n "$LIBCAPSTONE"; then echo "LIBCAPSTONE=$LIBCAPSTONE" >> $config_host_mak fi if test "$numa" = "yes"; then echo "CONFIG_NUMA=y" >> $config_host_mak + echo "NUMA_LIBS=$numa_libs" >> $config_host_mak fi if test "$ccache_cpp2" = "yes"; then @@ -8532,9 +8118,8 @@ DIRS="$DIRS docs docs/interop fsdev scsi" DIRS="$DIRS pc-bios/optionrom pc-bios/s390-ccw" DIRS="$DIRS roms/seabios" LINKS="Makefile" -LINKS="$LINKS tests/tcg/lm32/Makefile po/Makefile" -LINKS="$LINKS tests/tcg/Makefile.target tests/fp/Makefile" -LINKS="$LINKS tests/plugin/Makefile" +LINKS="$LINKS tests/tcg/lm32/Makefile" +LINKS="$LINKS tests/tcg/Makefile.target" LINKS="$LINKS pc-bios/optionrom/Makefile pc-bios/keymaps" LINKS="$LINKS pc-bios/s390-ccw/Makefile" LINKS="$LINKS roms/seabios/Makefile" @@ -8545,6 +8130,7 @@ LINKS="$LINKS tests/qemu-iotests/check" LINKS="$LINKS python" for bios_file in \ $source_path/pc-bios/*.bin \ + $source_path/pc-bios/*.elf \ $source_path/pc-bios/*.lid \ $source_path/pc-bios/*.rom \ $source_path/pc-bios/*.dtb \ @@ -8592,6 +8178,89 @@ echo "# Automatically generated by configure - do not modify" > "$iotests_common echo >> "$iotests_common_env" echo "export PYTHON='$python'" >> "$iotests_common_env" +if test "$skip_meson" = no; then +cross="config-meson.cross.new" +meson_quote() { + echo "['$(echo $* | sed "s/ /','/g")']" +} + +echo "# Automatically generated by configure - do not modify" > $cross +echo "[properties]" >> $cross +test -z "$cxx" && echo "link_language = 'c'" >> $cross +echo "[binaries]" >> $cross +echo "c = $(meson_quote $cc)" >> $cross +test -n "$cxx" && echo "cpp = $(meson_quote $cxx)" >> $cross +echo "ar = $(meson_quote $ar)" >> $cross +echo "nm = $(meson_quote $nm)" >> $cross +echo "pkgconfig = $(meson_quote $pkg_config_exe)" >> $cross +echo "ranlib = $(meson_quote $ranlib)" >> $cross +echo "strip = $(meson_quote $strip)" >> $cross +echo "windres = $(meson_quote $windres)" >> $cross +if test -n "$cross_prefix"; then + cross_arg="--cross-file config-meson.cross" + # Hack: Meson expects an absolute path for the *build* machine + # for the prefix, so add a slash in front of a Windows path that + # includes a drive letter. + # + # See https://github.com/mesonbuild/meson/issues/7577. + echo "[host_machine]" >> $cross + if test "$mingw32" = "yes" ; then + echo "system = 'windows'" >> $cross + case $prefix in + ?:*) pre_prefix=/ ;; + esac + fi + case "$ARCH" in + i386|x86_64) + echo "cpu_family = 'x86'" >> $cross + ;; + ppc64le) + echo "cpu_family = 'ppc64'" >> $cross + ;; + *) + echo "cpu_family = '$ARCH'" >> $cross + ;; + esac + echo "cpu = '$cpu'" >> $cross + if test "$bigendian" = "yes" ; then + echo "endian = 'big'" >> $cross + else + echo "endian = 'little'" >> $cross + fi +else + cross_arg="--native-file config-meson.cross" +fi +mv $cross config-meson.cross + +rm -rf meson-private meson-info meson-logs +NINJA=$PWD/ninjatool $meson setup \ + --prefix "${pre_prefix}$prefix" \ + --libdir "${pre_prefix}$libdir" \ + --libexecdir "${pre_prefix}$libexecdir" \ + --bindir "${pre_prefix}$bindir" \ + --includedir "${pre_prefix}$includedir" \ + --datadir "${pre_prefix}$datadir" \ + --mandir "${pre_prefix}$mandir" \ + --sysconfdir "${pre_prefix}$sysconfdir" \ + --localstatedir "${pre_prefix}$local_statedir" \ + -Doptimization=$(if test "$debug" = yes; then echo 0; else echo 2; fi) \ + -Ddebug=$(if test "$debug_info" = yes; then echo true; else echo false; fi) \ + -Dwerror=$(if test "$werror" = yes; then echo true; else echo false; fi) \ + -Dstrip=$(if test "$strip_opt" = yes; then echo true; else echo false; fi) \ + -Db_pie=$(if test "$pie" = yes; then echo true; else echo false; fi) \ + -Db_coverage=$(if test "$gcov" = yes; then echo true; else echo false; fi) \ + -Dsdl=$sdl -Dsdl_image=$sdl_image \ + -Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png \ + -Dgettext=$gettext \ + $cross_arg \ + "$PWD" "$source_path" + +if test "$?" -ne 0 ; then + error_exit "meson setup failed" +fi +touch ninjatool.stamp +fi + # Save the configure command line for later reuse. cat <<EOD >config.status #!/bin/sh @@ -8640,7 +8309,9 @@ preserve_env STRIP preserve_env WINDRES printf "exec" >>config.status -printf " '%s'" "$0" "$@" >>config.status +for i in "$0" "$@"; do + test "$i" = --skip-meson || printf " '%s'" "$i" >>config.status +done echo ' "$@"' >>config.status chmod +x config.status diff --git a/contrib/elf2dmp/Makefile.objs b/contrib/elf2dmp/Makefile.objs deleted file mode 100644 index 1505716916..0000000000 --- a/contrib/elf2dmp/Makefile.objs +++ /dev/null @@ -1,4 +0,0 @@ -elf2dmp-obj-y = main.o addrspace.o download.o pdb.o qemu_elf.o - -download.o-cflags := $(CURL_CFLAGS) -download.o-libs := $(CURL_LIBS) diff --git a/contrib/elf2dmp/meson.build b/contrib/elf2dmp/meson.build new file mode 100644 index 0000000000..b3de173316 --- /dev/null +++ b/contrib/elf2dmp/meson.build @@ -0,0 +1,5 @@ +if 'CONFIG_CURL' in config_host + executable('elf2dmp', files('main.c', 'addrspace.c', 'download.c', 'pdb.c', 'qemu_elf.c'), + dependencies: [glib, curl], + install: true) +endif diff --git a/contrib/gitdm/filetypes.txt b/contrib/gitdm/filetypes.txt index 2d5002fea0..9e9c505205 100644 --- a/contrib/gitdm/filetypes.txt +++ b/contrib/gitdm/filetypes.txt @@ -42,7 +42,7 @@ order build,interface,tests,code,documentation,devel-doc,blobs # (most common languages first # filetype code \.c$ # C -filetype code \.inc.c$ # C +filetype code \.c.inc$ # C filetype code \.C$ # C++ filetype code \.cpp$ # C++ filetype code \.c\+\+$ # C++ diff --git a/contrib/ivshmem-client/Makefile.objs b/contrib/ivshmem-client/Makefile.objs deleted file mode 100644 index bfab2d20dd..0000000000 --- a/contrib/ivshmem-client/Makefile.objs +++ /dev/null @@ -1 +0,0 @@ -ivshmem-client-obj-y = ivshmem-client.o main.o diff --git a/contrib/ivshmem-client/meson.build b/contrib/ivshmem-client/meson.build new file mode 100644 index 0000000000..1b171efb4f --- /dev/null +++ b/contrib/ivshmem-client/meson.build @@ -0,0 +1,4 @@ +executable('ivshmem-client', files('ivshmem-client.c', 'main.c'), + dependencies: glib, + build_by_default: targetos == 'linux', + install: false) diff --git a/contrib/ivshmem-server/Makefile.objs b/contrib/ivshmem-server/Makefile.objs deleted file mode 100644 index c060dd3698..0000000000 --- a/contrib/ivshmem-server/Makefile.objs +++ /dev/null @@ -1 +0,0 @@ -ivshmem-server-obj-y = ivshmem-server.o main.o diff --git a/contrib/ivshmem-server/meson.build b/contrib/ivshmem-server/meson.build new file mode 100644 index 0000000000..3a53942201 --- /dev/null +++ b/contrib/ivshmem-server/meson.build @@ -0,0 +1,4 @@ +executable('ivshmem-server', files('ivshmem-server.c', 'main.c'), + dependencies: [qemuutil, rt], + build_by_default: targetos == 'linux', + install: false) diff --git a/contrib/libvhost-user/Makefile.objs b/contrib/libvhost-user/Makefile.objs deleted file mode 100644 index ef3778edd4..0000000000 --- a/contrib/libvhost-user/Makefile.objs +++ /dev/null @@ -1 +0,0 @@ -libvhost-user-obj-y += libvhost-user.o libvhost-user-glib.o diff --git a/contrib/libvhost-user/meson.build b/contrib/libvhost-user/meson.build new file mode 100644 index 0000000000..e68dd1a581 --- /dev/null +++ b/contrib/libvhost-user/meson.build @@ -0,0 +1,3 @@ +libvhost_user = static_library('vhost-user', + files('libvhost-user.c', 'libvhost-user-glib.c'), + build_by_default: false) diff --git a/contrib/rdmacm-mux/Makefile.objs b/contrib/rdmacm-mux/Makefile.objs deleted file mode 100644 index 3df744af89..0000000000 --- a/contrib/rdmacm-mux/Makefile.objs +++ /dev/null @@ -1,3 +0,0 @@ -ifdef CONFIG_PVRDMA -rdmacm-mux-obj-y = main.o -endif diff --git a/contrib/rdmacm-mux/meson.build b/contrib/rdmacm-mux/meson.build new file mode 100644 index 0000000000..6cc5016747 --- /dev/null +++ b/contrib/rdmacm-mux/meson.build @@ -0,0 +1,9 @@ +if 'CONFIG_PVRDMA' in config_host + # if not found, CONFIG_PVRDMA should not be set + # FIXME: broken on big endian architectures + libumad = cc.find_library('ibumad', required: true) + executable('rdmacm-mux', files('main.c'), + dependencies: [glib, libumad], + build_by_default: false, + install: false) +endif diff --git a/contrib/vhost-user-blk/Makefile.objs b/contrib/vhost-user-blk/Makefile.objs deleted file mode 100644 index 72e2cdc3ad..0000000000 --- a/contrib/vhost-user-blk/Makefile.objs +++ /dev/null @@ -1 +0,0 @@ -vhost-user-blk-obj-y = vhost-user-blk.o diff --git a/contrib/vhost-user-blk/meson.build b/contrib/vhost-user-blk/meson.build new file mode 100644 index 0000000000..5db8cc3fe2 --- /dev/null +++ b/contrib/vhost-user-blk/meson.build @@ -0,0 +1,6 @@ +# FIXME: broken on 32-bit architectures +executable('vhost-user-blk', files('vhost-user-blk.c'), + link_with: libvhost_user, + dependencies: qemuutil, + build_by_default: false, + install: false) diff --git a/contrib/vhost-user-gpu/Makefile.objs b/contrib/vhost-user-gpu/Makefile.objs deleted file mode 100644 index 09296091be..0000000000 --- a/contrib/vhost-user-gpu/Makefile.objs +++ /dev/null @@ -1,10 +0,0 @@ -vhost-user-gpu-obj-y = vhost-user-gpu.o virgl.o vugbm.o - -vhost-user-gpu.o-cflags := $(PIXMAN_CFLAGS) $(GBM_CFLAGS) -vhost-user-gpu.o-libs := $(PIXMAN_LIBS) - -virgl.o-cflags := $(VIRGL_CFLAGS) $(GBM_CFLAGS) -virgl.o-libs := $(VIRGL_LIBS) - -vugbm.o-cflags := $(GBM_CFLAGS) -vugbm.o-libs := $(GBM_LIBS) diff --git a/contrib/vhost-user-gpu/meson.build b/contrib/vhost-user-gpu/meson.build new file mode 100644 index 0000000000..6c1459f54a --- /dev/null +++ b/contrib/vhost-user-gpu/meson.build @@ -0,0 +1,13 @@ +if 'CONFIG_TOOLS' in config_host and 'CONFIG_VIRGL' in config_host \ + and 'CONFIG_GBM' in config_host and 'CONFIG_LINUX' in config_host + executable('vhost-user-gpu', files('vhost-user-gpu.c', 'virgl.c', 'vugbm.c'), + link_with: libvhost_user, + dependencies: [qemuutil, pixman, gbm, virgl], + install: true, + install_dir: get_option('libexecdir')) + + configure_file(input: '50-qemu-gpu.json.in', + output: '50-qemu-gpu.json', + configuration: config_host, + install_dir: config_host['qemu_datadir'] / 'vhost-user') +endif diff --git a/contrib/vhost-user-input/Makefile.objs b/contrib/vhost-user-input/Makefile.objs deleted file mode 100644 index b1fad90d51..0000000000 --- a/contrib/vhost-user-input/Makefile.objs +++ /dev/null @@ -1 +0,0 @@ -vhost-user-input-obj-y = main.o diff --git a/contrib/vhost-user-input/meson.build b/contrib/vhost-user-input/meson.build new file mode 100644 index 0000000000..1eeb1329d9 --- /dev/null +++ b/contrib/vhost-user-input/meson.build @@ -0,0 +1,5 @@ +executable('vhost-user-input', files('main.c'), + link_with: libvhost_user, + dependencies: qemuutil, + build_by_default: targetos == 'linux', + install: false) diff --git a/contrib/vhost-user-scsi/Makefile.objs b/contrib/vhost-user-scsi/Makefile.objs deleted file mode 100644 index e83a38a85b..0000000000 --- a/contrib/vhost-user-scsi/Makefile.objs +++ /dev/null @@ -1 +0,0 @@ -vhost-user-scsi-obj-y = vhost-user-scsi.o diff --git a/contrib/vhost-user-scsi/meson.build b/contrib/vhost-user-scsi/meson.build new file mode 100644 index 0000000000..257cbffc8e --- /dev/null +++ b/contrib/vhost-user-scsi/meson.build @@ -0,0 +1,7 @@ +if 'CONFIG_LIBISCSI' in config_host + executable('vhost-user-scsi', files('vhost-user-scsi.c'), + link_with: libvhost_user, + dependencies: [qemuutil, libiscsi], + build_by_default: targetos == 'linux', + install: false) +endif diff --git a/contrib/vhost-user-scsi/vhost-user-scsi.c b/contrib/vhost-user-scsi/vhost-user-scsi.c index 7a1db164c8..3c912384e9 100644 --- a/contrib/vhost-user-scsi/vhost-user-scsi.c +++ b/contrib/vhost-user-scsi/vhost-user-scsi.c @@ -12,7 +12,9 @@ #include "qemu/osdep.h" #include <iscsi/iscsi.h> +#define inline __attribute__((gnu_inline)) /* required for libiscsi v1.9.0 */ #include <iscsi/scsi-lowlevel.h> +#undef inline #include "contrib/libvhost-user/libvhost-user-glib.h" #include "standard-headers/linux/virtio_scsi.h" diff --git a/crypto/Makefile.objs b/crypto/Makefile.objs deleted file mode 100644 index f1965b1a68..0000000000 --- a/crypto/Makefile.objs +++ /dev/null @@ -1,43 +0,0 @@ -crypto-obj-y = init.o -crypto-obj-y += hash.o -crypto-obj-$(CONFIG_NETTLE) += hash-nettle.o -crypto-obj-$(if $(CONFIG_NETTLE),n,$(CONFIG_GCRYPT)) += hash-gcrypt.o -crypto-obj-$(if $(CONFIG_NETTLE),n,$(if $(CONFIG_GCRYPT),n,y)) += hash-glib.o -crypto-obj-y += hmac.o -crypto-obj-$(CONFIG_NETTLE) += hmac-nettle.o -crypto-obj-$(CONFIG_GCRYPT_HMAC) += hmac-gcrypt.o -crypto-obj-$(if $(CONFIG_NETTLE),n,$(if $(CONFIG_GCRYPT_HMAC),n,y)) += hmac-glib.o -crypto-obj-y += aes.o -crypto-obj-y += desrfb.o -crypto-obj-y += cipher.o -crypto-obj-$(CONFIG_AF_ALG) += afalg.o -crypto-obj-$(CONFIG_AF_ALG) += cipher-afalg.o -crypto-obj-$(CONFIG_AF_ALG) += hash-afalg.o -crypto-obj-$(CONFIG_GNUTLS) += tls-cipher-suites.o -crypto-obj-y += tlscreds.o -crypto-obj-y += tlscredsanon.o -crypto-obj-y += tlscredspsk.o -crypto-obj-y += tlscredsx509.o -crypto-obj-y += tlssession.o -crypto-obj-y += secret_common.o -crypto-obj-y += secret.o -crypto-obj-$(CONFIG_SECRET_KEYRING) += secret_keyring.o -crypto-obj-y += pbkdf.o -crypto-obj-$(CONFIG_NETTLE) += pbkdf-nettle.o -crypto-obj-$(if $(CONFIG_NETTLE),n,$(CONFIG_GCRYPT)) += pbkdf-gcrypt.o -crypto-obj-$(if $(CONFIG_NETTLE),n,$(if $(CONFIG_GCRYPT),n,y)) += pbkdf-stub.o -crypto-obj-y += ivgen.o -crypto-obj-y += ivgen-essiv.o -crypto-obj-y += ivgen-plain.o -crypto-obj-y += ivgen-plain64.o -crypto-obj-y += afsplit.o -crypto-obj-$(CONFIG_QEMU_PRIVATE_XTS) += xts.o -crypto-obj-y += block.o -crypto-obj-y += block-qcow.o -crypto-obj-y += block-luks.o - -util-obj-$(CONFIG_GCRYPT) += random-gcrypt.o -util-obj-$(if $(CONFIG_GCRYPT),n,$(CONFIG_GNUTLS)) += random-gnutls.o -util-obj-$(if $(CONFIG_GCRYPT),n,$(if $(CONFIG_GNUTLS),n,$(CONFIG_RNG_NONE))) += random-none.o -util-obj-$(if $(CONFIG_GCRYPT),n,$(if $(CONFIG_GNUTLS),n,$(if $(CONFIG_RNG_NONE),n,y))) += random-platform.o -util-obj-y += aes.o init.o diff --git a/crypto/meson.build b/crypto/meson.build new file mode 100644 index 0000000000..18da7c8541 --- /dev/null +++ b/crypto/meson.build @@ -0,0 +1,63 @@ +crypto_ss = ss.source_set() +crypto_ss.add(genh) +crypto_ss.add(files( + 'afsplit.c', + 'block-luks.c', + 'block-qcow.c', + 'block.c', + 'cipher.c', + 'desrfb.c', + 'hash.c', + 'hmac.c', + 'ivgen-essiv.c', + 'ivgen-plain.c', + 'ivgen-plain64.c', + 'ivgen.c', + 'pbkdf.c', + 'secret_common.c', + 'secret.c', + 'tlscreds.c', + 'tlscredsanon.c', + 'tlscredspsk.c', + 'tlscredsx509.c', + 'tlssession.c', +)) + +if 'CONFIG_GCRYPT' in config_host + wo_nettle = files('hash-gcrypt.c', 'pbkdf-gcrypt.c') +else + wo_nettle = files('hash-glib.c', 'pbkdf-stub.c') +endif +if 'CONFIG_GCRYPT_HMAC' not in config_host + wo_nettle += files('hmac-glib.c') +endif +crypto_ss.add(when: [nettle, 'CONFIG_NETTLE'], + if_true: files('hash-nettle.c', 'hmac-nettle.c', 'pbkdf-nettle.c'), + if_false: wo_nettle) + +crypto_ss.add(when: 'CONFIG_SECRET_KEYRING', if_true: files('secret_keyring.c')) +crypto_ss.add(when: 'CONFIG_QEMU_PRIVATE_XTS', if_true: files('xts.c')) +crypto_ss.add(when: 'CONFIG_GCRYPT_HMAC', if_true: files('hmac-gcrypt.c')) +crypto_ss.add(when: 'CONFIG_AF_ALG', if_true: files('afalg.c', 'cipher-afalg.c', 'hash-afalg.c')) +crypto_ss.add(when: 'CONFIG_GNUTLS', if_true: files('tls-cipher-suites.c')) + +crypto_ss = crypto_ss.apply(config_host, strict: false) +libcrypto = static_library('crypto', crypto_ss.sources() + genh, + dependencies: [crypto_ss.dependencies()], + name_suffix: 'fa', + build_by_default: false) + +crypto = declare_dependency(link_whole: libcrypto, + dependencies: [authz, qom]) + +util_ss.add(files('aes.c')) +util_ss.add(files('init.c')) +if 'CONFIG_GCRYPT' in config_host + util_ss.add(files('random-gcrypt.c')) +elif 'CONFIG_GNUTLS' in config_host + util_ss.add(files('random-gnutls.c'), gnutls) +elif 'CONFIG_RNG_NONE' in config_host + util_ss.add(files('random-none.c')) +else + util_ss.add(files('random-platform.c')) +endif diff --git a/crypto/trace.h b/crypto/trace.h new file mode 100644 index 0000000000..a9af0f315c --- /dev/null +++ b/crypto/trace.h @@ -0,0 +1 @@ +#include "trace/trace-crypto.h" diff --git a/disas/Makefile.objs b/disas/Makefile.objs deleted file mode 100644 index 3c1cdce026..0000000000 --- a/disas/Makefile.objs +++ /dev/null @@ -1,30 +0,0 @@ - -common-obj-$(CONFIG_ALPHA_DIS) += alpha.o -common-obj-$(CONFIG_ARM_DIS) += arm.o -common-obj-$(CONFIG_ARM_A64_DIS) += arm-a64.o -common-obj-$(CONFIG_ARM_A64_DIS) += libvixl/ -libvixldir = $(SRC_PATH)/disas/libvixl -# The -Wno-sign-compare is needed only for gcc 4.6, which complains about -# some signed-unsigned equality comparisons in libvixl which later gcc -# versions do not. -arm-a64.o-cflags := -I$(libvixldir) -Wno-sign-compare -common-obj-$(CONFIG_CRIS_DIS) += cris.o -common-obj-$(CONFIG_HPPA_DIS) += hppa.o -common-obj-$(CONFIG_I386_DIS) += i386.o -common-obj-$(CONFIG_M68K_DIS) += m68k.o -common-obj-$(CONFIG_MICROBLAZE_DIS) += microblaze.o -common-obj-$(CONFIG_MIPS_DIS) += mips.o -common-obj-$(CONFIG_NANOMIPS_DIS) += nanomips.o -common-obj-$(CONFIG_NIOS2_DIS) += nios2.o -common-obj-$(CONFIG_MOXIE_DIS) += moxie.o -common-obj-$(CONFIG_PPC_DIS) += ppc.o -common-obj-$(CONFIG_RISCV_DIS) += riscv.o -common-obj-$(CONFIG_S390_DIS) += s390.o -common-obj-$(CONFIG_SH4_DIS) += sh4.o -common-obj-$(CONFIG_SPARC_DIS) += sparc.o -common-obj-$(CONFIG_LM32_DIS) += lm32.o -common-obj-$(CONFIG_XTENSA_DIS) += xtensa.o - -# TODO: As long as the TCG interpreter and its generated code depend -# on the QEMU target, we cannot compile the disassembler here. -#common-obj-$(CONFIG_TCI_DIS) += tci.o diff --git a/disas/libvixl/Makefile.objs b/disas/libvixl/Makefile.objs deleted file mode 100644 index 99a637f6a0..0000000000 --- a/disas/libvixl/Makefile.objs +++ /dev/null @@ -1,5 +0,0 @@ -common-obj-$(CONFIG_ARM_A64_DIS) = vixl/utils.o \ - vixl/compiler-intrinsics.o \ - vixl/a64/instructions-a64.o \ - vixl/a64/decoder-a64.o \ - vixl/a64/disasm-a64.o diff --git a/disas/libvixl/meson.build b/disas/libvixl/meson.build new file mode 100644 index 0000000000..5e2eb33e8e --- /dev/null +++ b/disas/libvixl/meson.build @@ -0,0 +1,7 @@ +libvixl_ss.add(files( + 'vixl/a64/decoder-a64.cc', + 'vixl/a64/disasm-a64.cc', + 'vixl/a64/instructions-a64.cc', + 'vixl/compiler-intrinsics.cc', + 'vixl/utils.cc', +)) diff --git a/disas/meson.build b/disas/meson.build new file mode 100644 index 0000000000..0527d69128 --- /dev/null +++ b/disas/meson.build @@ -0,0 +1,27 @@ +libvixl_ss = ss.source_set() +subdir('libvixl') + +common_ss.add(when: 'CONFIG_ALPHA_DIS', if_true: files('alpha.c')) +common_ss.add(when: 'CONFIG_ARM_A64_DIS', if_true: files('arm-a64.cc')) +common_ss.add_all(when: 'CONFIG_ARM_A64_DIS', if_true: libvixl_ss) +common_ss.add(when: 'CONFIG_ARM_DIS', if_true: files('arm.c')) +common_ss.add(when: 'CONFIG_CRIS_DIS', if_true: files('cris.c')) +common_ss.add(when: 'CONFIG_HPPA_DIS', if_true: files('hppa.c')) +common_ss.add(when: 'CONFIG_I386_DIS', if_true: files('i386.c')) +common_ss.add(when: 'CONFIG_LM32_DIS', if_true: files('lm32.c')) +common_ss.add(when: 'CONFIG_M68K_DIS', if_true: files('m68k.c')) +common_ss.add(when: 'CONFIG_MICROBLAZE_DIS', if_true: files('microblaze.c')) +common_ss.add(when: 'CONFIG_MIPS_DIS', if_true: files('mips.c')) +common_ss.add(when: 'CONFIG_MOXIE_DIS', if_true: files('moxie.c')) +common_ss.add(when: 'CONFIG_NANOMIPS_DIS', if_true: files('nanomips.cpp')) +common_ss.add(when: 'CONFIG_NIOS2_DIS', if_true: files('nios2.c')) +common_ss.add(when: 'CONFIG_PPC_DIS', if_true: files('ppc.c')) +common_ss.add(when: 'CONFIG_RISCV_DIS', if_true: files('riscv.c')) +common_ss.add(when: 'CONFIG_S390_DIS', if_true: files('s390.c')) +common_ss.add(when: 'CONFIG_SH4_DIS', if_true: files('sh4.c')) +common_ss.add(when: 'CONFIG_SPARC_DIS', if_true: files('sparc.c')) +common_ss.add(when: 'CONFIG_XTENSA_DIS', if_true: files('xtensa.c')) + +# TODO: As long as the TCG interpreter and its generated code depend +# on the QEMU target, we cannot compile the disassembler here. +#common_ss.add(when: 'CONFIG_TCI_DIS', if_true: files('tci.c')) diff --git a/dma-helpers.c b/dma-helpers.c index 2a77b5a9cb..41ef24a63b 100644 --- a/dma-helpers.c +++ b/dma-helpers.c @@ -10,7 +10,7 @@ #include "qemu/osdep.h" #include "sysemu/block-backend.h" #include "sysemu/dma.h" -#include "trace-root.h" +#include "trace/trace-root.h" #include "qemu/thread.h" #include "qemu/main-loop.h" #include "sysemu/cpus.h" diff --git a/docs/conf.py b/docs/conf.py index d6e173ef77..0dbd90dc11 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -67,7 +67,7 @@ needs_sphinx = '1.6' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = ['kerneldoc', 'qmp_lexer', 'hxtool'] +extensions = ['kerneldoc', 'qmp_lexer', 'hxtool', 'depfile'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff --git a/docs/devel/blkverify.txt b/docs/devel/blkverify.txt index d556dc4e6d..aca826c51c 100644 --- a/docs/devel/blkverify.txt +++ b/docs/devel/blkverify.txt @@ -62,8 +62,8 @@ A more realistic scenario is verifying the installation of a guest OS: $ ./qemu-img create raw.img 16G $ ./qemu-img create -f qcow2 test.qcow2 16G - $ x86_64-softmmu/qemu-system-x86_64 -cdrom debian.iso \ - -drive file=blkverify:raw.img:test.qcow2 + $ ./qemu-system-x86_64 -cdrom debian.iso \ + -drive file=blkverify:raw.img:test.qcow2 If the installation is aborted when blkverify detects corruption, use qemu-io to explore the contents of the disk image at the sector in question. diff --git a/docs/devel/build-system.rst b/docs/devel/build-system.rst new file mode 100644 index 0000000000..58bf392430 --- /dev/null +++ b/docs/devel/build-system.rst @@ -0,0 +1,500 @@ +================================== +The QEMU build system architecture +================================== + +This document aims to help developers understand the architecture of the +QEMU build system. As with projects using GNU autotools, the QEMU build +system has two stages, first the developer runs the "configure" script +to determine the local build environment characteristics, then they run +"make" to build the project. There is about where the similarities with +GNU autotools end, so try to forget what you know about them. + + +Stage 1: configure +================== + +The QEMU configure script is written directly in shell, and should be +compatible with any POSIX shell, hence it uses #!/bin/sh. An important +implication of this is that it is important to avoid using bash-isms on +development platforms where bash is the primary host. + +In contrast to autoconf scripts, QEMU's configure is expected to be +silent while it is checking for features. It will only display output +when an error occurs, or to show the final feature enablement summary +on completion. + +Because QEMU uses the Meson build system under the hood, only VPATH +builds are supported. There are two general ways to invoke configure & +perform a build: + + - VPATH, build artifacts outside of QEMU source tree entirely:: + + cd ../ + mkdir build + cd build + ../qemu/configure + make + + - VPATH, build artifacts in a subdir of QEMU source tree:: + + mkdir build + cd build + ../configure + make + +For now, checks on the compilation environment are found in configure +rather than meson.build, though this is expected to change. The command +line is parsed in the configure script and, whenever needed, converted +into the appropriate options to Meson. + +New checks should be added to Meson, which usually comprises the +following tasks: + + - Add a Meson build option to meson_options.txt. + + - Add support to the command line arg parser to handle any new + `--enable-XXX`/`--disable-XXX` flags required by the feature. + + - Add information to the help output message to report on the new + feature flag. + + - Add code to perform the actual feature check. + + - Add code to include the feature status in `config-host.h` + + - Add code to print out the feature status in the configure summary + upon completion. + + +Taking the probe for SDL as an example, we have the following pieces +in configure:: + + # Initial variable state + sdl=auto + + ..snip.. + + # Configure flag processing + --disable-gnutls) sdl=disabled + ;; + --enable-gnutls) sdl=enabled + ;; + + ..snip.. + + # Help output feature message + sdl SDL UI + + ..snip.. + + # Meson invocation + -Dsdl=$sdl + +In meson_options.txt:: + + option('sdl', type : 'feature', value : 'auto') + +In meson.build:: + + # Detect dependency + sdl = dependency('sdl2', + required: get_option('sdl'), + static: enable_static) + + # Create config-host.h + config_host_data.set('CONFIG_SDL', sdl.found()) + + # Summary + summary_info += {'SDL support': sdl.found()} + + + +Helper functions +---------------- + +The configure script provides a variety of helper functions to assist +developers in checking for system features: + +`do_cc $ARGS...` + Attempt to run the system C compiler passing it $ARGS... + +`do_cxx $ARGS...` + Attempt to run the system C++ compiler passing it $ARGS... + +`compile_object $CFLAGS` + Attempt to compile a test program with the system C compiler using + $CFLAGS. The test program must have been previously written to a file + called $TMPC. + +`compile_prog $CFLAGS $LDFLAGS` + Attempt to compile a test program with the system C compiler using + $CFLAGS and link it with the system linker using $LDFLAGS. The test + program must have been previously written to a file called $TMPC. + +`has $COMMAND` + Determine if $COMMAND exists in the current environment, either as a + shell builtin, or executable binary, returning 0 on success. + +`path_of $COMMAND` + Return the fully qualified path of $COMMAND, printing it to stdout, + and returning 0 on success. + +`check_define $NAME` + Determine if the macro $NAME is defined by the system C compiler + +`check_include $NAME` + Determine if the include $NAME file is available to the system C + compiler + +`write_c_skeleton` + Write a minimal C program main() function to the temporary file + indicated by $TMPC + +`feature_not_found $NAME $REMEDY` + Print a message to stderr that the feature $NAME was not available + on the system, suggesting the user try $REMEDY to address the + problem. + +`error_exit $MESSAGE $MORE...` + Print $MESSAGE to stderr, followed by $MORE... and then exit from the + configure script with non-zero status + +`query_pkg_config $ARGS...` + Run pkg-config passing it $ARGS. If QEMU is doing a static build, + then --static will be automatically added to $ARGS + + +Stage 2: Meson +============== + +The Meson build system is currently used to describe the build +process for: + +1) executables, which include: + + - Tools - qemu-img, qemu-nbd, qga (guest agent), etc + + - System emulators - qemu-system-$ARCH + + - Userspace emulators - qemu-$ARCH + + - Some (but not all) unit tests + +2) documentation + +3) ROMs, which can be either installed as binary blobs or compiled + +4) other data files, such as icons or desktop files + +The source code is highly modularized, split across many files to +facilitate building of all of these components with as little duplicated +compilation as possible. The Meson "sourceset" functionality is used +to list the files and their dependency on various configuration +symbols. + +Various subsystems that are common to both tools and emulators have +their own sourceset, for example `block_ss` for the block device subsystem, +`chardev_ss` for the character device subsystem, etc. These sourcesets +are then turned into static libraries as follows:: + + libchardev = static_library('chardev', chardev_ss.sources(), + name_suffix: 'fa', + build_by_default: false) + + chardev = declare_dependency(link_whole: libchardev) + +The special `.fa` suffix is needed as long as unit tests are built with +the older Makefile infrastructure, and will go away later. + +Files linked into emulator targets there can be split into two distinct groups +of files, those which are independent of the QEMU emulation target and +those which are dependent on the QEMU emulation target. + +In the target-independent set lives various general purpose helper code, +such as error handling infrastructure, standard data structures, +platform portability wrapper functions, etc. This code can be compiled +once only and the .o files linked into all output binaries. +Target-independent code lives in the `common_ss`, `softmmu_ss` and +`user_ss` sourcesets. `common_ss` is linked into all emulators, `softmmu_ss` +only in system emulators, `user_ss` only in user-mode emulators. + +In the target-dependent set lives CPU emulation, device emulation and +much glue code. This sometimes also has to be compiled multiple times, +once for each target being built. + +All binaries link with a static library `libqemuutil.a`, which is then +linked to all the binaries. `libqemuutil.a` is built from several +sourcesets; most of them however host generated code, and the only two +of general interest are `util_ss` and `stub_ss`. + +The separation between these two is purely for documentation purposes. +`util_ss` contains generic utility files. Even though this code is only +linked in some binaries, sometimes it requires hooks only in some of +these and depend on other functions that are not fully implemented by +all QEMU binaries. `stub_ss` links dummy stubs that will only be linked +into the binary if the real implementation is not present. In a way, +the stubs can be thought of as a portable implementation of the weak +symbols concept. + +The following files concur in the definition of which files are linked +into each emulator: + +`default-configs/*.mak` + The files under default-configs/ control what emulated hardware is built + into each QEMU system and userspace emulator targets. They merely contain + a list of config variable definitions like the machines that should be + included. For example, default-configs/aarch64-softmmu.mak has:: + + include arm-softmmu.mak + CONFIG_XLNX_ZYNQMP_ARM=y + CONFIG_XLNX_VERSAL=y + +`*/Kconfig` + These files are processed together with `default-configs/*.mak` and + describe the dependencies between various features, subsystems and + device models. They are described in kconfig.rst. + +These files rarely need changing unless new devices / hardware need to +be enabled for a particular system/userspace emulation target + + +Support scripts +--------------- + +Meson has a special convention for invoking Python scripts: if their +first line is `#! /usr/bin/env python3` and the file is *not* executable, +find_program() arranges to invoke the script under the same Python +interpreter that was used to invoke Meson. This is the most common +and preferred way to invoke support scripts from Meson build files, +because it automatically uses the value of configure's --python= option. + +In case the script is not written in Python, use a `#! /usr/bin/env ...` +line and make the script executable. + +Scripts written in Python, where it is desirable to make the script +executable (for example for test scripts that developers may want to +invoke from the command line, such as tests/qapi-schema/test-qapi.py), +should be invoked through the `python` variable in meson.build. For +example:: + + test('QAPI schema regression tests', python, + args: files('test-qapi.py'), + env: test_env, suite: ['qapi-schema', 'qapi-frontend']) + +This is needed to obey the --python= option passed to the configure +script, which may point to something other than the first python3 +binary on the path. + + +Stage 3: makefiles +================== + +The use of GNU make is required with the QEMU build system. + +The output of Meson is a build.ninja file, which is used with the Ninja +build system. QEMU uses a different approach, where Makefile rules are +synthesized from the build.ninja file. The main Makefile includes these +rules and wraps them so that e.g. submodules are built before QEMU. +The resulting build system is largely non-recursive in nature, in +contrast to common practices seen with automake. + +Tests are also ran by the Makefile with the traditional `make check` +phony target. Meson test suites such as `unit` can be ran with `make +check-unit` too. It is also possible to run tests defined in meson.build +with `meson test`. + +The following text is only relevant for unit tests which still have to +be converted to Meson. + +All binaries should link to `libqemuutil.a`, e.g.: + + qemu-img$(EXESUF): qemu-img.o ..snip.. libqemuutil.a + +On Windows, all binaries have the suffix `.exe`, so all Makefile rules +which create binaries must include the $(EXESUF) variable on the binary +name. e.g. + + qemu-img$(EXESUF): qemu-img.o ..snip.. + +This expands to `.exe` on Windows, or an empty string on other platforms. + +Variable naming +--------------- + +The QEMU convention is to define variables to list different groups of +object files. These are named with the convention $PREFIX-obj-y. The +Meson `chardev` variable in the previous example corresponds to a +variable 'chardev-obj-y'. + +Likewise, tests that are executed by `make check-unit` are grouped into +a variable check-unit-y, like this: + + check-unit-y += tests/test-visitor-serialization$(EXESUF) + check-unit-y += tests/test-iov$(EXESUF) + check-unit-y += tests/test-bitmap$(EXESUF) + +When a test or object file which needs to be conditionally built based +on some characteristic of the host system, the configure script will +define a variable for the conditional. For example, on Windows it will +define $(CONFIG_POSIX) with a value of 'n' and $(CONFIG_WIN32) with a +value of 'y'. It is now possible to use the config variables when +listing object files. For example, + + check-unit-$(CONFIG_POSIX) += tests/test-vmstate$(EXESUF) + +On Windows this expands to + + check-unit-n += tests/vmstate.exe + +Since the `check-unit` target only runs tests included in `$(check-unit-y)`, +POSIX specific tests listed in `$(util-obj-n)` are ignored on the Windows +platform builds. + + +CFLAGS / LDFLAGS / LIBS handling +-------------------------------- + +There are many different binaries being built with differing purposes, +and some of them might even be 3rd party libraries pulled in via git +submodules. As such the use of the global CFLAGS variable is generally +avoided in QEMU, since it would apply to too many build targets. + +Flags that are needed by any QEMU code (i.e. everything *except* GIT +submodule projects) are put in $(QEMU_CFLAGS) variable. For linker +flags the $(LIBS) variable is sometimes used, but a couple of more +targeted variables are preferred. + +In addition to these variables, it is possible to provide cflags and +libs against individual source code files, by defining variables of the +form $FILENAME-cflags and $FILENAME-libs. For example, the test +test-crypto-tlscredsx509 needs to link to the libtasn1 library, +so tests/Makefile.include defines some variables: + + tests/crypto-tls-x509-helpers.o-cflags := $(TASN1_CFLAGS) + tests/crypto-tls-x509-helpers.o-libs := $(TASN1_LIBS) + +The scope is a little different between the two variables. The libs get +used when linking any target binary that includes the curl.o object +file, while the cflags get used when compiling the curl.c file only. + + +Important files for the build system +==================================== + +Statically defined files +------------------------ + +The following key files are statically defined in the source tree, with +the rules needed to build QEMU. Their behaviour is influenced by a +number of dynamically created files listed later. + +`Makefile` + The main entry point used when invoking make to build all the components + of QEMU. The default 'all' target will naturally result in the build of + every component. Makefile takes care of recursively building submodules + directly via a non-recursive set of rules. + +`*/meson.build` + The meson.build file in the root directory is the main entry point for the + Meson build system, and it coordinates the configuration and build of all + executables. Build rules for various subdirectories are included in + other meson.build files spread throughout the QEMU source tree. + +`rules.mak` + This file provides the generic helper rules for invoking build tools, in + particular the compiler and linker. + +`tests/Makefile.include` + Rules for building the unit tests. This file is included directly by the + top level Makefile, so anything defined in this file will influence the + entire build system. Care needs to be taken when writing rules for tests + to ensure they only apply to the unit test execution / build. + +`tests/docker/Makefile.include` + Rules for Docker tests. Like tests/Makefile, this file is included + directly by the top level Makefile, anything defined in this file will + influence the entire build system. + +`tests/vm/Makefile.include` + Rules for VM-based tests. Like tests/Makefile, this file is included + directly by the top level Makefile, anything defined in this file will + influence the entire build system. + +Dynamically created files +------------------------- + +The following files are generated dynamically by configure in order to +control the behaviour of the statically defined makefiles. This avoids +the need for QEMU makefiles to go through any pre-processing as seen +with autotools, where Makefile.am generates Makefile.in which generates +Makefile. + +Built by configure: + +`config-host.mak` + When configure has determined the characteristics of the build host it + will write a long list of variables to config-host.mak file. This + provides the various install directories, compiler / linker flags and a + variety of `CONFIG_*` variables related to optionally enabled features. + This is imported by the top level Makefile and meson.build in order to + tailor the build output. + + config-host.mak is also used as a dependency checking mechanism. If make + sees that the modification timestamp on configure is newer than that on + config-host.mak, then configure will be re-run. + + The variables defined here are those which are applicable to all QEMU + build outputs. Variables which are potentially different for each + emulator target are defined by the next file... + +`$TARGET-NAME/config-target.mak` + TARGET-NAME is the name of a system or userspace emulator, for example, + x86_64-softmmu denotes the system emulator for the x86_64 architecture. + This file contains the variables which need to vary on a per-target + basis. For example, it will indicate whether KVM or Xen are enabled for + the target and any other potential custom libraries needed for linking + the target. + + +Built by Meson: + +`${TARGET-NAME}-config-devices.mak` + TARGET-NAME is again the name of a system or userspace emulator. The + config-devices.mak file is automatically generated by make using the + scripts/make_device_config.sh program, feeding it the + default-configs/$TARGET-NAME file as input. + +`config-host.h`, `$TARGET-NAME/config-target.h`, `$TARGET-NAME/config-devices.h` + These files are used by source code to determine what features + are enabled. They are generated from the contents of the corresponding + `*.h` files using the scripts/create_config program. This extracts + relevant variables and formats them as C preprocessor macros. + +`build.ninja` + The build rules. + + +Built by Makefile: + +`Makefile.ninja` + A Makefile conversion of the build rules in build.ninja. The conversion + is straightforward and, were it necessary to debug the rules produced + by Meson, it should be enough to look at build.ninja. The conversion + is performed by scripts/ninjatool.py. + +`Makefile.mtest` + The Makefile definitions that let "make check" run tests defined in + meson.build. The rules are produced from Meson's JSON description of + tests (obtained with "meson introspect --tests") through the script + scripts/mtest2make.py. + + +Useful make targets +------------------- + +`help` + Print a help message for the most common build targets. + +`print-VAR` + Print the value of the variable VAR. Useful for debugging the build + system. diff --git a/docs/devel/build-system.txt b/docs/devel/build-system.txt deleted file mode 100644 index 41bd08ea3a..0000000000 --- a/docs/devel/build-system.txt +++ /dev/null @@ -1,519 +0,0 @@ - The QEMU build system architecture - ================================== - -This document aims to help developers understand the architecture of the -QEMU build system. As with projects using GNU autotools, the QEMU build -system has two stages, first the developer runs the "configure" script -to determine the local build environment characteristics, then they run -"make" to build the project. There is about where the similarities with -GNU autotools end, so try to forget what you know about them. - - -Stage 1: configure -================== - -The QEMU configure script is written directly in shell, and should be -compatible with any POSIX shell, hence it uses #!/bin/sh. An important -implication of this is that it is important to avoid using bash-isms on -development platforms where bash is the primary host. - -In contrast to autoconf scripts, QEMU's configure is expected to be -silent while it is checking for features. It will only display output -when an error occurs, or to show the final feature enablement summary -on completion. - -Adding new checks to the configure script usually comprises the -following tasks: - - - Initialize one or more variables with the default feature state. - - Ideally features should auto-detect whether they are present, - so try to avoid hardcoding the initial state to either enabled - or disabled, as that forces the user to pass a --enable-XXX - / --disable-XXX flag on every invocation of configure. - - - Add support to the command line arg parser to handle any new - --enable-XXX / --disable-XXX flags required by the feature XXX. - - - Add information to the help output message to report on the new - feature flag. - - - Add code to perform the actual feature check. As noted above, try to - be fully dynamic in checking enablement/disablement. - - - Add code to print out the feature status in the configure summary - upon completion. - - - Add any new makefile variables to $config_host_mak on completion. - - -Taking (a simplified version of) the probe for gnutls from configure, -we have the following pieces: - - # Initial variable state - gnutls="" - - ..snip.. - - # Configure flag processing - --disable-gnutls) gnutls="no" - ;; - --enable-gnutls) gnutls="yes" - ;; - - ..snip.. - - # Help output feature message - gnutls GNUTLS cryptography support - - ..snip.. - - # Test for gnutls - if test "$gnutls" != "no"; then - if ! $pkg_config --exists "gnutls"; then - gnutls_cflags=`$pkg_config --cflags gnutls` - gnutls_libs=`$pkg_config --libs gnutls` - libs_softmmu="$gnutls_libs $libs_softmmu" - libs_tools="$gnutls_libs $libs_tools" - QEMU_CFLAGS="$QEMU_CFLAGS $gnutls_cflags" - gnutls="yes" - elif test "$gnutls" = "yes"; then - feature_not_found "gnutls" "Install gnutls devel" - else - gnutls="no" - fi - fi - - ..snip.. - - # Completion feature summary - echo "GNUTLS support $gnutls" - - ..snip.. - - # Define make variables - if test "$gnutls" = "yes" ; then - echo "CONFIG_GNUTLS=y" >> $config_host_mak - fi - - -Helper functions ----------------- - -The configure script provides a variety of helper functions to assist -developers in checking for system features: - - - do_cc $ARGS... - - Attempt to run the system C compiler passing it $ARGS... - - - do_cxx $ARGS... - - Attempt to run the system C++ compiler passing it $ARGS... - - - compile_object $CFLAGS - - Attempt to compile a test program with the system C compiler using - $CFLAGS. The test program must have been previously written to a file - called $TMPC. - - - compile_prog $CFLAGS $LDFLAGS - - Attempt to compile a test program with the system C compiler using - $CFLAGS and link it with the system linker using $LDFLAGS. The test - program must have been previously written to a file called $TMPC. - - - has $COMMAND - - Determine if $COMMAND exists in the current environment, either as a - shell builtin, or executable binary, returning 0 on success. - - - path_of $COMMAND - - Return the fully qualified path of $COMMAND, printing it to stdout, - and returning 0 on success. - - - check_define $NAME - - Determine if the macro $NAME is defined by the system C compiler - - - check_include $NAME - - Determine if the include $NAME file is available to the system C - compiler - - - write_c_skeleton - - Write a minimal C program main() function to the temporary file - indicated by $TMPC - - - feature_not_found $NAME $REMEDY - - Print a message to stderr that the feature $NAME was not available - on the system, suggesting the user try $REMEDY to address the - problem. - - - error_exit $MESSAGE $MORE... - - Print $MESSAGE to stderr, followed by $MORE... and then exit from the - configure script with non-zero status - - - query_pkg_config $ARGS... - - Run pkg-config passing it $ARGS. If QEMU is doing a static build, - then --static will be automatically added to $ARGS - - -Stage 2: makefiles -================== - -The use of GNU make is required with the QEMU build system. - -Although the source code is spread across multiple subdirectories, the -build system should be considered largely non-recursive in nature, in -contrast to common practices seen with automake. There is some recursive -invocation of make, but this is related to the things being built, -rather than the source directory structure. - -QEMU currently supports both VPATH and non-VPATH builds, so there are -three general ways to invoke configure & perform a build. - - - VPATH, build artifacts outside of QEMU source tree entirely - - cd ../ - mkdir build - cd build - ../qemu/configure - make - - - VPATH, build artifacts in a subdir of QEMU source tree - - mkdir build - cd build - ../configure - make - - - non-VPATH, build artifacts everywhere - - ./configure - make - -The QEMU maintainers generally recommend that a VPATH build is used by -developers. Patches to QEMU are expected to ensure VPATH build still -works. - - -Module structure ----------------- - -There are a number of key outputs of the QEMU build system: - - - Tools - qemu-img, qemu-nbd, qga (guest agent), etc - - System emulators - qemu-system-$ARCH - - Userspace emulators - qemu-$ARCH - - Unit tests - -The source code is highly modularized, split across many files to -facilitate building of all of these components with as little duplicated -compilation as possible. There can be considered to be two distinct -groups of files, those which are independent of the QEMU emulation -target and those which are dependent on the QEMU emulation target. - -In the target-independent set lives various general purpose helper code, -such as error handling infrastructure, standard data structures, -platform portability wrapper functions, etc. This code can be compiled -once only and the .o files linked into all output binaries. - -In the target-dependent set lives CPU emulation, device emulation and -much glue code. This sometimes also has to be compiled multiple times, -once for each target being built. - -The utility code that is used by all binaries is built into a -static archive called libqemuutil.a, which is then linked to all the -binaries. In order to provide hooks that are only needed by some of the -binaries, code in libqemuutil.a may depend on other functions that are -not fully implemented by all QEMU binaries. Dummy stubs for all these -functions are also provided by this library, and will only be linked -into the binary if the real implementation is not present. In a way, -the stubs can be thought of as a portable implementation of the weak -symbols concept. - -All binaries should link to libqemuutil.a, e.g.: - - qemu-img$(EXESUF): qemu-img.o ..snip.. libqemuutil.a - - -Windows platform portability ----------------------------- - -On Windows, all binaries have the suffix '.exe', so all Makefile rules -which create binaries must include the $(EXESUF) variable on the binary -name. e.g. - - qemu-img$(EXESUF): qemu-img.o ..snip.. - -This expands to '.exe' on Windows, or '' on other platforms. - -A further complication for the system emulator binaries is that -two separate binaries need to be generated. - -The main binary (e.g. qemu-system-x86_64.exe) is linked against the -Windows console runtime subsystem. These are expected to be run from a -command prompt window, and so will print stderr to the console that -launched them. - -The second binary generated has a 'w' on the end of its name (e.g. -qemu-system-x86_64w.exe) and is linked against the Windows graphical -runtime subsystem. These are expected to be run directly from the -desktop and will open up a dedicated console window for stderr output. - -The Makefile.target will generate the binary for the graphical subsystem -first, and then use objcopy to relink it against the console subsystem -to generate the second binary. - - -Object variable naming ----------------------- - -The QEMU convention is to define variables to list different groups of -object files. These are named with the convention $PREFIX-obj-y. For -example the libqemuutil.a file will be linked with all objects listed -in a variable 'util-obj-y'. So, for example, util/Makefile.obj will -contain a set of definitions looking like - - util-obj-y += bitmap.o bitops.o hbitmap.o - util-obj-y += fifo8.o - util-obj-y += acl.o - util-obj-y += error.o qemu-error.o - -When there is an object file which needs to be conditionally built based -on some characteristic of the host system, the configure script will -define a variable for the conditional. For example, on Windows it will -define $(CONFIG_POSIX) with a value of 'n' and $(CONFIG_WIN32) with a -value of 'y'. It is now possible to use the config variables when -listing object files. For example, - - util-obj-$(CONFIG_WIN32) += oslib-win32.o qemu-thread-win32.o - util-obj-$(CONFIG_POSIX) += oslib-posix.o qemu-thread-posix.o - -On Windows this expands to - - util-obj-y += oslib-win32.o qemu-thread-win32.o - util-obj-n += oslib-posix.o qemu-thread-posix.o - -Since libqemutil.a links in $(util-obj-y), the POSIX specific files -listed against $(util-obj-n) are ignored on the Windows platform builds. - - -CFLAGS / LDFLAGS / LIBS handling --------------------------------- - -There are many different binaries being built with differing purposes, -and some of them might even be 3rd party libraries pulled in via git -submodules. As such the use of the global CFLAGS variable is generally -avoided in QEMU, since it would apply to too many build targets. - -Flags that are needed by any QEMU code (i.e. everything *except* GIT -submodule projects) are put in $(QEMU_CFLAGS) variable. For linker -flags the $(LIBS) variable is sometimes used, but a couple of more -targeted variables are preferred. $(libs_softmmu) is used for -libraries that must be linked to system emulator targets, $(LIBS_TOOLS) -is used for tools like qemu-img, qemu-nbd, etc and $(LIBS_QGA) is used -for the QEMU guest agent. There is currently no specific variable for -the userspace emulator targets as the global $(LIBS), or more targeted -variables shown below, are sufficient. - -In addition to these variables, it is possible to provide cflags and -libs against individual source code files, by defining variables of the -form $FILENAME-cflags and $FILENAME-libs. For example, the curl block -driver needs to link to the libcurl library, so block/Makefile defines -some variables: - - curl.o-cflags := $(CURL_CFLAGS) - curl.o-libs := $(CURL_LIBS) - -The scope is a little different between the two variables. The libs get -used when linking any target binary that includes the curl.o object -file, while the cflags get used when compiling the curl.c file only. - - -Statically defined files ------------------------- - -The following key files are statically defined in the source tree, with -the rules needed to build QEMU. Their behaviour is influenced by a -number of dynamically created files listed later. - -- Makefile - -The main entry point used when invoking make to build all the components -of QEMU. The default 'all' target will naturally result in the build of -every component. The various tools and helper binaries are built -directly via a non-recursive set of rules. - -Each system/userspace emulation target needs to have a slightly -different set of make rules / variables. Thus, make will be recursively -invoked for each of the emulation targets. - -The recursive invocation will end up processing the toplevel -Makefile.target file (more on that later). - - -- */Makefile.objs - -Since the source code is spread across multiple directories, the rules -for each file are similarly modularized. Thus each subdirectory -containing .c files will usually also contain a Makefile.objs file. -These files are not directly invoked by a recursive make, but instead -they are imported by the top level Makefile and/or Makefile.target - -Each Makefile.objs usually just declares a set of variables listing the -.o files that need building from the source files in the directory. They -will also define any custom linker or compiler flags. For example in -block/Makefile.objs - - block-obj-$(CONFIG_LIBISCSI) += iscsi.o - block-obj-$(CONFIG_CURL) += curl.o - - ..snip... - - iscsi.o-cflags := $(LIBISCSI_CFLAGS) - iscsi.o-libs := $(LIBISCSI_LIBS) - curl.o-cflags := $(CURL_CFLAGS) - curl.o-libs := $(CURL_LIBS) - -If there are any rules defined in the Makefile.objs file, they should -all use $(obj) as a prefix to the target, e.g. - - $(obj)/generated-tcg-tracers.h: $(obj)/generated-tcg-tracers.h-timestamp - - -- Makefile.target - -This file provides the entry point used to build each individual system -or userspace emulator target. Each enabled target has its own -subdirectory. For example if configure is run with the argument -'--target-list=x86_64-softmmu', then a sub-directory 'x86_64-softmmu' -will be created, containing a 'Makefile' which symlinks back to -Makefile.target - -So when the recursive '$(MAKE) -C x86_64-softmmu' is invoked, it ends up -using Makefile.target for the build rules. - - -- rules.mak - -This file provides the generic helper rules for invoking build tools, in -particular the compiler and linker. This also contains the magic (hairy) -'unnest-vars' function which is used to merge the variable definitions -from all Makefile.objs in the source tree down into the main Makefile -context. - - -- default-configs/*.mak - -The files under default-configs/ control what emulated hardware is built -into each QEMU system and userspace emulator targets. They merely contain -a list of config variable definitions like the machines that should be -included. For example, default-configs/aarch64-softmmu.mak has: - - include arm-softmmu.mak - CONFIG_XLNX_ZYNQMP_ARM=y - CONFIG_XLNX_VERSAL=y - -These files rarely need changing unless new devices / hardware need to -be enabled for a particular system/userspace emulation target - - -- tests/Makefile - -Rules for building the unit tests. This file is included directly by the -top level Makefile, so anything defined in this file will influence the -entire build system. Care needs to be taken when writing rules for tests -to ensure they only apply to the unit test execution / build. - -- tests/docker/Makefile.include - -Rules for Docker tests. Like tests/Makefile, this file is included -directly by the top level Makefile, anything defined in this file will -influence the entire build system. - -- po/Makefile - -Rules for building and installing the binary message catalogs from the -text .po file sources. This almost never needs changing for any reason. - - -Dynamically created files -------------------------- - -The following files are generated dynamically by configure in order to -control the behaviour of the statically defined makefiles. This avoids -the need for QEMU makefiles to go through any pre-processing as seen -with autotools, where Makefile.am generates Makefile.in which generates -Makefile. - - -- config-host.mak - -When configure has determined the characteristics of the build host it -will write a long list of variables to config-host.mak file. This -provides the various install directories, compiler / linker flags and a -variety of CONFIG_* variables related to optionally enabled features. -This is imported by the top level Makefile in order to tailor the build -output. - -The variables defined here are those which are applicable to all QEMU -build outputs. Variables which are potentially different for each -emulator target are defined by the next file... - -It is also used as a dependency checking mechanism. If make sees that -the modification timestamp on configure is newer than that on -config-host.mak, then configure will be re-run. - - -- config-host.h - -The config-host.h file is used by source code to determine what features -are enabled. It is generated from the contents of config-host.mak using -the scripts/create_config program. This extracts all the CONFIG_* variables, -most of the HOST_* variables and a few other misc variables from -config-host.mak, formatting them as C preprocessor macros. - - -- $TARGET-NAME/config-target.mak - -TARGET-NAME is the name of a system or userspace emulator, for example, -x86_64-softmmu denotes the system emulator for the x86_64 architecture. -This file contains the variables which need to vary on a per-target -basis. For example, it will indicate whether KVM or Xen are enabled for -the target and any other potential custom libraries needed for linking -the target. - - -- $TARGET-NAME/config-devices.mak - -TARGET-NAME is again the name of a system or userspace emulator. The -config-devices.mak file is automatically generated by make using the -scripts/make_device_config.sh program, feeding it the -default-configs/$TARGET-NAME file as input. - - -- $TARGET-NAME/Makefile - -This is the entrypoint used when make recurses to build a single system -or userspace emulator target. It is merely a symlink back to the -Makefile.target in the top level. - - -Useful make targets -=================== - -- help - - Print a help message for the most common build targets. - -- print-VAR - - Print the value of the variable VAR. Useful for debugging the build - system. diff --git a/docs/devel/index.rst b/docs/devel/index.rst index ae6eac7c9c..04773ce076 100644 --- a/docs/devel/index.rst +++ b/docs/devel/index.rst @@ -13,6 +13,7 @@ Contents: .. toctree:: :maxdepth: 2 + build-system kconfig loads-stores memory diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index c1ff24370b..196e3bc35e 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -164,13 +164,12 @@ instrumenting the tested code. To use it, configure QEMU with ``--enable-gcov`` option and build. Then run ``make check`` as usual. If you want to gather coverage information on a single test the ``make -clean-coverage`` target can be used to delete any existing coverage +clean-gcda`` target can be used to delete any existing coverage information before running a single test. You can generate a HTML coverage report by executing ``make -coverage-report`` which will create -./reports/coverage/coverage-report.html. If you want to create it -elsewhere simply execute ``make /foo/bar/baz/coverage-report.html``. +coverage-html`` which will create +``meson-logs/coveragereport/index.html``. Further analysis can be conducted by running the ``gcov`` command directly on the various .gcda output files. Please read the ``gcov`` @@ -820,7 +819,7 @@ the following approaches: 1) Set ``qemu_bin``, and use the given binary 2) Do not set ``qemu_bin``, and use a QEMU binary named like - "${arch}-softmmu/qemu-system-${arch}", either in the current + "qemu-system-${arch}", either in the current working directory, or in the current source tree. The resulting ``qemu_bin`` value will be preserved in the @@ -887,7 +886,7 @@ like the following: .. code:: - PARAMS (key=qemu_bin, path=*, default=x86_64-softmmu/qemu-system-x86_64) => 'x86_64-softmmu/qemu-system-x86_64 + PARAMS (key=qemu_bin, path=*, default=./qemu-system-x86_64) => './qemu-system-x86_64 arch ~~~~ diff --git a/docs/devel/tracing.txt b/docs/devel/tracing.txt index cb5f685de9..6144d9921b 100644 --- a/docs/devel/tracing.txt +++ b/docs/devel/tracing.txt @@ -60,7 +60,7 @@ general. It is strongly preferred that all events be declared directly in the sub-directory that uses them. The only exception is where there are some shared trace events defined in the top level directory trace-events file. The top level directory generates trace files with a filename prefix of -"trace-root" instead of just "trace". This is to avoid ambiguity between +"trace/trace-root" instead of just "trace". This is to avoid ambiguity between a trace.h in the current directory, vs the top level directory. === Using trace events === diff --git a/docs/index.html.in b/docs/index.html.in index 6736fa4360..ca28047881 100644 --- a/docs/index.html.in +++ b/docs/index.html.in @@ -2,10 +2,10 @@ <html lang="en"> <head> <meta charset="UTF-8"> - <title>QEMU @@VERSION@@ Documentation</title> + <title>QEMU @VERSION@ Documentation</title> </head> <body> - <h1>QEMU @@VERSION@@ Documentation</h1> + <h1>QEMU @VERSION@ Documentation</h1> <ul> <li><a href="system/index.html">System Emulation User's Guide</a></li> <li><a href="user/index.html">User Mode Emulation User's Guide</a></li> diff --git a/docs/interop/live-block-operations.rst b/docs/interop/live-block-operations.rst index 48afdc7927..e13f5a21f8 100644 --- a/docs/interop/live-block-operations.rst +++ b/docs/interop/live-block-operations.rst @@ -129,7 +129,7 @@ To show some example invocations of command-line, we will use the following invocation of QEMU, with a QMP server running over UNIX socket:: - $ ./x86_64-softmmu/qemu-system-x86_64 -display none -no-user-config \ + $ ./qemu-system-x86_64 -display none -no-user-config \ -M q35 -nodefaults -m 512 \ -blockdev node-name=node-A,driver=qcow2,file.driver=file,file.node-name=file,file.filename=./a.qcow2 \ -device virtio-blk,drive=node-A,id=virtio0 \ @@ -694,7 +694,7 @@ instance, with the following invocation. (As noted earlier, for simplicity's sake, the destination QEMU is started on the same host, but it could be located elsewhere):: - $ ./x86_64-softmmu/qemu-system-x86_64 -display none -no-user-config \ + $ ./qemu-system-x86_64 -display none -no-user-config \ -M q35 -nodefaults -m 512 \ -blockdev node-name=node-TargetDisk,driver=qcow2,file.driver=file,file.node-name=file,file.filename=./target-disk.qcow2 \ -device virtio-blk,drive=node-TargetDisk,id=virtio0 \ diff --git a/docs/interop/qemu-ga-ref.texi b/docs/interop/qemu-ga-ref.texi index ddb76ce1c2..a23cc2ed7f 100644 --- a/docs/interop/qemu-ga-ref.texi +++ b/docs/interop/qemu-ga-ref.texi @@ -65,7 +65,7 @@ along with this manual. If not, see http://www.gnu.org/licenses/. @c for texi2pod: @c man begin DESCRIPTION -@include qemu-ga-qapi.texi +@include qga/qga-qapi-doc.texi @c man end diff --git a/docs/interop/qemu-qmp-ref.texi b/docs/interop/qemu-qmp-ref.texi index bb25758bd0..ea1d7fe6c2 100644 --- a/docs/interop/qemu-qmp-ref.texi +++ b/docs/interop/qemu-qmp-ref.texi @@ -65,7 +65,7 @@ along with this manual. If not, see http://www.gnu.org/licenses/. @c for texi2pod: @c man begin DESCRIPTION -@include qemu-qmp-qapi.texi +@include qapi/qapi-doc.texi @c man end diff --git a/docs/meson.build b/docs/meson.build new file mode 100644 index 0000000000..8b059a8e39 --- /dev/null +++ b/docs/meson.build @@ -0,0 +1,73 @@ +SPHINX_ARGS = [config_host['SPHINX_BUILD'], + '-Dversion=' + meson.project_version(), + '-Drelease=' + config_host['PKGVERSION']] + +if get_option('werror') + SPHINX_ARGS += [ '-W' ] +endif + +if build_docs + configure_file(output: 'index.html', + input: files('index.html.in'), + configuration: {'VERSION': meson.project_version()}, + install_dir: config_host['qemu_docdir']) + manuals = [ 'devel', 'interop', 'tools', 'specs', 'system', 'user' ] + man_pages = { + 'interop' : { + 'qemu-ga.8': (have_tools ? 'man8' : ''), + }, + 'tools': { + 'qemu-img.1': (have_tools ? 'man1' : ''), + 'qemu-nbd.8': (have_tools ? 'man8' : ''), + 'qemu-trace-stap.1': (config_host.has_key('CONFIG_TRACE_SYSTEMTAP') ? 'man1' : ''), + 'virtfs-proxy-helper.1': (have_virtfs_proxy_helper ? 'man1' : ''), + 'virtiofsd.1': (have_virtiofsd ? 'man1' : ''), + }, + 'system': { + 'qemu.1': 'man1', + 'qemu-block-drivers.7': 'man7', + 'qemu-cpu-models.7': 'man7' + }, + } + + sphinxdocs = [] + sphinxmans = [] + foreach manual : manuals + private_dir = meson.current_build_dir() / (manual + '.p') + output_dir = meson.current_build_dir() / manual + input_dir = meson.current_source_dir() / manual + + this_manual = custom_target(manual + ' manual', + build_by_default: build_docs, + output: [manual + '.stamp'], + input: [files('conf.py'), files(manual / 'conf.py')], + depfile: manual + '.d', + command: [SPHINX_ARGS, '-Ddepfile=@DEPFILE@', + '-Ddepfile_stamp=@OUTPUT0@', + '-b', 'html', '-d', private_dir, + input_dir, output_dir]) + sphinxdocs += this_manual + if build_docs and manual != 'devel' + install_subdir(output_dir, install_dir: config_host['qemu_docdir']) + endif + + these_man_pages = [] + install_dirs = [] + foreach page, section : man_pages.get(manual, {}) + these_man_pages += page + install_dirs += section == '' ? false : get_option('mandir') / section + endforeach + if these_man_pages.length() > 0 + sphinxmans += custom_target(manual + ' man pages', + build_by_default: build_docs, + output: these_man_pages, + input: this_manual, + install: build_docs, + install_dir: install_dirs, + command: [SPHINX_ARGS, '-b', 'man', '-d', private_dir, + input_dir, meson.current_build_dir()]) + endif + endforeach + alias_target('sphinxdocs', sphinxdocs) + alias_target('man', sphinxmans) +endif diff --git a/docs/specs/index.rst b/docs/specs/index.rst index 426632a475..1b0eb979d5 100644 --- a/docs/specs/index.rst +++ b/docs/specs/index.rst @@ -12,6 +12,7 @@ Contents: ppc-xive ppc-spapr-xive + ppc-spapr-numa acpi_hw_reduced_hotplug tpm acpi_hest_ghes diff --git a/docs/specs/ppc-spapr-numa.rst b/docs/specs/ppc-spapr-numa.rst new file mode 100644 index 0000000000..e762038022 --- /dev/null +++ b/docs/specs/ppc-spapr-numa.rst @@ -0,0 +1,191 @@ + +NUMA mechanics for sPAPR (pseries machines) +============================================ + +NUMA in sPAPR works different than the System Locality Distance +Information Table (SLIT) in ACPI. The logic is explained in the LOPAPR +1.1 chapter 15, "Non Uniform Memory Access (NUMA) Option". This +document aims to complement this specification, providing details +of the elements that impacts how QEMU views NUMA in pseries. + +Associativity and ibm,associativity property +-------------------------------------------- + +Associativity is defined as a group of platform resources that has +similar mean performance (or in our context here, distance) relative to +everyone else outside of the group. + +The format of the ibm,associativity property varies with the value of +bit 0 of byte 5 of the ibm,architecture-vec-5 property. The format with +bit 0 equal to zero is deprecated. The current format, with the bit 0 +with the value of one, makes ibm,associativity property represent the +physical hierarchy of the platform, as one or more lists that starts +with the highest level grouping up to the smallest. Considering the +following topology: + +:: + + Mem M1 ---- Proc P1 | + ----------------- | Socket S1 ---| + chip C1 | | + | HW module 1 (MOD1) + Mem M2 ---- Proc P2 | | + ----------------- | Socket S2 ---| + chip C2 | + +The ibm,associativity property for the processors would be: + +* P1: {MOD1, S1, C1, P1} +* P2: {MOD1, S2, C2, P2} + +Each allocable resource has an ibm,associativity property. The LOPAPR +specification allows multiple lists to be present in this property, +considering that the same resource can have multiple connections to the +platform. + +Relative Performance Distance and ibm,associativity-reference-points +-------------------------------------------------------------------- + +The ibm,associativity-reference-points property is an array that is used +to define the relevant performance/distance related boundaries, defining +the NUMA levels for the platform. + +The definition of its elements also varies with the value of bit 0 of byte 5 +of the ibm,architecture-vec-5 property. The format with bit 0 equal to zero +is also deprecated. With the current format, each integer of the +ibm,associativity-reference-points represents an 1 based ordinal index (i.e. +the first element is 1) of the ibm,associativity array. The first +boundary is the most significant to application performance, followed by +less significant boundaries. Allocated resources that belongs to the +same performance boundaries are expected to have relative NUMA distance +that matches the relevancy of the boundary itself. Resources that belongs +to the same first boundary will have the shortest distance from each +other. Subsequent boundaries represents greater distances and degraded +performance. + +Using the previous example, the following setting reference points defines +three NUMA levels: + +* ibm,associativity-reference-points = {0x3, 0x2, 0x1} + +The first NUMA level (0x3) is interpreted as the third element of each +ibm,associativity array, the second level is the second element and +the third level is the first element. Let's also consider that elements +belonging to the first NUMA level have distance equal to 10 from each +other, and each NUMA level doubles the distance from the previous. This +means that the second would be 20 and the third level 40. For the P1 and +P2 processors, we would have the following NUMA levels: + +:: + + * ibm,associativity-reference-points = {0x3, 0x2, 0x1} + + * P1: associativity{MOD1, S1, C1, P1} + + First NUMA level (0x3) => associativity[2] = C1 + Second NUMA level (0x2) => associativity[1] = S1 + Third NUMA level (0x1) => associativity[0] = MOD1 + + * P2: associativity{MOD1, S2, C2, P2} + + First NUMA level (0x3) => associativity[2] = C2 + Second NUMA level (0x2) => associativity[1] = S2 + Third NUMA level (0x1) => associativity[0] = MOD1 + + P1 and P2 have the same third NUMA level, MOD1: Distance between them = 40 + +Changing the ibm,associativity-reference-points array changes the performance +distance attributes for the same associativity arrays, as the following +example illustrates: + +:: + + * ibm,associativity-reference-points = {0x2} + + * P1: associativity{MOD1, S1, C1, P1} + + First NUMA level (0x2) => associativity[1] = S1 + + * P2: associativity{MOD1, S2, C2, P2} + + First NUMA level (0x2) => associativity[1] = S2 + + P1 and P2 does not have a common performance boundary. Since this is a one level + NUMA configuration, distance between them is one boundary above the first + level, 20. + + +In a hypothetical platform where all resources inside the same hardware module +is considered to be on the same performance boundary: + +:: + + * ibm,associativity-reference-points = {0x1} + + * P1: associativity{MOD1, S1, C1, P1} + + First NUMA level (0x1) => associativity[0] = MOD0 + + * P2: associativity{MOD1, S2, C2, P2} + + First NUMA level (0x1) => associativity[0] = MOD0 + + P1 and P2 belongs to the same first order boundary. The distance between then + is 10. + + +How the pseries Linux guest calculates NUMA distances +===================================================== + +Another key difference between ACPI SLIT and the LOPAPR regarding NUMA is +how the distances are expressed. The SLIT table provides the NUMA distance +value between the relevant resources. LOPAPR does not provide a standard +way to calculate it. We have the ibm,associativity for each resource, which +provides a common-performance hierarchy, and the ibm,associativity-reference-points +array that tells which level of associativity is considered to be relevant +or not. + +The result is that each OS is free to implement and to interpret the distance +as it sees fit. For the pseries Linux guest, each level of NUMA duplicates +the distance of the previous level, and the maximum amount of levels is +limited to MAX_DISTANCE_REF_POINTS = 4 (from arch/powerpc/mm/numa.c in the +kernel tree). This results in the following distances: + +* both resources in the first NUMA level: 10 +* resources one NUMA level apart: 20 +* resources two NUMA levels apart: 40 +* resources three NUMA levels apart: 80 +* resources four NUMA levels apart: 160 + + +Consequences for QEMU NUMA tuning +--------------------------------- + +The way the pseries Linux guest calculates NUMA distances has a direct effect +on what QEMU users can expect when doing NUMA tuning. As of QEMU 5.1, this is +the default ibm,associativity-reference-points being used in the pseries +machine: + +ibm,associativity-reference-points = {0x4, 0x4, 0x2} + +The first and second level are equal, 0x4, and a third one was added in +commit a6030d7e0b35 exclusively for NVLink GPUs support. This means that +regardless of how the ibm,associativity properties are being created in +the device tree, the pseries Linux guest will only recognize three scenarios +as far as NUMA distance goes: + +* if the resources belongs to the same first NUMA level = 10 +* second level is skipped since it's equal to the first +* all resources that aren't a NVLink GPU, it is guaranteed that they will belong + to the same third NUMA level, having distance = 40 +* for NVLink GPUs, distance = 80 from everything else + +In short, we can summarize the NUMA distances seem in pseries Linux guests, using +QEMU up to 5.1, as follows: + +* local distance, i.e. the distance of the resource to its own NUMA node: 10 +* if it's a NVLink GPU device, distance: 80 +* every other resource, distance: 40 + +This also means that user input in QEMU command line does not change the +NUMA distancing inside the guest for the pseries machine. diff --git a/docs/specs/ppc-spapr-xive.rst b/docs/specs/ppc-spapr-xive.rst index 6159bc6eed..7144347560 100644 --- a/docs/specs/ppc-spapr-xive.rst +++ b/docs/specs/ppc-spapr-xive.rst @@ -61,6 +61,11 @@ depend on the XIVE KVM capability of the host. On older kernels without XIVE KVM support, QEMU will use the emulated XIVE device as a fallback and on newer kernels (>=5.2), the KVM XIVE device. +XIVE native exploitation mode is not supported for KVM nested guests, +VMs running under a L1 hypervisor (KVM on pSeries). In that case, the +hypervisor will not advertise the KVM capability and QEMU will use the +emulated XIVE device, same as for older versions of KVM. + As a final refinement, the user can also switch the use of the KVM device with the machine option ``kernel_irqchip``. @@ -121,6 +126,9 @@ xics XICS KVM XICS emul. XICS KVM (1) QEMU warns with ``warning: kernel_irqchip requested but unavailable: IRQ_XIVE capability must be present for KVM`` + In some cases (old host kernels or KVM nested guests), one may hit a + QEMU/KVM incompatibility due to device destruction in reset. QEMU fails + with ``KVM is incompatible with ic-mode=dual,kernel-irqchip=on`` (2) QEMU fails with ``kernel_irqchip requested but unavailable: IRQ_XIVE capability must be present for KVM`` @@ -143,7 +151,7 @@ xics XICS KVM XICS emul. XICS KVM mode (XICS), either don't set the ic-mode machine property or try ic-mode=xics or ic-mode=dual`` (4) QEMU/KVM incompatibility due to device destruction in reset. QEMU fails - with ``KVM is too old to support ic-mode=dual,kernel-irqchip=on`` + with ``KVM is incompatible with ic-mode=dual,kernel-irqchip=on`` XIVE Device tree properties diff --git a/docs/sphinx/depfile.py b/docs/sphinx/depfile.py new file mode 100644 index 0000000000..277fdf0f56 --- /dev/null +++ b/docs/sphinx/depfile.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# +# QEMU depfile generation extension +# +# Copyright (c) 2020 Red Hat, Inc. +# +# This work is licensed under the terms of the GNU GPLv2 or later. +# See the COPYING file in the top-level directory. + +"""depfile is a Sphinx extension that writes a dependency file for + an external build system""" + +import os +import sphinx + +__version__ = '1.0' + +def get_infiles(env): + for x in env.found_docs: + yield env.doc2path(x) + yield from ((os.path.join(env.srcdir, dep) + for dep in env.dependencies[x])) + +def write_depfile(app, env): + if not env.config.depfile: + return + + # Using a directory as the output file does not work great because + # its timestamp does not necessarily change when the contents change. + # So create a timestamp file. + if env.config.depfile_stamp: + with open(env.config.depfile_stamp, 'w') as f: + pass + + with open(env.config.depfile, 'w') as f: + print((env.config.depfile_stamp or app.outdir) + ": \\", file=f) + print(*get_infiles(env), file=f) + for x in get_infiles(env): + print(x + ":", file=f) + + +def setup(app): + app.add_config_value('depfile', None, 'env') + app.add_config_value('depfile_stamp', None, 'env') + app.connect('env-updated', write_depfile) + + return dict( + version = __version__, + parallel_read_safe = True, + parallel_write_safe = True + ) diff --git a/docs/system/arm/xlnx-versal-virt.rst b/docs/system/arm/xlnx-versal-virt.rst new file mode 100644 index 0000000000..2602d0f995 --- /dev/null +++ b/docs/system/arm/xlnx-versal-virt.rst @@ -0,0 +1,176 @@ +Xilinx Versal Virt (``xlnx-versal-virt``) +========================================= + +Xilinx Versal is a family of heterogeneous multi-core SoCs +(System on Chip) that combine traditional hardened CPUs and I/O +peripherals in a Processing System (PS) with runtime programmable +FPGA logic (PL) and an Artificial Intelligence Engine (AIE). + +More details here: +https://www.xilinx.com/products/silicon-devices/acap/versal.html + +The family of Versal SoCs share a single architecture but come in +different parts with different speed grades, amounts of PL and +other differences. + +The Xilinx Versal Virt board in QEMU is a model of a virtual board +(does not exist in reality) with a virtual Versal SoC without I/O +limitations. Currently, we support the following cores and devices: + +Implemented CPU cores: + +- 2 ACPUs (ARM Cortex-A72) + +Implemented devices: + +- Interrupt controller (ARM GICv3) +- 2 UARTs (ARM PL011) +- An RTC (Versal built-in) +- 2 GEMs (Cadence MACB Ethernet MACs) +- 8 ADMA (Xilinx zDMA) channels +- 2 SD Controllers +- OCM (256KB of On Chip Memory) +- DDR memory + +QEMU does not yet model any other devices, including the PL and the AI Engine. + +Other differences between the hardware and the QEMU model: + +- QEMU allows the amount of DDR memory provided to be specified with the + ``-m`` argument. If a DTB is provided on the command line then QEMU will + edit it to include suitable entries describing the Versal DDR memory ranges. + +- QEMU provides 8 virtio-mmio virtio transports; these start at + address ``0xa0000000`` and have IRQs from 111 and upwards. + +Running +""""""" +If the user provides an Operating System to be loaded, we expect users +to use the ``-kernel`` command line option. + +Users can load firmware or boot-loaders with the ``-device loader`` options. + +When loading an OS, QEMU generates a DTB and selects an appropriate address +where it gets loaded. This DTB will be passed to the kernel in register x0. + +If there's no ``-kernel`` option, we generate a DTB and place it at 0x1000 +for boot-loaders or firmware to pick it up. + +If users want to provide their own DTB, they can use the ``-dtb`` option. +These DTBs will have their memory nodes modified to match QEMU's +selected ram_size option before they get passed to the kernel or FW. + +When loading an OS, we turn on QEMU's PSCI implementation with SMC +as the PSCI conduit. When there's no ``-kernel`` option, we assume the user +provides EL3 firmware to handle PSCI. + +A few examples: + +Direct Linux boot of a generic ARM64 upstream Linux kernel: + +.. code-block:: bash + + $ qemu-system-aarch64 -M xlnx-versal-virt -m 2G \ + -serial mon:stdio -display none \ + -kernel arch/arm64/boot/Image \ + -nic user -nic user \ + -device virtio-rng-device,bus=virtio-mmio-bus.0 \ + -drive if=none,index=0,file=hd0.qcow2,id=hd0,snapshot \ + -drive file=qemu_sd.qcow2,if=sd,index=0,snapshot \ + -device virtio-blk-device,drive=hd0 -append root=/dev/vda + +Direct Linux boot of PetaLinux 2019.2: + +.. code-block:: bash + + $ qemu-system-aarch64 -M xlnx-versal-virt -m 2G \ + -serial mon:stdio -display none \ + -kernel petalinux-v2019.2/Image \ + -append "rdinit=/sbin/init console=ttyAMA0,115200n8 earlycon=pl011,mmio,0xFF000000,115200n8" \ + -net nic,model=cadence_gem,netdev=net0 -netdev user,id=net0 \ + -device virtio-rng-device,bus=virtio-mmio-bus.0,rng=rng0 \ + -object rng-random,filename=/dev/urandom,id=rng0 + +Boot PetaLinux 2019.2 via ARM Trusted Firmware (2018.3 because the 2019.2 +version of ATF tries to configure the CCI which we don't model) and U-boot: + +.. code-block:: bash + + $ qemu-system-aarch64 -M xlnx-versal-virt -m 2G \ + -serial stdio -display none \ + -device loader,file=petalinux-v2018.3/bl31.elf,cpu-num=0 \ + -device loader,file=petalinux-v2019.2/u-boot.elf \ + -device loader,addr=0x20000000,file=petalinux-v2019.2/Image \ + -nic user -nic user \ + -device virtio-rng-device,bus=virtio-mmio-bus.0,rng=rng0 \ + -object rng-random,filename=/dev/urandom,id=rng0 + +Run the following at the U-Boot prompt: + +.. code-block:: bash + + Versal> + fdt addr $fdtcontroladdr + fdt move $fdtcontroladdr 0x40000000 + fdt set /timer clock-frequency <0x3dfd240> + setenv bootargs "rdinit=/sbin/init maxcpus=1 console=ttyAMA0,115200n8 earlycon=pl011,mmio,0xFF000000,115200n8" + booti 20000000 - 40000000 + fdt addr $fdtcontroladdr + +Boot Linux as DOM0 on Xen via U-Boot: + +.. code-block:: bash + + $ qemu-system-aarch64 -M xlnx-versal-virt -m 4G \ + -serial stdio -display none \ + -device loader,file=petalinux-v2019.2/u-boot.elf,cpu-num=0 \ + -device loader,addr=0x30000000,file=linux/2018-04-24/xen \ + -device loader,addr=0x40000000,file=petalinux-v2019.2/Image \ + -nic user -nic user \ + -device virtio-rng-device,bus=virtio-mmio-bus.0,rng=rng0 \ + -object rng-random,filename=/dev/urandom,id=rng0 + +Run the following at the U-Boot prompt: + +.. code-block:: bash + + Versal> + fdt addr $fdtcontroladdr + fdt move $fdtcontroladdr 0x20000000 + fdt set /timer clock-frequency <0x3dfd240> + fdt set /chosen xen,xen-bootargs "console=dtuart dtuart=/uart@ff000000 dom0_mem=640M bootscrub=0 maxcpus=1 timer_slop=0" + fdt set /chosen xen,dom0-bootargs "rdinit=/sbin/init clk_ignore_unused console=hvc0 maxcpus=1" + fdt mknode /chosen dom0 + fdt set /chosen/dom0 compatible "xen,multiboot-module" + fdt set /chosen/dom0 reg <0x00000000 0x40000000 0x0 0x03100000> + booti 30000000 - 20000000 + +Boot Linux as Dom0 on Xen via ARM Trusted Firmware and U-Boot: + +.. code-block:: bash + + $ qemu-system-aarch64 -M xlnx-versal-virt -m 4G \ + -serial stdio -display none \ + -device loader,file=petalinux-v2018.3/bl31.elf,cpu-num=0 \ + -device loader,file=petalinux-v2019.2/u-boot.elf \ + -device loader,addr=0x30000000,file=linux/2018-04-24/xen \ + -device loader,addr=0x40000000,file=petalinux-v2019.2/Image \ + -nic user -nic user \ + -device virtio-rng-device,bus=virtio-mmio-bus.0,rng=rng0 \ + -object rng-random,filename=/dev/urandom,id=rng0 + +Run the following at the U-Boot prompt: + +.. code-block:: bash + + Versal> + fdt addr $fdtcontroladdr + fdt move $fdtcontroladdr 0x20000000 + fdt set /timer clock-frequency <0x3dfd240> + fdt set /chosen xen,xen-bootargs "console=dtuart dtuart=/uart@ff000000 dom0_mem=640M bootscrub=0 maxcpus=1 timer_slop=0" + fdt set /chosen xen,dom0-bootargs "rdinit=/sbin/init clk_ignore_unused console=hvc0 maxcpus=1" + fdt mknode /chosen dom0 + fdt set /chosen/dom0 compatible "xen,multiboot-module" + fdt set /chosen/dom0 reg <0x00000000 0x40000000 0x0 0x03100000> + booti 30000000 - 20000000 + diff --git a/docs/system/target-arm.rst b/docs/system/target-arm.rst index 4c5b0e4aab..afdb37e738 100644 --- a/docs/system/target-arm.rst +++ b/docs/system/target-arm.rst @@ -93,6 +93,7 @@ undocumented; you can get a complete list by running arm/sx1 arm/stellaris arm/virt + arm/xlnx-versal-virt Arm CPU features ================ diff --git a/dump/Makefile.objs b/dump/Makefile.objs deleted file mode 100644 index d2a5db3b81..0000000000 --- a/dump/Makefile.objs +++ /dev/null @@ -1,3 +0,0 @@ -obj-y += dump.o -common-obj-y += dump-hmp-cmds.o -obj-$(TARGET_X86_64) += win_dump.o diff --git a/dump/meson.build b/dump/meson.build new file mode 100644 index 0000000000..2eff29c3ea --- /dev/null +++ b/dump/meson.build @@ -0,0 +1,4 @@ +softmmu_ss.add(files('dump-hmp-cmds.c')) + +specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: [files('dump.c'), snappy, lzo]) +specific_ss.add(when: ['CONFIG_SOFTMMU', 'TARGET_X86_64'], if_true: files('win_dump.c')) @@ -50,7 +50,7 @@ #include "sysemu/hw_accel.h" #include "exec/address-spaces.h" #include "sysemu/xen-mapcache.h" -#include "trace-root.h" +#include "trace/trace-root.h" #ifdef CONFIG_FALLOCATE_PUNCH_HOLE #include <linux/falloc.h> @@ -3659,7 +3659,7 @@ void cpu_physical_memory_unmap(void *buffer, hwaddr len, #define TRANSLATE(...) address_space_translate(as, __VA_ARGS__) #define RCU_READ_LOCK(...) rcu_read_lock() #define RCU_READ_UNLOCK(...) rcu_read_unlock() -#include "memory_ldst.inc.c" +#include "memory_ldst.c.inc" int64_t address_space_cache_init(MemoryRegionCache *cache, AddressSpace *as, @@ -3795,7 +3795,7 @@ address_space_write_cached_slow(MemoryRegionCache *cache, hwaddr addr, #define TRANSLATE(...) address_space_translate_cached(cache, __VA_ARGS__) #define RCU_READ_LOCK() ((void)0) #define RCU_READ_UNLOCK() ((void)0) -#include "memory_ldst.inc.c" +#include "memory_ldst.c.inc" /* virtual memory access for debug (includes writing to ROM) */ int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr, diff --git a/fpu/softfloat-specialize.inc.c b/fpu/softfloat-specialize.c.inc index 034d18199c..034d18199c 100644 --- a/fpu/softfloat-specialize.inc.c +++ b/fpu/softfloat-specialize.c.inc diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 79be4f5840..5dce791eb6 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -621,7 +621,7 @@ static inline float64 float64_pack_raw(FloatParts p) | are propagated from function inputs to output. These details are target- | specific. *----------------------------------------------------------------------------*/ -#include "softfloat-specialize.inc.c" +#include "softfloat-specialize.c.inc" /* Canonicalize EXP and FRAC, setting CLS. */ static FloatParts sf_canonicalize(FloatParts part, const FloatFmt *parm, diff --git a/fsdev/Makefile.objs b/fsdev/Makefile.objs deleted file mode 100644 index 42cd70c367..0000000000 --- a/fsdev/Makefile.objs +++ /dev/null @@ -1,12 +0,0 @@ -# Lots of the fsdev/9pcode is pulled in by vl.c via qemu_fsdev_add. -# only pull in the actual 9p backend if we also enabled virtio or xen. -ifeq ($(CONFIG_FSDEV_9P),y) -common-obj-y = qemu-fsdev.o 9p-marshal.o 9p-iov-marshal.o -else -common-obj-y = qemu-fsdev-dummy.o -endif -common-obj-y += qemu-fsdev-opts.o qemu-fsdev-throttle.o - -# Toplevel always builds this; targets without virtio will put it in -# common-obj-y -common-obj-$(CONFIG_ALL) += qemu-fsdev-dummy.o diff --git a/fsdev/meson.build b/fsdev/meson.build new file mode 100644 index 0000000000..7dd1cc9bfb --- /dev/null +++ b/fsdev/meson.build @@ -0,0 +1,18 @@ +fsdev_ss = ss.source_set() +fsdev_ss.add(files('qemu-fsdev-opts.c', 'qemu-fsdev-throttle.c')) +fsdev_ss.add(when: 'CONFIG_ALL', if_true: files('qemu-fsdev-dummy.c')) +fsdev_ss.add(when: ['CONFIG_FSDEV_9P'], if_true: files( + '9p-iov-marshal.c', + '9p-marshal.c', + 'qemu-fsdev.c', +), if_false: files('qemu-fsdev-dummy.c')) +softmmu_ss.add_all(when: 'CONFIG_LINUX', if_true: fsdev_ss) + +have_virtfs_proxy_helper = have_tools and libattr.found() and libcap_ng.found() and 'CONFIG_VIRTFS' in config_host +if have_virtfs_proxy_helper + executable('virtfs-proxy-helper', + files('virtfs-proxy-helper.c', '9p-marshal.c', '9p-iov-marshal.c'), + dependencies: [qemuutil, libattr, libcap_ng], + install: true, + install_dir: get_option('libexecdir')) +endif @@ -30,7 +30,7 @@ #include "qemu/ctype.h" #include "qemu/cutils.h" #include "qemu/module.h" -#include "trace-root.h" +#include "trace/trace-root.h" #ifdef CONFIG_USER_ONLY #include "qemu.h" #else diff --git a/hw/9pfs/Kconfig b/hw/9pfs/Kconfig index 3ae5749661..d3ebd73730 100644 --- a/hw/9pfs/Kconfig +++ b/hw/9pfs/Kconfig @@ -2,8 +2,12 @@ config FSDEV_9P bool depends on VIRTFS +config 9PFS + bool + config VIRTIO_9P bool default y depends on VIRTFS && VIRTIO select FSDEV_9P + select 9PFS diff --git a/hw/9pfs/Makefile.objs b/hw/9pfs/Makefile.objs deleted file mode 100644 index 70ded6fd8f..0000000000 --- a/hw/9pfs/Makefile.objs +++ /dev/null @@ -1,9 +0,0 @@ -common-obj-y = 9p.o 9p-util.o -common-obj-y += 9p-local.o 9p-xattr.o -common-obj-y += 9p-xattr-user.o 9p-posix-acl.o -common-obj-y += coth.o cofs.o codir.o cofile.o -common-obj-y += coxattr.o 9p-synth.o -common-obj-y += 9p-proxy.o - -common-obj-$(CONFIG_XEN) += xen-9p-backend.o -obj-$(CONFIG_VIRTIO_9P) += virtio-9p-device.o diff --git a/hw/9pfs/meson.build b/hw/9pfs/meson.build new file mode 100644 index 0000000000..cc09426212 --- /dev/null +++ b/hw/9pfs/meson.build @@ -0,0 +1,20 @@ +fs_ss = ss.source_set() +fs_ss.add(files( + '9p-local.c', + '9p-posix-acl.c', + '9p-proxy.c', + '9p-synth.c', + '9p-util.c', + '9p-xattr-user.c', + '9p-xattr.c', + '9p.c', + 'codir.c', + 'cofile.c', + 'cofs.c', + 'coth.c', + 'coxattr.c', +)) +fs_ss.add(when: 'CONFIG_XEN', if_true: files('xen-9p-backend.c')) +softmmu_ss.add_all(when: 'CONFIG_9PFS', if_true: fs_ss) + +specific_ss.add(when: 'CONFIG_VIRTIO_9P', if_true: files('virtio-9p-device.c')) diff --git a/hw/9pfs/trace.h b/hw/9pfs/trace.h new file mode 100644 index 0000000000..6104fe2a77 --- /dev/null +++ b/hw/9pfs/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_9pfs.h" diff --git a/hw/Makefile.objs b/hw/Makefile.objs deleted file mode 100644 index 14b7ea4eb6..0000000000 --- a/hw/Makefile.objs +++ /dev/null @@ -1,48 +0,0 @@ -devices-dirs-y = core/ -ifeq ($(CONFIG_SOFTMMU), y) -devices-dirs-$(call lor,$(CONFIG_VIRTIO_9P),$(call land,$(CONFIG_VIRTFS),$(CONFIG_XEN))) += 9pfs/ -devices-dirs-y += acpi/ -devices-dirs-y += adc/ -devices-dirs-y += audio/ -devices-dirs-y += block/ -devices-dirs-y += char/ -devices-dirs-y += cpu/ -devices-dirs-y += display/ -devices-dirs-y += dma/ -devices-dirs-y += gpio/ -devices-dirs-$(CONFIG_HYPERV) += hyperv/ -devices-dirs-$(CONFIG_I2C) += i2c/ -devices-dirs-y += ide/ -devices-dirs-y += input/ -devices-dirs-y += intc/ -devices-dirs-$(CONFIG_IPACK) += ipack/ -devices-dirs-$(CONFIG_IPMI) += ipmi/ -devices-dirs-y += isa/ -devices-dirs-y += misc/ -devices-dirs-y += net/ -devices-dirs-y += rdma/ -devices-dirs-y += nvram/ -devices-dirs-y += pci/ -devices-dirs-$(CONFIG_PCI) += pci-bridge/ pci-host/ -devices-dirs-y += pcmcia/ -devices-dirs-y += rtc/ -devices-dirs-$(CONFIG_SCSI) += scsi/ -devices-dirs-y += sd/ -devices-dirs-y += ssi/ -devices-dirs-y += timer/ -devices-dirs-$(CONFIG_TPM) += tpm/ -devices-dirs-y += usb/ -devices-dirs-$(CONFIG_VFIO) += vfio/ -devices-dirs-y += virtio/ -devices-dirs-y += watchdog/ -devices-dirs-$(CONFIG_XEN) += xen/ -devices-dirs-$(CONFIG_MEM_DEVICE) += mem/ -devices-dirs-$(CONFIG_NUBUS) += nubus/ -devices-dirs-y += semihosting/ -devices-dirs-y += smbios/ -endif - -common-obj-y += $(devices-dirs-y) -common-obj-m += display/ -common-obj-m += usb/ -obj-y += $(devices-dirs-y) diff --git a/hw/acpi/Makefile.objs b/hw/acpi/Makefile.objs deleted file mode 100644 index 72886c7965..0000000000 --- a/hw/acpi/Makefile.objs +++ /dev/null @@ -1,26 +0,0 @@ -ifeq ($(CONFIG_ACPI),y) -common-obj-$(CONFIG_ACPI_X86) += core.o piix4.o pcihp.o -common-obj-$(CONFIG_ACPI_X86_ICH) += ich9.o tco.o -common-obj-$(CONFIG_ACPI_CPU_HOTPLUG) += cpu_hotplug.o -common-obj-$(CONFIG_ACPI_MEMORY_HOTPLUG) += memory_hotplug.o -common-obj-$(CONFIG_ACPI_CPU_HOTPLUG) += cpu.o -common-obj-$(CONFIG_ACPI_NVDIMM) += nvdimm.o -common-obj-$(CONFIG_ACPI_VMGENID) += vmgenid.o -common-obj-$(CONFIG_ACPI_HW_REDUCED) += generic_event_device.o -common-obj-$(CONFIG_ACPI_HMAT) += hmat.o -common-obj-$(CONFIG_ACPI_APEI) += ghes.o -common-obj-$(call lnot,$(CONFIG_ACPI_X86)) += acpi-stub.o -common-obj-$(call lnot,$(CONFIG_PC)) += acpi-x86-stub.o - -common-obj-y += acpi_interface.o -common-obj-y += bios-linker-loader.o -common-obj-y += aml-build.o utils.o -common-obj-$(CONFIG_ACPI_PCI) += pci.o -common-obj-$(CONFIG_TPM) += tpm.o - -common-obj-$(CONFIG_IPMI) += ipmi.o -common-obj-$(call lnot,$(CONFIG_IPMI)) += ipmi-stub.o -else -common-obj-y += acpi-stub.o aml-build-stub.o -endif -common-obj-$(CONFIG_ALL) += acpi-stub.o aml-build-stub.o acpi-x86-stub.o ipmi-stub.o diff --git a/hw/acpi/meson.build b/hw/acpi/meson.build new file mode 100644 index 0000000000..dd69577212 --- /dev/null +++ b/hw/acpi/meson.build @@ -0,0 +1,25 @@ +acpi_ss = ss.source_set() +acpi_ss.add(files( + 'acpi_interface.c', + 'aml-build.c', + 'bios-linker-loader.c', + 'utils.c', +)) +acpi_ss.add(when: 'CONFIG_ACPI_CPU_HOTPLUG', if_true: files('cpu.c')) +acpi_ss.add(when: 'CONFIG_ACPI_CPU_HOTPLUG', if_true: files('cpu_hotplug.c')) +acpi_ss.add(when: 'CONFIG_ACPI_MEMORY_HOTPLUG', if_true: files('memory_hotplug.c')) +acpi_ss.add(when: 'CONFIG_ACPI_NVDIMM', if_true: files('nvdimm.c')) +acpi_ss.add(when: 'CONFIG_ACPI_PCI', if_true: files('pci.c')) +acpi_ss.add(when: 'CONFIG_ACPI_VMGENID', if_true: files('vmgenid.c')) +acpi_ss.add(when: 'CONFIG_ACPI_HW_REDUCED', if_true: files('generic_event_device.c')) +acpi_ss.add(when: 'CONFIG_ACPI_HMAT', if_true: files('hmat.c')) +acpi_ss.add(when: 'CONFIG_ACPI_APEI', if_true: files('ghes.c')) +acpi_ss.add(when: 'CONFIG_ACPI_X86', if_true: files('core.c', 'piix4.c', 'pcihp.c'), if_false: files('acpi-stub.c')) +acpi_ss.add(when: 'CONFIG_ACPI_X86_ICH', if_true: files('ich9.c', 'tco.c')) +acpi_ss.add(when: 'CONFIG_IPMI', if_true: files('ipmi.c'), if_false: files('ipmi-stub.c')) +acpi_ss.add(when: 'CONFIG_PC', if_false: files('acpi-x86-stub.c')) +acpi_ss.add(when: 'CONFIG_TPM', if_true: files('tpm.c')) +softmmu_ss.add(when: 'CONFIG_ACPI', if_false: files('acpi-stub.c', 'aml-build-stub.c')) +softmmu_ss.add_all(when: 'CONFIG_ACPI', if_true: acpi_ss) +softmmu_ss.add(when: 'CONFIG_ALL', if_true: files('acpi-stub.c', 'aml-build-stub.c', + 'acpi-x86-stub.c', 'ipmi-stub.c')) diff --git a/hw/acpi/trace.h b/hw/acpi/trace.h new file mode 100644 index 0000000000..a7f7da7009 --- /dev/null +++ b/hw/acpi/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_acpi.h" diff --git a/hw/adc/Makefile.objs b/hw/adc/Makefile.objs deleted file mode 100644 index 2b9dc36c7f..0000000000 --- a/hw/adc/Makefile.objs +++ /dev/null @@ -1 +0,0 @@ -common-obj-$(CONFIG_STM32F2XX_ADC) += stm32f2xx_adc.o diff --git a/hw/adc/meson.build b/hw/adc/meson.build new file mode 100644 index 0000000000..0d62ae96ae --- /dev/null +++ b/hw/adc/meson.build @@ -0,0 +1 @@ +softmmu_ss.add(when: 'CONFIG_STM32F2XX_ADC', if_true: files('stm32f2xx_adc.c')) diff --git a/hw/alpha/Makefile.objs b/hw/alpha/Makefile.objs deleted file mode 100644 index 62fdf3edec..0000000000 --- a/hw/alpha/Makefile.objs +++ /dev/null @@ -1 +0,0 @@ -obj-$(CONFIG_DP264) += dp264.o pci.o typhoon.o diff --git a/hw/alpha/meson.build b/hw/alpha/meson.build new file mode 100644 index 0000000000..81ca215777 --- /dev/null +++ b/hw/alpha/meson.build @@ -0,0 +1,8 @@ +alpha_ss = ss.source_set() +alpha_ss.add(when: 'CONFIG_DP264', if_true: files( + 'dp264.c', + 'pci.c', + 'typhoon.c', +)) + +hw_arch += {'alpha': alpha_ss} diff --git a/hw/alpha/trace.h b/hw/alpha/trace.h new file mode 100644 index 0000000000..20fe698191 --- /dev/null +++ b/hw/alpha/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_alpha.h" diff --git a/hw/arm/Makefile.objs b/hw/arm/Makefile.objs deleted file mode 100644 index 534a6a119e..0000000000 --- a/hw/arm/Makefile.objs +++ /dev/null @@ -1,56 +0,0 @@ -obj-y += boot.o -obj-$(CONFIG_PLATFORM_BUS) += sysbus-fdt.o -obj-$(CONFIG_ARM_VIRT) += virt.o -obj-$(CONFIG_ACPI) += virt-acpi-build.o -obj-$(CONFIG_DIGIC) += digic_boards.o -obj-$(CONFIG_EXYNOS4) += exynos4_boards.o -obj-$(CONFIG_EMCRAFT_SF2) += msf2-som.o -obj-$(CONFIG_HIGHBANK) += highbank.o -obj-$(CONFIG_INTEGRATOR) += integratorcp.o -obj-$(CONFIG_MAINSTONE) += mainstone.o -obj-$(CONFIG_MICROBIT) += microbit.o -obj-$(CONFIG_MUSICPAL) += musicpal.o -obj-$(CONFIG_NETDUINO2) += netduino2.o -obj-$(CONFIG_NETDUINOPLUS2) += netduinoplus2.o -obj-$(CONFIG_NSERIES) += nseries.o -obj-$(CONFIG_SX1) += omap_sx1.o -obj-$(CONFIG_CHEETAH) += palm.o -obj-$(CONFIG_GUMSTIX) += gumstix.o -obj-$(CONFIG_SPITZ) += spitz.o -obj-$(CONFIG_TOSA) += tosa.o -obj-$(CONFIG_Z2) += z2.o -obj-$(CONFIG_REALVIEW) += realview.o -obj-$(CONFIG_SBSA_REF) += sbsa-ref.o -obj-$(CONFIG_STELLARIS) += stellaris.o -obj-$(CONFIG_COLLIE) += collie.o -obj-$(CONFIG_VERSATILE) += versatilepb.o -obj-$(CONFIG_VEXPRESS) += vexpress.o -obj-$(CONFIG_ZYNQ) += xilinx_zynq.o -obj-$(CONFIG_SABRELITE) += sabrelite.o - -obj-$(CONFIG_ARM_V7M) += armv7m.o -obj-$(CONFIG_EXYNOS4) += exynos4210.o -obj-$(CONFIG_PXA2XX) += pxa2xx.o pxa2xx_gpio.o pxa2xx_pic.o -obj-$(CONFIG_DIGIC) += digic.o -obj-$(CONFIG_OMAP) += omap1.o omap2.o -obj-$(CONFIG_STRONGARM) += strongarm.o -obj-$(CONFIG_ALLWINNER_A10) += allwinner-a10.o cubieboard.o -obj-$(CONFIG_ALLWINNER_H3) += allwinner-h3.o orangepi.o -obj-$(CONFIG_RASPI) += bcm2835_peripherals.o bcm2836.o raspi.o -obj-$(CONFIG_STM32F205_SOC) += stm32f205_soc.o -obj-$(CONFIG_STM32F405_SOC) += stm32f405_soc.o -obj-$(CONFIG_XLNX_ZYNQMP_ARM) += xlnx-zynqmp.o xlnx-zcu102.o -obj-$(CONFIG_XLNX_VERSAL) += xlnx-versal.o xlnx-versal-virt.o -obj-$(CONFIG_FSL_IMX25) += fsl-imx25.o imx25_pdk.o -obj-$(CONFIG_FSL_IMX31) += fsl-imx31.o kzm.o -obj-$(CONFIG_FSL_IMX6) += fsl-imx6.o -obj-$(CONFIG_ASPEED_SOC) += aspeed_soc.o aspeed.o aspeed_ast2600.o -obj-$(CONFIG_MPS2) += mps2.o -obj-$(CONFIG_MPS2) += mps2-tz.o -obj-$(CONFIG_MSF2) += msf2-soc.o -obj-$(CONFIG_MUSCA) += musca.o -obj-$(CONFIG_ARMSSE) += armsse.o -obj-$(CONFIG_FSL_IMX7) += fsl-imx7.o mcimx7d-sabre.o -obj-$(CONFIG_ARM_SMMUV3) += smmu-common.o smmuv3.o -obj-$(CONFIG_FSL_IMX6UL) += fsl-imx6ul.o mcimx6ul-evk.o -obj-$(CONFIG_NRF51_SOC) += nrf51_soc.o diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c index f304c2b4f0..fe7c2b9d4b 100644 --- a/hw/arm/integratorcp.c +++ b/hw/arm/integratorcp.c @@ -25,6 +25,7 @@ #include "hw/char/pl011.h" #include "hw/hw.h" #include "hw/irq.h" +#include "hw/sd/sd.h" #define TYPE_INTEGRATOR_CM "integrator_core" #define INTEGRATOR_CM(obj) \ @@ -595,6 +596,7 @@ static void integratorcp_init(MachineState *machine) MemoryRegion *ram_alias = g_new(MemoryRegion, 1); qemu_irq pic[32]; DeviceState *dev, *sic, *icp; + DriveInfo *dinfo; int i; cpuobj = object_new(machine->cpu_type); @@ -645,10 +647,21 @@ static void integratorcp_init(MachineState *machine) sysbus_create_simple(TYPE_INTEGRATOR_DEBUG, 0x1a000000, 0); dev = sysbus_create_varargs("pl181", 0x1c000000, pic[23], pic[24], NULL); - qdev_connect_gpio_out(dev, 0, + qdev_connect_gpio_out_named(dev, "card-read-only", 0, qdev_get_gpio_in_named(icp, ICP_GPIO_MMC_WPROT, 0)); - qdev_connect_gpio_out(dev, 1, + qdev_connect_gpio_out_named(dev, "card-inserted", 0, qdev_get_gpio_in_named(icp, ICP_GPIO_MMC_CARDIN, 0)); + dinfo = drive_get_next(IF_SD); + if (dinfo) { + DeviceState *card; + + card = qdev_new(TYPE_SD_CARD); + qdev_prop_set_drive_err(card, "drive", blk_by_legacy_dinfo(dinfo), + &error_fatal); + qdev_realize_and_unref(card, qdev_get_child_bus(dev, "sd-bus"), + &error_fatal); + } + sysbus_create_varargs("pl041", 0x1d000000, pic[25], NULL); if (nd_table[0].used) diff --git a/hw/arm/meson.build b/hw/arm/meson.build new file mode 100644 index 0000000000..1ae5e17eeb --- /dev/null +++ b/hw/arm/meson.build @@ -0,0 +1,59 @@ +arm_ss = ss.source_set() +arm_ss.add(files('boot.c')) +arm_ss.add(when: 'CONFIG_PLATFORM_BUS', if_true: files('sysbus-fdt.c')) +arm_ss.add(when: 'CONFIG_ARM_VIRT', if_true: files('virt.c')) +arm_ss.add(when: 'CONFIG_ACPI', if_true: files('virt-acpi-build.c')) +arm_ss.add(when: 'CONFIG_DIGIC', if_true: files('digic_boards.c')) +arm_ss.add(when: 'CONFIG_EXYNOS4', if_true: files('exynos4_boards.c')) +arm_ss.add(when: 'CONFIG_EMCRAFT_SF2', if_true: files('msf2-som.c')) +arm_ss.add(when: 'CONFIG_HIGHBANK', if_true: files('highbank.c')) +arm_ss.add(when: 'CONFIG_INTEGRATOR', if_true: files('integratorcp.c')) +arm_ss.add(when: 'CONFIG_MAINSTONE', if_true: files('mainstone.c')) +arm_ss.add(when: 'CONFIG_MICROBIT', if_true: files('microbit.c')) +arm_ss.add(when: 'CONFIG_MUSICPAL', if_true: files('musicpal.c')) +arm_ss.add(when: 'CONFIG_NETDUINO2', if_true: files('netduino2.c')) +arm_ss.add(when: 'CONFIG_NETDUINOPLUS2', if_true: files('netduinoplus2.c')) +arm_ss.add(when: 'CONFIG_NSERIES', if_true: files('nseries.c')) +arm_ss.add(when: 'CONFIG_SX1', if_true: files('omap_sx1.c')) +arm_ss.add(when: 'CONFIG_CHEETAH', if_true: files('palm.c')) +arm_ss.add(when: 'CONFIG_GUMSTIX', if_true: files('gumstix.c')) +arm_ss.add(when: 'CONFIG_SPITZ', if_true: files('spitz.c')) +arm_ss.add(when: 'CONFIG_TOSA', if_true: files('tosa.c')) +arm_ss.add(when: 'CONFIG_Z2', if_true: files('z2.c')) +arm_ss.add(when: 'CONFIG_REALVIEW', if_true: files('realview.c')) +arm_ss.add(when: 'CONFIG_SBSA_REF', if_true: files('sbsa-ref.c')) +arm_ss.add(when: 'CONFIG_STELLARIS', if_true: files('stellaris.c')) +arm_ss.add(when: 'CONFIG_COLLIE', if_true: files('collie.c')) +arm_ss.add(when: 'CONFIG_VERSATILE', if_true: files('versatilepb.c')) +arm_ss.add(when: 'CONFIG_VEXPRESS', if_true: files('vexpress.c')) +arm_ss.add(when: 'CONFIG_ZYNQ', if_true: files('xilinx_zynq.c')) +arm_ss.add(when: 'CONFIG_SABRELITE', if_true: files('sabrelite.c')) + +arm_ss.add(when: 'CONFIG_ARM_V7M', if_true: files('armv7m.c')) +arm_ss.add(when: 'CONFIG_EXYNOS4', if_true: files('exynos4210.c')) +arm_ss.add(when: 'CONFIG_PXA2XX', if_true: files('pxa2xx.c', 'pxa2xx_gpio.c', 'pxa2xx_pic.c')) +arm_ss.add(when: 'CONFIG_DIGIC', if_true: files('digic.c')) +arm_ss.add(when: 'CONFIG_OMAP', if_true: files('omap1.c', 'omap2.c')) +arm_ss.add(when: 'CONFIG_STRONGARM', if_true: files('strongarm.c')) +arm_ss.add(when: 'CONFIG_ALLWINNER_A10', if_true: files('allwinner-a10.c', 'cubieboard.c')) +arm_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-h3.c', 'orangepi.c')) +arm_ss.add(when: 'CONFIG_RASPI', if_true: files('bcm2835_peripherals.c', 'bcm2836.c', 'raspi.c')) +arm_ss.add(when: 'CONFIG_STM32F205_SOC', if_true: files('stm32f205_soc.c')) +arm_ss.add(when: 'CONFIG_STM32F405_SOC', if_true: files('stm32f405_soc.c')) +arm_ss.add(when: 'CONFIG_XLNX_ZYNQMP_ARM', if_true: files('xlnx-zynqmp.c', 'xlnx-zcu102.c')) +arm_ss.add(when: 'CONFIG_XLNX_VERSAL', if_true: files('xlnx-versal.c', 'xlnx-versal-virt.c')) +arm_ss.add(when: 'CONFIG_FSL_IMX25', if_true: files('fsl-imx25.c', 'imx25_pdk.c')) +arm_ss.add(when: 'CONFIG_FSL_IMX31', if_true: files('fsl-imx31.c', 'kzm.c')) +arm_ss.add(when: 'CONFIG_FSL_IMX6', if_true: files('fsl-imx6.c')) +arm_ss.add(when: 'CONFIG_ASPEED_SOC', if_true: files('aspeed_soc.c', 'aspeed.c', 'aspeed_ast2600.c')) +arm_ss.add(when: 'CONFIG_MPS2', if_true: files('mps2.c')) +arm_ss.add(when: 'CONFIG_MPS2', if_true: files('mps2-tz.c')) +arm_ss.add(when: 'CONFIG_MSF2', if_true: files('msf2-soc.c')) +arm_ss.add(when: 'CONFIG_MUSCA', if_true: files('musca.c')) +arm_ss.add(when: 'CONFIG_ARMSSE', if_true: files('armsse.c')) +arm_ss.add(when: 'CONFIG_FSL_IMX7', if_true: files('fsl-imx7.c', 'mcimx7d-sabre.c')) +arm_ss.add(when: 'CONFIG_ARM_SMMUV3', if_true: files('smmu-common.c', 'smmuv3.c')) +arm_ss.add(when: 'CONFIG_FSL_IMX6UL', if_true: files('fsl-imx6ul.c', 'mcimx6ul-evk.c')) +arm_ss.add(when: 'CONFIG_NRF51_SOC', if_true: files('nrf51_soc.c')) + +hw_arch += {'arm': arm_ss} diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c index 6203c4cfe0..20fa201dd5 100644 --- a/hw/arm/pxa2xx.c +++ b/hw/arm/pxa2xx.c @@ -22,6 +22,7 @@ #include "hw/irq.h" #include "hw/qdev-properties.h" #include "hw/ssi/ssi.h" +#include "hw/sd/sd.h" #include "chardev/char-fe.h" #include "sysemu/blockdev.h" #include "sysemu/qtest.h" @@ -2136,15 +2137,24 @@ PXA2xxState *pxa270_init(MemoryRegion *address_space, s->gpio = pxa2xx_gpio_init(0x40e00000, s->cpu, s->pic, 121); - dinfo = drive_get(IF_SD, 0, 0); - if (!dinfo && !qtest_enabled()) { - warn_report("missing SecureDigital device"); - } s->mmc = pxa2xx_mmci_init(address_space, 0x41100000, - dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, qdev_get_gpio_in(s->pic, PXA2XX_PIC_MMC), qdev_get_gpio_in(s->dma, PXA2XX_RX_RQ_MMCI), qdev_get_gpio_in(s->dma, PXA2XX_TX_RQ_MMCI)); + dinfo = drive_get(IF_SD, 0, 0); + if (dinfo) { + DeviceState *carddev; + + /* Create and plug in the sd card */ + carddev = qdev_new(TYPE_SD_CARD); + qdev_prop_set_drive_err(carddev, "drive", + blk_by_legacy_dinfo(dinfo), &error_fatal); + qdev_realize_and_unref(carddev, qdev_get_child_bus(DEVICE(s->mmc), + "sd-bus"), + &error_fatal); + } else if (!qtest_enabled()) { + warn_report("missing SecureDigital device"); + } for (i = 0; pxa270_serial[i].io_base; i++) { if (serial_hd(i)) { @@ -2260,15 +2270,24 @@ PXA2xxState *pxa255_init(MemoryRegion *address_space, unsigned int sdram_size) s->gpio = pxa2xx_gpio_init(0x40e00000, s->cpu, s->pic, 85); - dinfo = drive_get(IF_SD, 0, 0); - if (!dinfo && !qtest_enabled()) { - warn_report("missing SecureDigital device"); - } s->mmc = pxa2xx_mmci_init(address_space, 0x41100000, - dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, qdev_get_gpio_in(s->pic, PXA2XX_PIC_MMC), qdev_get_gpio_in(s->dma, PXA2XX_RX_RQ_MMCI), qdev_get_gpio_in(s->dma, PXA2XX_TX_RQ_MMCI)); + dinfo = drive_get(IF_SD, 0, 0); + if (dinfo) { + DeviceState *carddev; + + /* Create and plug in the sd card */ + carddev = qdev_new(TYPE_SD_CARD); + qdev_prop_set_drive_err(carddev, "drive", + blk_by_legacy_dinfo(dinfo), &error_fatal); + qdev_realize_and_unref(carddev, qdev_get_child_bus(DEVICE(s->mmc), + "sd-bus"), + &error_fatal); + } else if (!qtest_enabled()) { + warn_report("missing SecureDigital device"); + } for (i = 0; pxa255_serial[i].io_base; i++) { if (serial_hd(i)) { diff --git a/hw/arm/realview.c b/hw/arm/realview.c index c1ff172b13..5f1f36b15c 100644 --- a/hw/arm/realview.c +++ b/hw/arm/realview.c @@ -27,6 +27,7 @@ #include "hw/intc/realview_gic.h" #include "hw/irq.h" #include "hw/i2c/arm_sbcon_i2c.h" +#include "hw/sd/sd.h" #define SMP_BOOT_ADDR 0xe0000000 #define SMP_BOOTREG_ADDR 0x10000030 @@ -69,6 +70,7 @@ static void realview_init(MachineState *machine, qemu_irq mmc_irq[2]; PCIBus *pci_bus = NULL; NICInfo *nd; + DriveInfo *dinfo; I2CBus *i2c; int n; unsigned int smp_cpus = machine->smp.cpus; @@ -234,8 +236,18 @@ static void realview_init(MachineState *machine, mmc_irq[1] = qemu_irq_split( qdev_get_gpio_in(sysctl, ARM_SYSCTL_GPIO_MMC_CARDIN), qemu_irq_invert(qdev_get_gpio_in(gpio2, 0))); - qdev_connect_gpio_out(dev, 0, mmc_irq[0]); - qdev_connect_gpio_out(dev, 1, mmc_irq[1]); + qdev_connect_gpio_out_named(dev, "card-read-only", 0, mmc_irq[0]); + qdev_connect_gpio_out_named(dev, "card-inserted", 0, mmc_irq[1]); + dinfo = drive_get_next(IF_SD); + if (dinfo) { + DeviceState *card; + + card = qdev_new(TYPE_SD_CARD); + qdev_prop_set_drive_err(card, "drive", blk_by_legacy_dinfo(dinfo), + &error_fatal); + qdev_realize_and_unref(card, qdev_get_child_bus(dev, "sd-bus"), + &error_fatal); + } sysbus_create_simple("pl031", 0x10017000, pic[10]); diff --git a/hw/arm/smmu-common.c b/hw/arm/smmu-common.c index e13a5f4a7c..3838db1395 100644 --- a/hw/arm/smmu-common.c +++ b/hw/arm/smmu-common.c @@ -32,6 +32,91 @@ /* IOTLB Management */ +static guint smmu_iotlb_key_hash(gconstpointer v) +{ + SMMUIOTLBKey *key = (SMMUIOTLBKey *)v; + uint32_t a, b, c; + + /* Jenkins hash */ + a = b = c = JHASH_INITVAL + sizeof(*key); + a += key->asid + key->level + key->tg; + b += extract64(key->iova, 0, 32); + c += extract64(key->iova, 32, 32); + + __jhash_mix(a, b, c); + __jhash_final(a, b, c); + + return c; +} + +static gboolean smmu_iotlb_key_equal(gconstpointer v1, gconstpointer v2) +{ + SMMUIOTLBKey *k1 = (SMMUIOTLBKey *)v1, *k2 = (SMMUIOTLBKey *)v2; + + return (k1->asid == k2->asid) && (k1->iova == k2->iova) && + (k1->level == k2->level) && (k1->tg == k2->tg); +} + +SMMUIOTLBKey smmu_get_iotlb_key(uint16_t asid, uint64_t iova, + uint8_t tg, uint8_t level) +{ + SMMUIOTLBKey key = {.asid = asid, .iova = iova, .tg = tg, .level = level}; + + return key; +} + +SMMUTLBEntry *smmu_iotlb_lookup(SMMUState *bs, SMMUTransCfg *cfg, + SMMUTransTableInfo *tt, hwaddr iova) +{ + uint8_t tg = (tt->granule_sz - 10) / 2; + uint8_t inputsize = 64 - tt->tsz; + uint8_t stride = tt->granule_sz - 3; + uint8_t level = 4 - (inputsize - 4) / stride; + SMMUTLBEntry *entry = NULL; + + while (level <= 3) { + uint64_t subpage_size = 1ULL << level_shift(level, tt->granule_sz); + uint64_t mask = subpage_size - 1; + SMMUIOTLBKey key; + + key = smmu_get_iotlb_key(cfg->asid, iova & ~mask, tg, level); + entry = g_hash_table_lookup(bs->iotlb, &key); + if (entry) { + break; + } + level++; + } + + if (entry) { + cfg->iotlb_hits++; + trace_smmu_iotlb_lookup_hit(cfg->asid, iova, + cfg->iotlb_hits, cfg->iotlb_misses, + 100 * cfg->iotlb_hits / + (cfg->iotlb_hits + cfg->iotlb_misses)); + } else { + cfg->iotlb_misses++; + trace_smmu_iotlb_lookup_miss(cfg->asid, iova, + cfg->iotlb_hits, cfg->iotlb_misses, + 100 * cfg->iotlb_hits / + (cfg->iotlb_hits + cfg->iotlb_misses)); + } + return entry; +} + +void smmu_iotlb_insert(SMMUState *bs, SMMUTransCfg *cfg, SMMUTLBEntry *new) +{ + SMMUIOTLBKey *key = g_new0(SMMUIOTLBKey, 1); + uint8_t tg = (new->granule - 10) / 2; + + if (g_hash_table_size(bs->iotlb) >= SMMU_IOTLB_MAX_SIZE) { + smmu_iotlb_inv_all(bs); + } + + *key = smmu_get_iotlb_key(cfg->asid, new->entry.iova, tg, new->level); + trace_smmu_iotlb_insert(cfg->asid, new->entry.iova, tg, new->level); + g_hash_table_insert(bs->iotlb, key, new); +} + inline void smmu_iotlb_inv_all(SMMUState *s) { trace_smmu_iotlb_inv_all(); @@ -44,15 +129,44 @@ static gboolean smmu_hash_remove_by_asid(gpointer key, gpointer value, uint16_t asid = *(uint16_t *)user_data; SMMUIOTLBKey *iotlb_key = (SMMUIOTLBKey *)key; - return iotlb_key->asid == asid; + return SMMU_IOTLB_ASID(*iotlb_key) == asid; } -inline void smmu_iotlb_inv_iova(SMMUState *s, uint16_t asid, dma_addr_t iova) +static gboolean smmu_hash_remove_by_asid_iova(gpointer key, gpointer value, + gpointer user_data) { - SMMUIOTLBKey key = {.asid = asid, .iova = iova}; + SMMUTLBEntry *iter = (SMMUTLBEntry *)value; + IOMMUTLBEntry *entry = &iter->entry; + SMMUIOTLBPageInvInfo *info = (SMMUIOTLBPageInvInfo *)user_data; + SMMUIOTLBKey iotlb_key = *(SMMUIOTLBKey *)key; - trace_smmu_iotlb_inv_iova(asid, iova); - g_hash_table_remove(s->iotlb, &key); + if (info->asid >= 0 && info->asid != SMMU_IOTLB_ASID(iotlb_key)) { + return false; + } + return ((info->iova & ~entry->addr_mask) == entry->iova) || + ((entry->iova & ~info->mask) == info->iova); +} + +inline void +smmu_iotlb_inv_iova(SMMUState *s, int asid, dma_addr_t iova, + uint8_t tg, uint64_t num_pages, uint8_t ttl) +{ + if (ttl && (num_pages == 1)) { + SMMUIOTLBKey key = smmu_get_iotlb_key(asid, iova, tg, ttl); + + g_hash_table_remove(s->iotlb, &key); + } else { + /* if tg is not set we use 4KB range invalidation */ + uint8_t granule = tg ? tg * 2 + 10 : 12; + + SMMUIOTLBPageInvInfo info = { + .asid = asid, .iova = iova, + .mask = (num_pages * 1 << granule) - 1}; + + g_hash_table_foreach_remove(s->iotlb, + smmu_hash_remove_by_asid_iova, + &info); + } } inline void smmu_iotlb_inv_asid(SMMUState *s, uint16_t asid) @@ -149,7 +263,7 @@ SMMUTransTableInfo *select_tt(SMMUTransCfg *cfg, dma_addr_t iova) * @cfg: translation config * @iova: iova to translate * @perm: access type - * @tlbe: IOMMUTLBEntry (out) + * @tlbe: SMMUTLBEntry (out) * @info: handle to an error info * * Return 0 on success, < 0 on error. In case of error, @info is filled @@ -159,7 +273,7 @@ SMMUTransTableInfo *select_tt(SMMUTransCfg *cfg, dma_addr_t iova) */ static int smmu_ptw_64(SMMUTransCfg *cfg, dma_addr_t iova, IOMMUAccessFlags perm, - IOMMUTLBEntry *tlbe, SMMUPTWEventInfo *info) + SMMUTLBEntry *tlbe, SMMUPTWEventInfo *info) { dma_addr_t baseaddr, indexmask; int stage = cfg->stage; @@ -179,14 +293,11 @@ static int smmu_ptw_64(SMMUTransCfg *cfg, baseaddr = extract64(tt->ttb, 0, 48); baseaddr &= ~indexmask; - tlbe->iova = iova; - tlbe->addr_mask = (1 << granule_sz) - 1; - while (level <= 3) { uint64_t subpage_size = 1ULL << level_shift(level, granule_sz); uint64_t mask = subpage_size - 1; uint32_t offset = iova_level_offset(iova, inputsize, level, granule_sz); - uint64_t pte; + uint64_t pte, gpa; dma_addr_t pte_addr = baseaddr + offset * sizeof(pte); uint8_t ap; @@ -199,60 +310,50 @@ static int smmu_ptw_64(SMMUTransCfg *cfg, if (is_invalid_pte(pte) || is_reserved_pte(pte, level)) { trace_smmu_ptw_invalid_pte(stage, level, baseaddr, pte_addr, offset, pte); - info->type = SMMU_PTW_ERR_TRANSLATION; - goto error; + break; } - if (is_page_pte(pte, level)) { - uint64_t gpa = get_page_pte_address(pte, granule_sz); + if (is_table_pte(pte, level)) { + ap = PTE_APTABLE(pte); - ap = PTE_AP(pte); - if (is_permission_fault(ap, perm)) { + if (is_permission_fault(ap, perm) && !tt->had) { info->type = SMMU_PTW_ERR_PERMISSION; goto error; } - - tlbe->translated_addr = gpa + (iova & mask); - tlbe->perm = PTE_AP_TO_PERM(ap); + baseaddr = get_table_pte_address(pte, granule_sz); + level++; + continue; + } else if (is_page_pte(pte, level)) { + gpa = get_page_pte_address(pte, granule_sz); trace_smmu_ptw_page_pte(stage, level, iova, baseaddr, pte_addr, pte, gpa); - return 0; - } - if (is_block_pte(pte, level)) { + } else { uint64_t block_size; - hwaddr gpa = get_block_pte_address(pte, level, granule_sz, - &block_size); - - ap = PTE_AP(pte); - if (is_permission_fault(ap, perm)) { - info->type = SMMU_PTW_ERR_PERMISSION; - goto error; - } + gpa = get_block_pte_address(pte, level, granule_sz, + &block_size); trace_smmu_ptw_block_pte(stage, level, baseaddr, pte_addr, pte, iova, gpa, block_size >> 20); - - tlbe->translated_addr = gpa + (iova & mask); - tlbe->perm = PTE_AP_TO_PERM(ap); - return 0; } - - /* table pte */ - ap = PTE_APTABLE(pte); - + ap = PTE_AP(pte); if (is_permission_fault(ap, perm)) { info->type = SMMU_PTW_ERR_PERMISSION; goto error; } - baseaddr = get_table_pte_address(pte, granule_sz); - level++; - } + tlbe->entry.translated_addr = gpa; + tlbe->entry.iova = iova & ~mask; + tlbe->entry.addr_mask = mask; + tlbe->entry.perm = PTE_AP_TO_PERM(ap); + tlbe->level = level; + tlbe->granule = granule_sz; + return 0; + } info->type = SMMU_PTW_ERR_TRANSLATION; error: - tlbe->perm = IOMMU_NONE; + tlbe->entry.perm = IOMMU_NONE; return -EINVAL; } @@ -268,7 +369,7 @@ error: * return 0 on success */ inline int smmu_ptw(SMMUTransCfg *cfg, dma_addr_t iova, IOMMUAccessFlags perm, - IOMMUTLBEntry *tlbe, SMMUPTWEventInfo *info) + SMMUTLBEntry *tlbe, SMMUPTWEventInfo *info) { if (!cfg->aa64) { /* @@ -361,31 +462,6 @@ IOMMUMemoryRegion *smmu_iommu_mr(SMMUState *s, uint32_t sid) return NULL; } -static guint smmu_iotlb_key_hash(gconstpointer v) -{ - SMMUIOTLBKey *key = (SMMUIOTLBKey *)v; - uint32_t a, b, c; - - /* Jenkins hash */ - a = b = c = JHASH_INITVAL + sizeof(*key); - a += key->asid; - b += extract64(key->iova, 0, 32); - c += extract64(key->iova, 32, 32); - - __jhash_mix(a, b, c); - __jhash_final(a, b, c); - - return c; -} - -static gboolean smmu_iotlb_key_equal(gconstpointer v1, gconstpointer v2) -{ - const SMMUIOTLBKey *k1 = v1; - const SMMUIOTLBKey *k2 = v2; - - return (k1->asid == k2->asid) && (k1->iova == k2->iova); -} - /* Unmap the whole notifier's range */ static void smmu_unmap_notifier_range(IOMMUNotifier *n) { diff --git a/hw/arm/smmu-internal.h b/hw/arm/smmu-internal.h index 7794d6d394..55147f29be 100644 --- a/hw/arm/smmu-internal.h +++ b/hw/arm/smmu-internal.h @@ -96,4 +96,12 @@ uint64_t iova_level_offset(uint64_t iova, int inputsize, MAKE_64BIT_MASK(0, gsz - 3); } +#define SMMU_IOTLB_ASID(key) ((key).asid) + +typedef struct SMMUIOTLBPageInvInfo { + int asid; + uint64_t iova; + uint64_t mask; +} SMMUIOTLBPageInvInfo; + #endif diff --git a/hw/arm/smmuv3-internal.h b/hw/arm/smmuv3-internal.h index 4112394129..fa3c088972 100644 --- a/hw/arm/smmuv3-internal.h +++ b/hw/arm/smmuv3-internal.h @@ -54,6 +54,8 @@ REG32(IDR1, 0x4) REG32(IDR2, 0x8) REG32(IDR3, 0xc) + FIELD(IDR3, HAD, 2, 1); + FIELD(IDR3, RIL, 10, 1); REG32(IDR4, 0x10) REG32(IDR5, 0x14) FIELD(IDR5, OAS, 0, 3); @@ -63,7 +65,8 @@ REG32(IDR5, 0x14) #define SMMU_IDR5_OAS 4 -REG32(IIDR, 0x1c) +REG32(IIDR, 0x18) +REG32(AIDR, 0x1c) REG32(CR0, 0x20) FIELD(CR0, SMMU_ENABLE, 0, 1) FIELD(CR0, EVENTQEN, 2, 1) @@ -298,6 +301,8 @@ enum { /* Command completion notification */ }; #define CMD_TYPE(x) extract32((x)->word[0], 0 , 8) +#define CMD_NUM(x) extract32((x)->word[0], 12 , 5) +#define CMD_SCALE(x) extract32((x)->word[0], 20 , 5) #define CMD_SSEC(x) extract32((x)->word[0], 10, 1) #define CMD_SSV(x) extract32((x)->word[0], 11, 1) #define CMD_RESUME_AC(x) extract32((x)->word[0], 12, 1) @@ -310,6 +315,8 @@ enum { /* Command completion notification */ #define CMD_RESUME_STAG(x) extract32((x)->word[2], 0 , 16) #define CMD_RESP(x) extract32((x)->word[2], 11, 2) #define CMD_LEAF(x) extract32((x)->word[2], 0 , 1) +#define CMD_TTL(x) extract32((x)->word[2], 8 , 2) +#define CMD_TG(x) extract32((x)->word[2], 10, 2) #define CMD_STE_RANGE(x) extract32((x)->word[2], 0 , 5) #define CMD_ADDR(x) ({ \ uint64_t high = (uint64_t)(x)->word[3]; \ @@ -573,6 +580,7 @@ static inline int pa_range(STE *ste) lo = (x)->word[(sel) * 2 + 2] & ~0xfULL; \ hi | lo; \ }) +#define CD_HAD(x, sel) extract32((x)->word[(sel) * 2 + 2], 1, 1) #define CD_TSZ(x, sel) extract32((x)->word[0], (16 * (sel)) + 0, 6) #define CD_TG(x, sel) extract32((x)->word[0], (16 * (sel)) + 6, 2) diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c index 57a79df55b..0122700e72 100644 --- a/hw/arm/smmuv3.c +++ b/hw/arm/smmuv3.c @@ -254,6 +254,9 @@ static void smmuv3_init_regs(SMMUv3State *s) s->idr[1] = FIELD_DP32(s->idr[1], IDR1, EVENTQS, SMMU_EVENTQS); s->idr[1] = FIELD_DP32(s->idr[1], IDR1, CMDQS, SMMU_CMDQS); + s->idr[3] = FIELD_DP32(s->idr[3], IDR3, RIL, 1); + s->idr[3] = FIELD_DP32(s->idr[3], IDR3, HAD, 1); + /* 4K and 64K granule support */ s->idr[5] = FIELD_DP32(s->idr[5], IDR5, GRAN4K, 1); s->idr[5] = FIELD_DP32(s->idr[5], IDR5, GRAN64K, 1); @@ -270,6 +273,7 @@ static void smmuv3_init_regs(SMMUv3State *s) s->features = 0; s->sid_split = 0; + s->aidr = 0x1; } static int smmu_get_ste(SMMUv3State *s, dma_addr_t addr, STE *buf, @@ -506,7 +510,8 @@ static int decode_cd(SMMUTransCfg *cfg, CD *cd, SMMUEventInfo *event) if (tt->ttb & ~(MAKE_64BIT_MASK(0, cfg->oas))) { goto bad_cd; } - trace_smmuv3_decode_cd_tt(i, tt->tsz, tt->ttb, tt->granule_sz); + tt->had = CD_HAD(cd, i); + trace_smmuv3_decode_cd_tt(i, tt->tsz, tt->ttb, tt->granule_sz, tt->had); } event->record_trans_faults = CD_R(cd); @@ -626,7 +631,7 @@ static IOMMUTLBEntry smmuv3_translate(IOMMUMemoryRegion *mr, hwaddr addr, SMMUTranslationStatus status; SMMUState *bs = ARM_SMMU(s); uint64_t page_mask, aligned_addr; - IOMMUTLBEntry *cached_entry = NULL; + SMMUTLBEntry *cached_entry = NULL; SMMUTransTableInfo *tt; SMMUTransCfg *cfg = NULL; IOMMUTLBEntry entry = { @@ -636,7 +641,6 @@ static IOMMUTLBEntry smmuv3_translate(IOMMUMemoryRegion *mr, hwaddr addr, .addr_mask = ~(hwaddr)0, .perm = IOMMU_NONE, }; - SMMUIOTLBKey key, *new_key; qemu_mutex_lock(&s->mutex); @@ -675,17 +679,9 @@ static IOMMUTLBEntry smmuv3_translate(IOMMUMemoryRegion *mr, hwaddr addr, page_mask = (1ULL << (tt->granule_sz)) - 1; aligned_addr = addr & ~page_mask; - key.asid = cfg->asid; - key.iova = aligned_addr; - - cached_entry = g_hash_table_lookup(bs->iotlb, &key); + cached_entry = smmu_iotlb_lookup(bs, cfg, tt, aligned_addr); if (cached_entry) { - cfg->iotlb_hits++; - trace_smmu_iotlb_cache_hit(cfg->asid, aligned_addr, - cfg->iotlb_hits, cfg->iotlb_misses, - 100 * cfg->iotlb_hits / - (cfg->iotlb_hits + cfg->iotlb_misses)); - if ((flag & IOMMU_WO) && !(cached_entry->perm & IOMMU_WO)) { + if ((flag & IOMMU_WO) && !(cached_entry->entry.perm & IOMMU_WO)) { status = SMMU_TRANS_ERROR; if (event.record_trans_faults) { event.type = SMMU_EVT_F_PERMISSION; @@ -698,17 +694,7 @@ static IOMMUTLBEntry smmuv3_translate(IOMMUMemoryRegion *mr, hwaddr addr, goto epilogue; } - cfg->iotlb_misses++; - trace_smmu_iotlb_cache_miss(cfg->asid, addr & ~page_mask, - cfg->iotlb_hits, cfg->iotlb_misses, - 100 * cfg->iotlb_hits / - (cfg->iotlb_hits + cfg->iotlb_misses)); - - if (g_hash_table_size(bs->iotlb) >= SMMU_IOTLB_MAX_SIZE) { - smmu_iotlb_inv_all(bs); - } - - cached_entry = g_new0(IOMMUTLBEntry, 1); + cached_entry = g_new0(SMMUTLBEntry, 1); if (smmu_ptw(cfg, aligned_addr, flag, cached_entry, &ptw_info)) { g_free(cached_entry); @@ -753,10 +739,7 @@ static IOMMUTLBEntry smmuv3_translate(IOMMUMemoryRegion *mr, hwaddr addr, } status = SMMU_TRANS_ERROR; } else { - new_key = g_new0(SMMUIOTLBKey, 1); - new_key->asid = cfg->asid; - new_key->iova = aligned_addr; - g_hash_table_insert(bs->iotlb, new_key, cached_entry); + smmu_iotlb_insert(bs, cfg, cached_entry); status = SMMU_TRANS_SUCCESS; } @@ -765,9 +748,9 @@ epilogue: switch (status) { case SMMU_TRANS_SUCCESS: entry.perm = flag; - entry.translated_addr = cached_entry->translated_addr + - (addr & page_mask); - entry.addr_mask = cached_entry->addr_mask; + entry.translated_addr = cached_entry->entry.translated_addr + + (addr & cached_entry->entry.addr_mask); + entry.addr_mask = cached_entry->entry.addr_mask; trace_smmuv3_translate_success(mr->parent_obj.name, sid, addr, entry.translated_addr, entry.perm); break; @@ -807,42 +790,49 @@ epilogue: * @n: notifier to be called * @asid: address space ID or negative value if we don't care * @iova: iova + * @tg: translation granule (if communicated through range invalidation) + * @num_pages: number of @granule sized pages (if tg != 0), otherwise 1 */ static void smmuv3_notify_iova(IOMMUMemoryRegion *mr, IOMMUNotifier *n, - int asid, - dma_addr_t iova) + int asid, dma_addr_t iova, + uint8_t tg, uint64_t num_pages) { SMMUDevice *sdev = container_of(mr, SMMUDevice, iommu); - SMMUEventInfo event = {.inval_ste_allowed = true}; - SMMUTransTableInfo *tt; - SMMUTransCfg *cfg; IOMMUTLBEntry entry; + uint8_t granule = tg; - cfg = smmuv3_get_config(sdev, &event); - if (!cfg) { - return; - } + if (!tg) { + SMMUEventInfo event = {.inval_ste_allowed = true}; + SMMUTransCfg *cfg = smmuv3_get_config(sdev, &event); + SMMUTransTableInfo *tt; - if (asid >= 0 && cfg->asid != asid) { - return; - } + if (!cfg) { + return; + } - tt = select_tt(cfg, iova); - if (!tt) { - return; + if (asid >= 0 && cfg->asid != asid) { + return; + } + + tt = select_tt(cfg, iova); + if (!tt) { + return; + } + granule = tt->granule_sz; } entry.target_as = &address_space_memory; entry.iova = iova; - entry.addr_mask = (1 << tt->granule_sz) - 1; + entry.addr_mask = num_pages * (1 << granule) - 1; entry.perm = IOMMU_NONE; memory_region_notify_one(n, &entry); } -/* invalidate an asid/iova tuple in all mr's */ -static void smmuv3_inv_notifiers_iova(SMMUState *s, int asid, dma_addr_t iova) +/* invalidate an asid/iova range tuple in all mr's */ +static void smmuv3_inv_notifiers_iova(SMMUState *s, int asid, dma_addr_t iova, + uint8_t tg, uint64_t num_pages) { SMMUDevice *sdev; @@ -850,14 +840,41 @@ static void smmuv3_inv_notifiers_iova(SMMUState *s, int asid, dma_addr_t iova) IOMMUMemoryRegion *mr = &sdev->iommu; IOMMUNotifier *n; - trace_smmuv3_inv_notifiers_iova(mr->parent_obj.name, asid, iova); + trace_smmuv3_inv_notifiers_iova(mr->parent_obj.name, asid, iova, + tg, num_pages); IOMMU_NOTIFIER_FOREACH(n, mr) { - smmuv3_notify_iova(mr, n, asid, iova); + smmuv3_notify_iova(mr, n, asid, iova, tg, num_pages); } } } +static void smmuv3_s1_range_inval(SMMUState *s, Cmd *cmd) +{ + uint8_t scale = 0, num = 0, ttl = 0; + dma_addr_t addr = CMD_ADDR(cmd); + uint8_t type = CMD_TYPE(cmd); + uint16_t vmid = CMD_VMID(cmd); + bool leaf = CMD_LEAF(cmd); + uint8_t tg = CMD_TG(cmd); + hwaddr num_pages = 1; + int asid = -1; + + if (tg) { + scale = CMD_SCALE(cmd); + num = CMD_NUM(cmd); + ttl = CMD_TTL(cmd); + num_pages = (num + 1) * (1 << (scale)); + } + + if (type == SMMU_CMD_TLBI_NH_VA) { + asid = CMD_ASID(cmd); + } + trace_smmuv3_s1_range_inval(vmid, asid, addr, tg, num_pages, ttl, leaf); + smmuv3_inv_notifiers_iova(s, asid, addr, tg, num_pages); + smmu_iotlb_inv_iova(s, asid, addr, tg, num_pages, ttl); +} + static int smmuv3_cmdq_consume(SMMUv3State *s) { SMMUState *bs = ARM_SMMU(s); @@ -988,27 +1005,9 @@ static int smmuv3_cmdq_consume(SMMUv3State *s) smmu_iotlb_inv_all(bs); break; case SMMU_CMD_TLBI_NH_VAA: - { - dma_addr_t addr = CMD_ADDR(&cmd); - uint16_t vmid = CMD_VMID(&cmd); - - trace_smmuv3_cmdq_tlbi_nh_vaa(vmid, addr); - smmuv3_inv_notifiers_iova(bs, -1, addr); - smmu_iotlb_inv_all(bs); - break; - } case SMMU_CMD_TLBI_NH_VA: - { - uint16_t asid = CMD_ASID(&cmd); - uint16_t vmid = CMD_VMID(&cmd); - dma_addr_t addr = CMD_ADDR(&cmd); - bool leaf = CMD_LEAF(&cmd); - - trace_smmuv3_cmdq_tlbi_nh_va(vmid, asid, addr, leaf); - smmuv3_inv_notifiers_iova(bs, asid, addr); - smmu_iotlb_inv_iova(bs, asid, addr); + smmuv3_s1_range_inval(bs, &cmd); break; - } case SMMU_CMD_TLBI_EL3_ALL: case SMMU_CMD_TLBI_EL3_VA: case SMMU_CMD_TLBI_EL2_ALL: @@ -1257,6 +1256,9 @@ static MemTxResult smmu_readl(SMMUv3State *s, hwaddr offset, case A_IIDR: *data = s->iidr; return MEMTX_OK; + case A_AIDR: + *data = s->aidr; + return MEMTX_OK; case A_CR0: *data = s->cr[0]; return MEMTX_OK; diff --git a/hw/arm/trace-events b/hw/arm/trace-events index 0acedcedc6..c8a4d80f6b 100644 --- a/hw/arm/trace-events +++ b/hw/arm/trace-events @@ -14,6 +14,9 @@ smmu_iotlb_inv_all(void) "IOTLB invalidate all" smmu_iotlb_inv_asid(uint16_t asid) "IOTLB invalidate asid=%d" smmu_iotlb_inv_iova(uint16_t asid, uint64_t addr) "IOTLB invalidate asid=%d addr=0x%"PRIx64 smmu_inv_notifiers_mr(const char *name) "iommu mr=%s" +smmu_iotlb_lookup_hit(uint16_t asid, uint64_t addr, uint32_t hit, uint32_t miss, uint32_t p) "IOTLB cache HIT asid=%d addr=0x%"PRIx64" hit=%d miss=%d hit rate=%d" +smmu_iotlb_lookup_miss(uint16_t asid, uint64_t addr, uint32_t hit, uint32_t miss, uint32_t p) "IOTLB cache MISS asid=%d addr=0x%"PRIx64" hit=%d miss=%d hit rate=%d" +smmu_iotlb_insert(uint16_t asid, uint64_t addr, uint8_t tg, uint8_t level) "IOTLB ++ asid=%d addr=0x%"PRIx64" tg=%d level=%d" # smmuv3.c smmuv3_read_mmio(uint64_t addr, uint64_t val, unsigned size, uint32_t r) "addr: 0x%"PRIx64" val:0x%"PRIx64" size: 0x%x(%d)" @@ -36,20 +39,17 @@ smmuv3_translate_abort(const char *n, uint16_t sid, uint64_t addr, bool is_write smmuv3_translate_success(const char *n, uint16_t sid, uint64_t iova, uint64_t translated, int perm) "%s sid=%d iova=0x%"PRIx64" translated=0x%"PRIx64" perm=0x%x" smmuv3_get_cd(uint64_t addr) "CD addr: 0x%"PRIx64 smmuv3_decode_cd(uint32_t oas) "oas=%d" -smmuv3_decode_cd_tt(int i, uint32_t tsz, uint64_t ttb, uint32_t granule_sz) "TT[%d]:tsz:%d ttb:0x%"PRIx64" granule_sz:%d" +smmuv3_decode_cd_tt(int i, uint32_t tsz, uint64_t ttb, uint32_t granule_sz, bool had) "TT[%d]:tsz:%d ttb:0x%"PRIx64" granule_sz:%d had:%d" smmuv3_cmdq_cfgi_ste(int streamid) "streamid =%d" smmuv3_cmdq_cfgi_ste_range(int start, int end) "start=0x%d - end=0x%d" smmuv3_cmdq_cfgi_cd(uint32_t sid) "streamid = %d" smmuv3_config_cache_hit(uint32_t sid, uint32_t hits, uint32_t misses, uint32_t perc) "Config cache HIT for sid %d (hits=%d, misses=%d, hit rate=%d)" smmuv3_config_cache_miss(uint32_t sid, uint32_t hits, uint32_t misses, uint32_t perc) "Config cache MISS for sid %d (hits=%d, misses=%d, hit rate=%d)" -smmuv3_cmdq_tlbi_nh_va(int vmid, int asid, uint64_t addr, bool leaf) "vmid =%d asid =%d addr=0x%"PRIx64" leaf=%d" -smmuv3_cmdq_tlbi_nh_vaa(int vmid, uint64_t addr) "vmid =%d addr=0x%"PRIx64 +smmuv3_s1_range_inval(int vmid, int asid, uint64_t addr, uint8_t tg, uint64_t num_pages, uint8_t ttl, bool leaf) "vmid =%d asid =%d addr=0x%"PRIx64" tg=%d num_pages=0x%"PRIx64" ttl=%d leaf=%d" smmuv3_cmdq_tlbi_nh(void) "" smmuv3_cmdq_tlbi_nh_asid(uint16_t asid) "asid=%d" -smmu_iotlb_cache_hit(uint16_t asid, uint64_t addr, uint32_t hit, uint32_t miss, uint32_t p) "IOTLB cache HIT asid=%d addr=0x%"PRIx64" hit=%d miss=%d hit rate=%d" -smmu_iotlb_cache_miss(uint16_t asid, uint64_t addr, uint32_t hit, uint32_t miss, uint32_t p) "IOTLB cache MISS asid=%d addr=0x%"PRIx64" hit=%d miss=%d hit rate=%d" smmuv3_config_cache_inv(uint32_t sid) "Config cache INV for sid %d" smmuv3_notify_flag_add(const char *iommu) "ADD SMMUNotifier node for iommu mr=%s" smmuv3_notify_flag_del(const char *iommu) "DEL SMMUNotifier node for iommu mr=%s" -smmuv3_inv_notifiers_iova(const char *name, uint16_t asid, uint64_t iova) "iommu mr=%s asid=%d iova=0x%"PRIx64 +smmuv3_inv_notifiers_iova(const char *name, uint16_t asid, uint64_t iova, uint8_t tg, uint64_t num_pages) "iommu mr=%s asid=%d iova=0x%"PRIx64" tg=%d num_pages=0x%"PRIx64 diff --git a/hw/arm/trace.h b/hw/arm/trace.h new file mode 100644 index 0000000000..91337aa6b0 --- /dev/null +++ b/hw/arm/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_arm.h" diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c index 9dc93182b6..9127579984 100644 --- a/hw/arm/versatilepb.c +++ b/hw/arm/versatilepb.c @@ -25,6 +25,7 @@ #include "hw/block/flash.h" #include "qemu/error-report.h" #include "hw/char/pl011.h" +#include "hw/sd/sd.h" #define VERSATILE_FLASH_ADDR 0x34000000 #define VERSATILE_FLASH_SIZE (64 * 1024 * 1024) @@ -309,8 +310,29 @@ static void versatile_init(MachineState *machine, int board_id) /* Wire up the mux control signals from the SYS_CLCD register */ qdev_connect_gpio_out(sysctl, 0, qdev_get_gpio_in(dev, 0)); - sysbus_create_varargs("pl181", 0x10005000, sic[22], sic[1], NULL); - sysbus_create_varargs("pl181", 0x1000b000, sic[23], sic[2], NULL); + dev = sysbus_create_varargs("pl181", 0x10005000, sic[22], sic[1], NULL); + dinfo = drive_get_next(IF_SD); + if (dinfo) { + DeviceState *card; + + card = qdev_new(TYPE_SD_CARD); + qdev_prop_set_drive_err(card, "drive", blk_by_legacy_dinfo(dinfo), + &error_fatal); + qdev_realize_and_unref(card, qdev_get_child_bus(dev, "sd-bus"), + &error_fatal); + } + + dev = sysbus_create_varargs("pl181", 0x1000b000, sic[23], sic[2], NULL); + dinfo = drive_get_next(IF_SD); + if (dinfo) { + DeviceState *card; + + card = qdev_new(TYPE_SD_CARD); + qdev_prop_set_drive_err(card, "drive", blk_by_legacy_dinfo(dinfo), + &error_fatal); + qdev_realize_and_unref(card, qdev_get_child_bus(dev, "sd-bus"), + &error_fatal); + } /* Add PL031 Real Time Clock. */ sysbus_create_simple("pl031", 0x101e8000, pic[10]); diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index 1dc971c34f..95405f5940 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -43,6 +43,7 @@ #include "hw/cpu/a9mpcore.h" #include "hw/cpu/a15mpcore.h" #include "hw/i2c/arm_sbcon_i2c.h" +#include "hw/sd/sd.h" #define VEXPRESS_BOARD_ID 0x8e0 #define VEXPRESS_FLASH_SIZE (64 * 1024 * 1024) @@ -624,10 +625,20 @@ static void vexpress_common_init(MachineState *machine) dev = sysbus_create_varargs("pl181", map[VE_MMCI], pic[9], pic[10], NULL); /* Wire up MMC card detect and read-only signals */ - qdev_connect_gpio_out(dev, 0, + qdev_connect_gpio_out_named(dev, "card-read-only", 0, qdev_get_gpio_in(sysctl, ARM_SYSCTL_GPIO_MMC_WPROT)); - qdev_connect_gpio_out(dev, 1, + qdev_connect_gpio_out_named(dev, "card-inserted", 0, qdev_get_gpio_in(sysctl, ARM_SYSCTL_GPIO_MMC_CARDIN)); + dinfo = drive_get_next(IF_SD); + if (dinfo) { + DeviceState *card; + + card = qdev_new(TYPE_SD_CARD); + qdev_prop_set_drive_err(card, "drive", blk_by_legacy_dinfo(dinfo), + &error_fatal); + qdev_realize_and_unref(card, qdev_get_child_bus(dev, "sd-bus"), + &error_fatal); + } sysbus_create_simple("pl050_keyboard", map[VE_KMI0], pic[12]); sysbus_create_simple("pl050_mouse", map[VE_KMI1], pic[13]); diff --git a/hw/arm/virt.c b/hw/arm/virt.c index ecfee362a1..acf9bfbece 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2546,10 +2546,17 @@ static void machvirt_machine_init(void) } type_init(machvirt_machine_init); +static void virt_machine_5_2_options(MachineClass *mc) +{ +} +DEFINE_VIRT_MACHINE_AS_LATEST(5, 2) + static void virt_machine_5_1_options(MachineClass *mc) { + virt_machine_5_2_options(mc); + compat_props_add(mc->compat_props, hw_compat_5_1, hw_compat_5_1_len); } -DEFINE_VIRT_MACHINE_AS_LATEST(5, 1) +DEFINE_VIRT_MACHINE(5, 1) static void virt_machine_5_0_options(MachineClass *mc) { diff --git a/hw/audio/Makefile.objs b/hw/audio/Makefile.objs deleted file mode 100644 index 63db383709..0000000000 --- a/hw/audio/Makefile.objs +++ /dev/null @@ -1,18 +0,0 @@ -# Sound -common-obj-$(CONFIG_SB16) += sb16.o -common-obj-$(CONFIG_ES1370) += es1370.o -common-obj-$(CONFIG_AC97) += ac97.o -common-obj-$(CONFIG_ADLIB) += fmopl.o adlib.o -common-obj-$(CONFIG_GUS) += gus.o gusemu_hal.o gusemu_mixer.o -common-obj-$(CONFIG_CS4231A) += cs4231a.o -common-obj-$(CONFIG_HDA) += intel-hda.o hda-codec.o - -common-obj-$(CONFIG_PCSPK) += pcspk.o -common-obj-$(CONFIG_WM8750) += wm8750.o -common-obj-$(CONFIG_PL041) += pl041.o lm4549.o - -common-obj-$(CONFIG_CS4231) += cs4231.o -common-obj-$(CONFIG_MARVELL_88W8618) += marvell_88w8618.o -common-obj-$(CONFIG_MILKYMIST) += milkymist-ac97.o - -common-obj-y += soundhw.o diff --git a/hw/audio/meson.build b/hw/audio/meson.build new file mode 100644 index 0000000000..549e9a0396 --- /dev/null +++ b/hw/audio/meson.build @@ -0,0 +1,14 @@ +softmmu_ss.add(files('soundhw.c')) +softmmu_ss.add(when: 'CONFIG_AC97', if_true: files('ac97.c')) +softmmu_ss.add(when: 'CONFIG_ADLIB', if_true: files('fmopl.c', 'adlib.c')) +softmmu_ss.add(when: 'CONFIG_CS4231', if_true: files('cs4231.c')) +softmmu_ss.add(when: 'CONFIG_CS4231A', if_true: files('cs4231a.c')) +softmmu_ss.add(when: 'CONFIG_ES1370', if_true: files('es1370.c')) +softmmu_ss.add(when: 'CONFIG_GUS', if_true: files('gus.c', 'gusemu_hal.c', 'gusemu_mixer.c')) +softmmu_ss.add(when: 'CONFIG_HDA', if_true: files('intel-hda.c', 'hda-codec.c')) +softmmu_ss.add(when: 'CONFIG_MARVELL_88W8618', if_true: files('marvell_88w8618.c')) +softmmu_ss.add(when: 'CONFIG_MILKYMIST', if_true: files('milkymist-ac97.c')) +softmmu_ss.add(when: 'CONFIG_PCSPK', if_true: files('pcspk.c')) +softmmu_ss.add(when: 'CONFIG_PL041', if_true: files('pl041.c', 'lm4549.c')) +softmmu_ss.add(when: 'CONFIG_SB16', if_true: files('sb16.c')) +softmmu_ss.add(when: 'CONFIG_WM8750', if_true: files('wm8750.c')) diff --git a/hw/audio/trace.h b/hw/audio/trace.h new file mode 100644 index 0000000000..5c7516a4d1 --- /dev/null +++ b/hw/audio/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_audio.h" diff --git a/hw/avr/Makefile.objs b/hw/avr/Makefile.objs deleted file mode 100644 index 4dca064bfc..0000000000 --- a/hw/avr/Makefile.objs +++ /dev/null @@ -1,3 +0,0 @@ -obj-y += boot.o -obj-$(CONFIG_AVR_ATMEGA_MCU) += atmega.o -obj-$(CONFIG_ARDUINO) += arduino.o diff --git a/hw/avr/meson.build b/hw/avr/meson.build new file mode 100644 index 0000000000..46d53fb17e --- /dev/null +++ b/hw/avr/meson.build @@ -0,0 +1,6 @@ +avr_ss = ss.source_set() +avr_ss.add(files('boot.c')) +avr_ss.add(when: 'CONFIG_AVR_ATMEGA_MCU', if_true: files('atmega.c')) +avr_ss.add(when: 'CONFIG_ARDUINO', if_true: files('arduino.c')) + +hw_arch += {'avr': avr_ss} diff --git a/hw/block/Makefile.objs b/hw/block/Makefile.objs deleted file mode 100644 index 8855c22656..0000000000 --- a/hw/block/Makefile.objs +++ /dev/null @@ -1,18 +0,0 @@ -common-obj-y += block.o cdrom.o hd-geometry.o -common-obj-$(CONFIG_FDC) += fdc.o -common-obj-$(CONFIG_SSI_M25P80) += m25p80.o -common-obj-$(CONFIG_NAND) += nand.o -common-obj-$(CONFIG_PFLASH_CFI01) += pflash_cfi01.o -common-obj-$(CONFIG_PFLASH_CFI02) += pflash_cfi02.o -common-obj-$(CONFIG_XEN) += xen-block.o -common-obj-$(CONFIG_ECC) += ecc.o -common-obj-$(CONFIG_ONENAND) += onenand.o -common-obj-$(CONFIG_SWIM) += swim.o - -common-obj-$(CONFIG_SH4) += tc58128.o - -obj-$(CONFIG_VIRTIO_BLK) += virtio-blk.o -obj-$(CONFIG_VHOST_USER_BLK) += vhost-user-blk.o -common-obj-$(CONFIG_NVME_PCI) += nvme.o - -obj-y += dataplane/ diff --git a/hw/block/dataplane/Makefile.objs b/hw/block/dataplane/Makefile.objs deleted file mode 100644 index 0c5270268e..0000000000 --- a/hw/block/dataplane/Makefile.objs +++ /dev/null @@ -1,2 +0,0 @@ -obj-$(CONFIG_VIRTIO_BLK) += virtio-blk.o -obj-$(CONFIG_XEN) += xen-block.o diff --git a/hw/block/dataplane/meson.build b/hw/block/dataplane/meson.build new file mode 100644 index 0000000000..12c6a264f1 --- /dev/null +++ b/hw/block/dataplane/meson.build @@ -0,0 +1,2 @@ +specific_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-blk.c')) +specific_ss.add(when: 'CONFIG_XEN', if_true: files('xen-block.c')) diff --git a/hw/block/dataplane/trace.h b/hw/block/dataplane/trace.h new file mode 100644 index 0000000000..240cc59834 --- /dev/null +++ b/hw/block/dataplane/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_block_dataplane.h" diff --git a/hw/block/meson.build b/hw/block/meson.build new file mode 100644 index 0000000000..78cad8f7cb --- /dev/null +++ b/hw/block/meson.build @@ -0,0 +1,21 @@ +softmmu_ss.add(files( + 'block.c', + 'cdrom.c', + 'hd-geometry.c' +)) +softmmu_ss.add(when: 'CONFIG_ECC', if_true: files('ecc.c')) +softmmu_ss.add(when: 'CONFIG_FDC', if_true: files('fdc.c')) +softmmu_ss.add(when: 'CONFIG_NAND', if_true: files('nand.c')) +softmmu_ss.add(when: 'CONFIG_ONENAND', if_true: files('onenand.c')) +softmmu_ss.add(when: 'CONFIG_PFLASH_CFI01', if_true: files('pflash_cfi01.c')) +softmmu_ss.add(when: 'CONFIG_PFLASH_CFI02', if_true: files('pflash_cfi02.c')) +softmmu_ss.add(when: 'CONFIG_SSI_M25P80', if_true: files('m25p80.c')) +softmmu_ss.add(when: 'CONFIG_SWIM', if_true: files('swim.c')) +softmmu_ss.add(when: 'CONFIG_XEN', if_true: files('xen-block.c')) +softmmu_ss.add(when: 'CONFIG_SH4', if_true: files('tc58128.c')) +softmmu_ss.add(when: 'CONFIG_NVME_PCI', if_true: files('nvme.c')) + +specific_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-blk.c')) +specific_ss.add(when: 'CONFIG_VHOST_USER_BLK', if_true: files('vhost-user-blk.c')) + +subdir('dataplane') diff --git a/hw/block/trace.h b/hw/block/trace.h new file mode 100644 index 0000000000..cde210ae69 --- /dev/null +++ b/hw/block/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_block.h" diff --git a/hw/char/Makefile.objs b/hw/char/Makefile.objs deleted file mode 100644 index bf177ac41d..0000000000 --- a/hw/char/Makefile.objs +++ /dev/null @@ -1,39 +0,0 @@ -common-obj-$(CONFIG_IPACK) += ipoctal232.o -common-obj-$(CONFIG_ESCC) += escc.o -common-obj-$(CONFIG_NRF51_SOC) += nrf51_uart.o -common-obj-$(CONFIG_PARALLEL) += parallel.o -common-obj-$(CONFIG_ISA_BUS) += parallel-isa.o -common-obj-$(CONFIG_PL011) += pl011.o -common-obj-$(CONFIG_SERIAL) += serial.o -common-obj-$(CONFIG_SERIAL_ISA) += serial-isa.o -common-obj-$(CONFIG_SERIAL_PCI) += serial-pci.o -common-obj-$(CONFIG_SERIAL_PCI_MULTI) += serial-pci-multi.o -common-obj-$(CONFIG_VIRTIO_SERIAL) += virtio-console.o -common-obj-$(CONFIG_XILINX) += xilinx_uartlite.o -common-obj-$(CONFIG_XEN) += xen_console.o -common-obj-$(CONFIG_CADENCE) += cadence_uart.o -common-obj-$(CONFIG_IBEX) += ibex_uart.o - -common-obj-$(CONFIG_EXYNOS4) += exynos4210_uart.o -common-obj-$(CONFIG_COLDFIRE) += mcf_uart.o -common-obj-$(CONFIG_OMAP) += omap_uart.o -common-obj-$(CONFIG_SH4) += sh_serial.o -common-obj-$(CONFIG_DIGIC) += digic-uart.o -common-obj-$(CONFIG_STM32F2XX_USART) += stm32f2xx_usart.o -common-obj-$(CONFIG_RASPI) += bcm2835_aux.o -common-obj-$(CONFIG_RENESAS_SCI) += renesas_sci.o -common-obj-$(CONFIG_AVR_USART) += avr_usart.o - -common-obj-$(CONFIG_CMSDK_APB_UART) += cmsdk-apb-uart.o -common-obj-$(CONFIG_ETRAXFS) += etraxfs_ser.o -common-obj-$(CONFIG_ISA_DEBUG) += debugcon.o -common-obj-$(CONFIG_GRLIB) += grlib_apbuart.o -common-obj-$(CONFIG_IMX) += imx_serial.o -common-obj-$(CONFIG_LM32) += lm32_juart.o -common-obj-$(CONFIG_LM32) += lm32_uart.o -common-obj-$(CONFIG_MILKYMIST) += milkymist-uart.o -common-obj-$(CONFIG_SCLPCONSOLE) += sclpconsole.o sclpconsole-lm.o - -obj-$(CONFIG_VIRTIO) += virtio-serial-bus.o -obj-$(CONFIG_PSERIES) += spapr_vty.o -obj-$(CONFIG_TERMINAL3270) += terminal3270.o diff --git a/hw/char/meson.build b/hw/char/meson.build new file mode 100644 index 0000000000..e888215145 --- /dev/null +++ b/hw/char/meson.build @@ -0,0 +1,38 @@ +softmmu_ss.add(when: 'CONFIG_CADENCE', if_true: files('cadence_uart.c')) +softmmu_ss.add(when: 'CONFIG_CMSDK_APB_UART', if_true: files('cmsdk-apb-uart.c')) +softmmu_ss.add(when: 'CONFIG_ESCC', if_true: files('escc.c')) +softmmu_ss.add(when: 'CONFIG_ETRAXFS', if_true: files('etraxfs_ser.c')) +softmmu_ss.add(when: 'CONFIG_GRLIB', if_true: files('grlib_apbuart.c')) +softmmu_ss.add(when: 'CONFIG_IBEX', if_true: files('ibex_uart.c')) +softmmu_ss.add(when: 'CONFIG_IMX', if_true: files('imx_serial.c')) +softmmu_ss.add(when: 'CONFIG_IPACK', if_true: files('ipoctal232.c')) +softmmu_ss.add(when: 'CONFIG_ISA_BUS', if_true: files('parallel-isa.c')) +softmmu_ss.add(when: 'CONFIG_ISA_DEBUG', if_true: files('debugcon.c')) +softmmu_ss.add(when: 'CONFIG_LM32', if_true: files('lm32_juart.c')) +softmmu_ss.add(when: 'CONFIG_LM32', if_true: files('lm32_uart.c')) +softmmu_ss.add(when: 'CONFIG_MILKYMIST', if_true: files('milkymist-uart.c')) +softmmu_ss.add(when: 'CONFIG_NRF51_SOC', if_true: files('nrf51_uart.c')) +softmmu_ss.add(when: 'CONFIG_PARALLEL', if_true: files('parallel.c')) +softmmu_ss.add(when: 'CONFIG_PL011', if_true: files('pl011.c')) +softmmu_ss.add(when: 'CONFIG_SCLPCONSOLE', if_true: files('sclpconsole.c', 'sclpconsole-lm.c')) +softmmu_ss.add(when: 'CONFIG_SERIAL', if_true: files('serial.c')) +softmmu_ss.add(when: 'CONFIG_SERIAL_ISA', if_true: files('serial-isa.c')) +softmmu_ss.add(when: 'CONFIG_SERIAL_PCI', if_true: files('serial-pci.c')) +softmmu_ss.add(when: 'CONFIG_SERIAL_PCI_MULTI', if_true: files('serial-pci-multi.c')) +softmmu_ss.add(when: 'CONFIG_VIRTIO_SERIAL', if_true: files('virtio-console.c')) +softmmu_ss.add(when: 'CONFIG_XEN', if_true: files('xen_console.c')) +softmmu_ss.add(when: 'CONFIG_XILINX', if_true: files('xilinx_uartlite.c')) + +softmmu_ss.add(when: 'CONFIG_AVR_USART', if_true: files('avr_usart.c')) +softmmu_ss.add(when: 'CONFIG_COLDFIRE', if_true: files('mcf_uart.c')) +softmmu_ss.add(when: 'CONFIG_DIGIC', if_true: files('digic-uart.c')) +softmmu_ss.add(when: 'CONFIG_EXYNOS4', if_true: files('exynos4210_uart.c')) +softmmu_ss.add(when: 'CONFIG_OMAP', if_true: files('omap_uart.c')) +softmmu_ss.add(when: 'CONFIG_RASPI', if_true: files('bcm2835_aux.c')) +softmmu_ss.add(when: 'CONFIG_RENESAS_SCI', if_true: files('renesas_sci.c')) +softmmu_ss.add(when: 'CONFIG_SH4', if_true: files('sh_serial.c')) +softmmu_ss.add(when: 'CONFIG_STM32F2XX_USART', if_true: files('stm32f2xx_usart.c')) + +specific_ss.add(when: 'CONFIG_TERMINAL3270', if_true: files('terminal3270.c')) +specific_ss.add(when: 'CONFIG_VIRTIO', if_true: files('virtio-serial-bus.c')) +specific_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr_vty.c')) diff --git a/hw/char/trace.h b/hw/char/trace.h new file mode 100644 index 0000000000..c2df66af2e --- /dev/null +++ b/hw/char/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_char.h" diff --git a/hw/core/Makefile.objs b/hw/core/Makefile.objs deleted file mode 100644 index d8fee8effe..0000000000 --- a/hw/core/Makefile.objs +++ /dev/null @@ -1,34 +0,0 @@ -# core qdev-related obj files, also used by *-user: -common-obj-y += qdev.o qdev-properties.o -common-obj-y += bus.o -common-obj-y += cpu.o -common-obj-y += resettable.o -common-obj-y += hotplug.o -common-obj-y += vmstate-if.o -# irq.o needed for qdev GPIO handling: -common-obj-y += irq.o -common-obj-y += clock.o qdev-clock.o - -common-obj-$(CONFIG_SOFTMMU) += reset.o -common-obj-$(CONFIG_SOFTMMU) += qdev-fw.o -common-obj-$(CONFIG_SOFTMMU) += fw-path-provider.o -common-obj-$(CONFIG_SOFTMMU) += nmi.o -common-obj-$(CONFIG_SOFTMMU) += vm-change-state-handler.o -common-obj-$(CONFIG_SOFTMMU) += qdev-properties-system.o -common-obj-$(CONFIG_SOFTMMU) += sysbus.o -common-obj-$(CONFIG_SOFTMMU) += machine.o -common-obj-$(CONFIG_SOFTMMU) += null-machine.o -common-obj-$(CONFIG_SOFTMMU) += loader.o -common-obj-$(CONFIG_SOFTMMU) += machine-hmp-cmds.o -common-obj-$(CONFIG_SOFTMMU) += numa.o -common-obj-$(CONFIG_SOFTMMU) += clock-vmstate.o -obj-$(CONFIG_SOFTMMU) += machine-qmp-cmds.o - -common-obj-$(CONFIG_XILINX_AXI) += stream.o -common-obj-$(CONFIG_PTIMER) += ptimer.o -common-obj-$(CONFIG_FITLOADER) += loader-fit.o -common-obj-$(CONFIG_REGISTER) += register.o -common-obj-$(CONFIG_OR_IRQ) += or-irq.o -common-obj-$(CONFIG_SPLIT_IRQ) += split-irq.o -common-obj-$(CONFIG_PLATFORM_BUS) += platform-bus.o -common-obj-$(CONFIG_GENERIC_LOADER) += generic-loader.o diff --git a/hw/core/cpu.c b/hw/core/cpu.c index 594441a150..22bc3f974a 100644 --- a/hw/core/cpu.c +++ b/hw/core/cpu.c @@ -31,7 +31,7 @@ #include "sysemu/tcg.h" #include "hw/boards.h" #include "hw/qdev-properties.h" -#include "trace-root.h" +#include "trace/trace-root.h" #include "qemu/plugin.h" CPUInterruptHandler cpu_interrupt_handler; diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index 963088b798..21551221ad 100644 --- a/hw/core/machine-qmp-cmds.c +++ b/hw/core/machine-qmp-cmds.c @@ -238,6 +238,10 @@ MachineInfoList *qmp_query_machines(Error **errp) info->default_cpu_type = g_strdup(mc->default_cpu_type); info->has_default_cpu_type = true; } + if (mc->default_ram_id) { + info->default_ram_id = g_strdup(mc->default_ram_id); + info->has_default_ram_id = true; + } entry = g_malloc0(sizeof(*entry)); entry->value = info; diff --git a/hw/core/machine.c b/hw/core/machine.c index 8d1a90c6cf..cf5f2dfaeb 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -28,6 +28,9 @@ #include "hw/mem/nvdimm.h" #include "migration/vmstate.h" +GlobalProperty hw_compat_5_1[] = {}; +const size_t hw_compat_5_1_len = G_N_ELEMENTS(hw_compat_5_1); + GlobalProperty hw_compat_5_0[] = { { "pci-host-bridge", "x-config-reg-migration-enabled", "off" }, { "virtio-balloon-device", "page-poison", "false" }, diff --git a/hw/core/meson.build b/hw/core/meson.build new file mode 100644 index 0000000000..fc91f98075 --- /dev/null +++ b/hw/core/meson.build @@ -0,0 +1,49 @@ +# core qdev-related obj files, also used by *-user and unit tests +hwcore_files = files( + 'bus.c', + 'fw-path-provider.c', + 'hotplug.c', + 'qdev-properties.c', + 'qdev.c', + 'reset.c', + 'resettable.c', + 'vmstate-if.c', + # irq.c needed for qdev GPIO handling: + 'irq.c', + 'clock.c', + 'qdev-clock.c', +) + +libhwcore = static_library('hwcore', sources: hwcore_files + genh, + name_suffix: 'fa', + build_by_default: false) +hwcore = declare_dependency(link_whole: libhwcore) +common_ss.add(hwcore) + +common_ss.add(files('cpu.c')) +common_ss.add(when: 'CONFIG_FITLOADER', if_true: files('loader-fit.c')) +common_ss.add(when: 'CONFIG_GENERIC_LOADER', if_true: files('generic-loader.c')) +common_ss.add(when: 'CONFIG_OR_IRQ', if_true: files('or-irq.c')) +common_ss.add(when: 'CONFIG_PLATFORM_BUS', if_true: files('platform-bus.c')) +common_ss.add(when: 'CONFIG_PTIMER', if_true: files('ptimer.c')) +common_ss.add(when: 'CONFIG_REGISTER', if_true: files('register.c')) +common_ss.add(when: 'CONFIG_SPLIT_IRQ', if_true: files('split-irq.c')) +common_ss.add(when: 'CONFIG_XILINX_AXI', if_true: files('stream.c')) + +softmmu_ss.add(files( + 'loader.c', + 'machine-hmp-cmds.c', + 'machine.c', + 'nmi.c', + 'null-machine.c', + 'qdev-fw.c', + 'qdev-properties-system.c', + 'sysbus.c', + 'vm-change-state-handler.c', + 'clock-vmstate.c', +)) + +specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: files( + 'machine-qmp-cmds.c', + 'numa.c', +)) diff --git a/hw/core/trace.h b/hw/core/trace.h new file mode 100644 index 0000000000..23dfd61c49 --- /dev/null +++ b/hw/core/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_core.h" diff --git a/hw/cpu/Makefile.objs b/hw/cpu/Makefile.objs deleted file mode 100644 index 8db9e8a7b3..0000000000 --- a/hw/cpu/Makefile.objs +++ /dev/null @@ -1,5 +0,0 @@ -obj-$(CONFIG_ARM11MPCORE) += arm11mpcore.o -obj-$(CONFIG_REALVIEW) += realview_mpcore.o -obj-$(CONFIG_A9MPCORE) += a9mpcore.o -obj-$(CONFIG_A15MPCORE) += a15mpcore.o -common-obj-y += core.o cluster.o diff --git a/hw/cpu/a9mpcore.c b/hw/cpu/a9mpcore.c index 351295e518..ec186d49ab 100644 --- a/hw/cpu/a9mpcore.c +++ b/hw/cpu/a9mpcore.c @@ -15,6 +15,7 @@ #include "hw/irq.h" #include "hw/qdev-properties.h" #include "hw/core/cpu.h" +#include "cpu.h" #define A9_GIC_NUM_PRIORITY_BITS 5 @@ -52,8 +53,18 @@ static void a9mp_priv_realize(DeviceState *dev, Error **errp) *wdtbusdev; int i; bool has_el3; + CPUState *cpu0; Object *cpuobj; + cpu0 = qemu_get_cpu(0); + cpuobj = OBJECT(cpu0); + if (strcmp(object_get_typename(cpuobj), ARM_CPU_TYPE_NAME("cortex-a9"))) { + /* We might allow Cortex-A5 once we model it */ + error_setg(errp, + "Cortex-A9MPCore peripheral can only use Cortex-A9 CPU"); + return; + } + scudev = DEVICE(&s->scu); qdev_prop_set_uint32(scudev, "num-cpu", s->num_cpu); if (!sysbus_realize(SYS_BUS_DEVICE(&s->scu), errp)) { @@ -70,7 +81,6 @@ static void a9mp_priv_realize(DeviceState *dev, Error **errp) /* Make the GIC's TZ support match the CPUs. We assume that * either all the CPUs have TZ, or none do. */ - cpuobj = OBJECT(qemu_get_cpu(0)); has_el3 = object_property_find(cpuobj, "has_el3", NULL) && object_property_get_bool(cpuobj, "has_el3", &error_abort); qdev_prop_set_bit(gicdev, "has-security-extensions", has_el3); diff --git a/hw/cpu/meson.build b/hw/cpu/meson.build new file mode 100644 index 0000000000..9e52fee9e7 --- /dev/null +++ b/hw/cpu/meson.build @@ -0,0 +1,6 @@ +softmmu_ss.add(files('core.c', 'cluster.c')) + +specific_ss.add(when: 'CONFIG_ARM11MPCORE', if_true: files('arm11mpcore.c')) +specific_ss.add(when: 'CONFIG_REALVIEW', if_true: files('realview_mpcore.c')) +specific_ss.add(when: 'CONFIG_A9MPCORE', if_true: files('a9mpcore.c')) +specific_ss.add(when: 'CONFIG_A15MPCORE', if_true: files('a15mpcore.c')) diff --git a/hw/cris/Makefile.objs b/hw/cris/Makefile.objs deleted file mode 100644 index a4a27b3a13..0000000000 --- a/hw/cris/Makefile.objs +++ /dev/null @@ -1,2 +0,0 @@ -obj-y += boot.o -obj-$(CONFIG_AXIS) += axis_dev88.o diff --git a/hw/cris/meson.build b/hw/cris/meson.build new file mode 100644 index 0000000000..dc808a4e0f --- /dev/null +++ b/hw/cris/meson.build @@ -0,0 +1,5 @@ +cris_ss = ss.source_set() +cris_ss.add(files('boot.c')) +cris_ss.add(when: 'CONFIG_AXIS', if_true: files('axis_dev88.c')) + +hw_arch += {'cris': cris_ss} diff --git a/hw/display/Makefile.objs b/hw/display/Makefile.objs deleted file mode 100644 index d619594ad4..0000000000 --- a/hw/display/Makefile.objs +++ /dev/null @@ -1,65 +0,0 @@ -common-obj-$(CONFIG_DDC) += i2c-ddc.o -common-obj-$(CONFIG_EDID) += edid-generate.o edid-region.o - -common-obj-$(CONFIG_FW_CFG_DMA) += ramfb.o -common-obj-$(CONFIG_FW_CFG_DMA) += ramfb-standalone.o - -common-obj-$(CONFIG_ADS7846) += ads7846.o -common-obj-$(CONFIG_VGA_CIRRUS) += cirrus_vga.o -common-obj-$(call land,$(CONFIG_VGA_CIRRUS),$(CONFIG_VGA_ISA))+=cirrus_vga_isa.o -common-obj-$(CONFIG_G364FB) += g364fb.o -common-obj-$(CONFIG_JAZZ_LED) += jazz_led.o -common-obj-$(CONFIG_PL110) += pl110.o -common-obj-$(CONFIG_SII9022) += sii9022.o -common-obj-$(CONFIG_SSD0303) += ssd0303.o -common-obj-$(CONFIG_SSD0323) += ssd0323.o -common-obj-$(CONFIG_XEN) += xenfb.o - -common-obj-$(CONFIG_VGA_PCI) += vga-pci.o -common-obj-$(CONFIG_VGA_ISA) += vga-isa.o -common-obj-$(CONFIG_VGA_ISA_MM) += vga-isa-mm.o -common-obj-$(CONFIG_VMWARE_VGA) += vmware_vga.o -common-obj-$(CONFIG_BOCHS_DISPLAY) += bochs-display.o - -common-obj-$(CONFIG_BLIZZARD) += blizzard.o -common-obj-$(CONFIG_EXYNOS4) += exynos4210_fimd.o -common-obj-$(CONFIG_FRAMEBUFFER) += framebuffer.o -common-obj-$(CONFIG_MILKYMIST) += milkymist-vgafb.o -common-obj-$(CONFIG_ZAURUS) += tc6393xb.o -common-obj-$(CONFIG_MACFB) += macfb.o - -obj-$(CONFIG_MILKYMIST_TMU2) += milkymist-tmu2.o -milkymist-tmu2.o-cflags := $(X11_CFLAGS) $(OPENGL_CFLAGS) -milkymist-tmu2.o-libs := $(X11_LIBS) $(OPENGL_LIBS) - -common-obj-$(CONFIG_OMAP) += omap_dss.o -obj-$(CONFIG_OMAP) += omap_lcdc.o -common-obj-$(CONFIG_PXA2XX) += pxa2xx_lcd.o -common-obj-$(CONFIG_RASPI) += bcm2835_fb.o -common-obj-$(CONFIG_SM501) += sm501.o -common-obj-$(CONFIG_TCX) += tcx.o -common-obj-$(CONFIG_CG3) += cg3.o -common-obj-$(CONFIG_NEXTCUBE) += next-fb.o -common-obj-$(CONFIG_ARTIST) += artist.o - -obj-$(CONFIG_VGA) += vga.o - -ifeq ($(CONFIG_QXL),y) -common-obj-m += qxl.mo -qxl.mo-objs = qxl.o qxl-logger.o qxl-render.o -endif - -common-obj-$(CONFIG_VIRTIO_GPU) += virtio-gpu-base.o virtio-gpu.o virtio-gpu-3d.o -common-obj-$(CONFIG_VHOST_USER_GPU) += vhost-user-gpu.o -common-obj-$(call land,$(CONFIG_VIRTIO_GPU),$(CONFIG_VIRTIO_PCI)) += virtio-gpu-pci.o -common-obj-$(call land,$(CONFIG_VHOST_USER_GPU),$(CONFIG_VIRTIO_PCI)) += vhost-user-gpu-pci.o -common-obj-$(CONFIG_VIRTIO_VGA) += virtio-vga.o -common-obj-$(CONFIG_VHOST_USER_VGA) += vhost-user-vga.o -virtio-gpu.o-cflags := $(VIRGL_CFLAGS) -virtio-gpu.o-libs += $(VIRGL_LIBS) -virtio-gpu-3d.o-cflags := $(VIRGL_CFLAGS) -virtio-gpu-3d.o-libs += $(VIRGL_LIBS) -common-obj-$(CONFIG_DPCD) += dpcd.o -common-obj-$(CONFIG_XLNX_ZYNQMP_ARM) += xlnx_dp.o - -common-obj-$(CONFIG_ATI_VGA) += ati.o ati_2d.o ati_dbg.o diff --git a/hw/display/meson.build b/hw/display/meson.build new file mode 100644 index 0000000000..78adaf9db4 --- /dev/null +++ b/hw/display/meson.build @@ -0,0 +1,84 @@ +hw_display_modules = {} + +softmmu_ss.add(when: 'CONFIG_DDC', if_true: files('i2c-ddc.c')) +softmmu_ss.add(when: 'CONFIG_EDID', if_true: files('edid-generate.c', 'edid-region.c')) + +softmmu_ss.add(when: 'CONFIG_FW_CFG_DMA', if_true: files('ramfb.c')) +softmmu_ss.add(when: 'CONFIG_FW_CFG_DMA', if_true: files('ramfb-standalone.c')) + +softmmu_ss.add(when: 'CONFIG_ADS7846', if_true: files('ads7846.c')) +softmmu_ss.add(when: 'CONFIG_VGA_CIRRUS', if_true: files('cirrus_vga.c')) +softmmu_ss.add(when: ['CONFIG_VGA_CIRRUS', 'CONFIG_VGA_ISA'], if_true: files('cirrus_vga_isa.c')) +softmmu_ss.add(when: 'CONFIG_G364FB', if_true: files('g364fb.c')) +softmmu_ss.add(when: 'CONFIG_JAZZ_LED', if_true: files('jazz_led.c')) +softmmu_ss.add(when: 'CONFIG_PL110', if_true: files('pl110.c')) +softmmu_ss.add(when: 'CONFIG_SII9022', if_true: files('sii9022.c')) +softmmu_ss.add(when: 'CONFIG_SSD0303', if_true: files('ssd0303.c')) +softmmu_ss.add(when: 'CONFIG_SSD0323', if_true: files('ssd0323.c')) +softmmu_ss.add(when: 'CONFIG_XEN', if_true: files('xenfb.c')) + +softmmu_ss.add(when: 'CONFIG_VGA_PCI', if_true: files('vga-pci.c')) +softmmu_ss.add(when: 'CONFIG_VGA_ISA', if_true: files('vga-isa.c')) +softmmu_ss.add(when: 'CONFIG_VGA_ISA_MM', if_true: files('vga-isa-mm.c')) +softmmu_ss.add(when: 'CONFIG_VMWARE_VGA', if_true: files('vmware_vga.c')) +softmmu_ss.add(when: 'CONFIG_BOCHS_DISPLAY', if_true: files('bochs-display.c')) + +softmmu_ss.add(when: 'CONFIG_BLIZZARD', if_true: files('blizzard.c')) +softmmu_ss.add(when: 'CONFIG_EXYNOS4', if_true: files('exynos4210_fimd.c')) +softmmu_ss.add(when: 'CONFIG_FRAMEBUFFER', if_true: files('framebuffer.c')) +softmmu_ss.add(when: 'CONFIG_ZAURUS', if_true: files('tc6393xb.c')) + +softmmu_ss.add(when: 'CONFIG_OMAP', if_true: files('omap_dss.c')) +softmmu_ss.add(when: 'CONFIG_PXA2XX', if_true: files('pxa2xx_lcd.c')) +softmmu_ss.add(when: 'CONFIG_RASPI', if_true: files('bcm2835_fb.c')) +softmmu_ss.add(when: 'CONFIG_SM501', if_true: files('sm501.c')) +softmmu_ss.add(when: 'CONFIG_TCX', if_true: files('tcx.c')) +softmmu_ss.add(when: 'CONFIG_CG3', if_true: files('cg3.c')) +softmmu_ss.add(when: 'CONFIG_MACFB', if_true: files('macfb.c')) +softmmu_ss.add(when: 'CONFIG_NEXTCUBE', if_true: files('next-fb.c')) + +specific_ss.add(when: 'CONFIG_VGA', if_true: files('vga.c')) + +if config_all_devices.has_key('CONFIG_QXL') + qxl_ss = ss.source_set() + qxl_ss.add(when: 'CONFIG_QXL', if_true: files('qxl.c', 'qxl-logger.c', 'qxl-render.c')) + hw_display_modules += {'qxl': qxl_ss} +endif + +softmmu_ss.add(when: 'CONFIG_QXL', if_true: files('qxl.c', 'qxl-logger.c', 'qxl-render.c')) + +softmmu_ss.add(when: 'CONFIG_DPCD', if_true: files('dpcd.c')) +softmmu_ss.add(when: 'CONFIG_XLNX_ZYNQMP_ARM', if_true: files('xlnx_dp.c')) + +softmmu_ss.add(when: 'CONFIG_MILKYMIST', if_true: files('milkymist-vgafb.c')) +softmmu_ss.add(when: 'CONFIG_ARTIST', if_true: files('artist.c')) + +softmmu_ss.add(when: [pixman, 'CONFIG_ATI_VGA'], if_true: files('ati.c', 'ati_2d.c', 'ati_dbg.c')) + +if config_all_devices.has_key('CONFIG_VIRTIO_GPU') + virtio_gpu_ss = ss.source_set() + virtio_gpu_ss.add(when: 'CONFIG_VIRTIO_GPU', + if_true: [files('virtio-gpu-base.c', 'virtio-gpu.c', 'virtio-gpu-3d.c'), pixman, virgl]) + virtio_gpu_ss.add(when: 'CONFIG_VHOST_USER_GPU', if_true: files('vhost-user-gpu.c')) + virtio_gpu_ss.add(when: ['CONFIG_VIRTIO_GPU', 'CONFIG_VIRTIO_PCI'], if_true: files('virtio-gpu-pci.c')) + virtio_gpu_ss.add(when: ['CONFIG_VHOST_USER_GPU', 'CONFIG_VIRTIO_PCI'], if_true: files('vhost-user-gpu-pci.c')) + virtio_gpu_ss.add(when: 'CONFIG_VIRTIO_VGA', if_true: files('virtio-vga.c')) + virtio_gpu_ss.add(when: 'CONFIG_VHOST_USER_VGA', if_true: files('vhost-user-vga.c')) + + # FIXME: this was attempted in the Makefile build system; it was then reverted + # as it would try to load all devices when the module is loaded, even if + # config_devices for this target only has some of them. Since virtio-gpu-pci + # and virtio-vga both instantiate a virtio-gpu-device, fixing it probably does + # not even require a dependency system, just splitting the module in three + # for CONFIG_VIRTIO_GPU/CONFIG_VHOST_USER_GPU, CONFIG_VIRTIO_PCI and + # CONFIG_VIRTIO_VGA/CONFIG_VHOST_USER_VGA. + # Sourcesets are a dime a dozen, so keep it and just disable module builds. + + #hw_display_modules += {'virtio-gpu': virtio_gpu_ss} + softmmu_ss.add_all(virtio_gpu_ss) +endif + +specific_ss.add(when: [x11, opengl, 'CONFIG_MILKYMIST_TMU2'], if_true: files('milkymist-tmu2.c')) +specific_ss.add(when: 'CONFIG_OMAP', if_true: files('omap_lcdc.c')) + +modules += { 'hw-display': hw_display_modules } diff --git a/hw/display/trace.h b/hw/display/trace.h new file mode 100644 index 0000000000..4ed0e9165b --- /dev/null +++ b/hw/display/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_display.h" diff --git a/hw/dma/Makefile.objs b/hw/dma/Makefile.objs deleted file mode 100644 index f4b1cfe26d..0000000000 --- a/hw/dma/Makefile.objs +++ /dev/null @@ -1,16 +0,0 @@ -common-obj-$(CONFIG_PUV3) += puv3_dma.o -common-obj-$(CONFIG_RC4030) += rc4030.o -common-obj-$(CONFIG_PL080) += pl080.o -common-obj-$(CONFIG_PL330) += pl330.o -common-obj-$(CONFIG_I82374) += i82374.o -common-obj-$(CONFIG_I8257) += i8257.o -common-obj-$(CONFIG_XILINX_AXI) += xilinx_axidma.o -common-obj-$(CONFIG_ZYNQ_DEVCFG) += xlnx-zynq-devcfg.o -common-obj-$(CONFIG_ETRAXFS) += etraxfs_dma.o -common-obj-$(CONFIG_STP2000) += sparc32_dma.o -common-obj-$(CONFIG_XLNX_ZYNQMP_ARM) += xlnx_dpdma.o -common-obj-$(CONFIG_XLNX_ZYNQMP_ARM) += xlnx-zdma.o - -common-obj-$(CONFIG_OMAP) += omap_dma.o soc_dma.o -common-obj-$(CONFIG_PXA2XX) += pxa2xx_dma.o -common-obj-$(CONFIG_RASPI) += bcm2835_dma.o diff --git a/hw/dma/meson.build b/hw/dma/meson.build new file mode 100644 index 0000000000..ff5bb3748f --- /dev/null +++ b/hw/dma/meson.build @@ -0,0 +1,15 @@ +softmmu_ss.add(when: 'CONFIG_PUV3', if_true: files('puv3_dma.c')) +softmmu_ss.add(when: 'CONFIG_RC4030', if_true: files('rc4030.c')) +softmmu_ss.add(when: 'CONFIG_PL080', if_true: files('pl080.c')) +softmmu_ss.add(when: 'CONFIG_PL330', if_true: files('pl330.c')) +softmmu_ss.add(when: 'CONFIG_I82374', if_true: files('i82374.c')) +softmmu_ss.add(when: 'CONFIG_I8257', if_true: files('i8257.c')) +softmmu_ss.add(when: 'CONFIG_XILINX_AXI', if_true: files('xilinx_axidma.c')) +softmmu_ss.add(when: 'CONFIG_ZYNQ_DEVCFG', if_true: files('xlnx-zynq-devcfg.c')) +softmmu_ss.add(when: 'CONFIG_ETRAXFS', if_true: files('etraxfs_dma.c')) +softmmu_ss.add(when: 'CONFIG_STP2000', if_true: files('sparc32_dma.c')) +softmmu_ss.add(when: 'CONFIG_XLNX_ZYNQMP_ARM', if_true: files('xlnx_dpdma.c')) +softmmu_ss.add(when: 'CONFIG_XLNX_ZYNQMP_ARM', if_true: files('xlnx-zdma.c')) +softmmu_ss.add(when: 'CONFIG_OMAP', if_true: files('omap_dma.c', 'soc_dma.c')) +softmmu_ss.add(when: 'CONFIG_PXA2XX', if_true: files('pxa2xx_dma.c')) +softmmu_ss.add(when: 'CONFIG_RASPI', if_true: files('bcm2835_dma.c')) diff --git a/hw/dma/trace.h b/hw/dma/trace.h new file mode 100644 index 0000000000..4bcb28b47c --- /dev/null +++ b/hw/dma/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_dma.h" diff --git a/hw/gpio/Makefile.objs b/hw/gpio/Makefile.objs deleted file mode 100644 index 3cfc261f9b..0000000000 --- a/hw/gpio/Makefile.objs +++ /dev/null @@ -1,12 +0,0 @@ -common-obj-$(CONFIG_MAX7310) += max7310.o -common-obj-$(CONFIG_PL061) += pl061.o -common-obj-$(CONFIG_PUV3) += puv3_gpio.o -common-obj-$(CONFIG_ZAURUS) += zaurus.o -common-obj-$(CONFIG_E500) += mpc8xxx.o -common-obj-$(CONFIG_GPIO_KEY) += gpio_key.o - -common-obj-$(CONFIG_OMAP) += omap_gpio.o -common-obj-$(CONFIG_IMX) += imx_gpio.o -common-obj-$(CONFIG_RASPI) += bcm2835_gpio.o -common-obj-$(CONFIG_NRF51_SOC) += nrf51_gpio.o -common-obj-$(CONFIG_ASPEED_SOC) += aspeed_gpio.o diff --git a/hw/gpio/meson.build b/hw/gpio/meson.build new file mode 100644 index 0000000000..6bcdfa6b1d --- /dev/null +++ b/hw/gpio/meson.build @@ -0,0 +1,12 @@ +softmmu_ss.add(when: 'CONFIG_E500', if_true: files('mpc8xxx.c')) +softmmu_ss.add(when: 'CONFIG_GPIO_KEY', if_true: files('gpio_key.c')) +softmmu_ss.add(when: 'CONFIG_MAX7310', if_true: files('max7310.c')) +softmmu_ss.add(when: 'CONFIG_PL061', if_true: files('pl061.c')) +softmmu_ss.add(when: 'CONFIG_PUV3', if_true: files('puv3_gpio.c')) +softmmu_ss.add(when: 'CONFIG_ZAURUS', if_true: files('zaurus.c')) + +softmmu_ss.add(when: 'CONFIG_IMX', if_true: files('imx_gpio.c')) +softmmu_ss.add(when: 'CONFIG_NRF51_SOC', if_true: files('nrf51_gpio.c')) +softmmu_ss.add(when: 'CONFIG_OMAP', if_true: files('omap_gpio.c')) +softmmu_ss.add(when: 'CONFIG_RASPI', if_true: files('bcm2835_gpio.c')) +softmmu_ss.add(when: 'CONFIG_ASPEED_SOC', if_true: files('aspeed_gpio.c')) diff --git a/hw/gpio/trace.h b/hw/gpio/trace.h new file mode 100644 index 0000000000..8b139071bc --- /dev/null +++ b/hw/gpio/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_gpio.h" diff --git a/hw/hppa/Makefile.objs b/hw/hppa/Makefile.objs deleted file mode 100644 index eac3467d8a..0000000000 --- a/hw/hppa/Makefile.objs +++ /dev/null @@ -1 +0,0 @@ -obj-$(CONFIG_DINO) += pci.o machine.o dino.o lasi.o diff --git a/hw/hppa/meson.build b/hw/hppa/meson.build new file mode 100644 index 0000000000..1deae83aee --- /dev/null +++ b/hw/hppa/meson.build @@ -0,0 +1,4 @@ +hppa_ss = ss.source_set() +hppa_ss.add(when: 'CONFIG_DINO', if_true: files('pci.c', 'machine.c', 'dino.c', 'lasi.c')) + +hw_arch += {'hppa': hppa_ss} diff --git a/hw/hppa/trace.h b/hw/hppa/trace.h new file mode 100644 index 0000000000..4e8b52dc28 --- /dev/null +++ b/hw/hppa/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_hppa.h" diff --git a/hw/hyperv/Makefile.objs b/hw/hyperv/Makefile.objs deleted file mode 100644 index 5b614e040c..0000000000 --- a/hw/hyperv/Makefile.objs +++ /dev/null @@ -1,3 +0,0 @@ -obj-y += hyperv.o -obj-$(CONFIG_HYPERV_TESTDEV) += hyperv_testdev.o -obj-$(CONFIG_VMBUS) += vmbus.o diff --git a/hw/hyperv/meson.build b/hw/hyperv/meson.build new file mode 100644 index 0000000000..1367e2994f --- /dev/null +++ b/hw/hyperv/meson.build @@ -0,0 +1,3 @@ +specific_ss.add(when: 'CONFIG_HYPERV', if_true: files('hyperv.c')) +specific_ss.add(when: 'CONFIG_HYPERV_TESTDEV', if_true: files('hyperv_testdev.c')) +specific_ss.add(when: 'CONFIG_VMBUS', if_true: files('vmbus.c')) diff --git a/hw/hyperv/trace.h b/hw/hyperv/trace.h new file mode 100644 index 0000000000..7f2a88881b --- /dev/null +++ b/hw/hyperv/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_hyperv.h" diff --git a/hw/i2c/Makefile.objs b/hw/i2c/Makefile.objs deleted file mode 100644 index f2c61eaa8b..0000000000 --- a/hw/i2c/Makefile.objs +++ /dev/null @@ -1,14 +0,0 @@ -common-obj-$(CONFIG_I2C) += core.o -common-obj-$(CONFIG_SMBUS) += smbus_slave.o smbus_master.o -common-obj-$(CONFIG_SMBUS_EEPROM) += smbus_eeprom.o -common-obj-$(CONFIG_VERSATILE_I2C) += versatile_i2c.o -common-obj-$(CONFIG_ACPI_X86_ICH) += smbus_ich9.o -common-obj-$(CONFIG_ACPI_SMBUS) += pm_smbus.o -common-obj-$(CONFIG_BITBANG_I2C) += bitbang_i2c.o -common-obj-$(CONFIG_EXYNOS4) += exynos4210_i2c.o -common-obj-$(CONFIG_IMX_I2C) += imx_i2c.o -common-obj-$(CONFIG_ASPEED_SOC) += aspeed_i2c.o -common-obj-$(CONFIG_NRF51_SOC) += microbit_i2c.o -common-obj-$(CONFIG_MPC_I2C) += mpc_i2c.o -common-obj-$(CONFIG_OMAP) += omap_i2c.o -common-obj-$(CONFIG_PPC4XX) += ppc4xx_i2c.o diff --git a/hw/i2c/meson.build b/hw/i2c/meson.build new file mode 100644 index 0000000000..3a511539ad --- /dev/null +++ b/hw/i2c/meson.build @@ -0,0 +1,16 @@ +i2c_ss = ss.source_set() +i2c_ss.add(when: 'CONFIG_I2C', if_true: files('core.c')) +i2c_ss.add(when: 'CONFIG_SMBUS', if_true: files('smbus_slave.c', 'smbus_master.c')) +i2c_ss.add(when: 'CONFIG_ACPI_SMBUS', if_true: files('pm_smbus.c')) +i2c_ss.add(when: 'CONFIG_ACPI_X86_ICH', if_true: files('smbus_ich9.c')) +i2c_ss.add(when: 'CONFIG_ASPEED_SOC', if_true: files('aspeed_i2c.c')) +i2c_ss.add(when: 'CONFIG_BITBANG_I2C', if_true: files('bitbang_i2c.c')) +i2c_ss.add(when: 'CONFIG_EXYNOS4', if_true: files('exynos4210_i2c.c')) +i2c_ss.add(when: 'CONFIG_IMX_I2C', if_true: files('imx_i2c.c')) +i2c_ss.add(when: 'CONFIG_MPC_I2C', if_true: files('mpc_i2c.c')) +i2c_ss.add(when: 'CONFIG_NRF51_SOC', if_true: files('microbit_i2c.c')) +i2c_ss.add(when: 'CONFIG_SMBUS_EEPROM', if_true: files('smbus_eeprom.c')) +i2c_ss.add(when: 'CONFIG_VERSATILE_I2C', if_true: files('versatile_i2c.c')) +i2c_ss.add(when: 'CONFIG_OMAP', if_true: files('omap_i2c.c')) +i2c_ss.add(when: 'CONFIG_PPC4XX', if_true: files('ppc4xx_i2c.c')) +softmmu_ss.add_all(when: 'CONFIG_I2C', if_true: i2c_ss) diff --git a/hw/i2c/trace.h b/hw/i2c/trace.h new file mode 100644 index 0000000000..4843a8d544 --- /dev/null +++ b/hw/i2c/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_i2c.h" diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs deleted file mode 100644 index 6abc74551a..0000000000 --- a/hw/i386/Makefile.objs +++ /dev/null @@ -1,20 +0,0 @@ -obj-$(CONFIG_KVM) += kvm/ -obj-y += e820_memory_layout.o multiboot.o -obj-y += x86.o -obj-$(CONFIG_PC) += pc.o pc_sysfw.o -obj-$(CONFIG_I440FX) += pc_piix.o -obj-$(CONFIG_Q35) += pc_q35.o -obj-$(CONFIG_MICROVM) += microvm.o -obj-y += fw_cfg.o -obj-$(CONFIG_X86_IOMMU) += x86-iommu.o -obj-$(call lnot,$(CONFIG_X86_IOMMU)) += x86-iommu-stub.o -obj-$(CONFIG_VTD) += intel_iommu.o -obj-$(CONFIG_AMD_IOMMU) += amd_iommu.o -obj-$(CONFIG_XEN) += ../xenpv/ xen/ -obj-$(CONFIG_VMPORT) += vmport.o -obj-$(CONFIG_VMMOUSE) += vmmouse.o -obj-$(CONFIG_PC) += port92.o - -obj-y += kvmvapic.o -obj-$(CONFIG_ACPI) += acpi-common.o -obj-$(CONFIG_PC) += acpi-build.o diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c index c55abfb01a..33441ad484 100644 --- a/hw/i386/fw_cfg.c +++ b/hw/i386/fw_cfg.c @@ -22,7 +22,7 @@ #include "hw/nvram/fw_cfg.h" #include "e820_memory_layout.h" #include "kvm_i386.h" -#include "config-devices.h" +#include CONFIG_DEVICES struct hpet_fw_config hpet_cfg = {.count = UINT8_MAX}; diff --git a/hw/i386/kvm/Makefile.objs b/hw/i386/kvm/Makefile.objs deleted file mode 100644 index 0c8d5f2dee..0000000000 --- a/hw/i386/kvm/Makefile.objs +++ /dev/null @@ -1,5 +0,0 @@ -obj-y += clock.o -obj-$(CONFIG_APIC) += apic.o -obj-$(CONFIG_IOAPIC) += ioapic.o -obj-$(CONFIG_I8254) += i8254.o -obj-$(CONFIG_I8259) += i8259.o diff --git a/hw/i386/kvm/meson.build b/hw/i386/kvm/meson.build new file mode 100644 index 0000000000..95467f1ded --- /dev/null +++ b/hw/i386/kvm/meson.build @@ -0,0 +1,8 @@ +i386_kvm_ss = ss.source_set() +i386_kvm_ss.add(files('clock.c')) +i386_kvm_ss.add(when: 'CONFIG_APIC', if_true: files('apic.c')) +i386_kvm_ss.add(when: 'CONFIG_I8254', if_true: files('i8254.c')) +i386_kvm_ss.add(when: 'CONFIG_I8259', if_true: files('i8259.c')) +i386_kvm_ss.add(when: 'CONFIG_IOAPIC', if_true: files('ioapic.c')) + +i386_ss.add_all(when: 'CONFIG_KVM', if_true: i386_kvm_ss) diff --git a/hw/i386/meson.build b/hw/i386/meson.build new file mode 100644 index 0000000000..63918fbe22 --- /dev/null +++ b/hw/i386/meson.build @@ -0,0 +1,32 @@ +i386_ss = ss.source_set() +i386_ss.add(files( + 'fw_cfg.c', + 'kvmvapic.c', + 'e820_memory_layout.c', + 'multiboot.c', + 'x86.c', +)) + +i386_ss.add(when: 'CONFIG_X86_IOMMU', if_true: files('x86-iommu.c'), + if_false: files('x86-iommu-stub.c')) +i386_ss.add(when: 'CONFIG_AMD_IOMMU', if_true: files('amd_iommu.c')) +i386_ss.add(when: 'CONFIG_I440FX', if_true: files('pc_piix.c')) +i386_ss.add(when: 'CONFIG_MICROVM', if_true: files('microvm.c')) +i386_ss.add(when: 'CONFIG_Q35', if_true: files('pc_q35.c')) +i386_ss.add(when: 'CONFIG_VMMOUSE', if_true: files('vmmouse.c')) +i386_ss.add(when: 'CONFIG_VMPORT', if_true: files('vmport.c')) +i386_ss.add(when: 'CONFIG_VTD', if_true: files('intel_iommu.c')) + +i386_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-common.c')) +i386_ss.add(when: 'CONFIG_PC', if_true: files( + 'pc.c', + 'pc_sysfw.c', + 'acpi-build.c', + 'port92.c')) + +subdir('kvm') +subdir('xen') + +i386_ss.add_all(xenpv_ss) + +hw_arch += {'i386': i386_ss} diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 47c5ca3e34..5d8d5ef8b3 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -92,10 +92,13 @@ #include "hw/mem/memory-device.h" #include "sysemu/replay.h" #include "qapi/qmp/qerror.h" -#include "config-devices.h" #include "e820_memory_layout.h" #include "fw_cfg.h" #include "trace.h" +#include CONFIG_DEVICES + +GlobalProperty pc_compat_5_1[] = {}; +const size_t pc_compat_5_1_len = G_N_ELEMENTS(pc_compat_5_1); GlobalProperty pc_compat_5_0[] = { }; diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index b789e83f9a..32b1453e6a 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -23,7 +23,7 @@ */ #include "qemu/osdep.h" -#include "config-devices.h" +#include CONFIG_DEVICES #include "qemu/units.h" #include "hw/loader.h" @@ -426,7 +426,7 @@ static void pc_i440fx_machine_options(MachineClass *m) machine_class_allow_dynamic_sysbus_dev(m, TYPE_VMBUS_BRIDGE); } -static void pc_i440fx_5_1_machine_options(MachineClass *m) +static void pc_i440fx_5_2_machine_options(MachineClass *m) { PCMachineClass *pcmc = PC_MACHINE_CLASS(m); pc_i440fx_machine_options(m); @@ -435,6 +435,18 @@ static void pc_i440fx_5_1_machine_options(MachineClass *m) pcmc->default_cpu_version = 1; } +DEFINE_I440FX_MACHINE(v5_2, "pc-i440fx-5.2", NULL, + pc_i440fx_5_2_machine_options); + +static void pc_i440fx_5_1_machine_options(MachineClass *m) +{ + pc_i440fx_5_2_machine_options(m); + m->alias = NULL; + m->is_default = false; + compat_props_add(m->compat_props, hw_compat_5_1, hw_compat_5_1_len); + compat_props_add(m->compat_props, pc_compat_5_1, pc_compat_5_1_len); +} + DEFINE_I440FX_MACHINE(v5_1, "pc-i440fx-5.1", NULL, pc_i440fx_5_1_machine_options); diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index a3e607a544..0cb9c18cd4 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -353,7 +353,7 @@ static void pc_q35_machine_options(MachineClass *m) m->max_cpus = 288; } -static void pc_q35_5_1_machine_options(MachineClass *m) +static void pc_q35_5_2_machine_options(MachineClass *m) { PCMachineClass *pcmc = PC_MACHINE_CLASS(m); pc_q35_machine_options(m); @@ -361,6 +361,17 @@ static void pc_q35_5_1_machine_options(MachineClass *m) pcmc->default_cpu_version = 1; } +DEFINE_Q35_MACHINE(v5_2, "pc-q35-5.2", NULL, + pc_q35_5_2_machine_options); + +static void pc_q35_5_1_machine_options(MachineClass *m) +{ + pc_q35_5_2_machine_options(m); + m->alias = NULL; + compat_props_add(m->compat_props, hw_compat_5_1, hw_compat_5_1_len); + compat_props_add(m->compat_props, pc_compat_5_1, pc_compat_5_1_len); +} + DEFINE_Q35_MACHINE(v5_1, "pc-q35-5.1", NULL, pc_q35_5_1_machine_options); diff --git a/hw/i386/trace.h b/hw/i386/trace.h new file mode 100644 index 0000000000..37a9f67e5d --- /dev/null +++ b/hw/i386/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_i386.h" diff --git a/hw/i386/x86.c b/hw/i386/x86.c index 67bee1bcb8..cf384b9743 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -49,7 +49,7 @@ #include "multiboot.h" #include "elf.h" #include "standard-headers/asm-x86/bootparam.h" -#include "config-devices.h" +#include CONFIG_DEVICES #include "kvm_i386.h" #define BIOS_FILENAME "bios.bin" diff --git a/hw/i386/xen/Makefile.objs b/hw/i386/xen/Makefile.objs deleted file mode 100644 index be9d10cf2a..0000000000 --- a/hw/i386/xen/Makefile.objs +++ /dev/null @@ -1 +0,0 @@ -obj-y += xen_platform.o xen_apic.o xen_pvdevice.o xen-hvm.o xen-mapcache.o diff --git a/hw/i386/xen/meson.build b/hw/i386/xen/meson.build new file mode 100644 index 0000000000..be84130300 --- /dev/null +++ b/hw/i386/xen/meson.build @@ -0,0 +1,7 @@ +i386_ss.add(when: 'CONFIG_XEN', if_true: files( + 'xen-hvm.c', + 'xen-mapcache.c', + 'xen_apic.c', + 'xen_platform.c', + 'xen_pvdevice.c', +)) diff --git a/hw/i386/xen/trace.h b/hw/i386/xen/trace.h new file mode 100644 index 0000000000..a02bf755dc --- /dev/null +++ b/hw/i386/xen/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_i386_xen.h" diff --git a/hw/ide/Makefile.objs b/hw/ide/Makefile.objs deleted file mode 100644 index faf04e0209..0000000000 --- a/hw/ide/Makefile.objs +++ /dev/null @@ -1,14 +0,0 @@ -common-obj-$(CONFIG_IDE_CORE) += core.o atapi.o -common-obj-$(CONFIG_IDE_QDEV) += qdev.o -common-obj-$(CONFIG_IDE_PCI) += pci.o -common-obj-$(CONFIG_IDE_ISA) += isa.o ioport.o -common-obj-$(CONFIG_IDE_PIIX) += piix.o ioport.o -common-obj-$(CONFIG_IDE_CMD646) += cmd646.o -common-obj-$(CONFIG_IDE_MACIO) += macio.o -common-obj-$(CONFIG_IDE_MMIO) += mmio.o -common-obj-$(CONFIG_IDE_VIA) += via.o -common-obj-$(CONFIG_MICRODRIVE) += microdrive.o -common-obj-$(CONFIG_AHCI) += ahci.o -common-obj-$(CONFIG_AHCI_ICH9) += ich.o -common-obj-$(CONFIG_ALLWINNER_A10) += ahci-allwinner.o -common-obj-$(CONFIG_IDE_SII3112) += sii3112.o diff --git a/hw/ide/meson.build b/hw/ide/meson.build new file mode 100644 index 0000000000..ddcb3b28d2 --- /dev/null +++ b/hw/ide/meson.build @@ -0,0 +1,14 @@ +softmmu_ss.add(when: 'CONFIG_AHCI', if_true: files('ahci.c')) +softmmu_ss.add(when: 'CONFIG_AHCI_ICH9', if_true: files('ich.c')) +softmmu_ss.add(when: 'CONFIG_ALLWINNER_A10', if_true: files('ahci-allwinner.c')) +softmmu_ss.add(when: 'CONFIG_IDE_CMD646', if_true: files('cmd646.c')) +softmmu_ss.add(when: 'CONFIG_IDE_CORE', if_true: files('core.c', 'atapi.c')) +softmmu_ss.add(when: 'CONFIG_IDE_ISA', if_true: files('isa.c', 'ioport.c')) +softmmu_ss.add(when: 'CONFIG_IDE_MACIO', if_true: files('macio.c')) +softmmu_ss.add(when: 'CONFIG_IDE_MMIO', if_true: files('mmio.c')) +softmmu_ss.add(when: 'CONFIG_IDE_PCI', if_true: files('pci.c')) +softmmu_ss.add(when: 'CONFIG_IDE_PIIX', if_true: files('piix.c', 'ioport.c')) +softmmu_ss.add(when: 'CONFIG_IDE_QDEV', if_true: files('qdev.c')) +softmmu_ss.add(when: 'CONFIG_IDE_SII3112', if_true: files('sii3112.c')) +softmmu_ss.add(when: 'CONFIG_IDE_VIA', if_true: files('via.c')) +softmmu_ss.add(when: 'CONFIG_MICRODRIVE', if_true: files('microdrive.c')) diff --git a/hw/ide/trace.h b/hw/ide/trace.h new file mode 100644 index 0000000000..e060e0aef1 --- /dev/null +++ b/hw/ide/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_ide.h" diff --git a/hw/input/Makefile.objs b/hw/input/Makefile.objs deleted file mode 100644 index abc1ff03c0..0000000000 --- a/hw/input/Makefile.objs +++ /dev/null @@ -1,18 +0,0 @@ -common-obj-$(CONFIG_ADB) += adb.o adb-mouse.o adb-kbd.o -common-obj-y += hid.o -common-obj-$(CONFIG_LM832X) += lm832x.o -common-obj-$(CONFIG_PCKBD) += pckbd.o -common-obj-$(CONFIG_PL050) += pl050.o -common-obj-$(CONFIG_PS2) += ps2.o -common-obj-$(CONFIG_STELLARIS_INPUT) += stellaris_input.o -common-obj-$(CONFIG_TSC2005) += tsc2005.o - -common-obj-$(CONFIG_VIRTIO_INPUT) += virtio-input.o -common-obj-$(CONFIG_VIRTIO_INPUT) += virtio-input-hid.o -common-obj-$(CONFIG_VIRTIO_INPUT_HOST) += virtio-input-host.o -common-obj-$(CONFIG_VHOST_USER_INPUT) += vhost-user-input.o - -common-obj-$(CONFIG_MILKYMIST) += milkymist-softusb.o -common-obj-$(CONFIG_PXA2XX) += pxa2xx_keypad.o -common-obj-$(CONFIG_TSC210X) += tsc210x.o -common-obj-$(CONFIG_LASIPS2) += lasips2.o diff --git a/hw/input/meson.build b/hw/input/meson.build new file mode 100644 index 0000000000..e7285b15ae --- /dev/null +++ b/hw/input/meson.build @@ -0,0 +1,18 @@ +softmmu_ss.add(files('hid.c')) +softmmu_ss.add(when: 'CONFIG_ADB', if_true: files('adb.c', 'adb-mouse.c', 'adb-kbd.c')) +softmmu_ss.add(when: 'CONFIG_LM832X', if_true: files('lm832x.c')) +softmmu_ss.add(when: 'CONFIG_PCKBD', if_true: files('pckbd.c')) +softmmu_ss.add(when: 'CONFIG_PL050', if_true: files('pl050.c')) +softmmu_ss.add(when: 'CONFIG_PS2', if_true: files('ps2.c')) +softmmu_ss.add(when: 'CONFIG_STELLARIS_INPUT', if_true: files('stellaris_input.c')) +softmmu_ss.add(when: 'CONFIG_TSC2005', if_true: files('tsc2005.c')) + +softmmu_ss.add(when: 'CONFIG_VIRTIO_INPUT', if_true: files('virtio-input.c')) +softmmu_ss.add(when: 'CONFIG_VIRTIO_INPUT', if_true: files('virtio-input-hid.c')) +softmmu_ss.add(when: 'CONFIG_VIRTIO_INPUT_HOST', if_true: files('virtio-input-host.c')) +softmmu_ss.add(when: 'CONFIG_VHOST_USER_INPUT', if_true: files('vhost-user-input.c')) + +softmmu_ss.add(when: 'CONFIG_MILKYMIST', if_true: files('milkymist-softusb.c')) +softmmu_ss.add(when: 'CONFIG_PXA2XX', if_true: files('pxa2xx_keypad.c')) +softmmu_ss.add(when: 'CONFIG_TSC210X', if_true: files('tsc210x.c')) +softmmu_ss.add(when: 'CONFIG_LASIPS2', if_true: files('lasips2.c')) diff --git a/hw/input/trace.h b/hw/input/trace.h new file mode 100644 index 0000000000..d1cc5d924c --- /dev/null +++ b/hw/input/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_input.h" diff --git a/hw/intc/Makefile.objs b/hw/intc/Makefile.objs deleted file mode 100644 index 3ac2b40fbb..0000000000 --- a/hw/intc/Makefile.objs +++ /dev/null @@ -1,54 +0,0 @@ -common-obj-$(CONFIG_HEATHROW_PIC) += heathrow_pic.o -common-obj-$(CONFIG_I8259) += i8259_common.o i8259.o -common-obj-$(CONFIG_PL190) += pl190.o -common-obj-$(CONFIG_PUV3) += puv3_intc.o -common-obj-$(CONFIG_XILINX) += xilinx_intc.o -common-obj-$(CONFIG_XLNX_ZYNQMP_PMU) += xlnx-pmu-iomod-intc.o -common-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-zynqmp-ipi.o -common-obj-$(CONFIG_ETRAXFS) += etraxfs_pic.o -common-obj-$(CONFIG_IMX) += imx_avic.o imx_gpcv2.o -common-obj-$(CONFIG_LM32) += lm32_pic.o -common-obj-$(CONFIG_REALVIEW) += realview_gic.o -common-obj-$(CONFIG_SLAVIO) += slavio_intctl.o -common-obj-$(CONFIG_IOAPIC) += ioapic_common.o -common-obj-$(CONFIG_ARM_GIC) += arm_gic_common.o -common-obj-$(CONFIG_ARM_GIC) += arm_gic.o -common-obj-$(CONFIG_ARM_GIC) += arm_gicv2m.o -common-obj-$(CONFIG_ARM_GIC) += arm_gicv3_common.o -common-obj-$(CONFIG_ARM_GIC) += arm_gicv3.o -common-obj-$(CONFIG_ARM_GIC) += arm_gicv3_dist.o -common-obj-$(CONFIG_ARM_GIC) += arm_gicv3_redist.o -common-obj-$(CONFIG_ARM_GIC) += arm_gicv3_its_common.o -common-obj-$(CONFIG_OPENPIC) += openpic.o -common-obj-$(CONFIG_RX_ICU) += rx_icu.o -common-obj-y += intc.o - -obj-$(CONFIG_APIC) += apic.o apic_common.o -obj-$(CONFIG_ARM_GIC_KVM) += arm_gic_kvm.o -obj-$(call land,$(CONFIG_ARM_GIC_KVM),$(TARGET_AARCH64)) += arm_gicv3_kvm.o -obj-$(call land,$(CONFIG_ARM_GIC_KVM),$(TARGET_AARCH64)) += arm_gicv3_its_kvm.o -obj-$(CONFIG_ARM_V7M) += armv7m_nvic.o -obj-$(CONFIG_EXYNOS4) += exynos4210_gic.o exynos4210_combiner.o -obj-$(CONFIG_GRLIB) += grlib_irqmp.o -obj-$(CONFIG_IOAPIC) += ioapic.o -obj-$(CONFIG_OMAP) += omap_intc.o -obj-$(CONFIG_OPENPIC_KVM) += openpic_kvm.o -obj-$(CONFIG_RASPI) += bcm2835_ic.o bcm2836_control.o -obj-$(CONFIG_SH4) += sh_intc.o -obj-$(CONFIG_XICS) += xics.o -obj-$(CONFIG_XICS_SPAPR) += xics_spapr.o -obj-$(CONFIG_XICS_KVM) += xics_kvm.o -obj-$(CONFIG_XIVE) += xive.o -obj-$(CONFIG_XIVE_SPAPR) += spapr_xive.o -obj-$(CONFIG_XIVE_KVM) += spapr_xive_kvm.o -obj-$(CONFIG_POWERNV) += xics_pnv.o pnv_xive.o -obj-$(CONFIG_ALLWINNER_A10_PIC) += allwinner-a10-pic.o -obj-$(CONFIG_S390_FLIC) += s390_flic.o -obj-$(CONFIG_S390_FLIC_KVM) += s390_flic_kvm.o -obj-$(CONFIG_ASPEED_SOC) += aspeed_vic.o -obj-$(CONFIG_ARM_GIC) += arm_gicv3_cpuif.o -obj-$(CONFIG_MIPS_CPS) += mips_gic.o -obj-$(CONFIG_NIOS2) += nios2_iic.o -obj-$(CONFIG_OMPIC) += ompic.o -obj-$(CONFIG_IBEX) += ibex_plic.o -obj-$(CONFIG_LOONGSON_LIOINTC) += loongson_liointc.o diff --git a/hw/intc/ibex_plic.c b/hw/intc/ibex_plic.c index 41079518c6..f49fa67c91 100644 --- a/hw/intc/ibex_plic.c +++ b/hw/intc/ibex_plic.c @@ -43,12 +43,22 @@ static void ibex_plic_irqs_set_pending(IbexPlicState *s, int irq, bool level) { int pending_num = irq / 32; + if (s->claimed[pending_num] & 1 << (irq % 32)) { + /* + * The interrupt has been claimed, but not compelted. + * The pending bit can't be set. + */ + return; + } + s->pending[pending_num] |= level << (irq % 32); } static bool ibex_plic_irqs_pending(IbexPlicState *s, uint32_t context) { int i; + uint32_t max_irq = 0; + uint32_t max_prio = s->threshold; for (i = 0; i < s->pending_num; i++) { uint32_t irq_num = ctz64(s->pending[i]) + (i * 32); @@ -58,14 +68,17 @@ static bool ibex_plic_irqs_pending(IbexPlicState *s, uint32_t context) continue; } - if (s->priority[irq_num] > s->threshold) { - if (!s->claim) { - s->claim = irq_num; - } - return true; + if (s->priority[irq_num] > max_prio) { + max_irq = irq_num; + max_prio = s->priority[irq_num]; } } + if (max_irq) { + s->claim = max_irq; + return true; + } + return false; } @@ -120,7 +133,14 @@ static uint64_t ibex_plic_read(void *opaque, hwaddr addr, int pending_num = s->claim / 32; s->pending[pending_num] &= ~(1 << (s->claim % 32)); + /* Set the interrupt as claimed, but not compelted */ + s->claimed[pending_num] |= 1 << (s->claim % 32); + + /* Return the current claimed interrupt */ ret = s->claim; + + /* Update the interrupt status after the claim */ + ibex_plic_update(s); } return ret; @@ -140,6 +160,7 @@ static void ibex_plic_write(void *opaque, hwaddr addr, } else if (addr_between(addr, s->priority_base, s->priority_num)) { uint32_t irq = ((addr - s->priority_base) >> 2) + 1; s->priority[irq] = value & 7; + ibex_plic_update(s); } else if (addr_between(addr, s->enable_base, s->enable_num)) { uint32_t enable_reg = (addr - s->enable_base) / 4; @@ -151,6 +172,10 @@ static void ibex_plic_write(void *opaque, hwaddr addr, /* Interrupt was completed */ s->claim = 0; } + if (s->claimed[value / 32] & 1 << (value % 32)) { + /* This value was already claimed, clear it. */ + s->claimed[value / 32] &= ~(1 << (value % 32)); + } } ibex_plic_update(s); @@ -211,6 +236,7 @@ static void ibex_plic_realize(DeviceState *dev, Error **errp) int i; s->pending = g_new0(uint32_t, s->pending_num); + s->claimed = g_new0(uint32_t, s->pending_num); s->source = g_new0(uint32_t, s->source_num); s->priority = g_new0(uint32_t, s->priority_num); s->enable = g_new0(uint32_t, s->enable_num); diff --git a/hw/intc/meson.build b/hw/intc/meson.build new file mode 100644 index 0000000000..c16f7f036e --- /dev/null +++ b/hw/intc/meson.build @@ -0,0 +1,55 @@ +softmmu_ss.add(files('intc.c')) +softmmu_ss.add(when: 'CONFIG_ARM_GIC', if_true: files( + 'arm_gic.c', + 'arm_gic_common.c', + 'arm_gicv2m.c', + 'arm_gicv3.c', + 'arm_gicv3_common.c', + 'arm_gicv3_dist.c', + 'arm_gicv3_its_common.c', + 'arm_gicv3_redist.c', +)) +softmmu_ss.add(when: 'CONFIG_ETRAXFS', if_true: files('etraxfs_pic.c')) +softmmu_ss.add(when: 'CONFIG_HEATHROW_PIC', if_true: files('heathrow_pic.c')) +softmmu_ss.add(when: 'CONFIG_I8259', if_true: files('i8259_common.c', 'i8259.c')) +softmmu_ss.add(when: 'CONFIG_IMX', if_true: files('imx_avic.c', 'imx_gpcv2.c')) +softmmu_ss.add(when: 'CONFIG_IOAPIC', if_true: files('ioapic_common.c')) +softmmu_ss.add(when: 'CONFIG_LM32', if_true: files('lm32_pic.c')) +softmmu_ss.add(when: 'CONFIG_OPENPIC', if_true: files('openpic.c')) +softmmu_ss.add(when: 'CONFIG_PL190', if_true: files('pl190.c')) +softmmu_ss.add(when: 'CONFIG_PUV3', if_true: files('puv3_intc.c')) +softmmu_ss.add(when: 'CONFIG_REALVIEW', if_true: files('realview_gic.c')) +softmmu_ss.add(when: 'CONFIG_SLAVIO', if_true: files('slavio_intctl.c')) +softmmu_ss.add(when: 'CONFIG_XILINX', if_true: files('xilinx_intc.c')) +softmmu_ss.add(when: 'CONFIG_XLNX_ZYNQMP', if_true: files('xlnx-zynqmp-ipi.c')) +softmmu_ss.add(when: 'CONFIG_XLNX_ZYNQMP_PMU', if_true: files('xlnx-pmu-iomod-intc.c')) + +specific_ss.add(when: 'CONFIG_ALLWINNER_A10_PIC', if_true: files('allwinner-a10-pic.c')) +specific_ss.add(when: 'CONFIG_APIC', if_true: files('apic.c', 'apic_common.c')) +specific_ss.add(when: 'CONFIG_ARM_GIC', if_true: files('arm_gicv3_cpuif.c')) +specific_ss.add(when: 'CONFIG_ARM_GIC_KVM', if_true: files('arm_gic_kvm.c')) +specific_ss.add(when: ['CONFIG_ARM_GIC_KVM', 'TARGET_AARCH64'], if_true: files('arm_gicv3_kvm.c', 'arm_gicv3_its_kvm.c')) +specific_ss.add(when: 'CONFIG_ARM_V7M', if_true: files('armv7m_nvic.c')) +specific_ss.add(when: 'CONFIG_ASPEED_SOC', if_true: files('aspeed_vic.c')) +specific_ss.add(when: 'CONFIG_EXYNOS4', if_true: files('exynos4210_gic.c', 'exynos4210_combiner.c')) +specific_ss.add(when: 'CONFIG_GRLIB', if_true: files('grlib_irqmp.c')) +specific_ss.add(when: 'CONFIG_IBEX', if_true: files('ibex_plic.c')) +specific_ss.add(when: 'CONFIG_IOAPIC', if_true: files('ioapic.c')) +specific_ss.add(when: 'CONFIG_LOONGSON_LIOINTC', if_true: files('loongson_liointc.c')) +specific_ss.add(when: 'CONFIG_MIPS_CPS', if_true: files('mips_gic.c')) +specific_ss.add(when: 'CONFIG_NIOS2', if_true: files('nios2_iic.c')) +specific_ss.add(when: 'CONFIG_OMAP', if_true: files('omap_intc.c')) +specific_ss.add(when: 'CONFIG_OMPIC', if_true: files('ompic.c')) +specific_ss.add(when: 'CONFIG_OPENPIC_KVM', if_true: files('openpic_kvm.c')) +specific_ss.add(when: 'CONFIG_POWERNV', if_true: files('xics_pnv.c', 'pnv_xive.c')) +specific_ss.add(when: 'CONFIG_RASPI', if_true: files('bcm2835_ic.c', 'bcm2836_control.c')) +specific_ss.add(when: 'CONFIG_RX_ICU', if_true: files('rx_icu.c')) +specific_ss.add(when: 'CONFIG_S390_FLIC', if_true: files('s390_flic.c')) +specific_ss.add(when: 'CONFIG_S390_FLIC_KVM', if_true: files('s390_flic_kvm.c')) +specific_ss.add(when: 'CONFIG_SH4', if_true: files('sh_intc.c')) +specific_ss.add(when: 'CONFIG_XICS', if_true: files('xics.c')) +specific_ss.add(when: 'CONFIG_XICS_KVM', if_true: files('xics_kvm.c')) +specific_ss.add(when: 'CONFIG_XICS_SPAPR', if_true: files('xics_spapr.c')) +specific_ss.add(when: 'CONFIG_XIVE', if_true: files('xive.c')) +specific_ss.add(when: 'CONFIG_XIVE_KVM', if_true: files('spapr_xive_kvm.c')) +specific_ss.add(when: 'CONFIG_XIVE_SPAPR', if_true: files('spapr_xive.c')) diff --git a/hw/intc/spapr_xive.c b/hw/intc/spapr_xive.c index 89c8cd9667..4bd0d606ba 100644 --- a/hw/intc/spapr_xive.c +++ b/hw/intc/spapr_xive.c @@ -148,12 +148,19 @@ static void spapr_xive_end_pic_print_info(SpaprXive *xive, XiveEND *end, xive_end_queue_pic_print_info(end, 6, mon); } +/* + * kvm_irqchip_in_kernel() will cause the compiler to turn this + * info a nop if CONFIG_KVM isn't defined. + */ +#define spapr_xive_in_kernel(xive) \ + (kvm_irqchip_in_kernel() && (xive)->fd != -1) + void spapr_xive_pic_print_info(SpaprXive *xive, Monitor *mon) { XiveSource *xsrc = &xive->source; int i; - if (kvm_irqchip_in_kernel()) { + if (spapr_xive_in_kernel(xive)) { Error *local_err = NULL; kvmppc_xive_synchronize_state(xive, &local_err); @@ -329,7 +336,7 @@ static void spapr_xive_realize(DeviceState *dev, Error **errp) sysbus_init_mmio(SYS_BUS_DEVICE(xive), &end_xsrc->esb_mmio); /* Set the mapping address of the END ESB pages after the source ESBs */ - xive->end_base = xive->vc_base + (1ull << xsrc->esb_shift) * xsrc->nr_irqs; + xive->end_base = xive->vc_base + xive_source_esb_len(xsrc); /* * Allocate the routing tables @@ -507,8 +514,10 @@ static const VMStateDescription vmstate_spapr_xive_eas = { static int vmstate_spapr_xive_pre_save(void *opaque) { - if (kvm_irqchip_in_kernel()) { - return kvmppc_xive_pre_save(SPAPR_XIVE(opaque)); + SpaprXive *xive = SPAPR_XIVE(opaque); + + if (spapr_xive_in_kernel(xive)) { + return kvmppc_xive_pre_save(xive); } return 0; @@ -520,8 +529,10 @@ static int vmstate_spapr_xive_pre_save(void *opaque) */ static int spapr_xive_post_load(SpaprInterruptController *intc, int version_id) { - if (kvm_irqchip_in_kernel()) { - return kvmppc_xive_post_load(SPAPR_XIVE(intc), version_id); + SpaprXive *xive = SPAPR_XIVE(intc); + + if (spapr_xive_in_kernel(xive)) { + return kvmppc_xive_post_load(xive, version_id); } return 0; @@ -564,7 +575,7 @@ static int spapr_xive_claim_irq(SpaprInterruptController *intc, int lisn, xive_source_irq_set_lsi(xsrc, lisn); } - if (kvm_irqchip_in_kernel()) { + if (spapr_xive_in_kernel(xive)) { return kvmppc_xive_source_reset_one(xsrc, lisn, errp); } @@ -641,7 +652,7 @@ static void spapr_xive_set_irq(SpaprInterruptController *intc, int irq, int val) { SpaprXive *xive = SPAPR_XIVE(intc); - if (kvm_irqchip_in_kernel()) { + if (spapr_xive_in_kernel(xive)) { kvmppc_xive_source_set_irq(&xive->source, irq, val); } else { xive_source_set_irq(&xive->source, irq, val); @@ -749,11 +760,16 @@ static void spapr_xive_deactivate(SpaprInterruptController *intc) spapr_xive_mmio_set_enabled(xive, false); - if (kvm_irqchip_in_kernel()) { + if (spapr_xive_in_kernel(xive)) { kvmppc_xive_disconnect(intc); } } +static bool spapr_xive_in_kernel_xptr(const XivePresenter *xptr) +{ + return spapr_xive_in_kernel(SPAPR_XIVE(xptr)); +} + static void spapr_xive_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); @@ -788,6 +804,7 @@ static void spapr_xive_class_init(ObjectClass *klass, void *data) sicc->post_load = spapr_xive_post_load; xpc->match_nvt = spapr_xive_match_nvt; + xpc->in_kernel = spapr_xive_in_kernel_xptr; } static const TypeInfo spapr_xive_info = { @@ -1058,7 +1075,7 @@ static target_ulong h_int_set_source_config(PowerPCCPU *cpu, new_eas.w = xive_set_field64(EAS_END_DATA, new_eas.w, eisn); } - if (kvm_irqchip_in_kernel()) { + if (spapr_xive_in_kernel(xive)) { Error *local_err = NULL; kvmppc_xive_set_source_config(xive, lisn, &new_eas, &local_err); @@ -1379,7 +1396,7 @@ static target_ulong h_int_set_queue_config(PowerPCCPU *cpu, */ out: - if (kvm_irqchip_in_kernel()) { + if (spapr_xive_in_kernel(xive)) { Error *local_err = NULL; kvmppc_xive_set_queue_config(xive, end_blk, end_idx, &end, &local_err); @@ -1480,7 +1497,7 @@ static target_ulong h_int_get_queue_config(PowerPCCPU *cpu, args[2] = 0; } - if (kvm_irqchip_in_kernel()) { + if (spapr_xive_in_kernel(xive)) { Error *local_err = NULL; kvmppc_xive_get_queue_config(xive, end_blk, end_idx, end, &local_err); @@ -1642,7 +1659,7 @@ static target_ulong h_int_esb(PowerPCCPU *cpu, return H_P3; } - if (kvm_irqchip_in_kernel()) { + if (spapr_xive_in_kernel(xive)) { args[0] = kvmppc_xive_esb_rw(xsrc, lisn, offset, data, flags & SPAPR_XIVE_ESB_STORE); } else { @@ -1717,7 +1734,7 @@ static target_ulong h_int_sync(PowerPCCPU *cpu, * under KVM */ - if (kvm_irqchip_in_kernel()) { + if (spapr_xive_in_kernel(xive)) { Error *local_err = NULL; kvmppc_xive_sync_source(xive, lisn, &local_err); @@ -1761,7 +1778,7 @@ static target_ulong h_int_reset(PowerPCCPU *cpu, device_legacy_reset(DEVICE(xive)); - if (kvm_irqchip_in_kernel()) { + if (spapr_xive_in_kernel(xive)) { Error *local_err = NULL; kvmppc_xive_reset(xive, &local_err); diff --git a/hw/intc/spapr_xive_kvm.c b/hw/intc/spapr_xive_kvm.c index edb7ee0e74..e8667ce5f6 100644 --- a/hw/intc/spapr_xive_kvm.c +++ b/hw/intc/spapr_xive_kvm.c @@ -73,54 +73,54 @@ static void kvm_cpu_disable_all(void) * XIVE Thread Interrupt Management context (KVM) */ -void kvmppc_xive_cpu_set_state(XiveTCTX *tctx, Error **errp) +int kvmppc_xive_cpu_set_state(XiveTCTX *tctx, Error **errp) { SpaprXive *xive = SPAPR_XIVE(tctx->xptr); uint64_t state[2]; int ret; - /* The KVM XIVE device is not in use yet */ - if (xive->fd == -1) { - return; - } + assert(xive->fd != -1); /* word0 and word1 of the OS ring. */ state[0] = *((uint64_t *) &tctx->regs[TM_QW1_OS]); ret = kvm_set_one_reg(tctx->cs, KVM_REG_PPC_VP_STATE, state); if (ret != 0) { - error_setg_errno(errp, errno, + error_setg_errno(errp, -ret, "XIVE: could not restore KVM state of CPU %ld", kvm_arch_vcpu_id(tctx->cs)); + return ret; } + + return 0; } -void kvmppc_xive_cpu_get_state(XiveTCTX *tctx, Error **errp) +int kvmppc_xive_cpu_get_state(XiveTCTX *tctx, Error **errp) { SpaprXive *xive = SPAPR_XIVE(tctx->xptr); uint64_t state[2] = { 0 }; int ret; - /* The KVM XIVE device is not in use */ - if (xive->fd == -1) { - return; - } + assert(xive->fd != -1); ret = kvm_get_one_reg(tctx->cs, KVM_REG_PPC_VP_STATE, state); if (ret != 0) { - error_setg_errno(errp, errno, + error_setg_errno(errp, -ret, "XIVE: could not capture KVM state of CPU %ld", kvm_arch_vcpu_id(tctx->cs)); - return; + return ret; } /* word0 and word1 of the OS ring. */ *((uint64_t *) &tctx->regs[TM_QW1_OS]) = state[0]; + + return 0; } typedef struct { XiveTCTX *tctx; - Error *err; + Error **errp; + int ret; } XiveCpuGetState; static void kvmppc_xive_cpu_do_synchronize_state(CPUState *cpu, @@ -128,14 +128,14 @@ static void kvmppc_xive_cpu_do_synchronize_state(CPUState *cpu, { XiveCpuGetState *s = arg.host_ptr; - kvmppc_xive_cpu_get_state(s->tctx, &s->err); + s->ret = kvmppc_xive_cpu_get_state(s->tctx, s->errp); } -void kvmppc_xive_cpu_synchronize_state(XiveTCTX *tctx, Error **errp) +int kvmppc_xive_cpu_synchronize_state(XiveTCTX *tctx, Error **errp) { XiveCpuGetState s = { .tctx = tctx, - .err = NULL, + .errp = errp, }; /* @@ -144,26 +144,21 @@ void kvmppc_xive_cpu_synchronize_state(XiveTCTX *tctx, Error **errp) run_on_cpu(tctx->cs, kvmppc_xive_cpu_do_synchronize_state, RUN_ON_CPU_HOST_PTR(&s)); - if (s.err) { - error_propagate(errp, s.err); - return; - } + return s.ret; } -void kvmppc_xive_cpu_connect(XiveTCTX *tctx, Error **errp) +int kvmppc_xive_cpu_connect(XiveTCTX *tctx, Error **errp) { + ERRP_GUARD(); SpaprXive *xive = SPAPR_XIVE(tctx->xptr); unsigned long vcpu_id; int ret; - /* The KVM XIVE device is not in use */ - if (xive->fd == -1) { - return; - } + assert(xive->fd != -1); /* Check if CPU was hot unplugged and replugged. */ if (kvm_cpu_is_enabled(tctx->cs)) { - return; + return 0; } vcpu_id = kvm_arch_vcpu_id(tctx->cs); @@ -171,28 +166,26 @@ void kvmppc_xive_cpu_connect(XiveTCTX *tctx, Error **errp) ret = kvm_vcpu_enable_cap(tctx->cs, KVM_CAP_PPC_IRQ_XIVE, 0, xive->fd, vcpu_id, 0); if (ret < 0) { - Error *local_err = NULL; - - error_setg(&local_err, - "XIVE: unable to connect CPU%ld to KVM device: %s", - vcpu_id, strerror(errno)); - if (errno == ENOSPC) { - error_append_hint(&local_err, "Try -smp maxcpus=N with N < %u\n", + error_setg_errno(errp, -ret, + "XIVE: unable to connect CPU%ld to KVM device", + vcpu_id); + if (ret == -ENOSPC) { + error_append_hint(errp, "Try -smp maxcpus=N with N < %u\n", MACHINE(qdev_get_machine())->smp.max_cpus); } - error_propagate(errp, local_err); - return; + return ret; } kvm_cpu_enable(tctx->cs); + return 0; } /* * XIVE Interrupt Source (KVM) */ -void kvmppc_xive_set_source_config(SpaprXive *xive, uint32_t lisn, XiveEAS *eas, - Error **errp) +int kvmppc_xive_set_source_config(SpaprXive *xive, uint32_t lisn, XiveEAS *eas, + Error **errp) { uint32_t end_idx; uint32_t end_blk; @@ -201,7 +194,6 @@ void kvmppc_xive_set_source_config(SpaprXive *xive, uint32_t lisn, XiveEAS *eas, bool masked; uint32_t eisn; uint64_t kvm_src; - Error *local_err = NULL; assert(xive_eas_is_valid(eas)); @@ -221,12 +213,8 @@ void kvmppc_xive_set_source_config(SpaprXive *xive, uint32_t lisn, XiveEAS *eas, kvm_src |= ((uint64_t)eisn << KVM_XIVE_SOURCE_EISN_SHIFT) & KVM_XIVE_SOURCE_EISN_MASK; - kvm_device_access(xive->fd, KVM_DEV_XIVE_GRP_SOURCE_CONFIG, lisn, - &kvm_src, true, &local_err); - if (local_err) { - error_propagate(errp, local_err); - return; - } + return kvm_device_access(xive->fd, KVM_DEV_XIVE_GRP_SOURCE_CONFIG, lisn, + &kvm_src, true, errp); } void kvmppc_xive_sync_source(SpaprXive *xive, uint32_t lisn, Error **errp) @@ -245,10 +233,7 @@ int kvmppc_xive_source_reset_one(XiveSource *xsrc, int srcno, Error **errp) SpaprXive *xive = SPAPR_XIVE(xsrc->xive); uint64_t state = 0; - /* The KVM XIVE device is not in use */ - if (xive->fd == -1) { - return -ENODEV; - } + assert(xive->fd != -1); if (xive_source_irq_is_lsi(xsrc, srcno)) { state |= KVM_XIVE_LEVEL_SENSITIVE; @@ -261,24 +246,25 @@ int kvmppc_xive_source_reset_one(XiveSource *xsrc, int srcno, Error **errp) true, errp); } -static void kvmppc_xive_source_reset(XiveSource *xsrc, Error **errp) +static int kvmppc_xive_source_reset(XiveSource *xsrc, Error **errp) { SpaprXive *xive = SPAPR_XIVE(xsrc->xive); int i; for (i = 0; i < xsrc->nr_irqs; i++) { - Error *local_err = NULL; + int ret; if (!xive_eas_is_valid(&xive->eat[i])) { continue; } - kvmppc_xive_source_reset_one(xsrc, i, &local_err); - if (local_err) { - error_propagate(errp, local_err); - return; + ret = kvmppc_xive_source_reset_one(xsrc, i, errp); + if (ret < 0) { + return ret; } } + + return 0; } /* @@ -381,15 +367,15 @@ void kvmppc_xive_source_set_irq(void *opaque, int srcno, int val) /* * sPAPR XIVE interrupt controller (KVM) */ -void kvmppc_xive_get_queue_config(SpaprXive *xive, uint8_t end_blk, - uint32_t end_idx, XiveEND *end, - Error **errp) +int kvmppc_xive_get_queue_config(SpaprXive *xive, uint8_t end_blk, + uint32_t end_idx, XiveEND *end, + Error **errp) { struct kvm_ppc_xive_eq kvm_eq = { 0 }; uint64_t kvm_eq_idx; uint8_t priority; uint32_t server; - Error *local_err = NULL; + int ret; assert(xive_end_is_valid(end)); @@ -401,11 +387,10 @@ void kvmppc_xive_get_queue_config(SpaprXive *xive, uint8_t end_blk, kvm_eq_idx |= server << KVM_XIVE_EQ_SERVER_SHIFT & KVM_XIVE_EQ_SERVER_MASK; - kvm_device_access(xive->fd, KVM_DEV_XIVE_GRP_EQ_CONFIG, kvm_eq_idx, - &kvm_eq, false, &local_err); - if (local_err) { - error_propagate(errp, local_err); - return; + ret = kvm_device_access(xive->fd, KVM_DEV_XIVE_GRP_EQ_CONFIG, kvm_eq_idx, + &kvm_eq, false, errp); + if (ret < 0) { + return ret; } /* @@ -415,17 +400,18 @@ void kvmppc_xive_get_queue_config(SpaprXive *xive, uint8_t end_blk, */ end->w1 = xive_set_field32(END_W1_GENERATION, 0ul, kvm_eq.qtoggle) | xive_set_field32(END_W1_PAGE_OFF, 0ul, kvm_eq.qindex); + + return 0; } -void kvmppc_xive_set_queue_config(SpaprXive *xive, uint8_t end_blk, - uint32_t end_idx, XiveEND *end, - Error **errp) +int kvmppc_xive_set_queue_config(SpaprXive *xive, uint8_t end_blk, + uint32_t end_idx, XiveEND *end, + Error **errp) { struct kvm_ppc_xive_eq kvm_eq = { 0 }; uint64_t kvm_eq_idx; uint8_t priority; uint32_t server; - Error *local_err = NULL; /* * Build the KVM state from the local END structure. @@ -463,12 +449,9 @@ void kvmppc_xive_set_queue_config(SpaprXive *xive, uint8_t end_blk, kvm_eq_idx |= server << KVM_XIVE_EQ_SERVER_SHIFT & KVM_XIVE_EQ_SERVER_MASK; - kvm_device_access(xive->fd, KVM_DEV_XIVE_GRP_EQ_CONFIG, kvm_eq_idx, - &kvm_eq, true, &local_err); - if (local_err) { - error_propagate(errp, local_err); - return; - } + return + kvm_device_access(xive->fd, KVM_DEV_XIVE_GRP_EQ_CONFIG, kvm_eq_idx, + &kvm_eq, true, errp); } void kvmppc_xive_reset(SpaprXive *xive, Error **errp) @@ -477,23 +460,24 @@ void kvmppc_xive_reset(SpaprXive *xive, Error **errp) NULL, true, errp); } -static void kvmppc_xive_get_queues(SpaprXive *xive, Error **errp) +static int kvmppc_xive_get_queues(SpaprXive *xive, Error **errp) { - Error *local_err = NULL; int i; + int ret; for (i = 0; i < xive->nr_ends; i++) { if (!xive_end_is_valid(&xive->endt[i])) { continue; } - kvmppc_xive_get_queue_config(xive, SPAPR_XIVE_BLOCK_ID, i, - &xive->endt[i], &local_err); - if (local_err) { - error_propagate(errp, local_err); - return; + ret = kvmppc_xive_get_queue_config(xive, SPAPR_XIVE_BLOCK_ID, i, + &xive->endt[i], errp); + if (ret < 0) { + return ret; } } + + return 0; } /* @@ -592,10 +576,7 @@ static void kvmppc_xive_change_state_handler(void *opaque, int running, void kvmppc_xive_synchronize_state(SpaprXive *xive, Error **errp) { - /* The KVM XIVE device is not in use */ - if (xive->fd == -1) { - return; - } + assert(xive->fd != -1); /* * When the VM is stopped, the sources are masked and the previous @@ -621,19 +602,17 @@ void kvmppc_xive_synchronize_state(SpaprXive *xive, Error **errp) int kvmppc_xive_pre_save(SpaprXive *xive) { Error *local_err = NULL; + int ret; - /* The KVM XIVE device is not in use */ - if (xive->fd == -1) { - return 0; - } + assert(xive->fd != -1); /* EAT: there is no extra state to query from KVM */ /* ENDT */ - kvmppc_xive_get_queues(xive, &local_err); - if (local_err) { + ret = kvmppc_xive_get_queues(xive, &local_err); + if (ret < 0) { error_report_err(local_err); - return -1; + return ret; } return 0; @@ -650,6 +629,7 @@ int kvmppc_xive_post_load(SpaprXive *xive, int version_id) Error *local_err = NULL; CPUState *cs; int i; + int ret; /* The KVM XIVE device should be in use */ assert(xive->fd != -1); @@ -660,11 +640,10 @@ int kvmppc_xive_post_load(SpaprXive *xive, int version_id) continue; } - kvmppc_xive_set_queue_config(xive, SPAPR_XIVE_BLOCK_ID, i, - &xive->endt[i], &local_err); - if (local_err) { - error_report_err(local_err); - return -1; + ret = kvmppc_xive_set_queue_config(xive, SPAPR_XIVE_BLOCK_ID, i, + &xive->endt[i], &local_err); + if (ret < 0) { + goto fail; } } @@ -679,16 +658,14 @@ int kvmppc_xive_post_load(SpaprXive *xive, int version_id) * previously set in KVM. Since we don't do that for all interrupts * at reset time anymore, let's do it now. */ - kvmppc_xive_source_reset_one(&xive->source, i, &local_err); - if (local_err) { - error_report_err(local_err); - return -1; + ret = kvmppc_xive_source_reset_one(&xive->source, i, &local_err); + if (ret < 0) { + goto fail; } - kvmppc_xive_set_source_config(xive, i, &xive->eat[i], &local_err); - if (local_err) { - error_report_err(local_err); - return -1; + ret = kvmppc_xive_set_source_config(xive, i, &xive->eat[i], &local_err); + if (ret < 0) { + goto fail; } } @@ -705,17 +682,21 @@ int kvmppc_xive_post_load(SpaprXive *xive, int version_id) CPU_FOREACH(cs) { PowerPCCPU *cpu = POWERPC_CPU(cs); - kvmppc_xive_cpu_set_state(spapr_cpu_state(cpu)->tctx, &local_err); - if (local_err) { - error_report_err(local_err); - return -1; + ret = kvmppc_xive_cpu_set_state(spapr_cpu_state(cpu)->tctx, &local_err); + if (ret < 0) { + goto fail; } } /* The source states will be restored when the machine starts running */ return 0; + +fail: + error_report_err(local_err); + return ret; } +/* Returns MAP_FAILED on error and sets errno */ static void *kvmppc_xive_mmap(SpaprXive *xive, int pgoff, size_t len, Error **errp) { @@ -726,7 +707,6 @@ static void *kvmppc_xive_mmap(SpaprXive *xive, int pgoff, size_t len, pgoff << page_shift); if (addr == MAP_FAILED) { error_setg_errno(errp, errno, "XIVE: unable to set memory mapping"); - return NULL; } return addr; @@ -741,10 +721,12 @@ int kvmppc_xive_connect(SpaprInterruptController *intc, uint32_t nr_servers, { SpaprXive *xive = SPAPR_XIVE(intc); XiveSource *xsrc = &xive->source; - Error *local_err = NULL; - size_t esb_len = (1ull << xsrc->esb_shift) * xsrc->nr_irqs; + size_t esb_len = xive_source_esb_len(xsrc); size_t tima_len = 4ull << TM_SHIFT; CPUState *cs; + int fd; + void *addr; + int ret; /* * The KVM XIVE device already in use. This is the case when @@ -760,18 +742,20 @@ int kvmppc_xive_connect(SpaprInterruptController *intc, uint32_t nr_servers, } /* First, create the KVM XIVE device */ - xive->fd = kvm_create_device(kvm_state, KVM_DEV_TYPE_XIVE, false); - if (xive->fd < 0) { - error_setg_errno(errp, -xive->fd, "XIVE: error creating KVM device"); + fd = kvm_create_device(kvm_state, KVM_DEV_TYPE_XIVE, false); + if (fd < 0) { + error_setg_errno(errp, -fd, "XIVE: error creating KVM device"); return -1; } + xive->fd = fd; /* Tell KVM about the # of VCPUs we may have */ if (kvm_device_check_attr(xive->fd, KVM_DEV_XIVE_GRP_CTRL, KVM_DEV_XIVE_NR_SERVERS)) { - if (kvm_device_access(xive->fd, KVM_DEV_XIVE_GRP_CTRL, - KVM_DEV_XIVE_NR_SERVERS, &nr_servers, true, - &local_err)) { + ret = kvm_device_access(xive->fd, KVM_DEV_XIVE_GRP_CTRL, + KVM_DEV_XIVE_NR_SERVERS, &nr_servers, true, + errp); + if (ret < 0) { goto fail; } } @@ -779,14 +763,14 @@ int kvmppc_xive_connect(SpaprInterruptController *intc, uint32_t nr_servers, /* * 1. Source ESB pages - KVM mapping */ - xsrc->esb_mmap = kvmppc_xive_mmap(xive, KVM_XIVE_ESB_PAGE_OFFSET, esb_len, - &local_err); - if (local_err) { + addr = kvmppc_xive_mmap(xive, KVM_XIVE_ESB_PAGE_OFFSET, esb_len, errp); + if (addr == MAP_FAILED) { goto fail; } + xsrc->esb_mmap = addr; memory_region_init_ram_device_ptr(&xsrc->esb_mmio_kvm, OBJECT(xsrc), - "xive.esb", esb_len, xsrc->esb_mmap); + "xive.esb-kvm", esb_len, xsrc->esb_mmap); memory_region_add_subregion_overlap(&xsrc->esb_mmio, 0, &xsrc->esb_mmio_kvm, 1); @@ -797,11 +781,12 @@ int kvmppc_xive_connect(SpaprInterruptController *intc, uint32_t nr_servers, /* * 3. TIMA pages - KVM mapping */ - xive->tm_mmap = kvmppc_xive_mmap(xive, KVM_XIVE_TIMA_PAGE_OFFSET, tima_len, - &local_err); - if (local_err) { + addr = kvmppc_xive_mmap(xive, KVM_XIVE_TIMA_PAGE_OFFSET, tima_len, errp); + if (addr == MAP_FAILED) { goto fail; } + xive->tm_mmap = addr; + memory_region_init_ram_device_ptr(&xive->tm_mmio_kvm, OBJECT(xive), "xive.tima", tima_len, xive->tm_mmap); memory_region_add_subregion_overlap(&xive->tm_mmio, 0, @@ -814,15 +799,15 @@ int kvmppc_xive_connect(SpaprInterruptController *intc, uint32_t nr_servers, CPU_FOREACH(cs) { PowerPCCPU *cpu = POWERPC_CPU(cs); - kvmppc_xive_cpu_connect(spapr_cpu_state(cpu)->tctx, &local_err); - if (local_err) { + ret = kvmppc_xive_cpu_connect(spapr_cpu_state(cpu)->tctx, errp); + if (ret < 0) { goto fail; } } /* Update the KVM sources */ - kvmppc_xive_source_reset(xsrc, &local_err); - if (local_err) { + ret = kvmppc_xive_source_reset(xsrc, errp); + if (ret < 0) { goto fail; } @@ -832,7 +817,6 @@ int kvmppc_xive_connect(SpaprInterruptController *intc, uint32_t nr_servers, return 0; fail: - error_propagate(errp, local_err); kvmppc_xive_disconnect(intc); return -1; } @@ -843,14 +827,11 @@ void kvmppc_xive_disconnect(SpaprInterruptController *intc) XiveSource *xsrc; size_t esb_len; - /* The KVM XIVE device is not in use */ - if (!xive || xive->fd == -1) { - return; - } + assert(xive->fd != -1); /* Clear the KVM mapping */ xsrc = &xive->source; - esb_len = (1ull << xsrc->esb_shift) * xsrc->nr_irqs; + esb_len = xive_source_esb_len(xsrc); if (xsrc->esb_mmap) { memory_region_del_subregion(&xsrc->esb_mmio, &xsrc->esb_mmio_kvm); @@ -871,10 +852,8 @@ void kvmppc_xive_disconnect(SpaprInterruptController *intc) * and removed from the list of devices of the VM. The VCPU * presenters are also detached from the device. */ - if (xive->fd != -1) { - close(xive->fd); - xive->fd = -1; - } + close(xive->fd); + xive->fd = -1; kvm_kernel_irqchip = false; kvm_msi_via_irqfd_allowed = false; diff --git a/hw/intc/trace.h b/hw/intc/trace.h new file mode 100644 index 0000000000..02394aea20 --- /dev/null +++ b/hw/intc/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_intc.h" diff --git a/hw/intc/xive.c b/hw/intc/xive.c index 9a162431e0..489e6256ef 100644 --- a/hw/intc/xive.c +++ b/hw/intc/xive.c @@ -592,6 +592,17 @@ static const char * const xive_tctx_ring_names[] = { "USER", "OS", "POOL", "PHYS", }; +/* + * kvm_irqchip_in_kernel() will cause the compiler to turn this + * info a nop if CONFIG_KVM isn't defined. + */ +#define xive_in_kernel(xptr) \ + (kvm_irqchip_in_kernel() && \ + ({ \ + XivePresenterClass *xpc = XIVE_PRESENTER_GET_CLASS(xptr); \ + xpc->in_kernel ? xpc->in_kernel(xptr) : false; \ + })) + void xive_tctx_pic_print_info(XiveTCTX *tctx, Monitor *mon) { int cpu_index; @@ -606,7 +617,7 @@ void xive_tctx_pic_print_info(XiveTCTX *tctx, Monitor *mon) cpu_index = tctx->cs ? tctx->cs->cpu_index : -1; - if (kvm_irqchip_in_kernel()) { + if (xive_in_kernel(tctx->xptr)) { Error *local_err = NULL; kvmppc_xive_cpu_synchronize_state(tctx, &local_err); @@ -651,7 +662,6 @@ static void xive_tctx_realize(DeviceState *dev, Error **errp) XiveTCTX *tctx = XIVE_TCTX(dev); PowerPCCPU *cpu; CPUPPCState *env; - Error *local_err = NULL; assert(tctx->cs); assert(tctx->xptr); @@ -671,10 +681,8 @@ static void xive_tctx_realize(DeviceState *dev, Error **errp) } /* Connect the presenter to the VCPU (required for CPU hotplug) */ - if (kvm_irqchip_in_kernel()) { - kvmppc_xive_cpu_connect(tctx, &local_err); - if (local_err) { - error_propagate(errp, local_err); + if (xive_in_kernel(tctx->xptr)) { + if (kvmppc_xive_cpu_connect(tctx, errp) < 0) { return; } } @@ -682,13 +690,15 @@ static void xive_tctx_realize(DeviceState *dev, Error **errp) static int vmstate_xive_tctx_pre_save(void *opaque) { + XiveTCTX *tctx = XIVE_TCTX(opaque); Error *local_err = NULL; + int ret; - if (kvm_irqchip_in_kernel()) { - kvmppc_xive_cpu_get_state(XIVE_TCTX(opaque), &local_err); - if (local_err) { + if (xive_in_kernel(tctx->xptr)) { + ret = kvmppc_xive_cpu_get_state(tctx, &local_err); + if (ret < 0) { error_report_err(local_err); - return -1; + return ret; } } @@ -697,17 +707,19 @@ static int vmstate_xive_tctx_pre_save(void *opaque) static int vmstate_xive_tctx_post_load(void *opaque, int version_id) { + XiveTCTX *tctx = XIVE_TCTX(opaque); Error *local_err = NULL; + int ret; - if (kvm_irqchip_in_kernel()) { + if (xive_in_kernel(tctx->xptr)) { /* * Required for hotplugged CPU, for which the state comes * after all states of the machine. */ - kvmppc_xive_cpu_set_state(XIVE_TCTX(opaque), &local_err); - if (local_err) { + ret = kvmppc_xive_cpu_set_state(tctx, &local_err); + if (ret < 0) { error_report_err(local_err); - return -1; + return ret; } } @@ -1128,6 +1140,7 @@ static void xive_source_reset(void *dev) static void xive_source_realize(DeviceState *dev, Error **errp) { XiveSource *xsrc = XIVE_SOURCE(dev); + size_t esb_len = xive_source_esb_len(xsrc); assert(xsrc->xive); @@ -1147,11 +1160,11 @@ static void xive_source_realize(DeviceState *dev, Error **errp) xsrc->status = g_malloc0(xsrc->nr_irqs); xsrc->lsi_map = bitmap_new(xsrc->nr_irqs); - if (!kvm_irqchip_in_kernel()) { - memory_region_init_io(&xsrc->esb_mmio, OBJECT(xsrc), - &xive_source_esb_ops, xsrc, "xive.esb", - (1ull << xsrc->esb_shift) * xsrc->nr_irqs); - } + memory_region_init(&xsrc->esb_mmio, OBJECT(xsrc), "xive.esb", esb_len); + memory_region_init_io(&xsrc->esb_mmio_emulated, OBJECT(xsrc), + &xive_source_esb_ops, xsrc, "xive.esb-emulated", + esb_len); + memory_region_add_subregion(&xsrc->esb_mmio, 0, &xsrc->esb_mmio_emulated); qemu_register_reset(xive_source_reset, dev); } @@ -1502,7 +1515,7 @@ static bool xive_presenter_notify(XiveFabric *xfb, uint8_t format, /* * Notification using the END ESe/ESn bit (Event State Buffer for - * escalation and notification). Profide futher coalescing in the + * escalation and notification). Provide further coalescing in the * Router. */ static bool xive_router_end_es_notify(XiveRouter *xrtr, uint8_t end_blk, @@ -1581,7 +1594,7 @@ static void xive_router_end_notify(XiveRouter *xrtr, uint8_t end_blk, /* * Check the END ESn (Event State Buffer for notification) for - * even futher coalescing in the Router + * even further coalescing in the Router */ if (!xive_end_is_notify(&end)) { /* ESn[Q]=1 : end of notification */ @@ -1660,7 +1673,7 @@ do_escalation: /* * Check the END ESe (Event State Buffer for escalation) for even - * futher coalescing in the Router + * further coalescing in the Router */ if (!xive_end_is_uncond_escalation(&end)) { /* ESe[Q]=1 : end of notification */ diff --git a/hw/ipack/Makefile.objs b/hw/ipack/Makefile.objs deleted file mode 100644 index 8b9bdcb549..0000000000 --- a/hw/ipack/Makefile.objs +++ /dev/null @@ -1,2 +0,0 @@ -common-obj-$(CONFIG_IPACK) += ipack.o -common-obj-$(CONFIG_IPACK) += tpci200.o diff --git a/hw/ipack/meson.build b/hw/ipack/meson.build new file mode 100644 index 0000000000..3f8138b6f2 --- /dev/null +++ b/hw/ipack/meson.build @@ -0,0 +1 @@ +softmmu_ss.add(when: 'CONFIG_IPACK', if_true: files('ipack.c', 'tpci200.c')) diff --git a/hw/ipmi/Makefile.objs b/hw/ipmi/Makefile.objs deleted file mode 100644 index 3cca10bc50..0000000000 --- a/hw/ipmi/Makefile.objs +++ /dev/null @@ -1,8 +0,0 @@ -common-obj-$(CONFIG_IPMI) += ipmi.o ipmi_kcs.o ipmi_bt.o -common-obj-$(CONFIG_IPMI_LOCAL) += ipmi_bmc_sim.o -common-obj-$(CONFIG_IPMI_EXTERN) += ipmi_bmc_extern.o -common-obj-$(CONFIG_ISA_IPMI_KCS) += isa_ipmi_kcs.o -common-obj-$(CONFIG_PCI_IPMI_KCS) += pci_ipmi_kcs.o -common-obj-$(CONFIG_ISA_IPMI_BT) += isa_ipmi_bt.o -common-obj-$(CONFIG_PCI_IPMI_BT) += pci_ipmi_bt.o -common-obj-$(CONFIG_IPMI_SSIF) += smbus_ipmi.o diff --git a/hw/ipmi/meson.build b/hw/ipmi/meson.build new file mode 100644 index 0000000000..9622ea2a2c --- /dev/null +++ b/hw/ipmi/meson.build @@ -0,0 +1,11 @@ +ipmi_ss = ss.source_set() +ipmi_ss.add(when: 'CONFIG_IPMI', if_true: files('ipmi.c', 'ipmi_kcs.c', 'ipmi_bt.c')) +ipmi_ss.add(when: 'CONFIG_IPMI_LOCAL', if_true: files('ipmi_bmc_sim.c')) +ipmi_ss.add(when: 'CONFIG_IPMI_EXTERN', if_true: files('ipmi_bmc_extern.c')) +ipmi_ss.add(when: 'CONFIG_ISA_IPMI_KCS', if_true: files('isa_ipmi_kcs.c')) +ipmi_ss.add(when: 'CONFIG_PCI_IPMI_KCS', if_true: files('pci_ipmi_kcs.c')) +ipmi_ss.add(when: 'CONFIG_ISA_IPMI_BT', if_true: files('isa_ipmi_bt.c')) +ipmi_ss.add(when: 'CONFIG_PCI_IPMI_BT', if_true: files('pci_ipmi_bt.c')) +ipmi_ss.add(when: 'CONFIG_IPMI_SSIF', if_true: files('smbus_ipmi.c')) + +softmmu_ss.add_all(when: 'CONFIG_IPMI', if_true: ipmi_ss) diff --git a/hw/isa/Makefile.objs b/hw/isa/Makefile.objs deleted file mode 100644 index 8e73960a75..0000000000 --- a/hw/isa/Makefile.objs +++ /dev/null @@ -1,11 +0,0 @@ -common-obj-$(CONFIG_ISA_BUS) += isa-bus.o -common-obj-$(CONFIG_ISA_SUPERIO) += isa-superio.o -common-obj-$(CONFIG_APM) += apm.o -common-obj-$(CONFIG_I82378) += i82378.o -common-obj-$(CONFIG_PC87312) += pc87312.o -common-obj-$(CONFIG_PIIX3) += piix3.o -common-obj-$(CONFIG_PIIX4) += piix4.o -common-obj-$(CONFIG_VT82C686) += vt82c686.o -common-obj-$(CONFIG_SMC37C669) += smc37c669-superio.o - -obj-$(CONFIG_LPC_ICH9) += lpc_ich9.o diff --git a/hw/isa/meson.build b/hw/isa/meson.build new file mode 100644 index 0000000000..8bf678ca0a --- /dev/null +++ b/hw/isa/meson.build @@ -0,0 +1,11 @@ +softmmu_ss.add(when: 'CONFIG_APM', if_true: files('apm.c')) +softmmu_ss.add(when: 'CONFIG_I82378', if_true: files('i82378.c')) +softmmu_ss.add(when: 'CONFIG_ISA_BUS', if_true: files('isa-bus.c')) +softmmu_ss.add(when: 'CONFIG_ISA_SUPERIO', if_true: files('isa-superio.c')) +softmmu_ss.add(when: 'CONFIG_PC87312', if_true: files('pc87312.c')) +softmmu_ss.add(when: 'CONFIG_PIIX3', if_true: files('piix3.c')) +softmmu_ss.add(when: 'CONFIG_PIIX4', if_true: files('piix4.c')) +softmmu_ss.add(when: 'CONFIG_SMC37C669', if_true: files('smc37c669-superio.c')) +softmmu_ss.add(when: 'CONFIG_VT82C686', if_true: files('vt82c686.c')) + +specific_ss.add(when: 'CONFIG_LPC_ICH9', if_true: files('lpc_ich9.c')) diff --git a/hw/isa/trace.h b/hw/isa/trace.h new file mode 100644 index 0000000000..501205cfc1 --- /dev/null +++ b/hw/isa/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_isa.h" diff --git a/hw/lm32/Makefile.objs b/hw/lm32/Makefile.objs deleted file mode 100644 index c3941866c7..0000000000 --- a/hw/lm32/Makefile.objs +++ /dev/null @@ -1,3 +0,0 @@ -# LM32 boards -obj-$(CONFIG_LM32) += lm32_boards.o -obj-$(CONFIG_MILKYMIST) += milkymist.o diff --git a/hw/lm32/meson.build b/hw/lm32/meson.build new file mode 100644 index 0000000000..8caf0a727f --- /dev/null +++ b/hw/lm32/meson.build @@ -0,0 +1,6 @@ +lm32_ss = ss.source_set() +# LM32 boards +lm32_ss.add(when: 'CONFIG_LM32', if_true: files('lm32_boards.c')) +lm32_ss.add(when: 'CONFIG_MILKYMIST', if_true: files('milkymist.c')) + +hw_arch += {'lm32': lm32_ss} diff --git a/hw/lm32/milkymist-hw.h b/hw/lm32/milkymist-hw.h index 05e2c2a5a7..5dca5d52f5 100644 --- a/hw/lm32/milkymist-hw.h +++ b/hw/lm32/milkymist-hw.h @@ -31,17 +31,6 @@ static inline DeviceState *milkymist_hpdmc_create(hwaddr base) return dev; } -static inline DeviceState *milkymist_memcard_create(hwaddr base) -{ - DeviceState *dev; - - dev = qdev_new("milkymist-memcard"); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); - sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base); - - return dev; -} - static inline DeviceState *milkymist_vgafb_create(hwaddr base, uint32_t fb_offset, uint32_t fb_mask) { diff --git a/hw/lm32/milkymist.c b/hw/lm32/milkymist.c index 85913bb68b..9f8fe9fef1 100644 --- a/hw/lm32/milkymist.c +++ b/hw/lm32/milkymist.c @@ -34,6 +34,7 @@ #include "elf.h" #include "milkymist-hw.h" #include "hw/display/milkymist_tmu2.h" +#include "hw/sd/sd.h" #include "lm32.h" #include "exec/address-spaces.h" #include "qemu/cutils.h" @@ -80,6 +81,29 @@ static void main_cpu_reset(void *opaque) env->deba = reset_info->flash_base; } +static DeviceState *milkymist_memcard_create(hwaddr base) +{ + DeviceState *dev; + DriveInfo *dinfo; + + dev = qdev_new("milkymist-memcard"); + sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base); + + dinfo = drive_get_next(IF_SD); + if (dinfo) { + DeviceState *card; + + card = qdev_new(TYPE_SD_CARD); + qdev_prop_set_drive_err(card, "drive", blk_by_legacy_dinfo(dinfo), + &error_fatal); + qdev_realize_and_unref(card, qdev_get_child_bus(dev, "sd-bus"), + &error_fatal); + } + + return dev; +} + static void milkymist_init(MachineState *machine) { diff --git a/hw/m68k/Makefile.objs b/hw/m68k/Makefile.objs deleted file mode 100644 index b2c9e5ab12..0000000000 --- a/hw/m68k/Makefile.objs +++ /dev/null @@ -1,4 +0,0 @@ -obj-$(CONFIG_AN5206) += an5206.o mcf5206.o -obj-$(CONFIG_MCF5208) += mcf5208.o mcf_intc.o -obj-$(CONFIG_NEXTCUBE) += next-kbd.o next-cube.o -obj-$(CONFIG_Q800) += q800.o diff --git a/hw/m68k/meson.build b/hw/m68k/meson.build new file mode 100644 index 0000000000..ca0044c652 --- /dev/null +++ b/hw/m68k/meson.build @@ -0,0 +1,7 @@ +m68k_ss = ss.source_set() +m68k_ss.add(when: 'CONFIG_AN5206', if_true: files('an5206.c', 'mcf5206.c')) +m68k_ss.add(when: 'CONFIG_MCF5208', if_true: files('mcf5208.c', 'mcf_intc.c')) +m68k_ss.add(when: 'CONFIG_NEXTCUBE', if_true: files('next-kbd.c', 'next-cube.c')) +m68k_ss.add(when: 'CONFIG_Q800', if_true: files('q800.c')) + +hw_arch += {'m68k': m68k_ss} diff --git a/hw/mem/Kconfig b/hw/mem/Kconfig index c27844900d..a0ef2cf648 100644 --- a/hw/mem/Kconfig +++ b/hw/mem/Kconfig @@ -9,3 +9,4 @@ config NVDIMM bool default y depends on (PC || PSERIES || ARM_VIRT) + select MEM_DEVICE diff --git a/hw/mem/Makefile.objs b/hw/mem/Makefile.objs deleted file mode 100644 index 56345befd0..0000000000 --- a/hw/mem/Makefile.objs +++ /dev/null @@ -1,3 +0,0 @@ -common-obj-$(CONFIG_DIMM) += pc-dimm.o -common-obj-y += memory-device.o -common-obj-$(CONFIG_NVDIMM) += nvdimm.o diff --git a/hw/mem/meson.build b/hw/mem/meson.build new file mode 100644 index 0000000000..ba424622bb --- /dev/null +++ b/hw/mem/meson.build @@ -0,0 +1,6 @@ +mem_ss = ss.source_set() +mem_ss.add(files('memory-device.c')) +mem_ss.add(when: 'CONFIG_DIMM', if_true: files('pc-dimm.c')) +mem_ss.add(when: 'CONFIG_NVDIMM', if_true: files('nvdimm.c')) + +softmmu_ss.add_all(when: 'CONFIG_MEM_DEVICE', if_true: mem_ss) diff --git a/hw/mem/trace.h b/hw/mem/trace.h new file mode 100644 index 0000000000..2f2c945407 --- /dev/null +++ b/hw/mem/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_mem.h" diff --git a/hw/meson.build b/hw/meson.build new file mode 100644 index 0000000000..010de7219c --- /dev/null +++ b/hw/meson.build @@ -0,0 +1,67 @@ +subdir('9pfs') +subdir('acpi') +subdir('adc') +subdir('audio') +subdir('block') +subdir('char') +subdir('core') +subdir('cpu') +subdir('display') +subdir('dma') +subdir('gpio') +subdir('hyperv') +subdir('i2c') +subdir('ide') +subdir('input') +subdir('intc') +subdir('ipack') +subdir('ipmi') +subdir('isa') +subdir('mem') +subdir('misc') +subdir('net') +subdir('nubus') +subdir('nvram') +subdir('pci') +subdir('pci-bridge') +subdir('pci-host') +subdir('pcmcia') +subdir('rdma') +subdir('rtc') +subdir('scsi') +subdir('sd') +subdir('semihosting') +subdir('smbios') +subdir('ssi') +subdir('timer') +subdir('tpm') +subdir('usb') +subdir('vfio') +subdir('virtio') +subdir('watchdog') +subdir('xen') +subdir('xenpv') + +subdir('alpha') +subdir('arm') +subdir('avr') +subdir('cris') +subdir('hppa') +subdir('i386') +subdir('lm32') +subdir('m68k') +subdir('microblaze') +subdir('mips') +subdir('moxie') +subdir('nios2') +subdir('openrisc') +subdir('ppc') +subdir('riscv') +subdir('rx') +subdir('s390x') +subdir('sh4') +subdir('sparc') +subdir('sparc64') +subdir('tricore') +subdir('unicore32') +subdir('xtensa') diff --git a/hw/microblaze/Makefile.objs b/hw/microblaze/Makefile.objs deleted file mode 100644 index 8595a62f6c..0000000000 --- a/hw/microblaze/Makefile.objs +++ /dev/null @@ -1,4 +0,0 @@ -obj-$(CONFIG_PETALOGIX_S3ADSP1800) += petalogix_s3adsp1800_mmu.o -obj-$(CONFIG_PETALOGIX_ML605) += petalogix_ml605_mmu.o -obj-$(CONFIG_XLNX_ZYNQMP_PMU) += xlnx-zynqmp-pmu.o -obj-y += boot.o diff --git a/hw/microblaze/meson.build b/hw/microblaze/meson.build new file mode 100644 index 0000000000..bb9e4eb8f4 --- /dev/null +++ b/hw/microblaze/meson.build @@ -0,0 +1,7 @@ +microblaze_ss = ss.source_set() +microblaze_ss.add(files('boot.c')) +microblaze_ss.add(when: 'CONFIG_PETALOGIX_S3ADSP1800', if_true: files('petalogix_s3adsp1800_mmu.c')) +microblaze_ss.add(when: 'CONFIG_PETALOGIX_ML605', if_true: files('petalogix_ml605_mmu.c')) +microblaze_ss.add(when: 'CONFIG_XLNX_ZYNQMP_PMU', if_true: files('xlnx-zynqmp-pmu.c')) + +hw_arch += {'microblaze': microblaze_ss} diff --git a/hw/mips/Makefile.objs b/hw/mips/Makefile.objs deleted file mode 100644 index 739e2b7b40..0000000000 --- a/hw/mips/Makefile.objs +++ /dev/null @@ -1,8 +0,0 @@ -obj-y += addr.o mips_int.o -obj-$(CONFIG_R4K) += r4k.o -obj-$(CONFIG_MALTA) += gt64xxx_pci.o malta.o -obj-$(CONFIG_MIPSSIM) += mipssim.o -obj-$(CONFIG_JAZZ) += jazz.o -obj-$(CONFIG_FULOONG) += fuloong2e.o -obj-$(CONFIG_MIPS_CPS) += cps.o -obj-$(CONFIG_MIPS_BOSTON) += boston.o diff --git a/hw/mips/meson.build b/hw/mips/meson.build new file mode 100644 index 0000000000..6ac9dc4cff --- /dev/null +++ b/hw/mips/meson.build @@ -0,0 +1,11 @@ +mips_ss = ss.source_set() +mips_ss.add(files('addr.c', 'mips_int.c')) +mips_ss.add(when: 'CONFIG_FULOONG', if_true: files('fuloong2e.c')) +mips_ss.add(when: 'CONFIG_JAZZ', if_true: files('jazz.c')) +mips_ss.add(when: 'CONFIG_MALTA', if_true: files('gt64xxx_pci.c', 'malta.c')) +mips_ss.add(when: 'CONFIG_MIPSSIM', if_true: files('mipssim.c')) +mips_ss.add(when: 'CONFIG_MIPS_BOSTON', if_true: files('boston.c')) +mips_ss.add(when: 'CONFIG_MIPS_CPS', if_true: files('cps.c')) +mips_ss.add(when: 'CONFIG_R4K', if_true: files('r4k.c')) + +hw_arch += {'mips': mips_ss} diff --git a/hw/mips/trace.h b/hw/mips/trace.h new file mode 100644 index 0000000000..8d1fd7c9e2 --- /dev/null +++ b/hw/mips/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_mips.h" diff --git a/hw/misc/Makefile.objs b/hw/misc/Makefile.objs deleted file mode 100644 index 6be3d255ab..0000000000 --- a/hw/misc/Makefile.objs +++ /dev/null @@ -1,95 +0,0 @@ -common-obj-$(CONFIG_APPLESMC) += applesmc.o -common-obj-$(CONFIG_MAX111X) += max111x.o -common-obj-$(CONFIG_TMP105) += tmp105.o -common-obj-$(CONFIG_TMP421) += tmp421.o -common-obj-$(CONFIG_ISA_DEBUG) += debugexit.o -common-obj-$(CONFIG_SGA) += sga.o -common-obj-$(CONFIG_ISA_TESTDEV) += pc-testdev.o -common-obj-$(CONFIG_PCI_TESTDEV) += pci-testdev.o -common-obj-$(CONFIG_EDU) += edu.o -common-obj-$(CONFIG_PCA9552) += pca9552.o - -common-obj-$(CONFIG_UNIMP) += unimp.o -common-obj-$(CONFIG_EMPTY_SLOT) += empty_slot.o -common-obj-$(CONFIG_FW_CFG_DMA) += vmcoreinfo.o - -# ARM devices -common-obj-$(CONFIG_PL310) += arm_l2x0.o -common-obj-$(CONFIG_INTEGRATOR_DEBUG) += arm_integrator_debug.o -common-obj-$(CONFIG_A9SCU) += a9scu.o -common-obj-$(CONFIG_ARM11SCU) += arm11scu.o - -# Mac devices -common-obj-$(CONFIG_MOS6522) += mos6522.o - -# PKUnity SoC devices -common-obj-$(CONFIG_PUV3) += puv3_pm.o - -common-obj-$(CONFIG_MACIO) += macio/ - -common-obj-$(CONFIG_IVSHMEM_DEVICE) += ivshmem.o - -common-obj-$(CONFIG_ALLWINNER_H3) += allwinner-h3-ccu.o -obj-$(CONFIG_ALLWINNER_H3) += allwinner-cpucfg.o -common-obj-$(CONFIG_ALLWINNER_H3) += allwinner-h3-dramc.o -common-obj-$(CONFIG_ALLWINNER_H3) += allwinner-h3-sysctrl.o -common-obj-$(CONFIG_ALLWINNER_H3) += allwinner-sid.o -common-obj-$(CONFIG_REALVIEW) += arm_sysctl.o -common-obj-$(CONFIG_NSERIES) += cbus.o -common-obj-$(CONFIG_ECCMEMCTL) += eccmemctl.o -common-obj-$(CONFIG_EXYNOS4) += exynos4210_pmu.o exynos4210_clk.o exynos4210_rng.o -common-obj-$(CONFIG_IMX) += imx_ccm.o -common-obj-$(CONFIG_IMX) += imx31_ccm.o -common-obj-$(CONFIG_IMX) += imx25_ccm.o -common-obj-$(CONFIG_IMX) += imx6_ccm.o -common-obj-$(CONFIG_IMX) += imx6ul_ccm.o -obj-$(CONFIG_IMX) += imx6_src.o -common-obj-$(CONFIG_IMX) += imx7_ccm.o -common-obj-$(CONFIG_IMX) += imx7_snvs.o -common-obj-$(CONFIG_IMX) += imx7_gpr.o -common-obj-$(CONFIG_IMX) += imx_rngc.o -common-obj-$(CONFIG_MILKYMIST) += milkymist-hpdmc.o -common-obj-$(CONFIG_MILKYMIST) += milkymist-pfpu.o -common-obj-$(CONFIG_MAINSTONE) += mst_fpga.o -common-obj-$(CONFIG_OMAP) += omap_clk.o -common-obj-$(CONFIG_OMAP) += omap_gpmc.o -common-obj-$(CONFIG_OMAP) += omap_l4.o -common-obj-$(CONFIG_OMAP) += omap_sdrc.o -common-obj-$(CONFIG_OMAP) += omap_tap.o -common-obj-$(CONFIG_RASPI) += bcm2835_mbox.o -common-obj-$(CONFIG_RASPI) += bcm2835_mphi.o -common-obj-$(CONFIG_RASPI) += bcm2835_property.o -common-obj-$(CONFIG_RASPI) += bcm2835_rng.o -common-obj-$(CONFIG_RASPI) += bcm2835_thermal.o -common-obj-$(CONFIG_SLAVIO) += slavio_misc.o -common-obj-$(CONFIG_ZYNQ) += zynq_slcr.o -common-obj-$(CONFIG_ZYNQ) += zynq-xadc.o -common-obj-$(CONFIG_STM32F2XX_SYSCFG) += stm32f2xx_syscfg.o -common-obj-$(CONFIG_STM32F4XX_SYSCFG) += stm32f4xx_syscfg.o -common-obj-$(CONFIG_STM32F4XX_EXTI) += stm32f4xx_exti.o -obj-$(CONFIG_MIPS_CPS) += mips_cmgcr.o -obj-$(CONFIG_MIPS_CPS) += mips_cpc.o -obj-$(CONFIG_MIPS_ITU) += mips_itu.o -common-obj-$(CONFIG_MPS2_FPGAIO) += mps2-fpgaio.o -common-obj-$(CONFIG_MPS2_SCC) += mps2-scc.o - -common-obj-$(CONFIG_TZ_MPC) += tz-mpc.o -common-obj-$(CONFIG_TZ_MSC) += tz-msc.o -common-obj-$(CONFIG_TZ_PPC) += tz-ppc.o -common-obj-$(CONFIG_IOTKIT_SECCTL) += iotkit-secctl.o -obj-$(CONFIG_IOTKIT_SYSCTL) += iotkit-sysctl.o -common-obj-$(CONFIG_IOTKIT_SYSINFO) += iotkit-sysinfo.o -common-obj-$(CONFIG_ARMSSE_CPUID) += armsse-cpuid.o -common-obj-$(CONFIG_ARMSSE_MHU) += armsse-mhu.o - -common-obj-$(CONFIG_PVPANIC) += pvpanic.o -common-obj-$(CONFIG_AUX) += auxbus.o -common-obj-$(CONFIG_ASPEED_SOC) += aspeed_xdma.o -common-obj-$(CONFIG_ASPEED_SOC) += aspeed_scu.o aspeed_sdmc.o -common-obj-$(CONFIG_MSF2) += msf2-sysreg.o -common-obj-$(CONFIG_NRF51_SOC) += nrf51_rng.o -obj-$(CONFIG_MAC_VIA) += mac_via.o - -common-obj-$(CONFIG_GRLIB) += grlib_ahb_apb_pnp.o - -obj-$(CONFIG_AVR_POWER) += avr_power.o diff --git a/hw/misc/macio/Makefile.objs b/hw/misc/macio/Makefile.objs deleted file mode 100644 index 07fdb320d4..0000000000 --- a/hw/misc/macio/Makefile.objs +++ /dev/null @@ -1,5 +0,0 @@ -common-obj-y += macio.o -common-obj-$(CONFIG_CUDA) += cuda.o -common-obj-$(CONFIG_MAC_PMU) += pmu.o -common-obj-$(CONFIG_MAC_DBDMA) += mac_dbdma.o -common-obj-$(CONFIG_MACIO_GPIO) += gpio.o diff --git a/hw/misc/macio/meson.build b/hw/misc/macio/meson.build new file mode 100644 index 0000000000..17282da20a --- /dev/null +++ b/hw/misc/macio/meson.build @@ -0,0 +1,8 @@ +macio_ss = ss.source_set() +macio_ss.add(files('macio.c')) +macio_ss.add(when: 'CONFIG_CUDA', if_true: files('cuda.c')) +macio_ss.add(when: 'CONFIG_MACIO_GPIO', if_true: files('gpio.c')) +macio_ss.add(when: 'CONFIG_MAC_DBDMA', if_true: files('mac_dbdma.c')) +macio_ss.add(when: 'CONFIG_MAC_PMU', if_true: files('pmu.c')) + +softmmu_ss.add_all(when: 'CONFIG_MACIO', if_true: macio_ss) diff --git a/hw/misc/macio/trace.h b/hw/misc/macio/trace.h new file mode 100644 index 0000000000..34a3cf1b42 --- /dev/null +++ b/hw/misc/macio/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_misc_macio.h" diff --git a/hw/misc/meson.build b/hw/misc/meson.build new file mode 100644 index 0000000000..84fed0494d --- /dev/null +++ b/hw/misc/meson.build @@ -0,0 +1,99 @@ +softmmu_ss.add(when: 'CONFIG_APPLESMC', if_true: files('applesmc.c')) +softmmu_ss.add(when: 'CONFIG_EDU', if_true: files('edu.c')) +softmmu_ss.add(when: 'CONFIG_FW_CFG_DMA', if_true: files('vmcoreinfo.c')) +softmmu_ss.add(when: 'CONFIG_ISA_DEBUG', if_true: files('debugexit.c')) +softmmu_ss.add(when: 'CONFIG_ISA_TESTDEV', if_true: files('pc-testdev.c')) +softmmu_ss.add(when: 'CONFIG_MAX111X', if_true: files('max111x.c')) +softmmu_ss.add(when: 'CONFIG_PCA9552', if_true: files('pca9552.c')) +softmmu_ss.add(when: 'CONFIG_PCI_TESTDEV', if_true: files('pci-testdev.c')) +softmmu_ss.add(when: 'CONFIG_SGA', if_true: files('sga.c')) +softmmu_ss.add(when: 'CONFIG_TMP105', if_true: files('tmp105.c')) +softmmu_ss.add(when: 'CONFIG_TMP421', if_true: files('tmp421.c')) +softmmu_ss.add(when: 'CONFIG_UNIMP', if_true: files('unimp.c')) +softmmu_ss.add(when: 'CONFIG_EMPTY_SLOT', if_true: files('empty_slot.c')) + +# ARM devices +softmmu_ss.add(when: 'CONFIG_PL310', if_true: files('arm_l2x0.c')) +softmmu_ss.add(when: 'CONFIG_INTEGRATOR_DEBUG', if_true: files('arm_integrator_debug.c')) +softmmu_ss.add(when: 'CONFIG_A9SCU', if_true: files('a9scu.c')) +softmmu_ss.add(when: 'CONFIG_ARM11SCU', if_true: files('arm11scu.c')) + +# Mac devices +softmmu_ss.add(when: 'CONFIG_MOS6522', if_true: files('mos6522.c')) + +# PKUnity SoC devices +softmmu_ss.add(when: 'CONFIG_PUV3', if_true: files('puv3_pm.c')) + +subdir('macio') + +softmmu_ss.add(when: 'CONFIG_IVSHMEM_DEVICE', if_true: files('ivshmem.c')) + +softmmu_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-h3-ccu.c')) +specific_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-cpucfg.c')) +softmmu_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-h3-dramc.c')) +softmmu_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-h3-sysctrl.c')) +softmmu_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-sid.c')) +softmmu_ss.add(when: 'CONFIG_REALVIEW', if_true: files('arm_sysctl.c')) +softmmu_ss.add(when: 'CONFIG_NSERIES', if_true: files('cbus.c')) +softmmu_ss.add(when: 'CONFIG_ECCMEMCTL', if_true: files('eccmemctl.c')) +softmmu_ss.add(when: 'CONFIG_EXYNOS4', if_true: files('exynos4210_pmu.c', 'exynos4210_clk.c', 'exynos4210_rng.c')) +softmmu_ss.add(when: 'CONFIG_IMX', if_true: files( + 'imx25_ccm.c', + 'imx31_ccm.c', + 'imx6_ccm.c', + 'imx6ul_ccm.c', + 'imx7_ccm.c', + 'imx7_gpr.c', + 'imx7_snvs.c', + 'imx_ccm.c', + 'imx_rngc.c', +)) +softmmu_ss.add(when: 'CONFIG_MILKYMIST', if_true: files('milkymist-hpdmc.c', 'milkymist-pfpu.c')) +softmmu_ss.add(when: 'CONFIG_MAINSTONE', if_true: files('mst_fpga.c')) +softmmu_ss.add(when: 'CONFIG_OMAP', if_true: files( + 'omap_clk.c', + 'omap_gpmc.c', + 'omap_l4.c', + 'omap_sdrc.c', + 'omap_tap.c', +)) +softmmu_ss.add(when: 'CONFIG_RASPI', if_true: files( + 'bcm2835_mbox.c', + 'bcm2835_mphi.c', + 'bcm2835_property.c', + 'bcm2835_rng.c', + 'bcm2835_thermal.c', +)) +softmmu_ss.add(when: 'CONFIG_SLAVIO', if_true: files('slavio_misc.c')) +softmmu_ss.add(when: 'CONFIG_ZYNQ', if_true: files('zynq_slcr.c', 'zynq-xadc.c')) +softmmu_ss.add(when: 'CONFIG_STM32F2XX_SYSCFG', if_true: files('stm32f2xx_syscfg.c')) +softmmu_ss.add(when: 'CONFIG_STM32F4XX_SYSCFG', if_true: files('stm32f4xx_syscfg.c')) +softmmu_ss.add(when: 'CONFIG_STM32F4XX_EXTI', if_true: files('stm32f4xx_exti.c')) +softmmu_ss.add(when: 'CONFIG_MPS2_FPGAIO', if_true: files('mps2-fpgaio.c')) +softmmu_ss.add(when: 'CONFIG_MPS2_SCC', if_true: files('mps2-scc.c')) + +softmmu_ss.add(when: 'CONFIG_TZ_MPC', if_true: files('tz-mpc.c')) +softmmu_ss.add(when: 'CONFIG_TZ_MSC', if_true: files('tz-msc.c')) +softmmu_ss.add(when: 'CONFIG_TZ_PPC', if_true: files('tz-ppc.c')) +softmmu_ss.add(when: 'CONFIG_IOTKIT_SECCTL', if_true: files('iotkit-secctl.c')) +softmmu_ss.add(when: 'CONFIG_IOTKIT_SYSINFO', if_true: files('iotkit-sysinfo.c')) +softmmu_ss.add(when: 'CONFIG_ARMSSE_CPUID', if_true: files('armsse-cpuid.c')) +softmmu_ss.add(when: 'CONFIG_ARMSSE_MHU', if_true: files('armsse-mhu.c')) + +softmmu_ss.add(when: 'CONFIG_PVPANIC', if_true: files('pvpanic.c')) +softmmu_ss.add(when: 'CONFIG_AUX', if_true: files('auxbus.c')) +softmmu_ss.add(when: 'CONFIG_ASPEED_SOC', if_true: files('aspeed_scu.c', 'aspeed_sdmc.c', 'aspeed_xdma.c')) +softmmu_ss.add(when: 'CONFIG_MSF2', if_true: files('msf2-sysreg.c')) +softmmu_ss.add(when: 'CONFIG_NRF51_SOC', if_true: files('nrf51_rng.c')) + +softmmu_ss.add(when: 'CONFIG_GRLIB', if_true: files('grlib_ahb_apb_pnp.c')) + +specific_ss.add(when: 'CONFIG_AVR_POWER', if_true: files('avr_power.c')) + +specific_ss.add(when: 'CONFIG_IMX', if_true: files('imx6_src.c')) +specific_ss.add(when: 'CONFIG_IOTKIT_SYSCTL', if_true: files('iotkit-sysctl.c')) + +specific_ss.add(when: 'CONFIG_MAC_VIA', if_true: files('mac_via.c')) + +specific_ss.add(when: 'CONFIG_MIPS_CPS', if_true: files('mips_cmgcr.c', 'mips_cpc.c')) +specific_ss.add(when: 'CONFIG_MIPS_ITU', if_true: files('mips_itu.c')) diff --git a/hw/misc/trace.h b/hw/misc/trace.h new file mode 100644 index 0000000000..1ab6923d11 --- /dev/null +++ b/hw/misc/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_misc.h" diff --git a/hw/moxie/Makefile.objs b/hw/moxie/Makefile.objs deleted file mode 100644 index ddbf300f54..0000000000 --- a/hw/moxie/Makefile.objs +++ /dev/null @@ -1,2 +0,0 @@ -# moxie boards -obj-$(CONFIG_MOXIESIM) += moxiesim.o diff --git a/hw/moxie/meson.build b/hw/moxie/meson.build new file mode 100644 index 0000000000..05a7c2e00f --- /dev/null +++ b/hw/moxie/meson.build @@ -0,0 +1,4 @@ +moxie_ss = ss.source_set() +moxie_ss.add(when: 'CONFIG_MOXIESIM', if_true: files('moxiesim.c')) + +hw_arch += {'moxie': moxie_ss} diff --git a/hw/net/Makefile.objs b/hw/net/Makefile.objs deleted file mode 100644 index 7ccbf72ea7..0000000000 --- a/hw/net/Makefile.objs +++ /dev/null @@ -1,59 +0,0 @@ -common-obj-$(CONFIG_DP8393X) += dp8393x.o -common-obj-$(CONFIG_XEN) += xen_nic.o -common-obj-$(CONFIG_NE2000_COMMON) += ne2000.o - -# PCI network cards -common-obj-$(CONFIG_NE2000_PCI) += ne2000-pci.o -common-obj-$(CONFIG_EEPRO100_PCI) += eepro100.o -common-obj-$(CONFIG_PCNET_PCI) += pcnet-pci.o -common-obj-$(CONFIG_PCNET_COMMON) += pcnet.o -common-obj-$(CONFIG_E1000_PCI) += e1000.o e1000x_common.o -common-obj-$(CONFIG_E1000E_PCI_EXPRESS) += net_tx_pkt.o net_rx_pkt.o -common-obj-$(CONFIG_E1000E_PCI_EXPRESS) += e1000e.o e1000e_core.o e1000x_common.o -common-obj-$(CONFIG_RTL8139_PCI) += rtl8139.o -common-obj-$(CONFIG_VMXNET3_PCI) += net_tx_pkt.o net_rx_pkt.o -common-obj-$(CONFIG_VMXNET3_PCI) += vmxnet3.o -common-obj-$(CONFIG_TULIP) += tulip.o - -common-obj-$(CONFIG_SMC91C111) += smc91c111.o -common-obj-$(CONFIG_LAN9118) += lan9118.o -common-obj-$(CONFIG_NE2000_ISA) += ne2000-isa.o -common-obj-$(CONFIG_OPENCORES_ETH) += opencores_eth.o -common-obj-$(CONFIG_XGMAC) += xgmac.o -common-obj-$(CONFIG_MIPSNET) += mipsnet.o -common-obj-$(CONFIG_XILINX_AXI) += xilinx_axienet.o -common-obj-$(CONFIG_ALLWINNER_EMAC) += allwinner_emac.o -common-obj-$(CONFIG_ALLWINNER_SUN8I_EMAC) += allwinner-sun8i-emac.o -common-obj-$(CONFIG_IMX_FEC) += imx_fec.o - -common-obj-$(CONFIG_CADENCE) += cadence_gem.o -common-obj-$(CONFIG_STELLARIS_ENET) += stellaris_enet.o -common-obj-$(CONFIG_LANCE) += lance.o -common-obj-$(CONFIG_LASI_82596) += lasi_i82596.o -common-obj-$(CONFIG_I82596_COMMON) += i82596.o -common-obj-$(CONFIG_SUNHME) += sunhme.o -common-obj-$(CONFIG_FTGMAC100) += ftgmac100.o -common-obj-$(CONFIG_SUNGEM) += sungem.o - -common-obj-$(CONFIG_ETRAXFS) += etraxfs_eth.o -common-obj-$(CONFIG_COLDFIRE) += mcf_fec.o -obj-$(CONFIG_MILKYMIST) += milkymist-minimac2.o -obj-$(CONFIG_PSERIES) += spapr_llan.o -obj-$(CONFIG_XILINX_ETHLITE) += xilinx_ethlite.o - -common-obj-$(CONFIG_VIRTIO_NET) += net_rx_pkt.o -obj-$(CONFIG_VIRTIO_NET) += virtio-net.o -common-obj-$(call land,$(CONFIG_VIRTIO_NET),$(CONFIG_VHOST_NET)) += vhost_net.o -common-obj-$(call lnot,$(call land,$(CONFIG_VIRTIO_NET),$(CONFIG_VHOST_NET))) += vhost_net-stub.o -common-obj-$(CONFIG_ALL) += vhost_net-stub.o - -common-obj-$(CONFIG_ETSEC) += fsl_etsec/etsec.o fsl_etsec/registers.o \ - fsl_etsec/rings.o fsl_etsec/miim.o - -common-obj-$(CONFIG_ROCKER) += rocker/rocker.o rocker/rocker_fp.o \ - rocker/rocker_desc.o rocker/rocker_world.o \ - rocker/rocker_of_dpa.o -obj-$(call lnot,$(CONFIG_ROCKER)) += rocker/qmp-norocker.o - -common-obj-$(CONFIG_CAN_BUS) += can/ -common-obj-$(CONFIG_MSF2) += msf2-emac.o diff --git a/hw/net/can/Makefile.objs b/hw/net/can/Makefile.objs deleted file mode 100644 index 9f0c4ee332..0000000000 --- a/hw/net/can/Makefile.objs +++ /dev/null @@ -1,4 +0,0 @@ -common-obj-$(CONFIG_CAN_SJA1000) += can_sja1000.o -common-obj-$(CONFIG_CAN_PCI) += can_kvaser_pci.o -common-obj-$(CONFIG_CAN_PCI) += can_pcm3680_pci.o -common-obj-$(CONFIG_CAN_PCI) += can_mioe3680_pci.o diff --git a/hw/net/can/meson.build b/hw/net/can/meson.build new file mode 100644 index 0000000000..c9cfeb7954 --- /dev/null +++ b/hw/net/can/meson.build @@ -0,0 +1,4 @@ +softmmu_ss.add(when: 'CONFIG_CAN_SJA1000', if_true: files('can_sja1000.c')) +softmmu_ss.add(when: 'CONFIG_CAN_PCI', if_true: files('can_kvaser_pci.c')) +softmmu_ss.add(when: 'CONFIG_CAN_PCI', if_true: files('can_pcm3680_pci.c')) +softmmu_ss.add(when: 'CONFIG_CAN_PCI', if_true: files('can_mioe3680_pci.c')) diff --git a/hw/net/meson.build b/hw/net/meson.build new file mode 100644 index 0000000000..4a7051b54a --- /dev/null +++ b/hw/net/meson.build @@ -0,0 +1,67 @@ +softmmu_ss.add(when: 'CONFIG_DP8393X', if_true: files('dp8393x.c')) +softmmu_ss.add(when: 'CONFIG_XEN', if_true: files('xen_nic.c')) +softmmu_ss.add(when: 'CONFIG_NE2000_COMMON', if_true: files('ne2000.c')) + +# PCI network cards +softmmu_ss.add(when: 'CONFIG_NE2000_PCI', if_true: files('ne2000-pci.c')) +softmmu_ss.add(when: 'CONFIG_EEPRO100_PCI', if_true: files('eepro100.c')) +softmmu_ss.add(when: 'CONFIG_PCNET_PCI', if_true: files('pcnet-pci.c')) +softmmu_ss.add(when: 'CONFIG_PCNET_COMMON', if_true: files('pcnet.c')) +softmmu_ss.add(when: 'CONFIG_E1000_PCI', if_true: files('e1000.c', 'e1000x_common.c')) +softmmu_ss.add(when: 'CONFIG_E1000E_PCI_EXPRESS', if_true: files('net_tx_pkt.c', 'net_rx_pkt.c')) +softmmu_ss.add(when: 'CONFIG_E1000E_PCI_EXPRESS', if_true: files('e1000e.c', 'e1000e_core.c', 'e1000x_common.c')) +softmmu_ss.add(when: 'CONFIG_RTL8139_PCI', if_true: files('rtl8139.c')) +softmmu_ss.add(when: 'CONFIG_TULIP', if_true: files('tulip.c')) +softmmu_ss.add(when: 'CONFIG_VMXNET3_PCI', if_true: files('net_tx_pkt.c', 'net_rx_pkt.c')) +softmmu_ss.add(when: 'CONFIG_VMXNET3_PCI', if_true: files('vmxnet3.c')) + +softmmu_ss.add(when: 'CONFIG_SMC91C111', if_true: files('smc91c111.c')) +softmmu_ss.add(when: 'CONFIG_LAN9118', if_true: files('lan9118.c')) +softmmu_ss.add(when: 'CONFIG_NE2000_ISA', if_true: files('ne2000-isa.c')) +softmmu_ss.add(when: 'CONFIG_OPENCORES_ETH', if_true: files('opencores_eth.c')) +softmmu_ss.add(when: 'CONFIG_XGMAC', if_true: files('xgmac.c')) +softmmu_ss.add(when: 'CONFIG_MIPSNET', if_true: files('mipsnet.c')) +softmmu_ss.add(when: 'CONFIG_XILINX_AXI', if_true: files('xilinx_axienet.c')) +softmmu_ss.add(when: 'CONFIG_ALLWINNER_EMAC', if_true: files('allwinner_emac.c')) +softmmu_ss.add(when: 'CONFIG_ALLWINNER_SUN8I_EMAC', if_true: files('allwinner-sun8i-emac.c')) +softmmu_ss.add(when: 'CONFIG_IMX_FEC', if_true: files('imx_fec.c')) +softmmu_ss.add(when: 'CONFIG_MSF2', if_true: files('msf2-emac.c')) + +softmmu_ss.add(when: 'CONFIG_CADENCE', if_true: files('cadence_gem.c')) +softmmu_ss.add(when: 'CONFIG_STELLARIS_ENET', if_true: files('stellaris_enet.c')) +softmmu_ss.add(when: 'CONFIG_LANCE', if_true: files('lance.c')) +softmmu_ss.add(when: 'CONFIG_LASI_I82596', if_true: files('lasi_i82596.c')) +softmmu_ss.add(when: 'CONFIG_I82596_COMMON', if_true: files('i82596.c')) +softmmu_ss.add(when: 'CONFIG_SUNHME', if_true: files('sunhme.c')) +softmmu_ss.add(when: 'CONFIG_FTGMAC100', if_true: files('ftgmac100.c')) +softmmu_ss.add(when: 'CONFIG_SUNGEM', if_true: files('sungem.c')) + +softmmu_ss.add(when: 'CONFIG_ETRAXFS', if_true: files('etraxfs_eth.c')) +softmmu_ss.add(when: 'CONFIG_COLDFIRE', if_true: files('mcf_fec.c')) +specific_ss.add(when: 'CONFIG_MILKYMIST', if_true: files('milkymist-minimac2.c')) +specific_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr_llan.c')) +specific_ss.add(when: 'CONFIG_XILINX_ETHLITE', if_true: files('xilinx_ethlite.c')) + +softmmu_ss.add(when: 'CONFIG_VIRTIO_NET', if_true: files('net_rx_pkt.c')) +specific_ss.add(when: 'CONFIG_VIRTIO_NET', if_true: files('virtio-net.c')) + +softmmu_ss.add(when: ['CONFIG_VIRTIO_NET', 'CONFIG_VHOST_NET'], if_true: files('vhost_net.c'), if_false: files('vhost_net-stub.c')) +softmmu_ss.add(when: 'CONFIG_ALL', if_true: files('vhost_net-stub.c')) + +softmmu_ss.add(when: 'CONFIG_ETSEC', if_true: files( + 'fsl_etsec/etsec.c', + 'fsl_etsec/miim.c', + 'fsl_etsec/registers.c', + 'fsl_etsec/rings.c', +)) + +softmmu_ss.add(when: 'CONFIG_ROCKER', if_true: files( + 'rocker/rocker.c', + 'rocker/rocker_desc.c', + 'rocker/rocker_fp.c', + 'rocker/rocker_of_dpa.c', + 'rocker/rocker_world.c', +), if_false: files('rocker/qmp-norocker.c')) +softmmu_ss.add(when: 'CONFIG_ALL', if_true: files('rocker/qmp-norocker.c')) + +subdir('can') diff --git a/hw/net/trace.h b/hw/net/trace.h new file mode 100644 index 0000000000..93249af0ac --- /dev/null +++ b/hw/net/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_net.h" diff --git a/hw/nios2/Makefile.objs b/hw/nios2/Makefile.objs deleted file mode 100644 index 3e017981ba..0000000000 --- a/hw/nios2/Makefile.objs +++ /dev/null @@ -1,3 +0,0 @@ -obj-y = boot.o cpu_pic.o -obj-$(CONFIG_NIOS2_10M50) += 10m50_devboard.o -obj-$(CONFIG_NIOS2_GENERIC_NOMMU) += generic_nommu.o diff --git a/hw/nios2/meson.build b/hw/nios2/meson.build new file mode 100644 index 0000000000..dd66ebb32f --- /dev/null +++ b/hw/nios2/meson.build @@ -0,0 +1,6 @@ +nios2_ss = ss.source_set() +nios2_ss.add(files('boot.c', 'cpu_pic.c')) +nios2_ss.add(when: 'CONFIG_NIOS2_10M50', if_true: files('10m50_devboard.c')) +nios2_ss.add(when: 'CONFIG_NIOS2_GENERIC_NOMMU', if_true: files('generic_nommu.c')) + +hw_arch += {'nios2': nios2_ss} diff --git a/hw/nubus/Makefile.objs b/hw/nubus/Makefile.objs deleted file mode 100644 index 135ba7878d..0000000000 --- a/hw/nubus/Makefile.objs +++ /dev/null @@ -1,4 +0,0 @@ -common-obj-y += nubus-device.o -common-obj-y += nubus-bus.o -common-obj-y += nubus-bridge.o -common-obj-$(CONFIG_Q800) += mac-nubus-bridge.o diff --git a/hw/nubus/meson.build b/hw/nubus/meson.build new file mode 100644 index 0000000000..9287c633aa --- /dev/null +++ b/hw/nubus/meson.build @@ -0,0 +1,7 @@ +nubus_ss = ss.source_set() +nubus_ss.add(files('nubus-device.c')) +nubus_ss.add(files('nubus-bus.c')) +nubus_ss.add(files('nubus-bridge.c')) +nubus_ss.add(when: 'CONFIG_Q800', if_true: files('mac-nubus-bridge.c')) + +softmmu_ss.add_all(when: 'CONFIG_NUBUS', if_true: nubus_ss) diff --git a/hw/nvram/Makefile.objs b/hw/nvram/Makefile.objs deleted file mode 100644 index f3ad921382..0000000000 --- a/hw/nvram/Makefile.objs +++ /dev/null @@ -1,8 +0,0 @@ -common-obj-$(CONFIG_DS1225Y) += ds1225y.o -common-obj-$(CONFIG_NMC93XX_EEPROM) += eeprom93xx.o -common-obj-$(CONFIG_AT24C) += eeprom_at24c.o -common-obj-y += fw_cfg.o -common-obj-$(CONFIG_CHRP_NVRAM) += chrp_nvram.o -common-obj-$(CONFIG_MAC_NVRAM) += mac_nvram.o -common-obj-$(CONFIG_NRF51_SOC) += nrf51_nvm.o -obj-$(CONFIG_PSERIES) += spapr_nvram.o diff --git a/hw/nvram/chrp_nvram.c b/hw/nvram/chrp_nvram.c index d969f26704..d4d10a7c03 100644 --- a/hw/nvram/chrp_nvram.c +++ b/hw/nvram/chrp_nvram.c @@ -21,14 +21,21 @@ #include "qemu/osdep.h" #include "qemu/cutils.h" +#include "qemu/error-report.h" #include "hw/nvram/chrp_nvram.h" #include "sysemu/sysemu.h" -static int chrp_nvram_set_var(uint8_t *nvram, int addr, const char *str) +static int chrp_nvram_set_var(uint8_t *nvram, int addr, const char *str, + int max_len) { int len; len = strlen(str) + 1; + + if (max_len < len) { + return -1; + } + memcpy(&nvram[addr], str, len); return addr + len; @@ -38,19 +45,26 @@ static int chrp_nvram_set_var(uint8_t *nvram, int addr, const char *str) * Create a "system partition", used for the Open Firmware * environment variables. */ -int chrp_nvram_create_system_partition(uint8_t *data, int min_len) +int chrp_nvram_create_system_partition(uint8_t *data, int min_len, int max_len) { ChrpNvramPartHdr *part_header; unsigned int i; int end; + if (max_len < sizeof(*part_header)) { + goto fail; + } + part_header = (ChrpNvramPartHdr *)data; part_header->signature = CHRP_NVPART_SYSTEM; pstrcpy(part_header->name, sizeof(part_header->name), "system"); end = sizeof(ChrpNvramPartHdr); for (i = 0; i < nb_prom_envs; i++) { - end = chrp_nvram_set_var(data, end, prom_envs[i]); + end = chrp_nvram_set_var(data, end, prom_envs[i], max_len - end); + if (end == -1) { + goto fail; + } } /* End marker */ @@ -65,6 +79,10 @@ int chrp_nvram_create_system_partition(uint8_t *data, int min_len) chrp_nvram_finish_partition(part_header, end); return end; + +fail: + error_report("NVRAM is too small. Try to pass less data to -prom-env"); + exit(EXIT_FAILURE); } /** diff --git a/hw/nvram/mac_nvram.c b/hw/nvram/mac_nvram.c index beec1c4e4d..11f2d31cdb 100644 --- a/hw/nvram/mac_nvram.c +++ b/hw/nvram/mac_nvram.c @@ -141,7 +141,7 @@ static void pmac_format_nvram_partition_of(MacIONVRAMState *nvr, int off, /* OpenBIOS nvram variables partition */ sysp_end = chrp_nvram_create_system_partition(&nvr->data[off], - DEF_SYSTEM_SIZE) + off; + DEF_SYSTEM_SIZE, len) + off; /* Free space partition */ chrp_nvram_create_free_partition(&nvr->data[sysp_end], len - sysp_end); diff --git a/hw/nvram/meson.build b/hw/nvram/meson.build new file mode 100644 index 0000000000..ba214558ac --- /dev/null +++ b/hw/nvram/meson.build @@ -0,0 +1,9 @@ +softmmu_ss.add(files('fw_cfg.c')) +softmmu_ss.add(when: 'CONFIG_CHRP_NVRAM', if_true: files('chrp_nvram.c')) +softmmu_ss.add(when: 'CONFIG_DS1225Y', if_true: files('ds1225y.c')) +softmmu_ss.add(when: 'CONFIG_NMC93XX_EEPROM', if_true: files('eeprom93xx.c')) +softmmu_ss.add(when: 'CONFIG_AT24C', if_true: files('eeprom_at24c.c')) +softmmu_ss.add(when: 'CONFIG_MAC_NVRAM', if_true: files('mac_nvram.c')) +softmmu_ss.add(when: 'CONFIG_NRF51_SOC', if_true: files('nrf51_nvm.c')) + +specific_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr_nvram.c')) diff --git a/hw/nvram/spapr_nvram.c b/hw/nvram/spapr_nvram.c index 15d08281d4..386513499f 100644 --- a/hw/nvram/spapr_nvram.c +++ b/hw/nvram/spapr_nvram.c @@ -188,7 +188,8 @@ static void spapr_nvram_realize(SpaprVioDevice *dev, Error **errp) } } else if (nb_prom_envs > 0) { /* Create a system partition to pass the -prom-env variables */ - chrp_nvram_create_system_partition(nvram->buf, MIN_NVRAM_SIZE / 4); + chrp_nvram_create_system_partition(nvram->buf, MIN_NVRAM_SIZE / 4, + nvram->size); chrp_nvram_create_free_partition(&nvram->buf[MIN_NVRAM_SIZE / 4], nvram->size - MIN_NVRAM_SIZE / 4); } diff --git a/hw/nvram/trace.h b/hw/nvram/trace.h new file mode 100644 index 0000000000..88fa900ad3 --- /dev/null +++ b/hw/nvram/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_nvram.h" diff --git a/hw/openrisc/Makefile.objs b/hw/openrisc/Makefile.objs deleted file mode 100644 index aa04de7f5a..0000000000 --- a/hw/openrisc/Makefile.objs +++ /dev/null @@ -1,2 +0,0 @@ -obj-y = pic_cpu.o cputimer.o -obj-$(CONFIG_OR1K_SIM) += openrisc_sim.o diff --git a/hw/openrisc/meson.build b/hw/openrisc/meson.build new file mode 100644 index 0000000000..57c42558e1 --- /dev/null +++ b/hw/openrisc/meson.build @@ -0,0 +1,5 @@ +openrisc_ss = ss.source_set() +openrisc_ss.add(files('pic_cpu.c', 'cputimer.c')) +openrisc_ss.add(when: 'CONFIG_OR1K_SIM', if_true: files('openrisc_sim.c')) + +hw_arch += {'openrisc': openrisc_ss} diff --git a/hw/pci-bridge/Makefile.objs b/hw/pci-bridge/Makefile.objs deleted file mode 100644 index 47065f87d9..0000000000 --- a/hw/pci-bridge/Makefile.objs +++ /dev/null @@ -1,10 +0,0 @@ -common-obj-y += pci_bridge_dev.o -common-obj-$(CONFIG_PCIE_PORT) += pcie_root_port.o gen_pcie_root_port.o pcie_pci_bridge.o -common-obj-$(CONFIG_PXB) += pci_expander_bridge.o -common-obj-$(CONFIG_XIO3130) += xio3130_upstream.o xio3130_downstream.o -common-obj-$(CONFIG_IOH3420) += ioh3420.o -common-obj-$(CONFIG_I82801B11) += i82801b11.o -# NewWorld PowerMac -common-obj-$(CONFIG_DEC_PCI) += dec.o -# Sun4u -common-obj-$(CONFIG_SIMBA) += simba.o diff --git a/hw/pci-bridge/meson.build b/hw/pci-bridge/meson.build new file mode 100644 index 0000000000..daab8acf2a --- /dev/null +++ b/hw/pci-bridge/meson.build @@ -0,0 +1,14 @@ +pci_ss = ss.source_set() +pci_ss.add(files('pci_bridge_dev.c')) +pci_ss.add(when: 'CONFIG_I82801B11', if_true: files('i82801b11.c')) +pci_ss.add(when: 'CONFIG_IOH3420', if_true: files('ioh3420.c')) +pci_ss.add(when: 'CONFIG_PCIE_PORT', if_true: files('pcie_root_port.c', 'gen_pcie_root_port.c', 'pcie_pci_bridge.c')) +pci_ss.add(when: 'CONFIG_PXB', if_true: files('pci_expander_bridge.c')) +pci_ss.add(when: 'CONFIG_XIO3130', if_true: files('xio3130_upstream.c', 'xio3130_downstream.c')) + +# NewWorld PowerMac +pci_ss.add(when: 'CONFIG_DEC_PCI', if_true: files('dec.c')) +# Sun4u +pci_ss.add(when: 'CONFIG_SIMBA', if_true: files('simba.c')) + +softmmu_ss.add_all(when: 'CONFIG_PCI', if_true: pci_ss) diff --git a/hw/pci-host/Makefile.objs b/hw/pci-host/Makefile.objs deleted file mode 100644 index e422e0aca0..0000000000 --- a/hw/pci-host/Makefile.objs +++ /dev/null @@ -1,24 +0,0 @@ -common-obj-$(CONFIG_PAM) += pam.o - -# PPC devices -common-obj-$(CONFIG_PREP_PCI) += prep.o -common-obj-$(CONFIG_GRACKLE_PCI) += grackle.o -# NewWorld PowerMac -common-obj-$(CONFIG_UNIN_PCI) += uninorth.o -# PowerPC E500 boards -common-obj-$(CONFIG_PPCE500_PCI) += ppce500.o - -# ARM devices -common-obj-$(CONFIG_VERSATILE_PCI) += versatile.o - -common-obj-$(CONFIG_PCI_SABRE) += sabre.o -common-obj-$(CONFIG_PCI_BONITO) += bonito.o -common-obj-$(CONFIG_PCI_I440FX) += i440fx.o -common-obj-$(CONFIG_XEN_IGD_PASSTHROUGH) += xen_igd_pt.o -common-obj-$(CONFIG_PCI_EXPRESS_Q35) += q35.o -common-obj-$(CONFIG_PCI_EXPRESS_GENERIC_BRIDGE) += gpex.o -common-obj-$(CONFIG_PCI_EXPRESS_XILINX) += xilinx-pcie.o - -common-obj-$(CONFIG_PCI_EXPRESS_DESIGNWARE) += designware.o -obj-$(CONFIG_POWERNV) += pnv_phb4.o pnv_phb4_pec.o -obj-$(CONFIG_POWERNV) += pnv_phb3.o pnv_phb3_msi.o pnv_phb3_pbcq.o diff --git a/hw/pci-host/meson.build b/hw/pci-host/meson.build new file mode 100644 index 0000000000..cd52f6ff1c --- /dev/null +++ b/hw/pci-host/meson.build @@ -0,0 +1,31 @@ +pci_ss = ss.source_set() +pci_ss.add(when: 'CONFIG_PAM', if_true: files('pam.c')) +pci_ss.add(when: 'CONFIG_PCI_BONITO', if_true: files('bonito.c')) +pci_ss.add(when: 'CONFIG_PCI_EXPRESS_DESIGNWARE', if_true: files('designware.c')) +pci_ss.add(when: 'CONFIG_PCI_EXPRESS_GENERIC_BRIDGE', if_true: files('gpex.c')) +pci_ss.add(when: 'CONFIG_PCI_EXPRESS_Q35', if_true: files('q35.c')) +pci_ss.add(when: 'CONFIG_PCI_EXPRESS_XILINX', if_true: files('xilinx-pcie.c')) +pci_ss.add(when: 'CONFIG_PCI_I440FX', if_true: files('i440fx.c')) +pci_ss.add(when: 'CONFIG_PCI_SABRE', if_true: files('sabre.c')) +pci_ss.add(when: 'CONFIG_XEN_IGD_PASSTHROUGH', if_true: files('xen_igd_pt.c')) + +# PPC devices +pci_ss.add(when: 'CONFIG_PREP_PCI', if_true: files('prep.c')) +pci_ss.add(when: 'CONFIG_GRACKLE_PCI', if_true: files('grackle.c')) +# NewWorld PowerMac +pci_ss.add(when: 'CONFIG_UNIN_PCI', if_true: files('uninorth.c')) +# PowerPC E500 boards +pci_ss.add(when: 'CONFIG_PPCE500_PCI', if_true: files('ppce500.c')) + +# ARM devices +pci_ss.add(when: 'CONFIG_VERSATILE_PCI', if_true: files('versatile.c')) + +softmmu_ss.add_all(when: 'CONFIG_PCI', if_true: pci_ss) + +specific_ss.add(when: 'CONFIG_POWERNV', if_true: files( + 'pnv_phb3.c', + 'pnv_phb3_msi.c', + 'pnv_phb3_pbcq.c', + 'pnv_phb4.c', + 'pnv_phb4_pec.c' +)) diff --git a/hw/pci-host/trace.h b/hw/pci-host/trace.h new file mode 100644 index 0000000000..93ec814a73 --- /dev/null +++ b/hw/pci-host/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_pci_host.h" diff --git a/hw/pci/Makefile.objs b/hw/pci/Makefile.objs deleted file mode 100644 index c78f2fb24b..0000000000 --- a/hw/pci/Makefile.objs +++ /dev/null @@ -1,14 +0,0 @@ -common-obj-$(CONFIG_PCI) += pci.o pci_bridge.o -common-obj-$(CONFIG_PCI) += msix.o msi.o -common-obj-$(CONFIG_PCI) += shpc.o -common-obj-$(CONFIG_PCI) += slotid_cap.o -common-obj-$(CONFIG_PCI) += pci_host.o - -# The functions in these modules can be used by devices too. Since we -# allow plugging PCIe devices into PCI buses, include them even if -# CONFIG_PCI_EXPRESS=n. -common-obj-$(CONFIG_PCI) += pcie.o pcie_aer.o -common-obj-$(CONFIG_PCI_EXPRESS) += pcie_port.o pcie_host.o - -common-obj-$(call lnot,$(CONFIG_PCI)) += pci-stub.o -common-obj-$(CONFIG_ALL) += pci-stub.o diff --git a/hw/pci/meson.build b/hw/pci/meson.build new file mode 100644 index 0000000000..5c4bbac817 --- /dev/null +++ b/hw/pci/meson.build @@ -0,0 +1,19 @@ +pci_ss = ss.source_set() +pci_ss.add(files( + 'msi.c', + 'msix.c', + 'pci.c', + 'pci_bridge.c', + 'pci_host.c', + 'shpc.c', + 'slotid_cap.c' +)) +# The functions in these modules can be used by devices too. Since we +# allow plugging PCIe devices into PCI buses, include them even if +# CONFIG_PCI_EXPRESS=n. +pci_ss.add(files('pcie.c', 'pcie_aer.c')) +softmmu_ss.add(when: 'CONFIG_PCI_EXPRESS', if_true: files('pcie_port.c', 'pcie_host.c')) +softmmu_ss.add_all(when: 'CONFIG_PCI', if_true: pci_ss) + +softmmu_ss.add(when: 'CONFIG_PCI', if_false: files('pci-stub.c')) +softmmu_ss.add(when: 'CONFIG_ALL', if_true: files('pci-stub.c')) diff --git a/hw/pci/trace.h b/hw/pci/trace.h new file mode 100644 index 0000000000..3dd773e22a --- /dev/null +++ b/hw/pci/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_pci.h" diff --git a/hw/pcmcia/Makefile.objs b/hw/pcmcia/Makefile.objs deleted file mode 100644 index 02cd986a2c..0000000000 --- a/hw/pcmcia/Makefile.objs +++ /dev/null @@ -1,2 +0,0 @@ -common-obj-y += pcmcia.o -common-obj-$(CONFIG_PXA2XX) += pxa2xx.o diff --git a/hw/pcmcia/meson.build b/hw/pcmcia/meson.build new file mode 100644 index 0000000000..ab50bd325d --- /dev/null +++ b/hw/pcmcia/meson.build @@ -0,0 +1,2 @@ +softmmu_ss.add(files('pcmcia.c')) +softmmu_ss.add(when: 'CONFIG_PXA2XX', if_true: files('pxa2xx.c')) diff --git a/hw/ppc/Makefile.objs b/hw/ppc/Makefile.objs deleted file mode 100644 index c3d3cc56eb..0000000000 --- a/hw/ppc/Makefile.objs +++ /dev/null @@ -1,35 +0,0 @@ -# shared objects -obj-y += ppc.o ppc_booke.o -obj-$(CONFIG_FDT_PPC) += fdt.o -obj-$(CONFIG_FW_CFG_PPC) += fw_cfg.o -# IBM pSeries (sPAPR) -obj-$(CONFIG_PSERIES) += spapr.o spapr_caps.o spapr_vio.o spapr_events.o -obj-$(CONFIG_PSERIES) += spapr_hcall.o spapr_iommu.o spapr_rtas.o -obj-$(CONFIG_PSERIES) += spapr_pci.o spapr_rtc.o spapr_drc.o -obj-$(CONFIG_PSERIES) += spapr_cpu_core.o spapr_ovec.o spapr_irq.o -obj-$(CONFIG_PSERIES) += spapr_tpm_proxy.o spapr_nvdimm.o -obj-$(CONFIG_SPAPR_RNG) += spapr_rng.o -obj-$(call land,$(CONFIG_PSERIES),$(CONFIG_LINUX)) += spapr_pci_vfio.o spapr_pci_nvlink2.o -# IBM PowerNV -obj-$(CONFIG_POWERNV) += pnv.o pnv_xscom.o pnv_core.o pnv_lpc.o pnv_psi.o pnv_occ.o pnv_bmc.o -obj-$(CONFIG_POWERNV) += pnv_homer.o pnv_pnor.o - -obj-$(CONFIG_PSERIES) += spapr_rtas_ddw.o -# PowerPC 4xx boards -obj-$(CONFIG_PPC405) += ppc405_boards.o ppc405_uc.o -obj-$(CONFIG_PPC440) += ppc440_bamboo.o ppc440_pcix.o ppc440_uc.o -obj-$(CONFIG_PPC4XX) += ppc4xx_pci.o ppc4xx_devs.o -obj-$(CONFIG_SAM460EX) += sam460ex.o -# PReP -obj-$(CONFIG_PREP) += prep.o -obj-$(CONFIG_PREP) += prep_systemio.o -obj-${CONFIG_RS6000_MC} += rs6000_mc.o -# OldWorld PowerMac -obj-$(CONFIG_MAC_OLDWORLD) += mac_oldworld.o -# NewWorld PowerMac -obj-$(CONFIG_MAC_NEWWORLD) += mac_newworld.o -# e500 -obj-$(CONFIG_E500) += e500.o mpc8544ds.o e500plat.o -obj-$(CONFIG_E500) += mpc8544_guts.o ppce500_spin.o -# PowerPC 440 Xilinx ML507 reference board. -obj-$(CONFIG_VIRTEX) += virtex_ml507.o diff --git a/hw/ppc/meson.build b/hw/ppc/meson.build new file mode 100644 index 0000000000..918969b320 --- /dev/null +++ b/hw/ppc/meson.build @@ -0,0 +1,80 @@ +ppc_ss = ss.source_set() +ppc_ss.add(files( + 'ppc.c', + 'ppc_booke.c', +)) +ppc_ss.add(when: 'CONFIG_FDT_PPC', if_true: [files( + 'fdt.c', +), fdt]) +ppc_ss.add(when: 'CONFIG_FW_CFG_PPC', if_true: files('fw_cfg.c')) + +# IBM pSeries (sPAPR) +ppc_ss.add(when: 'CONFIG_PSERIES', if_true: files( + 'spapr.c', + 'spapr_caps.c', + 'spapr_vio.c', + 'spapr_events.c', + 'spapr_hcall.c', + 'spapr_iommu.c', + 'spapr_rtas.c', + 'spapr_pci.c', + 'spapr_rtc.c', + 'spapr_drc.c', + 'spapr_cpu_core.c', + 'spapr_ovec.c', + 'spapr_irq.c', + 'spapr_tpm_proxy.c', + 'spapr_nvdimm.c', + 'spapr_rtas_ddw.c' +)) +ppc_ss.add(when: 'CONFIG_SPAPR_RNG', if_true: files('spapr_rng.c')) +ppc_ss.add(when: ['CONFIG_PSERIES', 'CONFIG_LINUX'], if_true: files( + 'spapr_pci_vfio.c', + 'spapr_pci_nvlink2.c' +)) + +# IBM PowerNV +ppc_ss.add(when: 'CONFIG_POWERNV', if_true: files( + 'pnv.c', + 'pnv_xscom.c', + 'pnv_core.c', + 'pnv_lpc.c', + 'pnv_psi.c', + 'pnv_occ.c', + 'pnv_bmc.c', + 'pnv_homer.c', + 'pnv_pnor.c', +)) +# PowerPC 4xx boards +ppc_ss.add(when: 'CONFIG_PPC405', if_true: files( + 'ppc405_boards.c', + 'ppc405_uc.c')) +ppc_ss.add(when: 'CONFIG_PPC440', if_true: files( + 'ppc440_bamboo.c', + 'ppc440_pcix.c', 'ppc440_uc.c')) +ppc_ss.add(when: 'CONFIG_PPC4XX', if_true: files( + 'ppc4xx_pci.c', + 'ppc4xx_devs.c')) +ppc_ss.add(when: 'CONFIG_SAM460EX', if_true: files('sam460ex.c')) +# PReP +ppc_ss.add(when: 'CONFIG_PREP', if_true: files('prep.c')) +ppc_ss.add(when: 'CONFIG_PREP', if_true: files('prep_systemio.c')) +ppc_ss.add(when: 'CONFIG_RS6000_MC', if_true: files('rs6000_mc.c')) +# OldWorld PowerMac +ppc_ss.add(when: 'CONFIG_MAC_OLDWORLD', if_true: files('mac_oldworld.c')) +# NewWorld PowerMac +ppc_ss.add(when: 'CONFIG_MAC_NEWWORLD', if_true: files('mac_newworld.c')) +# e500 +ppc_ss.add(when: 'CONFIG_E500', if_true: files( + 'e500.c', + 'mpc8544ds.c', + 'e500plat.c' +)) +ppc_ss.add(when: 'CONFIG_E500', if_true: files( + 'mpc8544_guts.c', + 'ppce500_spin.c' +)) +# PowerPC 440 Xilinx ML507 reference board. +ppc_ss.add(when: 'CONFIG_VIRTEX', if_true: files('virtex_ml507.c')) + +hw_arch += {'ppc': ppc_ss} diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 0ae293ec94..dd2fa4826b 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -558,7 +558,8 @@ static int spapr_dt_dynamic_reconfiguration_memory(SpaprMachineState *spapr, int nb_numa_nodes = machine->numa_state->num_nodes; int ret, i, offset; uint64_t lmb_size = SPAPR_MEMORY_BLOCK_SIZE; - uint32_t prop_lmb_size[] = {0, cpu_to_be32(lmb_size)}; + uint32_t prop_lmb_size[] = {cpu_to_be32(lmb_size >> 32), + cpu_to_be32(lmb_size & 0xffffffff)}; uint32_t *int_buf, *cur_index, buf_len; int nr_nodes = nb_numa_nodes ? nb_numa_nodes : 1; MemoryDeviceInfoList *dimms = NULL; @@ -905,7 +906,8 @@ static void spapr_dt_rtas(SpaprMachineState *spapr, void *fdt) uint32_t lrdr_capacity[] = { cpu_to_be32(max_device_addr >> 32), cpu_to_be32(max_device_addr & 0xffffffff), - 0, cpu_to_be32(SPAPR_MEMORY_BLOCK_SIZE), + cpu_to_be32(SPAPR_MEMORY_BLOCK_SIZE >> 32), + cpu_to_be32(SPAPR_MEMORY_BLOCK_SIZE & 0xffffffff), cpu_to_be32(ms->smp.max_cpus / ms->smp.threads), }; uint32_t maxdomain = cpu_to_be32(spapr->gpu_numa_id > 1 ? 1 : 0); @@ -4580,14 +4582,25 @@ static void spapr_machine_latest_class_options(MachineClass *mc) type_init(spapr_machine_register_##suffix) /* + * pseries-5.2 + */ +static void spapr_machine_5_2_class_options(MachineClass *mc) +{ + /* Defaults for the latest behaviour inherited from the base class */ +} + +DEFINE_SPAPR_MACHINE(5_2, "5.2", true); + +/* * pseries-5.1 */ static void spapr_machine_5_1_class_options(MachineClass *mc) { - /* Defaults for the latest behaviour inherited from the base class */ + spapr_machine_5_2_class_options(mc); + compat_props_add(mc->compat_props, hw_compat_5_1, hw_compat_5_1_len); } -DEFINE_SPAPR_MACHINE(5_1, "5.1", true); +DEFINE_SPAPR_MACHINE(5_1, "5.1", false); /* * pseries-5.0 diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c index 3225fc5a2e..10a80a8159 100644 --- a/hw/ppc/spapr_caps.c +++ b/hw/ppc/spapr_caps.c @@ -180,24 +180,24 @@ static void spapr_cap_set_pagesize(Object *obj, Visitor *v, const char *name, static void cap_htm_apply(SpaprMachineState *spapr, uint8_t val, Error **errp) { + ERRP_GUARD(); if (!val) { /* TODO: We don't support disabling htm yet */ return; } if (tcg_enabled()) { - error_setg(errp, - "No Transactional Memory support in TCG," - " try appending -machine cap-htm=off"); + error_setg(errp, "No Transactional Memory support in TCG"); + error_append_hint(errp, "Try appending -machine cap-htm=off\n"); } else if (kvm_enabled() && !kvmppc_has_cap_htm()) { error_setg(errp, -"KVM implementation does not support Transactional Memory," - " try appending -machine cap-htm=off" - ); + "KVM implementation does not support Transactional Memory"); + error_append_hint(errp, "Try appending -machine cap-htm=off\n"); } } static void cap_vsx_apply(SpaprMachineState *spapr, uint8_t val, Error **errp) { + ERRP_GUARD(); PowerPCCPU *cpu = POWERPC_CPU(first_cpu); CPUPPCState *env = &cpu->env; @@ -209,13 +209,14 @@ static void cap_vsx_apply(SpaprMachineState *spapr, uint8_t val, Error **errp) * rid of anything that doesn't do VMX */ g_assert(env->insns_flags & PPC_ALTIVEC); if (!(env->insns_flags2 & PPC2_VSX)) { - error_setg(errp, "VSX support not available," - " try appending -machine cap-vsx=off"); + error_setg(errp, "VSX support not available"); + error_append_hint(errp, "Try appending -machine cap-vsx=off\n"); } } static void cap_dfp_apply(SpaprMachineState *spapr, uint8_t val, Error **errp) { + ERRP_GUARD(); PowerPCCPU *cpu = POWERPC_CPU(first_cpu); CPUPPCState *env = &cpu->env; @@ -224,8 +225,8 @@ static void cap_dfp_apply(SpaprMachineState *spapr, uint8_t val, Error **errp) return; } if (!(env->insns_flags2 & PPC2_DFP)) { - error_setg(errp, "DFP support not available," - " try appending -machine cap-dfp=off"); + error_setg(errp, "DFP support not available"); + error_append_hint(errp, "Try appending -machine cap-dfp=off\n"); } } @@ -239,6 +240,7 @@ SpaprCapPossible cap_cfpc_possible = { static void cap_safe_cache_apply(SpaprMachineState *spapr, uint8_t val, Error **errp) { + ERRP_GUARD(); uint8_t kvm_val = kvmppc_get_cap_safe_cache(); if (tcg_enabled() && val) { @@ -247,9 +249,9 @@ static void cap_safe_cache_apply(SpaprMachineState *spapr, uint8_t val, cap_cfpc_possible.vals[val]); } else if (kvm_enabled() && (val > kvm_val)) { error_setg(errp, - "Requested safe cache capability level not supported by kvm," - " try appending -machine cap-cfpc=%s", - cap_cfpc_possible.vals[kvm_val]); + "Requested safe cache capability level not supported by KVM"); + error_append_hint(errp, "Try appending -machine cap-cfpc=%s\n", + cap_cfpc_possible.vals[kvm_val]); } } @@ -263,6 +265,7 @@ SpaprCapPossible cap_sbbc_possible = { static void cap_safe_bounds_check_apply(SpaprMachineState *spapr, uint8_t val, Error **errp) { + ERRP_GUARD(); uint8_t kvm_val = kvmppc_get_cap_safe_bounds_check(); if (tcg_enabled() && val) { @@ -271,9 +274,9 @@ static void cap_safe_bounds_check_apply(SpaprMachineState *spapr, uint8_t val, cap_sbbc_possible.vals[val]); } else if (kvm_enabled() && (val > kvm_val)) { error_setg(errp, -"Requested safe bounds check capability level not supported by kvm," - " try appending -machine cap-sbbc=%s", - cap_sbbc_possible.vals[kvm_val]); +"Requested safe bounds check capability level not supported by KVM"); + error_append_hint(errp, "Try appending -machine cap-sbbc=%s\n", + cap_sbbc_possible.vals[kvm_val]); } } @@ -290,6 +293,7 @@ SpaprCapPossible cap_ibs_possible = { static void cap_safe_indirect_branch_apply(SpaprMachineState *spapr, uint8_t val, Error **errp) { + ERRP_GUARD(); uint8_t kvm_val = kvmppc_get_cap_safe_indirect_branch(); if (tcg_enabled() && val) { @@ -298,9 +302,9 @@ static void cap_safe_indirect_branch_apply(SpaprMachineState *spapr, cap_ibs_possible.vals[val]); } else if (kvm_enabled() && (val > kvm_val)) { error_setg(errp, -"Requested safe indirect branch capability level not supported by kvm," - " try appending -machine cap-ibs=%s", - cap_ibs_possible.vals[kvm_val]); +"Requested safe indirect branch capability level not supported by KVM"); + error_append_hint(errp, "Try appending -machine cap-ibs=%s\n", + cap_ibs_possible.vals[kvm_val]); } } @@ -377,23 +381,35 @@ static void cap_hpt_maxpagesize_cpu_apply(SpaprMachineState *spapr, static void cap_nested_kvm_hv_apply(SpaprMachineState *spapr, uint8_t val, Error **errp) { + ERRP_GUARD(); + PowerPCCPU *cpu = POWERPC_CPU(first_cpu); + if (!val) { /* capability disabled by default */ return; } if (tcg_enabled()) { - error_setg(errp, - "No Nested KVM-HV support in tcg," - " try appending -machine cap-nested-hv=off"); + error_setg(errp, "No Nested KVM-HV support in TCG"); + error_append_hint(errp, "Try appending -machine cap-nested-hv=off\n"); } else if (kvm_enabled()) { + if (!ppc_check_compat(cpu, CPU_POWERPC_LOGICAL_3_00, 0, + spapr->max_compat_pvr)) { + error_setg(errp, "Nested KVM-HV only supported on POWER9"); + error_append_hint(errp, + "Try appending -machine max-cpu-compat=power9\n"); + return; + } + if (!kvmppc_has_cap_nested_kvm_hv()) { error_setg(errp, -"KVM implementation does not support Nested KVM-HV," - " try appending -machine cap-nested-hv=off"); + "KVM implementation does not support Nested KVM-HV"); + error_append_hint(errp, + "Try appending -machine cap-nested-hv=off\n"); } else if (kvmppc_set_cap_nested_kvm_hv(val) < 0) { - error_setg(errp, -"Error enabling cap-nested-hv with KVM, try cap-nested-hv=off"); + error_setg(errp, "Error enabling cap-nested-hv with KVM"); + error_append_hint(errp, + "Try appending -machine cap-nested-hv=off\n"); } } } @@ -401,6 +417,7 @@ static void cap_nested_kvm_hv_apply(SpaprMachineState *spapr, static void cap_large_decr_apply(SpaprMachineState *spapr, uint8_t val, Error **errp) { + ERRP_GUARD(); PowerPCCPU *cpu = POWERPC_CPU(first_cpu); PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu); @@ -411,22 +428,23 @@ static void cap_large_decr_apply(SpaprMachineState *spapr, if (tcg_enabled()) { if (!ppc_check_compat(cpu, CPU_POWERPC_LOGICAL_3_00, 0, spapr->max_compat_pvr)) { - error_setg(errp, - "Large decrementer only supported on POWER9, try -cpu POWER9"); + error_setg(errp, "Large decrementer only supported on POWER9"); + error_append_hint(errp, "Try -cpu POWER9\n"); return; } } else if (kvm_enabled()) { int kvm_nr_bits = kvmppc_get_cap_large_decr(); if (!kvm_nr_bits) { - error_setg(errp, - "No large decrementer support," - " try appending -machine cap-large-decr=off"); + error_setg(errp, "No large decrementer support"); + error_append_hint(errp, + "Try appending -machine cap-large-decr=off\n"); } else if (pcc->lrg_decr_bits != kvm_nr_bits) { error_setg(errp, -"KVM large decrementer size (%d) differs to model (%d)," - " try appending -machine cap-large-decr=off", - kvm_nr_bits, pcc->lrg_decr_bits); + "KVM large decrementer size (%d) differs to model (%d)", + kvm_nr_bits, pcc->lrg_decr_bits); + error_append_hint(errp, + "Try appending -machine cap-large-decr=off\n"); } } } @@ -435,14 +453,15 @@ static void cap_large_decr_cpu_apply(SpaprMachineState *spapr, PowerPCCPU *cpu, uint8_t val, Error **errp) { + ERRP_GUARD(); CPUPPCState *env = &cpu->env; target_ulong lpcr = env->spr[SPR_LPCR]; if (kvm_enabled()) { if (kvmppc_enable_cap_large_decr(cpu, val)) { - error_setg(errp, - "No large decrementer support," - " try appending -machine cap-large-decr=off"); + error_setg(errp, "No large decrementer support"); + error_append_hint(errp, + "Try appending -machine cap-large-decr=off\n"); } } @@ -457,6 +476,7 @@ static void cap_large_decr_cpu_apply(SpaprMachineState *spapr, static void cap_ccf_assist_apply(SpaprMachineState *spapr, uint8_t val, Error **errp) { + ERRP_GUARD(); uint8_t kvm_val = kvmppc_get_cap_count_cache_flush_assist(); if (tcg_enabled() && val) { @@ -479,14 +499,15 @@ static void cap_ccf_assist_apply(SpaprMachineState *spapr, uint8_t val, return; } error_setg(errp, -"Requested count cache flush assist capability level not supported by kvm," - " try appending -machine cap-ccf-assist=off"); + "Requested count cache flush assist capability level not supported by KVM"); + error_append_hint(errp, "Try appending -machine cap-ccf-assist=off\n"); } } static void cap_fwnmi_apply(SpaprMachineState *spapr, uint8_t val, Error **errp) { + ERRP_GUARD(); if (!val) { return; /* Disabled by default */ } diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c index 2f8f7d62f8..72bb938375 100644 --- a/hw/ppc/spapr_irq.c +++ b/hw/ppc/spapr_irq.c @@ -139,6 +139,7 @@ SpaprIrq spapr_irq_dual = { static int spapr_irq_check(SpaprMachineState *spapr, Error **errp) { + ERRP_GUARD(); MachineState *machine = MACHINE(spapr); /* @@ -179,14 +180,19 @@ static int spapr_irq_check(SpaprMachineState *spapr, Error **errp) /* * On a POWER9 host, some older KVM XICS devices cannot be destroyed and - * re-created. Detect that early to avoid QEMU to exit later when the - * guest reboots. + * re-created. Same happens with KVM nested guests. Detect that early to + * avoid QEMU to exit later when the guest reboots. */ if (kvm_enabled() && spapr->irq == &spapr_irq_dual && kvm_kernel_irqchip_required() && xics_kvm_has_broken_disconnect(spapr)) { - error_setg(errp, "KVM is too old to support ic-mode=dual,kernel-irqchip=on"); + error_setg(errp, + "KVM is incompatible with ic-mode=dual,kernel-irqchip=on"); + error_append_hint(errp, + "This can happen with an old KVM or in a KVM nested guest.\n"); + error_append_hint(errp, + "Try without kernel-irqchip or with kernel-irqchip=off.\n"); return -1; } diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 363cdb3f7b..0a418f1e67 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -1796,6 +1796,7 @@ static void spapr_phb_destroy_msi(gpointer opaque) static void spapr_phb_realize(DeviceState *dev, Error **errp) { + ERRP_GUARD(); /* We don't use SPAPR_MACHINE() in order to exit gracefully if the user * tries to add a sPAPR PHB to a non-pseries machine. */ @@ -1813,7 +1814,6 @@ static void spapr_phb_realize(DeviceState *dev, Error **errp) uint64_t msi_window_size = 4096; SpaprTceTable *tcet; const unsigned windows_supported = spapr_phb_windows_supported(sphb); - Error *local_err = NULL; if (!spapr) { error_setg(errp, TYPE_SPAPR_PCI_HOST_BRIDGE " needs a pseries machine"); @@ -1964,13 +1964,12 @@ static void spapr_phb_realize(DeviceState *dev, Error **errp) /* Initialize the LSI table */ for (i = 0; i < PCI_NUM_PINS; i++) { - uint32_t irq = SPAPR_IRQ_PCI_LSI + sphb->index * PCI_NUM_PINS + i; + int irq = SPAPR_IRQ_PCI_LSI + sphb->index * PCI_NUM_PINS + i; if (smc->legacy_irq_allocation) { - irq = spapr_irq_findone(spapr, &local_err); - if (local_err) { - error_propagate_prepend(errp, local_err, - "can't allocate LSIs: "); + irq = spapr_irq_findone(spapr, errp); + if (irq < 0) { + error_prepend(errp, "can't allocate LSIs: "); /* * Older machines will never support PHB hotplug, ie, this is an * init only path and QEMU will terminate. No need to rollback. @@ -1979,9 +1978,8 @@ static void spapr_phb_realize(DeviceState *dev, Error **errp) } } - spapr_irq_claim(spapr, irq, true, &local_err); - if (local_err) { - error_propagate_prepend(errp, local_err, "can't allocate LSIs: "); + if (spapr_irq_claim(spapr, irq, true, errp) < 0) { + error_prepend(errp, "can't allocate LSIs: "); goto unrealize; } diff --git a/hw/ppc/trace.h b/hw/ppc/trace.h new file mode 100644 index 0000000000..87c4198e61 --- /dev/null +++ b/hw/ppc/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_ppc.h" diff --git a/hw/rdma/Makefile.objs b/hw/rdma/Makefile.objs deleted file mode 100644 index 819bb12a35..0000000000 --- a/hw/rdma/Makefile.objs +++ /dev/null @@ -1,3 +0,0 @@ -obj-$(CONFIG_VMW_PVRDMA) += rdma_utils.o rdma_backend.o rdma_rm.o rdma.o -obj-$(CONFIG_VMW_PVRDMA) += vmw/pvrdma_dev_ring.o vmw/pvrdma_cmd.o \ - vmw/pvrdma_qp_ops.o vmw/pvrdma_main.o diff --git a/hw/rdma/meson.build b/hw/rdma/meson.build new file mode 100644 index 0000000000..7325f40c32 --- /dev/null +++ b/hw/rdma/meson.build @@ -0,0 +1,10 @@ +specific_ss.add(when: 'CONFIG_VMW_PVRDMA', if_true: files( + 'rdma.c', + 'rdma_backend.c', + 'rdma_rm.c', + 'rdma_utils.c', + 'vmw/pvrdma_cmd.c', + 'vmw/pvrdma_dev_ring.c', + 'vmw/pvrdma_main.c', + 'vmw/pvrdma_qp_ops.c', +)) diff --git a/hw/rdma/trace.h b/hw/rdma/trace.h new file mode 100644 index 0000000000..b3fa8ebc51 --- /dev/null +++ b/hw/rdma/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_rdma.h" diff --git a/hw/rdma/vmw/trace.h b/hw/rdma/vmw/trace.h new file mode 100644 index 0000000000..3ebc9fb7ad --- /dev/null +++ b/hw/rdma/vmw/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_rdma_vmw.h" diff --git a/hw/riscv/Makefile.objs b/hw/riscv/Makefile.objs deleted file mode 100644 index 57cc708f5d..0000000000 --- a/hw/riscv/Makefile.objs +++ /dev/null @@ -1,16 +0,0 @@ -obj-y += boot.o -obj-$(CONFIG_SPIKE) += riscv_htif.o -obj-$(CONFIG_HART) += riscv_hart.o -obj-$(CONFIG_OPENTITAN) += opentitan.o -obj-$(CONFIG_SIFIVE_E) += sifive_e.o -obj-$(CONFIG_SIFIVE_E) += sifive_e_prci.o -obj-$(CONFIG_SIFIVE) += sifive_clint.o -obj-$(CONFIG_SIFIVE) += sifive_gpio.o -obj-$(CONFIG_SIFIVE) += sifive_plic.o -obj-$(CONFIG_SIFIVE) += sifive_test.o -obj-$(CONFIG_SIFIVE_U) += sifive_u.o -obj-$(CONFIG_SIFIVE_U) += sifive_u_otp.o -obj-$(CONFIG_SIFIVE_U) += sifive_u_prci.o -obj-$(CONFIG_SIFIVE) += sifive_uart.o -obj-$(CONFIG_SPIKE) += spike.o -obj-$(CONFIG_RISCV_VIRT) += virt.o diff --git a/hw/riscv/meson.build b/hw/riscv/meson.build new file mode 100644 index 0000000000..2de8e5a2fe --- /dev/null +++ b/hw/riscv/meson.build @@ -0,0 +1,19 @@ +riscv_ss = ss.source_set() +riscv_ss.add(files('boot.c')) +riscv_ss.add(when: 'CONFIG_HART', if_true: files('riscv_hart.c')) +riscv_ss.add(when: 'CONFIG_OPENTITAN', if_true: files('opentitan.c')) +riscv_ss.add(when: 'CONFIG_RISCV_VIRT', if_true: files('virt.c')) +riscv_ss.add(when: 'CONFIG_SIFIVE', if_true: files('sifive_clint.c')) +riscv_ss.add(when: 'CONFIG_SIFIVE', if_true: files('sifive_gpio.c')) +riscv_ss.add(when: 'CONFIG_SIFIVE', if_true: files('sifive_plic.c')) +riscv_ss.add(when: 'CONFIG_SIFIVE', if_true: files('sifive_test.c')) +riscv_ss.add(when: 'CONFIG_SIFIVE', if_true: files('sifive_uart.c')) +riscv_ss.add(when: 'CONFIG_SIFIVE_E', if_true: files('sifive_e.c')) +riscv_ss.add(when: 'CONFIG_SIFIVE_E', if_true: files('sifive_e_prci.c')) +riscv_ss.add(when: 'CONFIG_SIFIVE_U', if_true: files('sifive_u.c')) +riscv_ss.add(when: 'CONFIG_SIFIVE_U', if_true: files('sifive_u_otp.c')) +riscv_ss.add(when: 'CONFIG_SIFIVE_U', if_true: files('sifive_u_prci.c')) +riscv_ss.add(when: 'CONFIG_SPIKE', if_true: files('riscv_htif.c')) +riscv_ss.add(when: 'CONFIG_SPIKE', if_true: files('spike.c')) + +hw_arch += {'riscv': riscv_ss} diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c index e5682c38a9..18301e6fa5 100644 --- a/hw/riscv/sifive_u.c +++ b/hw/riscv/sifive_u.c @@ -60,9 +60,9 @@ #include <libfdt.h> #if defined(TARGET_RISCV32) -# define BIOS_FILENAME "opensbi-riscv32-sifive_u-fw_jump.bin" +# define BIOS_FILENAME "opensbi-riscv32-generic-fw_dynamic.bin" #else -# define BIOS_FILENAME "opensbi-riscv64-sifive_u-fw_jump.bin" +# define BIOS_FILENAME "opensbi-riscv64-generic-fw_dynamic.bin" #endif static const struct MemmapEntry { @@ -72,6 +72,7 @@ static const struct MemmapEntry { [SIFIVE_U_DEBUG] = { 0x0, 0x100 }, [SIFIVE_U_MROM] = { 0x1000, 0xf000 }, [SIFIVE_U_CLINT] = { 0x2000000, 0x10000 }, + [SIFIVE_U_L2CC] = { 0x2010000, 0x1000 }, [SIFIVE_U_L2LIM] = { 0x8000000, 0x2000000 }, [SIFIVE_U_PLIC] = { 0xc000000, 0x4000000 }, [SIFIVE_U_PRCI] = { 0x10000000, 0x1000 }, @@ -302,6 +303,24 @@ static void create_fdt(SiFiveUState *s, const struct MemmapEntry *memmap, qemu_fdt_setprop_string(fdt, nodename, "compatible", "gpio-restart"); g_free(nodename); + nodename = g_strdup_printf("/soc/cache-controller@%lx", + (long)memmap[SIFIVE_U_L2CC].base); + qemu_fdt_add_subnode(fdt, nodename); + qemu_fdt_setprop_cells(fdt, nodename, "reg", + 0x0, memmap[SIFIVE_U_L2CC].base, + 0x0, memmap[SIFIVE_U_L2CC].size); + qemu_fdt_setprop_cells(fdt, nodename, "interrupts", + SIFIVE_U_L2CC_IRQ0, SIFIVE_U_L2CC_IRQ1, SIFIVE_U_L2CC_IRQ2); + qemu_fdt_setprop_cell(fdt, nodename, "interrupt-parent", plic_phandle); + qemu_fdt_setprop(fdt, nodename, "cache-unified", NULL, 0); + qemu_fdt_setprop_cell(fdt, nodename, "cache-size", 2097152); + qemu_fdt_setprop_cell(fdt, nodename, "cache-sets", 1024); + qemu_fdt_setprop_cell(fdt, nodename, "cache-level", 2); + qemu_fdt_setprop_cell(fdt, nodename, "cache-block-size", 64); + qemu_fdt_setprop_string(fdt, nodename, "compatible", + "sifive,fu540-c000-ccache"); + g_free(nodename); + phy_phandle = phandle++; nodename = g_strdup_printf("/soc/ethernet@%lx", (long)memmap[SIFIVE_U_GEM].base); @@ -733,6 +752,9 @@ static void sifive_u_soc_realize(DeviceState *dev, Error **errp) create_unimplemented_device("riscv.sifive.u.dmc", memmap[SIFIVE_U_DMC].base, memmap[SIFIVE_U_DMC].size); + + create_unimplemented_device("riscv.sifive.u.l2cc", + memmap[SIFIVE_U_L2CC].base, memmap[SIFIVE_U_L2CC].size); } static Property sifive_u_soc_props[] = { diff --git a/hw/riscv/spike.c b/hw/riscv/spike.c index 7b23a297fc..13958bdbeb 100644 --- a/hw/riscv/spike.c +++ b/hw/riscv/spike.c @@ -42,10 +42,15 @@ #include "sysemu/qtest.h" #include "sysemu/sysemu.h" +/* + * Not like other RISC-V machines that use plain binary bios images, + * keeping ELF files here was intentional because BIN files don't work + * for the Spike machine as HTIF emulation depends on ELF parsing. + */ #if defined(TARGET_RISCV32) -# define BIOS_FILENAME "opensbi-riscv32-spike-fw_jump.elf" +# define BIOS_FILENAME "opensbi-riscv32-generic-fw_dynamic.elf" #else -# define BIOS_FILENAME "opensbi-riscv64-spike-fw_jump.elf" +# define BIOS_FILENAME "opensbi-riscv64-generic-fw_dynamic.elf" #endif static const struct MemmapEntry { diff --git a/hw/riscv/trace.h b/hw/riscv/trace.h new file mode 100644 index 0000000000..8c0e3ca1f3 --- /dev/null +++ b/hw/riscv/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_riscv.h" diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 55a907bb35..6e91cf129e 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -43,9 +43,9 @@ #include "hw/pci-host/gpex.h" #if defined(TARGET_RISCV32) -# define BIOS_FILENAME "opensbi-riscv32-virt-fw_jump.bin" +# define BIOS_FILENAME "opensbi-riscv32-generic-fw_dynamic.bin" #else -# define BIOS_FILENAME "opensbi-riscv64-virt-fw_jump.bin" +# define BIOS_FILENAME "opensbi-riscv64-generic-fw_dynamic.bin" #endif static const struct MemmapEntry { diff --git a/hw/rtc/Makefile.objs b/hw/rtc/Makefile.objs deleted file mode 100644 index e4c1b8617c..0000000000 --- a/hw/rtc/Makefile.objs +++ /dev/null @@ -1,15 +0,0 @@ -common-obj-$(CONFIG_DS1338) += ds1338.o -common-obj-$(CONFIG_M41T80) += m41t80.o -common-obj-$(CONFIG_M48T59) += m48t59.o -ifeq ($(CONFIG_ISA_BUS),y) -common-obj-$(CONFIG_M48T59) += m48t59-isa.o -endif -common-obj-$(CONFIG_PL031) += pl031.o -common-obj-$(CONFIG_TWL92230) += twl92230.o -common-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-zynqmp-rtc.o -common-obj-$(CONFIG_EXYNOS4) += exynos4210_rtc.o -obj-$(CONFIG_MC146818RTC) += mc146818rtc.o -common-obj-$(CONFIG_SUN4V_RTC) += sun4v-rtc.o -common-obj-$(CONFIG_ASPEED_SOC) += aspeed_rtc.o -common-obj-$(CONFIG_GOLDFISH_RTC) += goldfish_rtc.o -common-obj-$(CONFIG_ALLWINNER_H3) += allwinner-rtc.o diff --git a/hw/rtc/meson.build b/hw/rtc/meson.build new file mode 100644 index 0000000000..7cecdee5dd --- /dev/null +++ b/hw/rtc/meson.build @@ -0,0 +1,16 @@ + +softmmu_ss.add(when: 'CONFIG_DS1338', if_true: files('ds1338.c')) +softmmu_ss.add(when: 'CONFIG_M41T80', if_true: files('m41t80.c')) +softmmu_ss.add(when: 'CONFIG_M48T59', if_true: files('m48t59.c')) +softmmu_ss.add(when: 'CONFIG_PL031', if_true: files('pl031.c')) +softmmu_ss.add(when: 'CONFIG_TWL92230', if_true: files('twl92230.c')) +softmmu_ss.add(when: ['CONFIG_ISA_BUS', 'CONFIG_M48T59'], if_true: files('m48t59-isa.c')) +softmmu_ss.add(when: 'CONFIG_XLNX_ZYNQMP', if_true: files('xlnx-zynqmp-rtc.c')) + +softmmu_ss.add(when: 'CONFIG_EXYNOS4', if_true: files('exynos4210_rtc.c')) +softmmu_ss.add(when: 'CONFIG_SUN4V_RTC', if_true: files('sun4v-rtc.c')) +softmmu_ss.add(when: 'CONFIG_ASPEED_SOC', if_true: files('aspeed_rtc.c')) +softmmu_ss.add(when: 'CONFIG_GOLDFISH_RTC', if_true: files('goldfish_rtc.c')) +softmmu_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-rtc.c')) + +specific_ss.add(when: 'CONFIG_MC146818RTC', if_true: files('mc146818rtc.c')) diff --git a/hw/rtc/trace.h b/hw/rtc/trace.h new file mode 100644 index 0000000000..cfd5d6ee62 --- /dev/null +++ b/hw/rtc/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_rtc.h" diff --git a/hw/rx/Makefile.objs b/hw/rx/Makefile.objs deleted file mode 100644 index 4ef6b9e5b1..0000000000 --- a/hw/rx/Makefile.objs +++ /dev/null @@ -1,2 +0,0 @@ -obj-$(CONFIG_RX62N_MCU) += rx62n.o -obj-$(CONFIG_RX_GDBSIM) += rx-gdbsim.o diff --git a/hw/rx/meson.build b/hw/rx/meson.build new file mode 100644 index 0000000000..d223512a78 --- /dev/null +++ b/hw/rx/meson.build @@ -0,0 +1,5 @@ +rx_ss = ss.source_set() +rx_ss.add(when: 'CONFIG_RX_GDBSIM', if_true: files('rx-gdbsim.c')) +rx_ss.add(when: 'CONFIG_RX62N_MCU', if_true: files('rx62n.c')) + +hw_arch += {'rx': rx_ss} diff --git a/hw/s390x/Makefile.objs b/hw/s390x/Makefile.objs deleted file mode 100644 index a46a1c7894..0000000000 --- a/hw/s390x/Makefile.objs +++ /dev/null @@ -1,37 +0,0 @@ -obj-y += s390-virtio-hcall.o -obj-y += sclp.o -obj-y += event-facility.o -obj-y += sclpquiesce.o -obj-y += sclpcpu.o -obj-y += ipl.o -obj-y += css.o -obj-$(CONFIG_S390_CCW_VIRTIO) += s390-virtio-ccw.o -obj-$(CONFIG_TERMINAL3270) += 3270-ccw.o -ifeq ($(CONFIG_VIRTIO_CCW),y) -obj-y += virtio-ccw.o -obj-$(CONFIG_VIRTIO_SERIAL) += virtio-ccw-serial.o -obj-$(CONFIG_VIRTIO_BALLOON) += virtio-ccw-balloon.o -obj-$(CONFIG_VIRTIO_SCSI) += virtio-ccw-scsi.o -obj-$(CONFIG_VIRTIO_RNG) += virtio-ccw-rng.o -obj-$(CONFIG_VIRTIO_CRYPTO) += virtio-ccw-crypto.o -obj-$(CONFIG_VIRTIO_GPU) += virtio-ccw-gpu.o -obj-$(CONFIG_VIRTIO_INPUT) += virtio-ccw-input.o -obj-$(CONFIG_VIRTIO_NET) += virtio-ccw-net.o -obj-$(CONFIG_VIRTIO_BLK) += virtio-ccw-blk.o -obj-$(call land,$(CONFIG_VIRTIO_9P),$(CONFIG_VIRTFS)) += virtio-ccw-9p.o -obj-$(CONFIG_VHOST_VSOCK) += vhost-vsock-ccw.o -endif -obj-y += css-bridge.o -obj-y += ccw-device.o -obj-y += s390-pci-bus.o s390-pci-inst.o -obj-y += s390-skeys.o -obj-y += s390-stattrib.o -obj-y += tod.o -obj-y += tod-qemu.o -obj-$(CONFIG_KVM) += tod-kvm.o -obj-$(CONFIG_KVM) += s390-skeys-kvm.o -obj-$(CONFIG_KVM) += s390-stattrib-kvm.o -obj-$(CONFIG_KVM) += pv.o -obj-y += s390-ccw.o -obj-y += ap-device.o -obj-y += ap-bridge.o diff --git a/hw/s390x/meson.build b/hw/s390x/meson.build new file mode 100644 index 0000000000..b63782d87a --- /dev/null +++ b/hw/s390x/meson.build @@ -0,0 +1,46 @@ +s390x_ss = ss.source_set() +s390x_ss.add(files( + 'ap-bridge.c', + 'ap-device.c', + 'ccw-device.c', + 'css-bridge.c', + 'css.c', + 'event-facility.c', + 'ipl.c', + 's390-ccw.c', + 's390-pci-bus.c', + 's390-pci-inst.c', + 's390-skeys.c', + 's390-stattrib.c', + 's390-virtio-hcall.c', + 'sclp.c', + 'sclpcpu.c', + 'sclpquiesce.c', + 'tod-qemu.c', + 'tod.c', +)) +s390x_ss.add(when: 'CONFIG_KVM', if_true: files( + 'tod-kvm.c', + 's390-skeys-kvm.c', + 's390-stattrib-kvm.c', + 'pv.c', +)) +s390x_ss.add(when: 'CONFIG_S390_CCW_VIRTIO', if_true: files('s390-virtio-ccw.c')) +s390x_ss.add(when: 'CONFIG_TERMINAL3270', if_true: files('3270-ccw.c')) + +virtio_ss = ss.source_set() +virtio_ss.add(files('virtio-ccw.c')) +virtio_ss.add(when: 'CONFIG_VIRTIO_BALLOON', if_true: files('virtio-ccw-balloon.c')) +virtio_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-ccw-blk.c')) +virtio_ss.add(when: 'CONFIG_VIRTIO_CRYPTO', if_true: files('virtio-ccw-crypto.c')) +virtio_ss.add(when: 'CONFIG_VIRTIO_GPU', if_true: files('virtio-ccw-gpu.c')) +virtio_ss.add(when: 'CONFIG_VIRTIO_INPUT', if_true: files('virtio-ccw-input.c')) +virtio_ss.add(when: 'CONFIG_VIRTIO_NET', if_true: files('virtio-ccw-net.c')) +virtio_ss.add(when: 'CONFIG_VIRTIO_RNG', if_true: files('virtio-ccw-rng.c')) +virtio_ss.add(when: 'CONFIG_VIRTIO_SCSI', if_true: files('virtio-ccw-scsi.c')) +virtio_ss.add(when: 'CONFIG_VIRTIO_SERIAL', if_true: files('virtio-ccw-serial.c')) +virtio_ss.add(when: ['CONFIG_VIRTIO_9P', 'CONFIG_VIRTFS'], if_true: files('virtio-ccw-blk.c')) +virtio_ss.add(when: 'CONFIG_VHOST_VSOCK', if_true: files('vhost-vsock-ccw.c')) +s390x_ss.add_all(when: 'CONFIG_VIRTIO_CCW', if_true: virtio_ss) + +hw_arch += {'s390x': s390x_ss} diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index e72c61d2ea..f4ea6a9545 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -801,14 +801,26 @@ bool css_migration_enabled(void) } \ type_init(ccw_machine_register_##suffix) +static void ccw_machine_5_2_instance_options(MachineState *machine) +{ +} + +static void ccw_machine_5_2_class_options(MachineClass *mc) +{ +} +DEFINE_CCW_MACHINE(5_2, "5.2", true); + static void ccw_machine_5_1_instance_options(MachineState *machine) { + ccw_machine_5_2_instance_options(machine); } static void ccw_machine_5_1_class_options(MachineClass *mc) { + ccw_machine_5_2_class_options(mc); + compat_props_add(mc->compat_props, hw_compat_5_1, hw_compat_5_1_len); } -DEFINE_CCW_MACHINE(5_1, "5.1", true); +DEFINE_CCW_MACHINE(5_1, "5.1", false); static void ccw_machine_5_0_instance_options(MachineState *machine) { diff --git a/hw/s390x/trace.h b/hw/s390x/trace.h new file mode 100644 index 0000000000..d6568b3648 --- /dev/null +++ b/hw/s390x/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_s390x.h" diff --git a/hw/scsi/Makefile.objs b/hw/scsi/Makefile.objs deleted file mode 100644 index 54b36ed8b1..0000000000 --- a/hw/scsi/Makefile.objs +++ /dev/null @@ -1,15 +0,0 @@ -common-obj-y += scsi-disk.o emulation.o -common-obj-y += scsi-generic.o scsi-bus.o -common-obj-$(CONFIG_LSI_SCSI_PCI) += lsi53c895a.o -common-obj-$(CONFIG_MPTSAS_SCSI_PCI) += mptsas.o mptconfig.o mptendian.o -common-obj-$(CONFIG_MEGASAS_SCSI_PCI) += megasas.o -common-obj-$(CONFIG_VMW_PVSCSI_SCSI_PCI) += vmw_pvscsi.o -common-obj-$(CONFIG_ESP) += esp.o -common-obj-$(CONFIG_ESP_PCI) += esp-pci.o -obj-$(CONFIG_SPAPR_VSCSI) += spapr_vscsi.o - -ifeq ($(CONFIG_VIRTIO_SCSI),y) -obj-y += virtio-scsi.o virtio-scsi-dataplane.o -obj-$(CONFIG_VHOST_SCSI) += vhost-scsi-common.o vhost-scsi.o -obj-$(CONFIG_VHOST_USER_SCSI) += vhost-scsi-common.o vhost-user-scsi.o -endif diff --git a/hw/scsi/meson.build b/hw/scsi/meson.build new file mode 100644 index 0000000000..923a34f344 --- /dev/null +++ b/hw/scsi/meson.build @@ -0,0 +1,26 @@ +scsi_ss = ss.source_set() +scsi_ss.add(files( + 'emulation.c', + 'scsi-bus.c', + 'scsi-disk.c', + 'scsi-generic.c', +)) +scsi_ss.add(when: 'CONFIG_ESP', if_true: files('esp.c')) +scsi_ss.add(when: 'CONFIG_ESP_PCI', if_true: files('esp-pci.c')) +scsi_ss.add(when: 'CONFIG_LSI_SCSI_PCI', if_true: files('lsi53c895a.c')) +scsi_ss.add(when: 'CONFIG_MEGASAS_SCSI_PCI', if_true: files('megasas.c')) +scsi_ss.add(when: 'CONFIG_MPTSAS_SCSI_PCI', if_true: files('mptsas.c', 'mptconfig.c', 'mptendian.c')) +scsi_ss.add(when: 'CONFIG_VMW_PVSCSI_SCSI_PCI', if_true: files('vmw_pvscsi.c')) +softmmu_ss.add_all(when: 'CONFIG_SCSI', if_true: scsi_ss) + +specific_scsi_ss = ss.source_set() + +virtio_scsi_ss = ss.source_set() +virtio_scsi_ss.add(files('virtio-scsi.c', 'virtio-scsi-dataplane.c')) +virtio_scsi_ss.add(when: 'CONFIG_VHOST_SCSI', if_true: files('vhost-scsi-common.c', 'vhost-scsi.c')) +virtio_scsi_ss.add(when: 'CONFIG_VHOST_USER_SCSI', if_true: files('vhost-scsi-common.c', 'vhost-user-scsi.c')) +specific_scsi_ss.add_all(when: 'CONFIG_VIRTIO_SCSI', if_true: virtio_scsi_ss) + +specific_scsi_ss.add(when: 'CONFIG_SPAPR_VSCSI', if_true: files('spapr_vscsi.c')) + +specific_ss.add_all(when: 'CONFIG_SCSI', if_true: specific_scsi_ss) diff --git a/hw/scsi/trace.h b/hw/scsi/trace.h new file mode 100644 index 0000000000..4ce2673582 --- /dev/null +++ b/hw/scsi/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_scsi.h" diff --git a/hw/sd/Makefile.objs b/hw/sd/Makefile.objs deleted file mode 100644 index 0d1df1721c..0000000000 --- a/hw/sd/Makefile.objs +++ /dev/null @@ -1,12 +0,0 @@ -common-obj-$(CONFIG_PL181) += pl181.o -common-obj-$(CONFIG_SSI_SD) += ssi-sd.o -common-obj-$(CONFIG_SD) += sd.o core.o sdmmc-internal.o -common-obj-$(CONFIG_SDHCI) += sdhci.o -common-obj-$(CONFIG_SDHCI_PCI) += sdhci-pci.o - -common-obj-$(CONFIG_ALLWINNER_H3) += allwinner-sdhost.o -common-obj-$(CONFIG_MILKYMIST) += milkymist-memcard.o -common-obj-$(CONFIG_OMAP) += omap_mmc.o -common-obj-$(CONFIG_PXA2XX) += pxa2xx_mmci.o -common-obj-$(CONFIG_RASPI) += bcm2835_sdhost.o -common-obj-$(CONFIG_ASPEED_SOC) += aspeed_sdhci.o diff --git a/hw/sd/allwinner-sdhost.c b/hw/sd/allwinner-sdhost.c index f404e1fdb4..f9eb92c09e 100644 --- a/hw/sd/allwinner-sdhost.c +++ b/hw/sd/allwinner-sdhost.c @@ -333,16 +333,11 @@ static uint32_t allwinner_sdhost_process_desc(AwSdHostState *s, if (is_write) { cpu_physical_memory_read((desc->addr & DESC_SIZE_MASK) + num_done, buf, buf_bytes); - - for (uint32_t i = 0; i < buf_bytes; i++) { - sdbus_write_data(&s->sdbus, buf[i]); - } + sdbus_write_data(&s->sdbus, buf, buf_bytes); /* Read from SD bus */ } else { - for (uint32_t i = 0; i < buf_bytes; i++) { - buf[i] = sdbus_read_data(&s->sdbus); - } + sdbus_read_data(&s->sdbus, buf, buf_bytes); cpu_physical_memory_write((desc->addr & DESC_SIZE_MASK) + num_done, buf, buf_bytes); } @@ -521,10 +516,8 @@ static uint64_t allwinner_sdhost_read(void *opaque, hwaddr offset, break; case REG_SD_FIFO: /* Read/Write FIFO */ if (sdbus_data_ready(&s->sdbus)) { - res = sdbus_read_data(&s->sdbus); - res |= sdbus_read_data(&s->sdbus) << 8; - res |= sdbus_read_data(&s->sdbus) << 16; - res |= sdbus_read_data(&s->sdbus) << 24; + sdbus_read_data(&s->sdbus, &res, sizeof(uint32_t)); + le32_to_cpus(&res); allwinner_sdhost_update_transfer_cnt(s, sizeof(uint32_t)); allwinner_sdhost_auto_stop(s); allwinner_sdhost_update_irq(s); @@ -548,6 +541,7 @@ static void allwinner_sdhost_write(void *opaque, hwaddr offset, uint64_t value, unsigned size) { AwSdHostState *s = AW_SDHOST(opaque); + uint32_t u32; trace_allwinner_sdhost_write(offset, value, size); @@ -654,11 +648,9 @@ static void allwinner_sdhost_write(void *opaque, hwaddr offset, s->startbit_detect = value; break; case REG_SD_FIFO: /* Read/Write FIFO */ - sdbus_write_data(&s->sdbus, value & 0xff); - sdbus_write_data(&s->sdbus, (value >> 8) & 0xff); - sdbus_write_data(&s->sdbus, (value >> 16) & 0xff); - sdbus_write_data(&s->sdbus, (value >> 24) & 0xff); - allwinner_sdhost_update_transfer_cnt(s, sizeof(uint32_t)); + u32 = cpu_to_le32(value); + sdbus_write_data(&s->sdbus, &u32, sizeof(u32)); + allwinner_sdhost_update_transfer_cnt(s, sizeof(u32)); allwinner_sdhost_auto_stop(s); allwinner_sdhost_update_irq(s); break; diff --git a/hw/sd/bcm2835_sdhost.c b/hw/sd/bcm2835_sdhost.c index 4a80fbcc86..2c7a675a2d 100644 --- a/hw/sd/bcm2835_sdhost.c +++ b/hw/sd/bcm2835_sdhost.c @@ -190,7 +190,7 @@ static void bcm2835_sdhost_fifo_run(BCM2835SDHostState *s) if (is_read) { n = 0; while (s->datacnt && s->fifo_len < BCM2835_SDHOST_FIFO_LEN) { - value |= (uint32_t)sdbus_read_data(&s->sdbus) << (n * 8); + value |= (uint32_t)sdbus_read_byte(&s->sdbus) << (n * 8); s->datacnt--; n++; if (n == 4) { @@ -223,7 +223,7 @@ static void bcm2835_sdhost_fifo_run(BCM2835SDHostState *s) } n--; s->datacnt--; - sdbus_write_data(&s->sdbus, value & 0xff); + sdbus_write_byte(&s->sdbus, value & 0xff); value >>= 8; } } diff --git a/hw/sd/core.c b/hw/sd/core.c index abec48bccb..957d116f1a 100644 --- a/hw/sd/core.c +++ b/hw/sd/core.c @@ -102,7 +102,7 @@ int sdbus_do_command(SDBus *sdbus, SDRequest *req, uint8_t *response) return 0; } -void sdbus_write_data(SDBus *sdbus, uint8_t value) +void sdbus_write_byte(SDBus *sdbus, uint8_t value) { SDState *card = get_card(sdbus); @@ -110,11 +110,26 @@ void sdbus_write_data(SDBus *sdbus, uint8_t value) if (card) { SDCardClass *sc = SD_CARD_GET_CLASS(card); - sc->write_data(card, value); + sc->write_byte(card, value); } } -uint8_t sdbus_read_data(SDBus *sdbus) +void sdbus_write_data(SDBus *sdbus, const void *buf, size_t length) +{ + SDState *card = get_card(sdbus); + const uint8_t *data = buf; + + if (card) { + SDCardClass *sc = SD_CARD_GET_CLASS(card); + + for (size_t i = 0; i < length; i++) { + trace_sdbus_write(sdbus_name(sdbus), data[i]); + sc->write_byte(card, data[i]); + } + } +} + +uint8_t sdbus_read_byte(SDBus *sdbus) { SDState *card = get_card(sdbus); uint8_t value = 0; @@ -122,13 +137,28 @@ uint8_t sdbus_read_data(SDBus *sdbus) if (card) { SDCardClass *sc = SD_CARD_GET_CLASS(card); - value = sc->read_data(card); + value = sc->read_byte(card); } trace_sdbus_read(sdbus_name(sdbus), value); return value; } +void sdbus_read_data(SDBus *sdbus, void *buf, size_t length) +{ + SDState *card = get_card(sdbus); + uint8_t *data = buf; + + if (card) { + SDCardClass *sc = SD_CARD_GET_CLASS(card); + + for (size_t i = 0; i < length; i++) { + data[i] = sc->read_byte(card); + trace_sdbus_read(sdbus_name(sdbus), data[i]); + } + } +} + bool sdbus_data_ready(SDBus *sdbus) { SDState *card = get_card(sdbus); diff --git a/hw/sd/meson.build b/hw/sd/meson.build new file mode 100644 index 0000000000..b43e59bd00 --- /dev/null +++ b/hw/sd/meson.build @@ -0,0 +1,12 @@ +softmmu_ss.add(when: 'CONFIG_PL181', if_true: files('pl181.c')) +softmmu_ss.add(when: 'CONFIG_SD', if_true: files('sd.c', 'core.c', 'sdmmc-internal.c')) +softmmu_ss.add(when: 'CONFIG_SDHCI', if_true: files('sdhci.c')) +softmmu_ss.add(when: 'CONFIG_SDHCI_PCI', if_true: files('sdhci-pci.c')) +softmmu_ss.add(when: 'CONFIG_SSI_SD', if_true: files('ssi-sd.c')) + +softmmu_ss.add(when: 'CONFIG_MILKYMIST', if_true: files('milkymist-memcard.c')) +softmmu_ss.add(when: 'CONFIG_OMAP', if_true: files('omap_mmc.c')) +softmmu_ss.add(when: 'CONFIG_PXA2XX', if_true: files('pxa2xx_mmci.c')) +softmmu_ss.add(when: 'CONFIG_RASPI', if_true: files('bcm2835_sdhost.c')) +softmmu_ss.add(when: 'CONFIG_ASPEED_SOC', if_true: files('aspeed_sdhci.c')) +softmmu_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-sdhost.c')) diff --git a/hw/sd/milkymist-memcard.c b/hw/sd/milkymist-memcard.c index 11f61294fc..be89a93876 100644 --- a/hw/sd/milkymist-memcard.c +++ b/hw/sd/milkymist-memcard.c @@ -66,6 +66,8 @@ enum { #define MILKYMIST_MEMCARD(obj) \ OBJECT_CHECK(MilkymistMemcardState, (obj), TYPE_MILKYMIST_MEMCARD) +#define TYPE_MILKYMIST_SDBUS "milkymist-sdbus" + struct MilkymistMemcardState { SysBusDevice parent_obj; @@ -149,11 +151,8 @@ static uint64_t memcard_read(void *opaque, hwaddr addr, if (!s->enabled) { r = 0xffffffff; } else { - r = 0; - r |= sdbus_read_data(&s->sdbus) << 24; - r |= sdbus_read_data(&s->sdbus) << 16; - r |= sdbus_read_data(&s->sdbus) << 8; - r |= sdbus_read_data(&s->sdbus); + sdbus_read_data(&s->sdbus, &r, sizeof(r)); + be32_to_cpus(&r); } break; case R_CLK2XDIV: @@ -179,6 +178,7 @@ static void memcard_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { MilkymistMemcardState *s = opaque; + uint32_t val32; trace_milkymist_memcard_memory_write(addr, value); @@ -207,10 +207,8 @@ static void memcard_write(void *opaque, hwaddr addr, uint64_t value, if (!s->enabled) { break; } - sdbus_write_data(&s->sdbus, (value >> 24) & 0xff); - sdbus_write_data(&s->sdbus, (value >> 16) & 0xff); - sdbus_write_data(&s->sdbus, (value >> 8) & 0xff); - sdbus_write_data(&s->sdbus, value & 0xff); + val32 = cpu_to_be32(value); + sdbus_write_data(&s->sdbus, &val32, sizeof(val32)); break; case R_ENABLE: s->regs[addr] = value; @@ -253,6 +251,19 @@ static void milkymist_memcard_reset(DeviceState *d) } } +static void milkymist_memcard_set_readonly(DeviceState *dev, bool level) +{ + qemu_log_mask(LOG_UNIMP, + "milkymist_memcard: read-only mode not supported\n"); +} + +static void milkymist_memcard_set_inserted(DeviceState *dev, bool level) +{ + MilkymistMemcardState *s = MILKYMIST_MEMCARD(dev); + + s->enabled = !!level; +} + static void milkymist_memcard_init(Object *obj) { MilkymistMemcardState *s = MILKYMIST_MEMCARD(obj); @@ -261,30 +272,9 @@ static void milkymist_memcard_init(Object *obj) memory_region_init_io(&s->regs_region, OBJECT(s), &memcard_mmio_ops, s, "milkymist-memcard", R_MAX * 4); sysbus_init_mmio(dev, &s->regs_region); -} - -static void milkymist_memcard_realize(DeviceState *dev, Error **errp) -{ - MilkymistMemcardState *s = MILKYMIST_MEMCARD(dev); - DeviceState *carddev; - BlockBackend *blk; - DriveInfo *dinfo; - Error *err = NULL; qbus_create_inplace(&s->sdbus, sizeof(s->sdbus), TYPE_SD_BUS, - dev, "sd-bus"); - - /* Create and plug in the sd card */ - /* FIXME use a qdev drive property instead of drive_get_next() */ - dinfo = drive_get_next(IF_SD); - blk = dinfo ? blk_by_legacy_dinfo(dinfo) : NULL; - carddev = qdev_new(TYPE_SD_CARD); - qdev_prop_set_drive(carddev, "drive", blk); - if (!qdev_realize_and_unref(carddev, BUS(&s->sdbus), &err)) { - error_propagate_prepend(errp, err, "failed to init SD card"); - return; - } - s->enabled = blk && blk_is_inserted(blk); + DEVICE(obj), "sd-bus"); } static const VMStateDescription vmstate_milkymist_memcard = { @@ -308,10 +298,9 @@ static void milkymist_memcard_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->realize = milkymist_memcard_realize; dc->reset = milkymist_memcard_reset; dc->vmsd = &vmstate_milkymist_memcard; - /* Reason: init() method uses drive_get_next() */ + /* Reason: output IRQs should be wired up */ dc->user_creatable = false; } @@ -323,9 +312,25 @@ static const TypeInfo milkymist_memcard_info = { .class_init = milkymist_memcard_class_init, }; +static void milkymist_sdbus_class_init(ObjectClass *klass, void *data) +{ + SDBusClass *sbc = SD_BUS_CLASS(klass); + + sbc->set_inserted = milkymist_memcard_set_inserted; + sbc->set_readonly = milkymist_memcard_set_readonly; +} + +static const TypeInfo milkymist_sdbus_info = { + .name = TYPE_MILKYMIST_SDBUS, + .parent = TYPE_SD_BUS, + .instance_size = sizeof(SDBus), + .class_init = milkymist_sdbus_class_init, +}; + static void milkymist_memcard_register_types(void) { type_register_static(&milkymist_memcard_info); + type_register_static(&milkymist_sdbus_info); } type_init(milkymist_memcard_register_types) diff --git a/hw/sd/omap_mmc.c b/hw/sd/omap_mmc.c index 4088a8a80b..1f946908fe 100644 --- a/hw/sd/omap_mmc.c +++ b/hw/sd/omap_mmc.c @@ -23,7 +23,7 @@ #include "qemu/log.h" #include "hw/irq.h" #include "hw/arm/omap.h" -#include "hw/sd/sd.h" +#include "hw/sd/sdcard_legacy.h" struct omap_mmc_s { qemu_irq irq; @@ -232,10 +232,10 @@ static void omap_mmc_transfer(struct omap_mmc_s *host) if (host->fifo_len > host->af_level) break; - value = sd_read_data(host->card); + value = sd_read_byte(host->card); host->fifo[(host->fifo_start + host->fifo_len) & 31] = value; if (-- host->blen_counter) { - value = sd_read_data(host->card); + value = sd_read_byte(host->card); host->fifo[(host->fifo_start + host->fifo_len) & 31] |= value << 8; host->blen_counter --; @@ -247,10 +247,10 @@ static void omap_mmc_transfer(struct omap_mmc_s *host) break; value = host->fifo[host->fifo_start] & 0xff; - sd_write_data(host->card, value); + sd_write_byte(host->card, value); if (-- host->blen_counter) { value = host->fifo[host->fifo_start] >> 8; - sd_write_data(host->card, value); + sd_write_byte(host->card, value); host->blen_counter --; } diff --git a/hw/sd/pl181.c b/hw/sd/pl181.c index 2b3776a6a0..579d68ad83 100644 --- a/hw/sd/pl181.c +++ b/hw/sd/pl181.c @@ -15,27 +15,22 @@ #include "hw/sd/sd.h" #include "qemu/log.h" #include "qemu/module.h" +#include "qemu/error-report.h" #include "qapi/error.h" - -//#define DEBUG_PL181 1 - -#ifdef DEBUG_PL181 -#define DPRINTF(fmt, ...) \ -do { printf("pl181: " fmt , ## __VA_ARGS__); } while (0) -#else -#define DPRINTF(fmt, ...) do {} while(0) -#endif +#include "trace.h" #define PL181_FIFO_LEN 16 #define TYPE_PL181 "pl181" #define PL181(obj) OBJECT_CHECK(PL181State, (obj), TYPE_PL181) +#define TYPE_PL181_BUS "pl181-bus" + typedef struct PL181State { SysBusDevice parent_obj; MemoryRegion iomem; - SDState *card; + SDBus sdbus; uint32_t clock; uint32_t power; uint32_t cmdarg; @@ -56,10 +51,11 @@ typedef struct PL181State { http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=4446/1 */ int32_t linux_hack; - uint32_t fifo[PL181_FIFO_LEN]; + uint32_t fifo[PL181_FIFO_LEN]; /* TODO use Fifo32 */ qemu_irq irq[2]; /* GPIO outputs for 'card is readonly' and 'card inserted' */ - qemu_irq cardstatus[2]; + qemu_irq card_readonly; + qemu_irq card_inserted; } PL181State; static const VMStateDescription vmstate_pl181 = { @@ -148,13 +144,13 @@ static void pl181_fifo_push(PL181State *s, uint32_t value) int n; if (s->fifo_len == PL181_FIFO_LEN) { - fprintf(stderr, "pl181: FIFO overflow\n"); + error_report("%s: FIFO overflow", __func__); return; } n = (s->fifo_pos + s->fifo_len) & (PL181_FIFO_LEN - 1); s->fifo_len++; s->fifo[n] = value; - DPRINTF("FIFO push %08x\n", (int)value); + trace_pl181_fifo_push(value); } static uint32_t pl181_fifo_pop(PL181State *s) @@ -162,17 +158,17 @@ static uint32_t pl181_fifo_pop(PL181State *s) uint32_t value; if (s->fifo_len == 0) { - fprintf(stderr, "pl181: FIFO underflow\n"); + error_report("%s: FIFO underflow", __func__); return 0; } value = s->fifo[s->fifo_pos]; s->fifo_len--; s->fifo_pos = (s->fifo_pos + 1) & (PL181_FIFO_LEN - 1); - DPRINTF("FIFO pop %08x\n", (int)value); + trace_pl181_fifo_pop(value); return value; } -static void pl181_send_command(PL181State *s) +static void pl181_do_command(PL181State *s) { SDRequest request; uint8_t response[16]; @@ -180,8 +176,8 @@ static void pl181_send_command(PL181State *s) request.cmd = s->cmd & PL181_CMD_INDEX; request.arg = s->cmdarg; - DPRINTF("Command %d %08x\n", request.cmd, request.arg); - rlen = sd_do_command(s->card, &request, response); + trace_pl181_command_send(request.cmd, request.arg); + rlen = sdbus_do_command(&s->sdbus, &request, response); if (rlen < 0) goto error; if (s->cmd & PL181_CMD_RESPONSE) { @@ -197,16 +193,16 @@ static void pl181_send_command(PL181State *s) s->response[2] = ldl_be_p(&response[8]); s->response[3] = ldl_be_p(&response[12]) & ~1; } - DPRINTF("Response received\n"); + trace_pl181_command_response_pending(); s->status |= PL181_STATUS_CMDRESPEND; } else { - DPRINTF("Command sent\n"); + trace_pl181_command_sent(); s->status |= PL181_STATUS_CMDSENT; } return; error: - DPRINTF("Timeout\n"); + trace_pl181_command_timeout(); s->status |= PL181_STATUS_CMDTIMEOUT; } @@ -222,12 +218,12 @@ static void pl181_fifo_run(PL181State *s) int is_read; is_read = (s->datactrl & PL181_DATA_DIRECTION) != 0; - if (s->datacnt != 0 && (!is_read || sd_data_ready(s->card)) + if (s->datacnt != 0 && (!is_read || sdbus_data_ready(&s->sdbus)) && !s->linux_hack) { if (is_read) { n = 0; while (s->datacnt && s->fifo_len < PL181_FIFO_LEN) { - value |= (uint32_t)sd_read_data(s->card) << (n * 8); + value |= (uint32_t)sdbus_read_byte(&s->sdbus) << (n * 8); s->datacnt--; n++; if (n == 4) { @@ -248,7 +244,7 @@ static void pl181_fifo_run(PL181State *s) } n--; s->datacnt--; - sd_write_data(s->card, value & 0xff); + sdbus_write_byte(&s->sdbus, value & 0xff); value >>= 8; } } @@ -258,11 +254,11 @@ static void pl181_fifo_run(PL181State *s) s->status |= PL181_STATUS_DATAEND; /* HACK: */ s->status |= PL181_STATUS_DATABLOCKEND; - DPRINTF("Transfer Complete\n"); + trace_pl181_fifo_transfer_complete(); } if (s->datacnt == 0 && s->fifo_len == 0) { s->datactrl &= ~PL181_DATA_ENABLE; - DPRINTF("Data engine idle\n"); + trace_pl181_data_engine_idle(); } else { /* Update FIFO bits. */ bits = PL181_STATUS_TXACTIVE | PL181_STATUS_RXACTIVE; @@ -401,7 +397,7 @@ static void pl181_write(void *opaque, hwaddr offset, qemu_log_mask(LOG_UNIMP, "pl181: Pending commands not implemented\n"); } else { - pl181_send_command(s); + pl181_do_command(s); pl181_fifo_run(s); } /* The command has completed one way or the other. */ @@ -454,6 +450,20 @@ static const MemoryRegionOps pl181_ops = { .endianness = DEVICE_NATIVE_ENDIAN, }; +static void pl181_set_readonly(DeviceState *dev, bool level) +{ + PL181State *s = (PL181State *)dev; + + qemu_set_irq(s->card_readonly, level); +} + +static void pl181_set_inserted(DeviceState *dev, bool level) +{ + PL181State *s = (PL181State *)dev; + + qemu_set_irq(s->card_inserted, level); +} + static void pl181_reset(DeviceState *d) { PL181State *s = PL181(d); @@ -477,12 +487,9 @@ static void pl181_reset(DeviceState *d) s->mask[0] = 0; s->mask[1] = 0; - /* We can assume our GPIO outputs have been wired up now */ - sd_set_cb(s->card, s->cardstatus[0], s->cardstatus[1]); - /* Since we're still using the legacy SD API the card is not plugged - * into any bus, and we must reset it manually. - */ - device_legacy_reset(DEVICE(s->card)); + /* Reset other state based on current card insertion/readonly status */ + pl181_set_inserted(DEVICE(s), sdbus_get_inserted(&s->sdbus)); + pl181_set_readonly(DEVICE(s), sdbus_get_readonly(&s->sdbus)); } static void pl181_init(Object *obj) @@ -495,20 +502,11 @@ static void pl181_init(Object *obj) sysbus_init_mmio(sbd, &s->iomem); sysbus_init_irq(sbd, &s->irq[0]); sysbus_init_irq(sbd, &s->irq[1]); - qdev_init_gpio_out(dev, s->cardstatus, 2); -} + qdev_init_gpio_out_named(dev, &s->card_readonly, "card-read-only", 1); + qdev_init_gpio_out_named(dev, &s->card_inserted, "card-inserted", 1); -static void pl181_realize(DeviceState *dev, Error **errp) -{ - PL181State *s = PL181(dev); - DriveInfo *dinfo; - - /* FIXME use a qdev drive property instead of drive_get_next() */ - dinfo = drive_get_next(IF_SD); - s->card = sd_init(dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, false); - if (s->card == NULL) { - error_setg(errp, "sd_init failed"); - } + qbus_create_inplace(&s->sdbus, sizeof(s->sdbus), + TYPE_PL181_BUS, dev, "sd-bus"); } static void pl181_class_init(ObjectClass *klass, void *data) @@ -517,9 +515,8 @@ static void pl181_class_init(ObjectClass *klass, void *data) k->vmsd = &vmstate_pl181; k->reset = pl181_reset; - /* Reason: init() method uses drive_get_next() */ + /* Reason: output IRQs should be wired up */ k->user_creatable = false; - k->realize = pl181_realize; } static const TypeInfo pl181_info = { @@ -530,9 +527,25 @@ static const TypeInfo pl181_info = { .class_init = pl181_class_init, }; +static void pl181_bus_class_init(ObjectClass *klass, void *data) +{ + SDBusClass *sbc = SD_BUS_CLASS(klass); + + sbc->set_inserted = pl181_set_inserted; + sbc->set_readonly = pl181_set_readonly; +} + +static const TypeInfo pl181_bus_info = { + .name = TYPE_PL181_BUS, + .parent = TYPE_SD_BUS, + .instance_size = sizeof(SDBus), + .class_init = pl181_bus_class_init, +}; + static void pl181_register_types(void) { type_register_static(&pl181_info); + type_register_static(&pl181_bus_info); } type_init(pl181_register_types) diff --git a/hw/sd/pxa2xx_mmci.c b/hw/sd/pxa2xx_mmci.c index 68bed24480..04f0a98f81 100644 --- a/hw/sd/pxa2xx_mmci.c +++ b/hw/sd/pxa2xx_mmci.c @@ -184,7 +184,7 @@ static void pxa2xx_mmci_fifo_update(PXA2xxMMCIState *s) if (s->cmdat & CMDAT_WR_RD) { while (s->bytesleft && s->tx_len) { - sdbus_write_data(&s->sdbus, s->tx_fifo[s->tx_start++]); + sdbus_write_byte(&s->sdbus, s->tx_fifo[s->tx_start++]); s->tx_start &= 0x1f; s->tx_len --; s->bytesleft --; @@ -194,7 +194,7 @@ static void pxa2xx_mmci_fifo_update(PXA2xxMMCIState *s) } else while (s->bytesleft && s->rx_len < 32) { s->rx_fifo[(s->rx_start + (s->rx_len ++)) & 0x1f] = - sdbus_read_data(&s->sdbus); + sdbus_read_byte(&s->sdbus); s->bytesleft --; s->intreq |= INT_RXFIFO_REQ; } @@ -476,15 +476,12 @@ static const MemoryRegionOps pxa2xx_mmci_ops = { PXA2xxMMCIState *pxa2xx_mmci_init(MemoryRegion *sysmem, hwaddr base, - BlockBackend *blk, qemu_irq irq, - qemu_irq rx_dma, qemu_irq tx_dma) + qemu_irq irq, qemu_irq rx_dma, qemu_irq tx_dma) { - DeviceState *dev, *carddev; + DeviceState *dev; SysBusDevice *sbd; - PXA2xxMMCIState *s; dev = qdev_new(TYPE_PXA2XX_MMCI); - s = PXA2XX_MMCI(dev); sbd = SYS_BUS_DEVICE(dev); sysbus_mmio_map(sbd, 0, base); sysbus_connect_irq(sbd, 0, irq); @@ -492,13 +489,7 @@ PXA2xxMMCIState *pxa2xx_mmci_init(MemoryRegion *sysmem, qdev_connect_gpio_out_named(dev, "tx-dma", 0, tx_dma); sysbus_realize_and_unref(sbd, &error_fatal); - /* Create and plug in the sd card */ - carddev = qdev_new(TYPE_SD_CARD); - qdev_prop_set_drive_err(carddev, "drive", blk, &error_fatal); - qdev_realize_and_unref(carddev, qdev_get_child_bus(dev, "sd-bus"), - &error_fatal); - - return s; + return PXA2XX_MMCI(dev); } static void pxa2xx_mmci_set_inserted(DeviceState *dev, bool inserted) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index fad9cf1ee7..483c4f1720 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -37,6 +37,7 @@ #include "hw/registerfields.h" #include "sysemu/block-backend.h" #include "hw/sd/sd.h" +#include "hw/sd/sdcard_legacy.h" #include "migration/vmstate.h" #include "qapi/error.h" #include "qemu/bitmap.h" @@ -50,6 +51,8 @@ //#define DEBUG_SD 1 +#define SDSC_MAX_CAPACITY (2 * GiB) + typedef enum { sd_r0 = 0, /* no response */ sd_r1, /* normal response command */ @@ -313,7 +316,7 @@ static void sd_ocr_powerup(void *opaque) /* card power-up OK */ sd->ocr = FIELD_DP32(sd->ocr, OCR, CARD_POWER_UP, 1); - if (sd->size > 1 * GiB) { + if (sd->size > SDSC_MAX_CAPACITY) { sd->ocr = FIELD_DP32(sd->ocr, OCR, CARD_CAPACITY, 1); } } @@ -385,7 +388,7 @@ static void sd_set_csd(SDState *sd, uint64_t size) uint32_t sectsize = (1 << (SECTOR_SHIFT + 1)) - 1; uint32_t wpsize = (1 << (WPGROUP_SHIFT + 1)) - 1; - if (size <= 1 * GiB) { /* Standard Capacity SD */ + if (size <= SDSC_MAX_CAPACITY) { /* Standard Capacity SD */ sd->csd[0] = 0x00; /* CSD structure */ sd->csd[1] = 0x26; /* Data read access-time-1 */ sd->csd[2] = 0x00; /* Data read access-time-2 */ @@ -806,11 +809,12 @@ static void sd_function_switch(SDState *sd, uint32_t arg) sd->data[11] = 0x43; sd->data[12] = 0x80; /* Supported group 1 functions */ sd->data[13] = 0x03; + for (i = 0; i < 6; i ++) { new_func = (arg >> (i * 4)) & 0x0f; if (mode && new_func != 0x0f) sd->function_group[i] = new_func; - sd->data[14 + (i >> 1)] = new_func << ((i * 4) & 4); + sd->data[16 - (i >> 1)] |= new_func << ((i % 2) * 4); } memset(&sd->data[17], 0, 47); stw_be_p(sd->data + 64, sd_crc16(sd->data, 64)); @@ -1808,7 +1812,7 @@ static void sd_blk_write(SDState *sd, uint64_t addr, uint32_t len) #define APP_READ_BLOCK(a, len) memset(sd->data, 0xec, len) #define APP_WRITE_BLOCK(a, len) -void sd_write_data(SDState *sd, uint8_t value) +void sd_write_byte(SDState *sd, uint8_t value) { int i; @@ -1817,7 +1821,7 @@ void sd_write_data(SDState *sd, uint8_t value) if (sd->state != sd_receivingdata_state) { qemu_log_mask(LOG_GUEST_ERROR, - "sd_write_data: not in Receiving-Data state\n"); + "%s: not in Receiving-Data state\n", __func__); return; } @@ -1939,7 +1943,7 @@ void sd_write_data(SDState *sd, uint8_t value) break; default: - qemu_log_mask(LOG_GUEST_ERROR, "sd_write_data: unknown command\n"); + qemu_log_mask(LOG_GUEST_ERROR, "%s: unknown command\n", __func__); break; } } @@ -1958,7 +1962,7 @@ static const uint8_t sd_tuning_block_pattern[SD_TUNING_BLOCK_SIZE] = { 0xbb, 0xff, 0xf7, 0xff, 0xf7, 0x7f, 0x7b, 0xde, }; -uint8_t sd_read_data(SDState *sd) +uint8_t sd_read_byte(SDState *sd) { /* TODO: Append CRCs */ uint8_t ret; @@ -1969,7 +1973,7 @@ uint8_t sd_read_data(SDState *sd) if (sd->state != sd_sendingdata_state) { qemu_log_mask(LOG_GUEST_ERROR, - "sd_read_data: not in Sending-Data state\n"); + "%s: not in Sending-Data state\n", __func__); return 0x00; } @@ -2075,14 +2079,14 @@ uint8_t sd_read_data(SDState *sd) break; default: - qemu_log_mask(LOG_GUEST_ERROR, "sd_read_data: unknown command\n"); + qemu_log_mask(LOG_GUEST_ERROR, "%s: unknown command\n", __func__); return 0x00; } return ret; } -bool sd_data_ready(SDState *sd) +static bool sd_data_ready(SDState *sd) { return sd->state == sd_sendingdata_state; } @@ -2191,8 +2195,8 @@ static void sd_class_init(ObjectClass *klass, void *data) sc->get_dat_lines = sd_get_dat_lines; sc->get_cmd_line = sd_get_cmd_line; sc->do_command = sd_do_command; - sc->write_data = sd_write_data; - sc->read_data = sd_read_data; + sc->write_byte = sd_write_byte; + sc->read_byte = sd_read_byte; sc->data_ready = sd_data_ready; sc->enable = sd_enable; sc->get_inserted = sd_get_inserted; diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index deac181865..1785d7e1f7 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -399,8 +399,6 @@ static void sdhci_end_transfer(SDHCIState *s) /* Fill host controller's read buffer with BLKSIZE bytes of data from card */ static void sdhci_read_block_from_card(SDHCIState *s) { - int index = 0; - uint8_t data; const uint16_t blk_size = s->blksize & BLOCK_SIZE_MASK; if ((s->trnmod & SDHC_TRNS_MULTI) && @@ -408,12 +406,9 @@ static void sdhci_read_block_from_card(SDHCIState *s) return; } - for (index = 0; index < blk_size; index++) { - data = sdbus_read_data(&s->sdbus); - if (!FIELD_EX32(s->hostctl2, SDHC_HOSTCTL2, EXECUTE_TUNING)) { - /* Device is not in tuning */ - s->fifo_buffer[index] = data; - } + if (!FIELD_EX32(s->hostctl2, SDHC_HOSTCTL2, EXECUTE_TUNING)) { + /* Device is not in tuning */ + sdbus_read_data(&s->sdbus, s->fifo_buffer, blk_size); } if (FIELD_EX32(s->hostctl2, SDHC_HOSTCTL2, EXECUTE_TUNING)) { @@ -496,8 +491,6 @@ static uint32_t sdhci_read_dataport(SDHCIState *s, unsigned size) /* Write data from host controller FIFO to card */ static void sdhci_write_block_to_card(SDHCIState *s) { - int index = 0; - if (s->prnsts & SDHC_SPACE_AVAILABLE) { if (s->norintstsen & SDHC_NISEN_WBUFRDY) { s->norintsts |= SDHC_NIS_WBUFRDY; @@ -514,9 +507,7 @@ static void sdhci_write_block_to_card(SDHCIState *s) } } - for (index = 0; index < (s->blksize & BLOCK_SIZE_MASK); index++) { - sdbus_write_data(&s->sdbus, s->fifo_buffer[index]); - } + sdbus_write_data(&s->sdbus, s->fifo_buffer, s->blksize & BLOCK_SIZE_MASK); /* Next data can be written through BUFFER DATORT register */ s->prnsts |= SDHC_SPACE_AVAILABLE; @@ -578,7 +569,7 @@ static void sdhci_write_dataport(SDHCIState *s, uint32_t value, unsigned size) static void sdhci_sdma_transfer_multi_blocks(SDHCIState *s) { bool page_aligned = false; - unsigned int n, begin; + unsigned int begin; const uint16_t block_size = s->blksize & BLOCK_SIZE_MASK; uint32_t boundary_chk = 1 << (((s->blksize & ~BLOCK_SIZE_MASK) >> 12) + 12); uint32_t boundary_count = boundary_chk - (s->sdmasysad % boundary_chk); @@ -600,9 +591,7 @@ static void sdhci_sdma_transfer_multi_blocks(SDHCIState *s) SDHC_DAT_LINE_ACTIVE; while (s->blkcnt) { if (s->data_count == 0) { - for (n = 0; n < block_size; n++) { - s->fifo_buffer[n] = sdbus_read_data(&s->sdbus); - } + sdbus_read_data(&s->sdbus, s->fifo_buffer, block_size); } begin = s->data_count; if (((boundary_count + begin) < block_size) && page_aligned) { @@ -641,9 +630,7 @@ static void sdhci_sdma_transfer_multi_blocks(SDHCIState *s) &s->fifo_buffer[begin], s->data_count - begin); s->sdmasysad += s->data_count - begin; if (s->data_count == block_size) { - for (n = 0; n < block_size; n++) { - sdbus_write_data(&s->sdbus, s->fifo_buffer[n]); - } + sdbus_write_data(&s->sdbus, s->fifo_buffer, block_size); s->data_count = 0; if (s->trnmod & SDHC_TRNS_BLK_CNT_EN) { s->blkcnt--; @@ -668,19 +655,14 @@ static void sdhci_sdma_transfer_multi_blocks(SDHCIState *s) /* single block SDMA transfer */ static void sdhci_sdma_transfer_single_block(SDHCIState *s) { - int n; uint32_t datacnt = s->blksize & BLOCK_SIZE_MASK; if (s->trnmod & SDHC_TRNS_READ) { - for (n = 0; n < datacnt; n++) { - s->fifo_buffer[n] = sdbus_read_data(&s->sdbus); - } + sdbus_read_data(&s->sdbus, s->fifo_buffer, datacnt); dma_memory_write(s->dma_as, s->sdmasysad, s->fifo_buffer, datacnt); } else { dma_memory_read(s->dma_as, s->sdmasysad, s->fifo_buffer, datacnt); - for (n = 0; n < datacnt; n++) { - sdbus_write_data(&s->sdbus, s->fifo_buffer[n]); - } + sdbus_write_data(&s->sdbus, s->fifo_buffer, datacnt); } s->blkcnt--; @@ -739,7 +721,7 @@ static void get_adma_description(SDHCIState *s, ADMADescr *dscr) static void sdhci_do_adma(SDHCIState *s) { - unsigned int n, begin, length; + unsigned int begin, length; const uint16_t block_size = s->blksize & BLOCK_SIZE_MASK; ADMADescr dscr = {}; int i; @@ -773,9 +755,7 @@ static void sdhci_do_adma(SDHCIState *s) if (s->trnmod & SDHC_TRNS_READ) { while (length) { if (s->data_count == 0) { - for (n = 0; n < block_size; n++) { - s->fifo_buffer[n] = sdbus_read_data(&s->sdbus); - } + sdbus_read_data(&s->sdbus, s->fifo_buffer, block_size); } begin = s->data_count; if ((length + begin) < block_size) { @@ -814,9 +794,7 @@ static void sdhci_do_adma(SDHCIState *s) s->data_count - begin); dscr.addr += s->data_count - begin; if (s->data_count == block_size) { - for (n = 0; n < block_size; n++) { - sdbus_write_data(&s->sdbus, s->fifo_buffer[n]); - } + sdbus_write_data(&s->sdbus, s->fifo_buffer, block_size); s->data_count = 0; if (s->trnmod & SDHC_TRNS_BLK_CNT_EN) { s->blkcnt--; diff --git a/hw/sd/ssi-sd.c b/hw/sd/ssi-sd.c index 9210ef567f..a7ef9cb922 100644 --- a/hw/sd/ssi-sd.c +++ b/hw/sd/ssi-sd.c @@ -190,7 +190,7 @@ static uint32_t ssi_sd_transfer(SSISlave *dev, uint32_t val) s->mode = SSI_SD_DATA_READ; return 0xfe; case SSI_SD_DATA_READ: - val = sdbus_read_data(&s->sdbus); + val = sdbus_read_byte(&s->sdbus); if (!sdbus_data_ready(&s->sdbus)) { DPRINTF("Data read end\n"); s->mode = SSI_SD_CMD; diff --git a/hw/sd/trace-events b/hw/sd/trace-events index 5f09d32eb2..a87d7355fb 100644 --- a/hw/sd/trace-events +++ b/hw/sd/trace-events @@ -62,3 +62,13 @@ milkymist_memcard_memory_write(uint32_t addr, uint32_t value) "addr 0x%08x value # pxa2xx_mmci.c pxa2xx_mmci_read(uint8_t size, uint32_t addr, uint32_t value) "size %d addr 0x%02x value 0x%08x" pxa2xx_mmci_write(uint8_t size, uint32_t addr, uint32_t value) "size %d addr 0x%02x value 0x%08x" + +# pl181.c +pl181_command_send(uint8_t cmd, uint32_t arg) "sending CMD%02d arg 0x%08" PRIx32 +pl181_command_sent(void) "command sent" +pl181_command_response_pending(void) "response received" +pl181_command_timeout(void) "command timeouted" +pl181_fifo_push(uint32_t data) "FIFO push 0x%08" PRIx32 +pl181_fifo_pop(uint32_t data) "FIFO pop 0x%08" PRIx32 +pl181_fifo_transfer_complete(void) "FIFO transfer complete" +pl181_data_engine_idle(void) "data engine idle" diff --git a/hw/sd/trace.h b/hw/sd/trace.h new file mode 100644 index 0000000000..f3d0c58563 --- /dev/null +++ b/hw/sd/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_sd.h" diff --git a/hw/semihosting/Makefile.objs b/hw/semihosting/Makefile.objs deleted file mode 100644 index 4ad47c05c0..0000000000 --- a/hw/semihosting/Makefile.objs +++ /dev/null @@ -1,2 +0,0 @@ -obj-$(CONFIG_SEMIHOSTING) += config.o -obj-$(CONFIG_SEMIHOSTING) += console.o diff --git a/hw/semihosting/meson.build b/hw/semihosting/meson.build new file mode 100644 index 0000000000..f40ac574c4 --- /dev/null +++ b/hw/semihosting/meson.build @@ -0,0 +1,4 @@ +specific_ss.add(when: 'CONFIG_SEMIHOSTING', if_true: files( + 'config.c', + 'console.c', +)) diff --git a/hw/sh4/Makefile.objs b/hw/sh4/Makefile.objs deleted file mode 100644 index 2a707f9473..0000000000 --- a/hw/sh4/Makefile.objs +++ /dev/null @@ -1,4 +0,0 @@ -obj-y += sh7750.o sh7750_regnames.o -obj-y += sh_pci.o -obj-$(CONFIG_R2D) += r2d.o -obj-$(CONFIG_SHIX) += shix.o diff --git a/hw/sh4/meson.build b/hw/sh4/meson.build new file mode 100644 index 0000000000..303c0f4287 --- /dev/null +++ b/hw/sh4/meson.build @@ -0,0 +1,10 @@ +sh4_ss = ss.source_set() +sh4_ss.add(files( + 'sh7750.c', + 'sh7750_regnames.c', + 'sh_pci.c' +)) +sh4_ss.add(when: 'CONFIG_R2D', if_true: files('r2d.c')) +sh4_ss.add(when: 'CONFIG_SHIX', if_true: files('shix.c')) + +hw_arch += {'sh4': sh4_ss} diff --git a/hw/smbios/Makefile.objs b/hw/smbios/Makefile.objs deleted file mode 100644 index 23bb2bac07..0000000000 --- a/hw/smbios/Makefile.objs +++ /dev/null @@ -1,10 +0,0 @@ -ifeq ($(CONFIG_SMBIOS),y) -common-obj-y += smbios.o -common-obj-$(CONFIG_IPMI) += smbios_type_38.o -common-obj-$(call lnot,$(CONFIG_IPMI)) += smbios_type_38-stub.o -else -common-obj-y += smbios-stub.o -endif - -common-obj-$(CONFIG_ALL) += smbios-stub.o -common-obj-$(CONFIG_ALL) += smbios_type_38-stub.o diff --git a/hw/smbios/meson.build b/hw/smbios/meson.build new file mode 100644 index 0000000000..9e762c7108 --- /dev/null +++ b/hw/smbios/meson.build @@ -0,0 +1,13 @@ +smbios_ss = ss.source_set() +smbios_ss.add(files('smbios.c')) +smbios_ss.add(when: 'CONFIG_IPMI', + if_true: files('smbios_type_38.c'), + if_false: files('smbios_type_38-stub.c')) + +softmmu_ss.add_all(when: 'CONFIG_SMBIOS', if_true: smbios_ss) +softmmu_ss.add(when: 'CONFIG_SMBIOS', if_false: files('smbios-stub.c')) + +softmmu_ss.add(when: 'CONFIG_ALL', if_true: files( + 'smbios-stub.c', + 'smbios_type_38-stub.c', +)) diff --git a/hw/sparc/Makefile.objs b/hw/sparc/Makefile.objs deleted file mode 100644 index d57e33f83e..0000000000 --- a/hw/sparc/Makefile.objs +++ /dev/null @@ -1,3 +0,0 @@ -obj-$(CONFIG_SUN4M) += sun4m_iommu.o -obj-$(CONFIG_SUN4M) += sun4m.o -obj-$(CONFIG_LEON3) += leon3.o diff --git a/hw/sparc/meson.build b/hw/sparc/meson.build new file mode 100644 index 0000000000..19c442c90d --- /dev/null +++ b/hw/sparc/meson.build @@ -0,0 +1,6 @@ +sparc_ss = ss.source_set() +sparc_ss.add(when: 'CONFIG_LEON3', if_true: files('leon3.c')) +sparc_ss.add(when: 'CONFIG_SUN4M', if_true: files('sun4m.c')) +sparc_ss.add(when: 'CONFIG_SUN4M', if_true: files('sun4m_iommu.c')) + +hw_arch += {'sparc': sparc_ss} diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 9be930415f..cf7dfa4af5 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -143,7 +143,7 @@ static void nvram_init(Nvram *nvram, uint8_t *macaddr, memset(image, '\0', sizeof(image)); /* OpenBIOS nvram variables partition */ - sysp_end = chrp_nvram_create_system_partition(image, 0); + sysp_end = chrp_nvram_create_system_partition(image, 0, 0x1fd0); /* Free space partition */ chrp_nvram_create_free_partition(&image[sysp_end], 0x1fd0 - sysp_end); diff --git a/hw/sparc/trace.h b/hw/sparc/trace.h new file mode 100644 index 0000000000..625d60ca70 --- /dev/null +++ b/hw/sparc/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_sparc.h" diff --git a/hw/sparc64/Makefile.objs b/hw/sparc64/Makefile.objs deleted file mode 100644 index af0525c1a2..0000000000 --- a/hw/sparc64/Makefile.objs +++ /dev/null @@ -1,4 +0,0 @@ -obj-y += sparc64.o -obj-$(CONFIG_SUN4U) += sun4u_iommu.o -obj-$(CONFIG_SUN4U) += sun4u.o -obj-$(CONFIG_NIAGARA) += niagara.o diff --git a/hw/sparc64/meson.build b/hw/sparc64/meson.build new file mode 100644 index 0000000000..58b5504651 --- /dev/null +++ b/hw/sparc64/meson.build @@ -0,0 +1,6 @@ +sparc64_ss = ss.source_set() +sparc64_ss.add(files('sparc64.c')) +sparc64_ss.add(when: 'CONFIG_NIAGARA', if_true: files('niagara.c')) +sparc64_ss.add(when: 'CONFIG_SUN4U', if_true: files('sun4u.c', 'sun4u_iommu.c')) + +hw_arch += {'sparc64': sparc64_ss} diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index 9e30203dcc..37310b73e6 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -136,7 +136,7 @@ static int sun4u_NVRAM_set_params(Nvram *nvram, uint16_t NVRAM_size, memset(image, '\0', sizeof(image)); /* OpenBIOS nvram variables partition */ - sysp_end = chrp_nvram_create_system_partition(image, 0); + sysp_end = chrp_nvram_create_system_partition(image, 0, 0x1fd0); /* Free space partition */ chrp_nvram_create_free_partition(&image[sysp_end], 0x1fd0 - sysp_end); diff --git a/hw/sparc64/trace.h b/hw/sparc64/trace.h new file mode 100644 index 0000000000..b6ef6e611d --- /dev/null +++ b/hw/sparc64/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_sparc64.h" diff --git a/hw/ssi/Makefile.objs b/hw/ssi/Makefile.objs deleted file mode 100644 index 07a85f1967..0000000000 --- a/hw/ssi/Makefile.objs +++ /dev/null @@ -1,10 +0,0 @@ -common-obj-$(CONFIG_PL022) += pl022.o -common-obj-$(CONFIG_SSI) += ssi.o -common-obj-$(CONFIG_XILINX_SPI) += xilinx_spi.o -common-obj-$(CONFIG_XILINX_SPIPS) += xilinx_spips.o -common-obj-$(CONFIG_ASPEED_SOC) += aspeed_smc.o -common-obj-$(CONFIG_STM32F2XX_SPI) += stm32f2xx_spi.o -common-obj-$(CONFIG_MSF2) += mss-spi.o - -common-obj-$(CONFIG_OMAP) += omap_spi.o -common-obj-$(CONFIG_IMX) += imx_spi.o diff --git a/hw/ssi/meson.build b/hw/ssi/meson.build new file mode 100644 index 0000000000..f1f5c287d0 --- /dev/null +++ b/hw/ssi/meson.build @@ -0,0 +1,9 @@ +softmmu_ss.add(when: 'CONFIG_ASPEED_SOC', if_true: files('aspeed_smc.c')) +softmmu_ss.add(when: 'CONFIG_MSF2', if_true: files('mss-spi.c')) +softmmu_ss.add(when: 'CONFIG_PL022', if_true: files('pl022.c')) +softmmu_ss.add(when: 'CONFIG_SSI', if_true: files('ssi.c')) +softmmu_ss.add(when: 'CONFIG_STM32F2XX_SPI', if_true: files('stm32f2xx_spi.c')) +softmmu_ss.add(when: 'CONFIG_XILINX_SPI', if_true: files('xilinx_spi.c')) +softmmu_ss.add(when: 'CONFIG_XILINX_SPIPS', if_true: files('xilinx_spips.c')) +softmmu_ss.add(when: 'CONFIG_IMX', if_true: files('imx_spi.c')) +softmmu_ss.add(when: 'CONFIG_OMAP', if_true: files('omap_spi.c')) diff --git a/hw/ssi/trace.h b/hw/ssi/trace.h new file mode 100644 index 0000000000..0c1de2679e --- /dev/null +++ b/hw/ssi/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_ssi.h" diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs deleted file mode 100644 index 1303b13e0d..0000000000 --- a/hw/timer/Makefile.objs +++ /dev/null @@ -1,41 +0,0 @@ -common-obj-$(CONFIG_ARM_TIMER) += arm_timer.o -common-obj-$(CONFIG_ARM_MPTIMER) += arm_mptimer.o -common-obj-$(CONFIG_ARM_V7M) += armv7m_systick.o -common-obj-$(CONFIG_A9_GTIMER) += a9gtimer.o -common-obj-$(CONFIG_CADENCE) += cadence_ttc.o -common-obj-$(CONFIG_HPET) += hpet.o -common-obj-$(CONFIG_I8254) += i8254_common.o i8254.o -common-obj-$(CONFIG_PUV3) += puv3_ost.o -common-obj-$(CONFIG_XILINX) += xilinx_timer.o -common-obj-$(CONFIG_SLAVIO) += slavio_timer.o -common-obj-$(CONFIG_ETRAXFS) += etraxfs_timer.o -common-obj-$(CONFIG_GRLIB) += grlib_gptimer.o -common-obj-$(CONFIG_IMX) += imx_epit.o -common-obj-$(CONFIG_IMX) += imx_gpt.o -common-obj-$(CONFIG_LM32) += lm32_timer.o -common-obj-$(CONFIG_MILKYMIST) += milkymist-sysctl.o -common-obj-$(CONFIG_NRF51_SOC) += nrf51_timer.o - -common-obj-$(CONFIG_ALTERA_TIMER) += altera_timer.o -common-obj-$(CONFIG_EXYNOS4) += exynos4210_mct.o -common-obj-$(CONFIG_EXYNOS4) += exynos4210_pwm.o -common-obj-$(CONFIG_OMAP) += omap_gptimer.o -common-obj-$(CONFIG_OMAP) += omap_synctimer.o -common-obj-$(CONFIG_PXA2XX) += pxa2xx_timer.o -common-obj-$(CONFIG_SH4) += sh_timer.o -common-obj-$(CONFIG_RENESAS_TMR) += renesas_tmr.o -common-obj-$(CONFIG_RENESAS_CMT) += renesas_cmt.o -common-obj-$(CONFIG_DIGIC) += digic-timer.o -common-obj-$(CONFIG_MIPS_CPS) += mips_gictimer.o - -common-obj-$(CONFIG_ALLWINNER_A10_PIT) += allwinner-a10-pit.o - -common-obj-$(CONFIG_STM32F2XX_TIMER) += stm32f2xx_timer.o -common-obj-$(CONFIG_ASPEED_SOC) += aspeed_timer.o - -common-obj-$(CONFIG_CMSDK_APB_TIMER) += cmsdk-apb-timer.o -common-obj-$(CONFIG_CMSDK_APB_DUALTIMER) += cmsdk-apb-dualtimer.o -common-obj-$(CONFIG_MSF2) += mss-timer.o -common-obj-$(CONFIG_RASPI) += bcm2835_systmr.o - -obj-$(CONFIG_AVR_TIMER16) += avr_timer16.o diff --git a/hw/timer/meson.build b/hw/timer/meson.build new file mode 100644 index 0000000000..9f0a267c83 --- /dev/null +++ b/hw/timer/meson.build @@ -0,0 +1,37 @@ +softmmu_ss.add(when: 'CONFIG_A9_GTIMER', if_true: files('a9gtimer.c')) +softmmu_ss.add(when: 'CONFIG_ALLWINNER_A10_PIT', if_true: files('allwinner-a10-pit.c')) +softmmu_ss.add(when: 'CONFIG_ALTERA_TIMER', if_true: files('altera_timer.c')) +softmmu_ss.add(when: 'CONFIG_ARM_MPTIMER', if_true: files('arm_mptimer.c')) +softmmu_ss.add(when: 'CONFIG_ARM_TIMER', if_true: files('arm_timer.c')) +softmmu_ss.add(when: 'CONFIG_ARM_V7M', if_true: files('armv7m_systick.c')) +softmmu_ss.add(when: 'CONFIG_ASPEED_SOC', if_true: files('aspeed_timer.c')) +softmmu_ss.add(when: 'CONFIG_CADENCE', if_true: files('cadence_ttc.c')) +softmmu_ss.add(when: 'CONFIG_CMSDK_APB_DUALTIMER', if_true: files('cmsdk-apb-dualtimer.c')) +softmmu_ss.add(when: 'CONFIG_CMSDK_APB_TIMER', if_true: files('cmsdk-apb-timer.c')) +softmmu_ss.add(when: 'CONFIG_RENESAS_TMR', if_true: files('renesas_tmr.c')) +softmmu_ss.add(when: 'CONFIG_RENESAS_CMT', if_true: files('renesas_cmt.c')) +softmmu_ss.add(when: 'CONFIG_DIGIC', if_true: files('digic-timer.c')) +softmmu_ss.add(when: 'CONFIG_ETRAXFS', if_true: files('etraxfs_timer.c')) +softmmu_ss.add(when: 'CONFIG_EXYNOS4', if_true: files('exynos4210_mct.c')) +softmmu_ss.add(when: 'CONFIG_EXYNOS4', if_true: files('exynos4210_pwm.c')) +softmmu_ss.add(when: 'CONFIG_GRLIB', if_true: files('grlib_gptimer.c')) +softmmu_ss.add(when: 'CONFIG_HPET', if_true: files('hpet.c')) +softmmu_ss.add(when: 'CONFIG_I8254', if_true: files('i8254_common.c', 'i8254.c')) +softmmu_ss.add(when: 'CONFIG_IMX', if_true: files('imx_epit.c')) +softmmu_ss.add(when: 'CONFIG_IMX', if_true: files('imx_gpt.c')) +softmmu_ss.add(when: 'CONFIG_LM32', if_true: files('lm32_timer.c')) +softmmu_ss.add(when: 'CONFIG_MILKYMIST', if_true: files('milkymist-sysctl.c')) +softmmu_ss.add(when: 'CONFIG_MIPS_CPS', if_true: files('mips_gictimer.c')) +softmmu_ss.add(when: 'CONFIG_MSF2', if_true: files('mss-timer.c')) +softmmu_ss.add(when: 'CONFIG_NRF51_SOC', if_true: files('nrf51_timer.c')) +softmmu_ss.add(when: 'CONFIG_OMAP', if_true: files('omap_gptimer.c')) +softmmu_ss.add(when: 'CONFIG_OMAP', if_true: files('omap_synctimer.c')) +softmmu_ss.add(when: 'CONFIG_PUV3', if_true: files('puv3_ost.c')) +softmmu_ss.add(when: 'CONFIG_PXA2XX', if_true: files('pxa2xx_timer.c')) +softmmu_ss.add(when: 'CONFIG_RASPI', if_true: files('bcm2835_systmr.c')) +softmmu_ss.add(when: 'CONFIG_SH4', if_true: files('sh_timer.c')) +softmmu_ss.add(when: 'CONFIG_SLAVIO', if_true: files('slavio_timer.c')) +softmmu_ss.add(when: 'CONFIG_STM32F2XX_TIMER', if_true: files('stm32f2xx_timer.c')) +softmmu_ss.add(when: 'CONFIG_XILINX', if_true: files('xilinx_timer.c')) + +specific_ss.add(when: 'CONFIG_AVR_TIMER16', if_true: files('avr_timer16.c')) diff --git a/hw/timer/trace.h b/hw/timer/trace.h new file mode 100644 index 0000000000..5f72c441b0 --- /dev/null +++ b/hw/timer/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_timer.h" diff --git a/hw/tpm/Makefile.objs b/hw/tpm/Makefile.objs deleted file mode 100644 index 6fc05be67c..0000000000 --- a/hw/tpm/Makefile.objs +++ /dev/null @@ -1,6 +0,0 @@ -obj-$(call lor,$(CONFIG_TPM_TIS),$(CONFIG_TPM_CRB)) += tpm_ppi.o -common-obj-$(CONFIG_TPM_TIS_ISA) += tpm_tis_isa.o -common-obj-$(CONFIG_TPM_TIS_SYSBUS) += tpm_tis_sysbus.o -common-obj-$(CONFIG_TPM_TIS) += tpm_tis_common.o -common-obj-$(CONFIG_TPM_CRB) += tpm_crb.o -obj-$(CONFIG_TPM_SPAPR) += tpm_spapr.o diff --git a/hw/tpm/meson.build b/hw/tpm/meson.build new file mode 100644 index 0000000000..1c68d81d6a --- /dev/null +++ b/hw/tpm/meson.build @@ -0,0 +1,8 @@ +softmmu_ss.add(when: 'CONFIG_TPM_TIS', if_true: files('tpm_tis_common.c')) +softmmu_ss.add(when: 'CONFIG_TPM_TIS_ISA', if_true: files('tpm_tis_isa.c')) +softmmu_ss.add(when: 'CONFIG_TPM_TIS_SYSBUS', if_true: files('tpm_tis_sysbus.c')) +softmmu_ss.add(when: 'CONFIG_TPM_CRB', if_true: files('tpm_crb.c')) + +specific_ss.add(when: ['CONFIG_SOFTMMU', 'CONFIG_TPM_TIS'], if_true: files('tpm_ppi.c')) +specific_ss.add(when: ['CONFIG_SOFTMMU', 'CONFIG_TPM_CRB'], if_true: files('tpm_ppi.c')) +specific_ss.add(when: 'CONFIG_TPM_SPAPR', if_true: files('tpm_spapr.c')) diff --git a/hw/tpm/trace.h b/hw/tpm/trace.h new file mode 100644 index 0000000000..9827c128aa --- /dev/null +++ b/hw/tpm/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_tpm.h" diff --git a/hw/tricore/Makefile.objs b/hw/tricore/Makefile.objs deleted file mode 100644 index 5501f6c1a8..0000000000 --- a/hw/tricore/Makefile.objs +++ /dev/null @@ -1 +0,0 @@ -obj-$(CONFIG_TRICORE) += tricore_testboard.o diff --git a/hw/tricore/meson.build b/hw/tricore/meson.build new file mode 100644 index 0000000000..579aa13c78 --- /dev/null +++ b/hw/tricore/meson.build @@ -0,0 +1,4 @@ +tricore_ss = ss.source_set() +tricore_ss.add(when: 'CONFIG_TRICORE', if_true: files('tricore_testboard.c')) + +hw_arch += {'tricore': tricore_ss} diff --git a/hw/unicore32/Makefile.objs b/hw/unicore32/Makefile.objs deleted file mode 100644 index e0fd628523..0000000000 --- a/hw/unicore32/Makefile.objs +++ /dev/null @@ -1,4 +0,0 @@ -# For UniCore32 machines and boards - -# PKUnity-v3 SoC and board information -obj-${CONFIG_PUV3} += puv3.o diff --git a/hw/unicore32/meson.build b/hw/unicore32/meson.build new file mode 100644 index 0000000000..fc26d6bcab --- /dev/null +++ b/hw/unicore32/meson.build @@ -0,0 +1,5 @@ +unicore32_ss = ss.source_set() +# PKUnity-v3 SoC and board information +unicore32_ss.add(when: 'CONFIG_PUV3', if_true: files('puv3.c')) + +hw_arch += {'unicore32': unicore32_ss} diff --git a/hw/usb/Makefile.objs b/hw/usb/Makefile.objs deleted file mode 100644 index e342ff59fa..0000000000 --- a/hw/usb/Makefile.objs +++ /dev/null @@ -1,71 +0,0 @@ -# usb subsystem core -common-obj-y += core.o combined-packet.o bus.o libhw.o -common-obj-$(CONFIG_USB) += desc.o desc-msos.o - -# usb host adapters -common-obj-$(CONFIG_USB_UHCI) += hcd-uhci.o -common-obj-$(CONFIG_USB_OHCI) += hcd-ohci.o -common-obj-$(CONFIG_USB_OHCI_PCI) += hcd-ohci-pci.o -common-obj-$(CONFIG_USB_EHCI) += hcd-ehci.o -common-obj-$(CONFIG_USB_EHCI_PCI) += hcd-ehci-pci.o -common-obj-$(CONFIG_USB_EHCI_SYSBUS) += hcd-ehci-sysbus.o -common-obj-$(CONFIG_USB_XHCI) += hcd-xhci.o -common-obj-$(CONFIG_USB_XHCI_NEC) += hcd-xhci-nec.o -common-obj-$(CONFIG_USB_MUSB) += hcd-musb.o -common-obj-$(CONFIG_USB_DWC2) += hcd-dwc2.o - -common-obj-$(CONFIG_TUSB6010) += tusb6010.o -common-obj-$(CONFIG_IMX) += chipidea.o - -# emulated usb devices -common-obj-$(CONFIG_USB) += dev-hub.o -common-obj-$(CONFIG_USB) += dev-hid.o -common-obj-$(CONFIG_USB_TABLET_WACOM) += dev-wacom.o -common-obj-$(CONFIG_USB_STORAGE_BOT) += dev-storage.o -common-obj-$(CONFIG_USB_STORAGE_UAS) += dev-uas.o -common-obj-$(CONFIG_USB_AUDIO) += dev-audio.o -common-obj-$(CONFIG_USB_SERIAL) += dev-serial.o -common-obj-$(CONFIG_USB_NETWORK) += dev-network.o - -ifeq ($(CONFIG_USB_SMARTCARD),y) -common-obj-y += dev-smartcard-reader.o -ifeq ($(CONFIG_SMARTCARD),y) -common-obj-m += smartcard.mo -smartcard.mo-objs := ccid-card-passthru.o ccid-card-emulated.o -smartcard.mo-cflags := $(SMARTCARD_CFLAGS) -smartcard.mo-libs := $(SMARTCARD_LIBS) -endif -endif - -ifeq ($(CONFIG_POSIX),y) -common-obj-$(CONFIG_USB_STORAGE_MTP) += dev-mtp.o -endif - -# usb redirection -ifeq ($(CONFIG_USB),y) -ifeq ($(CONFIG_USB_REDIR),y) -common-obj-m += redirect.mo -redirect.mo-objs = redirect.o quirks.o -redirect.mo-cflags = $(USB_REDIR_CFLAGS) -redirect.mo-libs = $(USB_REDIR_LIBS) -endif -endif - -# usb pass-through -ifeq ($(CONFIG_USB_LIBUSB)$(CONFIG_USB),yy) -common-obj-y += host-libusb.o -else -common-obj-y += host-stub.o -endif -common-obj-$(CONFIG_ALL) += host-stub.o - -host-libusb.o-cflags := $(LIBUSB_CFLAGS) -host-libusb.o-libs := $(LIBUSB_LIBS) - -ifeq ($(CONFIG_USB_LIBUSB),y) -common-obj-$(CONFIG_XEN) += xen-usb.o -xen-usb.o-cflags := $(LIBUSB_CFLAGS) -xen-usb.o-libs := $(LIBUSB_LIBS) -endif - -common-obj-$(CONFIG_IMX_USBPHY) += imx-usb-phy.o diff --git a/hw/usb/meson.build b/hw/usb/meson.build new file mode 100644 index 0000000000..3c44a1b069 --- /dev/null +++ b/hw/usb/meson.build @@ -0,0 +1,69 @@ +hw_usb_modules = {} + +# usb subsystem core +softmmu_ss.add(files( + 'bus.c', + 'combined-packet.c', + 'core.c', + 'libhw.c' +)) + +softmmu_ss.add(when: 'CONFIG_USB', if_true: files( + 'desc.c', + 'desc-msos.c', +)) + +# usb host adapters +softmmu_ss.add(when: 'CONFIG_USB_UHCI', if_true: files('hcd-uhci.c')) +softmmu_ss.add(when: 'CONFIG_USB_OHCI', if_true: files('hcd-ohci.c')) +softmmu_ss.add(when: 'CONFIG_USB_OHCI_PCI', if_true: files('hcd-ohci-pci.c')) +softmmu_ss.add(when: 'CONFIG_USB_EHCI', if_true: files('hcd-ehci.c')) +softmmu_ss.add(when: 'CONFIG_USB_EHCI_PCI', if_true: files('hcd-ehci-pci.c')) +softmmu_ss.add(when: 'CONFIG_USB_EHCI_SYSBUS', if_true: files('hcd-ehci.c', 'hcd-ehci-sysbus.c')) +softmmu_ss.add(when: 'CONFIG_USB_XHCI', if_true: files('hcd-xhci.c')) +softmmu_ss.add(when: 'CONFIG_USB_XHCI_NEC', if_true: files('hcd-xhci-nec.c')) +softmmu_ss.add(when: 'CONFIG_USB_MUSB', if_true: files('hcd-musb.c')) +softmmu_ss.add(when: 'CONFIG_USB_DWC2', if_true: files('hcd-dwc2.c')) + +softmmu_ss.add(when: 'CONFIG_TUSB6010', if_true: files('tusb6010.c')) +softmmu_ss.add(when: 'CONFIG_IMX', if_true: files('chipidea.c')) +softmmu_ss.add(when: 'CONFIG_IMX_USBPHY', if_true: files('imx-usb-phy.c')) + +# emulated usb devices +softmmu_ss.add(when: 'CONFIG_USB', if_true: files('dev-hub.c')) +softmmu_ss.add(when: 'CONFIG_USB', if_true: files('dev-hid.c')) +softmmu_ss.add(when: 'CONFIG_USB_TABLET_WACOM', if_true: files('dev-wacom.c')) +softmmu_ss.add(when: 'CONFIG_USB_STORAGE_BOT', if_true: files('dev-storage.c')) +softmmu_ss.add(when: 'CONFIG_USB_STORAGE_UAS', if_true: files('dev-uas.c')) +softmmu_ss.add(when: 'CONFIG_USB_AUDIO', if_true: files('dev-audio.c')) +softmmu_ss.add(when: 'CONFIG_USB_SERIAL', if_true: files('dev-serial.c')) +softmmu_ss.add(when: 'CONFIG_USB_NETWORK', if_true: files('dev-network.c')) +softmmu_ss.add(when: ['CONFIG_POSIX', 'CONFIG_USB_STORAGE_MTP'], if_true: files('dev-mtp.c')) + +# smartcard +softmmu_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true: files('dev-smartcard-reader.c')) + +if config_host.has_key('CONFIG_SMARTCARD') + usbsmartcard_ss = ss.source_set() + usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD', + if_true: [cacard, files('ccid-card-emulated.c', 'ccid-card-passthru.c')]) + hw_usb_modules += {'smartcard': usbsmartcard_ss} +endif + +# usb redirect +if config_host.has_key('CONFIG_USB_REDIR') + usbredir_ss = ss.source_set() + usbredir_ss.add(when: 'CONFIG_USB', + if_true: [usbredir, files('redirect.c', 'quirks.c')]) + hw_usb_modules += {'redirect': usbredir_ss} +endif + +# usb pass-through +softmmu_ss.add(when: ['CONFIG_USB', 'CONFIG_USB_LIBUSB', 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')) + +softmmu_ss.add(when: ['CONFIG_USB', 'CONFIG_XEN', libusb], if_true: files('xen-usb.c')) + +modules += { 'hw-usb': hw_usb_modules } diff --git a/hw/usb/trace.h b/hw/usb/trace.h new file mode 100644 index 0000000000..f3962f2baf --- /dev/null +++ b/hw/usb/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_usb.h" diff --git a/hw/vfio/Makefile.objs b/hw/vfio/Makefile.objs deleted file mode 100644 index 9bb1c09e84..0000000000 --- a/hw/vfio/Makefile.objs +++ /dev/null @@ -1,8 +0,0 @@ -obj-y += common.o spapr.o -obj-$(CONFIG_VFIO_PCI) += pci.o pci-quirks.o display.o -obj-$(CONFIG_VFIO_CCW) += ccw.o -obj-$(CONFIG_VFIO_PLATFORM) += platform.o -obj-$(CONFIG_VFIO_XGMAC) += calxeda-xgmac.o -obj-$(CONFIG_VFIO_AMD_XGBE) += amd-xgbe.o -obj-$(CONFIG_VFIO_AP) += ap.o -obj-$(CONFIG_VFIO_IGD) += igd.o diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build new file mode 100644 index 0000000000..37efa74018 --- /dev/null +++ b/hw/vfio/meson.build @@ -0,0 +1,18 @@ +vfio_ss = ss.source_set() +vfio_ss.add(files( + 'common.c', + 'spapr.c', +)) +vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files( + 'display.c', + 'pci-quirks.c', + 'pci.c', +)) +vfio_ss.add(when: 'CONFIG_VFIO_CCW', if_true: files('ccw.c')) +vfio_ss.add(when: 'CONFIG_VFIO_PLATFORM', if_true: files('platform.c')) +vfio_ss.add(when: 'CONFIG_VFIO_XGMAC', if_true: files('calxeda-xgmac.c')) +vfio_ss.add(when: 'CONFIG_VFIO_AMD_XGBE', if_true: files('amd-xgbe.c')) +vfio_ss.add(when: 'CONFIG_VFIO_AP', if_true: files('ap.c')) +vfio_ss.add(when: 'CONFIG_VFIO_IGD', if_true: files('igd.c')) + +specific_ss.add_all(when: 'CONFIG_VFIO', if_true: vfio_ss) diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c index 3a14b7c303..57150913b7 100644 --- a/hw/vfio/pci-quirks.c +++ b/hw/vfio/pci-quirks.c @@ -11,7 +11,7 @@ */ #include "qemu/osdep.h" -#include "config-devices.h" +#include CONFIG_DEVICES #include "exec/memop.h" #include "qemu/units.h" #include "qemu/error-report.h" diff --git a/hw/vfio/trace.h b/hw/vfio/trace.h new file mode 100644 index 0000000000..5a343aa59c --- /dev/null +++ b/hw/vfio/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_vfio.h" diff --git a/hw/virtio/Makefile.objs b/hw/virtio/Makefile.objs deleted file mode 100644 index fc91719b4a..0000000000 --- a/hw/virtio/Makefile.objs +++ /dev/null @@ -1,48 +0,0 @@ -ifeq ($(CONFIG_VIRTIO),y) -common-obj-y += virtio-bus.o -obj-y += virtio.o - -obj-$(CONFIG_VHOST) += vhost.o vhost-backend.o -common-obj-$(call lnot,$(CONFIG_VHOST)) += vhost-stub.o -obj-$(CONFIG_VHOST_USER) += vhost-user.o -obj-$(CONFIG_VHOST_VDPA) += vhost-vdpa.o - -common-obj-$(CONFIG_VIRTIO_RNG) += virtio-rng.o -common-obj-$(CONFIG_VIRTIO_PCI) += virtio-pci.o -common-obj-$(CONFIG_VIRTIO_MMIO) += virtio-mmio.o -obj-$(CONFIG_VIRTIO_BALLOON) += virtio-balloon.o -obj-$(CONFIG_VIRTIO_CRYPTO) += virtio-crypto.o -obj-$(CONFIG_VHOST_USER_FS) += vhost-user-fs.o -obj-$(call land,$(CONFIG_VIRTIO_CRYPTO),$(CONFIG_VIRTIO_PCI)) += virtio-crypto-pci.o -obj-$(CONFIG_VIRTIO_PMEM) += virtio-pmem.o -common-obj-$(call land,$(CONFIG_VIRTIO_PMEM),$(CONFIG_VIRTIO_PCI)) += virtio-pmem-pci.o -obj-$(call land,$(CONFIG_VHOST_USER_FS),$(CONFIG_VIRTIO_PCI)) += vhost-user-fs-pci.o -obj-$(CONFIG_VIRTIO_IOMMU) += virtio-iommu.o -obj-$(CONFIG_VHOST_VSOCK) += vhost-vsock-common.o vhost-vsock.o -obj-$(CONFIG_VHOST_USER_VSOCK) += vhost-vsock-common.o vhost-user-vsock.o -obj-$(CONFIG_VIRTIO_MEM) += virtio-mem.o -common-obj-$(call land,$(CONFIG_VIRTIO_MEM),$(CONFIG_VIRTIO_PCI)) += virtio-mem-pci.o - -ifeq ($(CONFIG_VIRTIO_PCI),y) -obj-$(CONFIG_VHOST_VSOCK) += vhost-vsock-pci.o -obj-$(CONFIG_VHOST_USER_VSOCK) += vhost-user-vsock-pci.o -obj-$(CONFIG_VHOST_USER_BLK) += vhost-user-blk-pci.o -obj-$(CONFIG_VHOST_USER_INPUT) += vhost-user-input-pci.o -obj-$(CONFIG_VHOST_USER_SCSI) += vhost-user-scsi-pci.o -obj-$(CONFIG_VHOST_SCSI) += vhost-scsi-pci.o -obj-$(CONFIG_VIRTIO_INPUT_HOST) += virtio-input-host-pci.o -obj-$(CONFIG_VIRTIO_INPUT) += virtio-input-pci.o -obj-$(CONFIG_VIRTIO_RNG) += virtio-rng-pci.o -obj-$(CONFIG_VIRTIO_BALLOON) += virtio-balloon-pci.o -obj-$(CONFIG_VIRTIO_IOMMU) += virtio-iommu-pci.o -obj-$(CONFIG_VIRTIO_9P) += virtio-9p-pci.o -obj-$(CONFIG_VIRTIO_SCSI) += virtio-scsi-pci.o -obj-$(CONFIG_VIRTIO_BLK) += virtio-blk-pci.o -obj-$(CONFIG_VIRTIO_NET) += virtio-net-pci.o -obj-$(CONFIG_VIRTIO_SERIAL) += virtio-serial-pci.o -endif -else -common-obj-y += vhost-stub.o -endif - -common-obj-$(CONFIG_ALL) += vhost-stub.o diff --git a/hw/virtio/meson.build b/hw/virtio/meson.build new file mode 100644 index 0000000000..fbff9bc9d4 --- /dev/null +++ b/hw/virtio/meson.build @@ -0,0 +1,51 @@ +softmmu_virtio_ss = ss.source_set() +softmmu_virtio_ss.add(files('virtio-bus.c')) +softmmu_virtio_ss.add(when: 'CONFIG_VIRTIO_PCI', if_true: files('virtio-pci.c')) +softmmu_virtio_ss.add(when: 'CONFIG_VIRTIO_MMIO', if_true: files('virtio-mmio.c')) +softmmu_virtio_ss.add(when: 'CONFIG_VHOST', if_false: files('vhost-stub.c')) + +softmmu_ss.add_all(when: 'CONFIG_VIRTIO', if_true: softmmu_virtio_ss) +softmmu_ss.add(when: 'CONFIG_VIRTIO', if_false: files('vhost-stub.c')) + +softmmu_ss.add(when: 'CONFIG_ALL', if_true: files('vhost-stub.c')) + +virtio_ss = ss.source_set() +virtio_ss.add(files('virtio.c')) +virtio_ss.add(when: 'CONFIG_VHOST', if_true: files('vhost.c', 'vhost-backend.c')) +virtio_ss.add(when: 'CONFIG_VHOST_USER', if_true: files('vhost-user.c')) +virtio_ss.add(when: 'CONFIG_VHOST_VDPA', if_true: files('vhost-vdpa.c')) +virtio_ss.add(when: 'CONFIG_VIRTIO_BALLOON', if_true: files('virtio-balloon.c')) +virtio_ss.add(when: 'CONFIG_VIRTIO_CRYPTO', if_true: files('virtio-crypto.c')) +virtio_ss.add(when: ['CONFIG_VIRTIO_CRYPTO', 'CONFIG_VIRTIO_PCI'], if_true: files('virtio-crypto-pci.c')) +virtio_ss.add(when: 'CONFIG_VHOST_USER_FS', if_true: files('vhost-user-fs.c')) +virtio_ss.add(when: ['CONFIG_VHOST_USER_FS', 'CONFIG_VIRTIO_PCI'], if_true: files('vhost-user-fs-pci.c')) +virtio_ss.add(when: 'CONFIG_VIRTIO_PMEM', if_true: files('virtio-pmem.c')) +virtio_ss.add(when: 'CONFIG_VHOST_VSOCK', if_true: files('vhost-vsock.c', 'vhost-vsock-common.c')) +virtio_ss.add(when: 'CONFIG_VHOST_USER_VSOCK', if_true: files('vhost-user-vsock.c', 'vhost-vsock-common.c')) +virtio_ss.add(when: 'CONFIG_VIRTIO_RNG', if_true: files('virtio-rng.c')) +virtio_ss.add(when: 'CONFIG_VIRTIO_IOMMU', if_true: files('virtio-iommu.c')) +virtio_ss.add(when: 'CONFIG_VIRTIO_MEM', if_true: files('virtio-mem.c')) + +virtio_pci_ss = ss.source_set() +virtio_pci_ss.add(when: 'CONFIG_VHOST_VSOCK', if_true: files('vhost-vsock-pci.c')) +virtio_pci_ss.add(when: 'CONFIG_VHOST_USER_VSOCK', if_true: files('vhost-user-vsock-pci.c')) +virtio_pci_ss.add(when: 'CONFIG_VHOST_USER_BLK', if_true: files('vhost-user-blk-pci.c')) +virtio_pci_ss.add(when: 'CONFIG_VHOST_USER_INPUT', if_true: files('vhost-user-input-pci.c')) +virtio_pci_ss.add(when: 'CONFIG_VHOST_USER_SCSI', if_true: files('vhost-user-scsi-pci.c')) +virtio_pci_ss.add(when: 'CONFIG_VHOST_SCSI', if_true: files('vhost-scsi-pci.c')) +virtio_pci_ss.add(when: 'CONFIG_VIRTIO_INPUT_HOST', if_true: files('virtio-input-host-pci.c')) +virtio_pci_ss.add(when: 'CONFIG_VIRTIO_INPUT', if_true: files('virtio-input-pci.c')) +virtio_pci_ss.add(when: 'CONFIG_VIRTIO_RNG', if_true: files('virtio-rng-pci.c')) +virtio_pci_ss.add(when: 'CONFIG_VIRTIO_BALLOON', if_true: files('virtio-balloon-pci.c')) +virtio_pci_ss.add(when: 'CONFIG_VIRTIO_9P', if_true: files('virtio-9p-pci.c')) +virtio_pci_ss.add(when: 'CONFIG_VIRTIO_SCSI', if_true: files('virtio-scsi-pci.c')) +virtio_pci_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-blk-pci.c')) +virtio_pci_ss.add(when: 'CONFIG_VIRTIO_NET', if_true: files('virtio-net-pci.c')) +virtio_pci_ss.add(when: 'CONFIG_VIRTIO_SERIAL', if_true: files('virtio-serial-pci.c')) +virtio_pci_ss.add(when: 'CONFIG_VIRTIO_PMEM', if_true: files('virtio-pmem-pci.c')) +virtio_pci_ss.add(when: 'CONFIG_VIRTIO_IOMMU', if_true: files('virtio-iommu-pci.c')) +virtio_pci_ss.add(when: 'CONFIG_VIRTIO_MEM', if_true: files('virtio-mem-pci.c')) + +virtio_ss.add_all(when: 'CONFIG_VIRTIO_PCI', if_true: virtio_pci_ss) + +specific_ss.add_all(when: 'CONFIG_VIRTIO', if_true: virtio_ss) diff --git a/hw/virtio/trace.h b/hw/virtio/trace.h new file mode 100644 index 0000000000..5d7097061b --- /dev/null +++ b/hw/virtio/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_virtio.h" diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c index 7740fc613f..8fbec77ccc 100644 --- a/hw/virtio/virtio-mem.c +++ b/hw/virtio/virtio-mem.c @@ -29,7 +29,7 @@ #include "migration/misc.h" #include "hw/boards.h" #include "hw/qdev-properties.h" -#include "config-devices.h" +#include CONFIG_DEVICES #include "trace.h" /* diff --git a/hw/watchdog/Makefile.objs b/hw/watchdog/Makefile.objs deleted file mode 100644 index 631b711d86..0000000000 --- a/hw/watchdog/Makefile.objs +++ /dev/null @@ -1,7 +0,0 @@ -common-obj-y += watchdog.o -common-obj-$(CONFIG_CMSDK_APB_WATCHDOG) += cmsdk-apb-watchdog.o -common-obj-$(CONFIG_WDT_IB6300ESB) += wdt_i6300esb.o -common-obj-$(CONFIG_WDT_IB700) += wdt_ib700.o -common-obj-$(CONFIG_WDT_DIAG288) += wdt_diag288.o -common-obj-$(CONFIG_ASPEED_SOC) += wdt_aspeed.o -common-obj-$(CONFIG_WDT_IMX2) += wdt_imx2.o diff --git a/hw/watchdog/meson.build b/hw/watchdog/meson.build new file mode 100644 index 0000000000..9b8725e642 --- /dev/null +++ b/hw/watchdog/meson.build @@ -0,0 +1,7 @@ +softmmu_ss.add(files('watchdog.c')) +softmmu_ss.add(when: 'CONFIG_CMSDK_APB_WATCHDOG', if_true: files('cmsdk-apb-watchdog.c')) +softmmu_ss.add(when: 'CONFIG_WDT_IB6300ESB', if_true: files('wdt_i6300esb.c')) +softmmu_ss.add(when: 'CONFIG_WDT_IB700', if_true: files('wdt_ib700.c')) +softmmu_ss.add(when: 'CONFIG_WDT_DIAG288', if_true: files('wdt_diag288.c')) +softmmu_ss.add(when: 'CONFIG_ASPEED_SOC', if_true: files('wdt_aspeed.c')) +softmmu_ss.add(when: 'CONFIG_WDT_IMX2', if_true: files('wdt_imx2.c')) diff --git a/hw/watchdog/trace.h b/hw/watchdog/trace.h new file mode 100644 index 0000000000..5d8495752b --- /dev/null +++ b/hw/watchdog/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_watchdog.h" diff --git a/hw/xen/Makefile.objs b/hw/xen/Makefile.objs deleted file mode 100644 index 502b32d877..0000000000 --- a/hw/xen/Makefile.objs +++ /dev/null @@ -1,7 +0,0 @@ -# xen backend driver support -common-obj-y += xen-legacy-backend.o xen_devconfig.o xen_pvdev.o xen-bus.o xen-bus-helper.o xen-backend.o - -obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen-host-pci-device.o -obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen_pt.o xen_pt_config_init.o xen_pt_graphics.o xen_pt_msi.o -obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen_pt_load_rom.o -obj-$(call lnot,$(CONFIG_XEN_PCI_PASSTHROUGH)) += xen_pt_stub.o diff --git a/hw/xen/meson.build b/hw/xen/meson.build new file mode 100644 index 0000000000..076954b89c --- /dev/null +++ b/hw/xen/meson.build @@ -0,0 +1,20 @@ +softmmu_ss.add(when: ['CONFIG_XEN', xen], if_true: files( + 'xen-backend.c', + 'xen-bus-helper.c', + 'xen-bus.c', + 'xen-legacy-backend.c', + 'xen_devconfig.c', + 'xen_pvdev.c', +)) + +xen_specific_ss = ss.source_set() +xen_specific_ss.add(when: 'CONFIG_XEN_PCI_PASSTHROUGH', if_true: files( + 'xen-host-pci-device.c', + 'xen_pt.c', + 'xen_pt_config_init.c', + 'xen_pt_graphics.c', + 'xen_pt_load_rom.c', + 'xen_pt_msi.c', +), if_false: files('xen_pt_stub.c')) + +specific_ss.add_all(when: ['CONFIG_XEN', xen], if_true: xen_specific_ss) diff --git a/hw/xen/trace.h b/hw/xen/trace.h new file mode 100644 index 0000000000..adba31a136 --- /dev/null +++ b/hw/xen/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_xen.h" diff --git a/hw/xenpv/Makefile.objs b/hw/xenpv/Makefile.objs deleted file mode 100644 index 8bfa4586ab..0000000000 --- a/hw/xenpv/Makefile.objs +++ /dev/null @@ -1,2 +0,0 @@ -# Xen PV machine support -obj-$(CONFIG_XEN) += xen_machine_pv.o diff --git a/hw/xenpv/meson.build b/hw/xenpv/meson.build new file mode 100644 index 0000000000..40f911ac15 --- /dev/null +++ b/hw/xenpv/meson.build @@ -0,0 +1,3 @@ +xenpv_ss = ss.source_set() + +xenpv_ss.add(when: 'CONFIG_XEN', if_true: files('xen_machine_pv.c')) diff --git a/hw/xtensa/Makefile.objs b/hw/xtensa/Makefile.objs deleted file mode 100644 index 2b40e1b60a..0000000000 --- a/hw/xtensa/Makefile.objs +++ /dev/null @@ -1,6 +0,0 @@ -obj-y += mx_pic.o -obj-y += pic_cpu.o -obj-y += xtensa_memory.o -obj-$(CONFIG_XTENSA_SIM) += sim.o -obj-$(CONFIG_XTENSA_VIRT) += virt.o -obj-$(CONFIG_XTENSA_XTFPGA) += xtfpga.o diff --git a/hw/xtensa/meson.build b/hw/xtensa/meson.build new file mode 100644 index 0000000000..1d5835df4b --- /dev/null +++ b/hw/xtensa/meson.build @@ -0,0 +1,11 @@ +xtensa_ss = ss.source_set() +xtensa_ss.add(files( + 'mx_pic.c', + 'pic_cpu.c', + 'xtensa_memory.c', +)) +xtensa_ss.add(when: 'CONFIG_XTENSA_SIM', if_true: files('sim.c')) +xtensa_ss.add(when: 'CONFIG_XTENSA_VIRT', if_true: files('virt.c')) +xtensa_ss.add(when: 'CONFIG_XTENSA_XTFPGA', if_true: files('xtfpga.c')) + +hw_arch += {'xtensa': xtensa_ss} diff --git a/include/elf.h b/include/elf.h index 5b06b55f28..c117a4d1ab 100644 --- a/include/elf.h +++ b/include/elf.h @@ -558,6 +558,7 @@ typedef struct { #define PPC_FEATURE2_HTM_NOSC 0x01000000 #define PPC_FEATURE2_ARCH_3_00 0x00800000 #define PPC_FEATURE2_HAS_IEEE128 0x00400000 +#define PPC_FEATURE2_ARCH_3_10 0x00040000 /* Bits present in AT_HWCAP for Sparc. */ diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index fc403d456b..f6439c4705 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -189,13 +189,13 @@ extern unsigned long reserved_va; #define ARG1 as #define ARG1_DECL AddressSpace *as #define TARGET_ENDIANNESS -#include "exec/memory_ldst.inc.h" +#include "exec/memory_ldst.h.inc" #define SUFFIX _cached_slow #define ARG1 cache #define ARG1_DECL MemoryRegionCache *cache #define TARGET_ENDIANNESS -#include "exec/memory_ldst.inc.h" +#include "exec/memory_ldst.h.inc" static inline void stl_phys_notdirty(AddressSpace *as, hwaddr addr, uint32_t val) { @@ -207,17 +207,17 @@ static inline void stl_phys_notdirty(AddressSpace *as, hwaddr addr, uint32_t val #define ARG1 as #define ARG1_DECL AddressSpace *as #define TARGET_ENDIANNESS -#include "exec/memory_ldst_phys.inc.h" +#include "exec/memory_ldst_phys.h.inc" /* Inline fast path for direct RAM access. */ #define ENDIANNESS -#include "exec/memory_ldst_cached.inc.h" +#include "exec/memory_ldst_cached.h.inc" #define SUFFIX _cached #define ARG1 cache #define ARG1_DECL MemoryRegionCache *cache #define TARGET_ENDIANNESS -#include "exec/memory_ldst_phys.inc.h" +#include "exec/memory_ldst_phys.h.inc" #endif /* page related stuff */ diff --git a/include/exec/memory.h b/include/exec/memory.h index 307e527835..0cfe987ab4 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -2133,12 +2133,12 @@ MemTxResult address_space_write_rom(AddressSpace *as, hwaddr addr, #define SUFFIX #define ARG1 as #define ARG1_DECL AddressSpace *as -#include "exec/memory_ldst.inc.h" +#include "exec/memory_ldst.h.inc" #define SUFFIX #define ARG1 as #define ARG1_DECL AddressSpace *as -#include "exec/memory_ldst_phys.inc.h" +#include "exec/memory_ldst_phys.h.inc" struct MemoryRegionCache { void *ptr; @@ -2179,7 +2179,7 @@ struct MemoryRegionCache { #define SUFFIX _cached_slow #define ARG1 cache #define ARG1_DECL MemoryRegionCache *cache -#include "exec/memory_ldst.inc.h" +#include "exec/memory_ldst.h.inc" /* Inline fast path for direct RAM access. */ static inline uint8_t address_space_ldub_cached(MemoryRegionCache *cache, @@ -2205,15 +2205,15 @@ static inline void address_space_stb_cached(MemoryRegionCache *cache, } #define ENDIANNESS _le -#include "exec/memory_ldst_cached.inc.h" +#include "exec/memory_ldst_cached.h.inc" #define ENDIANNESS _be -#include "exec/memory_ldst_cached.inc.h" +#include "exec/memory_ldst_cached.h.inc" #define SUFFIX _cached #define ARG1 cache #define ARG1_DECL MemoryRegionCache *cache -#include "exec/memory_ldst_phys.inc.h" +#include "exec/memory_ldst_phys.h.inc" /* address_space_cache_init: prepare for repeated access to a physical * memory region diff --git a/include/exec/memory_ldst.inc.h b/include/exec/memory_ldst.h.inc index 272c20f02e..272c20f02e 100644 --- a/include/exec/memory_ldst.inc.h +++ b/include/exec/memory_ldst.h.inc diff --git a/include/exec/memory_ldst_cached.inc.h b/include/exec/memory_ldst_cached.h.inc index fd4bbb40e7..fd4bbb40e7 100644 --- a/include/exec/memory_ldst_cached.inc.h +++ b/include/exec/memory_ldst_cached.h.inc diff --git a/include/exec/memory_ldst_phys.inc.h b/include/exec/memory_ldst_phys.h.inc index 91f72973cb..91f72973cb 100644 --- a/include/exec/memory_ldst_phys.inc.h +++ b/include/exec/memory_ldst_phys.h.inc diff --git a/include/hw/arm/pxa.h b/include/hw/arm/pxa.h index 8843e5f910..d99b6192da 100644 --- a/include/hw/arm/pxa.h +++ b/include/hw/arm/pxa.h @@ -89,8 +89,7 @@ void pxa2xx_lcd_vsync_notifier(PXA2xxLCDState *s, qemu_irq handler); typedef struct PXA2xxMMCIState PXA2xxMMCIState; PXA2xxMMCIState *pxa2xx_mmci_init(MemoryRegion *sysmem, hwaddr base, - BlockBackend *blk, qemu_irq irq, - qemu_irq rx_dma, qemu_irq tx_dma); + qemu_irq irq, qemu_irq rx_dma, qemu_irq tx_dma); void pxa2xx_mmci_handlers(PXA2xxMMCIState *s, qemu_irq readonly, qemu_irq coverswitch); diff --git a/include/hw/arm/smmu-common.h b/include/hw/arm/smmu-common.h index ca4a4b1ad1..880dccd7c0 100644 --- a/include/hw/arm/smmu-common.h +++ b/include/hw/arm/smmu-common.h @@ -50,8 +50,15 @@ typedef struct SMMUTransTableInfo { uint64_t ttb; /* TT base address */ uint8_t tsz; /* input range, ie. 2^(64 -tsz)*/ uint8_t granule_sz; /* granule page shift */ + bool had; /* hierarchical attribute disable */ } SMMUTransTableInfo; +typedef struct SMMUTLBEntry { + IOMMUTLBEntry entry; + uint8_t level; + uint8_t granule; +} SMMUTLBEntry; + /* * Generic structure populated by derived SMMU devices * after decoding the configuration information and used as @@ -91,6 +98,8 @@ typedef struct SMMUPciBus { typedef struct SMMUIOTLBKey { uint64_t iova; uint16_t asid; + uint8_t tg; + uint8_t level; } SMMUIOTLBKey; typedef struct SMMUState { @@ -140,7 +149,7 @@ static inline uint16_t smmu_get_sid(SMMUDevice *sdev) * pair, according to @cfg translation config */ int smmu_ptw(SMMUTransCfg *cfg, dma_addr_t iova, IOMMUAccessFlags perm, - IOMMUTLBEntry *tlbe, SMMUPTWEventInfo *info); + SMMUTLBEntry *tlbe, SMMUPTWEventInfo *info); /** * select_tt - compute which translation table shall be used according to @@ -153,9 +162,15 @@ IOMMUMemoryRegion *smmu_iommu_mr(SMMUState *s, uint32_t sid); #define SMMU_IOTLB_MAX_SIZE 256 +SMMUTLBEntry *smmu_iotlb_lookup(SMMUState *bs, SMMUTransCfg *cfg, + SMMUTransTableInfo *tt, hwaddr iova); +void smmu_iotlb_insert(SMMUState *bs, SMMUTransCfg *cfg, SMMUTLBEntry *entry); +SMMUIOTLBKey smmu_get_iotlb_key(uint16_t asid, uint64_t iova, + uint8_t tg, uint8_t level); void smmu_iotlb_inv_all(SMMUState *s); void smmu_iotlb_inv_asid(SMMUState *s, uint16_t asid); -void smmu_iotlb_inv_iova(SMMUState *s, uint16_t asid, dma_addr_t iova); +void smmu_iotlb_inv_iova(SMMUState *s, int asid, dma_addr_t iova, + uint8_t tg, uint64_t num_pages, uint8_t ttl); /* Unmap the range of all the notifiers registered to any IOMMU mr */ void smmu_inv_notifiers_all(SMMUState *s); diff --git a/include/hw/arm/smmuv3.h b/include/hw/arm/smmuv3.h index 36b2f45253..68d7a963e0 100644 --- a/include/hw/arm/smmuv3.h +++ b/include/hw/arm/smmuv3.h @@ -41,6 +41,7 @@ typedef struct SMMUv3State { uint32_t idr[6]; uint32_t iidr; + uint32_t aidr; uint32_t cr[3]; uint32_t cr0ack; uint32_t statusr; diff --git a/include/hw/boards.h b/include/hw/boards.h index 426ce5f625..bc5b82ad20 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -319,6 +319,9 @@ struct MachineState { } \ type_init(machine_initfn##_register_types) +extern GlobalProperty hw_compat_5_1[]; +extern const size_t hw_compat_5_1_len; + extern GlobalProperty hw_compat_5_0[]; extern const size_t hw_compat_5_0_len; diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 3d7ed3a55e..fe52e165b2 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -193,6 +193,9 @@ void pc_system_firmware_init(PCMachineState *pcms, MemoryRegion *rom_memory); void pc_madt_cpu_entry(AcpiDeviceIf *adev, int uid, const CPUArchIdList *apic_ids, GArray *entry); +extern GlobalProperty pc_compat_5_1[]; +extern const size_t pc_compat_5_1_len; + extern GlobalProperty pc_compat_5_0[]; extern const size_t pc_compat_5_0_len; diff --git a/include/hw/intc/ibex_plic.h b/include/hw/intc/ibex_plic.h index ddc7909903..d8eb09b258 100644 --- a/include/hw/intc/ibex_plic.h +++ b/include/hw/intc/ibex_plic.h @@ -33,6 +33,7 @@ typedef struct IbexPlicState { MemoryRegion mmio; uint32_t *pending; + uint32_t *claimed; uint32_t *source; uint32_t *priority; uint32_t *enable; diff --git a/include/hw/nvram/chrp_nvram.h b/include/hw/nvram/chrp_nvram.h index 09941a9be4..4a0f5c21b8 100644 --- a/include/hw/nvram/chrp_nvram.h +++ b/include/hw/nvram/chrp_nvram.h @@ -50,7 +50,8 @@ chrp_nvram_finish_partition(ChrpNvramPartHdr *header, uint32_t size) header->checksum = sum & 0xff; } -int chrp_nvram_create_system_partition(uint8_t *data, int min_len); +/* chrp_nvram_create_system_partition() failure is fatal */ +int chrp_nvram_create_system_partition(uint8_t *data, int min_len, int max_len); int chrp_nvram_create_free_partition(uint8_t *data, int len); #endif diff --git a/include/hw/ppc/spapr_xive.h b/include/hw/ppc/spapr_xive.h index 93d09d68de..0ffbe0be02 100644 --- a/include/hw/ppc/spapr_xive.h +++ b/include/hw/ppc/spapr_xive.h @@ -80,15 +80,15 @@ int kvmppc_xive_connect(SpaprInterruptController *intc, uint32_t nr_servers, Error **errp); void kvmppc_xive_disconnect(SpaprInterruptController *intc); void kvmppc_xive_reset(SpaprXive *xive, Error **errp); -void kvmppc_xive_set_source_config(SpaprXive *xive, uint32_t lisn, XiveEAS *eas, - Error **errp); +int kvmppc_xive_set_source_config(SpaprXive *xive, uint32_t lisn, XiveEAS *eas, + Error **errp); void kvmppc_xive_sync_source(SpaprXive *xive, uint32_t lisn, Error **errp); uint64_t kvmppc_xive_esb_rw(XiveSource *xsrc, int srcno, uint32_t offset, uint64_t data, bool write); -void kvmppc_xive_set_queue_config(SpaprXive *xive, uint8_t end_blk, +int kvmppc_xive_set_queue_config(SpaprXive *xive, uint8_t end_blk, uint32_t end_idx, XiveEND *end, Error **errp); -void kvmppc_xive_get_queue_config(SpaprXive *xive, uint8_t end_blk, +int kvmppc_xive_get_queue_config(SpaprXive *xive, uint8_t end_blk, uint32_t end_idx, XiveEND *end, Error **errp); void kvmppc_xive_synchronize_state(SpaprXive *xive, Error **errp); diff --git a/include/hw/ppc/xive.h b/include/hw/ppc/xive.h index 705cf48176..2c42ae92d2 100644 --- a/include/hw/ppc/xive.h +++ b/include/hw/ppc/xive.h @@ -191,6 +191,7 @@ typedef struct XiveSource { uint64_t esb_flags; uint32_t esb_shift; MemoryRegion esb_mmio; + MemoryRegion esb_mmio_emulated; /* KVM support */ void *esb_mmap; @@ -215,6 +216,11 @@ static inline bool xive_source_esb_has_2page(XiveSource *xsrc) xsrc->esb_shift == XIVE_ESB_4K_2PAGE; } +static inline size_t xive_source_esb_len(XiveSource *xsrc) +{ + return (1ull << xsrc->esb_shift) * xsrc->nr_irqs; +} + /* The trigger page is always the first/even page */ static inline hwaddr xive_source_esb_page(XiveSource *xsrc, uint32_t srcno) { @@ -396,6 +402,7 @@ typedef struct XivePresenterClass { uint8_t nvt_blk, uint32_t nvt_idx, bool cam_ignore, uint8_t priority, uint32_t logic_serv, XiveTCTXMatch *match); + bool (*in_kernel)(const XivePresenter *xptr); } XivePresenterClass; int xive_presenter_tctx_match(XivePresenter *xptr, XiveTCTX *tctx, @@ -480,9 +487,9 @@ void xive_tctx_ipb_update(XiveTCTX *tctx, uint8_t ring, uint8_t ipb); int kvmppc_xive_source_reset_one(XiveSource *xsrc, int srcno, Error **errp); void kvmppc_xive_source_set_irq(void *opaque, int srcno, int val); -void kvmppc_xive_cpu_connect(XiveTCTX *tctx, Error **errp); -void kvmppc_xive_cpu_synchronize_state(XiveTCTX *tctx, Error **errp); -void kvmppc_xive_cpu_get_state(XiveTCTX *tctx, Error **errp); -void kvmppc_xive_cpu_set_state(XiveTCTX *tctx, Error **errp); +int kvmppc_xive_cpu_connect(XiveTCTX *tctx, Error **errp); +int kvmppc_xive_cpu_synchronize_state(XiveTCTX *tctx, Error **errp); +int kvmppc_xive_cpu_get_state(XiveTCTX *tctx, Error **errp); +int kvmppc_xive_cpu_set_state(XiveTCTX *tctx, Error **errp); #endif /* PPC_XIVE_H */ diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h index 8f3a98cba6..528310bb22 100644 --- a/include/hw/qdev-properties.h +++ b/include/hw/qdev-properties.h @@ -238,6 +238,8 @@ extern const PropertyInfo qdev_prop_pcie_link_width; /* * Set properties between creation and realization. + * + * Returns: %true on success, %false on error. */ bool qdev_prop_set_drive_err(DeviceState *dev, const char *name, BlockBackend *value, Error **errp); diff --git a/include/hw/riscv/sifive_u.h b/include/hw/riscv/sifive_u.h index aba4d0181f..d3c0c00d10 100644 --- a/include/hw/riscv/sifive_u.h +++ b/include/hw/riscv/sifive_u.h @@ -71,6 +71,7 @@ enum { SIFIVE_U_DEBUG, SIFIVE_U_MROM, SIFIVE_U_CLINT, + SIFIVE_U_L2CC, SIFIVE_U_L2LIM, SIFIVE_U_PLIC, SIFIVE_U_PRCI, @@ -86,6 +87,9 @@ enum { }; enum { + SIFIVE_U_L2CC_IRQ0 = 1, + SIFIVE_U_L2CC_IRQ1 = 2, + SIFIVE_U_L2CC_IRQ2 = 3, SIFIVE_U_UART0_IRQ = 4, SIFIVE_U_UART1_IRQ = 5, SIFIVE_U_GPIO_IRQ0 = 7, diff --git a/include/hw/sd/sd.h b/include/hw/sd/sd.h index a84b8e274a..ac02d61a7a 100644 --- a/include/hw/sd/sd.h +++ b/include/hw/sd/sd.h @@ -104,8 +104,23 @@ typedef struct { /*< public >*/ int (*do_command)(SDState *sd, SDRequest *req, uint8_t *response); - void (*write_data)(SDState *sd, uint8_t value); - uint8_t (*read_data)(SDState *sd); + /** + * Write a byte to a SD card. + * @sd: card + * @value: byte to write + * + * Write a byte on the data lines of a SD card. + */ + void (*write_byte)(SDState *sd, uint8_t value); + /** + * Read a byte from a SD card. + * @sd: card + * + * Read a byte from the data lines of a SD card. + * + * Return: byte value read + */ + uint8_t (*read_byte)(SDState *sd); bool (*data_ready)(SDState *sd); void (*set_voltage)(SDState *sd, uint16_t millivolts); uint8_t (*get_dat_lines)(SDState *sd); @@ -136,23 +151,6 @@ typedef struct { void (*set_readonly)(DeviceState *dev, bool readonly); } SDBusClass; -/* Legacy functions to be used only by non-qdevified callers */ -SDState *sd_init(BlockBackend *bs, bool is_spi); -int sd_do_command(SDState *sd, SDRequest *req, - uint8_t *response); -void sd_write_data(SDState *sd, uint8_t value); -uint8_t sd_read_data(SDState *sd); -void sd_set_cb(SDState *sd, qemu_irq readonly, qemu_irq insert); -bool sd_data_ready(SDState *sd); -/* sd_enable should not be used -- it is only used on the nseries boards, - * where it is part of a broken implementation of the MMC card slot switch - * (there should be two card slots which are multiplexed to a single MMC - * controller, but instead we model it with one card and controller and - * disable the card when the second slot is selected, so it looks like the - * second slot is always empty). - */ -void sd_enable(SDState *sd, bool enable); - /* Functions to be used by qdevified callers (working via * an SDBus rather than directly with SDState) */ @@ -160,8 +158,41 @@ void sdbus_set_voltage(SDBus *sdbus, uint16_t millivolts); uint8_t sdbus_get_dat_lines(SDBus *sdbus); bool sdbus_get_cmd_line(SDBus *sdbus); int sdbus_do_command(SDBus *sd, SDRequest *req, uint8_t *response); -void sdbus_write_data(SDBus *sd, uint8_t value); -uint8_t sdbus_read_data(SDBus *sd); +/** + * Write a byte to a SD bus. + * @sd: bus + * @value: byte to write + * + * Write a byte on the data lines of a SD bus. + */ +void sdbus_write_byte(SDBus *sd, uint8_t value); +/** + * Read a byte from a SD bus. + * @sd: bus + * + * Read a byte from the data lines of a SD bus. + * + * Return: byte value read + */ +uint8_t sdbus_read_byte(SDBus *sd); +/** + * Write data to a SD bus. + * @sdbus: bus + * @buf: data to write + * @length: number of bytes to write + * + * Write multiple bytes of data on the data lines of a SD bus. + */ +void sdbus_write_data(SDBus *sdbus, const void *buf, size_t length); +/** + * Read data from a SD bus. + * @sdbus: bus + * @buf: buffer to read data into + * @length: number of bytes to read + * + * Read multiple bytes of data on the data lines of a SD bus. + */ +void sdbus_read_data(SDBus *sdbus, void *buf, size_t length); bool sdbus_data_ready(SDBus *sd); bool sdbus_get_inserted(SDBus *sd); bool sdbus_get_readonly(SDBus *sd); diff --git a/include/hw/sd/sdcard_legacy.h b/include/hw/sd/sdcard_legacy.h new file mode 100644 index 0000000000..0dc3889555 --- /dev/null +++ b/include/hw/sd/sdcard_legacy.h @@ -0,0 +1,50 @@ +/* + * SD Memory Card emulation (deprecated legacy API) + * + * Copyright (c) 2006 Andrzej Zaborowski <balrog@zabor.org> + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef HW_SDCARD_LEGACY_H +#define HW_SDCARD_LEGACY_H + +#include "hw/sd/sd.h" + +/* Legacy functions to be used only by non-qdevified callers */ +SDState *sd_init(BlockBackend *blk, bool is_spi); +int sd_do_command(SDState *card, SDRequest *request, uint8_t *response); +void sd_write_byte(SDState *card, uint8_t value); +uint8_t sd_read_byte(SDState *card); +void sd_set_cb(SDState *card, qemu_irq readonly, qemu_irq insert); + +/* sd_enable should not be used -- it is only used on the nseries boards, + * where it is part of a broken implementation of the MMC card slot switch + * (there should be two card slots which are multiplexed to a single MMC + * controller, but instead we model it with one card and controller and + * disable the card when the second slot is selected, so it looks like the + * second slot is always empty). + */ +void sd_enable(SDState *card, bool enable); + +#endif /* HW_SDCARD_LEGACY_H */ diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 20872e793e..412962d91a 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -29,7 +29,7 @@ #include "config-host.h" #ifdef NEED_CPU_H -#include "config-target.h" +#include CONFIG_TARGET #else #include "exec/poison.h" #endif diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index e63450a893..d40c925d04 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -636,7 +636,7 @@ struct TCGContext { /* Track which vCPU triggers events */ CPUState *cpu; /* *_trans */ - /* These structures are private to tcg-target.inc.c. */ + /* These structures are private to tcg-target.c.inc. */ #ifdef TCG_TARGET_NEED_LDST_LABELS QSIMPLEQ_HEAD(, TCGLabelQemuLdst) ldst_labels; #endif diff --git a/include/user/syscall-trace.h b/include/user/syscall-trace.h index 79fd3e5aa9..42e3b48b03 100644 --- a/include/user/syscall-trace.h +++ b/include/user/syscall-trace.h @@ -10,7 +10,7 @@ #ifndef _SYSCALL_TRACE_H_ #define _SYSCALL_TRACE_H_ -#include "trace-root.h" +#include "trace/trace-root.h" /* * These helpers just provide a common place for the various diff --git a/io/Makefile.objs b/io/Makefile.objs deleted file mode 100644 index 9a20fce4ed..0000000000 --- a/io/Makefile.objs +++ /dev/null @@ -1,12 +0,0 @@ -io-obj-y = channel.o -io-obj-y += channel-buffer.o -io-obj-y += channel-command.o -io-obj-y += channel-file.o -io-obj-y += channel-socket.o -io-obj-y += channel-tls.o -io-obj-y += channel-watch.o -io-obj-y += channel-websock.o -io-obj-y += channel-util.o -io-obj-y += dns-resolver.o -io-obj-y += net-listener.o -io-obj-y += task.o diff --git a/io/meson.build b/io/meson.build new file mode 100644 index 0000000000..768c1b5ec3 --- /dev/null +++ b/io/meson.build @@ -0,0 +1,25 @@ +io_ss = ss.source_set() +io_ss.add(genh) +io_ss.add(files( + 'channel-buffer.c', + 'channel-command.c', + 'channel-file.c', + 'channel-socket.c', + 'channel-tls.c', + 'channel-util.c', + 'channel-watch.c', + 'channel-websock.c', + 'channel.c', + 'dns-resolver.c', + 'net-listener.c', + 'task.c', +)) + +io_ss = io_ss.apply(config_host, strict: false) +libio = static_library('io', io_ss.sources() + genh, + dependencies: [io_ss.dependencies()], + link_with: libqemuutil, + name_suffix: 'fa', + build_by_default: false) + +io = declare_dependency(link_whole: libio, dependencies: [crypto, qom]) diff --git a/io/trace.h b/io/trace.h new file mode 100644 index 0000000000..92d63a5bfc --- /dev/null +++ b/io/trace.h @@ -0,0 +1 @@ +#include "trace/trace-io.h" @@ -27,7 +27,7 @@ #include "qemu/job.h" #include "qapi/qapi-commands-job.h" #include "qapi/error.h" -#include "trace-root.h" +#include "trace/trace-root.h" /* Get a job using its ID and acquire its AioContext */ static Job *find_job(const char *id, AioContext **aio_context, Error **errp) @@ -29,7 +29,7 @@ #include "qemu/id.h" #include "qemu/main-loop.h" #include "block/aio-wait.h" -#include "trace-root.h" +#include "trace/trace-root.h" #include "qapi/qapi-events-job.h" static QLIST_HEAD(, Job) jobs = QLIST_HEAD_INITIALIZER(jobs); diff --git a/libdecnumber/Makefile.objs b/libdecnumber/Makefile.objs deleted file mode 100644 index d81db0443a..0000000000 --- a/libdecnumber/Makefile.objs +++ /dev/null @@ -1,5 +0,0 @@ -obj-y += decContext.o -obj-y += decNumber.o -obj-y += dpd/decimal32.o -obj-y += dpd/decimal64.o -obj-y += dpd/decimal128.o diff --git a/libdecnumber/meson.build b/libdecnumber/meson.build new file mode 100644 index 0000000000..4d04139af4 --- /dev/null +++ b/libdecnumber/meson.build @@ -0,0 +1,7 @@ +libdecnumber = files( + 'decContext.c', + 'decNumber.c', + 'dpd/decimal128.c', + 'dpd/decimal32.c', + 'dpd/decimal64.c', +) diff --git a/linux-user/Makefile.objs b/linux-user/Makefile.objs deleted file mode 100644 index 1940910a73..0000000000 --- a/linux-user/Makefile.objs +++ /dev/null @@ -1,25 +0,0 @@ -obj-y = main.o syscall.o strace.o mmap.o signal.o \ - elfload.o linuxload.o uaccess.o uname.o \ - safe-syscall.o $(TARGET_ABI_DIR)/signal.o \ - $(TARGET_ABI_DIR)/cpu_loop.o exit.o fd-trans.o - -obj-$(TARGET_HAS_BFLT) += flatload.o -obj-$(TARGET_I386) += vm86.o -obj-$(TARGET_AARCH64) += arm/semihost.o - -obj-$(TARGET_ALPHA) += alpha/ -obj-$(TARGET_ARM) += arm/ -obj-$(TARGET_HPPA) += hppa/ -obj-$(TARGET_I386) += i386/ -obj-$(TARGET_M68K) += m68k/ -obj-$(TARGET_MICROBLAZE) += microblaze/ -obj-$(TARGET_MIPS) += mips/ -obj-$(TARGET_MIPS64) += mips64/ -obj-$(TARGET_PPC) += ppc/ -obj-$(TARGET_PPC64) += ppc/ -obj-$(TARGET_S390X) += s390x/ -obj-$(TARGET_SH4) += sh4/ -obj-$(TARGET_SPARC) += sparc/ -obj-$(TARGET_SPARC64) += $(TARGET_ABI_DIR)/ -obj-$(TARGET_X86_64) += x86_64/ -obj-$(TARGET_XTENSA) += xtensa/ diff --git a/linux-user/alpha/Makefile.objs b/linux-user/alpha/Makefile.objs deleted file mode 100644 index d6397a70ab..0000000000 --- a/linux-user/alpha/Makefile.objs +++ /dev/null @@ -1,5 +0,0 @@ -generated-files-y += linux-user/alpha/syscall_nr.h - -syshdr := $(SRC_PATH)/linux-user/alpha/syscallhdr.sh -%/syscall_nr.h: $(SRC_PATH)/linux-user/alpha/syscall.tbl $(syshdr) - $(call quiet-command, sh $(syshdr) $< $@ $(TARGET_SYSTBL_ABI),"GEN","$@") diff --git a/linux-user/alpha/meson.build b/linux-user/alpha/meson.build new file mode 100644 index 0000000000..a3cd22d2c4 --- /dev/null +++ b/linux-user/alpha/meson.build @@ -0,0 +1,5 @@ +syscall_nr_generators += { + 'alpha': generator(sh, + arguments: [ meson.current_source_dir() / 'syscallhdr.sh', '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@' ], + output: '@BASENAME@_nr.h') +} diff --git a/linux-user/arm/Makefile.objs b/linux-user/arm/Makefile.objs deleted file mode 100644 index c7eb94dcba..0000000000 --- a/linux-user/arm/Makefile.objs +++ /dev/null @@ -1,8 +0,0 @@ -obj-$(TARGET_ARM) += nwfpe/ -obj-$(TARGET_ARM) += semihost.o - -generated-files-y += linux-user/arm/syscall_nr.h - -syshdr := $(SRC_PATH)/linux-user/arm/syscallhdr.sh -%/syscall_nr.h: $(SRC_PATH)/linux-user/arm/syscall.tbl $(syshdr) - $(call quiet-command, sh $(syshdr) $< $@ $(TARGET_SYSTBL_ABI),"GEN","$@") diff --git a/linux-user/arm/meson.build b/linux-user/arm/meson.build new file mode 100644 index 0000000000..432984b58e --- /dev/null +++ b/linux-user/arm/meson.build @@ -0,0 +1,10 @@ +linux_user_ss.add(when: 'TARGET_AARCH64', if_true: files('semihost.c')) +linux_user_ss.add(when: 'TARGET_ARM', if_true: files('semihost.c')) + +subdir('nwfpe') + +syscall_nr_generators += { + 'arm': generator(sh, + arguments: [ meson.current_source_dir() / 'syscallhdr.sh', '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@' ], + output: '@BASENAME@_nr.h') +} diff --git a/linux-user/arm/nwfpe/Makefile.objs b/linux-user/arm/nwfpe/Makefile.objs deleted file mode 100644 index 51b0c32c2a..0000000000 --- a/linux-user/arm/nwfpe/Makefile.objs +++ /dev/null @@ -1,2 +0,0 @@ -obj-y = fpa11.o fpa11_cpdo.o fpa11_cpdt.o fpa11_cprt.o fpopcode.o -obj-y += single_cpdo.o double_cpdo.o extended_cpdo.o diff --git a/linux-user/arm/nwfpe/meson.build b/linux-user/arm/nwfpe/meson.build new file mode 100644 index 0000000000..1c27e55f2a --- /dev/null +++ b/linux-user/arm/nwfpe/meson.build @@ -0,0 +1,10 @@ +linux_user_ss.add(when: 'TARGET_ARM', if_true: files( + 'double_cpdo.c', + 'extended_cpdo.c', + 'fpa11.c', + 'fpa11_cpdo.c', + 'fpa11_cpdt.c', + 'fpa11_cprt.c', + 'fpopcode.c', + 'single_cpdo.c', +)) diff --git a/linux-user/hppa/Makefile.objs b/linux-user/hppa/Makefile.objs deleted file mode 100644 index f8368be6f3..0000000000 --- a/linux-user/hppa/Makefile.objs +++ /dev/null @@ -1,5 +0,0 @@ -generated-files-y += linux-user/hppa/syscall_nr.h - -syshdr := $(SRC_PATH)/linux-user/hppa/syscallhdr.sh -%/syscall_nr.h: $(SRC_PATH)/linux-user/hppa/syscall.tbl $(syshdr) - $(call quiet-command, sh $(syshdr) $< $@ $(TARGET_SYSTBL_ABI),"GEN","$@") diff --git a/linux-user/hppa/meson.build b/linux-user/hppa/meson.build new file mode 100644 index 0000000000..4709508a09 --- /dev/null +++ b/linux-user/hppa/meson.build @@ -0,0 +1,5 @@ +syscall_nr_generators += { + 'hppa': generator(sh, + arguments: [ meson.current_source_dir() / 'syscallhdr.sh', '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@' ], + output: '@BASENAME@_nr.h') +} diff --git a/linux-user/i386/Makefile.objs b/linux-user/i386/Makefile.objs deleted file mode 100644 index c25cf17bfb..0000000000 --- a/linux-user/i386/Makefile.objs +++ /dev/null @@ -1,5 +0,0 @@ -generated-files-y += linux-user/i386/syscall_nr.h - -syshdr := $(SRC_PATH)/linux-user/i386/syscallhdr.sh -%/syscall_nr.h: $(SRC_PATH)/linux-user/i386/syscall_32.tbl $(syshdr) - $(call quiet-command, sh $(syshdr) $< $@ $(TARGET_SYSTBL_ABI),"GEN","$@") diff --git a/linux-user/i386/meson.build b/linux-user/i386/meson.build new file mode 100644 index 0000000000..ee523019a5 --- /dev/null +++ b/linux-user/i386/meson.build @@ -0,0 +1,5 @@ +syscall_nr_generators += { + 'i386': generator(sh, + arguments: [ meson.current_source_dir() / 'syscallhdr.sh', '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@' ], + output: '@BASENAME@_nr.h') +} diff --git a/linux-user/i386/syscall_nr.h b/linux-user/i386/syscall_nr.h new file mode 100644 index 0000000000..976caab67f --- /dev/null +++ b/linux-user/i386/syscall_nr.h @@ -0,0 +1 @@ +#include "syscall_32_nr.h" diff --git a/linux-user/m68k/Makefile.objs b/linux-user/m68k/Makefile.objs deleted file mode 100644 index 961bd05c23..0000000000 --- a/linux-user/m68k/Makefile.objs +++ /dev/null @@ -1,5 +0,0 @@ -generated-files-y += linux-user/m68k/syscall_nr.h - -syshdr := $(SRC_PATH)/linux-user/m68k/syscallhdr.sh -%/syscall_nr.h: $(SRC_PATH)/linux-user/m68k/syscall.tbl $(syshdr) - $(call quiet-command, sh $(syshdr) $< $@ $(TARGET_SYSTBL_ABI),"GEN","$@") diff --git a/linux-user/m68k/meson.build b/linux-user/m68k/meson.build new file mode 100644 index 0000000000..c0f436fe50 --- /dev/null +++ b/linux-user/m68k/meson.build @@ -0,0 +1,5 @@ +syscall_nr_generators += { + 'm68k': generator(sh, + arguments: [ meson.current_source_dir() / 'syscallhdr.sh', '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@' ], + output: '@BASENAME@_nr.h') +} diff --git a/linux-user/meson.build b/linux-user/meson.build new file mode 100644 index 0000000000..2b94e4ba24 --- /dev/null +++ b/linux-user/meson.build @@ -0,0 +1,37 @@ +linux_user_ss.add(files( + 'elfload.c', + 'exit.c', + 'fd-trans.c', + 'linuxload.c', + 'main.c', + 'mmap.c', + 'safe-syscall.S', + 'signal.c', + 'strace.c', + 'syscall.c', + 'uaccess.c', + 'uname.c', +)) +linux_user_ss.add(rt) + +linux_user_ss.add(when: 'TARGET_HAS_BFLT', if_true: files('flatload.c')) +linux_user_ss.add(when: 'TARGET_I386', if_true: files('vm86.c')) + + +syscall_nr_generators = {} + +subdir('alpha') +subdir('arm') +subdir('hppa') +subdir('i386') +subdir('m68k') +subdir('microblaze') +subdir('mips64') +subdir('mips') +subdir('ppc') +subdir('s390x') +subdir('sh4') +subdir('sparc64') +subdir('sparc') +subdir('x86_64') +subdir('xtensa') diff --git a/linux-user/microblaze/Makefile.objs b/linux-user/microblaze/Makefile.objs deleted file mode 100644 index bb8b318dda..0000000000 --- a/linux-user/microblaze/Makefile.objs +++ /dev/null @@ -1,5 +0,0 @@ -generated-files-y += linux-user/microblaze/syscall_nr.h - -syshdr := $(SRC_PATH)/linux-user/microblaze/syscallhdr.sh -%/syscall_nr.h: $(SRC_PATH)/linux-user/microblaze/syscall.tbl $(syshdr) - $(call quiet-command, sh $(syshdr) $< $@ $(TARGET_SYSTBL_ABI),"GEN","$@") diff --git a/linux-user/microblaze/meson.build b/linux-user/microblaze/meson.build new file mode 100644 index 0000000000..f749d89418 --- /dev/null +++ b/linux-user/microblaze/meson.build @@ -0,0 +1,5 @@ +syscall_nr_generators += { + 'microblaze': generator(sh, + arguments: [ meson.current_source_dir() / 'syscallhdr.sh', '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@' ], + output: '@BASENAME@_nr.h') +} diff --git a/linux-user/mips/Makefile.objs b/linux-user/mips/Makefile.objs deleted file mode 100644 index 9be4de07d9..0000000000 --- a/linux-user/mips/Makefile.objs +++ /dev/null @@ -1,5 +0,0 @@ -generated-files-y += linux-user/mips/syscall_nr.h - -syshdr := $(SRC_PATH)/linux-user/mips/syscallhdr.sh -%/syscall_nr.h: $(SRC_PATH)/linux-user/mips/syscall_o32.tbl $(syshdr) - $(call quiet-command, sh $(syshdr) $< $@ $(TARGET_SYSTBL_ABI) "" 4000,"GEN","$@") diff --git a/linux-user/mips/meson.build b/linux-user/mips/meson.build new file mode 100644 index 0000000000..262a35703b --- /dev/null +++ b/linux-user/mips/meson.build @@ -0,0 +1,6 @@ +syscall_nr_generators += { + 'mips': generator(sh, + arguments: [ meson.current_source_dir() / 'syscallhdr.sh', '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@', + '', '4000' ], + output: '@BASENAME@_nr.h') +} diff --git a/linux-user/mips/syscall_nr.h b/linux-user/mips/syscall_nr.h new file mode 100644 index 0000000000..45d133c6f9 --- /dev/null +++ b/linux-user/mips/syscall_nr.h @@ -0,0 +1 @@ +#include "syscall_o32_nr.h" diff --git a/linux-user/mips64/Makefile.objs b/linux-user/mips64/Makefile.objs deleted file mode 100644 index 573448f956..0000000000 --- a/linux-user/mips64/Makefile.objs +++ /dev/null @@ -1,12 +0,0 @@ -generated-files-y += linux-user/$(TARGET_ABI_DIR)/syscall_nr.h - -syshdr := $(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)/syscallhdr.sh - -ifeq ($(TARGET_SYSTBL_ABI),n32) -%/syscall_nr.h: $(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)/syscall_n32.tbl $(syshdr) - $(call quiet-command, sh $(syshdr) $< $@ n32 "" 6000,"GEN","$@") -endif -ifeq ($(TARGET_SYSTBL_ABI),n64) -%/syscall_nr.h: $(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)/syscall_n64.tbl $(syshdr) - $(call quiet-command, sh $(syshdr) $< $@ n64 "" 5000,"GEN","$@") -endif diff --git a/linux-user/mips64/meson.build b/linux-user/mips64/meson.build new file mode 100644 index 0000000000..0caab5fabd --- /dev/null +++ b/linux-user/mips64/meson.build @@ -0,0 +1,6 @@ +syscall_nr_generators += { + 'mips64': generator(sh, + arguments: [ meson.current_source_dir() / 'syscallhdr.sh', '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@', + '', 'TARGET_SYSCALL_OFFSET' ], + output: '@BASENAME@_nr.h') +} diff --git a/linux-user/mips64/syscall_nr.h b/linux-user/mips64/syscall_nr.h new file mode 100644 index 0000000000..672f2fa51c --- /dev/null +++ b/linux-user/mips64/syscall_nr.h @@ -0,0 +1,7 @@ +#ifdef TARGET_ABI_MIPSN32 +#define TARGET_SYSCALL_OFFSET 6000 +#include "syscall_n32_nr.h" +#else +#define TARGET_SYSCALL_OFFSET 5000 +#include "syscall_n64_nr.h" +#endif diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 0019447892..f261563420 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -59,64 +59,100 @@ void mmap_fork_end(int child) pthread_mutex_unlock(&mmap_mutex); } +/* + * Validate target prot bitmask. + * Return the prot bitmask for the host in *HOST_PROT. + * Return 0 if the target prot bitmask is invalid, otherwise + * the internal qemu page_flags (which will include PAGE_VALID). + */ +static int validate_prot_to_pageflags(int *host_prot, int prot) +{ + int valid = PROT_READ | PROT_WRITE | PROT_EXEC | TARGET_PROT_SEM; + int page_flags = (prot & PAGE_BITS) | PAGE_VALID; + + /* + * For the host, we need not pass anything except read/write/exec. + * While PROT_SEM is allowed by all hosts, it is also ignored, so + * don't bother transforming guest bit to host bit. Any other + * target-specific prot bits will not be understood by the host + * and will need to be encoded into page_flags for qemu emulation. + * + * Pages that are executable by the guest will never be executed + * by the host, but the host will need to be able to read them. + */ + *host_prot = (prot & (PROT_READ | PROT_WRITE)) + | (prot & PROT_EXEC ? PROT_READ : 0); + + return prot & ~valid ? 0 : page_flags; +} + /* NOTE: all the constants are the HOST ones, but addresses are target. */ -int target_mprotect(abi_ulong start, abi_ulong len, int prot) +int target_mprotect(abi_ulong start, abi_ulong len, int target_prot) { abi_ulong end, host_start, host_end, addr; - int prot1, ret; + int prot1, ret, page_flags, host_prot; - trace_target_mprotect(start, len, prot); + trace_target_mprotect(start, len, target_prot); - if ((start & ~TARGET_PAGE_MASK) != 0) + if ((start & ~TARGET_PAGE_MASK) != 0) { return -TARGET_EINVAL; + } + page_flags = validate_prot_to_pageflags(&host_prot, target_prot); + if (!page_flags) { + return -TARGET_EINVAL; + } len = TARGET_PAGE_ALIGN(len); end = start + len; if (!guest_range_valid(start, len)) { return -TARGET_ENOMEM; } - prot &= PROT_READ | PROT_WRITE | PROT_EXEC; - if (len == 0) + if (len == 0) { return 0; + } mmap_lock(); host_start = start & qemu_host_page_mask; host_end = HOST_PAGE_ALIGN(end); if (start > host_start) { /* handle host page containing start */ - prot1 = prot; - for(addr = host_start; addr < start; addr += TARGET_PAGE_SIZE) { + prot1 = host_prot; + for (addr = host_start; addr < start; addr += TARGET_PAGE_SIZE) { prot1 |= page_get_flags(addr); } if (host_end == host_start + qemu_host_page_size) { - for(addr = end; addr < host_end; addr += TARGET_PAGE_SIZE) { + for (addr = end; addr < host_end; addr += TARGET_PAGE_SIZE) { prot1 |= page_get_flags(addr); } end = host_end; } - ret = mprotect(g2h(host_start), qemu_host_page_size, prot1 & PAGE_BITS); - if (ret != 0) + ret = mprotect(g2h(host_start), qemu_host_page_size, + prot1 & PAGE_BITS); + if (ret != 0) { goto error; + } host_start += qemu_host_page_size; } if (end < host_end) { - prot1 = prot; - for(addr = end; addr < host_end; addr += TARGET_PAGE_SIZE) { + prot1 = host_prot; + for (addr = end; addr < host_end; addr += TARGET_PAGE_SIZE) { prot1 |= page_get_flags(addr); } - ret = mprotect(g2h(host_end - qemu_host_page_size), qemu_host_page_size, - prot1 & PAGE_BITS); - if (ret != 0) + ret = mprotect(g2h(host_end - qemu_host_page_size), + qemu_host_page_size, prot1 & PAGE_BITS); + if (ret != 0) { goto error; + } host_end -= qemu_host_page_size; } /* handle the pages in the middle */ if (host_start < host_end) { - ret = mprotect(g2h(host_start), host_end - host_start, prot); - if (ret != 0) + ret = mprotect(g2h(host_start), host_end - host_start, host_prot); + if (ret != 0) { goto error; + } } - page_set_flags(start, start + len, prot | PAGE_VALID); + page_set_flags(start, start + len, page_flags); mmap_unlock(); return 0; error: @@ -360,19 +396,26 @@ abi_ulong mmap_find_vma(abi_ulong start, abi_ulong size, abi_ulong align) } /* NOTE: all the constants are the HOST ones */ -abi_long target_mmap(abi_ulong start, abi_ulong len, int prot, +abi_long target_mmap(abi_ulong start, abi_ulong len, int target_prot, int flags, int fd, abi_ulong offset) { abi_ulong ret, end, real_start, real_end, retaddr, host_offset, host_len; + int page_flags, host_prot; mmap_lock(); - trace_target_mmap(start, len, prot, flags, fd, offset); + trace_target_mmap(start, len, target_prot, flags, fd, offset); if (!len) { errno = EINVAL; goto fail; } + page_flags = validate_prot_to_pageflags(&host_prot, target_prot); + if (!page_flags) { + errno = EINVAL; + goto fail; + } + /* Also check for overflows... */ len = TARGET_PAGE_ALIGN(len); if (!len) { @@ -438,14 +481,15 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot, /* Note: we prefer to control the mapping address. It is especially important if qemu_host_page_size > qemu_real_host_page_size */ - p = mmap(g2h(start), host_len, prot, + p = mmap(g2h(start), host_len, host_prot, flags | MAP_FIXED | MAP_ANONYMOUS, -1, 0); - if (p == MAP_FAILED) + if (p == MAP_FAILED) { goto fail; + } /* update start so that it points to the file position at 'offset' */ host_start = (unsigned long)p; if (!(flags & MAP_ANONYMOUS)) { - p = mmap(g2h(start), len, prot, + p = mmap(g2h(start), len, host_prot, flags | MAP_FIXED, fd, host_offset); if (p == MAP_FAILED) { munmap(g2h(start), host_len); @@ -479,19 +523,19 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot, /* msync() won't work here, so we return an error if write is possible while it is a shared mapping */ if ((flags & MAP_TYPE) == MAP_SHARED && - (prot & PROT_WRITE)) { + (host_prot & PROT_WRITE)) { errno = EINVAL; goto fail; } - retaddr = target_mmap(start, len, prot | PROT_WRITE, + retaddr = target_mmap(start, len, target_prot | PROT_WRITE, MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); if (retaddr == -1) goto fail; if (pread(fd, g2h(start), len, offset) == -1) goto fail; - if (!(prot & PROT_WRITE)) { - ret = target_mprotect(start, len, prot); + if (!(host_prot & PROT_WRITE)) { + ret = target_mprotect(start, len, target_prot); assert(ret == 0); } goto the_end; @@ -502,13 +546,13 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot, if (real_end == real_start + qemu_host_page_size) { /* one single host page */ ret = mmap_frag(real_start, start, end, - prot, flags, fd, offset); + host_prot, flags, fd, offset); if (ret == -1) goto fail; goto the_end1; } ret = mmap_frag(real_start, start, real_start + qemu_host_page_size, - prot, flags, fd, offset); + host_prot, flags, fd, offset); if (ret == -1) goto fail; real_start += qemu_host_page_size; @@ -517,7 +561,7 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot, if (end < real_end) { ret = mmap_frag(real_end - qemu_host_page_size, real_end - qemu_host_page_size, end, - prot, flags, fd, + host_prot, flags, fd, offset + real_end - qemu_host_page_size - start); if (ret == -1) goto fail; @@ -533,13 +577,13 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot, else offset1 = offset + real_start - start; p = mmap(g2h(real_start), real_end - real_start, - prot, flags, fd, offset1); + host_prot, flags, fd, offset1); if (p == MAP_FAILED) goto fail; } } the_end1: - page_set_flags(start, start + len, prot | PAGE_VALID); + page_set_flags(start, start + len, page_flags); the_end: trace_target_mmap_complete(start); if (qemu_loglevel_mask(CPU_LOG_PAGE)) { diff --git a/linux-user/ppc/Makefile.objs b/linux-user/ppc/Makefile.objs deleted file mode 100644 index be92e67eb1..0000000000 --- a/linux-user/ppc/Makefile.objs +++ /dev/null @@ -1,6 +0,0 @@ -generated-files-y += linux-user/$(TARGET_ABI_DIR)/syscall_nr.h - -syshdr := $(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)/syscallhdr.sh - -%/syscall_nr.h: $(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)/syscall.tbl $(syshdr) - $(call quiet-command, sh $(syshdr) $< $@ $(TARGET_SYSTBL_ABI),"GEN","$@") diff --git a/linux-user/ppc/meson.build b/linux-user/ppc/meson.build new file mode 100644 index 0000000000..19fead7bc8 --- /dev/null +++ b/linux-user/ppc/meson.build @@ -0,0 +1,5 @@ +syscall_nr_generators += { + 'ppc': generator(sh, + arguments: [ meson.current_source_dir() / 'syscallhdr.sh', '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@' ], + output: '@BASENAME@_nr.h') +} diff --git a/linux-user/s390x/Makefile.objs b/linux-user/s390x/Makefile.objs deleted file mode 100644 index f30f1625cc..0000000000 --- a/linux-user/s390x/Makefile.objs +++ /dev/null @@ -1,5 +0,0 @@ -generated-files-y += linux-user/s390x/syscall_nr.h - -syshdr := $(SRC_PATH)/linux-user/s390x/syscallhdr.sh -%/syscall_nr.h: $(SRC_PATH)/linux-user/s390x/syscall.tbl $(syshdr) - $(call quiet-command, sh $(syshdr) $< $@ $(TARGET_SYSTBL_ABI),"GEN","$@") diff --git a/linux-user/s390x/meson.build b/linux-user/s390x/meson.build new file mode 100644 index 0000000000..0781ccea1d --- /dev/null +++ b/linux-user/s390x/meson.build @@ -0,0 +1,5 @@ +syscall_nr_generators += { + 's390x': generator(sh, + arguments: [ meson.current_source_dir() / 'syscallhdr.sh', '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@' ], + output: '@BASENAME@_nr.h') +} diff --git a/linux-user/sh4/Makefile.objs b/linux-user/sh4/Makefile.objs deleted file mode 100644 index 83fc939570..0000000000 --- a/linux-user/sh4/Makefile.objs +++ /dev/null @@ -1,5 +0,0 @@ -generated-files-y += linux-user/sh4/syscall_nr.h - -syshdr := $(SRC_PATH)/linux-user/sh4/syscallhdr.sh -%/syscall_nr.h: $(SRC_PATH)/linux-user/sh4/syscall.tbl $(syshdr) - $(call quiet-command, sh $(syshdr) $< $@ $(TARGET_SYSTBL_ABI),"GEN","$@") diff --git a/linux-user/sh4/meson.build b/linux-user/sh4/meson.build new file mode 100644 index 0000000000..3bc3a6924a --- /dev/null +++ b/linux-user/sh4/meson.build @@ -0,0 +1,5 @@ +syscall_nr_generators += { + 'sh4': generator(sh, + arguments: [ meson.current_source_dir() / 'syscallhdr.sh', '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@' ], + output: '@BASENAME@_nr.h') +} diff --git a/linux-user/sparc/Makefile.objs b/linux-user/sparc/Makefile.objs deleted file mode 100644 index 29d3f066cb..0000000000 --- a/linux-user/sparc/Makefile.objs +++ /dev/null @@ -1,5 +0,0 @@ -generated-files-y += linux-user/sparc/syscall_nr.h - -syshdr := $(SRC_PATH)/linux-user/sparc/syscallhdr.sh -%/syscall_nr.h: $(SRC_PATH)/linux-user/sparc/syscall.tbl $(syshdr) - $(call quiet-command, sh $(syshdr) $< $@ $(TARGET_SYSTBL_ABI),"GEN","$@") diff --git a/linux-user/sparc/meson.build b/linux-user/sparc/meson.build new file mode 100644 index 0000000000..51a9c7795c --- /dev/null +++ b/linux-user/sparc/meson.build @@ -0,0 +1,5 @@ +syscall_nr_generators += { + 'sparc': generator(sh, + arguments: [ meson.current_source_dir() / 'syscallhdr.sh', '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@' ], + output: '@BASENAME@_nr.h') +} diff --git a/linux-user/sparc64/Makefile.objs b/linux-user/sparc64/Makefile.objs deleted file mode 100644 index afcd535bc4..0000000000 --- a/linux-user/sparc64/Makefile.objs +++ /dev/null @@ -1,5 +0,0 @@ -generated-files-y += linux-user/sparc64/syscall_nr.h - -syshdr := $(SRC_PATH)/linux-user/sparc64/syscallhdr.sh -%/syscall_nr.h: $(SRC_PATH)/linux-user/sparc/syscall.tbl $(syshdr) - $(call quiet-command, sh $(syshdr) $< $@ $(TARGET_SYSTBL_ABI),"GEN","$@") diff --git a/linux-user/sparc64/meson.build b/linux-user/sparc64/meson.build new file mode 100644 index 0000000000..9527a40ed4 --- /dev/null +++ b/linux-user/sparc64/meson.build @@ -0,0 +1,5 @@ +syscall_nr_generators += { + 'sparc64': generator(sh, + arguments: [ meson.current_source_dir() / 'syscallhdr.sh', '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@' ], + output: '@BASENAME@_nr.h') +} diff --git a/linux-user/strace.c b/linux-user/strace.c index 13981341b3..5e38048643 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -541,6 +541,7 @@ static void print_fdset(int n, abi_ulong target_fds_addr) { int i; + int first = 1; qemu_log("["); if( target_fds_addr ) { @@ -555,9 +556,12 @@ print_fdset(int n, abi_ulong target_fds_addr) return; for (i=n; i>=0; i--) { - if ((tswapal(target_fds[i / TARGET_ABI_BITS]) >> (i & (TARGET_ABI_BITS - 1))) & 1) - qemu_log("%d,", i); + if ((tswapal(target_fds[i / TARGET_ABI_BITS]) >> + (i & (TARGET_ABI_BITS - 1))) & 1) { + qemu_log("%s%d", get_comma(first), i); + first = 0; } + } unlock_user(target_fds, target_fds_addr, 0); } qemu_log("]"); diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 945fc25279..b4a7b605f3 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -1229,7 +1229,9 @@ static inline abi_long copy_to_user_timeval64(abi_ulong target_tv_addr, defined(TARGET_NR_nanosleep) || defined(TARGET_NR_clock_settime) || \ defined(TARGET_NR_utimensat) || defined(TARGET_NR_mq_timedsend) || \ defined(TARGET_NR_mq_timedreceive) || defined(TARGET_NR_ipc) || \ - defined(TARGET_NR_semop) || defined(TARGET_NR_semtimedop) + defined(TARGET_NR_semop) || defined(TARGET_NR_semtimedop) || \ + defined(TARGET_NR_timer_settime) || \ + (defined(TARGET_NR_timerfd_settime) && defined(CONFIG_TIMERFD)) static inline abi_long target_to_host_timespec(struct timespec *host_ts, abi_ulong target_addr) { @@ -1245,7 +1247,9 @@ static inline abi_long target_to_host_timespec(struct timespec *host_ts, } #endif -#if defined(TARGET_NR_clock_settime64) || defined(TARGET_NR_futex_time64) +#if defined(TARGET_NR_clock_settime64) || defined(TARGET_NR_futex_time64) || \ + defined(TARGET_NR_timer_settime64) || \ + (defined(TARGET_NR_timerfd_settime64) && defined(CONFIG_TIMERFD)) static inline abi_long target_to_host_timespec64(struct timespec *host_ts, abi_ulong target_addr) { @@ -6783,46 +6787,74 @@ static inline abi_long target_ftruncate64(void *cpu_env, abi_long arg1, #if defined(TARGET_NR_timer_settime) || \ (defined(TARGET_NR_timerfd_settime) && defined(CONFIG_TIMERFD)) -static inline abi_long target_to_host_itimerspec(struct itimerspec *host_itspec, +static inline abi_long target_to_host_itimerspec(struct itimerspec *host_its, abi_ulong target_addr) { - struct target_itimerspec *target_itspec; - - if (!lock_user_struct(VERIFY_READ, target_itspec, target_addr, 1)) { + if (target_to_host_timespec(&host_its->it_interval, target_addr + + offsetof(struct target_itimerspec, + it_interval)) || + target_to_host_timespec(&host_its->it_value, target_addr + + offsetof(struct target_itimerspec, + it_value))) { return -TARGET_EFAULT; } - host_itspec->it_interval.tv_sec = - tswapal(target_itspec->it_interval.tv_sec); - host_itspec->it_interval.tv_nsec = - tswapal(target_itspec->it_interval.tv_nsec); - host_itspec->it_value.tv_sec = tswapal(target_itspec->it_value.tv_sec); - host_itspec->it_value.tv_nsec = tswapal(target_itspec->it_value.tv_nsec); + return 0; +} +#endif + +#if defined(TARGET_NR_timer_settime64) || \ + (defined(TARGET_NR_timerfd_settime64) && defined(CONFIG_TIMERFD)) +static inline abi_long target_to_host_itimerspec64(struct itimerspec *host_its, + abi_ulong target_addr) +{ + if (target_to_host_timespec64(&host_its->it_interval, target_addr + + offsetof(struct target__kernel_itimerspec, + it_interval)) || + target_to_host_timespec64(&host_its->it_value, target_addr + + offsetof(struct target__kernel_itimerspec, + it_value))) { + return -TARGET_EFAULT; + } - unlock_user_struct(target_itspec, target_addr, 1); return 0; } #endif #if ((defined(TARGET_NR_timerfd_gettime) || \ defined(TARGET_NR_timerfd_settime)) && defined(CONFIG_TIMERFD)) || \ - defined(TARGET_NR_timer_gettime) || defined(TARGET_NR_timer_settime) + defined(TARGET_NR_timer_gettime) || defined(TARGET_NR_timer_settime) static inline abi_long host_to_target_itimerspec(abi_ulong target_addr, - struct itimerspec *host_its) -{ - struct target_itimerspec *target_itspec; - - if (!lock_user_struct(VERIFY_WRITE, target_itspec, target_addr, 0)) { + struct itimerspec *host_its) +{ + if (host_to_target_timespec(target_addr + offsetof(struct target_itimerspec, + it_interval), + &host_its->it_interval) || + host_to_target_timespec(target_addr + offsetof(struct target_itimerspec, + it_value), + &host_its->it_value)) { return -TARGET_EFAULT; } + return 0; +} +#endif - target_itspec->it_interval.tv_sec = tswapal(host_its->it_interval.tv_sec); - target_itspec->it_interval.tv_nsec = tswapal(host_its->it_interval.tv_nsec); - - target_itspec->it_value.tv_sec = tswapal(host_its->it_value.tv_sec); - target_itspec->it_value.tv_nsec = tswapal(host_its->it_value.tv_nsec); - - unlock_user_struct(target_itspec, target_addr, 0); +#if ((defined(TARGET_NR_timerfd_gettime64) || \ + defined(TARGET_NR_timerfd_settime64)) && defined(CONFIG_TIMERFD)) || \ + defined(TARGET_NR_timer_gettime64) || defined(TARGET_NR_timer_settime64) +static inline abi_long host_to_target_itimerspec64(abi_ulong target_addr, + struct itimerspec *host_its) +{ + if (host_to_target_timespec64(target_addr + + offsetof(struct target__kernel_itimerspec, + it_interval), + &host_its->it_interval) || + host_to_target_timespec64(target_addr + + offsetof(struct target__kernel_itimerspec, + it_value), + &host_its->it_value)) { + return -TARGET_EFAULT; + } return 0; } #endif @@ -11819,6 +11851,17 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, return ret; } #endif +#ifdef TARGET_NR_clock_getres_time64 + case TARGET_NR_clock_getres_time64: + { + struct timespec ts; + ret = get_errno(clock_getres(arg1, &ts)); + if (!is_error(ret)) { + host_to_target_timespec64(arg2, &ts); + } + return ret; + } +#endif #ifdef TARGET_NR_clock_nanosleep case TARGET_NR_clock_nanosleep: { @@ -11876,8 +11919,13 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, if (!arg3) { tsp = NULL; } else { - target_to_host_timespec(ts, arg3); - target_to_host_timespec(ts+1, arg3+sizeof(struct target_timespec)); + if (target_to_host_timespec(ts, arg3)) { + return -TARGET_EFAULT; + } + if (target_to_host_timespec(ts + 1, arg3 + + sizeof(struct target_timespec))) { + return -TARGET_EFAULT; + } tsp = ts; } if (!arg2) @@ -12413,6 +12461,32 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, } #endif +#ifdef TARGET_NR_timer_settime64 + case TARGET_NR_timer_settime64: + { + target_timer_t timerid = get_timer_id(arg1); + + if (timerid < 0) { + ret = timerid; + } else if (arg3 == 0) { + ret = -TARGET_EINVAL; + } else { + timer_t htimer = g_posix_timers[timerid]; + struct itimerspec hspec_new = {{0},}, hspec_old = {{0},}; + + if (target_to_host_itimerspec64(&hspec_new, arg3)) { + return -TARGET_EFAULT; + } + ret = get_errno( + timer_settime(htimer, arg2, &hspec_new, &hspec_old)); + if (arg4 && host_to_target_itimerspec64(arg4, &hspec_old)) { + return -TARGET_EFAULT; + } + } + return ret; + } +#endif + #ifdef TARGET_NR_timer_gettime case TARGET_NR_timer_gettime: { @@ -12436,6 +12510,29 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, } #endif +#ifdef TARGET_NR_timer_gettime64 + case TARGET_NR_timer_gettime64: + { + /* args: timer_t timerid, struct itimerspec64 *curr_value */ + target_timer_t timerid = get_timer_id(arg1); + + if (timerid < 0) { + ret = timerid; + } else if (!arg2) { + ret = -TARGET_EFAULT; + } else { + timer_t htimer = g_posix_timers[timerid]; + struct itimerspec hspec; + ret = get_errno(timer_gettime(htimer, &hspec)); + + if (host_to_target_itimerspec64(arg2, &hspec)) { + ret = -TARGET_EFAULT; + } + } + return ret; + } +#endif + #ifdef TARGET_NR_timer_getoverrun case TARGET_NR_timer_getoverrun: { @@ -12489,6 +12586,20 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, return ret; #endif +#if defined(TARGET_NR_timerfd_gettime64) && defined(CONFIG_TIMERFD) + case TARGET_NR_timerfd_gettime64: + { + struct itimerspec its_curr; + + ret = get_errno(timerfd_gettime(arg1, &its_curr)); + + if (arg2 && host_to_target_itimerspec64(arg2, &its_curr)) { + return -TARGET_EFAULT; + } + } + return ret; +#endif + #if defined(TARGET_NR_timerfd_settime) && defined(CONFIG_TIMERFD) case TARGET_NR_timerfd_settime: { @@ -12512,6 +12623,29 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, return ret; #endif +#if defined(TARGET_NR_timerfd_settime64) && defined(CONFIG_TIMERFD) + case TARGET_NR_timerfd_settime64: + { + struct itimerspec its_new, its_old, *p_new; + + if (arg3) { + if (target_to_host_itimerspec64(&its_new, arg3)) { + return -TARGET_EFAULT; + } + p_new = &its_new; + } else { + p_new = NULL; + } + + ret = get_errno(timerfd_settime(arg1, arg2, p_new, &its_old)); + + if (arg4 && host_to_target_itimerspec64(arg4, &its_old)) { + return -TARGET_EFAULT; + } + } + return ret; +#endif + #if defined(TARGET_NR_ioprio_get) && defined(__NR_ioprio_get) case TARGET_NR_ioprio_get: return get_errno(ioprio_get(arg1, arg2)); diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 3c261cff0e..427a25f5bc 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -259,6 +259,11 @@ struct target_itimerspec { struct target_timespec it_value; }; +struct target__kernel_itimerspec { + struct target__kernel_timespec it_interval; + struct target__kernel_timespec it_value; +}; + struct target_timex { abi_uint modes; /* Mode selector */ abi_long offset; /* Time offset */ diff --git a/linux-user/trace.h b/linux-user/trace.h new file mode 100644 index 0000000000..05518e4694 --- /dev/null +++ b/linux-user/trace.h @@ -0,0 +1 @@ +#include "trace/trace-linux_user.h" diff --git a/linux-user/x86_64/Makefile.objs b/linux-user/x86_64/Makefile.objs deleted file mode 100644 index 2cef1d48be..0000000000 --- a/linux-user/x86_64/Makefile.objs +++ /dev/null @@ -1,5 +0,0 @@ -generated-files-y += linux-user/x86_64/syscall_nr.h - -syshdr := $(SRC_PATH)/linux-user/x86_64/syscallhdr.sh -%/syscall_nr.h: $(SRC_PATH)/linux-user/x86_64/syscall_64.tbl $(syshdr) - $(call quiet-command, sh $(syshdr) $< $@ $(TARGET_SYSTBL_ABI),"GEN","$@") diff --git a/linux-user/x86_64/meson.build b/linux-user/x86_64/meson.build new file mode 100644 index 0000000000..203af9a60c --- /dev/null +++ b/linux-user/x86_64/meson.build @@ -0,0 +1,5 @@ +syscall_nr_generators += { + 'x86_64': generator(sh, + arguments: [ meson.current_source_dir() / 'syscallhdr.sh', '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@' ], + output: '@BASENAME@_nr.h') +} diff --git a/linux-user/x86_64/syscall_nr.h b/linux-user/x86_64/syscall_nr.h new file mode 100644 index 0000000000..760302cb3e --- /dev/null +++ b/linux-user/x86_64/syscall_nr.h @@ -0,0 +1 @@ +#include "syscall_64_nr.h" diff --git a/linux-user/xtensa/Makefile.objs b/linux-user/xtensa/Makefile.objs deleted file mode 100644 index d4be1b7455..0000000000 --- a/linux-user/xtensa/Makefile.objs +++ /dev/null @@ -1,5 +0,0 @@ -generated-files-y += linux-user/xtensa/syscall_nr.h - -syshdr := $(SRC_PATH)/linux-user/xtensa/syscallhdr.sh -%/syscall_nr.h: $(SRC_PATH)/linux-user/xtensa/syscall.tbl $(syshdr) - $(call quiet-command, sh $(syshdr) $< $@ $(TARGET_SYSTBL_ABI),"GEN","$@") diff --git a/linux-user/xtensa/meson.build b/linux-user/xtensa/meson.build new file mode 100644 index 0000000000..de77f3b66a --- /dev/null +++ b/linux-user/xtensa/meson.build @@ -0,0 +1,5 @@ +syscall_nr_generators += { + 'xtensa': generator(sh, + arguments: [ meson.current_source_dir() / 'syscallhdr.sh', '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@' ], + output: '@BASENAME@_nr.h') +} diff --git a/memory_ldst.inc.c b/memory_ldst.c.inc index c54aee4a95..c54aee4a95 100644 --- a/memory_ldst.inc.c +++ b/memory_ldst.c.inc diff --git a/meson b/meson new file mode 160000 +Subproject d0c68dc11507a47b9b85de508e023d9590d6056 diff --git a/meson.build b/meson.build new file mode 100644 index 0000000000..df5bf728b5 --- /dev/null +++ b/meson.build @@ -0,0 +1,1449 @@ +project('qemu', ['c'], meson_version: '>=0.55.0', + default_options: ['warning_level=1', 'c_std=gnu99', 'cpp_std=gnu++11', 'b_lundef=false'], + version: run_command('head', meson.source_root() / 'VERSION').stdout().strip()) + +not_found = dependency('', required: false) +if meson.version().version_compare('>=0.56.0') + keyval = import('keyval') +else + keyval = import('unstable-keyval') +endif +ss = import('sourceset') + +sh = find_program('sh') +cc = meson.get_compiler('c') +config_host = keyval.load(meson.current_build_dir() / 'config-host.mak') +config_all_disas = keyval.load(meson.current_build_dir() / 'config-all-disas.mak') +enable_modules = 'CONFIG_MODULES' in config_host +enable_static = 'CONFIG_STATIC' in config_host +build_docs = 'BUILD_DOCS' in config_host +config_host_data = configuration_data() +genh = [] + +add_project_arguments(config_host['QEMU_CFLAGS'].split(), + native: false, language: ['c', 'objc']) +add_project_arguments(config_host['QEMU_CXXFLAGS'].split(), + native: false, language: 'cpp') +add_project_link_arguments(config_host['QEMU_LDFLAGS'].split(), + native: false, language: ['c', 'cpp', 'objc']) +add_project_arguments(config_host['QEMU_INCLUDES'].split(), + language: ['c', 'cpp', 'objc']) + +python = import('python').find_installation() + +link_language = meson.get_external_property('link_language', 'cpp') +if link_language == 'cpp' + add_languages('cpp', required: true, native: false) +endif +if host_machine.system() == 'darwin' + add_languages('objc', required: false, native: false) +endif + +if 'SPARSE_CFLAGS' in config_host + run_target('sparse', + command: [find_program('scripts/check_sparse.py'), + config_host['SPARSE_CFLAGS'].split(), + 'compile_commands.json']) +endif + +configure_file(input: files('scripts/ninjatool.py'), + output: 'ninjatool', + configuration: config_host) + +supported_oses = ['windows', 'freebsd', 'netbsd', 'openbsd', 'darwin', 'sunos', 'linux'] +supported_cpus = ['ppc', 'ppc64', 's390x', 'sparc64', 'riscv32', 'riscv64', 'x86', 'x86_64', + 'arm', 'aarch64', 'mips', 'mips64', 'sparc', 'sparc64'] + +cpu = host_machine.cpu_family() +targetos = host_machine.system() + +m = cc.find_library('m', required: false) +util = cc.find_library('util', required: false) +winmm = [] +socket = [] +version_res = [] +coref = [] +iokit = [] +cocoa = [] +hvf = [] +if targetos == 'windows' + socket = cc.find_library('ws2_32') + winmm = cc.find_library('winmm') + + win = import('windows') + version_res = win.compile_resources('version.rc', + depend_files: files('pc-bios/qemu-nsis.ico'), + include_directories: include_directories('.')) +elif targetos == 'darwin' + coref = dependency('appleframeworks', modules: 'CoreFoundation') + iokit = dependency('appleframeworks', modules: 'IOKit') + cocoa = dependency('appleframeworks', modules: 'Cocoa') + hvf = dependency('appleframeworks', modules: 'Hypervisor') +elif targetos == 'sunos' + socket = [cc.find_library('socket'), + cc.find_library('nsl'), + cc.find_library('resolv')] +elif targetos == 'haiku' + socket = [cc.find_library('posix_error_mapper'), + cc.find_library('network'), + cc.find_library('bsd')] +endif +glib = declare_dependency(compile_args: config_host['GLIB_CFLAGS'].split(), + link_args: config_host['GLIB_LIBS'].split()) +gio = not_found +if 'CONFIG_GIO' in config_host + gio = declare_dependency(compile_args: config_host['GIO_CFLAGS'].split(), + link_args: config_host['GIO_LIBS'].split()) +endif +lttng = not_found +if 'CONFIG_TRACE_UST' in config_host + lttng = declare_dependency(link_args: config_host['LTTNG_UST_LIBS'].split()) +endif +urcubp = not_found +if 'CONFIG_TRACE_UST' in config_host + urcubp = declare_dependency(link_args: config_host['URCU_BP_LIBS'].split()) +endif +nettle = not_found +if 'CONFIG_NETTLE' in config_host + nettle = declare_dependency(compile_args: config_host['NETTLE_CFLAGS'].split(), + link_args: config_host['NETTLE_LIBS'].split()) +endif +gnutls = not_found +if 'CONFIG_GNUTLS' in config_host + gnutls = declare_dependency(compile_args: config_host['GNUTLS_CFLAGS'].split(), + link_args: config_host['GNUTLS_LIBS'].split()) +endif +pixman = declare_dependency(compile_args: config_host['PIXMAN_CFLAGS'].split(), + link_args: config_host['PIXMAN_LIBS'].split()) +pam = not_found +if 'CONFIG_AUTH_PAM' in config_host + pam = cc.find_library('pam') +endif +libaio = cc.find_library('aio', required: false) +zlib = not_found +if 'CONFIG_ZLIB' in config_host + zlib = declare_dependency(compile_args: config_host['ZLIB_CFLAGS'].split(), + link_args: config_host['ZLIB_LIBS'].split()) +endif +linux_io_uring = not_found +if 'CONFIG_LINUX_IO_URING' in config_host + linux_io_uring = declare_dependency(compile_args: config_host['LINUX_IO_URING_CFLAGS'].split(), + link_args: config_host['LINUX_IO_URING_LIBS'].split()) +endif +libxml2 = not_found +if 'CONFIG_LIBXML2' in config_host + libxml2 = declare_dependency(compile_args: config_host['LIBXML2_CFLAGS'].split(), + link_args: config_host['LIBXML2_LIBS'].split()) +endif +libnfs = not_found +if 'CONFIG_LIBNFS' in config_host + libnfs = declare_dependency(link_args: config_host['LIBNFS_LIBS'].split()) +endif +libattr = not_found +if 'CONFIG_ATTR' in config_host + libattr = declare_dependency(link_args: config_host['LIBATTR_LIBS'].split()) +endif +seccomp = not_found +if 'CONFIG_SECCOMP' in config_host + seccomp = declare_dependency(compile_args: config_host['SECCOMP_CFLAGS'].split(), + link_args: config_host['SECCOMP_LIBS'].split()) +endif +libcap_ng = not_found +if 'CONFIG_LIBCAP_NG' in config_host + libcap_ng = declare_dependency(link_args: config_host['LIBCAP_NG_LIBS'].split()) +endif +xkbcommon = not_found +if 'CONFIG_XKBCOMMON' in config_host + xkbcommon = declare_dependency(compile_args: config_host['XKBCOMMON_CFLAGS'].split(), + link_args: config_host['XKBCOMMON_LIBS'].split()) +endif +slirp = not_found +if config_host.has_key('CONFIG_SLIRP') + slirp = declare_dependency(compile_args: config_host['SLIRP_CFLAGS'].split(), + link_args: config_host['SLIRP_LIBS'].split()) +endif +vde = not_found +if config_host.has_key('CONFIG_VDE') + vde = declare_dependency(link_args: config_host['VDE_LIBS'].split()) +endif +pulse = not_found +if 'CONFIG_LIBPULSE' in config_host + pulse = declare_dependency(compile_args: config_host['PULSE_CFLAGS'].split(), + link_args: config_host['PULSE_LIBS'].split()) +endif +alsa = not_found +if 'CONFIG_ALSA' in config_host + alsa = declare_dependency(compile_args: config_host['ALSA_CFLAGS'].split(), + link_args: config_host['ALSA_LIBS'].split()) +endif +jack = not_found +if 'CONFIG_LIBJACK' in config_host + jack = declare_dependency(link_args: config_host['JACK_LIBS'].split()) +endif +spice = not_found +if 'CONFIG_SPICE' in config_host + spice = declare_dependency(compile_args: config_host['SPICE_CFLAGS'].split(), + link_args: config_host['SPICE_LIBS'].split()) +endif +rt = cc.find_library('rt', required: false) +libmpathpersist = not_found +if config_host.has_key('CONFIG_MPATH') + libmpathpersist = cc.find_library('mpathpersist') +endif +libiscsi = not_found +if 'CONFIG_LIBISCSI' in config_host + libiscsi = declare_dependency(compile_args: config_host['LIBISCSI_CFLAGS'].split(), + link_args: config_host['LIBISCSI_LIBS'].split()) +endif +zstd = not_found +if 'CONFIG_ZSTD' in config_host + zstd = declare_dependency(compile_args: config_host['ZSTD_CFLAGS'].split(), + link_args: config_host['ZSTD_LIBS'].split()) +endif +gbm = not_found +if 'CONFIG_GBM' in config_host + gbm = declare_dependency(compile_args: config_host['GBM_CFLAGS'].split(), + link_args: config_host['GBM_LIBS'].split()) +endif +virgl = not_found +if 'CONFIG_VIRGL' in config_host + virgl = declare_dependency(compile_args: config_host['VIRGL_CFLAGS'].split(), + link_args: config_host['VIRGL_LIBS'].split()) +endif +curl = not_found +if 'CONFIG_CURL' in config_host + curl = declare_dependency(compile_args: config_host['CURL_CFLAGS'].split(), + link_args: config_host['CURL_LIBS'].split()) +endif +libudev = not_found +if 'CONFIG_LIBUDEV' in config_host + libudev = declare_dependency(link_args: config_host['LIBUDEV_LIBS'].split()) +endif +brlapi = not_found +if 'CONFIG_BRLAPI' in config_host + brlapi = declare_dependency(link_args: config_host['BRLAPI_LIBS'].split()) +endif + +sdl = dependency('sdl2', required: get_option('sdl'), static: enable_static, + include_type: 'system') +sdl_image = not_found +if sdl.found() + # work around 2.0.8 bug + sdl = declare_dependency(compile_args: '-Wno-undef', + dependencies: sdl) + sdl_image = dependency('sdl-image', required: get_option('sdl_image'), + static: enable_static) +else + if get_option('sdl_image').enabled() + error('sdl-image required, but SDL was @0@', + get_option('sdl').disabled() ? 'disabled' : 'not found') + endif + sdl_image = not_found +endif + +rbd = not_found +if 'CONFIG_RBD' in config_host + rbd = declare_dependency(link_args: config_host['RBD_LIBS'].split()) +endif +glusterfs = not_found +if 'CONFIG_GLUSTERFS' in config_host + glusterfs = declare_dependency(compile_args: config_host['GLUSTERFS_CFLAGS'].split(), + link_args: config_host['GLUSTERFS_LIBS'].split()) +endif +libssh = not_found +if 'CONFIG_LIBSSH' in config_host + libssh = declare_dependency(compile_args: config_host['LIBSSH_CFLAGS'].split(), + link_args: config_host['LIBSSH_LIBS'].split()) +endif +libbzip2 = not_found +if 'CONFIG_BZIP2' in config_host + libbzip2 = declare_dependency(link_args: config_host['BZIP2_LIBS'].split()) +endif +liblzfse = not_found +if 'CONFIG_LZFSE' in config_host + liblzfse = declare_dependency(link_args: config_host['LZFSE_LIBS'].split()) +endif +oss = not_found +if 'CONFIG_AUDIO_OSS' in config_host + oss = declare_dependency(link_args: config_host['OSS_LIBS'].split()) +endif +dsound = not_found +if 'CONFIG_AUDIO_DSOUND' in config_host + dsound = declare_dependency(link_args: config_host['DSOUND_LIBS'].split()) +endif +coreaudio = not_found +if 'CONFIG_AUDIO_COREAUDIO' in config_host + coreaudio = declare_dependency(link_args: config_host['COREAUDIO_LIBS'].split()) +endif +opengl = not_found +if 'CONFIG_OPENGL' in config_host + opengl = declare_dependency(link_args: config_host['OPENGL_LIBS'].split()) +else +endif +gtk = not_found +if 'CONFIG_GTK' in config_host + gtk = declare_dependency(compile_args: config_host['GTK_CFLAGS'].split(), + link_args: config_host['GTK_LIBS'].split()) +endif +vte = not_found +if 'CONFIG_VTE' in config_host + vte = declare_dependency(compile_args: config_host['VTE_CFLAGS'].split(), + link_args: config_host['VTE_LIBS'].split()) +endif +x11 = not_found +if 'CONFIG_X11' in config_host + x11 = declare_dependency(compile_args: config_host['X11_CFLAGS'].split(), + link_args: config_host['X11_LIBS'].split()) +endif +curses = not_found +if 'CONFIG_CURSES' in config_host + curses = declare_dependency(compile_args: config_host['CURSES_CFLAGS'].split(), + link_args: config_host['CURSES_LIBS'].split()) +endif +iconv = not_found +if 'CONFIG_ICONV' in config_host + iconv = declare_dependency(compile_args: config_host['ICONV_CFLAGS'].split(), + link_args: config_host['ICONV_LIBS'].split()) +endif +gio = not_found +if 'CONFIG_GIO' in config_host + gio = declare_dependency(compile_args: config_host['GIO_CFLAGS'].split(), + link_args: config_host['GIO_LIBS'].split()) +endif +vnc = not_found +png = not_found +jpeg = not_found +sasl = not_found +if get_option('vnc').enabled() + vnc = declare_dependency() # dummy dependency + png = dependency('libpng', required: get_option('vnc_png'), + static: enable_static) + jpeg = cc.find_library('jpeg', has_headers: ['jpeglib.h'], + required: get_option('vnc_jpeg'), + static: enable_static) + sasl = cc.find_library('sasl2', has_headers: ['sasl/sasl.h'], + required: get_option('vnc_sasl'), + static: enable_static) + if sasl.found() + sasl = declare_dependency(dependencies: sasl, + compile_args: '-DSTRUCT_IOVEC_DEFINED') + endif +endif +fdt = not_found +if 'CONFIG_FDT' in config_host + fdt = declare_dependency(compile_args: config_host['FDT_CFLAGS'].split(), + link_args: config_host['FDT_LIBS'].split()) +endif +snappy = not_found +if 'CONFIG_SNAPPY' in config_host + snappy = declare_dependency(link_args: config_host['SNAPPY_LIBS'].split()) +endif +lzo = not_found +if 'CONFIG_LZO' in config_host + lzo = declare_dependency(link_args: config_host['LZO_LIBS'].split()) +endif +rdma = not_found +if 'CONFIG_RDMA' in config_host + rdma = declare_dependency(link_args: config_host['RDMA_LIBS'].split()) +endif +numa = not_found +if 'CONFIG_NUMA' in config_host + numa = declare_dependency(link_args: config_host['NUMA_LIBS'].split()) +endif +xen = not_found +if 'CONFIG_XEN_BACKEND' in config_host + xen = declare_dependency(compile_args: config_host['XEN_CFLAGS'].split(), + link_args: config_host['XEN_LIBS'].split()) +endif +cacard = not_found +if 'CONFIG_SMARTCARD' in config_host + cacard = declare_dependency(compile_args: config_host['SMARTCARD_CFLAGS'].split(), + link_args: config_host['SMARTCARD_LIBS'].split()) +endif +usbredir = not_found +if 'CONFIG_USB_REDIR' in config_host + usbredir = declare_dependency(compile_args: config_host['USB_REDIR_CFLAGS'].split(), + link_args: config_host['USB_REDIR_LIBS'].split()) +endif +libusb = not_found +if 'CONFIG_USB_LIBUSB' in config_host + libusb = declare_dependency(compile_args: config_host['LIBUSB_CFLAGS'].split(), + link_args: config_host['LIBUSB_LIBS'].split()) +endif +capstone = not_found +if 'CONFIG_CAPSTONE' in config_host + capstone = declare_dependency(compile_args: config_host['CAPSTONE_CFLAGS'].split(), + link_args: config_host['CAPSTONE_LIBS'].split()) +endif +libpmem = not_found +if 'CONFIG_LIBPMEM' in config_host + libpmem = declare_dependency(compile_args: config_host['LIBPMEM_CFLAGS'].split(), + link_args: config_host['LIBPMEM_LIBS'].split()) +endif + +# Create config-host.h + +config_host_data.set('CONFIG_SDL', sdl.found()) +config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found()) +config_host_data.set('CONFIG_VNC', vnc.found()) +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('QEMU_VERSION', '"@0@"'.format(meson.project_version())) +config_host_data.set('QEMU_VERSION_MAJOR', meson.project_version().split('.')[0]) +config_host_data.set('QEMU_VERSION_MINOR', meson.project_version().split('.')[1]) +config_host_data.set('QEMU_VERSION_MICRO', meson.project_version().split('.')[2]) + +arrays = ['CONFIG_AUDIO_DRIVERS', 'CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST'] +strings = ['HOST_DSOSUF', 'CONFIG_IASL', 'qemu_confdir', 'qemu_datadir', + 'qemu_moddir', 'qemu_localstatedir', 'qemu_helperdir', 'qemu_localedir', + 'qemu_icondir', 'qemu_desktopdir', 'qemu_firmwarepath'] +foreach k, v: config_host + if arrays.contains(k) + if v != '' + v = '"' + '", "'.join(v.split()) + '", ' + endif + config_host_data.set(k, v) + elif k == 'ARCH' + config_host_data.set('HOST_' + v.to_upper(), 1) + elif strings.contains(k) + if not k.startswith('CONFIG_') + k = 'CONFIG_' + k.to_upper() + endif + config_host_data.set_quoted(k, v) + elif k.startswith('CONFIG_') or k.startswith('HAVE_') or k.startswith('HOST_') + config_host_data.set(k, v == 'y' ? 1 : v) + endif +endforeach +genh += configure_file(output: 'config-host.h', configuration: config_host_data) + +minikconf = find_program('scripts/minikconf.py') +target_dirs = config_host['TARGET_DIRS'].split() +have_user = false +have_system = false +config_devices_mak_list = [] +config_devices_h = {} +config_target_h = {} +config_target_mak = {} +kconfig_external_symbols = [ + 'CONFIG_KVM', + 'CONFIG_XEN', + 'CONFIG_TPM', + 'CONFIG_SPICE', + 'CONFIG_IVSHMEM', + 'CONFIG_OPENGL', + 'CONFIG_X11', + 'CONFIG_VHOST_USER', + 'CONFIG_VHOST_KERNEL', + 'CONFIG_VIRTFS', + 'CONFIG_LINUX', + 'CONFIG_PVRDMA', +] +ignored = ['TARGET_XML_FILES', 'TARGET_ABI_DIR', 'TARGET_DIRS'] +foreach target : target_dirs + have_user = have_user or target.endswith('-user') + config_target = keyval.load(meson.current_build_dir() / target / 'config-target.mak') + + config_target_data = configuration_data() + foreach k, v: config_target + if not k.startswith('TARGET_') and not k.startswith('CONFIG_') + # do nothing + elif ignored.contains(k) + # do nothing + elif k == 'TARGET_BASE_ARCH' + config_target_data.set('TARGET_' + v.to_upper(), 1) + elif k == 'TARGET_NAME' + config_target_data.set_quoted(k, v) + elif v == 'y' + config_target_data.set(k, 1) + else + config_target_data.set(k, v) + endif + endforeach + config_target_h += {target: configure_file(output: target + '-config-target.h', + configuration: config_target_data)} + + if target.endswith('-softmmu') + have_system = true + + base_kconfig = [] + foreach sym : kconfig_external_symbols + if sym in config_target or sym in config_host + base_kconfig += '@0@=y'.format(sym) + endif + endforeach + + config_devices_mak = target + '-config-devices.mak' + config_devices_mak = configure_file( + input: ['default-configs' / target + '.mak', 'Kconfig'], + output: config_devices_mak, + depfile: config_devices_mak + '.d', + capture: true, + command: [minikconf, config_host['CONFIG_MINIKCONF_MODE'], + config_devices_mak, '@DEPFILE@', '@INPUT@', + base_kconfig]) + + config_devices_data = configuration_data() + config_devices = keyval.load(config_devices_mak) + foreach k, v: config_devices + config_devices_data.set(k, 1) + endforeach + config_devices_mak_list += config_devices_mak + config_devices_h += {target: configure_file(output: target + '-config-devices.h', + configuration: config_devices_data)} + config_target += config_devices + endif + config_target_mak += {target: config_target} +endforeach +have_tools = 'CONFIG_TOOLS' in config_host +have_block = have_system or have_tools + +grepy = find_program('scripts/grepy.sh') +# This configuration is used to build files that are shared by +# multiple binaries, and then extracted out of the "common" +# static_library target. +# +# We do not use all_sources()/all_dependencies(), because it would +# build literally all source files, including devices only used by +# targets that are not built for this compilation. The CONFIG_ALL +# pseudo symbol replaces it. + +if have_system + config_all_devices_mak = configure_file( + output: 'config-all-devices.mak', + input: config_devices_mak_list, + capture: true, + command: [grepy, '@INPUT@'], + ) + config_all_devices = keyval.load(config_all_devices_mak) +else + config_all_devices = {} +endif +config_all = config_all_devices +config_all += config_host +config_all += config_all_disas +config_all += { + 'CONFIG_XEN': config_host.has_key('CONFIG_XEN_BACKEND'), + 'CONFIG_SOFTMMU': have_system, + 'CONFIG_USER_ONLY': have_user, + 'CONFIG_ALL': true, +} + +# Generators + +hxtool = find_program('scripts/hxtool') +shaderinclude = find_program('scripts/shaderinclude.pl') +qapi_gen = find_program('scripts/qapi-gen.py') +qapi_gen_depends = [ meson.source_root() / 'scripts/qapi/__init__.py', + meson.source_root() / 'scripts/qapi/commands.py', + meson.source_root() / 'scripts/qapi/common.py', + meson.source_root() / 'scripts/qapi/doc.py', + meson.source_root() / 'scripts/qapi/error.py', + meson.source_root() / 'scripts/qapi/events.py', + meson.source_root() / 'scripts/qapi/expr.py', + meson.source_root() / 'scripts/qapi/gen.py', + meson.source_root() / 'scripts/qapi/introspect.py', + meson.source_root() / 'scripts/qapi/parser.py', + meson.source_root() / 'scripts/qapi/schema.py', + meson.source_root() / 'scripts/qapi/source.py', + meson.source_root() / 'scripts/qapi/types.py', + meson.source_root() / 'scripts/qapi/visit.py', + meson.source_root() / 'scripts/qapi/common.py', + meson.source_root() / 'scripts/qapi/doc.py', + meson.source_root() / 'scripts/qapi-gen.py' +] + +tracetool = [ + python, files('scripts/tracetool.py'), + '--backend=' + config_host['TRACE_BACKENDS'] +] + +qemu_version_cmd = [find_program('scripts/qemu-version.sh'), + meson.current_source_dir(), + config_host['PKGVERSION'], meson.project_version()] +qemu_version = custom_target('qemu-version.h', + output: 'qemu-version.h', + command: qemu_version_cmd, + capture: true, + build_by_default: true, + build_always_stale: true) +genh += qemu_version + +hxdep = [] +hx_headers = [ + ['qemu-options.hx', 'qemu-options.def'], + ['qemu-img-cmds.hx', 'qemu-img-cmds.h'], +] +if have_system + hx_headers += [ + ['hmp-commands.hx', 'hmp-commands.h'], + ['hmp-commands-info.hx', 'hmp-commands-info.h'], + ] +endif +foreach d : hx_headers + hxdep += custom_target(d[1], + input: files(d[0]), + output: d[1], + capture: true, + build_by_default: true, # to be removed when added to a target + command: [hxtool, '-h', '@INPUT0@']) +endforeach +genh += hxdep + +# Collect sourcesets. + +util_ss = ss.source_set() +stub_ss = ss.source_set() +trace_ss = ss.source_set() +block_ss = ss.source_set() +blockdev_ss = ss.source_set() +qmp_ss = ss.source_set() +common_ss = ss.source_set() +softmmu_ss = ss.source_set() +user_ss = ss.source_set() +bsd_user_ss = ss.source_set() +linux_user_ss = ss.source_set() +specific_ss = ss.source_set() +specific_fuzz_ss = ss.source_set() + +modules = {} +hw_arch = {} +target_arch = {} +target_softmmu_arch = {} + +############### +# Trace files # +############### + +# TODO: add each directory to the subdirs from its own meson.build, once +# we have those +trace_events_subdirs = [ + 'accel/kvm', + 'accel/tcg', + 'crypto', + 'monitor', +] +if have_user + trace_events_subdirs += [ 'linux-user' ] +endif +if have_block + trace_events_subdirs += [ + 'authz', + 'block', + 'io', + 'nbd', + 'scsi', + ] +endif +if have_system + trace_events_subdirs += [ + 'audio', + 'backends', + 'backends/tpm', + 'chardev', + 'hw/9pfs', + 'hw/acpi', + 'hw/alpha', + 'hw/arm', + 'hw/audio', + 'hw/block', + 'hw/block/dataplane', + 'hw/char', + 'hw/display', + 'hw/dma', + 'hw/hppa', + 'hw/hyperv', + 'hw/i2c', + 'hw/i386', + 'hw/i386/xen', + 'hw/ide', + 'hw/input', + 'hw/intc', + 'hw/isa', + 'hw/mem', + 'hw/mips', + 'hw/misc', + 'hw/misc/macio', + 'hw/net', + 'hw/nvram', + 'hw/pci', + 'hw/pci-host', + 'hw/ppc', + 'hw/rdma', + 'hw/rdma/vmw', + 'hw/rtc', + 'hw/s390x', + 'hw/scsi', + 'hw/sd', + 'hw/sparc', + 'hw/sparc64', + 'hw/ssi', + 'hw/timer', + 'hw/tpm', + 'hw/usb', + 'hw/vfio', + 'hw/virtio', + 'hw/watchdog', + 'hw/xen', + 'hw/gpio', + 'hw/riscv', + 'migration', + 'net', + 'ui', + ] +endif +trace_events_subdirs += [ + 'hw/core', + 'qapi', + 'qom', + 'target/arm', + 'target/hppa', + 'target/i386', + 'target/mips', + 'target/ppc', + 'target/riscv', + 'target/s390x', + 'target/sparc', + 'util', +] + +subdir('qapi') +subdir('qobject') +subdir('stubs') +subdir('trace') +subdir('util') +subdir('qom') +subdir('authz') +subdir('crypto') +subdir('ui') + + +if enable_modules + libmodulecommon = static_library('module-common', files('module-common.c') + genh, pic: true, c_args: '-DBUILD_DSO') + modulecommon = declare_dependency(link_whole: libmodulecommon, compile_args: '-DBUILD_DSO') +endif + +# Build targets from sourcesets + +stub_ss = stub_ss.apply(config_all, strict: false) + +util_ss.add_all(trace_ss) +util_ss = util_ss.apply(config_all, strict: false) +libqemuutil = static_library('qemuutil', + sources: util_ss.sources() + stub_ss.sources() + genh, + dependencies: [util_ss.dependencies(), m, glib, socket]) +qemuutil = declare_dependency(link_with: libqemuutil, + sources: genh + version_res) + +decodetree = generator(find_program('scripts/decodetree.py'), + output: 'decode-@BASENAME@.c.inc', + arguments: ['@INPUT@', '@EXTRA_ARGS@', '-o', '@OUTPUT@']) + +subdir('audio') +subdir('io') +subdir('chardev') +subdir('fsdev') +subdir('libdecnumber') +subdir('target') +subdir('dump') + +block_ss.add(files( + 'block.c', + 'blockjob.c', + 'job.c', + 'qemu-io-cmds.c', +)) +block_ss.add(when: 'CONFIG_REPLICATION', if_true: files('replication.c')) + +subdir('nbd') +subdir('scsi') +subdir('block') + +blockdev_ss.add(files( + 'blockdev.c', + 'blockdev-nbd.c', + 'iothread.c', + 'job-qmp.c', +)) + +# os-posix.c contains POSIX-specific functions used by qemu-storage-daemon, +# os-win32.c does not +blockdev_ss.add(when: 'CONFIG_POSIX', if_true: files('os-posix.c')) +softmmu_ss.add(when: 'CONFIG_WIN32', if_true: [files('os-win32.c')]) + +softmmu_ss.add_all(blockdev_ss) +softmmu_ss.add(files( + 'bootdevice.c', + 'dma-helpers.c', + 'qdev-monitor.c', +), sdl) + +softmmu_ss.add(when: 'CONFIG_TPM', if_true: files('tpm.c')) +softmmu_ss.add(when: 'CONFIG_SECCOMP', if_true: [files('qemu-seccomp.c'), seccomp]) +softmmu_ss.add(when: ['CONFIG_FDT', fdt], if_true: [files('device_tree.c')]) + +common_ss.add(files('cpus-common.c')) + +subdir('softmmu') + +specific_ss.add(files('disas.c', 'exec.c', 'gdbstub.c'), capstone, libpmem) +specific_ss.add(files('exec-vary.c')) +specific_ss.add(when: 'CONFIG_TCG', if_true: files( + 'fpu/softfloat.c', + 'tcg/optimize.c', + 'tcg/tcg-common.c', + 'tcg/tcg-op-gvec.c', + 'tcg/tcg-op-vec.c', + 'tcg/tcg-op.c', + 'tcg/tcg.c', +)) +specific_ss.add(when: 'CONFIG_TCG_INTERPRETER', if_true: files('disas/tci.c', 'tcg/tci.c')) + +subdir('backends') +subdir('disas') +subdir('migration') +subdir('monitor') +subdir('net') +subdir('replay') +subdir('hw') +subdir('accel') +subdir('plugins') +subdir('bsd-user') +subdir('linux-user') + +bsd_user_ss.add(files('gdbstub.c')) +specific_ss.add_all(when: 'CONFIG_BSD_USER', if_true: bsd_user_ss) + +linux_user_ss.add(files('gdbstub.c', 'thunk.c')) +specific_ss.add_all(when: 'CONFIG_LINUX_USER', if_true: linux_user_ss) + +# needed for fuzzing binaries +subdir('tests/qtest/libqos') +subdir('tests/qtest/fuzz') + +block_mods = [] +softmmu_mods = [] +foreach d, list : modules + foreach m, module_ss : list + if enable_modules and targetos != 'windows' + module_ss = module_ss.apply(config_host, strict: false) + sl = static_library(d + '-' + m, [genh, module_ss.sources()], + dependencies: [modulecommon, module_ss.dependencies()], pic: true) + if d == 'block' + block_mods += sl + else + softmmu_mods += sl + endif + else + if d == 'block' + block_ss.add_all(module_ss) + else + softmmu_ss.add_all(module_ss) + endif + endif + endforeach +endforeach + +nm = find_program('nm') +undefsym = find_program('scripts/undefsym.sh') +block_syms = custom_target('block.syms', output: 'block.syms', + input: [libqemuutil, block_mods], + capture: true, + command: [undefsym, nm, '@INPUT@']) +qemu_syms = custom_target('qemu.syms', output: 'qemu.syms', + input: [libqemuutil, softmmu_mods], + capture: true, + command: [undefsym, nm, '@INPUT@']) + +block_ss = block_ss.apply(config_host, strict: false) +libblock = static_library('block', block_ss.sources() + genh, + dependencies: block_ss.dependencies(), + link_depends: block_syms, + name_suffix: 'fa', + build_by_default: false) + +block = declare_dependency(link_whole: [libblock], + link_args: '@block.syms', + dependencies: [crypto, io]) + +qmp_ss = qmp_ss.apply(config_host, strict: false) +libqmp = static_library('qmp', qmp_ss.sources() + genh, + dependencies: qmp_ss.dependencies(), + name_suffix: 'fa', + build_by_default: false) + +qmp = declare_dependency(link_whole: [libqmp]) + +foreach m : block_mods + softmmu_mods + shared_module(m.name(), + name_prefix: '', + link_whole: m, + install: true, + install_dir: config_host['qemu_moddir']) +endforeach + +softmmu_ss.add(authz, block, chardev, crypto, io, qmp) +common_ss.add(qom, qemuutil) + +common_ss.add_all(when: 'CONFIG_SOFTMMU', if_true: [softmmu_ss]) +common_ss.add_all(when: 'CONFIG_USER_ONLY', if_true: user_ss) + +common_all = common_ss.apply(config_all, strict: false) +common_all = static_library('common', + build_by_default: false, + sources: common_all.sources() + genh, + dependencies: common_all.dependencies(), + name_suffix: 'fa') + +feature_to_c = find_program('scripts/feature_to_c.sh') + +emulators = [] +foreach target : target_dirs + config_target = config_target_mak[target] + target_name = config_target['TARGET_NAME'] + arch = config_target['TARGET_BASE_ARCH'] + arch_srcs = [config_target_h[target]] + arch_deps = [] + c_args = ['-DNEED_CPU_H', + '-DCONFIG_TARGET="@0@-config-target.h"'.format(target), + '-DCONFIG_DEVICES="@0@-config-devices.h"'.format(target)] + link_args = [] + + config_target += config_host + target_inc = [include_directories('target' / config_target['TARGET_BASE_ARCH'])] + if targetos == 'linux' + target_inc += include_directories('linux-headers', is_system: true) + endif + if target.endswith('-softmmu') + qemu_target_name = 'qemu-system-' + target_name + target_type='system' + t = target_softmmu_arch[arch].apply(config_target, strict: false) + arch_srcs += t.sources() + arch_deps += t.dependencies() + + hw_dir = target_name == 'sparc64' ? 'sparc64' : arch + hw = hw_arch[hw_dir].apply(config_target, strict: false) + arch_srcs += hw.sources() + arch_deps += hw.dependencies() + + arch_srcs += config_devices_h[target] + link_args += ['@block.syms', '@qemu.syms'] + else + abi = config_target['TARGET_ABI_DIR'] + target_type='user' + qemu_target_name = 'qemu-' + target_name + if 'CONFIG_LINUX_USER' in config_target + base_dir = 'linux-user' + target_inc += include_directories('linux-user/host/' / config_host['ARCH']) + else + base_dir = 'bsd-user' + endif + target_inc += include_directories( + base_dir, + base_dir / abi, + ) + if 'CONFIG_LINUX_USER' in config_target + dir = base_dir / abi + arch_srcs += files(dir / 'signal.c', dir / 'cpu_loop.c') + if config_target.has_key('TARGET_SYSTBL_ABI') + arch_srcs += \ + syscall_nr_generators[abi].process(base_dir / abi / config_target['TARGET_SYSTBL'], + extra_args : config_target['TARGET_SYSTBL_ABI']) + endif + endif + endif + + if 'TARGET_XML_FILES' in config_target + gdbstub_xml = custom_target(target + '-gdbstub-xml.c', + output: target + '-gdbstub-xml.c', + input: files(config_target['TARGET_XML_FILES'].split()), + command: [feature_to_c, '@INPUT@'], + capture: true) + arch_srcs += gdbstub_xml + endif + + t = target_arch[arch].apply(config_target, strict: false) + arch_srcs += t.sources() + arch_deps += t.dependencies() + + target_common = common_ss.apply(config_target, strict: false) + objects = common_all.extract_objects(target_common.sources()) + deps = target_common.dependencies() + + target_specific = specific_ss.apply(config_target, strict: false) + arch_srcs += target_specific.sources() + arch_deps += target_specific.dependencies() + + lib = static_library('qemu-' + target, + sources: arch_srcs + genh, + objects: objects, + include_directories: target_inc, + c_args: c_args, + build_by_default: false, + name_suffix: 'fa') + + if target.endswith('-softmmu') + execs = [{ + 'name': 'qemu-system-' + target_name, + 'gui': false, + 'sources': files('softmmu/main.c'), + 'dependencies': [] + }] + if targetos == 'windows' and (sdl.found() or gtk.found()) + execs += [{ + 'name': 'qemu-system-' + target_name + 'w', + 'gui': true, + 'sources': files('softmmu/main.c'), + 'dependencies': [] + }] + endif + if config_host.has_key('CONFIG_FUZZ') + specific_fuzz = specific_fuzz_ss.apply(config_target, strict: false) + execs += [{ + 'name': 'qemu-fuzz-' + target_name, + 'gui': false, + 'sources': specific_fuzz.sources(), + 'dependencies': specific_fuzz.dependencies(), + 'link_depends': [files('tests/qtest/fuzz/fork_fuzz.ld')], + }] + endif + else + execs = [{ + 'name': 'qemu-' + target_name, + 'gui': false, + 'sources': [], + 'dependencies': [] + }] + endif + foreach exe: execs + emulators += executable(exe['name'], exe['sources'], + install: true, + c_args: c_args, + dependencies: arch_deps + deps + exe['dependencies'], + objects: lib.extract_all_objects(recursive: true), + link_language: link_language, + link_depends: [block_syms, qemu_syms] + exe.get('link_depends', []), + link_args: link_args, + gui_app: exe['gui']) + + if 'CONFIG_TRACE_SYSTEMTAP' in config_host + foreach stp: [ + {'ext': '.stp-build', 'fmt': 'stap', 'bin': meson.current_build_dir() / exe_name, 'install': false}, + {'ext': '.stp', 'fmt': 'stap', 'bin': get_option('prefix') / get_option('bindir') / exe_name, 'install': true}, + {'ext': '-simpletrace.stp', 'fmt': 'simpletrace-stap', 'bin': '', 'install': true}, + {'ext': '-log.stp', 'fmt': 'log-stap', 'bin': '', 'install': true}, + ] + custom_target(exe_name + stp['ext'], + input: trace_events_all, + output: exe_name + stp['ext'], + capture: true, + install: stp['install'], + install_dir: config_host['qemu_datadir'] / '../systemtap/tapset', + command: [ + tracetool, '--group=all', '--format=' + stp['fmt'], + '--binary=' + stp['bin'], + '--target-name=' + target_name, + '--target-type=' + target_type, + '--probe-prefix=qemu.' + target_type + '.' + target_name, + '@INPUT@', + ]) + endforeach + endif + endforeach +endforeach + +# Other build targets + +if 'CONFIG_PLUGIN' in config_host + install_headers('include/qemu/qemu-plugin.h') +endif + +if 'CONFIG_GUEST_AGENT' in config_host + subdir('qga') +endif + +if 'CONFIG_XKBCOMMON' in config_host + # used for the update-keymaps target, so include rules even if !have_tools + qemu_keymap = executable('qemu-keymap', files('qemu-keymap.c', 'ui/input-keymap.c') + genh, + dependencies: [qemuutil, xkbcommon], install: have_tools) +endif + +qemu_block_tools = [] +if have_tools + qemu_img = executable('qemu-img', [files('qemu-img.c'), hxdep], + dependencies: [authz, block, crypto, io, qom, qemuutil], install: true) + qemu_io = executable('qemu-io', files('qemu-io.c'), + dependencies: [block, qemuutil], install: true) + qemu_block_tools += [qemu_img, qemu_io] + if targetos == 'linux' or targetos == 'sunos' or targetos.endswith('bsd') + qemu_nbd = executable('qemu-nbd', files('qemu-nbd.c'), + dependencies: [block, qemuutil], install: true) + qemu_block_tools += [qemu_nbd] + endif + + subdir('storage-daemon') + subdir('contrib/rdmacm-mux') + subdir('contrib/elf2dmp') + + executable('qemu-edid', files('qemu-edid.c', 'hw/display/edid-generate.c'), + dependencies: qemuutil, + install: true) + + if 'CONFIG_VHOST_USER' in config_host + subdir('contrib/libvhost-user') + subdir('contrib/vhost-user-blk') + if 'CONFIG_LINUX' in config_host + subdir('contrib/vhost-user-gpu') + endif + subdir('contrib/vhost-user-input') + subdir('contrib/vhost-user-scsi') + endif + + if targetos == 'linux' + executable('qemu-bridge-helper', files('qemu-bridge-helper.c'), + dependencies: [qemuutil, libcap_ng], + install: true, + install_dir: get_option('libexecdir')) + + executable('qemu-pr-helper', files('scsi/qemu-pr-helper.c', 'scsi/utils.c'), + dependencies: [authz, crypto, io, qom, qemuutil, + libcap_ng, libudev, libmpathpersist], + install: true) + endif + + if 'CONFIG_IVSHMEM' in config_host + subdir('contrib/ivshmem-client') + subdir('contrib/ivshmem-server') + endif +endif + +subdir('tools') +subdir('pc-bios') +subdir('tests') +subdir('docs') +if 'CONFIG_GTK' in config_host + subdir('po') +endif + +if build_docs + makeinfo = find_program('makeinfo', required: build_docs) + + docs_inc = [ + '-I', meson.current_source_dir(), + '-I', meson.current_build_dir() / 'docs', + '-I', '@OUTDIR@', + ] + + version_texi = configure_file(output: 'version.texi', + input: 'version.texi.in', + configuration: {'VERSION': meson.project_version(), + 'qemu_confdir': config_host['qemu_confdir']}) + + texi = { + 'qemu-qmp-ref': ['docs/interop/qemu-qmp-ref.texi', qapi_doc_texi, version_texi], + } + if 'CONFIG_GUEST_AGENT' in config_host + texi += {'qemu-ga-ref': ['docs/interop/qemu-ga-ref.texi', qga_qapi_doc_texi, version_texi]} + endif + + if makeinfo.found() + cmd = [ + 'env', 'LC_ALL=C', makeinfo, '--no-split', '--number-sections', docs_inc, + '@INPUT0@', '-o', '@OUTPUT@', + ] + foreach ext, args: { + 'info': [], + 'html': ['--no-headers', '--html'], + 'txt': ['--no-headers', '--plaintext'], + } + t = [] + foreach doc, input: texi + output = doc + '.' + ext + t += custom_target(output, + input: input, + output: output, + install: true, + install_dir: config_host['qemu_docdir'] / 'interop', + command: cmd + args) + endforeach + alias_target(ext, t) + endforeach + endif + + texi2pdf = find_program('texi2pdf', required: false) + + if texi2pdf.found() + pdfs = [] + foreach doc, input: texi + output = doc + '.pdf' + pdfs += custom_target(output, + input: input, + output: output, + command: [texi2pdf, '-q', docs_inc, '@INPUT0@', '-o', '@OUTPUT@'], + build_by_default: false) + endforeach + alias_target('pdf', pdfs) + endif + + texi2pod = find_program('scripts/texi2pod.pl') + pod2man = find_program('pod2man', required: build_docs) + + if pod2man.found() + foreach doc, input: texi + man = doc + '.7' + pod = custom_target(man + '.pod', + input: input, + output: man + '.pod', + command: [texi2pod, + '-DVERSION="' + meson.project_version() + '"', + '-DCONFDIR="' + config_host['qemu_confdir'] + '"', + '@INPUT0@', '@OUTPUT@']) + man = custom_target(man, + input: pod, + output: man, + capture: true, + install: true, + install_dir: config_host['mandir'] / 'man7', + command: [pod2man, '--utf8', '--section=7', '--center=" "', + '--release=" "', '@INPUT@']) + endforeach + endif +endif + +summary_info = {} +summary_info += {'Install prefix': config_host['prefix']} +summary_info += {'BIOS directory': config_host['qemu_datadir']} +summary_info += {'firmware path': config_host['qemu_firmwarepath']} +summary_info += {'binary directory': config_host['bindir']} +summary_info += {'library directory': config_host['libdir']} +summary_info += {'module directory': config_host['qemu_moddir']} +summary_info += {'libexec directory': config_host['libexecdir']} +summary_info += {'include directory': config_host['includedir']} +summary_info += {'config directory': config_host['sysconfdir']} +if targetos != 'windows' + summary_info += {'local state directory': config_host['qemu_localstatedir']} + summary_info += {'Manual directory': config_host['mandir']} +else + summary_info += {'local state directory': 'queried at runtime'} +endif +summary_info += {'Build directory': meson.current_build_dir()} +summary_info += {'Source path': meson.current_source_dir()} +summary_info += {'GIT binary': config_host['GIT']} +summary_info += {'GIT submodules': config_host['GIT_SUBMODULES']} +summary_info += {'C compiler': meson.get_compiler('c').cmd_array()[0]} +summary_info += {'Host C compiler': meson.get_compiler('c', native: true).cmd_array()[0]} +if link_language == 'cpp' + summary_info += {'C++ compiler': meson.get_compiler('cpp').cmd_array()[0]} +else + summary_info += {'C++ compiler': false} +endif +if targetos == 'darwin' + summary_info += {'Objective-C compiler': meson.get_compiler('objc').cmd_array()[0]} +endif +summary_info += {'ARFLAGS': config_host['ARFLAGS']} +summary_info += {'CFLAGS': config_host['CFLAGS']} +summary_info += {'QEMU_CFLAGS': config_host['QEMU_CFLAGS']} +summary_info += {'QEMU_LDFLAGS': config_host['QEMU_LDFLAGS']} +summary_info += {'make': config_host['MAKE']} +summary_info += {'install': config_host['INSTALL']} +summary_info += {'python': '@0@ (version: @1@)'.format(python.full_path(), python.language_version())} +summary_info += {'sphinx-build': config_host['SPHINX_BUILD']} +summary_info += {'genisoimage': config_host['GENISOIMAGE']} +# TODO: add back version +summary_info += {'slirp support': config_host.has_key('CONFIG_SLIRP')} +if config_host.has_key('CONFIG_SLIRP') + summary_info += {'smbd': config_host['CONFIG_SMBD_COMMAND']} +endif +summary_info += {'module support': config_host.has_key('CONFIG_MODULES')} +if config_host.has_key('CONFIG_MODULES') + summary_info += {'alternative module path': config_host.has_key('CONFIG_MODULE_UPGRADES')} +endif +summary_info += {'host CPU': cpu} +summary_info += {'host endianness': build_machine.endian()} +summary_info += {'target list': config_host['TARGET_DIRS']} +summary_info += {'gprof enabled': config_host.has_key('CONFIG_GPROF')} +summary_info += {'sparse enabled': meson.get_compiler('c').cmd_array().contains('cgcc')} +summary_info += {'strip binaries': get_option('strip')} +summary_info += {'profiler': config_host.has_key('CONFIG_PROFILER')} +summary_info += {'static build': config_host.has_key('CONFIG_TOOLS')} +if targetos == 'darwin' + summary_info += {'Cocoa support': config_host.has_key('CONFIG_COCOA')} +endif +# TODO: add back version +summary_info += {'SDL support': sdl.found()} +summary_info += {'SDL image support': sdl_image.found()} +# TODO: add back version +summary_info += {'GTK support': config_host.has_key('CONFIG_GTK')} +summary_info += {'GTK GL support': config_host.has_key('CONFIG_GTK_GL')} +# TODO: add back version +summary_info += {'VTE support': config_host.has_key('CONFIG_VTE')} +summary_info += {'TLS priority': config_host['CONFIG_TLS_PRIORITY']} +summary_info += {'GNUTLS support': config_host.has_key('CONFIG_GNUTLS')} +# TODO: add back version +summary_info += {'libgcrypt': config_host.has_key('CONFIG_GCRYPT')} +if config_host.has_key('CONFIG_GCRYPT') + summary_info += {' hmac': config_host.has_key('CONFIG_GCRYPT_HMAC')} + summary_info += {' XTS': not config_host.has_key('CONFIG_QEMU_PRIVATE_XTS')} +endif +# TODO: add back version +summary_info += {'nettle': config_host.has_key('CONFIG_NETTLE')} +if config_host.has_key('CONFIG_NETTLE') + summary_info += {' XTS': not config_host.has_key('CONFIG_QEMU_PRIVATE_XTS')} +endif +summary_info += {'libtasn1': config_host.has_key('CONFIG_TASN1')} +summary_info += {'PAM': config_host.has_key('CONFIG_AUTH_PAM')} +summary_info += {'iconv support': config_host.has_key('CONFIG_ICONV')} +summary_info += {'curses support': config_host.has_key('CONFIG_CURSES')} +# TODO: add back version +summary_info += {'virgl support': config_host.has_key('CONFIG_VIRGL')} +summary_info += {'curl support': config_host.has_key('CONFIG_CURL')} +summary_info += {'mingw32 support': targetos == 'windows'} +summary_info += {'Audio drivers': config_host['CONFIG_AUDIO_DRIVERS']} +summary_info += {'Block whitelist (rw)': config_host['CONFIG_BDRV_RW_WHITELIST']} +summary_info += {'Block whitelist (ro)': config_host['CONFIG_BDRV_RO_WHITELIST']} +summary_info += {'VirtFS support': config_host.has_key('CONFIG_VIRTFS')} +summary_info += {'Multipath support': config_host.has_key('CONFIG_MPATH')} +summary_info += {'VNC support': vnc.found()} +if vnc.found() + summary_info += {'VNC SASL support': sasl.found()} + summary_info += {'VNC JPEG support': jpeg.found()} + summary_info += {'VNC PNG support': png.found()} +endif +summary_info += {'xen support': config_host.has_key('CONFIG_XEN_BACKEND')} +if config_host.has_key('CONFIG_XEN_BACKEND') + summary_info += {'xen ctrl version': config_host['CONFIG_XEN_CTRL_INTERFACE_VERSION']} +endif +summary_info += {'brlapi support': config_host.has_key('CONFIG_BRLAPI')} +summary_info += {'Documentation': config_host.has_key('BUILD_DOCS')} +summary_info += {'PIE': get_option('b_pie')} +summary_info += {'vde support': config_host.has_key('CONFIG_VDE')} +summary_info += {'netmap support': config_host.has_key('CONFIG_NETMAP')} +summary_info += {'Linux AIO support': config_host.has_key('CONFIG_LINUX_AIO')} +summary_info += {'Linux io_uring support': config_host.has_key('CONFIG_LINUX_IO_URING')} +summary_info += {'ATTR/XATTR support': config_host.has_key('CONFIG_ATTR')} +summary_info += {'Install blobs': config_host.has_key('INSTALL_BLOBS')} +# TODO: add back KVM/HAX/HVF/WHPX/TCG +#summary_info += {'KVM support': have_kvm'} +#summary_info += {'HAX support': have_hax'} +#summary_info += {'HVF support': have_hvf'} +#summary_info += {'WHPX support': have_whpx'} +#summary_info += {'TCG support': have_tcg'} +#if get_option('tcg') +# summary_info += {'TCG debug enabled': config_host.has_key('CONFIG_DEBUG_TCG')} +# summary_info += {'TCG interpreter': config_host.has_key('CONFIG_TCG_INTERPRETER')} +#endif +summary_info += {'malloc trim support': config_host.has_key('CONFIG_MALLOC_TRIM')} +summary_info += {'RDMA support': config_host.has_key('CONFIG_RDMA')} +summary_info += {'PVRDMA support': config_host.has_key('CONFIG_PVRDMA')} +summary_info += {'fdt support': config_host.has_key('CONFIG_FDT')} +summary_info += {'membarrier': config_host.has_key('CONFIG_MEMBARRIER')} +summary_info += {'preadv support': config_host.has_key('CONFIG_PREADV')} +summary_info += {'fdatasync': config_host.has_key('CONFIG_FDATASYNC')} +summary_info += {'madvise': config_host.has_key('CONFIG_MADVISE')} +summary_info += {'posix_madvise': config_host.has_key('CONFIG_POSIX_MADVISE')} +summary_info += {'posix_memalign': config_host.has_key('CONFIG_POSIX_MEMALIGN')} +summary_info += {'libcap-ng support': config_host.has_key('CONFIG_LIBCAP_NG')} +summary_info += {'vhost-net support': config_host.has_key('CONFIG_VHOST_NET')} +summary_info += {'vhost-crypto support': config_host.has_key('CONFIG_VHOST_CRYPTO')} +summary_info += {'vhost-scsi support': config_host.has_key('CONFIG_VHOST_SCSI')} +summary_info += {'vhost-vsock support': config_host.has_key('CONFIG_VHOST_VSOCK')} +summary_info += {'vhost-user support': config_host.has_key('CONFIG_VHOST_KERNEL')} +summary_info += {'vhost-user-fs support': config_host.has_key('CONFIG_VHOST_USER_FS')} +summary_info += {'vhost-vdpa support': config_host.has_key('CONFIG_VHOST_VDPA')} +summary_info += {'Trace backends': config_host['TRACE_BACKENDS']} +if config_host['TRACE_BACKENDS'].split().contains('simple') + summary_info += {'Trace output file': config_host['CONFIG_TRACE_FILE'] + '-<pid>'} +endif +# TODO: add back protocol and server version +summary_info += {'spice support': config_host.has_key('CONFIG_SPICE')} +summary_info += {'rbd support': config_host.has_key('CONFIG_RBD')} +summary_info += {'xfsctl support': config_host.has_key('CONFIG_XFS')} +summary_info += {'smartcard support': config_host.has_key('CONFIG_SMARTCARD')} +summary_info += {'libusb': config_host.has_key('CONFIG_USB_LIBUSB')} +summary_info += {'usb net redir': config_host.has_key('CONFIG_USB_REDIR')} +summary_info += {'OpenGL support': config_host.has_key('CONFIG_OPENGL')} +summary_info += {'OpenGL dmabufs': config_host.has_key('CONFIG_OPENGL_DMABUF')} +summary_info += {'libiscsi support': config_host.has_key('CONFIG_LIBISCSI')} +summary_info += {'libnfs support': config_host.has_key('CONFIG_LIBNFS')} +summary_info += {'build guest agent': config_host.has_key('CONFIG_GUEST_AGENT')} +if targetos == 'windows' + if 'WIN_SDK' in config_host + summary_info += {'Windows SDK': config_host['WIN_SDK']} + endif + summary_info += {'QGA VSS support': config_host.has_key('CONFIG_QGA_VSS')} + summary_info += {'QGA w32 disk info': config_host.has_key('CONFIG_QGA_NTDDSCSI')} + summary_info += {'QGA MSI support': config_host.has_key('CONFIG_QGA_MSI_ENABLED')} +endif +summary_info += {'seccomp support': config_host.has_key('CONFIG_SECCOMP')} +summary_info += {'coroutine backend': config_host['CONFIG_COROUTINE_BACKEND']} +summary_info += {'coroutine pool': config_host['CONFIG_COROUTINE_POOL'] == '1'} +summary_info += {'debug stack usage': config_host.has_key('CONFIG_DEBUG_STACK_USAGE')} +summary_info += {'mutex debugging': config_host.has_key('CONFIG_DEBUG_MUTEX')} +summary_info += {'crypto afalg': config_host.has_key('CONFIG_AF_ALG')} +summary_info += {'GlusterFS support': config_host.has_key('CONFIG_GLUSTERFS')} +summary_info += {'gcov': get_option('b_coverage')} +summary_info += {'TPM support': config_host.has_key('CONFIG_TPM')} +summary_info += {'libssh support': config_host.has_key('CONFIG_LIBSSH')} +summary_info += {'QOM debugging': config_host.has_key('CONFIG_QOM_CAST_DEBUG')} +summary_info += {'Live block migration': config_host.has_key('CONFIG_LIVE_BLOCK_MIGRATION')} +summary_info += {'lzo support': config_host.has_key('CONFIG_LZO')} +summary_info += {'snappy support': config_host.has_key('CONFIG_SNAPPY')} +summary_info += {'bzip2 support': config_host.has_key('CONFIG_BZIP2')} +summary_info += {'lzfse support': config_host.has_key('CONFIG_LZFSE')} +summary_info += {'zstd support': config_host.has_key('CONFIG_ZSTD')} +summary_info += {'NUMA host support': config_host.has_key('CONFIG_NUMA')} +summary_info += {'libxml2': config_host.has_key('CONFIG_LIBXML2')} +summary_info += {'tcmalloc support': config_host.has_key('CONFIG_TCMALLOC')} +summary_info += {'jemalloc support': config_host.has_key('CONFIG_JEMALLOC')} +summary_info += {'avx2 optimization': config_host.has_key('CONFIG_AVX2_OPT')} +summary_info += {'avx512f optimization': config_host.has_key('CONFIG_AVX512F_OPT')} +summary_info += {'replication support': config_host.has_key('CONFIG_REPLICATION')} +summary_info += {'bochs support': config_host.has_key('CONFIG_BOCHS')} +summary_info += {'cloop support': config_host.has_key('CONFIG_CLOOP')} +summary_info += {'dmg support': config_host.has_key('CONFIG_DMG')} +summary_info += {'qcow v1 support': config_host.has_key('CONFIG_QCOW1')} +summary_info += {'vdi support': config_host.has_key('CONFIG_VDI')} +summary_info += {'vvfat support': config_host.has_key('CONFIG_VVFAT')} +summary_info += {'qed support': config_host.has_key('CONFIG_QED')} +summary_info += {'parallels support': config_host.has_key('CONFIG_PARALLELS')} +summary_info += {'sheepdog support': config_host.has_key('CONFIG_SHEEPDOG')} +summary_info += {'capstone': config_host.has_key('CONFIG_CAPSTONE')} +summary_info += {'libpmem support': config_host.has_key('CONFIG_LIBPMEM')} +summary_info += {'libdaxctl support': config_host.has_key('CONFIG_LIBDAXCTL')} +summary_info += {'libudev': config_host.has_key('CONFIG_LIBUDEV')} +summary_info += {'default devices': config_host['CONFIG_MINIKCONF_MODE'] == '--defconfig'} +summary_info += {'plugin support': config_host.has_key('CONFIG_PLUGIN')} +summary_info += {'fuzzing support': config_host.has_key('CONFIG_FUZZ')} +if config_host.has_key('HAVE_GDB_BIN') + summary_info += {'gdb': config_host['HAVE_GDB_BIN']} +endif +summary_info += {'thread sanitizer': config_host.has_key('CONFIG_TSAN')} +summary_info += {'rng-none': config_host.has_key('CONFIG_RNG_NONE')} +summary_info += {'Linux keyring': config_host.has_key('CONFIG_SECRET_KEYRING')} +summary(summary_info, bool_yn: true) + +if not supported_cpus.contains(cpu) + message() + warning('SUPPORT FOR THIS HOST CPU WILL GO AWAY IN FUTURE RELEASES!') + message() + message('CPU host architecture ' + cpu + ' support is not currently maintained.') + message('The QEMU project intends to remove support for this host CPU in') + message('a future release if nobody volunteers to maintain it and to') + message('provide a build host for our continuous integration setup.') + message('configure has succeeded and you can continue to build, but') + message('if you care about QEMU on this platform you should contact') + message('us upstream at qemu-devel@nongnu.org.') +endif + +if not supported_oses.contains(targetos) + message() + warning('WARNING: SUPPORT FOR THIS HOST OS WILL GO AWAY IN FUTURE RELEASES!') + message() + message('Host OS ' + targetos + 'support is not currently maintained.') + message('The QEMU project intends to remove support for this host OS in') + message('a future release if nobody volunteers to maintain it and to') + message('provide a build host for our continuous integration setup.') + message('configure has succeeded and you can continue to build, but') + message('if you care about QEMU on this platform you should contact') + message('us upstream at qemu-devel@nongnu.org.') +endif diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000000..e5f45243ce --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,7 @@ +option('gettext', type : 'boolean', value : true) +option('sdl', type : 'feature', value : 'auto') +option('sdl_image', type : 'feature', value : 'auto') +option('vnc', type : 'feature', value : 'enabled') +option('vnc_jpeg', type : 'feature', value : 'auto') +option('vnc_png', type : 'feature', value : 'auto') +option('vnc_sasl', type : 'feature', value : 'auto') diff --git a/migration/Makefile.objs b/migration/Makefile.objs deleted file mode 100644 index 0fc619e380..0000000000 --- a/migration/Makefile.objs +++ /dev/null @@ -1,18 +0,0 @@ -common-obj-y += migration.o socket.o fd.o exec.o -common-obj-y += tls.o channel.o savevm.o -common-obj-y += colo.o colo-failover.o -common-obj-y += vmstate.o vmstate-types.o page_cache.o -common-obj-y += qemu-file.o global_state.o -common-obj-y += qemu-file-channel.o -common-obj-y += xbzrle.o postcopy-ram.o -common-obj-y += qjson.o -common-obj-y += block-dirty-bitmap.o -common-obj-y += multifd.o -common-obj-y += multifd-zlib.o -common-obj-$(CONFIG_ZSTD) += multifd-zstd.o - -common-obj-$(CONFIG_RDMA) += rdma.o - -common-obj-$(CONFIG_LIVE_BLOCK_MIGRATION) += block.o - -rdma.o-libs := $(RDMA_LIBS) diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c index 784330ebe1..549e14daba 100644 --- a/migration/block-dirty-bitmap.c +++ b/migration/block-dirty-bitmap.c @@ -29,10 +29,10 @@ * * # Header (shared for different chunk types) * 1, 2 or 4 bytes: flags (see qemu_{put,put}_flags) - * [ 1 byte: node name size ] \ flags & DEVICE_NAME - * [ n bytes: node name ] / - * [ 1 byte: bitmap name size ] \ flags & BITMAP_NAME - * [ n bytes: bitmap name ] / + * [ 1 byte: node alias size ] \ flags & DEVICE_NAME + * [ n bytes: node alias ] / + * [ 1 byte: bitmap alias size ] \ flags & BITMAP_NAME + * [ n bytes: bitmap alias ] / * * # Start of bitmap migration (flags & START) * header @@ -72,7 +72,9 @@ #include "migration/register.h" #include "qemu/hbitmap.h" #include "qemu/cutils.h" +#include "qemu/id.h" #include "qapi/error.h" +#include "qapi/qapi-commands-migration.h" #include "trace.h" #define CHUNK_SIZE (1 << 10) @@ -104,7 +106,8 @@ typedef struct SaveBitmapState { /* Written during setup phase. */ BlockDriverState *bs; - const char *node_name; + char *node_alias; + char *bitmap_alias; BdrvDirtyBitmap *bitmap; uint64_t total_sectors; uint64_t sectors_per_chunk; @@ -138,8 +141,9 @@ typedef struct LoadBitmapState { /* State of the dirty bitmap migration (DBM) during load process */ typedef struct DBMLoadState { uint32_t flags; - char node_name[256]; - char bitmap_name[256]; + char node_alias[256]; + char bitmap_alias[256]; + char bitmap_name[BDRV_BITMAP_MAX_NAME_SIZE + 1]; BlockDriverState *bs; BdrvDirtyBitmap *bitmap; @@ -165,6 +169,188 @@ typedef struct DBMState { static DBMState dbm_state; +/* For hash tables that map node/bitmap names to aliases */ +typedef struct AliasMapInnerNode { + char *string; + GHashTable *subtree; +} AliasMapInnerNode; + +static void free_alias_map_inner_node(void *amin_ptr) +{ + AliasMapInnerNode *amin = amin_ptr; + + g_free(amin->string); + g_hash_table_unref(amin->subtree); + g_free(amin); +} + +/** + * Construct an alias map based on the given QMP structure. + * + * (Note that we cannot store such maps in the MigrationParameters + * object, because that struct is defined by the QAPI schema, which + * makes it basically impossible to have dicts with arbitrary keys. + * Therefore, we instead have to construct these maps when migration + * starts.) + * + * @bbm is the block_bitmap_mapping from the migration parameters. + * + * If @name_to_alias is true, the returned hash table will map node + * and bitmap names to their respective aliases (for outgoing + * migration). + * + * If @name_to_alias is false, the returned hash table will map node + * and bitmap aliases to their respective names (for incoming + * migration). + * + * The hash table maps node names/aliases to AliasMapInnerNode + * objects, whose .string is the respective node alias/name, and whose + * .subtree table maps bitmap names/aliases to the respective bitmap + * alias/name. + */ +static GHashTable *construct_alias_map(const BitmapMigrationNodeAliasList *bbm, + bool name_to_alias, + Error **errp) +{ + GHashTable *alias_map; + size_t max_node_name_len = sizeof_field(BlockDriverState, node_name) - 1; + + alias_map = g_hash_table_new_full(g_str_hash, g_str_equal, + g_free, free_alias_map_inner_node); + + for (; bbm; bbm = bbm->next) { + const BitmapMigrationNodeAlias *bmna = bbm->value; + const BitmapMigrationBitmapAliasList *bmbal; + AliasMapInnerNode *amin; + GHashTable *bitmaps_map; + const char *node_map_from, *node_map_to; + + if (!id_wellformed(bmna->alias)) { + error_setg(errp, "The node alias '%s' is not well-formed", + bmna->alias); + goto fail; + } + + if (strlen(bmna->alias) > UINT8_MAX) { + error_setg(errp, "The node alias '%s' is longer than %u bytes", + bmna->alias, UINT8_MAX); + goto fail; + } + + if (strlen(bmna->node_name) > max_node_name_len) { + error_setg(errp, "The node name '%s' is longer than %zu bytes", + bmna->node_name, max_node_name_len); + goto fail; + } + + if (name_to_alias) { + if (g_hash_table_contains(alias_map, bmna->node_name)) { + error_setg(errp, "The node name '%s' is mapped twice", + bmna->node_name); + goto fail; + } + + node_map_from = bmna->node_name; + node_map_to = bmna->alias; + } else { + if (g_hash_table_contains(alias_map, bmna->alias)) { + error_setg(errp, "The node alias '%s' is used twice", + bmna->alias); + goto fail; + } + + node_map_from = bmna->alias; + node_map_to = bmna->node_name; + } + + bitmaps_map = g_hash_table_new_full(g_str_hash, g_str_equal, + g_free, g_free); + + amin = g_new(AliasMapInnerNode, 1); + *amin = (AliasMapInnerNode){ + .string = g_strdup(node_map_to), + .subtree = bitmaps_map, + }; + + g_hash_table_insert(alias_map, g_strdup(node_map_from), amin); + + for (bmbal = bmna->bitmaps; bmbal; bmbal = bmbal->next) { + const BitmapMigrationBitmapAlias *bmba = bmbal->value; + const char *bmap_map_from, *bmap_map_to; + + if (strlen(bmba->alias) > UINT8_MAX) { + error_setg(errp, + "The bitmap alias '%s' is longer than %u bytes", + bmba->alias, UINT8_MAX); + goto fail; + } + + if (strlen(bmba->name) > BDRV_BITMAP_MAX_NAME_SIZE) { + error_setg(errp, "The bitmap name '%s' is longer than %d bytes", + bmba->name, BDRV_BITMAP_MAX_NAME_SIZE); + goto fail; + } + + if (name_to_alias) { + bmap_map_from = bmba->name; + bmap_map_to = bmba->alias; + + if (g_hash_table_contains(bitmaps_map, bmba->name)) { + error_setg(errp, "The bitmap '%s'/'%s' is mapped twice", + bmna->node_name, bmba->name); + goto fail; + } + } else { + bmap_map_from = bmba->alias; + bmap_map_to = bmba->name; + + if (g_hash_table_contains(bitmaps_map, bmba->alias)) { + error_setg(errp, "The bitmap alias '%s'/'%s' is used twice", + bmna->alias, bmba->alias); + goto fail; + } + } + + g_hash_table_insert(bitmaps_map, + g_strdup(bmap_map_from), g_strdup(bmap_map_to)); + } + } + + return alias_map; + +fail: + g_hash_table_destroy(alias_map); + return NULL; +} + +/** + * Run construct_alias_map() in both directions to check whether @bbm + * is valid. + * (This function is to be used by migration/migration.c to validate + * the user-specified block-bitmap-mapping migration parameter.) + * + * Returns true if and only if the mapping is valid. + */ +bool check_dirty_bitmap_mig_alias_map(const BitmapMigrationNodeAliasList *bbm, + Error **errp) +{ + GHashTable *alias_map; + + alias_map = construct_alias_map(bbm, true, errp); + if (!alias_map) { + return false; + } + g_hash_table_destroy(alias_map); + + alias_map = construct_alias_map(bbm, false, errp); + if (!alias_map) { + return false; + } + g_hash_table_destroy(alias_map); + + return true; +} + static uint32_t qemu_get_bitmap_flags(QEMUFile *f) { uint8_t flags = qemu_get_byte(f); @@ -207,11 +393,11 @@ static void send_bitmap_header(QEMUFile *f, DBMSaveState *s, qemu_put_bitmap_flags(f, flags); if (flags & DIRTY_BITMAP_MIG_FLAG_DEVICE_NAME) { - qemu_put_counted_string(f, dbms->node_name); + qemu_put_counted_string(f, dbms->node_alias); } if (flags & DIRTY_BITMAP_MIG_FLAG_BITMAP_NAME) { - qemu_put_counted_string(f, bdrv_dirty_bitmap_name(bitmap)); + qemu_put_counted_string(f, dbms->bitmap_alias); } } @@ -282,18 +468,25 @@ static void dirty_bitmap_do_save_cleanup(DBMSaveState *s) QSIMPLEQ_REMOVE_HEAD(&s->dbms_list, entry); bdrv_dirty_bitmap_set_busy(dbms->bitmap, false); bdrv_unref(dbms->bs); + g_free(dbms->node_alias); + g_free(dbms->bitmap_alias); g_free(dbms); } } /* Called with iothread lock taken. */ static int add_bitmaps_to_list(DBMSaveState *s, BlockDriverState *bs, - const char *bs_name) + const char *bs_name, GHashTable *alias_map) { BdrvDirtyBitmap *bitmap; SaveBitmapState *dbms; + GHashTable *bitmap_aliases; + const char *node_alias, *bitmap_name, *bitmap_alias; Error *local_err = NULL; + /* When an alias map is given, @bs_name must be @bs's node name */ + assert(!alias_map || !strcmp(bs_name, bdrv_get_node_name(bs))); + FOR_EACH_DIRTY_BITMAP(bs, bitmap) { if (bdrv_dirty_bitmap_name(bitmap)) { break; @@ -303,21 +496,39 @@ static int add_bitmaps_to_list(DBMSaveState *s, BlockDriverState *bs, return 0; } + bitmap_name = bdrv_dirty_bitmap_name(bitmap); + if (!bs_name || strcmp(bs_name, "") == 0) { error_report("Bitmap '%s' in unnamed node can't be migrated", - bdrv_dirty_bitmap_name(bitmap)); + bitmap_name); return -1; } - if (bs_name[0] == '#') { + if (alias_map) { + const AliasMapInnerNode *amin = g_hash_table_lookup(alias_map, bs_name); + + if (!amin) { + /* Skip bitmaps on nodes with no alias */ + return 0; + } + + node_alias = amin->string; + bitmap_aliases = amin->subtree; + } else { + node_alias = bs_name; + bitmap_aliases = NULL; + } + + if (node_alias[0] == '#') { error_report("Bitmap '%s' in a node with auto-generated " "name '%s' can't be migrated", - bdrv_dirty_bitmap_name(bitmap), bs_name); + bitmap_name, node_alias); return -1; } FOR_EACH_DIRTY_BITMAP(bs, bitmap) { - if (!bdrv_dirty_bitmap_name(bitmap)) { + bitmap_name = bdrv_dirty_bitmap_name(bitmap); + if (!bitmap_name) { continue; } @@ -326,12 +537,29 @@ static int add_bitmaps_to_list(DBMSaveState *s, BlockDriverState *bs, return -1; } + if (bitmap_aliases) { + bitmap_alias = g_hash_table_lookup(bitmap_aliases, bitmap_name); + if (!bitmap_alias) { + /* Skip bitmaps with no alias */ + continue; + } + } else { + if (strlen(bitmap_name) > UINT8_MAX) { + error_report("Cannot migrate bitmap '%s' on node '%s': " + "Name is longer than %u bytes", + bitmap_name, bs_name, UINT8_MAX); + return -1; + } + bitmap_alias = bitmap_name; + } + bdrv_ref(bs); bdrv_dirty_bitmap_set_busy(bitmap, true); dbms = g_new0(SaveBitmapState, 1); dbms->bs = bs; - dbms->node_name = bs_name; + dbms->node_alias = g_strdup(node_alias); + dbms->bitmap_alias = g_strdup(bitmap_alias); dbms->bitmap = bitmap; dbms->total_sectors = bdrv_nb_sectors(bs); dbms->sectors_per_chunk = CHUNK_SIZE * 8 * @@ -356,43 +584,52 @@ static int init_dirty_bitmap_migration(DBMSaveState *s) SaveBitmapState *dbms; GHashTable *handled_by_blk = g_hash_table_new(NULL, NULL); BlockBackend *blk; + const MigrationParameters *mig_params = &migrate_get_current()->parameters; + GHashTable *alias_map = NULL; + + if (mig_params->has_block_bitmap_mapping) { + alias_map = construct_alias_map(mig_params->block_bitmap_mapping, true, + &error_abort); + } s->bulk_completed = false; s->prev_bs = NULL; s->prev_bitmap = NULL; s->no_bitmaps = false; - /* - * Use blockdevice name for direct (or filtered) children of named block - * backends. - */ - for (blk = blk_next(NULL); blk; blk = blk_next(blk)) { - const char *name = blk_name(blk); - - if (!name || strcmp(name, "") == 0) { - continue; - } + if (!alias_map) { + /* + * Use blockdevice name for direct (or filtered) children of named block + * backends. + */ + for (blk = blk_next(NULL); blk; blk = blk_next(blk)) { + const char *name = blk_name(blk); - bs = blk_bs(blk); + if (!name || strcmp(name, "") == 0) { + continue; + } - /* Skip filters without bitmaps */ - while (bs && bs->drv && bs->drv->is_filter && - !bdrv_has_named_bitmaps(bs)) - { - if (bs->backing) { - bs = bs->backing->bs; - } else if (bs->file) { - bs = bs->file->bs; - } else { - bs = NULL; + bs = blk_bs(blk); + + /* Skip filters without bitmaps */ + while (bs && bs->drv && bs->drv->is_filter && + !bdrv_has_named_bitmaps(bs)) + { + if (bs->backing) { + bs = bs->backing->bs; + } else if (bs->file) { + bs = bs->file->bs; + } else { + bs = NULL; + } } - } - if (bs && bs->drv && !bs->drv->is_filter) { - if (add_bitmaps_to_list(s, bs, name)) { - goto fail; + if (bs && bs->drv && !bs->drv->is_filter) { + if (add_bitmaps_to_list(s, bs, name, NULL)) { + goto fail; + } + g_hash_table_add(handled_by_blk, bs); } - g_hash_table_add(handled_by_blk, bs); } } @@ -401,7 +638,7 @@ static int init_dirty_bitmap_migration(DBMSaveState *s) continue; } - if (add_bitmaps_to_list(s, bs, bdrv_get_node_name(bs))) { + if (add_bitmaps_to_list(s, bs, bdrv_get_node_name(bs), alias_map)) { goto fail; } } @@ -416,11 +653,17 @@ static int init_dirty_bitmap_migration(DBMSaveState *s) } g_hash_table_destroy(handled_by_blk); + if (alias_map) { + g_hash_table_destroy(alias_map); + } return 0; fail: g_hash_table_destroy(handled_by_blk); + if (alias_map) { + g_hash_table_destroy(alias_map); + } dirty_bitmap_do_save_cleanup(s); return -1; @@ -770,8 +1013,10 @@ static int dirty_bitmap_load_bits(QEMUFile *f, DBMLoadState *s) return 0; } -static int dirty_bitmap_load_header(QEMUFile *f, DBMLoadState *s) +static int dirty_bitmap_load_header(QEMUFile *f, DBMLoadState *s, + GHashTable *alias_map) { + GHashTable *bitmap_alias_map = NULL; Error *local_err = NULL; bool nothing; s->flags = qemu_get_bitmap_flags(f); @@ -780,28 +1025,75 @@ static int dirty_bitmap_load_header(QEMUFile *f, DBMLoadState *s) nothing = s->flags == (s->flags & DIRTY_BITMAP_MIG_FLAG_EOS); if (s->flags & DIRTY_BITMAP_MIG_FLAG_DEVICE_NAME) { - if (!qemu_get_counted_string(f, s->node_name)) { - error_report("Unable to read node name string"); + if (!qemu_get_counted_string(f, s->node_alias)) { + error_report("Unable to read node alias string"); return -EINVAL; } + if (!s->cancelled) { - s->bs = bdrv_lookup_bs(s->node_name, s->node_name, &local_err); + if (alias_map) { + const AliasMapInnerNode *amin; + + amin = g_hash_table_lookup(alias_map, s->node_alias); + if (!amin) { + error_setg(&local_err, "Error: Unknown node alias '%s'", + s->node_alias); + s->bs = NULL; + } else { + bitmap_alias_map = amin->subtree; + s->bs = bdrv_lookup_bs(NULL, amin->string, &local_err); + } + } else { + s->bs = bdrv_lookup_bs(s->node_alias, s->node_alias, + &local_err); + } if (!s->bs) { error_report_err(local_err); cancel_incoming_locked(s); } } - } else if (!s->bs && !nothing && !s->cancelled) { + } else if (s->bs) { + if (alias_map) { + const AliasMapInnerNode *amin; + + /* Must be present in the map, or s->bs would not be set */ + amin = g_hash_table_lookup(alias_map, s->node_alias); + assert(amin != NULL); + + bitmap_alias_map = amin->subtree; + } + } else if (!nothing && !s->cancelled) { error_report("Error: block device name is not set"); cancel_incoming_locked(s); } + assert(nothing || s->cancelled || !!alias_map == !!bitmap_alias_map); + if (s->flags & DIRTY_BITMAP_MIG_FLAG_BITMAP_NAME) { - if (!qemu_get_counted_string(f, s->bitmap_name)) { - error_report("Unable to read bitmap name string"); + const char *bitmap_name; + + if (!qemu_get_counted_string(f, s->bitmap_alias)) { + error_report("Unable to read bitmap alias string"); return -EINVAL; } + + if (!s->cancelled) { + if (bitmap_alias_map) { + bitmap_name = g_hash_table_lookup(bitmap_alias_map, + s->bitmap_alias); + if (!bitmap_name) { + error_report("Error: Unknown bitmap alias '%s' on node " + "'%s' (alias '%s')", s->bitmap_alias, + s->bs->node_name, s->node_alias); + cancel_incoming_locked(s); + } + } else { + bitmap_name = s->bitmap_alias; + } + } + if (!s->cancelled) { + g_strlcpy(s->bitmap_name, bitmap_name, sizeof(s->bitmap_name)); s->bitmap = bdrv_find_dirty_bitmap(s->bs, s->bitmap_name); /* @@ -811,7 +1103,7 @@ static int dirty_bitmap_load_header(QEMUFile *f, DBMLoadState *s) if (!s->bitmap && !(s->flags & DIRTY_BITMAP_MIG_FLAG_START)) { error_report("Error: unknown dirty bitmap " "'%s' for block device '%s'", - s->bitmap_name, s->node_name); + s->bitmap_name, s->bs->node_name); cancel_incoming_locked(s); } } @@ -835,6 +1127,8 @@ static int dirty_bitmap_load_header(QEMUFile *f, DBMLoadState *s) */ static int dirty_bitmap_load(QEMUFile *f, void *opaque, int version_id) { + GHashTable *alias_map = NULL; + const MigrationParameters *mig_params = &migrate_get_current()->parameters; DBMLoadState *s = &((DBMState *)opaque)->load; int ret = 0; @@ -846,13 +1140,18 @@ static int dirty_bitmap_load(QEMUFile *f, void *opaque, int version_id) return -EINVAL; } + if (mig_params->has_block_bitmap_mapping) { + alias_map = construct_alias_map(mig_params->block_bitmap_mapping, + false, &error_abort); + } + do { QEMU_LOCK_GUARD(&s->lock); - ret = dirty_bitmap_load_header(f, s); + ret = dirty_bitmap_load_header(f, s, alias_map); if (ret < 0) { cancel_incoming_locked(s); - return ret; + goto fail; } if (s->flags & DIRTY_BITMAP_MIG_FLAG_START) { @@ -869,12 +1168,17 @@ static int dirty_bitmap_load(QEMUFile *f, void *opaque, int version_id) if (ret) { cancel_incoming_locked(s); - return ret; + goto fail; } } while (!(s->flags & DIRTY_BITMAP_MIG_FLAG_EOS)); trace_dirty_bitmap_load_success(); - return 0; + ret = 0; +fail: + if (alias_map) { + g_hash_table_destroy(alias_map); + } + return ret; } static int dirty_bitmap_save_setup(QEMUFile *f, void *opaque) diff --git a/migration/meson.build b/migration/meson.build new file mode 100644 index 0000000000..ac8ff1419f --- /dev/null +++ b/migration/meson.build @@ -0,0 +1,40 @@ +# Files needed by unit tests +migration_files = files( + 'page_cache.c', + 'xbzrle.c', + 'vmstate-types.c', + 'vmstate.c', + 'qemu-file-channel.c', + 'qemu-file.c', + 'qjson.c', +) + +libmigration = static_library('migration', sources: migration_files + genh, + name_suffix: 'fa', + build_by_default: false) +migration = declare_dependency(link_with: libmigration, + dependencies: [zlib, qom, io]) +softmmu_ss.add(migration) + +softmmu_ss.add(files( + 'block-dirty-bitmap.c', + 'channel.c', + 'colo-failover.c', + 'colo.c', + 'exec.c', + 'fd.c', + 'global_state.c', + 'migration.c', + 'multifd.c', + 'multifd-zlib.c', + 'postcopy-ram.c', + 'savevm.c', + 'socket.c', + 'tls.c', +)) + +softmmu_ss.add(when: ['CONFIG_RDMA', rdma], if_true: files('rdma.c')) +softmmu_ss.add(when: 'CONFIG_LIVE_BLOCK_MIGRATION', if_true: files('block.c')) +softmmu_ss.add(when: 'CONFIG_ZSTD', if_true: [files('multifd-zstd.c'), zstd]) + +specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: files('ram.c')) diff --git a/migration/migration.c b/migration/migration.c index 8fe36339db..dbd4afa1e8 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -36,6 +36,7 @@ #include "block/block.h" #include "qapi/error.h" #include "qapi/clone-visitor.h" +#include "qapi/qapi-visit-migration.h" #include "qapi/qapi-visit-sockets.h" #include "qapi/qapi-commands-migration.h" #include "qapi/qapi-events-migration.h" @@ -843,6 +844,13 @@ MigrationParameters *qmp_query_migrate_parameters(Error **errp) params->has_announce_step = true; params->announce_step = s->parameters.announce_step; + if (s->parameters.has_block_bitmap_mapping) { + params->has_block_bitmap_mapping = true; + params->block_bitmap_mapping = + QAPI_CLONE(BitmapMigrationNodeAliasList, + s->parameters.block_bitmap_mapping); + } + return params; } @@ -1308,6 +1316,13 @@ static bool migrate_params_check(MigrationParameters *params, Error **errp) "is invalid, it must be in the range of 1 to 10000 ms"); return false; } + + if (params->has_block_bitmap_mapping && + !check_dirty_bitmap_mig_alias_map(params->block_bitmap_mapping, errp)) { + error_prepend(errp, "Invalid mapping given for block-bitmap-mapping: "); + return false; + } + return true; } @@ -1402,6 +1417,11 @@ static void migrate_params_test_apply(MigrateSetParameters *params, if (params->has_announce_step) { dest->announce_step = params->announce_step; } + + if (params->has_block_bitmap_mapping) { + dest->has_block_bitmap_mapping = true; + dest->block_bitmap_mapping = params->block_bitmap_mapping; + } } static void migrate_params_apply(MigrateSetParameters *params, Error **errp) @@ -1514,6 +1534,16 @@ static void migrate_params_apply(MigrateSetParameters *params, Error **errp) if (params->has_announce_step) { s->parameters.announce_step = params->announce_step; } + + if (params->has_block_bitmap_mapping) { + qapi_free_BitmapMigrationNodeAliasList( + s->parameters.block_bitmap_mapping); + + s->parameters.has_block_bitmap_mapping = true; + s->parameters.block_bitmap_mapping = + QAPI_CLONE(BitmapMigrationNodeAliasList, + params->block_bitmap_mapping); + } } void qmp_migrate_set_parameters(MigrateSetParameters *params, Error **errp) diff --git a/migration/migration.h b/migration/migration.h index 6c6a931d0d..2ed55c4aef 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -337,6 +337,9 @@ void migrate_send_rp_resume_ack(MigrationIncomingState *mis, uint32_t value); void dirty_bitmap_mig_before_vm_start(void); void dirty_bitmap_mig_cancel_outgoing(void); void dirty_bitmap_mig_cancel_incoming(void); +bool check_dirty_bitmap_mig_alias_map(const BitmapMigrationNodeAliasList *bbm, + Error **errp); + void migrate_add_address(SocketAddress *address); int foreach_not_ignored_block(RAMBlockIterFunc func, void *opaque); diff --git a/migration/trace.h b/migration/trace.h new file mode 100644 index 0000000000..e1a0f4fb74 --- /dev/null +++ b/migration/trace.h @@ -0,0 +1 @@ +#include "trace/trace-migration.h" diff --git a/monitor/Makefile.objs b/monitor/Makefile.objs deleted file mode 100644 index a8533c9dd7..0000000000 --- a/monitor/Makefile.objs +++ /dev/null @@ -1,6 +0,0 @@ -obj-y += misc.o -common-obj-y += monitor.o qmp.o hmp.o -common-obj-y += qmp-cmds.o qmp-cmds-control.o -common-obj-y += hmp-cmds.o - -storage-daemon-obj-y += monitor.o qmp.o qmp-cmds-control.o diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index ae4b6a4246..7711726fd2 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -469,6 +469,32 @@ void hmp_info_migrate_parameters(Monitor *mon, const QDict *qdict) monitor_printf(mon, "%s: '%s'\n", MigrationParameter_str(MIGRATION_PARAMETER_TLS_AUTHZ), params->tls_authz); + + if (params->has_block_bitmap_mapping) { + const BitmapMigrationNodeAliasList *bmnal; + + monitor_printf(mon, "%s:\n", + MigrationParameter_str( + MIGRATION_PARAMETER_BLOCK_BITMAP_MAPPING)); + + for (bmnal = params->block_bitmap_mapping; + bmnal; + bmnal = bmnal->next) + { + const BitmapMigrationNodeAlias *bmna = bmnal->value; + const BitmapMigrationBitmapAliasList *bmbal; + + monitor_printf(mon, " '%s' -> '%s'\n", + bmna->node_name, bmna->alias); + + for (bmbal = bmna->bitmaps; bmbal; bmbal = bmbal->next) { + const BitmapMigrationBitmapAlias *bmba = bmbal->value; + + monitor_printf(mon, " '%s' -> '%s'\n", + bmba->name, bmba->alias); + } + } + } } qapi_free_MigrationParameters(params); @@ -1384,6 +1410,10 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict) p->has_announce_step = true; visit_type_size(v, param, &p->announce_step, &err); break; + case MIGRATION_PARAMETER_BLOCK_BITMAP_MAPPING: + error_setg(&err, "The block-bitmap-mapping parameter can only be set " + "through QMP"); + break; default: assert(0); } diff --git a/monitor/meson.build b/monitor/meson.build new file mode 100644 index 0000000000..0484a64341 --- /dev/null +++ b/monitor/meson.build @@ -0,0 +1,9 @@ +qmp_ss.add(files('monitor.c', 'qmp.c', 'qmp-cmds-control.c')) + +softmmu_ss.add(files( + 'hmp-cmds.c', + 'hmp.c', + 'qmp-cmds.c', +)) + +specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: files('misc.c')) diff --git a/monitor/trace.h b/monitor/trace.h new file mode 100644 index 0000000000..f216e31be5 --- /dev/null +++ b/monitor/trace.h @@ -0,0 +1 @@ +#include "trace/trace-monitor.h" diff --git a/nbd/Makefile.objs b/nbd/Makefile.objs deleted file mode 100644 index eb3dd4461d..0000000000 --- a/nbd/Makefile.objs +++ /dev/null @@ -1 +0,0 @@ -block-obj-y += server.o client.o common.o diff --git a/nbd/meson.build b/nbd/meson.build new file mode 100644 index 0000000000..0c00a776d3 --- /dev/null +++ b/nbd/meson.build @@ -0,0 +1,5 @@ +block_ss.add(files( + 'client.c', + 'common.c', + 'server.c', +)) diff --git a/nbd/trace.h b/nbd/trace.h new file mode 100644 index 0000000000..233d08fdd1 --- /dev/null +++ b/nbd/trace.h @@ -0,0 +1 @@ +#include "trace/trace-nbd.h" diff --git a/net/Makefile.objs b/net/Makefile.objs deleted file mode 100644 index 5ab45545db..0000000000 --- a/net/Makefile.objs +++ /dev/null @@ -1,32 +0,0 @@ -common-obj-y = net.o queue.o checksum.o util.o hub.o -common-obj-y += socket.o -common-obj-y += dump.o -common-obj-y += eth.o -common-obj-y += announce.o -common-obj-$(CONFIG_L2TPV3) += l2tpv3.o -common-obj-$(call land,$(CONFIG_VIRTIO_NET),$(CONFIG_VHOST_NET_USER)) += vhost-user.o -common-obj-$(call land,$(call lnot,$(CONFIG_VIRTIO_NET)),$(CONFIG_VHOST_NET_USER)) += vhost-user-stub.o -common-obj-$(CONFIG_ALL) += vhost-user-stub.o -common-obj-$(CONFIG_SLIRP) += slirp.o -slirp.o-cflags := $(SLIRP_CFLAGS) -slirp.o-libs := $(SLIRP_LIBS) -common-obj-$(CONFIG_VDE) += vde.o -common-obj-$(CONFIG_NETMAP) += netmap.o -common-obj-y += filter.o -common-obj-y += filter-buffer.o -common-obj-y += filter-mirror.o -common-obj-y += colo-compare.o -common-obj-y += colo.o -common-obj-y += filter-rewriter.o -common-obj-y += filter-replay.o - -tap-obj-$(CONFIG_LINUX) = tap-linux.o -tap-obj-$(CONFIG_BSD) = tap-bsd.o -tap-obj-$(CONFIG_SOLARIS) = tap-solaris.o -tap-obj-y ?= tap-stub.o -common-obj-$(CONFIG_POSIX) += tap.o $(tap-obj-y) -common-obj-$(CONFIG_WIN32) += tap-win32.o -common-obj-$(CONFIG_VHOST_NET_VDPA) += vhost-vdpa.o -vde.o-libs = $(VDE_LIBS) - -common-obj-$(CONFIG_CAN_BUS) += can/ diff --git a/net/can/Makefile.objs b/net/can/Makefile.objs deleted file mode 100644 index 9f35dc5c87..0000000000 --- a/net/can/Makefile.objs +++ /dev/null @@ -1,2 +0,0 @@ -common-obj-y += can_core.o can_host.o -common-obj-$(CONFIG_LINUX) += can_socketcan.o diff --git a/net/can/meson.build b/net/can/meson.build new file mode 100644 index 0000000000..f53d9ec54f --- /dev/null +++ b/net/can/meson.build @@ -0,0 +1,5 @@ +can_ss = ss.source_set() +can_ss.add(files('can_core.c', 'can_host.c')) +can_ss.add(when: 'CONFIG_LINUX', if_true: files('can_socketcan.c')) + +softmmu_ss.add_all(when: 'CONFIG_CAN_BUS', if_true: can_ss) diff --git a/net/meson.build b/net/meson.build new file mode 100644 index 0000000000..6c2ec47dd5 --- /dev/null +++ b/net/meson.build @@ -0,0 +1,40 @@ +softmmu_ss.add(files( + 'announce.c', + 'checksum.c', + 'colo-compare.c', + 'colo.c', + 'dump.c', + 'eth.c', + 'filter-buffer.c', + 'filter-mirror.c', + 'filter-replay.c', + 'filter-rewriter.c', + 'filter.c', + 'hub.c', + 'net.c', + 'queue.c', + 'socket.c', + 'util.c', +)) + +softmmu_ss.add(when: 'CONFIG_L2TPV3', if_true: files('l2tpv3.c')) +softmmu_ss.add(when: ['CONFIG_SLIRP', slirp], if_true: files('slirp.c')) +softmmu_ss.add(when: ['CONFIG_VDE', vde], if_true: files('vde.c')) +softmmu_ss.add(when: 'CONFIG_NETMAP', if_true: files('netmap.c')) +vhost_user_ss = ss.source_set() +vhost_user_ss.add(when: 'CONFIG_VIRTIO_NET', if_true: files('vhost-user.c'), if_false: files('vhost-user-stub.c')) +softmmu_ss.add_all(when: 'CONFIG_VHOST_NET_USER', if_true: vhost_user_ss) +softmmu_ss.add(when: 'CONFIG_ALL', if_true: files('vhost-user-stub.c')) + +softmmu_ss.add(when: 'CONFIG_LINUX', if_true: files('tap-linux.c')) +softmmu_ss.add(when: 'CONFIG_BSD', if_true: files('tap-bsd.c')) +softmmu_ss.add(when: 'CONFIG_SOLARIS', if_true: files('tap-solaris.c')) +tap_posix = ['tap.c'] +if not config_host.has_key('CONFIG_LINUX') and not config_host.has_key('CONFIG_BSD') and not config_host.has_key('CONFIG_SOLARIS') + tap_posix += 'tap-stub.c' +endif +softmmu_ss.add(when: 'CONFIG_POSIX', if_true: files(tap_posix)) +softmmu_ss.add(when: 'CONFIG_WIN32', if_true: files('tap-win32.c')) +softmmu_ss.add(when: 'CONFIG_VHOST_NET_VDPA', if_true: files('vhost-vdpa.c')) + +subdir('can') diff --git a/net/trace.h b/net/trace.h new file mode 100644 index 0000000000..18d42c29b6 --- /dev/null +++ b/net/trace.h @@ -0,0 +1 @@ +#include "trace/trace-net.h" diff --git a/os-posix.c b/os-posix.c index 3572db3f44..bf98508b6d 100644 --- a/os-posix.c +++ b/os-posix.c @@ -82,7 +82,7 @@ void os_setup_signal_handling(void) /* * Find a likely location for support files using the location of the binary. - * When running from the build tree this will be "$bindir/../pc-bios". + * When running from the build tree this will be "$bindir/pc-bios". * Otherwise, this is CONFIG_QEMU_DATADIR. * * The caller must use g_free() to free the returned data when it is @@ -96,7 +96,7 @@ char *os_find_datadir(void) exec_dir = qemu_get_exec_dir(); g_return_val_if_fail(exec_dir != NULL, NULL); - dir = g_build_filename(exec_dir, "..", "pc-bios", NULL); + dir = g_build_filename(exec_dir, "pc-bios", NULL); if (g_file_test(dir, G_FILE_TEST_IS_DIR)) { return g_steal_pointer(&dir); } diff --git a/pc-bios/bios-256k.bin b/pc-bios/bios-256k.bin Binary files differindex 8fd42903cd..96bdeaa487 100644 --- a/pc-bios/bios-256k.bin +++ b/pc-bios/bios-256k.bin diff --git a/pc-bios/bios.bin b/pc-bios/bios.bin Binary files differindex 528b8ab412..3ecaf4a709 100644 --- a/pc-bios/bios.bin +++ b/pc-bios/bios.bin diff --git a/pc-bios/descriptors/meson.build b/pc-bios/descriptors/meson.build new file mode 100644 index 0000000000..7c715bace8 --- /dev/null +++ b/pc-bios/descriptors/meson.build @@ -0,0 +1,14 @@ +foreach f: [ + '50-edk2-i386-secure.json', + '50-edk2-x86_64-secure.json', + '60-edk2-aarch64.json', + '60-edk2-arm.json', + '60-edk2-i386.json', + '60-edk2-x86_64.json' +] + configure_file(input: files(f), + output: f, + configuration: {'DATADIR': config_host['qemu_datadir']}, + install: install_blobs, + install_dir: config_host['qemu_datadir'] / 'firmware') +endforeach diff --git a/pc-bios/keymaps/.gitignore b/pc-bios/keymaps/.gitignore new file mode 100644 index 0000000000..f90738f4dc --- /dev/null +++ b/pc-bios/keymaps/.gitignore @@ -0,0 +1 @@ +/*.stamp diff --git a/pc-bios/keymaps/Makefile b/pc-bios/keymaps/Makefile deleted file mode 100644 index 76217b0689..0000000000 --- a/pc-bios/keymaps/Makefile +++ /dev/null @@ -1,56 +0,0 @@ - -KEYMAP := $(shell which qemu-keymap 2>/dev/null) - -MAPS := ar bepo cz da de de-ch en-us en-gb es et fi fo \ - fr fr-be fr-ca fr-ch \ - hr hu is it ja lt lv mk nl no pl pt pt-br ru th tr - -ar : MAP_FLAGS := -l ar -bepo : MAP_FLAGS := -l fr -v dvorak -cz : MAP_FLAGS := -l cz -da : MAP_FLAGS := -l dk -de : MAP_FLAGS := -l de -v nodeadkeys -de-ch : MAP_FLAGS := -l ch -en-us : MAP_FLAGS := -l us -en-gb : MAP_FLAGS := -l gb -es : MAP_FLAGS := -l es -et : MAP_FLAGS := -l et -fi : MAP_FLAGS := -l fi -fo : MAP_FLAGS := -l fo -fr : MAP_FLAGS := -l fr -v nodeadkeys -fr-be : MAP_FLAGS := -l be -fr-ca : MAP_FLAGS := -l ca -v fr -fr-ch : MAP_FLAGS := -l ch -v fr -hr : MAP_FLAGS := -l hr -hu : MAP_FLAGS := -l hu -is : MAP_FLAGS := -l is -it : MAP_FLAGS := -l it -ja : MAP_FLAGS := -l jp -m jp106 -lt : MAP_FLAGS := -l lt -lv : MAP_FLAGS := -l lv -mk : MAP_FLAGS := -l mk -nl : MAP_FLAGS := -l nl -no : MAP_FLAGS := -l no -pl : MAP_FLAGS := -l pl -pt : MAP_FLAGS := -l pt -pt-br : MAP_FLAGS := -l br -ru : MAP_FLAGS := -l ru -th : MAP_FLAGS := -l th -tr : MAP_FLAGS := -l tr - -ifeq ($(KEYMAP),) - -all: - @echo "nothing to do (qemu-keymap not found)" - -else - -all: $(MAPS) - -clean: - rm -f $(MAPS) - -$(MAPS): $(KEYMAP) Makefile - $(KEYMAP) -f $@ $(MAP_FLAGS) - -endif diff --git a/pc-bios/keymaps/ar b/pc-bios/keymaps/ar index f62b297c54..32049d86e9 100644 --- a/pc-bios/keymaps/ar +++ b/pc-bios/keymaps/ar @@ -772,9 +772,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/keymaps/bepo b/pc-bios/keymaps/bepo index 2292cbc499..99d280ca74 100644 --- a/pc-bios/keymaps/bepo +++ b/pc-bios/keymaps/bepo @@ -763,9 +763,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/keymaps/cz b/pc-bios/keymaps/cz index 29cf2b05d8..60ac603489 100644 --- a/pc-bios/keymaps/cz +++ b/pc-bios/keymaps/cz @@ -819,9 +819,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/keymaps/da b/pc-bios/keymaps/da index 547d8c716b..4e42d9ece2 100644 --- a/pc-bios/keymaps/da +++ b/pc-bios/keymaps/da @@ -818,9 +818,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym 0x0edd0160) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym 0x0edd0270) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/keymaps/de b/pc-bios/keymaps/de index 261243edbc..7be0030dde 100644 --- a/pc-bios/keymaps/de +++ b/pc-bios/keymaps/de @@ -816,9 +816,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/keymaps/de-ch b/pc-bios/keymaps/de-ch index ed3da058e4..4aad312922 100644 --- a/pc-bios/keymaps/de-ch +++ b/pc-bios/keymaps/de-ch @@ -818,9 +818,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/keymaps/en-gb b/pc-bios/keymaps/en-gb index 18d8fce4d4..0fd8198b3e 100644 --- a/pc-bios/keymaps/en-gb +++ b/pc-bios/keymaps/en-gb @@ -817,9 +817,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/keymaps/en-us b/pc-bios/keymaps/en-us index 06762cfc6c..70cc7a2e62 100644 --- a/pc-bios/keymaps/en-us +++ b/pc-bios/keymaps/en-us @@ -729,9 +729,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/keymaps/es b/pc-bios/keymaps/es index fde441492d..b8fe3dc90f 100644 --- a/pc-bios/keymaps/es +++ b/pc-bios/keymaps/es @@ -817,9 +817,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/keymaps/et b/pc-bios/keymaps/et index a5dcbd18ab..946e388836 100644 --- a/pc-bios/keymaps/et +++ b/pc-bios/keymaps/et @@ -727,9 +727,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/keymaps/fi b/pc-bios/keymaps/fi index 816749421e..c8e943b8e7 100644 --- a/pc-bios/keymaps/fi +++ b/pc-bios/keymaps/fi @@ -792,9 +792,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/keymaps/fo b/pc-bios/keymaps/fo index 8bb6f97bba..20791e1f1f 100644 --- a/pc-bios/keymaps/fo +++ b/pc-bios/keymaps/fo @@ -819,9 +819,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/keymaps/fr b/pc-bios/keymaps/fr index 82ca812c7e..f865512758 100644 --- a/pc-bios/keymaps/fr +++ b/pc-bios/keymaps/fr @@ -819,9 +819,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/keymaps/fr-be b/pc-bios/keymaps/fr-be index f225f179a2..e680abb319 100644 --- a/pc-bios/keymaps/fr-be +++ b/pc-bios/keymaps/fr-be @@ -818,9 +818,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/keymaps/fr-ca b/pc-bios/keymaps/fr-ca index f264d0a9c3..e0b741adc3 100644 --- a/pc-bios/keymaps/fr-ca +++ b/pc-bios/keymaps/fr-ca @@ -750,9 +750,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/keymaps/fr-ch b/pc-bios/keymaps/fr-ch index bdd944da1c..fe200ea39c 100644 --- a/pc-bios/keymaps/fr-ch +++ b/pc-bios/keymaps/fr-ch @@ -818,9 +818,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/keymaps/hr b/pc-bios/keymaps/hr index 252936c3ae..f936a256e4 100644 --- a/pc-bios/keymaps/hr +++ b/pc-bios/keymaps/hr @@ -819,9 +819,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/keymaps/hu b/pc-bios/keymaps/hu index 853147610a..bef6c19f90 100644 --- a/pc-bios/keymaps/hu +++ b/pc-bios/keymaps/hu @@ -818,9 +818,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym 0x0a865600) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym 0x0a865710) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/keymaps/is b/pc-bios/keymaps/is index c88fa603aa..115c2d09bb 100644 --- a/pc-bios/keymaps/is +++ b/pc-bios/keymaps/is @@ -819,9 +819,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/keymaps/it b/pc-bios/keymaps/it index df00156cf8..66f46e7ae3 100644 --- a/pc-bios/keymaps/it +++ b/pc-bios/keymaps/it @@ -822,9 +822,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/keymaps/ja b/pc-bios/keymaps/ja index 6eb2e7bc20..4589dd29b7 100644 --- a/pc-bios/keymaps/ja +++ b/pc-bios/keymaps/ja @@ -733,9 +733,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/keymaps/lt b/pc-bios/keymaps/lt index db9b24f611..141286f0af 100644 --- a/pc-bios/keymaps/lt +++ b/pc-bios/keymaps/lt @@ -817,9 +817,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/keymaps/lv b/pc-bios/keymaps/lv index 54997ce092..240d8d3e85 100644 --- a/pc-bios/keymaps/lv +++ b/pc-bios/keymaps/lv @@ -792,9 +792,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/keymaps/meson.build b/pc-bios/keymaps/meson.build new file mode 100644 index 0000000000..b737c82230 --- /dev/null +++ b/pc-bios/keymaps/meson.build @@ -0,0 +1,56 @@ +keymaps = { + 'ar': '-l ar', + 'bepo': '-l fr -v dvorak', + 'cz': '-l cz', + 'da': '-l dk', + 'de': '-l de -v nodeadkeys', + 'de-ch': '-l ch', + 'en-gb': '-l gb', + 'en-us': '-l us', + 'es': '-l es', + 'et': '-l et', + 'fi': '-l fi', + 'fo': '-l fo', + 'fr': '-l fr -v nodeadkeys', + 'fr-be': '-l be', + 'fr-ca': '-l ca -v fr', + 'fr-ch': '-l ch -v fr', + 'hr': '-l hr', + 'hu': '-l hu', + 'is': '-l is', + 'it': '-l it', + 'ja': '-l jp -m jp106', + 'lt': '-l lt', + 'lv': '-l lv', + 'mk': '-l mk', + 'nl': '-l nl', + 'no': '-l no', + 'pl': '-l pl', + 'pt': '-l pt', + 'pt-br': '-l br', + 'ru': '-l ru', + 'th': '-l th', + 'tr': '-l tr', +} + +if meson.is_cross_build() or 'CONFIG_XKBCOMMON' not in config_host + native_qemu_keymap = find_program('qemu-keymap', required: false, disabler: true) +else + native_qemu_keymap = qemu_keymap +endif +t = [] +foreach km, args: keymaps + t += custom_target(km, + build_by_default: true, + output: km, + command: [native_qemu_keymap, '-f', '@OUTPUT@', args.split()], + install_dir: config_host['qemu_datadir'] / 'keymaps') +endforeach +if t.length() > 0 + alias_target('update-keymaps', t) +else + # install from the source tree + install_data(keymaps.keys(), install_dir: config_host['qemu_datadir'] / 'keymaps') +endif + +install_data(['sl', 'sv'], install_dir: config_host['qemu_datadir'] / 'keymaps') diff --git a/pc-bios/keymaps/mk b/pc-bios/keymaps/mk index cb362b6d39..d331b23bba 100644 --- a/pc-bios/keymaps/mk +++ b/pc-bios/keymaps/mk @@ -729,9 +729,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/keymaps/nl b/pc-bios/keymaps/nl index 1579829eef..d6522d117b 100644 --- a/pc-bios/keymaps/nl +++ b/pc-bios/keymaps/nl @@ -819,9 +819,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/keymaps/no b/pc-bios/keymaps/no index cd634e7b90..631f4dc1a7 100644 --- a/pc-bios/keymaps/no +++ b/pc-bios/keymaps/no @@ -833,9 +833,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym 0x00408160) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym 0x00408270) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/keymaps/pl b/pc-bios/keymaps/pl index 30d93ca727..6a966f5392 100644 --- a/pc-bios/keymaps/pl +++ b/pc-bios/keymaps/pl @@ -823,9 +823,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/keymaps/pt b/pc-bios/keymaps/pt index c34d6e3761..31c1dccc2c 100644 --- a/pc-bios/keymaps/pt +++ b/pc-bios/keymaps/pt @@ -816,9 +816,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/keymaps/pt-br b/pc-bios/keymaps/pt-br index 2d409c0bc0..0bac9e34a3 100644 --- a/pc-bios/keymaps/pt-br +++ b/pc-bios/keymaps/pt-br @@ -816,9 +816,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/keymaps/ru b/pc-bios/keymaps/ru index 9502ba1269..9f3492ef5d 100644 --- a/pc-bios/keymaps/ru +++ b/pc-bios/keymaps/ru @@ -730,9 +730,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/keymaps/th b/pc-bios/keymaps/th index b8298d902b..2c4a17f0e5 100644 --- a/pc-bios/keymaps/th +++ b/pc-bios/keymaps/th @@ -729,9 +729,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/keymaps/tr b/pc-bios/keymaps/tr index 8ef60a60c1..2f5bd621a3 100644 --- a/pc-bios/keymaps/tr +++ b/pc-bios/keymaps/tr @@ -812,9 +812,247 @@ XF86AudioMedia 0xed # evdev 245 (0xf5): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) -# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 246 (0xf6): no evdev -> QKeyCode mapping (xkb keysym XF86WWAN) -# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym Invalid) +# evdev 247 (0xf7): no evdev -> QKeyCode mapping (xkb keysym XF86RFKill) + +# evdev 248 (0xf8): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 249 (0xf9): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 250 (0xfa): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 251 (0xfb): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 252 (0xfc): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 253 (0xfd): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 254 (0xfe): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 255 (0xff): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 256 (0x100): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 257 (0x101): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 258 (0x102): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 259 (0x103): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 260 (0x104): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 261 (0x105): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 262 (0x106): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 263 (0x107): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 264 (0x108): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 265 (0x109): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 266 (0x10a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 267 (0x10b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 268 (0x10c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 269 (0x10d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 270 (0x10e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 271 (0x10f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 272 (0x110): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 273 (0x111): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 274 (0x112): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 275 (0x113): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 276 (0x114): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 277 (0x115): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 278 (0x116): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 279 (0x117): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 280 (0x118): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 281 (0x119): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 282 (0x11a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 283 (0x11b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 284 (0x11c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 285 (0x11d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 286 (0x11e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 287 (0x11f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 288 (0x120): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 289 (0x121): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 290 (0x122): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 291 (0x123): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 292 (0x124): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 293 (0x125): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 294 (0x126): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 295 (0x127): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 296 (0x128): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 297 (0x129): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 298 (0x12a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 299 (0x12b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 300 (0x12c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 301 (0x12d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 302 (0x12e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 303 (0x12f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 304 (0x130): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 305 (0x131): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 306 (0x132): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 307 (0x133): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 308 (0x134): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 309 (0x135): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 310 (0x136): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 311 (0x137): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 312 (0x138): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 313 (0x139): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 314 (0x13a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 315 (0x13b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 316 (0x13c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 317 (0x13d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 318 (0x13e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 319 (0x13f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 320 (0x140): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 321 (0x141): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 322 (0x142): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 323 (0x143): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 324 (0x144): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 325 (0x145): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 326 (0x146): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 327 (0x147): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 328 (0x148): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 329 (0x149): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 330 (0x14a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 331 (0x14b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 332 (0x14c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 333 (0x14d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 334 (0x14e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 335 (0x14f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 336 (0x150): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 337 (0x151): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 338 (0x152): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 339 (0x153): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 340 (0x154): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 341 (0x155): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 342 (0x156): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 343 (0x157): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 344 (0x158): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 345 (0x159): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 346 (0x15a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 347 (0x15b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 348 (0x15c): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 349 (0x15d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 350 (0x15e): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 351 (0x15f): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 352 (0x160): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 353 (0x161): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 354 (0x162): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 355 (0x163): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 356 (0x164): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 357 (0x165): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 358 (0x166): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 359 (0x167): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 360 (0x168): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 361 (0x169): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 362 (0x16a): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 363 (0x16b): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 364 (0x16c): no evdev -> QKeyCode mapping (xkb keysym XF86Favorites) + +# evdev 365 (0x16d): no evdev -> QKeyCode mapping (xkb keysym NoSymbol) + +# evdev 366 (0x16e): no evdev -> QKeyCode mapping (xkb keysym XF86Keyboard) # # quirks section start diff --git a/pc-bios/meson.build b/pc-bios/meson.build new file mode 100644 index 0000000000..b6389f5148 --- /dev/null +++ b/pc-bios/meson.build @@ -0,0 +1,28 @@ +bzip2 = find_program('bzip2') + +install_blobs = 'INSTALL_BLOBS' in config_host +if 'DECOMPRESS_EDK2_BLOBS' in config_host + fds = [ + 'edk2-aarch64-code.fd', + 'edk2-arm-code.fd', + 'edk2-arm-vars.fd', + 'edk2-i386-code.fd', + 'edk2-i386-secure-code.fd', + 'edk2-i386-vars.fd', + 'edk2-x86_64-code.fd', + 'edk2-x86_64-secure-code.fd', + ] + + foreach f : fds + custom_target(f, + output: f, + input: '@0@.bz2'.format(f), + capture: true, + install: install_blobs, + install_dir: config_host['qemu_datadir'], + command: [ bzip2, '-dc', '@INPUT0@' ]) + endforeach +endif + +subdir('descriptors') +subdir('keymaps') diff --git a/pc-bios/opensbi-riscv32-generic-fw_dynamic.bin b/pc-bios/opensbi-riscv32-generic-fw_dynamic.bin Binary files differnew file mode 100644 index 0000000000..23b4dfb3b9 --- /dev/null +++ b/pc-bios/opensbi-riscv32-generic-fw_dynamic.bin diff --git a/pc-bios/opensbi-riscv32-generic-fw_dynamic.elf b/pc-bios/opensbi-riscv32-generic-fw_dynamic.elf Binary files differnew file mode 100644 index 0000000000..eb9ebf5674 --- /dev/null +++ b/pc-bios/opensbi-riscv32-generic-fw_dynamic.elf diff --git a/pc-bios/opensbi-riscv32-sifive_u-fw_jump.bin b/pc-bios/opensbi-riscv32-sifive_u-fw_jump.bin Binary files differdeleted file mode 100644 index 3e0da54080..0000000000 --- a/pc-bios/opensbi-riscv32-sifive_u-fw_jump.bin +++ /dev/null diff --git a/pc-bios/opensbi-riscv32-virt-fw_jump.bin b/pc-bios/opensbi-riscv32-virt-fw_jump.bin Binary files differdeleted file mode 100644 index bc56ed61fd..0000000000 --- a/pc-bios/opensbi-riscv32-virt-fw_jump.bin +++ /dev/null diff --git a/pc-bios/opensbi-riscv64-generic-fw_dynamic.bin b/pc-bios/opensbi-riscv64-generic-fw_dynamic.bin Binary files differnew file mode 100644 index 0000000000..16c0cf4d0a --- /dev/null +++ b/pc-bios/opensbi-riscv64-generic-fw_dynamic.bin diff --git a/pc-bios/opensbi-riscv64-generic-fw_dynamic.elf b/pc-bios/opensbi-riscv64-generic-fw_dynamic.elf Binary files differnew file mode 100644 index 0000000000..642a64e240 --- /dev/null +++ b/pc-bios/opensbi-riscv64-generic-fw_dynamic.elf diff --git a/pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin b/pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin Binary files differdeleted file mode 100644 index 1acee86dc7..0000000000 --- a/pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin +++ /dev/null diff --git a/pc-bios/opensbi-riscv64-virt-fw_jump.bin b/pc-bios/opensbi-riscv64-virt-fw_jump.bin Binary files differdeleted file mode 100644 index c62f2b449b..0000000000 --- a/pc-bios/opensbi-riscv64-virt-fw_jump.bin +++ /dev/null diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile index e33a24da0d..51cb6ca9d8 100644 --- a/pc-bios/optionrom/Makefile +++ b/pc-bios/optionrom/Makefile @@ -1,13 +1,16 @@ -all: build-all +CURRENT_MAKEFILE := $(realpath $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))) +SRC_DIR := $(dir $(CURRENT_MAKEFILE)) +TOPSRC_DIR := $(SRC_DIR)/../.. +VPATH = $(SRC_DIR) + +all: multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin # Dummy command so that make thinks it has done something @true include ../../config-host.mak -include $(SRC_PATH)/rules.mak - -$(call set-vpath, $(SRC_PATH)/pc-bios/optionrom) -.PHONY : all clean build-all +quiet-command = $(if $(V),$1,$(if $(2),@printf " %-7s %s\n" $2 $3 && $1, @$1)) +cc-option = $(if $(shell $(CC) $1 -S -o /dev/null -xc /dev/null >/dev/null 2>&1 && echo OK), $1, $2) # Compiling with no optimization creates ROMs that are too large ifeq ($(lastword $(filter -O%, -O0 $(CFLAGS))),-O0) @@ -15,48 +18,60 @@ override CFLAGS += -O2 endif override CFLAGS += -march=i486 -# Drop -fstack-protector and the like -QEMU_CFLAGS := $(filter -W%, $(QEMU_CFLAGS)) $(CFLAGS_NOPIE) -ffreestanding -QEMU_CFLAGS += $(call cc-option, $(QEMU_CFLAGS), -fno-stack-protector) -QEMU_CFLAGS += $(call cc-option, $(QEMU_CFLAGS), -m16) -ifeq ($(filter -m16, $(QEMU_CFLAGS)),) +# Flags for dependency generation +override CPPFLAGS += -MMD -MP -MT $@ -MF $(@D)/$(*F).d + +override CFLAGS += $(filter -W%, $(QEMU_CFLAGS)) +override CFLAGS += $(CFLAGS_NOPIE) -ffreestanding -I$(TOPSRC_DIR)/include +override CFLAGS += $(call cc-option, -fno-stack-protector) +override CFLAGS += $(call cc-option, -m16) + +ifeq ($(filter -m16, $(CFLAGS)),) # Attempt to work around compilers that lack -m16 (GCC <= 4.8, clang <= ??) # On GCC we add -fno-toplevel-reorder to keep the order of asm blocks with # respect to the rest of the code. clang does not have -fno-toplevel-reorder, # but it places all asm blocks at the beginning and we're relying on it for # the option ROM header. So just force clang not to use the integrated # assembler, which doesn't support .code16gcc. -QEMU_CFLAGS += $(call cc-option, $(QEMU_CFLAGS), -fno-toplevel-reorder) -QEMU_CFLAGS += $(call cc-option, $(QEMU_CFLAGS), -no-integrated-as) -QEMU_CFLAGS += -m32 -include $(SRC_PATH)/pc-bios/optionrom/code16gcc.h +override CFLAGS += $(call cc-option, -fno-toplevel-reorder) +override CFLAGS += $(call cc-option, -no-integrated-as) +override CFLAGS += -m32 -include $(SRC_DIR)/code16gcc.h endif -QEMU_INCLUDES += -I$(SRC_PATH) - Wa = -Wa, -ASFLAGS += -32 -QEMU_CFLAGS += $(call cc-c-option, $(QEMU_CFLAGS), $(Wa)-32) +override ASFLAGS += -32 +override CFLAGS += $(call cc-option, $(Wa)-32) -build-all: multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin -# suppress auto-removal of intermediate files -.SECONDARY: +LD_I386_EMULATION ?= elf_i386 +override LDFLAGS = -m $(LD_I386_EMULATION) -T $(SRC_DIR)/flat.lds +override LDFLAGS += $(LDFLAGS_NOPIE) +all: multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin + +pvh.img: pvh.o pvh_main.o %.o: %.S - $(call quiet-command,$(CPP) $(QEMU_INCLUDES) $(QEMU_DGFLAGS) -c -o - $< | $(AS) $(ASFLAGS) -o $@,"AS","$(TARGET_DIR)$@") + $(call quiet-command,$(CPP) $(CPPFLAGS) -c -o - $< | $(AS) $(ASFLAGS) -o $@,"AS","$@") -pvh.img: pvh.o pvh_main.o - $(call quiet-command,$(LD) $(LDFLAGS_NOPIE) -m $(LD_I386_EMULATION) -T $(SRC_PATH)/pc-bios/optionrom/flat.lds -s -o $@ $^,"BUILD","$(TARGET_DIR)$@") +%.o: %.c + $(call quiet-command,$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@,"CC","$@") %.img: %.o - $(call quiet-command,$(LD) $(LDFLAGS_NOPIE) -m $(LD_I386_EMULATION) -T $(SRC_PATH)/pc-bios/optionrom/flat.lds -s -o $@ $<,"BUILD","$(TARGET_DIR)$@") + $(call quiet-command,$(LD) $(LDFLAGS) -s -o $@ $^,"BUILD","$@") %.raw: %.img - $(call quiet-command,$(OBJCOPY) -O binary -j .text $< $@,"BUILD","$(TARGET_DIR)$@") + $(call quiet-command,$(OBJCOPY) -O binary -j .text $< $@,"BUILD","$@") %.bin: %.raw - $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/signrom.py $< $@,"SIGN","$(TARGET_DIR)$@") + $(call quiet-command,$(PYTHON) $(TOPSRC_DIR)/scripts/signrom.py $< $@,"SIGN","$@") + +include $(wildcard *.d) clean: rm -f *.o *.d *.raw *.img *.bin *~ + +# suppress auto-removal of intermediate files +.SECONDARY: + +.PHONY: all clean diff --git a/pc-bios/petalogix-ml605.dtb b/pc-bios/petalogix-ml605.dtb Binary files differindex fbbd45fdad..9a05434db7 100644 --- a/pc-bios/petalogix-ml605.dtb +++ b/pc-bios/petalogix-ml605.dtb diff --git a/pc-bios/petalogix-ml605.dts b/pc-bios/petalogix-ml605.dts new file mode 100644 index 0000000000..b307a29279 --- /dev/null +++ b/pc-bios/petalogix-ml605.dts @@ -0,0 +1,350 @@ +/* + * Copyright (c) 2020 Xilinx Inc. + * Written by Edgar E. Iglesias <edgar.iglesias@xilinx.com>. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/dts-v1/; + +/ { + #address-cells = < 0x01 >; + #size-cells = < 0x01 >; + compatible = "xlnx,microblaze"; + model = "edk131"; + + memory@50000000 { + device_type = "memory"; + reg = < 0x50000000 0x10000000 >; + }; + + aliases { + ethernet0 = "/axi/axi-ethernet@82780000"; + serial0 = "/axi/serial@83e00000"; + }; + + chosen { + bootargs = " console=ttyS0,115200 "; + stdout-path = "/axi/serial@83e00000"; + }; + + cpus { + #address-cells = < 0x01 >; + #cpus = < 0x01 >; + #size-cells = < 0x00 >; + + cpu@0 { + clock-frequency = < 0xbebc200 >; + compatible = "xlnx,microblaze-8.10.a"; + d-cache-baseaddr = < 0x50000000 >; + d-cache-highaddr = < 0x5fffffff >; + d-cache-line-size = < 0x20 >; + d-cache-size = < 0x800 >; + device_type = "cpu"; + i-cache-baseaddr = < 0x50000000 >; + i-cache-highaddr = < 0x5fffffff >; + i-cache-line-size = < 0x20 >; + i-cache-size = < 0x800 >; + model = "microblaze,8.10.a"; + reg = < 0x00 >; + timebase-frequency = < 0xbebc200 >; + xlnx,addr-tag-bits = < 0x11 >; + xlnx,allow-dcache-wr = < 0x01 >; + xlnx,allow-icache-wr = < 0x01 >; + xlnx,area-optimized = < 0x00 >; + xlnx,branch-target-cache-size = < 0x00 >; + xlnx,cache-byte-size = < 0x800 >; + xlnx,d-axi = < 0x01 >; + xlnx,d-lmb = < 0x01 >; + xlnx,d-plb = < 0x00 >; + xlnx,data-size = < 0x20 >; + xlnx,dcache-addr-tag = < 0x11 >; + xlnx,dcache-always-used = < 0x01 >; + xlnx,dcache-byte-size = < 0x800 >; + xlnx,dcache-data-width = < 0x00 >; + xlnx,dcache-force-tag-lutram = < 0x00 >; + xlnx,dcache-interface = < 0x01 >; + xlnx,dcache-line-len = < 0x08 >; + xlnx,dcache-use-fsl = < 0x00 >; + xlnx,dcache-use-writeback = < 0x01 >; + xlnx,dcache-victims = < 0x00 >; + xlnx,debug-enabled = < 0x01 >; + xlnx,div-zero-exception = < 0x01 >; + xlnx,dynamic-bus-sizing = < 0x01 >; + xlnx,ecc-use-ce-exception = < 0x00 >; + xlnx,edge-is-positive = < 0x01 >; + xlnx,endianness = < 0x01 >; + xlnx,family = "virtex6"; + xlnx,fault-tolerant = < 0x00 >; + xlnx,fpu-exception = < 0x01 >; + xlnx,freq = < 0xbebc200 >; + xlnx,fsl-data-size = < 0x20 >; + xlnx,fsl-exception = < 0x00 >; + xlnx,fsl-links = < 0x00 >; + xlnx,i-axi = < 0x01 >; + xlnx,i-lmb = < 0x01 >; + xlnx,i-plb = < 0x00 >; + xlnx,icache-always-used = < 0x01 >; + xlnx,icache-data-width = < 0x00 >; + xlnx,icache-force-tag-lutram = < 0x00 >; + xlnx,icache-interface = < 0x00 >; + xlnx,icache-line-len = < 0x08 >; + xlnx,icache-streams = < 0x00 >; + xlnx,icache-use-fsl = < 0x00 >; + xlnx,icache-victims = < 0x00 >; + xlnx,ill-opcode-exception = < 0x01 >; + xlnx,instance = "microblaze_0"; + xlnx,interconnect = < 0x02 >; + xlnx,interrupt-is-edge = < 0x00 >; + xlnx,mmu-dtlb-size = < 0x04 >; + xlnx,mmu-itlb-size = < 0x02 >; + xlnx,mmu-privileged-instr = < 0x00 >; + xlnx,mmu-tlb-access = < 0x03 >; + xlnx,mmu-zones = < 0x02 >; + xlnx,number-of-pc-brk = < 0x01 >; + xlnx,number-of-rd-addr-brk = < 0x00 >; + xlnx,number-of-wr-addr-brk = < 0x00 >; + xlnx,opcode-0x0-illegal = < 0x01 >; + xlnx,optimization = < 0x00 >; + xlnx,pvr = < 0x02 >; + xlnx,pvr-user1 = < 0x00 >; + xlnx,pvr-user2 = < 0x00 >; + xlnx,reset-msr = < 0x00 >; + xlnx,sco = < 0x00 >; + xlnx,stream-interconnect = < 0x00 >; + xlnx,unaligned-exceptions = < 0x01 >; + xlnx,use-barrel = < 0x01 >; + xlnx,use-branch-target-cache = < 0x00 >; + xlnx,use-dcache = < 0x01 >; + xlnx,use-div = < 0x01 >; + xlnx,use-ext-brk = < 0x01 >; + xlnx,use-ext-nm-brk = < 0x01 >; + xlnx,use-extended-fsl-instr = < 0x00 >; + xlnx,use-fpu = < 0x01 >; + xlnx,use-hw-mul = < 0x02 >; + xlnx,use-icache = < 0x01 >; + xlnx,use-interrupt = < 0x01 >; + xlnx,use-mmu = < 0x03 >; + xlnx,use-msr-instr = < 0x01 >; + xlnx,use-pcmp-instr = < 0x01 >; + xlnx,use-stack-protection = < 0x00 >; + }; + }; + + axi { + #address-cells = < 0x01 >; + #size-cells = < 0x01 >; + compatible = "xlnx,axi-interconnect-1.02.a\0simple-bus"; + ranges; + + axi-ethernet@82780000 { + axistream-connected = < &axi_dma >; + compatible = "xlnx,axi-ethernet-2.01.a\0xlnx,axi-ethernet-1.00.a"; + device_type = "network"; + interrupt-parent = < &intc >; + interrupts = < 0x03 0x02 >; + local-mac-address = [ 00 0a 35 00 22 01 ]; + phy-handle = < &phy7 >; + reg = < 0x82780000 0x40000 >; + xlnx,avb = < 0x00 >; + xlnx,halfdup = < 0x00 >; + xlnx,include-io = < 0x01 >; + xlnx,mcast-extend = < 0x00 >; + xlnx,phy-type = < 0x01 >; + xlnx,phyaddr = "0B00001"; + xlnx,rxcsum = < 0x00 >; + xlnx,rxmem = < 0x1000 >; + xlnx,rxvlan-strp = < 0x00 >; + xlnx,rxvlan-tag = < 0x00 >; + xlnx,rxvlan-tran = < 0x00 >; + xlnx,stats = < 0x00 >; + xlnx,txcsum = < 0x00 >; + xlnx,txmem = < 0x1000 >; + xlnx,txvlan-strp = < 0x00 >; + xlnx,txvlan-tag = < 0x00 >; + xlnx,txvlan-tran = < 0x00 >; + xlnx,type = < 0x02 >; + + mdio { + #address-cells = < 0x01 >; + #size-cells = < 0x00 >; + + phy7: phy@7 { + compatible = "marvell,88e1111"; + device_type = "ethernet-phy"; + reg = < 0x07 >; + }; + }; + }; + + axi_dma: axi-dma@84600000 { + compatible = "xlnx,axi-dma-3.00.a"; + interrupt-parent = < &intc >; + interrupts = < 0x01 0x02 0x00 0x02 >; + reg = < 0x84600000 0x10000 >; + xlnx,dlytmr-resolution = < 0x4e2 >; + xlnx,family = "virtex6"; + xlnx,include-mm2s = < 0x01 >; + xlnx,include-mm2s-dre = < 0x01 >; + xlnx,include-s2mm = < 0x01 >; + xlnx,include-s2mm-dre = < 0x01 >; + xlnx,mm2s-burst-size = < 0x10 >; + xlnx,prmry-is-aclk-async = < 0x00 >; + xlnx,s2mm-burst-size = < 0x10 >; + xlnx,sg-include-desc-queue = < 0x01 >; + xlnx,sg-include-stscntrl-strm = < 0x01 >; + xlnx,sg-length-width = < 0x10 >; + xlnx,sg-use-stsapp-length = < 0x01 >; + }; + + serial@83e00000 { + clock-frequency = < 0x5f5e100 >; + compatible = "xlnx,axi-uart16550-1.01.a\0xlnx,xps-uart16550-2.00.a\0ns16550a"; + current-speed = < 0x2580 >; + device_type = "serial"; + interrupt-parent = < &intc >; + interrupts = < 0x05 0x02 >; + reg = < 0x83e00000 0x10000 >; + reg-offset = < 0x1000 >; + reg-shift = < 0x02 >; + xlnx,external-xin-clk-hz = < 0x17d7840 >; + xlnx,family = "virtex6"; + xlnx,has-external-rclk = < 0x00 >; + xlnx,has-external-xin = < 0x00 >; + xlnx,is-a-16550 = < 0x01 >; + xlnx,use-modem-ports = < 0x00 >; + xlnx,use-user-ports = < 0x00 >; + }; + + system-timer@83c00000 { + clock-frequency = < 0x5f5e100 >; + compatible = "xlnx,axi-timer-1.01.a\0xlnx,xps-timer-1.00.a"; + interrupt-parent = < &intc >; + interrupts = < 0x02 0x00 >; + reg = < 0x83c00000 0x10000 >; + xlnx,count-width = < 0x20 >; + xlnx,family = "virtex6"; + xlnx,gen0-assert = < 0x01 >; + xlnx,gen1-assert = < 0x01 >; + xlnx,one-timer-only = < 0x00 >; + xlnx,trig0-assert = < 0x01 >; + xlnx,trig1-assert = < 0x01 >; + }; + + intc: interrupt-controller@81800000 { + #interrupt-cells = < 0x02 >; + compatible = "xlnx,axi-intc-1.01.a\0xlnx,xps-intc-1.00.a"; + interrupt-controller; + reg = < 0x81800000 0x10000 >; + xlnx,kind-of-intr = < 0x04 >; + xlnx,num-intr-inputs = < 0x06 >; + }; + + flash@86000000 { + #address-cells = < 0x01 >; + #size-cells = < 0x01 >; + bank-width = < 0x02 >; + compatible = "xlnx,axi-emc-1.01.a\0cfi-flash"; + reg = < 0x86000000 0x2000000 >; + xlnx,axi-clk-period-ps = < 0x2710 >; + xlnx,family = "virtex6"; + xlnx,include-datawidth-matching-0 = < 0x01 >; + xlnx,include-datawidth-matching-1 = < 0x00 >; + xlnx,include-datawidth-matching-2 = < 0x00 >; + xlnx,include-datawidth-matching-3 = < 0x00 >; + xlnx,include-negedge-ioregs = < 0x00 >; + xlnx,max-mem-width = < 0x10 >; + xlnx,mem0-type = < 0x02 >; + xlnx,mem0-width = < 0x10 >; + xlnx,mem1-type = < 0x00 >; + xlnx,mem1-width = < 0x20 >; + xlnx,mem2-type = < 0x00 >; + xlnx,mem2-width = < 0x20 >; + xlnx,mem3-type = < 0x00 >; + xlnx,mem3-width = < 0x20 >; + xlnx,num-banks-mem = < 0x01 >; + xlnx,parity-type-mem-0 = < 0x00 >; + xlnx,parity-type-mem-1 = < 0x00 >; + xlnx,parity-type-mem-2 = < 0x00 >; + xlnx,parity-type-mem-3 = < 0x00 >; + xlnx,s-axi-en-reg = < 0x00 >; + xlnx,s-axi-mem-addr-width = < 0x20 >; + xlnx,s-axi-mem-data-width = < 0x20 >; + xlnx,s-axi-mem-id-width = < 0x01 >; + xlnx,s-axi-mem-protocol = "AXI4LITE"; + xlnx,s-axi-reg-addr-width = < 0x20 >; + xlnx,s-axi-reg-data-width = < 0x20 >; + xlnx,s-axi-reg-protocol = "axi4"; + xlnx,synch-pipedelay-0 = < 0x02 >; + xlnx,synch-pipedelay-1 = < 0x02 >; + xlnx,synch-pipedelay-2 = < 0x02 >; + xlnx,synch-pipedelay-3 = < 0x02 >; + xlnx,tavdv-ps-mem-0 = < 0x1fbd0 >; + xlnx,tavdv-ps-mem-1 = < 0x3a98 >; + xlnx,tavdv-ps-mem-2 = < 0x3a98 >; + xlnx,tavdv-ps-mem-3 = < 0x3a98 >; + xlnx,tcedv-ps-mem-0 = < 0x1fbd0 >; + xlnx,tcedv-ps-mem-1 = < 0x3a98 >; + xlnx,tcedv-ps-mem-2 = < 0x3a98 >; + xlnx,tcedv-ps-mem-3 = < 0x3a98 >; + xlnx,thzce-ps-mem-0 = < 0x88b8 >; + xlnx,thzce-ps-mem-1 = < 0x1b58 >; + xlnx,thzce-ps-mem-2 = < 0x1b58 >; + xlnx,thzce-ps-mem-3 = < 0x1b58 >; + xlnx,thzoe-ps-mem-0 = < 0x1b58 >; + xlnx,thzoe-ps-mem-1 = < 0x1b58 >; + xlnx,thzoe-ps-mem-2 = < 0x1b58 >; + xlnx,thzoe-ps-mem-3 = < 0x1b58 >; + xlnx,tlzwe-ps-mem-0 = < 0x88b8 >; + xlnx,tlzwe-ps-mem-1 = < 0x00 >; + xlnx,tlzwe-ps-mem-2 = < 0x00 >; + xlnx,tlzwe-ps-mem-3 = < 0x00 >; + xlnx,tpacc-ps-flash-0 = < 0x61a8 >; + xlnx,tpacc-ps-flash-1 = < 0x61a8 >; + xlnx,tpacc-ps-flash-2 = < 0x61a8 >; + xlnx,tpacc-ps-flash-3 = < 0x61a8 >; + xlnx,twc-ps-mem-0 = < 0x32c8 >; + xlnx,twc-ps-mem-1 = < 0x3a98 >; + xlnx,twc-ps-mem-2 = < 0x3a98 >; + xlnx,twc-ps-mem-3 = < 0x3a98 >; + xlnx,twp-ps-mem-0 = < 0x11170 >; + xlnx,twp-ps-mem-1 = < 0x2ee0 >; + xlnx,twp-ps-mem-2 = < 0x2ee0 >; + xlnx,twp-ps-mem-3 = < 0x2ee0 >; + xlnx,twph-ps-mem-0 = < 0x2ee0 >; + xlnx,twph-ps-mem-1 = < 0x2ee0 >; + xlnx,twph-ps-mem-2 = < 0x2ee0 >; + xlnx,twph-ps-mem-3 = < 0x2ee0 >; + + partition@0 { + label = "fpga"; + reg = < 0x00 0x100000 >; + }; + + partition@100000 { + label = "boot"; + reg = < 0x100000 0x40000 >; + }; + + partition@140000 { + label = "bootenv"; + reg = < 0x140000 0x20000 >; + }; + + partition@160000 { + label = "config"; + reg = < 0x160000 0x20000 >; + }; + + partition@180000 { + label = "image"; + reg = < 0x180000 0xa00000 >; + }; + + partition@b80000 { + label = "spare"; + reg = < 0xb80000 0x00 >; + }; + }; + }; +}; diff --git a/pc-bios/petalogix-s3adsp1800.dtb b/pc-bios/petalogix-s3adsp1800.dtb Binary files differindex 8ac80f2f2d..2513599438 100644 --- a/pc-bios/petalogix-s3adsp1800.dtb +++ b/pc-bios/petalogix-s3adsp1800.dtb diff --git a/pc-bios/petalogix-s3adsp1800.dts b/pc-bios/petalogix-s3adsp1800.dts new file mode 100644 index 0000000000..f53c36f870 --- /dev/null +++ b/pc-bios/petalogix-s3adsp1800.dts @@ -0,0 +1,282 @@ +/* + * Copyright (c) 2020 Xilinx Inc. + * Written by Edgar E. Iglesias <edgar.iglesias@xilinx.com>. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/dts-v1/; + +/ { + #address-cells = <0x01>; + #size-cells = <0x01>; + compatible = "xlnx,microblaze"; + model = "testing"; + + memory@90000000 { + device_type = "memory"; + reg = <0x90000000 0x8000000>; + }; + + chosen { + bootargs = "console=ttyUL0,115200"; + stdout-path = "/plb/serial@84000000"; + }; + + cpus { + #address-cells = <0x01>; + #size-cells = <0x00>; + #cpus = <0x01>; + + cpu@0 { + clock-frequency = <0x3b9aca0>; + compatible = "xlnx,microblaze-7.10.d"; + d-cache-baseaddr = <0x90000000>; + d-cache-highaddr = <0x97ffffff>; + d-cache-line-size = <0x10>; + d-cache-size = <0x800>; + device_type = "cpu"; + i-cache-baseaddr = <0x90000000>; + i-cache-highaddr = <0x97ffffff>; + i-cache-line-size = <0x10>; + i-cache-size = <0x800>; + model = "microblaze,7.10.d"; + reg = <0x00>; + timebase-frequency = <0x3b9aca0>; + xlnx,addr-tag-bits = <0x10>; + xlnx,allow-dcache-wr = <0x01>; + xlnx,allow-icache-wr = <0x01>; + xlnx,area-optimized = <0x00>; + xlnx,cache-byte-size = <0x800>; + xlnx,d-lmb = <0x01>; + xlnx,d-opb = <0x00>; + xlnx,d-plb = <0x01>; + xlnx,data-size = <0x20>; + xlnx,dcache-addr-tag = <0x10>; + xlnx,dcache-always-used = <0x00>; + xlnx,dcache-byte-size = <0x800>; + xlnx,dcache-line-len = <0x04>; + xlnx,dcache-use-fsl = <0x01>; + xlnx,debug-enabled = <0x01>; + xlnx,div-zero-exception = <0x00>; + xlnx,dopb-bus-exception = <0x00>; + xlnx,dynamic-bus-sizing = <0x01>; + xlnx,edge-is-positive = <0x01>; + xlnx,family = "spartan3adsp"; + xlnx,fpu-exception = <0x00>; + xlnx,fsl-data-size = <0x20>; + xlnx,fsl-exception = <0x00>; + xlnx,fsl-links = <0x00>; + xlnx,i-lmb = <0x01>; + xlnx,i-opb = <0x00>; + xlnx,i-plb = <0x01>; + xlnx,icache-always-used = <0x00>; + xlnx,icache-line-len = <0x04>; + xlnx,icache-use-fsl = <0x01>; + xlnx,ill-opcode-exception = <0x00>; + xlnx,instance = "microblaze_0"; + xlnx,interconnect = <0x01>; + xlnx,interrupt-is-edge = <0x00>; + xlnx,iopb-bus-exception = <0x00>; + xlnx,mmu-dtlb-size = <0x04>; + xlnx,mmu-itlb-size = <0x02>; + xlnx,mmu-tlb-access = <0x03>; + xlnx,mmu-zones = <0x10>; + xlnx,number-of-pc-brk = <0x03>; + xlnx,number-of-rd-addr-brk = <0x02>; + xlnx,number-of-wr-addr-brk = <0x02>; + xlnx,opcode-0x0-illegal = <0x00>; + xlnx,pvr = <0x01>; + xlnx,pvr-user1 = <0x00>; + xlnx,pvr-user2 = <0x00>; + xlnx,reset-msr = <0x00>; + xlnx,sco = <0x00>; + xlnx,unaligned-exceptions = <0x01>; + xlnx,use-barrel = <0x01>; + xlnx,use-dcache = <0x01>; + xlnx,use-div = <0x00>; + xlnx,use-ext-brk = <0x01>; + xlnx,use-ext-nm-brk = <0x01>; + xlnx,use-extended-fsl-instr = <0x00>; + xlnx,use-fpu = <0x00>; + xlnx,use-hw-mul = <0x01>; + xlnx,use-icache = <0x01>; + xlnx,use-interrupt = <0x01>; + xlnx,use-mmu = <0x03>; + xlnx,use-msr-instr = <0x01>; + xlnx,use-pcmp-instr = <0x01>; + }; + }; + + plb { + #address-cells = <0x01>; + #size-cells = <0x01>; + compatible = "xlnx,plb-v46-1.03.a\0simple-bus"; + ranges; + + ethernet@81000000 { + compatible = "xlnx,xps-ethernetlite-2.00.a"; + device_type = "network"; + interrupt-parent = <0x01>; + interrupts = <0x01 0x00>; + local-mac-address = [02 00 00 00 00 00]; + reg = <0x81000000 0x10000>; + xlnx,duplex = <0x01>; + xlnx,family = "spartan3adsp"; + xlnx,rx-ping-pong = <0x00>; + xlnx,tx-ping-pong = <0x00>; + }; + + flash@a0000000 { + bank-width = <0x01>; + compatible = "xlnx,xps-mch-emc-2.00.a\0cfi-flash"; + reg = <0xa0000000 0x1000000>; + xlnx,family = "spartan3adsp"; + xlnx,include-datawidth-matching-0 = <0x01>; + xlnx,include-datawidth-matching-1 = <0x00>; + xlnx,include-datawidth-matching-2 = <0x00>; + xlnx,include-datawidth-matching-3 = <0x00>; + xlnx,include-negedge-ioregs = <0x00>; + xlnx,include-plb-ipif = <0x01>; + xlnx,include-wrbuf = <0x01>; + xlnx,max-mem-width = <0x08>; + xlnx,mch-native-dwidth = <0x20>; + xlnx,mch-plb-clk-period-ps = <0x3e80>; + xlnx,mch-splb-awidth = <0x20>; + xlnx,mch0-accessbuf-depth = <0x10>; + xlnx,mch0-protocol = <0x00>; + xlnx,mch0-rddatabuf-depth = <0x10>; + xlnx,mch1-accessbuf-depth = <0x10>; + xlnx,mch1-protocol = <0x00>; + xlnx,mch1-rddatabuf-depth = <0x10>; + xlnx,mch2-accessbuf-depth = <0x10>; + xlnx,mch2-protocol = <0x00>; + xlnx,mch2-rddatabuf-depth = <0x10>; + xlnx,mch3-accessbuf-depth = <0x10>; + xlnx,mch3-protocol = <0x00>; + xlnx,mch3-rddatabuf-depth = <0x10>; + xlnx,mem0-width = <0x08>; + xlnx,mem1-width = <0x20>; + xlnx,mem2-width = <0x20>; + xlnx,mem3-width = <0x20>; + xlnx,num-banks-mem = <0x01>; + xlnx,num-channels = <0x00>; + xlnx,priority-mode = <0x00>; + xlnx,synch-mem-0 = <0x00>; + xlnx,synch-mem-1 = <0x00>; + xlnx,synch-mem-2 = <0x00>; + xlnx,synch-mem-3 = <0x00>; + xlnx,synch-pipedelay-0 = <0x02>; + xlnx,synch-pipedelay-1 = <0x02>; + xlnx,synch-pipedelay-2 = <0x02>; + xlnx,synch-pipedelay-3 = <0x02>; + xlnx,tavdv-ps-mem-0 = <0x11170>; + xlnx,tavdv-ps-mem-1 = <0x3a98>; + xlnx,tavdv-ps-mem-2 = <0x3a98>; + xlnx,tavdv-ps-mem-3 = <0x3a98>; + xlnx,tcedv-ps-mem-0 = <0x11170>; + xlnx,tcedv-ps-mem-1 = <0x3a98>; + xlnx,tcedv-ps-mem-2 = <0x3a98>; + xlnx,tcedv-ps-mem-3 = <0x3a98>; + xlnx,thzce-ps-mem-0 = <0x61a8>; + xlnx,thzce-ps-mem-1 = <0x1b58>; + xlnx,thzce-ps-mem-2 = <0x1b58>; + xlnx,thzce-ps-mem-3 = <0x1b58>; + xlnx,thzoe-ps-mem-0 = <0x61a8>; + xlnx,thzoe-ps-mem-1 = <0x1b58>; + xlnx,thzoe-ps-mem-2 = <0x1b58>; + xlnx,thzoe-ps-mem-3 = <0x1b58>; + xlnx,tlzwe-ps-mem-0 = <0x1388>; + xlnx,tlzwe-ps-mem-1 = <0x00>; + xlnx,tlzwe-ps-mem-2 = <0x00>; + xlnx,tlzwe-ps-mem-3 = <0x00>; + xlnx,twc-ps-mem-0 = <0x11170>; + xlnx,twc-ps-mem-1 = <0x3a98>; + xlnx,twc-ps-mem-2 = <0x3a98>; + xlnx,twc-ps-mem-3 = <0x3a98>; + xlnx,twp-ps-mem-0 = <0xafc8>; + xlnx,twp-ps-mem-1 = <0x2ee0>; + xlnx,twp-ps-mem-2 = <0x2ee0>; + xlnx,twp-ps-mem-3 = <0x2ee0>; + xlnx,xcl0-linesize = <0x04>; + xlnx,xcl0-writexfer = <0x01>; + xlnx,xcl1-linesize = <0x04>; + xlnx,xcl1-writexfer = <0x01>; + xlnx,xcl2-linesize = <0x04>; + xlnx,xcl2-writexfer = <0x01>; + xlnx,xcl3-linesize = <0x04>; + xlnx,xcl3-writexfer = <0x01>; + }; + + gpio@81400000 { + compatible = "xlnx,xps-gpio-1.00.a"; + interrupt-parent = <0x01>; + interrupts = <0x02 0x02>; + reg = <0x81400000 0x10000>; + xlnx,all-inputs = <0x00>; + xlnx,all-inputs-2 = <0x00>; + xlnx,dout-default = <0x00>; + xlnx,dout-default-2 = <0x00>; + xlnx,family = "spartan3adsp"; + xlnx,gpio-width = <0x08>; + xlnx,interrupt-present = <0x01>; + xlnx,is-bidir = <0x00>; + xlnx,is-bidir-2 = <0x01>; + xlnx,is-dual = <0x00>; + xlnx,tri-default = <0xffffffff>; + xlnx,tri-default-2 = <0xffffffff>; + }; + + serial@84000000 { + clock-frequency = <0x3b9aca0>; + compatible = "xlnx,xps-uartlite-1.00.a"; + current-speed = <0x1c200>; + device_type = "serial"; + interrupt-parent = <0x01>; + interrupts = <0x03 0x00>; + port-number = <0x00>; + reg = <0x84000000 0x10000>; + xlnx,baudrate = <0x1c200>; + xlnx,data-bits = <0x08>; + xlnx,family = "spartan3adsp"; + xlnx,odd-parity = <0x00>; + xlnx,use-parity = <0x00>; + }; + + debug@84400000 { + compatible = "xlnx,mdm-1.00.d"; + reg = <0x84400000 0x10000>; + xlnx,family = "spartan3adsp"; + xlnx,interconnect = <0x01>; + xlnx,jtag-chain = <0x02>; + xlnx,mb-dbg-ports = <0x01>; + xlnx,uart-width = <0x08>; + xlnx,use-uart = <0x01>; + xlnx,write-fsl-ports = <0x00>; + }; + + interrupt-controller@81800000 { + #interrupt-cells = <0x02>; + compatible = "xlnx,xps-intc-1.00.a"; + interrupt-controller; + reg = <0x81800000 0x10000>; + xlnx,kind-of-intr = <0x0a>; + xlnx,num-intr-inputs = <0x04>; + linux,phandle = <0x01>; + }; + + timer@83c00000 { + compatible = "xlnx,xps-timer-1.00.a"; + interrupt-parent = <0x01>; + interrupts = <0x00 0x02>; + reg = <0x83c00000 0x10000>; + xlnx,count-width = <0x20>; + xlnx,family = "spartan3adsp"; + xlnx,gen0-assert = <0x01>; + xlnx,gen1-assert = <0x01>; + xlnx,one-timer-only = <0x00>; + xlnx,trig0-assert = <0x01>; + xlnx,trig1-assert = <0x01>; + }; + }; +}; diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile index 50bc880272..cc0f77baa6 100644 --- a/pc-bios/s390-ccw/Makefile +++ b/pc-bios/s390-ccw/Makefile @@ -3,10 +3,26 @@ all: build-all @true include ../../config-host.mak -include $(SRC_PATH)/rules.mak +quiet-command = $(if $(V),$1,$(if $(2),@printf " %-7s %s\n" $2 $3 && $1, @$1)) +cc-option = $(if $(shell $(CC) $1 -S -o /dev/null -xc /dev/null > /dev/null \ + 2>&1 && echo OK), $1, $2) + +VPATH_SUFFIXES = %.c %.h %.S %.m %.mak %.sh %.rc Kconfig% %.json.in +set-vpath = $(if $1,$(foreach PATTERN,$(VPATH_SUFFIXES),$(eval vpath $(PATTERN) $1))) $(call set-vpath, $(SRC_PATH)/pc-bios/s390-ccw) +# Flags for dependency generation +QEMU_DGFLAGS = -MMD -MP -MT $@ -MF $(@D)/$(*F).d + +%.o: %.c + $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) \ + -c -o $@ $<,"CC","$(TARGET_DIR)$@") + +%.o: %.S + $(call quiet-command,$(CCAS) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) \ + -c -o $@ $<,"CCAS","$(TARGET_DIR)$@") + .PHONY : all clean build-all OBJECTS = start.o main.o bootmap.o jump2ipl.o sclp.o menu.o \ diff --git a/pc-bios/vgabios-ati.bin b/pc-bios/vgabios-ati.bin Binary files differindex 3dbfe53e5c..118caacde6 100644 --- a/pc-bios/vgabios-ati.bin +++ b/pc-bios/vgabios-ati.bin diff --git a/pc-bios/vgabios-bochs-display.bin b/pc-bios/vgabios-bochs-display.bin Binary files differindex ca4c3db2db..d79124b760 100644 --- a/pc-bios/vgabios-bochs-display.bin +++ b/pc-bios/vgabios-bochs-display.bin diff --git a/pc-bios/vgabios-cirrus.bin b/pc-bios/vgabios-cirrus.bin Binary files differindex b8ee1fe0ff..37bf5e7fe7 100644 --- a/pc-bios/vgabios-cirrus.bin +++ b/pc-bios/vgabios-cirrus.bin diff --git a/pc-bios/vgabios-qxl.bin b/pc-bios/vgabios-qxl.bin Binary files differindex 9829cd1dec..0ff8ff21f0 100644 --- a/pc-bios/vgabios-qxl.bin +++ b/pc-bios/vgabios-qxl.bin diff --git a/pc-bios/vgabios-ramfb.bin b/pc-bios/vgabios-ramfb.bin Binary files differindex 12dcb8e823..df5e9d615a 100644 --- a/pc-bios/vgabios-ramfb.bin +++ b/pc-bios/vgabios-ramfb.bin diff --git a/pc-bios/vgabios-stdvga.bin b/pc-bios/vgabios-stdvga.bin Binary files differindex 68fe2fe820..70f6094153 100644 --- a/pc-bios/vgabios-stdvga.bin +++ b/pc-bios/vgabios-stdvga.bin diff --git a/pc-bios/vgabios-virtio.bin b/pc-bios/vgabios-virtio.bin Binary files differindex 60ce81d37c..65af5be59d 100644 --- a/pc-bios/vgabios-virtio.bin +++ b/pc-bios/vgabios-virtio.bin diff --git a/pc-bios/vgabios-vmware.bin b/pc-bios/vgabios-vmware.bin Binary files differindex b75a3517d1..89d42b32c1 100644 --- a/pc-bios/vgabios-vmware.bin +++ b/pc-bios/vgabios-vmware.bin diff --git a/pc-bios/vgabios.bin b/pc-bios/vgabios.bin Binary files differindex 410436fbdf..320471e18d 100644 --- a/pc-bios/vgabios.bin +++ b/pc-bios/vgabios.bin diff --git a/plugins/Makefile.objs b/plugins/Makefile.objs deleted file mode 100644 index 6f14d91ccb..0000000000 --- a/plugins/Makefile.objs +++ /dev/null @@ -1,21 +0,0 @@ -# -# Plugin Support -# - -obj-y += loader.o -obj-y += core.o -obj-y += api.o - -# Abuse -libs suffix to only link with --dynamic-list/-exported_symbols_list -# when the final binary includes the plugin object. -# -# Note that simply setting LDFLAGS is not enough: we build binaries that -# never link plugin.o, and the linker might fail (at least ld64 does) -# if the symbols in the list are not in the output binary. -ifdef CONFIG_HAS_LD_DYNAMIC_LIST -api.o-libs := -Wl,--dynamic-list=$(BUILD_DIR)/qemu-plugins-ld.symbols -else -ifdef CONFIG_HAS_LD_EXPORTED_SYMBOLS_LIST -api.o-libs := -Wl,-exported_symbols_list,$(BUILD_DIR)/qemu-plugins-ld64.symbols -endif -endif diff --git a/plugins/meson.build b/plugins/meson.build new file mode 100644 index 0000000000..e77723010e --- /dev/null +++ b/plugins/meson.build @@ -0,0 +1,13 @@ +if 'CONFIG_HAS_LD_DYNAMIC_LIST' in config_host + plugin_ldflags = ['-Wl,--dynamic-list=' + (meson.build_root() / 'qemu-plugins-ld.symbols')] +elif 'CONFIG_HAS_LD_EXPORTED_SYMBOLS_LIST' in config_host + plugin_ldflags = ['-Wl,-exported_symbols_list,' + (meson.build_root() / 'qemu-plugins-ld64.symbols')] +else + plugin_ldflags = [] +endif + +specific_ss.add(when: 'CONFIG_PLUGIN', if_true: [files( + 'loader.c', + 'core.c', + 'api.c', +), declare_dependency(link_args: plugin_ldflags)]) diff --git a/po/LINGUAS b/po/LINGUAS new file mode 100644 index 0000000000..cc4b5c3b36 --- /dev/null +++ b/po/LINGUAS @@ -0,0 +1,8 @@ +bg +de_DE +fr_FR +hu +it +sv +tr +zh_CN diff --git a/po/Makefile b/po/Makefile deleted file mode 100644 index c041f4c858..0000000000 --- a/po/Makefile +++ /dev/null @@ -1,52 +0,0 @@ -# This makefile is very special as it's meant to build as part of the build -# process and also within the source tree to update the translation files. - -# Set SRC_PATH for in-tree builds without configuration. -SRC_PATH=.. - -# The default target must come before any include statements. -all: - -.PHONY: all build clean install update - -%.mo: %.po - $(call quiet-command, msgfmt -o $@ $<,"GEN","$@") - --include ../config-host.mak -include $(SRC_PATH)/rules.mak - -PO_PATH=$(SRC_PATH)/po - -VERSION=$(shell cat $(SRC_PATH)/VERSION) -SRCS=$(filter-out $(PO_PATH)/messages.po,$(wildcard $(PO_PATH)/*.po)) -OBJS=$(patsubst $(PO_PATH)/%.po,%.mo,$(SRCS)) - -vpath %.po $(PO_PATH) - -all: - @echo "Use 'make update' to update translation files or use 'make build'" - @echo "or 'make install' to build and install the translation files." - -update: $(SRCS) - -build: $(OBJS) - -clean: - rm -f $(OBJS) - -install: $(OBJS) - for obj in $(OBJS); do \ - base=$$(basename $$obj .mo); \ - $(INSTALL) -d $(DESTDIR)$(prefix)/share/locale/$$base/LC_MESSAGES; \ - $(INSTALL) -m644 $$obj $(DESTDIR)$(prefix)/share/locale/$$base/LC_MESSAGES/qemu.mo; \ - done - -$(PO_PATH)/messages.po: $(SRC_PATH)/ui/gtk.c - $(call quiet-command, ( cd $(SRC_PATH) && \ - xgettext -o - --from-code=UTF-8 --foreign-user --no-location \ - --package-name=QEMU --package-version=$(VERSION) \ - --msgid-bugs-address=qemu-devel@nongnu.org -k_ -C ui/gtk.c | \ - sed -e s/CHARSET/UTF-8/) >$@,"GEN","$@") - -$(PO_PATH)/%.po: $(PO_PATH)/messages.po - $(call quiet-command, msgmerge -q $@ $< > $@.bak && mv $@.bak $@,"GEN","$@") diff --git a/po/POTFILES b/po/POTFILES new file mode 100644 index 0000000000..d34d5ed9aa --- /dev/null +++ b/po/POTFILES @@ -0,0 +1 @@ +ui/gtk.c diff --git a/po/meson.build b/po/meson.build new file mode 100644 index 0000000000..1387fd979a --- /dev/null +++ b/po/meson.build @@ -0,0 +1,7 @@ +i18n = import('i18n') + +if get_option('gettext') + i18n.gettext(meson.project_name(), + args: '--msgid-bugs-address=qemu-devel@nongnu.org', + preset: 'glib') +endif diff --git a/po/messages.po b/po/messages.po deleted file mode 100644 index 065bd459a0..0000000000 --- a/po/messages.po +++ /dev/null @@ -1,74 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# This file is put in the public domain. -# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: QEMU 2.12.91\n" -"Report-Msgid-Bugs-To: qemu-devel@nongnu.org\n" -"POT-Creation-Date: 2018-07-18 07:56+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" -"Language-Team: LANGUAGE <LL@li.org>\n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -msgid " - Press Ctrl+Alt+G to release grab" -msgstr "" - -msgid " [Paused]" -msgstr "" - -msgid "_Pause" -msgstr "" - -msgid "_Reset" -msgstr "" - -msgid "Power _Down" -msgstr "" - -msgid "_Quit" -msgstr "" - -msgid "_Fullscreen" -msgstr "" - -msgid "_Copy" -msgstr "" - -msgid "Zoom _In" -msgstr "" - -msgid "Zoom _Out" -msgstr "" - -msgid "Best _Fit" -msgstr "" - -msgid "Zoom To _Fit" -msgstr "" - -msgid "Grab On _Hover" -msgstr "" - -msgid "_Grab Input" -msgstr "" - -msgid "Show _Tabs" -msgstr "" - -msgid "Detach Tab" -msgstr "" - -msgid "Show Menubar" -msgstr "" - -msgid "_Machine" -msgstr "" - -msgid "_View" -msgstr "" diff --git a/qapi/Makefile.objs b/qapi/Makefile.objs deleted file mode 100644 index 4673ab7490..0000000000 --- a/qapi/Makefile.objs +++ /dev/null @@ -1,38 +0,0 @@ -util-obj-y = qapi-visit-core.o qapi-dealloc-visitor.o qobject-input-visitor.o -util-obj-y += qobject-output-visitor.o qmp-registry.o qmp-dispatch.o -util-obj-y += string-input-visitor.o string-output-visitor.o -util-obj-y += opts-visitor.o qapi-clone-visitor.o -util-obj-y += qmp-event.o -util-obj-y += qapi-util.o - -QAPI_COMMON_MODULES = audio authz block-core block char common control crypto -QAPI_COMMON_MODULES += dump error introspect job machine migration misc -QAPI_COMMON_MODULES += net pragma qdev qom rdma rocker run-state sockets tpm -QAPI_COMMON_MODULES += trace transaction ui -QAPI_TARGET_MODULES = machine-target misc-target -QAPI_MODULES = $(QAPI_COMMON_MODULES) $(QAPI_TARGET_MODULES) - -util-obj-y += qapi-builtin-types.o -util-obj-y += $(QAPI_COMMON_MODULES:%=qapi-types-%.o) -util-obj-y += qapi-builtin-visit.o -util-obj-y += $(QAPI_COMMON_MODULES:%=qapi-visit-%.o) -util-obj-y += qapi-emit-events.o -util-obj-y += $(QAPI_COMMON_MODULES:%=qapi-events-%.o) - -common-obj-y = $(QAPI_COMMON_MODULES:%=qapi-commands-%.o) - -obj-y = qapi-introspect.o -obj-y += $(QAPI_TARGET_MODULES:%=qapi-types-%.o) -obj-y += qapi-types.o -obj-y += $(QAPI_TARGET_MODULES:%=qapi-visit-%.o) -obj-y += qapi-visit.o -obj-y += $(QAPI_TARGET_MODULES:%=qapi-events-%.o) -obj-y += qapi-events.o -obj-y += $(QAPI_TARGET_MODULES:%=qapi-commands-%.o) -obj-y += qapi-commands.o -obj-y += qapi-init-commands.o - -QAPI_MODULES_STORAGE_DAEMON = block-core char common control crypto -QAPI_MODULES_STORAGE_DAEMON += introspect job qom sockets pragma transaction - -storage-daemon-obj-y += $(QAPI_MODULES_STORAGE_DAEMON:%=qapi-commands-%.o) diff --git a/qapi/machine.json b/qapi/machine.json index 481b1f07ec..abc6fd0477 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -357,13 +357,16 @@ # @default-cpu-type: default CPU model typename if none is requested via # the -cpu argument. (since 4.2) # +# @default-ram-id: the default ID of initial RAM memory backend (since 5.2) +# # Since: 1.2.0 ## { 'struct': 'MachineInfo', 'data': { 'name': 'str', '*alias': 'str', '*is-default': 'bool', 'cpu-max': 'int', 'hotpluggable-cpus': 'bool', 'numa-mem-supported': 'bool', - 'deprecated': 'bool', '*default-cpu-type': 'str' } } + 'deprecated': 'bool', '*default-cpu-type': 'str', + '*default-ram-id': 'str' } } ## # @query-machines: diff --git a/qapi/meson.build b/qapi/meson.build new file mode 100644 index 0000000000..2b2872a41d --- /dev/null +++ b/qapi/meson.build @@ -0,0 +1,125 @@ +util_ss.add(files( + 'opts-visitor.c', + 'qapi-clone-visitor.c', + 'qapi-dealloc-visitor.c', + 'qapi-util.c', + 'qapi-visit-core.c', + 'qmp-dispatch.c', + 'qmp-event.c', + 'qmp-registry.c', + 'qobject-input-visitor.c', + 'qobject-output-visitor.c', + 'string-input-visitor.c', + 'string-output-visitor.c', +)) + +qapi_all_modules = [ + 'audio', + 'authz', + 'block-core', + 'block', + 'char', + 'common', + 'control', + 'crypto', + 'dump', + 'error', + 'introspect', + 'job', + 'machine', + 'machine-target', + 'migration', + 'misc', + 'misc-target', + 'net', + 'pragma', + 'qdev', + 'qom', + 'rdma', + 'rocker', + 'run-state', + 'sockets', + 'tpm', + 'trace', + 'transaction', + 'ui', +] + +qapi_storage_daemon_modules = [ + 'block-core', + 'char', + 'common', + 'control', + 'crypto', + 'introspect', + 'job', + 'qom', + 'sockets', + 'pragma', + 'transaction', +] + +qapi_nonmodule_outputs = [ + 'qapi-introspect.c', 'qapi-introspect.h', + 'qapi-types.c', 'qapi-types.h', + 'qapi-visit.h', 'qapi-visit.c', + 'qapi-commands.h', 'qapi-commands.c', + 'qapi-init-commands.h', 'qapi-init-commands.c', + 'qapi-events.h', 'qapi-events.c', + 'qapi-emit-events.c', 'qapi-emit-events.h', +] + +# First build all sources +qapi_util_outputs = [ + 'qapi-builtin-types.c', 'qapi-builtin-visit.c', + 'qapi-builtin-types.h', 'qapi-builtin-visit.h', +] + +qapi_inputs = [] +qapi_specific_outputs = [] +foreach module : qapi_all_modules + qapi_inputs += [ files(module + '.json') ] + qapi_module_outputs = [ + 'qapi-types-@0@.c'.format(module), + 'qapi-types-@0@.h'.format(module), + 'qapi-visit-@0@.c'.format(module), + 'qapi-visit-@0@.h'.format(module), + 'qapi-events-@0@.c'.format(module), + 'qapi-events-@0@.h'.format(module), + 'qapi-commands-@0@.c'.format(module), + 'qapi-commands-@0@.h'.format(module), + ] + if module.endswith('-target') + qapi_specific_outputs += qapi_module_outputs + else + qapi_util_outputs += qapi_module_outputs + endif +endforeach + +qapi_files = custom_target('shared QAPI source files', + output: qapi_util_outputs + qapi_specific_outputs + qapi_nonmodule_outputs + ['qapi-doc.texi'], + input: [ files('qapi-schema.json') ], + command: [ qapi_gen, '-o', 'qapi', '-b', '@INPUT0@' ], + depend_files: [ qapi_inputs, qapi_gen_depends ]) + +# Now go through all the outputs and add them to the right sourceset. +# These loops must be synchronized with the output of the above custom target. + +i = 0 +foreach output : qapi_util_outputs + if output.endswith('.h') + genh += qapi_files[i] + endif + util_ss.add(qapi_files[i]) + i = i + 1 +endforeach + +foreach output : qapi_specific_outputs + qapi_nonmodule_outputs + if output.endswith('.h') + genh += qapi_files[i] + endif + specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: qapi_files[i]) + i = i + 1 +endforeach + +qapi_doc_texi = qapi_files[i] diff --git a/qapi/migration.json b/qapi/migration.json index ea53b23dca..5f6b06172c 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -509,6 +509,44 @@ { 'name': 'zstd', 'if': 'defined(CONFIG_ZSTD)' } ] } ## +# @BitmapMigrationBitmapAlias: +# +# @name: The name of the bitmap. +# +# @alias: An alias name for migration (for example the bitmap name on +# the opposite site). +# +# Since: 5.2 +## +{ 'struct': 'BitmapMigrationBitmapAlias', + 'data': { + 'name': 'str', + 'alias': 'str' + } } + +## +# @BitmapMigrationNodeAlias: +# +# Maps a block node name and the bitmaps it has to aliases for dirty +# bitmap migration. +# +# @node-name: A block node name. +# +# @alias: An alias block node name for migration (for example the +# node name on the opposite site). +# +# @bitmaps: Mappings for the bitmaps on this node. +# +# Since: 5.2 +## +{ 'struct': 'BitmapMigrationNodeAlias', + 'data': { + 'node-name': 'str', + 'alias': 'str', + 'bitmaps': [ 'BitmapMigrationBitmapAlias' ] + } } + +## # @MigrationParameter: # # Migration parameters enumeration @@ -642,6 +680,25 @@ # will consume more CPU. # Defaults to 1. (Since 5.0) # +# @block-bitmap-mapping: Maps block nodes and bitmaps on them to +# aliases for the purpose of dirty bitmap migration. Such +# aliases may for example be the corresponding names on the +# opposite site. +# The mapping must be one-to-one, but not necessarily +# complete: On the source, unmapped bitmaps and all bitmaps +# on unmapped nodes will be ignored. On the destination, +# encountering an unmapped alias in the incoming migration +# stream will result in a report, and all further bitmap +# migration data will then be discarded. +# Note that the destination does not know about bitmaps it +# does not receive, so there is no limitation or requirement +# regarding the number of bitmaps received, or how they are +# named, or on which nodes they are placed. +# By default (when this parameter has never been set), bitmap +# names are mapped to themselves. Nodes are mapped to their +# block device name if there is one, and to their node name +# otherwise. (Since 5.2) +# # Since: 2.4 ## { 'enum': 'MigrationParameter', @@ -656,7 +713,8 @@ 'multifd-channels', 'xbzrle-cache-size', 'max-postcopy-bandwidth', 'max-cpu-throttle', 'multifd-compression', - 'multifd-zlib-level' ,'multifd-zstd-level' ] } + 'multifd-zlib-level' ,'multifd-zstd-level', + 'block-bitmap-mapping' ] } ## # @MigrateSetParameters: @@ -782,6 +840,25 @@ # will consume more CPU. # Defaults to 1. (Since 5.0) # +# @block-bitmap-mapping: Maps block nodes and bitmaps on them to +# aliases for the purpose of dirty bitmap migration. Such +# aliases may for example be the corresponding names on the +# opposite site. +# The mapping must be one-to-one, but not necessarily +# complete: On the source, unmapped bitmaps and all bitmaps +# on unmapped nodes will be ignored. On the destination, +# encountering an unmapped alias in the incoming migration +# stream will result in a report, and all further bitmap +# migration data will then be discarded. +# Note that the destination does not know about bitmaps it +# does not receive, so there is no limitation or requirement +# regarding the number of bitmaps received, or how they are +# named, or on which nodes they are placed. +# By default (when this parameter has never been set), bitmap +# names are mapped to themselves. Nodes are mapped to their +# block device name if there is one, and to their node name +# otherwise. (Since 5.2) +# # Since: 2.4 ## # TODO either fuse back into MigrationParameters, or make @@ -812,7 +889,8 @@ '*max-cpu-throttle': 'int', '*multifd-compression': 'MultiFDCompression', '*multifd-zlib-level': 'int', - '*multifd-zstd-level': 'int' } } + '*multifd-zstd-level': 'int', + '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ] } } ## # @migrate-set-parameters: @@ -958,6 +1036,25 @@ # will consume more CPU. # Defaults to 1. (Since 5.0) # +# @block-bitmap-mapping: Maps block nodes and bitmaps on them to +# aliases for the purpose of dirty bitmap migration. Such +# aliases may for example be the corresponding names on the +# opposite site. +# The mapping must be one-to-one, but not necessarily +# complete: On the source, unmapped bitmaps and all bitmaps +# on unmapped nodes will be ignored. On the destination, +# encountering an unmapped alias in the incoming migration +# stream will result in a report, and all further bitmap +# migration data will then be discarded. +# Note that the destination does not know about bitmaps it +# does not receive, so there is no limitation or requirement +# regarding the number of bitmaps received, or how they are +# named, or on which nodes they are placed. +# By default (when this parameter has never been set), bitmap +# names are mapped to themselves. Nodes are mapped to their +# block device name if there is one, and to their node name +# otherwise. (Since 5.2) +# # Since: 2.4 ## { 'struct': 'MigrationParameters', @@ -986,7 +1083,8 @@ '*max-cpu-throttle': 'uint8', '*multifd-compression': 'MultiFDCompression', '*multifd-zlib-level': 'uint8', - '*multifd-zstd-level': 'uint8' } } + '*multifd-zstd-level': 'uint8', + '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ] } } ## # @query-migrate-parameters: diff --git a/qapi/trace.h b/qapi/trace.h new file mode 100644 index 0000000000..5c3fb674d8 --- /dev/null +++ b/qapi/trace.h @@ -0,0 +1 @@ +#include "trace/trace-qapi.h" diff --git a/qga/Makefile.objs b/qga/Makefile.objs deleted file mode 100644 index 9c558ae51c..0000000000 --- a/qga/Makefile.objs +++ /dev/null @@ -1,10 +0,0 @@ -commands-posix.o-libs := $(LIBUDEV_LIBS) -qga-obj-y = commands.o guest-agent-command-state.o main.o -qga-obj-$(CONFIG_POSIX) += commands-posix.o channel-posix.o -qga-obj-$(CONFIG_WIN32) += commands-win32.o channel-win32.o service-win32.o -qga-obj-$(CONFIG_WIN32) += vss-win32.o -qga-obj-y += qapi-generated/qga-qapi-types.o qapi-generated/qga-qapi-visit.o -qga-obj-y += qapi-generated/qga-qapi-commands.o -qga-obj-y += qapi-generated/qga-qapi-init-commands.o - -qga-vss-dll-obj-$(CONFIG_QGA_VSS) += vss-win32/ diff --git a/qga/installer/qemu-ga.wxs b/qga/installer/qemu-ga.wxs index f6781752e6..9cb4c3d733 100644 --- a/qga/installer/qemu-ga.wxs +++ b/qga/installer/qemu-ga.wxs @@ -66,7 +66,7 @@ <Directory Id="$(var.GaProgramFilesFolder)" Name="QEMU Guest Agent"> <Directory Id="qemu_ga_directory" Name="Qemu-ga"> <Component Id="qemu_ga" Guid="{908B7199-DE2A-4DC6-A8D0-27A5AE444FEA}"> - <File Id="qemu_ga.exe" Name="qemu-ga.exe" Source="$(env.BUILD_DIR)/qemu-ga.exe" KeyPath="yes" DiskId="1"/> + <File Id="qemu_ga.exe" Name="qemu-ga.exe" Source="$(env.BUILD_DIR)/qga/qemu-ga.exe" KeyPath="yes" DiskId="1"/> <ServiceInstall Id="ServiceInstaller" Type="ownProcess" diff --git a/qga/meson.build b/qga/meson.build new file mode 100644 index 0000000000..3f28f74b52 --- /dev/null +++ b/qga/meson.build @@ -0,0 +1,87 @@ +qga_qapi_outputs = [ + 'qga-qapi-commands.c', + 'qga-qapi-commands.h', + 'qga-qapi-emit-events.c', + 'qga-qapi-emit-events.h', + 'qga-qapi-events.c', + 'qga-qapi-events.h', + 'qga-qapi-init-commands.c', + 'qga-qapi-init-commands.h', + 'qga-qapi-introspect.c', + 'qga-qapi-introspect.h', + 'qga-qapi-types.c', + 'qga-qapi-types.h', + 'qga-qapi-visit.c', + 'qga-qapi-visit.h', +] + +qga_qapi_files = custom_target('QGA QAPI files', + output: qga_qapi_outputs + ['qga-qapi-doc.texi'], + input: 'qapi-schema.json', + command: [ qapi_gen, '-o', 'qga', '-p', 'qga-', '@INPUT0@' ], + depend_files: qapi_gen_depends) + +qga_ss = ss.source_set() +i = 0 +foreach output: qga_qapi_outputs + qga_ss.add(qga_qapi_files[i]) + i = i + 1 +endforeach +qga_qapi_doc_texi = qga_qapi_files[i] + +qga_ss.add(files( + 'commands.c', + 'guest-agent-command-state.c', + 'main.c', +)) +qga_ss.add(when: 'CONFIG_POSIX', if_true: files( + 'channel-posix.c', + 'commands-posix.c')) +qga_ss.add(when: 'CONFIG_WIN32', if_true: files( + 'channel-win32.c', + 'commands-win32.c', + 'service-win32.c', + 'vss-win32.c' +)) + +qga_ss = qga_ss.apply(config_host, strict: false) + +qga = executable('qemu-ga', qga_ss.sources(), + link_args: config_host['LIBS_QGA'].split(), + dependencies: [qemuutil, libudev], + install: true) +all_qga = [qga] + +if targetos == 'windows' + if 'CONFIG_QGA_VSS' in config_host + subdir('vss-win32') + else + gen_tlb = [] + endif + + wixl = find_program('wixl', required: false) + if wixl.found() + deps = [gen_tlb, qga] + if 'CONFIG_QGA_VSS' in config_host and 'QEMU_GA_MSI_WITH_VSS' in config_host + deps += qga_vss + endif + qga_msi = custom_target('QGA MSI', + input: files('installer/qemu-ga.wxs'), + output: 'qemu-ga-@0@.msi'.format(config_host['ARCH']), + depends: deps, + command: [ + 'QEMU_GA_VERSION=' + config_host['QEMU_GA_VERSION'], + 'QEMU_GA_MANUFACTURER=' + config_host['QEMU_GA_MANUFACTURER'], + 'QEMU_GA_DISTRO=' + config_host['QEMU_GA_DISTRO'], + 'BUILD_DIR=' + meson.build_root(), + wixl, '-o', '@OUTPUT0@', '@INPUT0@', + config_host['QEMU_GA_MSI_ARCH'].split(), + config_host['QEMU_GA_MSI_WITH_VSS'].split(), + config_host['QEMU_GA_MSI_MINGW_DLL_PATH'].split(), + ]) + all_qga += [qga_msi] + alias_target('msi', qga_msi) + endif +endif + +alias_target('qemu-ga', all_qga) diff --git a/qga/vss-win32/Makefile.objs b/qga/vss-win32/Makefile.objs deleted file mode 100644 index c82676aeb8..0000000000 --- a/qga/vss-win32/Makefile.objs +++ /dev/null @@ -1,23 +0,0 @@ -# rules to build qga-vss.dll - -qga-vss-dll-obj-y += requester.o provider.o install.o - -obj-qga-vss-dll-obj-y = $(addprefix $(obj)/, $(qga-vss-dll-obj-y)) -$(obj-qga-vss-dll-obj-y): QEMU_CXXFLAGS := $(filter-out -fstack-protector-all -fstack-protector-strong, $(QEMU_CXXFLAGS)) -Wno-unknown-pragmas -Wno-delete-non-virtual-dtor - -QGA_VSS_LDFLAGS = -shared -Wl,--add-stdcall-alias,--enable-stdcall-fixup -lglib-2.0 -lole32 -loleaut32 -lshlwapi -luuid -lintl -lws2_32 -static -$(obj)/qga-vss.dll: $(obj-qga-vss-dll-obj-y) $(SRC_PATH)/$(obj)/qga-vss.def - $(call quiet-command,$(CXX) -o $@ $(qga-vss-dll-obj-y) $(SRC_PATH)/qga/vss-win32/qga-vss.def $(CXXFLAGS) $(QGA_VSS_LDFLAGS),"LINK","$(TARGET_DIR)$@") - - -# rules to build qga-provider.tlb -# Currently, only native build is supported because building .tlb -# (TypeLibrary) from .idl requires WindowsSDK and MIDL (and cl.exe in VC++). -MIDL=$(WIN_SDK)/Bin/midl - -$(obj)/qga-vss.tlb: $(SRC_PATH)/$(obj)/qga-vss.idl -ifeq ($(WIN_SDK),"") - $(call quiet-command,cp $(dir $<)qga-vss.tlb $@,"COPY","$(TARGET_DIR)$@") -else - $(call quiet-command,$(MIDL) -tlb $@ -I $(WIN_SDK)/Include $<,"MIDL","$(TARGET_DIR)$@") -endif diff --git a/qga/vss-win32/meson.build b/qga/vss-win32/meson.build new file mode 100644 index 0000000000..780c461432 --- /dev/null +++ b/qga/vss-win32/meson.build @@ -0,0 +1,36 @@ +if add_languages('cpp', required: false) + glib_static = dependency('glib-2.0', static: true) + link_args = cc.get_supported_link_arguments(['-fstack-protector-all', '-fstack-protector-strong', + '-Wl,--add-stdcall-alias', '-Wl,--enable-stdcall-fixup']) + + qga_vss = shared_module('qga-vss', ['requester.cpp', 'provider.cpp', 'install.cpp'], + name_prefix: '', + cpp_args: ['-Wno-unknown-pragmas', '-Wno-delete-non-virtual-dtor', '-Wno-non-virtual-dtor'], + link_args: link_args, + vs_module_defs: 'qga-vss.def', + dependencies: [glib_static, socket, + cc.find_library('ole32'), + cc.find_library('oleaut32'), + cc.find_library('shlwapi'), + cc.find_library('uuid'), + cc.find_library('intl')]) + + all_qga += qga_vss +endif + +# rules to build qga-vss.tlb +# Currently, only native build is supported because building .tlb +# (TypeLibrary) from .idl requires WindowsSDK and MIDL (and cl.exe in VC++). +midl = find_program('midl', required: false) +if midl.found() + gen_tlb = custom_target('gen-tlb', + input: 'qga-vss.idl', + output: 'qga-vss.tlb', + command: [midl, '-tlb', '-I' + config_host['WIN_SDK'], + '@INPUT@', '@OUTPUT@']) +else + gen_tlb = custom_target('gen-tlb', + input: 'qga-vss.tlb', + output: 'qga-vss.tlb', + command: ['cp', '@INPUT@', '@OUTPUT@']) +endif diff --git a/qobject/Makefile.objs b/qobject/Makefile.objs deleted file mode 100644 index 7b12c9cacf..0000000000 --- a/qobject/Makefile.objs +++ /dev/null @@ -1,3 +0,0 @@ -util-obj-y = qnull.o qnum.o qstring.o qdict.o qlist.o qbool.o qlit.o -util-obj-y += qjson.o qobject.o json-lexer.o json-streamer.o json-parser.o -util-obj-y += block-qdict.o diff --git a/qobject/meson.build b/qobject/meson.build new file mode 100644 index 0000000000..bb63c06b63 --- /dev/null +++ b/qobject/meson.build @@ -0,0 +1,3 @@ +util_ss.add(files('qnull.c', 'qnum.c', 'qstring.c', 'qdict.c', 'qlist.c', 'qbool.c', + 'qlit.c', 'qjson.c', 'qobject.c', 'json-lexer.c', 'json-streamer.c', 'json-parser.c', + 'block-qdict.c')) diff --git a/qom/Makefile.objs b/qom/Makefile.objs deleted file mode 100644 index 1b45d104ba..0000000000 --- a/qom/Makefile.objs +++ /dev/null @@ -1,5 +0,0 @@ -qom-obj-y = object.o container.o qom-qobject.o -qom-obj-y += object_interfaces.o - -common-obj-$(CONFIG_SOFTMMU) += qom-hmp-cmds.o qom-qmp-cmds.o -storage-daemon-obj-y += qom-qmp-cmds.o diff --git a/qom/meson.build b/qom/meson.build new file mode 100644 index 0000000000..a1cd03c82c --- /dev/null +++ b/qom/meson.build @@ -0,0 +1,18 @@ +qom_ss = ss.source_set() +qom_ss.add(genh) +qom_ss.add(files( + 'container.c', + 'object.c', + 'object_interfaces.c', + 'qom-qobject.c', +)) + +qmp_ss.add(files('qom-qmp-cmds.c')) +softmmu_ss.add(files('qom-hmp-cmds.c')) + +qom_ss = qom_ss.apply(config_host, strict: false) +libqom = static_library('qom', qom_ss.sources() + genh, + dependencies: [qom_ss.dependencies()], + name_suffix: 'fa') + +qom = declare_dependency(link_whole: libqom) diff --git a/qom/trace.h b/qom/trace.h new file mode 100644 index 0000000000..f2895e699b --- /dev/null +++ b/qom/trace.h @@ -0,0 +1 @@ +#include "trace/trace-qom.h" diff --git a/replay/Makefile.objs b/replay/Makefile.objs deleted file mode 100644 index 939be964a9..0000000000 --- a/replay/Makefile.objs +++ /dev/null @@ -1,10 +0,0 @@ -common-obj-y += replay.o -common-obj-y += replay-internal.o -common-obj-y += replay-events.o -common-obj-y += replay-time.o -common-obj-y += replay-input.o -common-obj-y += replay-char.o -common-obj-y += replay-snapshot.o -common-obj-y += replay-net.o -common-obj-y += replay-audio.o -common-obj-y += replay-random.o diff --git a/replay/meson.build b/replay/meson.build new file mode 100644 index 0000000000..8783aea7c8 --- /dev/null +++ b/replay/meson.build @@ -0,0 +1,12 @@ +softmmu_ss.add(files( + 'replay.c', + 'replay-internal.c', + 'replay-events.c', + 'replay-time.c', + 'replay-input.c', + 'replay-char.c', + 'replay-snapshot.c', + 'replay-net.c', + 'replay-audio.c', + 'replay-random.c', +)) diff --git a/roms/Makefile b/roms/Makefile index f9acf39954..5d9f15b677 100644 --- a/roms/Makefile +++ b/roms/Makefile @@ -64,10 +64,8 @@ default help: @echo " u-boot.e500 -- update u-boot.e500" @echo " u-boot.sam460 -- update u-boot.sam460" @echo " efi -- update UEFI (edk2) platform firmware" - @echo " opensbi32-virt -- update OpenSBI for 32-bit virt machine" - @echo " opensbi64-virt -- update OpenSBI for 64-bit virt machine" - @echo " opensbi32-sifive_u -- update OpenSBI for 32-bit sifive_u machine" - @echo " opensbi64-sifive_u -- update OpenSBI for 64-bit sifive_u machine" + @echo " opensbi32-generic -- update OpenSBI for 32-bit generic machine" + @echo " opensbi64-generic -- update OpenSBI for 64-bit generic machine" @echo " bios-microvm -- update bios-microvm.bin (qboot)" @echo " clean -- delete the files generated by the previous" \ "build targets" @@ -170,29 +168,19 @@ skiboot: efi: edk2-basetools $(MAKE) -f Makefile.edk2 -opensbi32-virt: +opensbi32-generic: $(MAKE) -C opensbi \ CROSS_COMPILE=$(riscv32_cross_prefix) \ - PLATFORM="qemu/virt" - cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-virt-fw_jump.bin + PLATFORM="generic" + cp opensbi/build/platform/generic/firmware/fw_dynamic.bin ../pc-bios/opensbi-riscv32-generic-fw_dynamic.bin + cp opensbi/build/platform/generic/firmware/fw_dynamic.elf ../pc-bios/opensbi-riscv32-generic-fw_dynamic.elf -opensbi64-virt: +opensbi64-generic: $(MAKE) -C opensbi \ CROSS_COMPILE=$(riscv64_cross_prefix) \ - PLATFORM="qemu/virt" - cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-virt-fw_jump.bin - -opensbi32-sifive_u: - $(MAKE) -C opensbi \ - CROSS_COMPILE=$(riscv32_cross_prefix) \ - PLATFORM="sifive/fu540" - cp opensbi/build/platform/sifive/fu540/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-sifive_u-fw_jump.bin - -opensbi64-sifive_u: - $(MAKE) -C opensbi \ - CROSS_COMPILE=$(riscv64_cross_prefix) \ - PLATFORM="sifive/fu540" - cp opensbi/build/platform/sifive/fu540/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin + PLATFORM="generic" + cp opensbi/build/platform/generic/firmware/fw_dynamic.bin ../pc-bios/opensbi-riscv64-generic-fw_dynamic.bin + cp opensbi/build/platform/generic/firmware/fw_dynamic.elf ../pc-bios/opensbi-riscv64-generic-fw_dynamic.elf bios-microvm: $(MAKE) -C qboot diff --git a/roms/opensbi b/roms/opensbi -Subproject 9f1b72ce66d659e91013b358939e832fb27223f +Subproject a98258d0b537a295f517bbc8d813007336731fa diff --git a/roms/seabios b/roms/seabios -Subproject d9c812dda519a1a73e8370e1b81ddf46eb22ed1 +Subproject 155821a1990b6de78dde5f98fa5ab90e802021e @@ -21,7 +21,6 @@ MAKEFLAGS += -rR %.cpp: %.m: %.mak: -clean-target: # Flags for dependency generation QEMU_DGFLAGS += -MMD -MP -MT $@ -MF $(@D)/$(*F).d @@ -32,53 +31,32 @@ QEMU_DGFLAGS += -MMD -MP -MT $@ -MF $(@D)/$(*F).d # dir, one absolute and the other relative to the compiler working # directory. These are the same for target-independent files, but # different for target-dependent ones. -QEMU_LOCAL_INCLUDES = -iquote $(BUILD_DIR)/$(@D) -iquote $(@D) +QEMU_LOCAL_INCLUDES = -iquote $(BUILD_DIR) -iquote $(BUILD_DIR)/$(@D) -iquote $(@D) -WL_U := -Wl,-u, -find-symbols = $(if $1, $(sort $(shell $(NM) -P -g $1 | $2))) -defined-symbols = $(call find-symbols,$1,awk '$$2!="U"{print $$1}') -undefined-symbols = $(call find-symbols,$1,awk '$$2=="U"{print $$1}') +WL := -Wl, +ifdef CONFIG_DARWIN +whole-archive = $(WL)-force_load,$1 +else +whole-archive = $(WL)--whole-archive $1 $(WL)--no-whole-archive +endif -# All the .mo objects in -m variables are also added into corresponding -y -# variable in unnest-vars, but filtered out here, when LINK is called. -# -# The .mo objects are supposed to be linked as a DSO, for module build. So here -# they are only used as a placeholders to generate those "archive undefined" -# symbol options (-Wl,-u,$symbol_name), which are the archive functions -# referenced by the code in the DSO. -# -# Also the presence in -y variables will also guarantee they are built before -# linking executables that will load them. So we can look up symbol reference -# in LINK. -# -# This is necessary because the exectuable itself may not use the function, in -# which case the function would not be linked in. Then the DSO loading will -# fail because of the missing symbol. -process-archive-undefs = $(filter-out %.a %.mo,$1) \ - $(addprefix $(WL_U), \ - $(filter $(call defined-symbols,$(filter %.a, $1)), \ - $(call undefined-symbols,$(filter %.mo,$1)))) \ - $(filter %.a,$1) - -extract-libs = $(strip $(foreach o,$(filter-out %.mo,$1),$($o-libs))) -expand-objs = $(strip $(sort $(filter %.o,$1)) \ - $(foreach o,$(filter %.mo,$1),$($o-objs)) \ - $(filter-out %.o %.mo,$1)) +extract-libs = $(strip $(foreach o,$1,$($o-libs))) %.o: %.c + @mkdir -p $(dir $@) $(call quiet-command,$(CC) $(QEMU_LOCAL_INCLUDES) $(QEMU_INCLUDES) \ $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) $($@-cflags) \ -c -o $@ $<,"CC","$(TARGET_DIR)$@") -%.o: %.rc - $(call quiet-command,$(WINDRES) -I. -o $@ $<,"RC","$(TARGET_DIR)$@") # If we have a CXX we might have some C++ objects, in which case we # must link with the C++ compiler, not the plain C compiler. LINKPROG = $(or $(CXX),$(CC)) LINK = $(call quiet-command, $(LINKPROG) $(CFLAGS) $(QEMU_LDFLAGS) -o $@ \ - $(call process-archive-undefs, $1) \ - $(version-obj-y) $(call extract-libs,$1) $(LIBS),"LINK","$(TARGET_DIR)$@") + $(filter-out %.a %.fa,$1) \ + $(foreach l,$(filter %.fa,$1),$(call whole-archive,$l)) \ + $(filter %.a,$1) \ + $(call extract-libs,$1) $(LIBS),"LINK","$(TARGET_DIR)$@") %.o: %.S $(call quiet-command,$(CCAS) $(QEMU_LOCAL_INCLUDES) $(QEMU_INCLUDES) \ @@ -87,12 +65,12 @@ LINK = $(call quiet-command, $(LINKPROG) $(CFLAGS) $(QEMU_LDFLAGS) -o $@ \ %.o: %.cc $(call quiet-command,$(CXX) $(QEMU_LOCAL_INCLUDES) $(QEMU_INCLUDES) \ - $(QEMU_CXXFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) $($@-cflags) \ + $(QEMU_CXXFLAGS) $(QEMU_DGFLAGS) $(CXXFLAGS) $($@-cflags) \ -c -o $@ $<,"CXX","$(TARGET_DIR)$@") %.o: %.cpp $(call quiet-command,$(CXX) $(QEMU_LOCAL_INCLUDES) $(QEMU_INCLUDES) \ - $(QEMU_CXXFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) $($@-cflags) \ + $(QEMU_CXXFLAGS) $(QEMU_DGFLAGS) $(CXXFLAGS) $($@-cflags) \ -c -o $@ $<,"CXX","$(TARGET_DIR)$@") %.o: %.m @@ -103,25 +81,11 @@ LINK = $(call quiet-command, $(LINKPROG) $(CFLAGS) $(QEMU_LDFLAGS) -o $@ \ %.o: %.dtrace $(call quiet-command,dtrace -o $@ -G -s $<,"GEN","$(TARGET_DIR)$@") -DSO_OBJ_CFLAGS := -fPIC -DBUILD_DSO -module-common.o: CFLAGS += $(DSO_OBJ_CFLAGS) -%$(DSOSUF): QEMU_LDFLAGS += $(LDFLAGS_SHARED) -%$(DSOSUF): %.mo - $(call LINK,$^) - @# Copy to build root so modules can be loaded when program started without install - $(if $(findstring /,$@),$(call quiet-command,cp $@ $(subst /,-,$@),"CP","$(subst /,-,$@)")) - - -LD_REL := $(CC) -nostdlib $(LD_REL_FLAGS) - -%.mo: - $(call quiet-command,$(LD_REL) -o $@ $^,"LD","$(TARGET_DIR)$@") - .PHONY: modules modules: %$(EXESUF): %.o - $(call LINK,$(filter %.o %.a %.mo, $^)) + $(call LINK,$(filter %.o %.a %.fa, $^)) %.a: $(call quiet-command,rm -f $@ && $(AR) rcs $@ $^,"AR","$(TARGET_DIR)$@") @@ -154,15 +118,6 @@ define install-prog $(if $(STRIP),$(STRIP) $(foreach T,$1,"$2/$(notdir $T)"),) endef -# find-in-path -# Usage: $(call find-in-path, prog) -# Looks in the PATH if the argument contains no slash, else only considers one -# specific directory. Returns an # empty string if the program doesn't exist -# there. -find-in-path = $(if $(findstring /, $1), \ - $(wildcard $1), \ - $(wildcard $(patsubst %, %/$1, $(subst :, ,$(PATH))))) - # Logical functions (for operating on y/n values like CONFIG_FOO vars) # Inputs to these must be either "y" (true) or "n" or "" (both false) # Output is always either "y" or "n". @@ -191,17 +146,6 @@ ne = $(if $(subst $2,,$1)$(subst $1,,$2),y,n) isempty = $(if $1,n,y) notempty = $(if $1,y,n) -# Generate files with tracetool -TRACETOOL=$(PYTHON) $(SRC_PATH)/scripts/tracetool.py - -# Generate timestamp files for .h include files - -config-%.h: config-%.h-timestamp - @cmp $< $@ >/dev/null 2>&1 || cp $< $@ - -config-%.h-timestamp: config-%.mak $(SRC_PATH)/scripts/create_config - $(call quiet-command, sh $(SRC_PATH)/scripts/create_config < $< > $@,"GEN","$(TARGET_DIR)config-$*.h") - .PHONY: clean-timestamp clean-timestamp: rm -f *.timestamp @@ -210,231 +154,5 @@ clean: clean-timestamp # will delete the target of a rule if commands exit with a nonzero exit status .DELETE_ON_ERROR: -# save-vars -# Usage: $(call save-vars, vars) -# Save each variable $v in $vars as save-vars-$v, save their object's -# variables, then clear $v. saved-vars-$v contains the variables that -# where saved for the objects, in order to speedup load-vars. -define save-vars - $(foreach v,$1, - $(eval save-vars-$v := $(value $v)) - $(eval saved-vars-$v := $(foreach o,$($v), \ - $(if $($o-cflags), $o-cflags $(eval save-vars-$o-cflags := $($o-cflags))$(eval $o-cflags := )) \ - $(if $($o-libs), $o-libs $(eval save-vars-$o-libs := $($o-libs))$(eval $o-libs := )) \ - $(if $($o-objs), $o-objs $(eval save-vars-$o-objs := $($o-objs))$(eval $o-objs := )))) - $(eval $v := )) -endef - -# load-vars -# Usage: $(call load-vars, vars, add_var) -# Load the saved value for each variable in @vars, and the per object -# variables. -# Append @add_var's current value to the loaded value. -define load-vars - $(eval $2-new-value := $(value $2)) - $(foreach v,$1, - $(eval $v := $(value save-vars-$v)) - $(foreach o,$(saved-vars-$v), - $(eval $o := $(save-vars-$o)) $(eval save-vars-$o := )) - $(eval save-vars-$v := ) - $(eval saved-vars-$v := )) - $(eval $2 := $(value $2) $($2-new-value)) -endef - -# fix-paths -# Usage: $(call fix-paths, obj_path, src_path, vars) -# Add prefix @obj_path to all objects in @vars, and add prefix @src_path to all -# directories in @vars. -define fix-paths - $(foreach v,$3, - $(foreach o,$($v), - $(if $($o-libs), - $(eval $1$o-libs := $($o-libs))) - $(if $($o-cflags), - $(eval $1$o-cflags := $($o-cflags))) - $(if $($o-objs), - $(eval $1$o-objs := $(addprefix $1,$($o-objs))))) - $(eval $v := $(addprefix $1,$(filter-out %/,$($v))) \ - $(addprefix $2,$(filter %/,$($v))))) -endef - -# unnest-var-recursive -# Usage: $(call unnest-var-recursive, obj_prefix, vars, var) -# -# Unnest @var by including subdir Makefile.objs, while protect others in @vars -# unchanged. -# -# @obj_prefix is the starting point of object path prefix. -# -define unnest-var-recursive - $(eval dirs := $(sort $(filter %/,$($3)))) - $(eval $3 := $(filter-out %/,$($3))) - $(foreach d,$(dirs:%/=%), - $(call save-vars,$2) - $(eval obj := $(if $1,$1/)$d) - $(eval -include $(SRC_PATH)/$d/Makefile.objs) - $(call fix-paths,$(if $1,$1/)$d/,$d/,$2) - $(call load-vars,$2,$3) - $(call unnest-var-recursive,$1,$2,$3)) -endef - -# unnest-vars -# Usage: $(call unnest-vars, obj_prefix, vars) -# -# @obj_prefix: object path prefix, can be empty, or '..', etc. Don't include -# ending '/'. -# -# @vars: the list of variable names to unnest. -# -# This macro will scan subdirectories's Makefile.objs, include them, to build -# up each variable listed in @vars. -# -# Per object and per module cflags and libs are saved with relative path fixed -# as well, those variables include -libs, -cflags and -objs. Items in -objs are -# also fixed to relative path against SRC_PATH plus the prefix @obj_prefix. -# -# All nested variables postfixed by -m in names are treated as DSO variables, -# and will be built as modules, if enabled. -# -# A simple example of the unnest: -# -# obj_prefix = .. -# vars = hot cold -# hot = fire.o sun.o season/ -# cold = snow.o water/ season/ -# -# Unnest through a faked source directory structure: -# -# SRC_PATH -# ├── water -# │ └── Makefile.objs──────────────────┐ -# │ │ hot += steam.o │ -# │ │ cold += ice.mo │ -# │ │ ice.mo-libs := -licemaker │ -# │ │ ice.mo-objs := ice1.o ice2.o │ -# │ └──────────────────────────────┘ -# │ -# └── season -# └── Makefile.objs──────┐ -# │ hot += summer.o │ -# │ cold += winter.o │ -# └──────────────────┘ -# -# In the end, the result will be: -# -# hot = ../fire.o ../sun.o ../season/summer.o -# cold = ../snow.o ../water/ice.mo ../season/winter.o -# ../water/ice.mo-libs = -licemaker -# ../water/ice.mo-objs = ../water/ice1.o ../water/ice2.o -# -# Note that 'hot' didn't include 'water/' in the input, so 'steam.o' is not -# included. -# -define unnest-vars - # In the case of target build (i.e. $1 == ..), fix path for top level - # Makefile.objs objects - $(if $1,$(call fix-paths,$1/,,$2)) - - # Descend and include every subdir Makefile.objs - $(foreach v, $2, - $(call unnest-var-recursive,$1,$2,$v) - # Pass the .mo-cflags and .mo-libs along to its member objects - $(foreach o, $(filter %.mo,$($v)), - $(foreach p,$($o-objs), - $(if $($o-cflags), $(eval $p-cflags += $($o-cflags))) - $(if $($o-libs), $(eval $p-libs += $($o-libs)))))) - - # For all %.mo objects that are directly added into -y, just expand them - $(foreach v,$(filter %-y,$2), - $(eval $v := $(foreach o,$($v),$(if $($o-objs),$($o-objs),$o)))) - - $(foreach v,$(filter %-m,$2), - # All .o found in *-m variables are single object modules, create .mo - # for them - $(foreach o,$(filter %.o,$($v)), - $(eval $(o:%.o=%.mo)-objs := $o)) - # Now unify .o in -m variable to .mo - $(eval $v := $($v:%.o=%.mo)) - $(eval modules-m += $($v)) - - # For module build, build shared libraries during "make modules" - # For non-module build, add -m to -y - $(if $(CONFIG_MODULES), - $(foreach o,$($v), - $(eval $($o-objs): CFLAGS += $(DSO_OBJ_CFLAGS)) - $(eval $o: $($o-objs))) - $(eval $(patsubst %-m,%-y,$v) += $($v)) - $(eval modules: $($v:%.mo=%$(DSOSUF))), - $(eval $(patsubst %-m,%-y,$v) += $(call expand-objs, $($v))))) - - # Post-process all the unnested vars - $(foreach v,$2, - $(foreach o, $(filter %.mo,$($v)), - # Find all the .mo objects in variables and add dependency rules - # according to .mo-objs. Report error if not set - $(if $($o-objs), - $(eval $(o:%.mo=%$(DSOSUF)): module-common.o $($o-objs)), - $(error $o added in $v but $o-objs is not set))) - $(shell mkdir -p ./ $(sort $(dir $($v)))) - # Include all the .d files - $(eval -include $(patsubst %.o,%.d,$(patsubst %.mo,%.d,$($v)))) - $(eval $v := $(filter-out %/,$($v)))) -endef - -TEXI2MAN = $(call quiet-command, \ - perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $(TEXI2PODFLAGS) $< $@.pod && \ - $(POD2MAN) --section=$(subst .,,$(suffix $@)) --center=" " --release=" " $@.pod > $@, \ - "GEN","$@") - -%.1: - $(call TEXI2MAN) -%.7: - $(call TEXI2MAN) -%.8: - $(call TEXI2MAN) - -GEN_SUBST = $(call quiet-command, \ - sed -e "s!@libexecdir@!$(libexecdir)!g" < $< > $@, \ - "GEN","$@") - -%.json: %.json.in - $(call GEN_SUBST) - -# Support for building multiple output files by atomically executing -# a single rule which depends on several input files (so the rule -# will be executed exactly once, not once per output file, and -# not multiple times in parallel.) For more explanation see: -# https://www.cmcrossroads.com/article/atomic-rules-gnu-make - -# Given a space-separated list of filenames, create the name of -# a 'sentinel' file to use to indicate that they have been built. -# We use fixed text on the end to avoid accidentally triggering -# automatic pattern rules, and . on the start to make the file -# not show up in ls output. -sentinel = .$(subst $(SPACE),_,$(subst /,_,$1)).sentinel. - -# Define an atomic rule that builds multiple outputs from multiple inputs. -# To use: -# $(call atomic,out1 out2 ...,in1 in2 ...) -# <TAB>rule to do the operation -# -# Make 4.3 will have native support for this, and you would be able -# to instead write: -# out1 out2 ... &: in1 in2 ... -# <TAB>rule to do the operation -# -# The way this works is that it creates a make rule -# "out1 out2 ... : sentinel-file ; @:" which says that the sentinel -# depends on the dependencies, and the rule to do that is "do nothing". -# Then we have a rule -# "sentinel-file : in1 in2 ..." -# whose commands start with "touch sentinel-file" and then continue -# with the rule text provided by the user of this 'atomic' function. -# The foreach... is there to delete the sentinel file if any of the -# output files don't exist, so that we correctly rebuild in that situation. -atomic = $(eval $1: $(call sentinel,$1) ; @:) \ - $(call sentinel,$1) : $2 ; @touch $$@ \ - $(foreach t,$1,$(if $(wildcard $t),,$(shell rm -f $(call sentinel,$1)))) - print-%: @echo '$*=$($*)' diff --git a/scripts/archive-source.sh b/scripts/archive-source.sh index fb5d6b3918..c6169db69f 100755 --- a/scripts/archive-source.sh +++ b/scripts/archive-source.sh @@ -26,7 +26,8 @@ sub_file="${sub_tdir}/submodule.tar" # independent of what the developer currently has initialized # in their checkout, because the build environment is completely # different to the host OS. -submodules="dtc slirp ui/keycodemapdb tests/fp/berkeley-softfloat-3 tests/fp/berkeley-testfloat-3" +submodules="dtc slirp meson ui/keycodemapdb" +submodules="$submodules tests/fp/berkeley-softfloat-3 tests/fp/berkeley-testfloat-3" sub_deinit="" function cleanup() { diff --git a/scripts/check_sparse.py b/scripts/check_sparse.py new file mode 100644 index 0000000000..0de7aa55d9 --- /dev/null +++ b/scripts/check_sparse.py @@ -0,0 +1,25 @@ +#! /usr/bin/env python3 + +# Invoke sparse based on the contents of compile_commands.json + +import json +import subprocess +import sys +import shlex + +def extract_cflags(shcmd): + cflags = shlex.split(shcmd) + return [x for x in cflags + if x.startswith('-D') or x.startswith('-I') or x.startswith('-W') + or x.startswith('-std=')] + +cflags = sys.argv[1:-1] +with open(sys.argv[-1], 'r') as fd: + compile_commands = json.load(fd) + +for cmd in compile_commands: + cmd = ['sparse'] + cflags + extract_cflags(cmd['command']) + [cmd['file']] + print(' '.join((shlex.quote(x) for x in cmd))) + r = subprocess.run(cmd) + if r.returncode != 0: + sys.exit(r.returncode) diff --git a/scripts/clean-includes b/scripts/clean-includes index 795b3bea31..aaa7d4ceb3 100755 --- a/scripts/clean-includes +++ b/scripts/clean-includes @@ -113,7 +113,7 @@ EOT for f in "$@"; do case "$f" in - *.inc.c) + *.c.inc) # These aren't standalone C source files echo "SKIPPING $f (not a standalone source file)" continue diff --git a/scripts/create_config b/scripts/create_config deleted file mode 100755 index 6d8f08b39d..0000000000 --- a/scripts/create_config +++ /dev/null @@ -1,129 +0,0 @@ -#!/bin/sh - -echo "/* Automatically generated by create_config - do not modify */" - -while read line; do - -case $line in - VERSION=*) # configuration - version=${line#*=} - major=$(echo "$version" | cut -d. -f1) - minor=$(echo "$version" | cut -d. -f2) - micro=$(echo "$version" | cut -d. -f3) - echo "#define QEMU_VERSION \"$version\"" - echo "#define QEMU_VERSION_MAJOR $major" - echo "#define QEMU_VERSION_MINOR $minor" - echo "#define QEMU_VERSION_MICRO $micro" - ;; - qemu_*dir=* | qemu_*path=*) # qemu-specific directory configuration - name=${line%=*} - value=${line#*=} - define_name=$(echo $name | LC_ALL=C tr '[a-z]' '[A-Z]') - eval "define_value=\"$value\"" - echo "#define CONFIG_$define_name \"$define_value\"" - # save for the next definitions - eval "$name=\$define_value" - ;; - prefix=*) - # save for the next definitions - prefix=${line#*=} - ;; - IASL=*) # iasl executable - value=${line#*=} - echo "#define CONFIG_IASL $value" - ;; - CONFIG_AUDIO_DRIVERS=*) - drivers=${line#*=} - echo "#define CONFIG_AUDIO_DRIVERS \\" - for drv in $drivers; do - echo " \"${drv}\",\\" - done - echo "" - ;; - CONFIG_BDRV_RW_WHITELIST=*) - echo "#define CONFIG_BDRV_RW_WHITELIST\\" - for drv in ${line#*=}; do - echo " \"${drv}\",\\" - done - echo " NULL" - ;; - CONFIG_BDRV_RO_WHITELIST=*) - echo "#define CONFIG_BDRV_RO_WHITELIST\\" - for drv in ${line#*=}; do - echo " \"${drv}\",\\" - done - echo " NULL" - ;; - CONFIG_*=y) # configuration - name=${line%=*} - echo "#define $name 1" - ;; - CONFIG_*=n) # configuration - ;; - CONFIG_*=*) # configuration - name=${line%=*} - value=${line#*=} - echo "#define $name $value" - ;; - HAVE_*=y) # configuration - name=${line%=*} - echo "#define $name 1" - ;; - HAVE_*=*) # configuration - name=${line%=*} - value=${line#*=} - echo "#define $name $value" - ;; - ARCH=*) # configuration - arch=${line#*=} - arch_name=$(echo $arch | LC_ALL=C tr '[a-z]' '[A-Z]') - echo "#define HOST_$arch_name 1" - ;; - HOST_USB=*) - # do nothing - ;; - HOST_CC=*) - # do nothing - ;; - HOST_*=y) # configuration - name=${line%=*} - echo "#define $name 1" - ;; - HOST_*=*) # configuration - name=${line%=*} - value=${line#*=} - echo "#define $name $value" - ;; - TARGET_BASE_ARCH=*) # configuration - target_base_arch=${line#*=} - base_arch_name=$(echo $target_base_arch | LC_ALL=C tr '[a-z]' '[A-Z]') - echo "#define TARGET_$base_arch_name 1" - ;; - TARGET_XML_FILES=*) - # do nothing - ;; - TARGET_ABI_DIR=*) - # do nothing - ;; - TARGET_NAME=*) - target_name=${line#*=} - echo "#define TARGET_NAME \"$target_name\"" - ;; - TARGET_DIRS=*) - # do nothing - ;; - TARGET_*=y) # configuration - name=${line%=*} - echo "#define $name 1" - ;; - TARGET_*=*) # configuration - name=${line%=*} - value=${line#*=} - echo "#define $name $value" - ;; - DSOSUF=*) - echo "#define HOST_DSOSUF \"${line#*=}\"" - ;; -esac - -done # read diff --git a/scripts/decodetree.py b/scripts/decodetree.py index 694757b6c2..4cd1e10904 100755..100644 --- a/scripts/decodetree.py +++ b/scripts/decodetree.py @@ -1257,7 +1257,7 @@ def main(): long_opts = ['decode=', 'translate=', 'output=', 'insnwidth=', 'static-decode=', 'varinsnwidth='] try: - (opts, args) = getopt.getopt(sys.argv[1:], 'o:vw:', long_opts) + (opts, args) = getopt.gnu_getopt(sys.argv[1:], 'o:vw:', long_opts) except getopt.GetoptError as err: error(0, err) for o, a in opts: diff --git a/scripts/device-crash-test b/scripts/device-crash-test index 305d0427af..866baf7058 100755 --- a/scripts/device-crash-test +++ b/scripts/device-crash-test @@ -383,7 +383,7 @@ def binariesToTest(args, testcase): if args.qemu: r = args.qemu else: - r = glob.glob('./*-softmmu/qemu-system-*') + r = glob.glob('./qemu-system-*') return r diff --git a/scripts/feature_to_c.sh b/scripts/feature_to_c.sh index c8ce9b88f6..b1169899c1 100644 --- a/scripts/feature_to_c.sh +++ b/scripts/feature_to_c.sh @@ -19,16 +19,8 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, see <http://www.gnu.org/licenses/>. -output=$1 -shift - -if test -z "$output" || test -z "$1"; then - echo "Usage: $0 OUTPUTFILE INPUTFILE..." - exit 1 -fi - -if test -e "$output"; then - echo "Output file \"$output\" already exists; refusing to overwrite." +if test -z "$1"; then + echo "Usage: $0 INPUTFILE..." exit 1 fi @@ -60,17 +52,17 @@ for input; do printf "'\''\\n'\'', \n" } END { print " 0 };" - }' < $input >> $output + }' < $input done -echo >> $output -echo "const char *const xml_builtin[][2] = {" >> $output +echo +echo "const char *const xml_builtin[][2] = {" for input; do basename=$(echo $input | sed 's,.*/,,') arrayname=xml_feature_$(echo $input | sed 's,.*/,,; s/[-.]/_/g') - echo " { \"$basename\", $arrayname }," >> $output + echo " { \"$basename\", $arrayname }," done -echo " { (char *)0, (char *)0 }" >> $output -echo "};" >> $output +echo " { (char *)0, (char *)0 }" +echo "};" diff --git a/scripts/grepy.sh b/scripts/grepy.sh new file mode 100755 index 0000000000..aee46ddc8d --- /dev/null +++ b/scripts/grepy.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +grep -h '=y$' "$@" | sort -u diff --git a/scripts/hxtool b/scripts/hxtool index 7b1452f3cf..80516b9437 100644..100755 --- a/scripts/hxtool +++ b/scripts/hxtool @@ -19,6 +19,6 @@ hxtoh() case "$1" in "-h") hxtoh ;; *) exit 1 ;; -esac +esac < "$2" exit 0 diff --git a/scripts/minikconf.py b/scripts/minikconf.py index bcd91015d3..bcd91015d3 100755..100644 --- a/scripts/minikconf.py +++ b/scripts/minikconf.py diff --git a/scripts/mtest2make.py b/scripts/mtest2make.py new file mode 100644 index 0000000000..bdb257bbd9 --- /dev/null +++ b/scripts/mtest2make.py @@ -0,0 +1,102 @@ +#! /usr/bin/env python3 + +# Create Makefile targets to run tests, from Meson's test introspection data. +# +# Author: Paolo Bonzini <pbonzini@redhat.com> + +from collections import defaultdict +import json +import os +import shlex +import sys + +class Suite(object): + def __init__(self): + self.tests = list() + self.slow_tests = list() + self.executables = set() + +print(''' +SPEED = quick + +# $1 = test command, $2 = test name +.test-human-tap = $1 < /dev/null | ./scripts/tap-driver.pl --test-name="$2" $(if $(V),,--show-failures-only) +.test-human-exitcode = $1 < /dev/null +.test-tap-tap = $1 < /dev/null | sed "s/^[a-z][a-z]* [0-9]*/& $2/" || true +.test-tap-exitcode = printf "%s\\n" 1..1 "`$1 < /dev/null > /dev/null || echo "not "`ok 1 $2" +.test.print = echo $(if $(V),'$1','Running test $2') >&3 +.test.env = MALLOC_PERTURB_=$${MALLOC_PERTURB_:-$$(( $${RANDOM:-0} % 255 + 1))} + +# $1 = test name, $2 = test target (human or tap) +.test.run = $(call .test.print,$(.test.cmd.$1),$(.test.name.$1)) && $(call .test-$2-$(.test.driver.$1),$(.test.cmd.$1),$(.test.name.$1)) + +define .test.human_k + @exec 3>&1; rc=0; $(foreach TEST, $1, $(call .test.run,$(TEST),human) || rc=$$?;) \\ + exit $$rc +endef +define .test.human_no_k + $(foreach TEST, $1, @exec 3>&1; $(call .test.run,$(TEST),human) +) +endef +.test.human = \\ + $(if $(findstring k, $(MAKEFLAGS)), $(.test.human_k), $(.test.human_no_k)) + +define .test.tap + @exec 3>&1; { $(foreach TEST, $1, $(call .test.run,$(TEST),tap); ) } \\ + | ./scripts/tap-merge.pl | tee "$@" \\ + | ./scripts/tap-driver.pl $(if $(V),, --show-failures-only) +endef +''') + +suites = defaultdict(Suite) +i = 0 +for test in json.load(sys.stdin): + env = ' '.join(('%s=%s' % (shlex.quote(k), shlex.quote(v)) + for k, v in test['env'].items())) + executable = os.path.relpath(test['cmd'][0]) + if test['workdir'] is not None: + test['cmd'][0] = os.path.relpath(test['cmd'][0], test['workdir']) + else: + test['cmd'][0] = executable + cmd = '$(.test.env) %s %s' % (env, ' '.join((shlex.quote(x) for x in test['cmd']))) + if test['workdir'] is not None: + cmd = '(cd %s && %s)' % (shlex.quote(test['workdir']), cmd) + driver = test['protocol'] if 'protocol' in test else 'exitcode' + + i += 1 + print('.test.name.%d := %s' % (i, test['name'])) + print('.test.driver.%d := %s' % (i, driver)) + print('.test.cmd.%d := %s' % (i, cmd)) + + test_suites = test['suite'] or ['default'] + is_slow = any(s.endswith('-slow') for s in test_suites) + for s in test_suites: + # The suite name in the introspection info is "PROJECT:SUITE" + s = s.split(':')[1] + if s.endswith('-slow'): + s = s[:-5] + if is_slow: + suites[s].slow_tests.append(i) + else: + suites[s].tests.append(i) + suites[s].executables.add(executable) + +print('.PHONY: check check-report.tap') +print('check:') +print('check-report.tap:') +print('\t@cat $^ | scripts/tap-merge.pl >$@') +for name, suite in suites.items(): + executables = ' '.join(suite.executables) + slow_test_numbers = ' '.join((str(x) for x in suite.slow_tests)) + test_numbers = ' '.join((str(x) for x in suite.tests)) + print('.test.suite-quick.%s := %s' % (name, test_numbers)) + print('.test.suite-slow.%s := $(.test.suite-quick.%s) %s' % (name, name, slow_test_numbers)) + print('check-build: %s' % executables) + print('.PHONY: check-%s' % name) + print('.PHONY: check-report-%s.tap' % name) + print('check: check-%s' % name) + print('check-%s: all %s' % (name, executables)) + print('\t$(call .test.human, $(.test.suite-$(SPEED).%s))' % (name, )) + print('check-report.tap: check-report-%s.tap' % name) + print('check-report-%s.tap: %s' % (name, executables)) + print('\t$(call .test.tap, $(.test.suite-$(SPEED).%s))' % (name, )) diff --git a/scripts/ninjatool.py b/scripts/ninjatool.py new file mode 100755 index 0000000000..cc77d51aa8 --- /dev/null +++ b/scripts/ninjatool.py @@ -0,0 +1,1002 @@ +#! /bin/sh + +# Python module for parsing and processing .ninja files. +# +# Author: Paolo Bonzini +# +# Copyright (C) 2019 Red Hat, Inc. + + +# We don't want to put "#! @PYTHON@" as the shebang and +# make the file executable, so instead we make this a +# Python/shell polyglot. The first line below starts a +# multiline string literal for Python, while it is just +# ":" for bash. The closing of the multiline string literal +# is never parsed by bash since it exits before. + +'''': +case "$0" in + /*) me=$0 ;; + *) me=$(command -v "$0") ;; +esac +python="@PYTHON@" +case $python in + @*) python=python3 ;; +esac +exec $python "$me" "$@" +exit 1 +''' + + +from collections import namedtuple, defaultdict +import sys +import os +import re +import json +import argparse +import shutil + + +class InvalidArgumentError(Exception): + pass + +# faster version of os.path.normpath: do nothing unless there is a double +# slash or a "." or ".." component. The filter does not have to be super +# precise, but it has to be fast. os.path.normpath is the hottest function +# for ninja2make without this optimization! +if os.path.sep == '/': + def normpath(path, _slow_re=re.compile('/[./]')): + return os.path.normpath(path) if _slow_re.search(path) or path[0] == '.' else path +else: + normpath = os.path.normpath + + +# ---- lexer and parser ---- + +PATH_RE = r"[^$\s:|]+|\$[$ :]|\$[a-zA-Z0-9_-]+|\$\{[a-zA-Z0-9_.-]+\}" + +SIMPLE_PATH_RE = re.compile(r"[^$\s:|]+") +IDENT_RE = re.compile(r"[a-zA-Z0-9_.-]+$") +STRING_RE = re.compile(r"(" + PATH_RE + r"|[\s:|])(?:\r?\n)?|.") +TOPLEVEL_RE = re.compile(r"([=:#]|\|\|?|^ +|(?:" + PATH_RE + r")+)\s*|.") +VAR_RE=re.compile(r'\$\$|\$\{([^}]*)\}') + +BUILD = 1 +POOL = 2 +RULE = 3 +DEFAULT = 4 +EQUALS = 5 +COLON = 6 +PIPE = 7 +PIPE2 = 8 +IDENT = 9 +INCLUDE = 10 +INDENT = 11 +EOL = 12 + + +class LexerError(Exception): + pass + + +class ParseError(Exception): + pass + + +class NinjaParserEvents(object): + def __init__(self, parser): + self.parser = parser + + def dollar_token(self, word, in_path=False): + return '$$' if word == '$' else word + + def variable_expansion_token(self, varname): + return '${%s}' % varname + + def variable(self, name, arg): + pass + + def begin_file(self): + pass + + def end_file(self): + pass + + def end_scope(self): + pass + + def begin_pool(self, name): + pass + + def begin_rule(self, name): + pass + + def begin_build(self, out, iout, rule, in_, iin, orderdep): + pass + + def default(self, targets): + pass + + +class NinjaParser(object): + + InputFile = namedtuple('InputFile', 'filename iter lineno') + + def __init__(self, filename, input): + self.stack = [] + self.top = None + self.iter = None + self.lineno = None + self.match_keyword = False + self.push(filename, input) + + def file_changed(self): + self.iter = self.top.iter + self.lineno = self.top.lineno + if self.top.filename is not None: + os.chdir(os.path.dirname(self.top.filename) or '.') + + def push(self, filename, input): + if self.top: + self.top.lineno = self.lineno + self.top.iter = self.iter + self.stack.append(self.top) + self.top = self.InputFile(filename=filename or 'stdin', + iter=self._tokens(input), lineno=0) + self.file_changed() + + def pop(self): + if len(self.stack): + self.top = self.stack[-1] + self.stack.pop() + self.file_changed() + else: + self.top = self.iter = None + + def next_line(self, input): + line = next(input).rstrip() + self.lineno += 1 + while len(line) and line[-1] == '$': + line = line[0:-1] + next(input).strip() + self.lineno += 1 + return line + + def print_token(self, tok): + if tok == EOL: + return "end of line" + if tok == BUILD: + return '"build"' + if tok == POOL: + return '"pool"' + if tok == RULE: + return '"rule"' + if tok == DEFAULT: + return '"default"' + if tok == EQUALS: + return '"="' + if tok == COLON: + return '":"' + if tok == PIPE: + return '"|"' + if tok == PIPE2: + return '"||"' + if tok == INCLUDE: + return '"include"' + if tok == IDENT: + return 'identifier' + return '"%s"' % tok + + def error(self, msg): + raise LexerError("%s:%d: %s" % (self.stack[-1].filename, self.lineno, msg)) + + def parse_error(self, msg): + raise ParseError("%s:%d: %s" % (self.stack[-1].filename, self.lineno, msg)) + + def expected(self, expected, tok): + msg = "found %s, expected " % (self.print_token(tok), ) + for i, exp_tok in enumerate(expected): + if i > 0: + msg = msg + (' or ' if i == len(expected) - 1 else ', ') + msg = msg + self.print_token(exp_tok) + self.parse_error(msg) + + def _variable_tokens(self, value): + for m in STRING_RE.finditer(value): + match = m.group(1) + if not match: + self.error("unexpected '%s'" % (m.group(0), )) + yield match + + def _tokens(self, input): + while True: + try: + line = self.next_line(input) + except StopIteration: + return + for m in TOPLEVEL_RE.finditer(line): + match = m.group(1) + if not match: + self.error("unexpected '%s'" % (m.group(0), )) + if match == ':': + yield COLON + continue + if match == '|': + yield PIPE + continue + if match == '||': + yield PIPE2 + continue + if match[0] == ' ': + yield INDENT + continue + if match[0] == '=': + yield EQUALS + value = line[m.start() + 1:].lstrip() + yield from self._variable_tokens(value) + break + if match[0] == '#': + break + + # identifier + if self.match_keyword: + if match == 'build': + yield BUILD + continue + if match == 'pool': + yield POOL + continue + if match == 'rule': + yield RULE + continue + if match == 'default': + yield DEFAULT + continue + if match == 'include': + filename = line[m.start() + 8:].strip() + self.push(filename, open(filename, 'r')) + break + if match == 'subninja': + self.error('subninja is not supported') + yield match + yield EOL + + def parse(self, events): + global_var = True + + def look_for(*expected): + # The last token in the token stream is always EOL. This + # is exploited to avoid catching StopIteration everywhere. + tok = next(self.iter) + if tok not in expected: + self.expected(expected, tok) + return tok + + def look_for_ident(*expected): + tok = next(self.iter) + if isinstance(tok, str): + if not IDENT_RE.match(tok): + self.parse_error('variable expansion not allowed') + elif tok not in expected: + self.expected(expected + (IDENT,), tok) + return tok + + def parse_assignment_rhs(gen, expected, in_path): + tokens = [] + for tok in gen: + if not isinstance(tok, str): + if tok in expected: + break + self.expected(expected + (IDENT,), tok) + if tok[0] != '$': + tokens.append(tok) + elif tok == '$ ' or tok == '$$' or tok == '$:': + tokens.append(events.dollar_token(tok[1], in_path)) + else: + var = tok[2:-1] if tok[1] == '{' else tok[1:] + tokens.append(events.variable_expansion_token(var)) + else: + # gen must have raised StopIteration + tok = None + + if tokens: + # Fast path avoiding str.join() + value = tokens[0] if len(tokens) == 1 else ''.join(tokens) + else: + value = None + return value, tok + + def look_for_path(*expected): + # paths in build rules are parsed one space-separated token + # at a time and expanded + token = next(self.iter) + if not isinstance(token, str): + return None, token + # Fast path if there are no dollar and variable expansion + if SIMPLE_PATH_RE.match(token): + return token, None + gen = self._variable_tokens(token) + return parse_assignment_rhs(gen, expected, True) + + def parse_assignment(tok): + name = tok + assert isinstance(name, str) + look_for(EQUALS) + value, tok = parse_assignment_rhs(self.iter, (EOL,), False) + assert tok == EOL + events.variable(name, value) + + def parse_build(): + # parse outputs + out = [] + iout = [] + while True: + value, tok = look_for_path(COLON, PIPE) + if value is None: + break + out.append(value) + if tok == PIPE: + while True: + value, tok = look_for_path(COLON) + if value is None: + break + iout.append(value) + + # parse rule + assert tok == COLON + rule = look_for_ident() + + # parse inputs and dependencies + in_ = [] + iin = [] + orderdep = [] + while True: + value, tok = look_for_path(PIPE, PIPE2, EOL) + if value is None: + break + in_.append(value) + if tok == PIPE: + while True: + value, tok = look_for_path(PIPE2, EOL) + if value is None: + break + iin.append(value) + if tok == PIPE2: + while True: + value, tok = look_for_path(EOL) + if value is None: + break + orderdep.append(value) + assert tok == EOL + events.begin_build(out, iout, rule, in_, iin, orderdep) + nonlocal global_var + global_var = False + + def parse_pool(): + # pool declarations are ignored. Just gobble all the variables + ident = look_for_ident() + look_for(EOL) + events.begin_pool(ident) + nonlocal global_var + global_var = False + + def parse_rule(): + ident = look_for_ident() + look_for(EOL) + events.begin_rule(ident) + nonlocal global_var + global_var = False + + def parse_default(): + idents = [] + while True: + ident = look_for_ident(EOL) + if ident == EOL: + break + idents.append(ident) + events.default(idents) + + def parse_declaration(tok): + if tok == EOL: + return + + nonlocal global_var + if tok == INDENT: + if global_var: + self.parse_error('indented line outside rule or edge') + tok = look_for_ident(EOL) + if tok == EOL: + return + parse_assignment(tok) + return + + if not global_var: + events.end_scope() + global_var = True + if tok == POOL: + parse_pool() + elif tok == BUILD: + parse_build() + elif tok == RULE: + parse_rule() + elif tok == DEFAULT: + parse_default() + elif isinstance(tok, str): + parse_assignment(tok) + else: + self.expected((POOL, BUILD, RULE, INCLUDE, DEFAULT, IDENT), tok) + + events.begin_file() + while self.iter: + try: + self.match_keyword = True + token = next(self.iter) + self.match_keyword = False + parse_declaration(token) + except StopIteration: + self.pop() + events.end_file() + + +# ---- variable handling ---- + +def expand(x, rule_vars=None, build_vars=None, global_vars=None): + if x is None: + return None + changed = True + have_dollar_replacement = False + while changed: + changed = False + matches = list(VAR_RE.finditer(x)) + if not matches: + break + + # Reverse the match so that expanding later matches does not + # invalidate m.start()/m.end() for earlier ones. Do not reduce $$ to $ + # until all variables are dealt with. + for m in reversed(matches): + name = m.group(1) + if not name: + have_dollar_replacement = True + continue + changed = True + if build_vars and name in build_vars: + value = build_vars[name] + elif rule_vars and name in rule_vars: + value = rule_vars[name] + elif name in global_vars: + value = global_vars[name] + else: + value = '' + x = x[:m.start()] + value + x[m.end():] + return x.replace('$$', '$') if have_dollar_replacement else x + + +class Scope(object): + def __init__(self, events): + self.events = events + + def on_left_scope(self): + pass + + def on_variable(self, key, value): + pass + + +class BuildScope(Scope): + def __init__(self, events, out, iout, rule, in_, iin, orderdep, rule_vars): + super().__init__(events) + self.rule = rule + self.out = [events.expand_and_normalize(x) for x in out] + self.in_ = [events.expand_and_normalize(x) for x in in_] + self.iin = [events.expand_and_normalize(x) for x in iin] + self.orderdep = [events.expand_and_normalize(x) for x in orderdep] + self.iout = [events.expand_and_normalize(x) for x in iout] + self.rule_vars = rule_vars + self.build_vars = dict() + self._define_variable('out', ' '.join(self.out)) + self._define_variable('in', ' '.join(self.in_)) + + def expand(self, x): + return self.events.expand(x, self.rule_vars, self.build_vars) + + def on_left_scope(self): + self.events.variable('out', self.build_vars['out']) + self.events.variable('in', self.build_vars['in']) + self.events.end_build(self, self.out, self.iout, self.rule, self.in_, + self.iin, self.orderdep) + + def _define_variable(self, key, value): + # The value has been expanded already, quote it for further + # expansion from rule variables + value = value.replace('$', '$$') + self.build_vars[key] = value + + def on_variable(self, key, value): + # in and out are at the top of the lookup order and cannot + # be overridden. Also, unlike what the manual says, build + # variables only lookup global variables. They never lookup + # rule variables, earlier build variables, or in/out. + if key not in ('in', 'in_newline', 'out'): + self._define_variable(key, self.events.expand(value)) + + +class RuleScope(Scope): + def __init__(self, events, name, vars_dict): + super().__init__(events) + self.name = name + self.vars_dict = vars_dict + self.generator = False + + def on_left_scope(self): + self.events.end_rule(self, self.name) + + def on_variable(self, key, value): + self.vars_dict[key] = value + if key == 'generator': + self.generator = True + + +class NinjaParserEventsWithVars(NinjaParserEvents): + def __init__(self, parser): + super().__init__(parser) + self.rule_vars = defaultdict(lambda: dict()) + self.global_vars = dict() + self.scope = None + + def variable(self, name, value): + if self.scope: + self.scope.on_variable(name, value) + else: + self.global_vars[name] = self.expand(value) + + def begin_build(self, out, iout, rule, in_, iin, orderdep): + if rule != 'phony' and rule not in self.rule_vars: + self.parser.parse_error("undefined rule '%s'" % rule) + + self.scope = BuildScope(self, out, iout, rule, in_, iin, orderdep, self.rule_vars[rule]) + + def begin_pool(self, name): + # pool declarations are ignored. Just gobble all the variables + self.scope = Scope(self) + + def begin_rule(self, name): + if name in self.rule_vars: + self.parser.parse_error("duplicate rule '%s'" % name) + self.scope = RuleScope(self, name, self.rule_vars[name]) + + def end_scope(self): + self.scope.on_left_scope() + self.scope = None + + # utility functions: + + def expand(self, x, rule_vars=None, build_vars=None): + return expand(x, rule_vars, build_vars, self.global_vars) + + def expand_and_normalize(self, x): + return normpath(self.expand(x)) + + # extra events not present in the superclass: + + def end_build(self, scope, out, iout, rule, in_, iin, orderdep): + pass + + def end_rule(self, scope, name): + pass + + +# ---- test client that just prints back whatever it parsed ---- + +class Writer(NinjaParserEvents): + ARGS = argparse.ArgumentParser(description='Rewrite input build.ninja to stdout.') + + def __init__(self, output, parser, args): + super().__init__(parser) + self.output = output + self.indent = '' + self.had_vars = False + + def dollar_token(self, word, in_path=False): + return '$' + word + + def print(self, *args, **kwargs): + if len(args): + self.output.write(self.indent) + print(*args, **kwargs, file=self.output) + + def variable(self, name, value): + self.print('%s = %s' % (name, value)) + self.had_vars = True + + def begin_scope(self): + self.indent = ' ' + self.had_vars = False + + def end_scope(self): + if self.had_vars: + self.print() + self.indent = '' + self.had_vars = False + + def begin_pool(self, name): + self.print('pool %s' % name) + self.begin_scope() + + def begin_rule(self, name): + self.print('rule %s' % name) + self.begin_scope() + + def begin_build(self, outputs, implicit_outputs, rule, inputs, implicit, order_only): + all_outputs = list(outputs) + all_inputs = list(inputs) + + if implicit: + all_inputs.append('|') + all_inputs.extend(implicit) + if order_only: + all_inputs.append('||') + all_inputs.extend(order_only) + if implicit_outputs: + all_outputs.append('|') + all_outputs.extend(implicit_outputs) + + self.print('build %s: %s' % (' '.join(all_outputs), + ' '.join([rule] + all_inputs))) + self.begin_scope() + + def default(self, targets): + self.print('default %s' % ' '.join(targets)) + + +# ---- emit compile_commands.json ---- + +class Compdb(NinjaParserEventsWithVars): + ARGS = argparse.ArgumentParser(description='Emit compile_commands.json.') + ARGS.add_argument('rules', nargs='*', + help='The ninja rules to emit compilation commands for.') + + def __init__(self, output, parser, args): + super().__init__(parser) + self.output = output + self.rules = args.rules + self.sep = '' + + def begin_file(self): + self.output.write('[') + self.directory = os.getcwd() + + def print_entry(self, **entry): + entry['directory'] = self.directory + self.output.write(self.sep + json.dumps(entry)) + self.sep = ',\n' + + def begin_build(self, out, iout, rule, in_, iin, orderdep): + if in_ and rule in self.rules: + super().begin_build(out, iout, rule, in_, iin, orderdep) + else: + self.scope = Scope(self) + + def end_build(self, scope, out, iout, rule, in_, iin, orderdep): + self.print_entry(command=scope.expand('${command}'), file=in_[0]) + + def end_file(self): + self.output.write(']\n') + + +# ---- clean output files ---- + +class Clean(NinjaParserEventsWithVars): + ARGS = argparse.ArgumentParser(description='Remove output build files.') + ARGS.add_argument('-g', dest='generator', action='store_true', + help='clean generated files too') + + def __init__(self, output, parser, args): + super().__init__(parser) + self.dry_run = args.dry_run + self.verbose = args.verbose or args.dry_run + self.generator = args.generator + + def begin_file(self): + print('Cleaning... ', end=(None if self.verbose else ''), flush=True) + self.cnt = 0 + + def end_file(self): + print('%d files' % self.cnt) + + def do_clean(self, *files): + for f in files: + if self.dry_run: + if os.path.exists(f): + self.cnt += 1 + print('Would remove ' + f) + continue + else: + try: + if os.path.isdir(f): + shutil.rmtree(f) + else: + os.unlink(f) + self.cnt += 1 + if self.verbose: + print('Removed ' + f) + except FileNotFoundError: + pass + + def end_build(self, scope, out, iout, rule, in_, iin, orderdep): + if rule == 'phony': + return + if self.generator: + rspfile = scope.expand('${rspfile}') + if rspfile: + self.do_clean(rspfile) + if self.generator or not scope.expand('${generator}'): + self.do_clean(*out, *iout) + depfile = scope.expand('${depfile}') + if depfile: + self.do_clean(depfile) + + +# ---- convert build.ninja to makefile ---- + +class Ninja2Make(NinjaParserEventsWithVars): + ARGS = argparse.ArgumentParser(description='Convert build.ninja to a Makefile.') + ARGS.add_argument('--clean', dest='emit_clean', action='store_true', + help='Emit clean/distclean rules.') + ARGS.add_argument('--doublecolon', action='store_true', + help='Emit double-colon rules for phony targets.') + ARGS.add_argument('--omit', metavar='TARGET', nargs='+', + help='Targets to omit.') + + def __init__(self, output, parser, args): + super().__init__(parser) + self.output = output + + self.emit_clean = args.emit_clean + self.doublecolon = args.doublecolon + self.omit = set(args.omit) + + if self.emit_clean: + self.omit.update(['clean', 'distclean']) + + # Lists of targets are kept in memory and emitted only at the + # end because appending is really inefficient in GNU make. + # We only do it when it's O(#rules) or O(#variables), but + # never when it could be O(#targets). + self.depfiles = list() + self.rspfiles = list() + self.build_vars = defaultdict(lambda: dict()) + self.rule_targets = defaultdict(lambda: list()) + self.stamp_targets = defaultdict(lambda: list()) + self.num_stamp = defaultdict(lambda: 0) + self.all_outs = set() + self.all_ins = set() + self.all_phony = set() + self.seen_default = False + + def print(self, *args, **kwargs): + print(*args, **kwargs, file=self.output) + + def dollar_token(self, word, in_path=False): + if in_path and word == ' ': + self.parser.parse_error('Make does not support spaces in filenames') + return '$$' if word == '$' else word + + def print_phony(self, outs, ins): + targets = ' '.join(outs).replace('$', '$$') + deps = ' '.join(ins).replace('$', '$$') + deps = deps.strip() + if self.doublecolon: + self.print(targets + '::' + (' ' if deps else '') + deps + ';@:') + else: + self.print(targets + ':' + (' ' if deps else '') + deps) + self.all_phony.update(outs) + + def begin_file(self): + self.print(r'# This is an automatically generated file, and it shows.') + self.print(r'ninja-default:') + self.print(r'.PHONY: ninja-default ninja-clean ninja-distclean') + if self.emit_clean: + self.print(r'ninja-clean:: ninja-clean-start; $(if $V,,@)rm -f ${ninja-depfiles}') + self.print(r'ninja-clean-start:; $(if $V,,@echo Cleaning...)') + self.print(r'ninja-distclean:: clean; $(if $V,,@)rm -f ${ninja-rspfiles}') + self.print(r'.PHONY: ninja-clean-start') + self.print_phony(['clean'], ['ninja-clean']) + self.print_phony(['distclean'], ['ninja-distclean']) + self.print(r'vpath') + self.print(r'NULL :=') + self.print(r'SPACE := ${NULL} #') + self.print(r'MAKEFLAGS += -rR') + self.print(r'define NEWLINE') + self.print(r'') + self.print(r'endef') + self.print(r'.var.in_newline = $(subst $(SPACE),$(NEWLINE),${.var.in})') + self.print(r"ninja-command = $(if $V,,$(if ${.var.description},@printf '%s\n' '$(subst ','\'',${.var.description})' && ))${.var.command}") + self.print(r"ninja-command-restat = $(if $V,,$(if ${.var.description},@printf '%s\n' '$(subst ','\'',${.var.description})' && ))${.var.command} && if test -e $(firstword ${.var.out}); then printf '%s\n' ${.var.out} > $@; fi") + + def end_file(self): + def natural_sort_key(s, _nsre=re.compile('([0-9]+)')): + return [int(text) if text.isdigit() else text.lower() + for text in _nsre.split(s)] + + self.print() + self.print('ninja-outputdirs :=') + for rule in self.rule_vars: + if rule == 'phony': + continue + self.print('ninja-targets-%s := %s' % (rule, ' '.join(self.rule_targets[rule]))) + self.print('ninja-stamp-%s := %s' % (rule, ' '.join(self.stamp_targets[rule]))) + self.print('ninja-outputdirs += $(sort $(dir ${ninja-targets-%s}))' % rule) + self.print() + self.print('dummy := $(shell mkdir -p . $(sort $(ninja-outputdirs)))') + self.print('ninja-depfiles :=' + ' '.join(self.depfiles)) + self.print('ninja-rspfiles :=' + ' '.join(self.rspfiles)) + self.print('-include ${ninja-depfiles}') + self.print() + for targets in self.build_vars: + for name, value in self.build_vars[targets].items(): + self.print('%s: private .var.%s := %s' % (targets, name, value)) + self.print() + if not self.seen_default: + default_targets = sorted(self.all_outs - self.all_ins, key=natural_sort_key) + self.print('ninja-default: ' + ' '.join(default_targets)) + + # This is a hack... Meson declares input meson.build files as + # phony, because Ninja does not have an equivalent of Make's + # "path/to/file:" declaration that ignores "path/to/file" even + # if it is absent. However, Makefile.ninja wants to depend on + # build.ninja, which in turn depends on these phony targets which + # would cause Makefile.ninja to be rebuilt in a loop. + phony_targets = sorted(self.all_phony - self.all_ins, key=natural_sort_key) + self.print('.PHONY: ' + ' '.join(phony_targets)) + + def variable(self, name, value): + super().variable(name, value) + if self.scope is None: + self.global_vars[name] = self.expand(value) + self.print('.var.%s := %s' % (name, self.global_vars[name])) + + def begin_build(self, out, iout, rule, in_, iin, orderdep): + if any(x in self.omit for x in out): + self.scope = Scope(self) + return + + super().begin_build(out, iout, rule, in_, iin, orderdep) + self.current_targets = ' '.join(self.scope.out + self.scope.iout).replace('$', '$$') + + def end_build(self, scope, out, iout, rule, in_, iin, orderdep): + self.rule_targets[rule] += self.scope.out + self.rule_targets[rule] += self.scope.iout + + self.all_outs.update(self.scope.iout) + self.all_outs.update(self.scope.out) + self.all_ins.update(self.scope.in_) + self.all_ins.update(self.scope.iin) + + targets = self.current_targets + self.current_targets = None + if rule == 'phony': + # Phony rules treat order-only dependencies as normal deps + self.print_phony(out + iout, in_ + iin + orderdep) + return + + inputs = ' '.join(in_ + iin).replace('$', '$$') + orderonly = ' '.join(orderdep).replace('$', '$$') + + rspfile = scope.expand('${rspfile}') + if rspfile: + rspfile_content = scope.expand('${rspfile_content}') + with open(rspfile, 'w') as f: + f.write(rspfile_content) + inputs += ' ' + rspfile + self.rspfiles.append(rspfile) + + restat = 'restat' in self.scope.build_vars or 'restat' in self.rule_vars[rule] + depfile = scope.expand('${depfile}') + build_vars = { + 'command': scope.expand('${command}'), + 'description': scope.expand('${description}'), + 'out': scope.expand('${out}') + } + + if restat and not depfile: + if len(out) == 1: + stamp = out[0] + '.stamp' + else: + stamp = '%s%d.stamp' %(rule, self.num_stamp[rule]) + self.num_stamp[rule] += 1 + self.print('%s: %s; @:' % (targets, stamp)) + self.print('%s: %s | %s; ${ninja-command-restat}' % (stamp, inputs, orderonly)) + self.rule_targets[rule].append(stamp) + self.stamp_targets[rule].append(stamp) + self.build_vars[stamp] = build_vars + else: + self.print('%s: %s | %s; ${ninja-command}' % (targets, inputs, orderonly)) + self.build_vars[targets] = build_vars + if depfile: + self.depfiles.append(depfile) + + def end_rule(self, scope, name): + # Note that the generator pseudo-variable could also be attached + # to a build block rather than a rule. This is not handled here + # in order to reduce the number of "rm" invocations. However, + # "ninjatool.py -t clean" does that correctly. + target = 'distclean' if scope.generator else 'clean' + self.print('ninja-%s:: ; $(if $V,,@)rm -f ${ninja-stamp-%s}' % (target, name)) + if self.emit_clean: + self.print('ninja-%s:: ; $(if $V,,@)rm -rf ${ninja-targets-%s}' % (target, name)) + + def default(self, targets): + self.print("ninja-default: " + ' '.join(targets)) + self.seen_default = True + + +# ---- command line parsing ---- + +# we cannot use subparsers because tools are chosen through the "-t" +# option. + +class ToolAction(argparse.Action): + def __init__(self, option_strings, dest, choices, metavar='TOOL', nargs=None, **kwargs): + if nargs is not None: + raise ValueError("nargs not allowed") + super().__init__(option_strings, dest, required=True, choices=choices, + metavar=metavar, **kwargs) + + def __call__(self, parser, namespace, value, option_string): + tool = self.choices[value] + setattr(namespace, self.dest, tool) + tool.ARGS.prog = '%s %s %s' % (parser.prog, option_string, value) + + +class ToolHelpAction(argparse.Action): + def __init__(self, option_strings, dest, nargs=None, **kwargs): + if nargs is not None: + raise ValueError("nargs not allowed") + super().__init__(option_strings, dest, nargs=0, **kwargs) + + def __call__(self, parser, namespace, values, option_string=None): + if namespace.tool: + namespace.tool.ARGS.print_help() + else: + parser.print_help() + parser.exit() + + +tools = { + 'test': Writer, + 'ninja2make': Ninja2Make, + 'compdb': Compdb, + 'clean': Clean, +} + +parser = argparse.ArgumentParser(description='Process and transform build.ninja files.', + add_help=False) +parser.add_argument('-C', metavar='DIR', dest='dir', default='.', + help='change to DIR before doing anything else') +parser.add_argument('-f', metavar='FILE', dest='file', default='build.ninja', + help='specify input build file [default=build.ninja]') +parser.add_argument('-n', dest='dry_run', action='store_true', + help='do not actually do anything') +parser.add_argument('-v', dest='verbose', action='store_true', + help='be more verbose') + +parser.add_argument('-t', dest='tool', choices=tools, action=ToolAction, + help='choose the tool to run') +parser.add_argument('-h', '--help', action=ToolHelpAction, + help='show this help message and exit') + +if len(sys.argv) >= 2 and sys.argv[1] == '--version': + print('1.8') + sys.exit(0) + +args, tool_args = parser.parse_known_args() +args.tool.ARGS.parse_args(tool_args, args) + +os.chdir(args.dir) +with open(args.file, 'r') as f: + parser = NinjaParser(args.file, f) + try: + events = args.tool(sys.stdout, parser, args) + except InvalidArgumentError as e: + parser.error(str(e)) + parser.parse(events) diff --git a/scripts/oss-fuzz/build.sh b/scripts/oss-fuzz/build.sh index a07b3022e8..f0b7442c96 100755 --- a/scripts/oss-fuzz/build.sh +++ b/scripts/oss-fuzz/build.sh @@ -20,7 +20,7 @@ # e.g. # $CXX $CXXFLAGS -std=c++11 -Iinclude \ # /path/to/name_of_fuzzer.cc -o $OUT/name_of_fuzzer \ -# $LIB_FUZZING_ENGINE /path/to/library.a +# -fsanitize=fuzzer /path/to/library.a fatal () { echo "Error : ${*}, exiting." @@ -54,10 +54,6 @@ mkdir -p $OSS_FUZZ_BUILD_DIR || fatal "mkdir $OSS_FUZZ_BUILD_DIR failed" cd $OSS_FUZZ_BUILD_DIR || fatal "cd $OSS_FUZZ_BUILD_DIR failed" -if [ -z ${LIB_FUZZING_ENGINE+x} ]; then - LIB_FUZZING_ENGINE="-fsanitize=fuzzer" -fi - if [ -z ${OUT+x} ]; then DEST_DIR=$(realpath "./DEST_DIR") else @@ -67,27 +63,27 @@ fi mkdir -p "$DEST_DIR/lib/" # Copy the shared libraries here # Build once to get the list of dynamic lib paths, and copy them over -../configure --disable-werror --cc="$CC" --cxx="$CXX" \ +../configure --disable-werror --cc="$CC" --cxx="$CXX" --enable-fuzzing \ + --prefix="$DEST_DIR" --bindir="$DEST_DIR" --datadir="$DEST_DIR/data/" \ --extra-cflags="$EXTRA_CFLAGS" --target-list="i386-softmmu" -if ! make CONFIG_FUZZ=y CFLAGS="$LIB_FUZZING_ENGINE" "-j$(nproc)" \ - i386-softmmu/fuzz; then +if ! make "-j$(nproc)" qemu-fuzz-i386; then fatal "Build failed. Please specify a compiler with fuzzing support"\ - "using the \$CC and \$CXX environemnt variables, or specify a"\ - "\$LIB_FUZZING_ENGINE compatible with your compiler"\ + "using the \$CC and \$CXX environemnt variables"\ "\nFor example: CC=clang CXX=clang++ $0" fi -for i in $(ldd ./i386-softmmu/qemu-fuzz-i386 | cut -f3 -d' '); do +for i in $(ldd ./qemu-fuzz-i386 | cut -f3 -d' '); do cp "$i" "$DEST_DIR/lib/" done -rm ./i386-softmmu/qemu-fuzz-i386 +rm qemu-fuzz-i386 # Build a second time to build the final binary with correct rpath -../configure --bindir="$DEST_DIR" --datadir="$DEST_DIR/data/" --disable-werror \ - --cc="$CC" --cxx="$CXX" --extra-cflags="$EXTRA_CFLAGS" \ - --extra-ldflags="-Wl,-rpath,'\$\$ORIGIN/lib'" -make CONFIG_FUZZ=y CFLAGS="$LIB_FUZZING_ENGINE" "-j$(nproc)" i386-softmmu/fuzz +../configure --disable-werror --cc="$CC" --cxx="$CXX" --enable-fuzzing \ + --prefix="$DEST_DIR" --bindir="$DEST_DIR" --datadir="$DEST_DIR/data/" \ + --extra-cflags="$EXTRA_CFLAGS" --extra-ldflags="-Wl,-rpath,'\$\$ORIGIN/lib'" \ + --target-list="i386-softmmu" +make "-j$(nproc)" qemu-fuzz-i386 V=1 # Copy over the datadir cp -r ../pc-bios/ "$DEST_DIR/pc-bios" @@ -96,9 +92,9 @@ cp -r ../pc-bios/ "$DEST_DIR/pc-bios" # of available fuzz-targets. Copy over the qemu-fuzz-i386, naming it according # to each available fuzz target (See 05509c8e6d fuzz: select fuzz target using # executable name) -for target in $(./i386-softmmu/qemu-fuzz-i386 | awk '$1 ~ /\*/ {print $2}'); +for target in $(./qemu-fuzz-i386 | awk '$1 ~ /\*/ {print $2}'); do - cp ./i386-softmmu/qemu-fuzz-i386 "$DEST_DIR/qemu-fuzz-i386-target-$target" + cp qemu-fuzz-i386 "$DEST_DIR/qemu-fuzz-i386-target-$target" done echo "Done. The fuzzers are located in $DEST_DIR" diff --git a/scripts/qapi-gen.py b/scripts/qapi-gen.py index 4b03f7d53b..4b03f7d53b 100755..100644 --- a/scripts/qapi-gen.py +++ b/scripts/qapi-gen.py diff --git a/scripts/qemu-version.sh b/scripts/qemu-version.sh new file mode 100755 index 0000000000..4847385e42 --- /dev/null +++ b/scripts/qemu-version.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +set -eu + +dir="$1" +pkgversion="$2" +version="$3" + +if [ -z "$pkgversion"]; then + cd "$dir" + if [ -e .git ]; then + pkgversion=$(git describe --match 'v*' --dirty | echo "") + fi +fi + +if [ -n "$pkgversion" ]; then + fullversion="$version ($pkgversion)" +else + fullversion="$version" +fi + +cat <<EOF +#define QEMU_PKGVERSION "$pkgversion" +#define QEMU_FULL_VERSION "$fullversion" +EOF diff --git a/scripts/tracetool.py b/scripts/tracetool.py index 31146242b7..31146242b7 100755..100644 --- a/scripts/tracetool.py +++ b/scripts/tracetool.py diff --git a/scripts/tracetool/backend/dtrace.py b/scripts/tracetool/backend/dtrace.py index fc0c8fc52f..e17edc9b9d 100644 --- a/scripts/tracetool/backend/dtrace.py +++ b/scripts/tracetool/backend/dtrace.py @@ -38,7 +38,7 @@ def generate_h_begin(events, group): if group == "root": header = "trace-dtrace-root.h" else: - header = "trace-dtrace.h" + header = "trace-dtrace-%s.h" % group # Workaround for ust backend, which also includes <sys/sdt.h> and may # require SDT_USE_VARIADIC to be defined. If dtrace includes <sys/sdt.h> diff --git a/scripts/tracetool/backend/ust.py b/scripts/tracetool/backend/ust.py index 6c0a5f8d68..c857516f21 100644 --- a/scripts/tracetool/backend/ust.py +++ b/scripts/tracetool/backend/ust.py @@ -19,11 +19,7 @@ PUBLIC = True def generate_h_begin(events, group): - if group == "root": - header = "trace-ust-root.h" - else: - header = "trace-ust.h" - + header = 'trace-ust-' + group + '.h' out('#include <lttng/tracepoint.h>', '#include "%s"' % header, '', diff --git a/scripts/tracetool/format/c.py b/scripts/tracetool/format/c.py index 23d82ea861..c390c1844a 100644 --- a/scripts/tracetool/format/c.py +++ b/scripts/tracetool/format/c.py @@ -19,10 +19,7 @@ def generate(events, backend, group): active_events = [e for e in events if "disable" not in e.properties] - if group == "root": - header = "trace-root.h" - else: - header = "trace.h" + header = "trace-" + group + ".h" out('/* This file is autogenerated by tracetool, do not edit. */', '', diff --git a/scripts/tracetool/format/tcg_h.py b/scripts/tracetool/format/tcg_h.py index 33cf6a31b3..4d84440aff 100644 --- a/scripts/tracetool/format/tcg_h.py +++ b/scripts/tracetool/format/tcg_h.py @@ -28,7 +28,7 @@ def vcpu_transform_args(args): def generate(events, backend, group): if group == "root": - header = "trace-root.h" + header = "trace/trace-root.h" else: header = "trace.h" diff --git a/scripts/tracetool/format/tcg_helper_c.py b/scripts/tracetool/format/tcg_helper_c.py index 2db6317f3c..72576e67d1 100644 --- a/scripts/tracetool/format/tcg_helper_c.py +++ b/scripts/tracetool/format/tcg_helper_c.py @@ -41,7 +41,7 @@ def vcpu_transform_args(args, mode): def generate(events, backend, group): if group == "root": - header = "trace-root.h" + header = "trace/trace-root.h" else: header = "trace.h" diff --git a/scripts/undefsym.sh b/scripts/undefsym.sh new file mode 100755 index 0000000000..b9ec332e95 --- /dev/null +++ b/scripts/undefsym.sh @@ -0,0 +1,20 @@ +#! /usr/bin/env bash + +# Before a shared module's DSO is produced, a static library is built for it +# and passed to this script. The script generates -Wl,-u options to force +# the inclusion of symbol from libqemuutil.a if the shared modules need them, +# This is necessary because the modules may use functions not needed by the +# executable itself, which would cause the function to not be linked in. +# Then the DSO loading would fail because of the missing symbol. + +if test $# -le 2; then + exit 0 +fi + +NM=$1 +staticlib=$2 +shift 2 +# Find symbols defined in static libraries and undefined in shared modules +comm -12 \ + <( $NM -P -g $staticlib | awk '$2!="U"{print "-Wl,-u," $1}' | sort -u) \ + <( $NM -P -g "$@" | awk '$2=="U"{print "-Wl,-u," $1}' | sort -u) diff --git a/scsi/Makefile.objs b/scsi/Makefile.objs deleted file mode 100644 index bb8789cd8b..0000000000 --- a/scsi/Makefile.objs +++ /dev/null @@ -1,4 +0,0 @@ -block-obj-y += utils.o - -block-obj-$(CONFIG_LINUX) += pr-manager.o pr-manager-helper.o -block-obj-$(call lnot,$(CONFIG_LINUX)) += pr-manager-stub.o diff --git a/scsi/meson.build b/scsi/meson.build new file mode 100644 index 0000000000..53f3a1f716 --- /dev/null +++ b/scsi/meson.build @@ -0,0 +1,4 @@ +block_ss.add(files('utils.c')) +block_ss.add(when: 'CONFIG_LINUX', + if_true: files('pr-manager.c', 'pr-manager-helper.c'), + if_false: files('pr-manager-stub.c')) diff --git a/scsi/trace.h b/scsi/trace.h new file mode 100644 index 0000000000..3e4d89a3a5 --- /dev/null +++ b/scsi/trace.h @@ -0,0 +1 @@ +#include "trace/trace-scsi.h" diff --git a/softmmu/Makefile.objs b/softmmu/Makefile.objs deleted file mode 100644 index a414a74c50..0000000000 --- a/softmmu/Makefile.objs +++ /dev/null @@ -1,14 +0,0 @@ -softmmu-main-y = softmmu/main.o - -obj-y += arch_init.o -obj-y += cpus.o -obj-y += cpu-throttle.o -obj-y += balloon.o -obj-y += ioport.o -obj-y += memory.o -obj-y += memory_mapping.o - -obj-y += qtest.o - -obj-y += vl.o -vl.o-cflags := $(GPROF_CFLAGS) $(SDL_CFLAGS) diff --git a/softmmu/balloon.c b/softmmu/balloon.c index 354408c6ea..b89646f85d 100644 --- a/softmmu/balloon.c +++ b/softmmu/balloon.c @@ -28,7 +28,7 @@ #include "qemu/atomic.h" #include "sysemu/kvm.h" #include "sysemu/balloon.h" -#include "trace-root.h" +#include "trace/trace-root.h" #include "qapi/error.h" #include "qapi/qapi-commands-misc.h" #include "qapi/qmp/qerror.h" diff --git a/softmmu/ioport.c b/softmmu/ioport.c index 04e360e79a..a799697c5d 100644 --- a/softmmu/ioport.c +++ b/softmmu/ioport.c @@ -28,7 +28,7 @@ #include "qemu/osdep.h" #include "cpu.h" #include "exec/ioport.h" -#include "trace-root.h" +#include "trace/trace-root.h" #include "exec/memory.h" #include "exec/address-spaces.h" diff --git a/softmmu/main.c b/softmmu/main.c index 7adc530c73..639c67ff48 100644 --- a/softmmu/main.c +++ b/softmmu/main.c @@ -29,6 +29,7 @@ #ifdef CONFIG_SDL #if defined(__APPLE__) || defined(main) #include <SDL.h> +static int qemu_main(int argc, char **argv, char **envp); int main(int argc, char **argv) { return qemu_main(argc, argv, NULL); diff --git a/softmmu/memory.c b/softmmu/memory.c index af25987518..70b93104e8 100644 --- a/softmmu/memory.c +++ b/softmmu/memory.c @@ -24,7 +24,7 @@ #include "qemu/main-loop.h" #include "qemu/qemu-print.h" #include "qom/object.h" -#include "trace-root.h" +#include "trace/trace-root.h" #include "exec/memory-internal.h" #include "exec/ram_addr.h" diff --git a/softmmu/meson.build b/softmmu/meson.build new file mode 100644 index 0000000000..95d38df259 --- /dev/null +++ b/softmmu/meson.build @@ -0,0 +1,10 @@ +specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: files( + 'arch_init.c', + 'balloon.c', + 'cpus.c', + 'cpu-throttle.c', + 'ioport.c', + 'memory.c', + 'memory_mapping.c', + 'qtest.c', + 'vl.c')) diff --git a/softmmu/qtest.c b/softmmu/qtest.c index 5672b75c35..4e439caec7 100644 --- a/softmmu/qtest.c +++ b/softmmu/qtest.c @@ -27,7 +27,7 @@ #include "qemu/error-report.h" #include "qemu/module.h" #include "qemu/cutils.h" -#include "config-devices.h" +#include CONFIG_DEVICES #ifdef CONFIG_PSERIES #include "hw/ppc/spapr_rtas.h" #endif diff --git a/softmmu/vl.c b/softmmu/vl.c index 4eb9d1f7fd..0cc86b0766 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -90,7 +90,7 @@ #include "disas/disas.h" -#include "trace-root.h" +#include "trace/trace-root.h" #include "trace/control.h" #include "qemu/plugin.h" #include "qemu/queue.h" diff --git a/storage-daemon/Makefile.objs b/storage-daemon/Makefile.objs deleted file mode 100644 index cfe6beee52..0000000000 --- a/storage-daemon/Makefile.objs +++ /dev/null @@ -1 +0,0 @@ -storage-daemon-obj-y += qapi/ diff --git a/storage-daemon/meson.build b/storage-daemon/meson.build new file mode 100644 index 0000000000..0409acc3f5 --- /dev/null +++ b/storage-daemon/meson.build @@ -0,0 +1,14 @@ +qsd_ss = ss.source_set() +qsd_ss.add(files('qemu-storage-daemon.c')) +qsd_ss.add(block, chardev, qmp, qom, qemuutil) +qsd_ss.add_all(blockdev_ss) + +subdir('qapi') + +if have_tools + qsd_ss = qsd_ss.apply(config_host, strict: false) + executable('qemu-storage-daemon', + qsd_ss.sources(), + dependencies: qsd_ss.dependencies(), + install: true) +endif diff --git a/storage-daemon/qapi/Makefile.objs b/storage-daemon/qapi/Makefile.objs deleted file mode 100644 index 8a4b220c96..0000000000 --- a/storage-daemon/qapi/Makefile.objs +++ /dev/null @@ -1 +0,0 @@ -storage-daemon-obj-y += qapi-commands.o qapi-init-commands.o qapi-introspect.o diff --git a/storage-daemon/qapi/meson.build b/storage-daemon/qapi/meson.build new file mode 100644 index 0000000000..cea618bec0 --- /dev/null +++ b/storage-daemon/qapi/meson.build @@ -0,0 +1,7 @@ +qsd_qapi_files = custom_target('QAPI files for qemu-storage-daemon', + output: qapi_nonmodule_outputs + ['qapi-doc.texi'], + input: [ files('qapi-schema.json') ], + command: [ qapi_gen, '-o', 'storage-daemon/qapi', '@INPUT@' ], + depend_files: [ qapi_inputs, qapi_gen_depends ]) + +qsd_ss.add(qsd_qapi_files.to_list()) diff --git a/qemu-storage-daemon.c b/storage-daemon/qemu-storage-daemon.c index 7e9b0e0d3f..7e9b0e0d3f 100644 --- a/qemu-storage-daemon.c +++ b/storage-daemon/qemu-storage-daemon.c diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs deleted file mode 100644 index d42046afe4..0000000000 --- a/stubs/Makefile.objs +++ /dev/null @@ -1,56 +0,0 @@ -stub-obj-y += blk-commit-all.o -stub-obj-y += cmos.o -stub-obj-y += cpu-get-clock.o -stub-obj-y += cpu-get-icount.o -stub-obj-y += dump.o -stub-obj-y += error-printf.o -stub-obj-y += fdset.o -stub-obj-y += gdbstub.o -stub-obj-y += iothread-lock.o -stub-obj-y += is-daemonized.o -stub-obj-y += isa-bus.o -stub-obj-$(CONFIG_LINUX_AIO) += linux-aio.o -stub-obj-$(CONFIG_LINUX_IO_URING) += io_uring.o -stub-obj-y += monitor-core.o -stub-obj-y += notify-event.o -stub-obj-y += pci-bus.o -stub-obj-y += qmp_memory_device.o -stub-obj-y += qtest.o -stub-obj-y += ramfb.o -stub-obj-y += replay.o -stub-obj-y += runstate-check.o -stub-obj-$(CONFIG_SOFTMMU) += semihost.o -stub-obj-y += set-fd-handler.o -stub-obj-y += sysbus.o -stub-obj-y += tpm.o -stub-obj-y += trace-control.o -stub-obj-y += vmgenid.o -stub-obj-y += vmstate.o -stub-obj-$(CONFIG_SOFTMMU) += win32-kbd-hook.o - -####################################################################### -# code used by both qemu system emulation and qemu-img - -ifeq ($(call lor,$(CONFIG_SOFTMMU),$(CONFIG_TOOLS)),y) - -stub-obj-y += arch_type.o -stub-obj-y += bdrv-next-monitor-owned.o -stub-obj-y += blockdev-close-all-bdrv-states.o -stub-obj-y += change-state-handler.o -stub-obj-y += clock-warp.o -stub-obj-y += fd-register.o -stub-obj-y += fw_cfg.o -stub-obj-y += get-vm-name.o -stub-obj-y += iothread.o -stub-obj-y += machine-init-done.o -stub-obj-y += migr-blocker.o -stub-obj-y += monitor.o -stub-obj-y += pci-host-piix.o -stub-obj-y += ram-block.o -stub-obj-y += replay-user.o -stub-obj-y += target-get-monitor-def.o -stub-obj-y += target-monitor-defs.o -stub-obj-y += uuid.o -stub-obj-y += vm-stop.o - -endif # CONFIG_SOFTMMU || CONFIG_TOOLS diff --git a/stubs/meson.build b/stubs/meson.build new file mode 100644 index 0000000000..019bd79c7a --- /dev/null +++ b/stubs/meson.build @@ -0,0 +1,50 @@ +stub_ss.add(files('arch_type.c')) +stub_ss.add(files('bdrv-next-monitor-owned.c')) +stub_ss.add(files('blk-commit-all.c')) +stub_ss.add(files('blockdev-close-all-bdrv-states.c')) +stub_ss.add(files('change-state-handler.c')) +stub_ss.add(files('clock-warp.c')) +stub_ss.add(files('cmos.c')) +stub_ss.add(files('cpu-get-clock.c')) +stub_ss.add(files('cpu-get-icount.c')) +stub_ss.add(files('dump.c')) +stub_ss.add(files('error-printf.c')) +stub_ss.add(files('fd-register.c')) +stub_ss.add(files('fdset.c')) +stub_ss.add(files('fw_cfg.c')) +stub_ss.add(files('gdbstub.c')) +stub_ss.add(files('get-vm-name.c')) +stub_ss.add(when: 'CONFIG_LINUX_IO_URING', if_true: files('io_uring.c')) +stub_ss.add(files('iothread.c')) +stub_ss.add(files('iothread-lock.c')) +stub_ss.add(files('isa-bus.c')) +stub_ss.add(files('is-daemonized.c')) +stub_ss.add(when: 'CONFIG_LINUX_AIO', if_true: files('linux-aio.c')) +stub_ss.add(files('machine-init-done.c')) +stub_ss.add(files('migr-blocker.c')) +stub_ss.add(files('monitor.c')) +stub_ss.add(files('monitor-core.c')) +stub_ss.add(files('notify-event.c')) +stub_ss.add(files('pci-bus.c')) +stub_ss.add(files('pci-host-piix.c')) +stub_ss.add(files('qmp_memory_device.c')) +stub_ss.add(files('qtest.c')) +stub_ss.add(files('ram-block.c')) +stub_ss.add(files('ramfb.c')) +stub_ss.add(files('replay.c')) +stub_ss.add(files('replay-user.c')) +stub_ss.add(files('runstate-check.c')) +stub_ss.add(files('set-fd-handler.c')) +stub_ss.add(files('sysbus.c')) +stub_ss.add(files('target-get-monitor-def.c')) +stub_ss.add(files('target-monitor-defs.c')) +stub_ss.add(files('tpm.c')) +stub_ss.add(files('trace-control.c')) +stub_ss.add(files('uuid.c')) +stub_ss.add(files('vmgenid.c')) +stub_ss.add(files('vmstate.c')) +stub_ss.add(files('vm-stop.c')) +stub_ss.add(files('win32-kbd-hook.c')) +if have_system + stub_ss.add(files('semihost.c')) +endif diff --git a/target/alpha/Makefile.objs b/target/alpha/Makefile.objs deleted file mode 100644 index 63664629f6..0000000000 --- a/target/alpha/Makefile.objs +++ /dev/null @@ -1,4 +0,0 @@ -obj-$(CONFIG_SOFTMMU) += machine.o -obj-y += translate.o helper.o cpu.o -obj-y += int_helper.o fpu_helper.o vax_helper.o sys_helper.o mem_helper.o -obj-y += gdbstub.o diff --git a/target/alpha/meson.build b/target/alpha/meson.build new file mode 100644 index 0000000000..1aec55abb4 --- /dev/null +++ b/target/alpha/meson.build @@ -0,0 +1,18 @@ +alpha_ss = ss.source_set() +alpha_ss.add(files( + 'cpu.c', + 'fpu_helper.c', + 'gdbstub.c', + 'helper.c', + 'int_helper.c', + 'mem_helper.c', + 'sys_helper.c', + 'translate.c', + 'vax_helper.c', +)) + +alpha_softmmu_ss = ss.source_set() +alpha_softmmu_ss.add(files('machine.c')) + +target_arch += {'alpha': alpha_ss} +target_softmmu_arch += {'alpha': alpha_softmmu_ss} diff --git a/target/arm/Makefile.objs b/target/arm/Makefile.objs deleted file mode 100644 index fa39fd7c83..0000000000 --- a/target/arm/Makefile.objs +++ /dev/null @@ -1,89 +0,0 @@ -obj-$(CONFIG_TCG) += arm-semi.o -obj-y += helper.o vfp_helper.o -obj-y += cpu.o gdbstub.o -obj-$(TARGET_AARCH64) += cpu64.o gdbstub64.o - -obj-$(CONFIG_SOFTMMU) += machine.o arch_dump.o monitor.o -obj-$(CONFIG_SOFTMMU) += arm-powerctl.o - -obj-$(CONFIG_KVM) += kvm.o -obj-$(call land,$(CONFIG_KVM),$(call lnot,$(TARGET_AARCH64))) += kvm32.o -obj-$(call land,$(CONFIG_KVM),$(TARGET_AARCH64)) += kvm64.o -obj-$(call lnot,$(CONFIG_KVM)) += kvm-stub.o - -DECODETREE = $(SRC_PATH)/scripts/decodetree.py - -target/arm/decode-sve.inc.c: $(SRC_PATH)/target/arm/sve.decode $(DECODETREE) - $(call quiet-command,\ - $(PYTHON) $(DECODETREE) --decode disas_sve -o $@ $<,\ - "GEN", $(TARGET_DIR)$@) - -target/arm/decode-neon-shared.inc.c: $(SRC_PATH)/target/arm/neon-shared.decode $(DECODETREE) - $(call quiet-command,\ - $(PYTHON) $(DECODETREE) --static-decode disas_neon_shared -o $@ $<,\ - "GEN", $(TARGET_DIR)$@) - -target/arm/decode-neon-dp.inc.c: $(SRC_PATH)/target/arm/neon-dp.decode $(DECODETREE) - $(call quiet-command,\ - $(PYTHON) $(DECODETREE) --static-decode disas_neon_dp -o $@ $<,\ - "GEN", $(TARGET_DIR)$@) - -target/arm/decode-neon-ls.inc.c: $(SRC_PATH)/target/arm/neon-ls.decode $(DECODETREE) - $(call quiet-command,\ - $(PYTHON) $(DECODETREE) --static-decode disas_neon_ls -o $@ $<,\ - "GEN", $(TARGET_DIR)$@) - -target/arm/decode-vfp.inc.c: $(SRC_PATH)/target/arm/vfp.decode $(DECODETREE) - $(call quiet-command,\ - $(PYTHON) $(DECODETREE) --static-decode disas_vfp -o $@ $<,\ - "GEN", $(TARGET_DIR)$@) - -target/arm/decode-vfp-uncond.inc.c: $(SRC_PATH)/target/arm/vfp-uncond.decode $(DECODETREE) - $(call quiet-command,\ - $(PYTHON) $(DECODETREE) --static-decode disas_vfp_uncond -o $@ $<,\ - "GEN", $(TARGET_DIR)$@) - -target/arm/decode-a32.inc.c: $(SRC_PATH)/target/arm/a32.decode $(DECODETREE) - $(call quiet-command,\ - $(PYTHON) $(DECODETREE) --static-decode disas_a32 -o $@ $<,\ - "GEN", $(TARGET_DIR)$@) - -target/arm/decode-a32-uncond.inc.c: $(SRC_PATH)/target/arm/a32-uncond.decode $(DECODETREE) - $(call quiet-command,\ - $(PYTHON) $(DECODETREE) --static-decode disas_a32_uncond -o $@ $<,\ - "GEN", $(TARGET_DIR)$@) - -target/arm/decode-t32.inc.c: $(SRC_PATH)/target/arm/t32.decode $(DECODETREE) - $(call quiet-command,\ - $(PYTHON) $(DECODETREE) --static-decode disas_t32 -o $@ $<,\ - "GEN", $(TARGET_DIR)$@) - -target/arm/decode-t16.inc.c: $(SRC_PATH)/target/arm/t16.decode $(DECODETREE) - $(call quiet-command,\ - $(PYTHON) $(DECODETREE) -w 16 --static-decode disas_t16 -o $@ $<,\ - "GEN", $(TARGET_DIR)$@) - -target/arm/translate-sve.o: target/arm/decode-sve.inc.c -target/arm/translate.o: target/arm/decode-neon-shared.inc.c -target/arm/translate.o: target/arm/decode-neon-dp.inc.c -target/arm/translate.o: target/arm/decode-neon-ls.inc.c -target/arm/translate.o: target/arm/decode-vfp.inc.c -target/arm/translate.o: target/arm/decode-vfp-uncond.inc.c -target/arm/translate.o: target/arm/decode-a32.inc.c -target/arm/translate.o: target/arm/decode-a32-uncond.inc.c -target/arm/translate.o: target/arm/decode-t32.inc.c -target/arm/translate.o: target/arm/decode-t16.inc.c - -obj-y += tlb_helper.o debug_helper.o -obj-y += translate.o op_helper.o -obj-y += crypto_helper.o -obj-y += iwmmxt_helper.o vec_helper.o neon_helper.o -obj-y += m_helper.o -obj-y += cpu_tcg.o - -obj-$(CONFIG_SOFTMMU) += psci.o - -obj-$(TARGET_AARCH64) += translate-a64.o helper-a64.o -obj-$(TARGET_AARCH64) += translate-sve.o sve_helper.o -obj-$(TARGET_AARCH64) += pauth_helper.o -obj-$(TARGET_AARCH64) += mte_helper.o diff --git a/target/arm/a32.decode b/target/arm/a32.decode index 0bd952c069..4dfd9139bf 100644 --- a/target/arm/a32.decode +++ b/target/arm/a32.decode @@ -47,6 +47,8 @@ &bfi rd rn lsb msb &sat rd rn satimm imm sh &pkh rd rn rm imm tb +&mcr cp opc1 crn crm opc2 rt +&mcrr cp opc1 crm rt rt2 # Data-processing (register) @@ -529,6 +531,23 @@ LDM_a32 ---- 100 b:1 i:1 u:1 w:1 1 rn:4 list:16 &ldst_block B .... 1010 ........................ @branch BL .... 1011 ........................ @branch +# Coprocessor instructions + +# We decode MCR, MCR, MRRC and MCRR only, because for QEMU the +# other coprocessor instructions always UNDEF. +# The trans_ functions for these will ignore cp values 8..13 for v7 or +# earlier, and 0..13 for v8 and later, because those areas of the +# encoding space may be used for other things, such as VFP or Neon. + +@mcr ---- .... opc1:3 . crn:4 rt:4 cp:4 opc2:3 . crm:4 &mcr +@mcrr ---- .... .... rt2:4 rt:4 cp:4 opc1:4 crm:4 &mcrr + +MCRR .... 1100 0100 .... .... .... .... .... @mcrr +MRRC .... 1100 0101 .... .... .... .... .... @mcrr + +MCR .... 1110 ... 0 .... .... .... ... 1 .... @mcr +MRC .... 1110 ... 1 .... .... .... ... 1 .... @mcr + # Supervisor call SVC ---- 1111 imm:24 &i diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 111579554f..6b382fcd60 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -391,12 +391,15 @@ static void arm_cpu_reset(DeviceState *dev) set_flush_to_zero(1, &env->vfp.standard_fp_status); set_flush_inputs_to_zero(1, &env->vfp.standard_fp_status); set_default_nan_mode(1, &env->vfp.standard_fp_status); + set_default_nan_mode(1, &env->vfp.standard_fp_status_f16); set_float_detect_tininess(float_tininess_before_rounding, &env->vfp.fp_status); set_float_detect_tininess(float_tininess_before_rounding, &env->vfp.standard_fp_status); set_float_detect_tininess(float_tininess_before_rounding, &env->vfp.fp_status_f16); + set_float_detect_tininess(float_tininess_before_rounding, + &env->vfp.standard_fp_status_f16); #ifndef CONFIG_USER_ONLY if (kvm_enabled()) { kvm_arm_reset_vcpu(cpu); diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 9e8ed423ea..ac857bdc2c 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -609,6 +609,8 @@ typedef struct CPUARMState { * fp_status: is the "normal" fp status. * fp_status_fp16: used for half-precision calculations * standard_fp_status : the ARM "Standard FPSCR Value" + * standard_fp_status_fp16 : used for half-precision + * calculations with the ARM "Standard FPSCR Value" * * Half-precision operations are governed by a separate * flush-to-zero control bit in FPSCR:FZ16. We pass a separate @@ -619,15 +621,20 @@ typedef struct CPUARMState { * Neon) which the architecture defines as controlled by the * standard FPSCR value rather than the FPSCR. * + * The "standard FPSCR but for fp16 ops" is needed because + * the "standard FPSCR" tracks the FPSCR.FZ16 bit rather than + * using a fixed value for it. + * * To avoid having to transfer exception bits around, we simply * say that the FPSCR cumulative exception flags are the logical - * OR of the flags in the three fp statuses. This relies on the + * OR of the flags in the four fp statuses. This relies on the * only thing which needs to read the exception flags being * an explicit FPSCR read. */ float_status fp_status; float_status fp_status_f16; float_status standard_fp_status; + float_status standard_fp_status_f16; /* ZCR_EL[1-3] */ uint64_t zcr_el[4]; @@ -1950,7 +1957,6 @@ enum arm_features { ARM_FEATURE_V8, ARM_FEATURE_AARCH64, /* supports 64 bit mode */ ARM_FEATURE_CBAR, /* has cp15 CBAR */ - ARM_FEATURE_CRC, /* ARMv8 CRC instructions */ ARM_FEATURE_CBAR_RO, /* has cp15 CBAR and it is read-only */ ARM_FEATURE_EL2, /* has EL2 Virtualization support */ ARM_FEATURE_EL3, /* has EL3 Secure monitor support */ diff --git a/target/arm/helper.c b/target/arm/helper.c index 455c92b891..6b4f0eb533 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -8462,6 +8462,35 @@ void define_one_arm_cp_reg_with_opaque(ARMCPU *cpu, assert((r->state != ARM_CP_STATE_AA32) || (r->opc0 == 0)); /* AArch64 regs are all 64 bit so ARM_CP_64BIT is meaningless */ assert((r->state != ARM_CP_STATE_AA64) || !(r->type & ARM_CP_64BIT)); + /* + * This API is only for Arm's system coprocessors (14 and 15) or + * (M-profile or v7A-and-earlier only) for implementation defined + * coprocessors in the range 0..7. Our decode assumes this, since + * 8..13 can be used for other insns including VFP and Neon. See + * valid_cp() in translate.c. Assert here that we haven't tried + * to use an invalid coprocessor number. + */ + switch (r->state) { + case ARM_CP_STATE_BOTH: + /* 0 has a special meaning, but otherwise the same rules as AA32. */ + if (r->cp == 0) { + break; + } + /* fall through */ + case ARM_CP_STATE_AA32: + if (arm_feature(&cpu->env, ARM_FEATURE_V8) && + !arm_feature(&cpu->env, ARM_FEATURE_M)) { + assert(r->cp >= 14 && r->cp <= 15); + } else { + assert(r->cp < 8 || (r->cp >= 14 && r->cp <= 15)); + } + break; + case ARM_CP_STATE_AA64: + assert(r->cp == 0 || r->cp == CP_REG_ARM64_SYSREG_CP); + break; + default: + g_assert_not_reached(); + } /* The AArch64 pseudocode CheckSystemAccess() specifies that op1 * encodes a minimum access level for the register. We roll this * runtime check into our general permission check code, so check diff --git a/target/arm/m-nocp.decode b/target/arm/m-nocp.decode new file mode 100644 index 0000000000..7182d7d121 --- /dev/null +++ b/target/arm/m-nocp.decode @@ -0,0 +1,42 @@ +# M-profile UserFault.NOCP exception handling +# +# Copyright (c) 2020 Linaro, Ltd +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, see <http://www.gnu.org/licenses/>. + +# +# This file is processed by scripts/decodetree.py +# +# For M-profile, the architecture specifies that NOCP UsageFaults +# should take precedence over UNDEF faults over the whole wide +# range of coprocessor-space encodings, with the exception of +# VLLDM and VLSTM. (Compare v8.1M IsCPInstruction() pseudocode and +# v8M Arm ARM rule R_QLGM.) This isn't mandatory for v8.0M but we choose +# to behave the same as v8.1M. +# This decode is handled before any others (and in particular before +# decoding FP instructions which are in the coprocessor space). +# If the coprocessor is not present or disabled then we will generate +# the NOCP exception; otherwise we let the insn through to the main decode. + +{ + # Special cases which do not take an early NOCP: VLLDM and VLSTM + VLLDM_VLSTM 1110 1100 001 l:1 rn:4 0000 1010 0000 0000 + # TODO: VSCCLRM (new in v8.1M) is similar: + #VSCCLRM 1110 1100 1-01 1111 ---- 1011 ---- ---0 + + NOCP 111- 1110 ---- ---- ---- cp:4 ---- ---- + NOCP 111- 110- ---- ---- ---- cp:4 ---- ---- + # TODO: From v8.1M onwards we will also want this range to NOCP + #NOCP_8_1 111- 1111 ---- ---- ---- ---- ---- ---- cp=10 +} diff --git a/target/arm/meson.build b/target/arm/meson.build new file mode 100644 index 0000000000..8990090712 --- /dev/null +++ b/target/arm/meson.build @@ -0,0 +1,63 @@ +gen = [ + decodetree.process('sve.decode', extra_args: '--decode=disas_sve'), + decodetree.process('neon-shared.decode', extra_args: '--static-decode=disas_neon_shared'), + decodetree.process('neon-dp.decode', extra_args: '--static-decode=disas_neon_dp'), + decodetree.process('neon-ls.decode', extra_args: '--static-decode=disas_neon_ls'), + decodetree.process('vfp.decode', extra_args: '--static-decode=disas_vfp'), + decodetree.process('vfp-uncond.decode', extra_args: '--static-decode=disas_vfp_uncond'), + decodetree.process('m-nocp.decode', extra_args: '--static-decode=disas_m_nocp'), + decodetree.process('a32.decode', extra_args: '--static-decode=disas_a32'), + decodetree.process('a32-uncond.decode', extra_args: '--static-decode=disas_a32_uncond'), + decodetree.process('t32.decode', extra_args: '--static-decode=disas_t32'), + decodetree.process('t16.decode', extra_args: ['-w', '16', '--static-decode=disas_t16']), +] + +arm_ss = ss.source_set() +arm_ss.add(gen) +arm_ss.add(files( + 'cpu.c', + 'crypto_helper.c', + 'debug_helper.c', + 'gdbstub.c', + 'helper.c', + 'iwmmxt_helper.c', + 'm_helper.c', + 'neon_helper.c', + 'op_helper.c', + 'tlb_helper.c', + 'translate.c', + 'vec_helper.c', + 'vfp_helper.c', + 'cpu_tcg.c', +)) +arm_ss.add(zlib) + +arm_ss.add(when: 'CONFIG_TCG', if_true: files('arm-semi.c')) + +kvm_ss = ss.source_set() +kvm_ss.add(when: 'TARGET_AARCH64', if_true: files('kvm64.c'), if_false: files('kvm32.c')) +arm_ss.add_all(when: 'CONFIG_KVM', if_true: kvm_ss) +arm_ss.add(when: 'CONFIG_KVM', if_true: files('kvm.c'), if_false: files('kvm-stub.c')) + +arm_ss.add(when: 'TARGET_AARCH64', if_true: files( + 'cpu64.c', + 'gdbstub64.c', + 'helper-a64.c', + 'mte_helper.c', + 'pauth_helper.c', + 'sve_helper.c', + 'translate-a64.c', + 'translate-sve.c', +)) + +arm_softmmu_ss = ss.source_set() +arm_softmmu_ss.add(files( + 'arch_dump.c', + 'arm-powerctl.c', + 'machine.c', + 'monitor.c', + 'psci.c', +)) + +target_arch += {'arm': arm_ss} +target_softmmu_arch += {'arm': arm_softmmu_ss} diff --git a/target/arm/t32.decode b/target/arm/t32.decode index c21a988f97..7069d821fd 100644 --- a/target/arm/t32.decode +++ b/target/arm/t32.decode @@ -45,6 +45,8 @@ &sat !extern rd rn satimm imm sh &pkh !extern rd rn rm imm tb &cps !extern mode imod M A I F +&mcr !extern cp opc1 crn crm opc2 rt +&mcrr !extern cp opc1 crm rt rt2 # Data-processing (register) @@ -621,6 +623,23 @@ RFE 1110 1001 10.1 .... 1100000000000000 @rfe pu=1 SRS 1110 1000 00.0 1101 1100 0000 000. .... @srs pu=2 SRS 1110 1001 10.0 1101 1100 0000 000. .... @srs pu=1 +# Coprocessor instructions + +# We decode MCR, MCR, MRRC and MCRR only, because for QEMU the +# other coprocessor instructions always UNDEF. +# The trans_ functions for these will ignore cp values 8..13 for v7 or +# earlier, and 0..13 for v8 and later, because those areas of the +# encoding space may be used for other things, such as VFP or Neon. + +@mcr .... .... opc1:3 . crn:4 rt:4 cp:4 opc2:3 . crm:4 +@mcrr .... .... .... rt2:4 rt:4 cp:4 opc1:4 crm:4 + +MCRR 1110 1100 0100 .... .... .... .... .... @mcrr +MRRC 1110 1100 0101 .... .... .... .... .... @mcrr + +MCR 1110 1110 ... 0 .... .... .... ... 1 .... @mcr +MRC 1110 1110 ... 1 .... .... .... ... 1 .... @mcr + # Branches %imm24 26:s1 13:1 11:1 16:10 0:11 !function=t32_branch24 diff --git a/target/arm/trace.h b/target/arm/trace.h new file mode 100644 index 0000000000..60372d8e26 --- /dev/null +++ b/target/arm/trace.h @@ -0,0 +1 @@ +#include "trace/trace-target_arm.h" diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 534c3ff5f3..0fc5e12fab 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -609,25 +609,6 @@ static void write_fp_sreg(DisasContext *s, int reg, TCGv_i32 v) tcg_temp_free_i64(tmp); } -TCGv_ptr get_fpstatus_ptr(bool is_f16) -{ - TCGv_ptr statusptr = tcg_temp_new_ptr(); - int offset; - - /* In A64 all instructions (both FP and Neon) use the FPCR; there - * is no equivalent of the A32 Neon "standard FPSCR value". - * However half-precision operations operate under a different - * FZ16 flag and use vfp.fp_status_f16 instead of vfp.fp_status. - */ - if (is_f16) { - offset = offsetof(CPUARMState, vfp.fp_status_f16); - } else { - offset = offsetof(CPUARMState, vfp.fp_status); - } - tcg_gen_addi_ptr(statusptr, cpu_env, offset); - return statusptr; -} - /* Expand a 2-operand AdvSIMD vector operation using an expander function. */ static void gen_gvec_fn2(DisasContext *s, bool is_q, int rd, int rn, GVecGen2Fn *gvec_fn, int vece) @@ -689,7 +670,7 @@ static void gen_gvec_op3_fpst(DisasContext *s, bool is_q, int rd, int rn, int rm, bool is_fp16, int data, gen_helper_gvec_3_ptr *fn) { - TCGv_ptr fpst = get_fpstatus_ptr(is_fp16); + TCGv_ptr fpst = fpstatus_ptr(is_fp16 ? FPST_FPCR_F16 : FPST_FPCR); tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, rd), vec_full_reg_offset(s, rn), vec_full_reg_offset(s, rm), fpst, @@ -5898,7 +5879,7 @@ static void handle_fp_compare(DisasContext *s, int size, bool cmp_with_zero, bool signal_all_nans) { TCGv_i64 tcg_flags = tcg_temp_new_i64(); - TCGv_ptr fpst = get_fpstatus_ptr(size == MO_16); + TCGv_ptr fpst = fpstatus_ptr(size == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); if (size == MO_64) { TCGv_i64 tcg_vn, tcg_vm; @@ -6157,7 +6138,7 @@ static void handle_fp_1src_half(DisasContext *s, int opcode, int rd, int rn) tcg_gen_xori_i32(tcg_res, tcg_op, 0x8000); break; case 0x3: /* FSQRT */ - fpst = get_fpstatus_ptr(true); + fpst = fpstatus_ptr(FPST_FPCR_F16); gen_helper_sqrt_f16(tcg_res, tcg_op, fpst); break; case 0x8: /* FRINTN */ @@ -6167,7 +6148,7 @@ static void handle_fp_1src_half(DisasContext *s, int opcode, int rd, int rn) case 0xc: /* FRINTA */ { TCGv_i32 tcg_rmode = tcg_const_i32(arm_rmode_to_sf(opcode & 7)); - fpst = get_fpstatus_ptr(true); + fpst = fpstatus_ptr(FPST_FPCR_F16); gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); gen_helper_advsimd_rinth(tcg_res, tcg_op, fpst); @@ -6177,11 +6158,11 @@ static void handle_fp_1src_half(DisasContext *s, int opcode, int rd, int rn) break; } case 0xe: /* FRINTX */ - fpst = get_fpstatus_ptr(true); + fpst = fpstatus_ptr(FPST_FPCR_F16); gen_helper_advsimd_rinth_exact(tcg_res, tcg_op, fpst); break; case 0xf: /* FRINTI */ - fpst = get_fpstatus_ptr(true); + fpst = fpstatus_ptr(FPST_FPCR_F16); gen_helper_advsimd_rinth(tcg_res, tcg_op, fpst); break; default: @@ -6253,7 +6234,7 @@ static void handle_fp_1src_single(DisasContext *s, int opcode, int rd, int rn) g_assert_not_reached(); } - fpst = get_fpstatus_ptr(false); + fpst = fpstatus_ptr(FPST_FPCR); if (rmode >= 0) { TCGv_i32 tcg_rmode = tcg_const_i32(rmode); gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); @@ -6330,7 +6311,7 @@ static void handle_fp_1src_double(DisasContext *s, int opcode, int rd, int rn) g_assert_not_reached(); } - fpst = get_fpstatus_ptr(false); + fpst = fpstatus_ptr(FPST_FPCR); if (rmode >= 0) { TCGv_i32 tcg_rmode = tcg_const_i32(rmode); gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); @@ -6365,7 +6346,7 @@ static void handle_fp_fcvt(DisasContext *s, int opcode, /* Single to half */ TCGv_i32 tcg_rd = tcg_temp_new_i32(); TCGv_i32 ahp = get_ahp_flag(); - TCGv_ptr fpst = get_fpstatus_ptr(false); + TCGv_ptr fpst = fpstatus_ptr(FPST_FPCR); gen_helper_vfp_fcvt_f32_to_f16(tcg_rd, tcg_rn, fpst, ahp); /* write_fp_sreg is OK here because top half of tcg_rd is zero */ @@ -6385,7 +6366,7 @@ static void handle_fp_fcvt(DisasContext *s, int opcode, /* Double to single */ gen_helper_vfp_fcvtsd(tcg_rd, tcg_rn, cpu_env); } else { - TCGv_ptr fpst = get_fpstatus_ptr(false); + TCGv_ptr fpst = fpstatus_ptr(FPST_FPCR); TCGv_i32 ahp = get_ahp_flag(); /* Double to half */ gen_helper_vfp_fcvt_f64_to_f16(tcg_rd, tcg_rn, fpst, ahp); @@ -6401,7 +6382,7 @@ static void handle_fp_fcvt(DisasContext *s, int opcode, case 0x3: { TCGv_i32 tcg_rn = read_fp_sreg(s, rn); - TCGv_ptr tcg_fpst = get_fpstatus_ptr(false); + TCGv_ptr tcg_fpst = fpstatus_ptr(FPST_FPCR); TCGv_i32 tcg_ahp = get_ahp_flag(); tcg_gen_ext16u_i32(tcg_rn, tcg_rn); if (dtype == 0) { @@ -6518,7 +6499,7 @@ static void handle_fp_2src_single(DisasContext *s, int opcode, TCGv_ptr fpst; tcg_res = tcg_temp_new_i32(); - fpst = get_fpstatus_ptr(false); + fpst = fpstatus_ptr(FPST_FPCR); tcg_op1 = read_fp_sreg(s, rn); tcg_op2 = read_fp_sreg(s, rm); @@ -6571,7 +6552,7 @@ static void handle_fp_2src_double(DisasContext *s, int opcode, TCGv_ptr fpst; tcg_res = tcg_temp_new_i64(); - fpst = get_fpstatus_ptr(false); + fpst = fpstatus_ptr(FPST_FPCR); tcg_op1 = read_fp_dreg(s, rn); tcg_op2 = read_fp_dreg(s, rm); @@ -6624,7 +6605,7 @@ static void handle_fp_2src_half(DisasContext *s, int opcode, TCGv_ptr fpst; tcg_res = tcg_temp_new_i32(); - fpst = get_fpstatus_ptr(true); + fpst = fpstatus_ptr(FPST_FPCR_F16); tcg_op1 = read_fp_hreg(s, rn); tcg_op2 = read_fp_hreg(s, rm); @@ -6723,7 +6704,7 @@ static void handle_fp_3src_single(DisasContext *s, bool o0, bool o1, { TCGv_i32 tcg_op1, tcg_op2, tcg_op3; TCGv_i32 tcg_res = tcg_temp_new_i32(); - TCGv_ptr fpst = get_fpstatus_ptr(false); + TCGv_ptr fpst = fpstatus_ptr(FPST_FPCR); tcg_op1 = read_fp_sreg(s, rn); tcg_op2 = read_fp_sreg(s, rm); @@ -6761,7 +6742,7 @@ static void handle_fp_3src_double(DisasContext *s, bool o0, bool o1, { TCGv_i64 tcg_op1, tcg_op2, tcg_op3; TCGv_i64 tcg_res = tcg_temp_new_i64(); - TCGv_ptr fpst = get_fpstatus_ptr(false); + TCGv_ptr fpst = fpstatus_ptr(FPST_FPCR); tcg_op1 = read_fp_dreg(s, rn); tcg_op2 = read_fp_dreg(s, rm); @@ -6799,7 +6780,7 @@ static void handle_fp_3src_half(DisasContext *s, bool o0, bool o1, { TCGv_i32 tcg_op1, tcg_op2, tcg_op3; TCGv_i32 tcg_res = tcg_temp_new_i32(); - TCGv_ptr fpst = get_fpstatus_ptr(true); + TCGv_ptr fpst = fpstatus_ptr(FPST_FPCR_F16); tcg_op1 = read_fp_hreg(s, rn); tcg_op2 = read_fp_hreg(s, rm); @@ -6945,7 +6926,7 @@ static void handle_fpfpcvt(DisasContext *s, int rd, int rn, int opcode, TCGv_i32 tcg_shift, tcg_single; TCGv_i64 tcg_double; - tcg_fpstatus = get_fpstatus_ptr(type == 3); + tcg_fpstatus = fpstatus_ptr(type == 3 ? FPST_FPCR_F16 : FPST_FPCR); tcg_shift = tcg_const_i32(64 - scale); @@ -7233,7 +7214,7 @@ static void handle_fmov(DisasContext *s, int rd, int rn, int type, bool itof) static void handle_fjcvtzs(DisasContext *s, int rd, int rn) { TCGv_i64 t = read_fp_dreg(s, rn); - TCGv_ptr fpstatus = get_fpstatus_ptr(false); + TCGv_ptr fpstatus = fpstatus_ptr(FPST_FPCR); gen_helper_fjcvtzs(t, t, fpstatus); @@ -7847,7 +7828,7 @@ static void disas_simd_across_lanes(DisasContext *s, uint32_t insn) * Note that correct NaN propagation requires that we do these * operations in exactly the order specified by the pseudocode. */ - TCGv_ptr fpst = get_fpstatus_ptr(size == MO_16); + TCGv_ptr fpst = fpstatus_ptr(size == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); int fpopcode = opcode | is_min << 4 | is_u << 5; int vmap = (1 << elements) - 1; TCGv_i32 tcg_res32 = do_reduction_op(s, fpopcode, rn, esize, @@ -8359,7 +8340,7 @@ static void disas_simd_scalar_pairwise(DisasContext *s, uint32_t insn) return; } - fpst = get_fpstatus_ptr(size == MO_16); + fpst = fpstatus_ptr(size == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); break; default: unallocated_encoding(s); @@ -8872,7 +8853,7 @@ static void handle_simd_intfp_conv(DisasContext *s, int rd, int rn, int elements, int is_signed, int fracbits, int size) { - TCGv_ptr tcg_fpst = get_fpstatus_ptr(size == MO_16); + TCGv_ptr tcg_fpst = fpstatus_ptr(size == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); TCGv_i32 tcg_shift = NULL; MemOp mop = size | (is_signed ? MO_SIGN : 0); @@ -9053,7 +9034,7 @@ static void handle_simd_shift_fpint_conv(DisasContext *s, bool is_scalar, assert(!(is_scalar && is_q)); tcg_rmode = tcg_const_i32(arm_rmode_to_sf(FPROUNDING_ZERO)); - tcg_fpstatus = get_fpstatus_ptr(size == MO_16); + tcg_fpstatus = fpstatus_ptr(size == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); gen_helper_set_rmode(tcg_rmode, tcg_rmode, tcg_fpstatus); fracbits = (16 << size) - immhb; tcg_shift = tcg_const_i32(fracbits); @@ -9392,7 +9373,7 @@ static void handle_3same_float(DisasContext *s, int size, int elements, int fpopcode, int rd, int rn, int rm) { int pass; - TCGv_ptr fpst = get_fpstatus_ptr(false); + TCGv_ptr fpst = fpstatus_ptr(FPST_FPCR); for (pass = 0; pass < elements; pass++) { if (size) { @@ -9785,7 +9766,7 @@ static void disas_simd_scalar_three_reg_same_fp16(DisasContext *s, return; } - fpst = get_fpstatus_ptr(true); + fpst = fpstatus_ptr(FPST_FPCR_F16); tcg_op1 = read_fp_hreg(s, rn); tcg_op2 = read_fp_hreg(s, rm); @@ -10038,7 +10019,7 @@ static void handle_2misc_fcmp_zero(DisasContext *s, int opcode, return; } - fpst = get_fpstatus_ptr(size == MO_16); + fpst = fpstatus_ptr(size == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); if (is_double) { TCGv_i64 tcg_op = tcg_temp_new_i64(); @@ -10168,7 +10149,7 @@ static void handle_2misc_reciprocal(DisasContext *s, int opcode, int size, int rn, int rd) { bool is_double = (size == 3); - TCGv_ptr fpst = get_fpstatus_ptr(false); + TCGv_ptr fpst = fpstatus_ptr(FPST_FPCR); if (is_double) { TCGv_i64 tcg_op = tcg_temp_new_i64(); @@ -10309,7 +10290,7 @@ static void handle_2misc_narrow(DisasContext *s, bool scalar, } else { TCGv_i32 tcg_lo = tcg_temp_new_i32(); TCGv_i32 tcg_hi = tcg_temp_new_i32(); - TCGv_ptr fpst = get_fpstatus_ptr(false); + TCGv_ptr fpst = fpstatus_ptr(FPST_FPCR); TCGv_i32 ahp = get_ahp_flag(); tcg_gen_extr_i64_i32(tcg_lo, tcg_hi, tcg_op); @@ -10571,7 +10552,7 @@ static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn) if (is_fcvt) { tcg_rmode = tcg_const_i32(arm_rmode_to_sf(rmode)); - tcg_fpstatus = get_fpstatus_ptr(false); + tcg_fpstatus = fpstatus_ptr(FPST_FPCR); gen_helper_set_rmode(tcg_rmode, tcg_rmode, tcg_fpstatus); } else { tcg_rmode = NULL; @@ -11396,7 +11377,7 @@ static void handle_simd_3same_pair(DisasContext *s, int is_q, int u, int opcode, /* Floating point operations need fpst */ if (opcode >= 0x58) { - fpst = get_fpstatus_ptr(false); + fpst = fpstatus_ptr(FPST_FPCR); } else { fpst = NULL; } @@ -11994,7 +11975,7 @@ static void disas_simd_three_reg_same_fp16(DisasContext *s, uint32_t insn) break; } - fpst = get_fpstatus_ptr(true); + fpst = fpstatus_ptr(FPST_FPCR_F16); if (pairwise) { int maxpass = is_q ? 8 : 4; @@ -12287,7 +12268,7 @@ static void handle_2misc_widening(DisasContext *s, int opcode, bool is_q, /* 16 -> 32 bit fp conversion */ int srcelt = is_q ? 4 : 0; TCGv_i32 tcg_res[4]; - TCGv_ptr fpst = get_fpstatus_ptr(false); + TCGv_ptr fpst = fpstatus_ptr(FPST_FPCR); TCGv_i32 ahp = get_ahp_flag(); for (pass = 0; pass < 4; pass++) { @@ -12759,7 +12740,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) } if (need_fpstatus || need_rmode) { - tcg_fpstatus = get_fpstatus_ptr(false); + tcg_fpstatus = fpstatus_ptr(FPST_FPCR); } else { tcg_fpstatus = NULL; } @@ -13149,7 +13130,7 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) } if (need_rmode || need_fpst) { - tcg_fpstatus = get_fpstatus_ptr(true); + tcg_fpstatus = fpstatus_ptr(FPST_FPCR_F16); } if (need_rmode) { @@ -13458,7 +13439,7 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) } if (is_fp) { - fpst = get_fpstatus_ptr(is_fp16); + fpst = fpstatus_ptr(is_fp16 ? FPST_FPCR_F16 : FPST_FPCR); } else { fpst = NULL; } diff --git a/target/arm/translate-a64.h b/target/arm/translate-a64.h index 647f0c74f6..2e0d16da25 100644 --- a/target/arm/translate-a64.h +++ b/target/arm/translate-a64.h @@ -37,7 +37,6 @@ TCGv_i64 cpu_reg_sp(DisasContext *s, int reg); TCGv_i64 read_cpu_reg(DisasContext *s, int reg, int sf); TCGv_i64 read_cpu_reg_sp(DisasContext *s, int reg, int sf); void write_fp_dreg(DisasContext *s, int reg, TCGv_i64 v); -TCGv_ptr get_fpstatus_ptr(bool); bool logic_imm_decode_wmask(uint64_t *result, unsigned int immn, unsigned int imms, unsigned int immr); bool sve_access_check(DisasContext *s); diff --git a/target/arm/translate-neon.inc.c b/target/arm/translate-neon.c.inc index f6cb921573..9879731a52 100644 --- a/target/arm/translate-neon.inc.c +++ b/target/arm/translate-neon.c.inc @@ -50,9 +50,9 @@ static inline int rsub_8(DisasContext *s, int x) } /* Include the generated Neon decoder */ -#include "decode-neon-dp.inc.c" -#include "decode-neon-ls.inc.c" -#include "decode-neon-shared.inc.c" +#include "decode-neon-dp.c.inc" +#include "decode-neon-ls.c.inc" +#include "decode-neon-shared.c.inc" /* Return the offset of a 2**SIZE piece of a NEON register, at index ELE, * where 0 is the least significant end of the register. @@ -181,7 +181,7 @@ static bool trans_VCMLA(DisasContext *s, arg_VCMLA *a) } opr_sz = (1 + a->q) * 8; - fpst = get_fpstatus_ptr(1); + fpst = fpstatus_ptr(a->size == 0 ? FPST_STD_F16 : FPST_STD); fn_gvec_ptr = a->size ? gen_helper_gvec_fcmlas : gen_helper_gvec_fcmlah; tcg_gen_gvec_3_ptr(vfp_reg_offset(1, a->vd), vfp_reg_offset(1, a->vn), @@ -218,7 +218,7 @@ static bool trans_VCADD(DisasContext *s, arg_VCADD *a) } opr_sz = (1 + a->q) * 8; - fpst = get_fpstatus_ptr(1); + fpst = fpstatus_ptr(a->size == 0 ? FPST_STD_F16 : FPST_STD); fn_gvec_ptr = a->size ? gen_helper_gvec_fcadds : gen_helper_gvec_fcaddh; tcg_gen_gvec_3_ptr(vfp_reg_offset(1, a->vd), vfp_reg_offset(1, a->vn), @@ -322,7 +322,7 @@ static bool trans_VCMLA_scalar(DisasContext *s, arg_VCMLA_scalar *a) fn_gvec_ptr = (a->size ? gen_helper_gvec_fcmlas_idx : gen_helper_gvec_fcmlah_idx); opr_sz = (1 + a->q) * 8; - fpst = get_fpstatus_ptr(1); + fpst = fpstatus_ptr(a->size == 0 ? FPST_STD_F16 : FPST_STD); tcg_gen_gvec_3_ptr(vfp_reg_offset(1, a->vd), vfp_reg_offset(1, a->vn), vfp_reg_offset(1, a->vm), @@ -358,7 +358,7 @@ static bool trans_VDOT_scalar(DisasContext *s, arg_VDOT_scalar *a) fn_gvec = a->u ? gen_helper_gvec_udot_idx_b : gen_helper_gvec_sdot_idx_b; opr_sz = (1 + a->q) * 8; - fpst = get_fpstatus_ptr(1); + fpst = fpstatus_ptr(FPST_STD); tcg_gen_gvec_3_ool(vfp_reg_offset(1, a->vd), vfp_reg_offset(1, a->vn), vfp_reg_offset(1, a->rm), @@ -1063,7 +1063,7 @@ static bool do_3same_fp(DisasContext *s, arg_3same *a, VFPGen3OpSPFn *fn, return true; } - TCGv_ptr fpstatus = get_fpstatus_ptr(1); + TCGv_ptr fpstatus = fpstatus_ptr(FPST_STD); for (pass = 0; pass < (a->q ? 4 : 2); pass++) { tmp = neon_load_reg(a->vn, pass); tmp2 = neon_load_reg(a->vm, pass); @@ -1091,7 +1091,7 @@ static bool do_3same_fp(DisasContext *s, arg_3same *a, VFPGen3OpSPFn *fn, uint32_t rn_ofs, uint32_t rm_ofs, \ uint32_t oprsz, uint32_t maxsz) \ { \ - TCGv_ptr fpst = get_fpstatus_ptr(1); \ + TCGv_ptr fpst = fpstatus_ptr(FPST_STD); \ tcg_gen_gvec_3_ptr(rd_ofs, rn_ofs, rm_ofs, fpst, \ oprsz, maxsz, 0, FUNC); \ tcg_temp_free_ptr(fpst); \ @@ -1287,7 +1287,7 @@ static bool do_3same_fp_pair(DisasContext *s, arg_3same *a, VFPGen3OpSPFn *fn) * early. Since Q is 0 there are always just two passes, so instead * of a complicated loop over each pass we just unroll. */ - fpstatus = get_fpstatus_ptr(1); + fpstatus = fpstatus_ptr(FPST_STD); tmp = neon_load_reg(a->vn, 0); tmp2 = neon_load_reg(a->vn, 1); fn(tmp, tmp, tmp2, fpstatus); @@ -1790,7 +1790,7 @@ static bool do_fp_2sh(DisasContext *s, arg_2reg_shift *a, return true; } - fpstatus = get_fpstatus_ptr(1); + fpstatus = fpstatus_ptr(FPST_STD); shiftv = tcg_const_i32(a->shift); for (pass = 0; pass < (a->q ? 4 : 2); pass++) { tmp = neon_load_reg(a->vm, pass); @@ -2591,7 +2591,7 @@ static bool trans_VMLS_2sc(DisasContext *s, arg_2scalar *a) #define WRAP_FP_FN(WRAPNAME, FUNC) \ static void WRAPNAME(TCGv_i32 rd, TCGv_i32 rn, TCGv_i32 rm) \ { \ - TCGv_ptr fpstatus = get_fpstatus_ptr(1); \ + TCGv_ptr fpstatus = fpstatus_ptr(FPST_STD); \ FUNC(rd, rn, rm, fpstatus); \ tcg_temp_free_ptr(fpstatus); \ } @@ -3480,7 +3480,7 @@ static bool trans_VCVT_F16_F32(DisasContext *s, arg_2misc *a) return true; } - fpst = get_fpstatus_ptr(true); + fpst = fpstatus_ptr(FPST_STD); ahp = get_ahp_flag(); tmp = neon_load_reg(a->vm, 0); gen_helper_vfp_fcvt_f32_to_f16(tmp, tmp, fpst, ahp); @@ -3528,7 +3528,7 @@ static bool trans_VCVT_F32_F16(DisasContext *s, arg_2misc *a) return true; } - fpst = get_fpstatus_ptr(true); + fpst = fpstatus_ptr(FPST_STD); ahp = get_ahp_flag(); tmp3 = tcg_temp_new_i32(); tmp = neon_load_reg(a->vm, 0); @@ -3838,7 +3838,7 @@ static bool do_2misc_fp(DisasContext *s, arg_2misc *a, return true; } - fpst = get_fpstatus_ptr(1); + fpst = fpstatus_ptr(FPST_STD); for (pass = 0; pass < (a->q ? 4 : 2); pass++) { TCGv_i32 tmp = neon_load_reg(a->vm, pass); fn(tmp, tmp, fpst); @@ -3932,7 +3932,7 @@ static bool do_vrint(DisasContext *s, arg_2misc *a, int rmode) return true; } - fpst = get_fpstatus_ptr(1); + fpst = fpstatus_ptr(FPST_STD); tcg_rmode = tcg_const_i32(arm_rmode_to_sf(rmode)); gen_helper_set_neon_rmode(tcg_rmode, tcg_rmode, cpu_env); for (pass = 0; pass < (a->q ? 4 : 2); pass++) { @@ -3993,7 +3993,7 @@ static bool do_vcvt(DisasContext *s, arg_2misc *a, int rmode, bool is_signed) return true; } - fpst = get_fpstatus_ptr(1); + fpst = fpstatus_ptr(FPST_STD); tcg_shift = tcg_const_i32(0); tcg_rmode = tcg_const_i32(arm_rmode_to_sf(rmode)); gen_helper_set_neon_rmode(tcg_rmode, tcg_rmode, cpu_env); diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 88a2fb271d..d97cb37d83 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -100,7 +100,7 @@ static inline int msz_dtype(DisasContext *s, int msz) * Include the generated decoder. */ -#include "decode-sve.inc.c" +#include "decode-sve.c.inc" /* * Implement all of the translator functions referenced by the decoder. @@ -3470,7 +3470,7 @@ static bool trans_FMLA_zzxz(DisasContext *s, arg_FMLA_zzxz *a) if (sve_access_check(s)) { unsigned vsz = vec_full_reg_size(s); - TCGv_ptr status = get_fpstatus_ptr(a->esz == MO_16); + TCGv_ptr status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); tcg_gen_gvec_4_ptr(vec_full_reg_offset(s, a->rd), vec_full_reg_offset(s, a->rn), vec_full_reg_offset(s, a->rm), @@ -3496,7 +3496,7 @@ static bool trans_FMUL_zzx(DisasContext *s, arg_FMUL_zzx *a) if (sve_access_check(s)) { unsigned vsz = vec_full_reg_size(s); - TCGv_ptr status = get_fpstatus_ptr(a->esz == MO_16); + TCGv_ptr status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, a->rd), vec_full_reg_offset(s, a->rn), vec_full_reg_offset(s, a->rm), @@ -3528,7 +3528,7 @@ static void do_reduce(DisasContext *s, arg_rpr_esz *a, tcg_gen_addi_ptr(t_zn, cpu_env, vec_full_reg_offset(s, a->rn)); tcg_gen_addi_ptr(t_pg, cpu_env, pred_full_reg_offset(s, a->pg)); - status = get_fpstatus_ptr(a->esz == MO_16); + status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); fn(temp, t_zn, t_pg, status, t_desc); tcg_temp_free_ptr(t_zn); @@ -3570,7 +3570,7 @@ DO_VPZ(FMAXV, fmaxv) static void do_zz_fp(DisasContext *s, arg_rr_esz *a, gen_helper_gvec_2_ptr *fn) { unsigned vsz = vec_full_reg_size(s); - TCGv_ptr status = get_fpstatus_ptr(a->esz == MO_16); + TCGv_ptr status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); tcg_gen_gvec_2_ptr(vec_full_reg_offset(s, a->rd), vec_full_reg_offset(s, a->rn), @@ -3618,7 +3618,7 @@ static void do_ppz_fp(DisasContext *s, arg_rpr_esz *a, gen_helper_gvec_3_ptr *fn) { unsigned vsz = vec_full_reg_size(s); - TCGv_ptr status = get_fpstatus_ptr(a->esz == MO_16); + TCGv_ptr status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); tcg_gen_gvec_3_ptr(pred_full_reg_offset(s, a->rd), vec_full_reg_offset(s, a->rn), @@ -3670,7 +3670,7 @@ static bool trans_FTMAD(DisasContext *s, arg_FTMAD *a) } if (sve_access_check(s)) { unsigned vsz = vec_full_reg_size(s); - TCGv_ptr status = get_fpstatus_ptr(a->esz == MO_16); + TCGv_ptr status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, a->rd), vec_full_reg_offset(s, a->rn), vec_full_reg_offset(s, a->rm), @@ -3710,7 +3710,7 @@ static bool trans_FADDA(DisasContext *s, arg_rprr_esz *a) t_pg = tcg_temp_new_ptr(); tcg_gen_addi_ptr(t_rm, cpu_env, vec_full_reg_offset(s, a->rm)); tcg_gen_addi_ptr(t_pg, cpu_env, pred_full_reg_offset(s, a->pg)); - t_fpst = get_fpstatus_ptr(a->esz == MO_16); + t_fpst = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); t_desc = tcg_const_i32(simd_desc(vsz, vsz, 0)); fns[a->esz - 1](t_val, t_val, t_rm, t_pg, t_fpst, t_desc); @@ -3737,7 +3737,7 @@ static bool do_zzz_fp(DisasContext *s, arg_rrr_esz *a, } if (sve_access_check(s)) { unsigned vsz = vec_full_reg_size(s); - TCGv_ptr status = get_fpstatus_ptr(a->esz == MO_16); + TCGv_ptr status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, a->rd), vec_full_reg_offset(s, a->rn), vec_full_reg_offset(s, a->rm), @@ -3779,7 +3779,7 @@ static bool do_zpzz_fp(DisasContext *s, arg_rprr_esz *a, } if (sve_access_check(s)) { unsigned vsz = vec_full_reg_size(s); - TCGv_ptr status = get_fpstatus_ptr(a->esz == MO_16); + TCGv_ptr status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); tcg_gen_gvec_4_ptr(vec_full_reg_offset(s, a->rd), vec_full_reg_offset(s, a->rn), vec_full_reg_offset(s, a->rm), @@ -3831,7 +3831,7 @@ static void do_fp_scalar(DisasContext *s, int zd, int zn, int pg, bool is_fp16, tcg_gen_addi_ptr(t_zn, cpu_env, vec_full_reg_offset(s, zn)); tcg_gen_addi_ptr(t_pg, cpu_env, pred_full_reg_offset(s, pg)); - status = get_fpstatus_ptr(is_fp16); + status = fpstatus_ptr(is_fp16 ? FPST_FPCR_F16 : FPST_FPCR); desc = tcg_const_i32(simd_desc(vsz, vsz, 0)); fn(t_zd, t_zn, t_pg, scalar, status, desc); @@ -3895,7 +3895,7 @@ static bool do_fp_cmp(DisasContext *s, arg_rprr_esz *a, } if (sve_access_check(s)) { unsigned vsz = vec_full_reg_size(s); - TCGv_ptr status = get_fpstatus_ptr(a->esz == MO_16); + TCGv_ptr status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); tcg_gen_gvec_4_ptr(pred_full_reg_offset(s, a->rd), vec_full_reg_offset(s, a->rn), vec_full_reg_offset(s, a->rm), @@ -3939,7 +3939,7 @@ static bool trans_FCADD(DisasContext *s, arg_FCADD *a) } if (sve_access_check(s)) { unsigned vsz = vec_full_reg_size(s); - TCGv_ptr status = get_fpstatus_ptr(a->esz == MO_16); + TCGv_ptr status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); tcg_gen_gvec_4_ptr(vec_full_reg_offset(s, a->rd), vec_full_reg_offset(s, a->rn), vec_full_reg_offset(s, a->rm), @@ -3958,7 +3958,7 @@ static bool do_fmla(DisasContext *s, arg_rprrr_esz *a, } if (sve_access_check(s)) { unsigned vsz = vec_full_reg_size(s); - TCGv_ptr status = get_fpstatus_ptr(a->esz == MO_16); + TCGv_ptr status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); tcg_gen_gvec_5_ptr(vec_full_reg_offset(s, a->rd), vec_full_reg_offset(s, a->rn), vec_full_reg_offset(s, a->rm), @@ -4001,7 +4001,7 @@ static bool trans_FCMLA_zpzzz(DisasContext *s, arg_FCMLA_zpzzz *a) } if (sve_access_check(s)) { unsigned vsz = vec_full_reg_size(s); - TCGv_ptr status = get_fpstatus_ptr(a->esz == MO_16); + TCGv_ptr status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); tcg_gen_gvec_5_ptr(vec_full_reg_offset(s, a->rd), vec_full_reg_offset(s, a->rn), vec_full_reg_offset(s, a->rm), @@ -4024,7 +4024,7 @@ static bool trans_FCMLA_zzxz(DisasContext *s, arg_FCMLA_zzxz *a) tcg_debug_assert(a->rd == a->ra); if (sve_access_check(s)) { unsigned vsz = vec_full_reg_size(s); - TCGv_ptr status = get_fpstatus_ptr(a->esz == MO_16); + TCGv_ptr status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, a->rd), vec_full_reg_offset(s, a->rn), vec_full_reg_offset(s, a->rm), @@ -4045,7 +4045,7 @@ static bool do_zpz_ptr(DisasContext *s, int rd, int rn, int pg, { if (sve_access_check(s)) { unsigned vsz = vec_full_reg_size(s); - TCGv_ptr status = get_fpstatus_ptr(is_fp16); + TCGv_ptr status = fpstatus_ptr(is_fp16 ? FPST_FPCR_F16 : FPST_FPCR); tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, rd), vec_full_reg_offset(s, rn), pred_full_reg_offset(s, pg), @@ -4191,7 +4191,7 @@ static bool do_frint_mode(DisasContext *s, arg_rpr_esz *a, int mode) if (sve_access_check(s)) { unsigned vsz = vec_full_reg_size(s); TCGv_i32 tmode = tcg_const_i32(mode); - TCGv_ptr status = get_fpstatus_ptr(a->esz == MO_16); + TCGv_ptr status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); gen_helper_set_rmode(tmode, tmode, status); diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.c.inc index afa8a5f888..4eeafb494a 100644 --- a/target/arm/translate-vfp.inc.c +++ b/target/arm/translate-vfp.c.inc @@ -27,8 +27,8 @@ */ /* Include the generated VFP decoder */ -#include "decode-vfp.inc.c" -#include "decode-vfp-uncond.inc.c" +#include "decode-vfp.c.inc" +#include "decode-vfp-uncond.c.inc" /* * The imm8 encodes the sign bit, enough bits to represent an exponent in @@ -95,14 +95,11 @@ static inline long vfp_f16_offset(unsigned reg, bool top) static bool full_vfp_access_check(DisasContext *s, bool ignore_vfp_enabled) { if (s->fp_excp_el) { - if (arm_dc_feature(s, ARM_FEATURE_M)) { - gen_exception_insn(s, s->pc_curr, EXCP_NOCP, syn_uncategorized(), - s->fp_excp_el); - } else { - gen_exception_insn(s, s->pc_curr, EXCP_UDEF, - syn_fp_access_trap(1, 0xe, false), - s->fp_excp_el); - } + /* M-profile handled this earlier, in disas_m_nocp() */ + assert (!arm_dc_feature(s, ARM_FEATURE_M)); + gen_exception_insn(s, s->pc_curr, EXCP_UDEF, + syn_fp_access_trap(1, 0xe, false), + s->fp_excp_el); return false; } @@ -362,7 +359,7 @@ static bool trans_VRINT(DisasContext *s, arg_VRINT *a) return true; } - fpst = get_fpstatus_ptr(0); + fpst = fpstatus_ptr(FPST_FPCR); tcg_rmode = tcg_const_i32(arm_rmode_to_sf(rounding)); gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); @@ -425,7 +422,7 @@ static bool trans_VCVT(DisasContext *s, arg_VCVT *a) return true; } - fpst = get_fpstatus_ptr(0); + fpst = fpstatus_ptr(FPST_FPCR); tcg_shift = tcg_const_i32(0); @@ -1234,7 +1231,7 @@ static bool do_vfp_3op_sp(DisasContext *s, VFPGen3OpSPFn *fn, f0 = tcg_temp_new_i32(); f1 = tcg_temp_new_i32(); fd = tcg_temp_new_i32(); - fpst = get_fpstatus_ptr(0); + fpst = fpstatus_ptr(FPST_FPCR); neon_load_reg32(f0, vn); neon_load_reg32(f1, vm); @@ -1317,7 +1314,7 @@ static bool do_vfp_3op_dp(DisasContext *s, VFPGen3OpDPFn *fn, f0 = tcg_temp_new_i64(); f1 = tcg_temp_new_i64(); fd = tcg_temp_new_i64(); - fpst = get_fpstatus_ptr(0); + fpst = fpstatus_ptr(FPST_FPCR); neon_load_reg64(f0, vn); neon_load_reg64(f1, vm); @@ -1799,7 +1796,7 @@ static bool do_vfm_sp(DisasContext *s, arg_VFMA_sp *a, bool neg_n, bool neg_d) /* VFNMA, VFNMS */ gen_helper_vfp_negs(vd, vd); } - fpst = get_fpstatus_ptr(0); + fpst = fpstatus_ptr(FPST_FPCR); gen_helper_vfp_muladds(vd, vn, vm, vd, fpst); neon_store_reg32(vd, a->vd); @@ -1890,7 +1887,7 @@ static bool do_vfm_dp(DisasContext *s, arg_VFMA_dp *a, bool neg_n, bool neg_d) /* VFNMA, VFNMS */ gen_helper_vfp_negd(vd, vd); } - fpst = get_fpstatus_ptr(0); + fpst = fpstatus_ptr(FPST_FPCR); gen_helper_vfp_muladdd(vd, vn, vm, vd, fpst); neon_store_reg64(vd, a->vd); @@ -2174,7 +2171,7 @@ static bool trans_VCVT_f32_f16(DisasContext *s, arg_VCVT_f32_f16 *a) return true; } - fpst = get_fpstatus_ptr(false); + fpst = fpstatus_ptr(FPST_FPCR); ahp_mode = get_ahp_flag(); tmp = tcg_temp_new_i32(); /* The T bit tells us if we want the low or high 16 bits of Vm */ @@ -2211,7 +2208,7 @@ static bool trans_VCVT_f64_f16(DisasContext *s, arg_VCVT_f64_f16 *a) return true; } - fpst = get_fpstatus_ptr(false); + fpst = fpstatus_ptr(FPST_FPCR); ahp_mode = get_ahp_flag(); tmp = tcg_temp_new_i32(); /* The T bit tells us if we want the low or high 16 bits of Vm */ @@ -2240,7 +2237,7 @@ static bool trans_VCVT_f16_f32(DisasContext *s, arg_VCVT_f16_f32 *a) return true; } - fpst = get_fpstatus_ptr(false); + fpst = fpstatus_ptr(FPST_FPCR); ahp_mode = get_ahp_flag(); tmp = tcg_temp_new_i32(); @@ -2277,7 +2274,7 @@ static bool trans_VCVT_f16_f64(DisasContext *s, arg_VCVT_f16_f64 *a) return true; } - fpst = get_fpstatus_ptr(false); + fpst = fpstatus_ptr(FPST_FPCR); ahp_mode = get_ahp_flag(); tmp = tcg_temp_new_i32(); vm = tcg_temp_new_i64(); @@ -2307,7 +2304,7 @@ static bool trans_VRINTR_sp(DisasContext *s, arg_VRINTR_sp *a) tmp = tcg_temp_new_i32(); neon_load_reg32(tmp, a->vm); - fpst = get_fpstatus_ptr(false); + fpst = fpstatus_ptr(FPST_FPCR); gen_helper_rints(tmp, tmp, fpst); neon_store_reg32(tmp, a->vd); tcg_temp_free_ptr(fpst); @@ -2339,7 +2336,7 @@ static bool trans_VRINTR_dp(DisasContext *s, arg_VRINTR_dp *a) tmp = tcg_temp_new_i64(); neon_load_reg64(tmp, a->vm); - fpst = get_fpstatus_ptr(false); + fpst = fpstatus_ptr(FPST_FPCR); gen_helper_rintd(tmp, tmp, fpst); neon_store_reg64(tmp, a->vd); tcg_temp_free_ptr(fpst); @@ -2363,7 +2360,7 @@ static bool trans_VRINTZ_sp(DisasContext *s, arg_VRINTZ_sp *a) tmp = tcg_temp_new_i32(); neon_load_reg32(tmp, a->vm); - fpst = get_fpstatus_ptr(false); + fpst = fpstatus_ptr(FPST_FPCR); tcg_rmode = tcg_const_i32(float_round_to_zero); gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); gen_helper_rints(tmp, tmp, fpst); @@ -2400,7 +2397,7 @@ static bool trans_VRINTZ_dp(DisasContext *s, arg_VRINTZ_dp *a) tmp = tcg_temp_new_i64(); neon_load_reg64(tmp, a->vm); - fpst = get_fpstatus_ptr(false); + fpst = fpstatus_ptr(FPST_FPCR); tcg_rmode = tcg_const_i32(float_round_to_zero); gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); gen_helper_rintd(tmp, tmp, fpst); @@ -2427,7 +2424,7 @@ static bool trans_VRINTX_sp(DisasContext *s, arg_VRINTX_sp *a) tmp = tcg_temp_new_i32(); neon_load_reg32(tmp, a->vm); - fpst = get_fpstatus_ptr(false); + fpst = fpstatus_ptr(FPST_FPCR); gen_helper_rints_exact(tmp, tmp, fpst); neon_store_reg32(tmp, a->vd); tcg_temp_free_ptr(fpst); @@ -2459,7 +2456,7 @@ static bool trans_VRINTX_dp(DisasContext *s, arg_VRINTX_dp *a) tmp = tcg_temp_new_i64(); neon_load_reg64(tmp, a->vm); - fpst = get_fpstatus_ptr(false); + fpst = fpstatus_ptr(FPST_FPCR); gen_helper_rintd_exact(tmp, tmp, fpst); neon_store_reg64(tmp, a->vd); tcg_temp_free_ptr(fpst); @@ -2538,7 +2535,7 @@ static bool trans_VCVT_int_sp(DisasContext *s, arg_VCVT_int_sp *a) vm = tcg_temp_new_i32(); neon_load_reg32(vm, a->vm); - fpst = get_fpstatus_ptr(false); + fpst = fpstatus_ptr(FPST_FPCR); if (a->s) { /* i32 -> f32 */ gen_helper_vfp_sitos(vm, vm, fpst); @@ -2574,7 +2571,7 @@ static bool trans_VCVT_int_dp(DisasContext *s, arg_VCVT_int_dp *a) vm = tcg_temp_new_i32(); vd = tcg_temp_new_i64(); neon_load_reg32(vm, a->vm); - fpst = get_fpstatus_ptr(false); + fpst = fpstatus_ptr(FPST_FPCR); if (a->s) { /* i32 -> f64 */ gen_helper_vfp_sitod(vd, vm, fpst); @@ -2640,7 +2637,7 @@ static bool trans_VCVT_fix_sp(DisasContext *s, arg_VCVT_fix_sp *a) vd = tcg_temp_new_i32(); neon_load_reg32(vd, a->vd); - fpst = get_fpstatus_ptr(false); + fpst = fpstatus_ptr(FPST_FPCR); shift = tcg_const_i32(frac_bits); /* Switch on op:U:sx bits */ @@ -2705,7 +2702,7 @@ static bool trans_VCVT_fix_dp(DisasContext *s, arg_VCVT_fix_dp *a) vd = tcg_temp_new_i64(); neon_load_reg64(vd, a->vd); - fpst = get_fpstatus_ptr(false); + fpst = fpstatus_ptr(FPST_FPCR); shift = tcg_const_i32(frac_bits); /* Switch on op:U:sx bits */ @@ -2758,7 +2755,7 @@ static bool trans_VCVT_sp_int(DisasContext *s, arg_VCVT_sp_int *a) return true; } - fpst = get_fpstatus_ptr(false); + fpst = fpstatus_ptr(FPST_FPCR); vm = tcg_temp_new_i32(); neon_load_reg32(vm, a->vm); @@ -2800,7 +2797,7 @@ static bool trans_VCVT_dp_int(DisasContext *s, arg_VCVT_dp_int *a) return true; } - fpst = get_fpstatus_ptr(false); + fpst = fpstatus_ptr(FPST_FPCR); vm = tcg_temp_new_i64(); vd = tcg_temp_new_i32(); neon_load_reg64(vm, a->vm); @@ -2842,9 +2839,14 @@ static bool trans_VLLDM_VLSTM(DisasContext *s, arg_VLLDM_VLSTM *a) !arm_dc_feature(s, ARM_FEATURE_V8)) { return false; } - /* If not secure, UNDEF. */ + /* + * If not secure, UNDEF. We must emit code for this + * rather than returning false so that this takes + * precedence over the m-nocp.decode NOCP fallback. + */ if (!s->v8m_secure) { - return false; + unallocated_encoding(s); + return true; } /* If no fpu, NOP. */ if (!dc_isar_feature(aa32_vfp, s)) { @@ -2863,3 +2865,33 @@ static bool trans_VLLDM_VLSTM(DisasContext *s, arg_VLLDM_VLSTM *a) s->base.is_jmp = DISAS_UPDATE_EXIT; return true; } + +static bool trans_NOCP(DisasContext *s, arg_NOCP *a) +{ + /* + * Handle M-profile early check for disabled coprocessor: + * all we need to do here is emit the NOCP exception if + * the coprocessor is disabled. Otherwise we return false + * and the real VFP/etc decode will handle the insn. + */ + assert(arm_dc_feature(s, ARM_FEATURE_M)); + + if (a->cp == 11) { + a->cp = 10; + } + /* TODO: in v8.1M cp 8, 9, 14, 15 also are governed by the cp10 enable */ + + if (a->cp != 10) { + gen_exception_insn(s, s->pc_curr, EXCP_NOCP, + syn_uncategorized(), default_exception_el(s)); + return true; + } + + if (s->fp_excp_el != 0) { + gen_exception_insn(s, s->pc_curr, EXCP_NOCP, + syn_uncategorized(), s->fp_excp_el); + return true; + } + + return false; +} diff --git a/target/arm/translate.c b/target/arm/translate.c index c39a929b93..d34c1d351a 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -49,8 +49,6 @@ #define ENABLE_ARCH_7 arm_dc_feature(s, ARM_FEATURE_V7) #define ENABLE_ARCH_8 arm_dc_feature(s, ARM_FEATURE_V8) -#define ARCH(x) do { if (!ENABLE_ARCH_##x) goto illegal_op; } while(0) - #include "translate.h" #if defined(CONFIG_USER_ONLY) @@ -59,8 +57,9 @@ #define IS_USER(s) (s->user) #endif -/* We reuse the same 64-bit temporaries for efficiency. */ +/* These are TCG temporaries used only by the legacy iwMMXt decoder */ static TCGv_i64 cpu_V0, cpu_V1, cpu_M0; +/* These are TCG globals which alias CPUARMState fields */ static TCGv_i32 cpu_R[16]; TCGv_i32 cpu_CF, cpu_NF, cpu_VF, cpu_ZF; TCGv_i64 cpu_exclusive_addr; @@ -1095,19 +1094,6 @@ static inline void gen_hlt(DisasContext *s, int imm) unallocated_encoding(s); } -static TCGv_ptr get_fpstatus_ptr(int neon) -{ - TCGv_ptr statusptr = tcg_temp_new_ptr(); - int offset; - if (neon) { - offset = offsetof(CPUARMState, vfp.standard_fp_status); - } else { - offset = offsetof(CPUARMState, vfp.fp_status); - } - tcg_gen_addi_ptr(statusptr, cpu_env, offset); - return statusptr; -} - static inline long vfp_reg_offset(bool dp, unsigned reg) { if (dp) { @@ -1176,8 +1162,9 @@ static TCGv_ptr vfp_reg_ptr(bool dp, int reg) #define ARM_CP_RW_BIT (1 << 20) /* Include the VFP and Neon decoders */ -#include "translate-vfp.inc.c" -#include "translate-neon.inc.c" +#include "decode-m-nocp.c.inc" +#include "translate-vfp.c.inc" +#include "translate-neon.c.inc" static inline void iwmmxt_load_reg(TCGv_i64 var, int reg) { @@ -2471,21 +2458,6 @@ static int disas_dsp_insn(DisasContext *s, uint32_t insn) return 1; } -#define VFP_REG_SHR(x, n) (((n) > 0) ? (x) >> (n) : (x) << -(n)) -#define VFP_DREG(reg, insn, bigbit, smallbit) do { \ - if (dc_isar_feature(aa32_simd_r32, s)) { \ - reg = (((insn) >> (bigbit)) & 0x0f) \ - | (((insn) >> ((smallbit) - 4)) & 0x10); \ - } else { \ - if (insn & (1 << (smallbit))) \ - return 1; \ - reg = ((insn) >> (bigbit)) & 0x0f; \ - }} while (0) - -#define VFP_DREG_D(reg, insn) VFP_DREG(reg, insn, 12, 22) -#define VFP_DREG_N(reg, insn) VFP_DREG(reg, insn, 16, 7) -#define VFP_DREG_M(reg, insn) VFP_DREG(reg, insn, 0, 5) - static inline bool use_goto_tb(DisasContext *s, target_ulong dest) { #ifndef CONFIG_USER_ONLY @@ -4544,48 +4516,12 @@ void gen_gvec_uaba(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, tcg_gen_gvec_3(rd_ofs, rn_ofs, rm_ofs, opr_sz, max_sz, &ops[vece]); } -static int disas_coproc_insn(DisasContext *s, uint32_t insn) +static void do_coproc_insn(DisasContext *s, int cpnum, int is64, + int opc1, int crn, int crm, int opc2, + bool isread, int rt, int rt2) { - int cpnum, is64, crn, crm, opc1, opc2, isread, rt, rt2; const ARMCPRegInfo *ri; - cpnum = (insn >> 8) & 0xf; - - /* First check for coprocessor space used for XScale/iwMMXt insns */ - if (arm_dc_feature(s, ARM_FEATURE_XSCALE) && (cpnum < 2)) { - if (extract32(s->c15_cpar, cpnum, 1) == 0) { - return 1; - } - if (arm_dc_feature(s, ARM_FEATURE_IWMMXT)) { - return disas_iwmmxt_insn(s, insn); - } else if (arm_dc_feature(s, ARM_FEATURE_XSCALE)) { - return disas_dsp_insn(s, insn); - } - return 1; - } - - /* Otherwise treat as a generic register access */ - is64 = (insn & (1 << 25)) == 0; - if (!is64 && ((insn & (1 << 4)) == 0)) { - /* cdp */ - return 1; - } - - crm = insn & 0xf; - if (is64) { - crn = 0; - opc1 = (insn >> 4) & 0xf; - opc2 = 0; - rt2 = (insn >> 16) & 0xf; - } else { - crn = (insn >> 16) & 0xf; - opc1 = (insn >> 21) & 7; - opc2 = (insn >> 5) & 7; - rt2 = 0; - } - isread = (insn >> 20) & 1; - rt = (insn >> 12) & 0xf; - ri = get_arm_cp_reginfo(s->cp_regs, ENCODE_CP_REG(cpnum, is64, s->ns, crn, crm, opc1, opc2)); if (ri) { @@ -4593,7 +4529,8 @@ static int disas_coproc_insn(DisasContext *s, uint32_t insn) /* Check access permissions */ if (!cp_access_ok(s->current_el, ri, isread)) { - return 1; + unallocated_encoding(s); + return; } if (s->hstr_active || ri->accessfn || @@ -4667,14 +4604,15 @@ static int disas_coproc_insn(DisasContext *s, uint32_t insn) /* Handle special cases first */ switch (ri->type & ~(ARM_CP_FLAG_MASK & ~ARM_CP_SPECIAL)) { case ARM_CP_NOP: - return 0; + return; case ARM_CP_WFI: if (isread) { - return 1; + unallocated_encoding(s); + return; } gen_set_pc_im(s, s->base.pc_next); s->base.is_jmp = DISAS_WFI; - return 0; + return; default: break; } @@ -4734,7 +4672,7 @@ static int disas_coproc_insn(DisasContext *s, uint32_t insn) /* Write */ if (ri->type & ARM_CP_CONST) { /* If not forbidden by access permissions, treat as WI */ - return 0; + return; } if (is64) { @@ -4800,7 +4738,7 @@ static int disas_coproc_insn(DisasContext *s, uint32_t insn) gen_lookup_tb(s); } - return 0; + return; } /* Unknown register; this might be a guest error or a QEMU @@ -4820,9 +4758,27 @@ static int disas_coproc_insn(DisasContext *s, uint32_t insn) s->ns ? "non-secure" : "secure"); } - return 1; + unallocated_encoding(s); + return; } +/* Decode XScale DSP or iWMMXt insn (in the copro space, cp=0 or 1) */ +static void disas_xscale_insn(DisasContext *s, uint32_t insn) +{ + int cpnum = (insn >> 8) & 0xf; + + if (extract32(s->c15_cpar, cpnum, 1) == 0) { + unallocated_encoding(s); + } else if (arm_dc_feature(s, ARM_FEATURE_IWMMXT)) { + if (disas_iwmmxt_insn(s, insn)) { + unallocated_encoding(s); + } + } else if (arm_dc_feature(s, ARM_FEATURE_XSCALE)) { + if (disas_dsp_insn(s, insn)) { + unallocated_encoding(s); + } + } +} /* Store a 64-bit value to a register pair. Clobbers val. */ static void gen_storeq_reg(DisasContext *s, int rlow, int rhigh, TCGv_i64 val) @@ -5217,10 +5173,72 @@ static int t16_pop_list(DisasContext *s, int x) * Include the generated decoders. */ -#include "decode-a32.inc.c" -#include "decode-a32-uncond.inc.c" -#include "decode-t32.inc.c" -#include "decode-t16.inc.c" +#include "decode-a32.c.inc" +#include "decode-a32-uncond.c.inc" +#include "decode-t32.c.inc" +#include "decode-t16.c.inc" + +static bool valid_cp(DisasContext *s, int cp) +{ + /* + * Return true if this coprocessor field indicates something + * that's really a possible coprocessor. + * For v7 and earlier, coprocessors 8..15 were reserved for Arm use, + * and of those only cp14 and cp15 were used for registers. + * cp10 and cp11 were used for VFP and Neon, whose decode is + * dealt with elsewhere. With the advent of fp16, cp9 is also + * now part of VFP. + * For v8A and later, the encoding has been tightened so that + * only cp14 and cp15 are valid, and other values aren't considered + * to be in the coprocessor-instruction space at all. v8M still + * permits coprocessors 0..7. + */ + if (arm_dc_feature(s, ARM_FEATURE_V8) && + !arm_dc_feature(s, ARM_FEATURE_M)) { + return cp >= 14; + } + return cp < 8 || cp >= 14; +} + +static bool trans_MCR(DisasContext *s, arg_MCR *a) +{ + if (!valid_cp(s, a->cp)) { + return false; + } + do_coproc_insn(s, a->cp, false, a->opc1, a->crn, a->crm, a->opc2, + false, a->rt, 0); + return true; +} + +static bool trans_MRC(DisasContext *s, arg_MRC *a) +{ + if (!valid_cp(s, a->cp)) { + return false; + } + do_coproc_insn(s, a->cp, false, a->opc1, a->crn, a->crm, a->opc2, + true, a->rt, 0); + return true; +} + +static bool trans_MCRR(DisasContext *s, arg_MCRR *a) +{ + if (!valid_cp(s, a->cp)) { + return false; + } + do_coproc_insn(s, a->cp, true, a->opc1, 0, a->crm, 0, + false, a->rt, a->rt2); + return true; +} + +static bool trans_MRRC(DisasContext *s, arg_MRRC *a) +{ + if (!valid_cp(s, a->cp)) { + return false; + } + do_coproc_insn(s, a->cp, true, a->opc1, 0, a->crm, 0, + true, a->rt, a->rt2); + return true; +} /* Helpers to swap operands for reverse-subtract. */ static void gen_rsb(TCGv_i32 dst, TCGv_i32 a, TCGv_i32 b) @@ -7862,7 +7880,7 @@ static bool trans_BLX_i(DisasContext *s, arg_BLX_i *a) { TCGv_i32 tmp; - /* For A32, ARCH(5) is checked near the start of the uncond block. */ + /* For A32, ARM_FEATURE_V5 is checked near the start of the uncond block. */ if (s->thumb && (a->imm & 2)) { return false; } @@ -8228,7 +8246,10 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn) * choose to UNDEF. In ARMv5 and above the space is used * for miscellaneous unconditional instructions. */ - ARCH(5); + if (!arm_dc_feature(s, ARM_FEATURE_V5)) { + unallocated_encoding(s); + return; + } /* Unconditional instructions. */ /* TODO: Perhaps merge these into one decodetree output file. */ @@ -8265,25 +8286,18 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn) return; } /* fall back to legacy decoder */ - - switch ((insn >> 24) & 0xf) { - case 0xc: - case 0xd: - case 0xe: - if (((insn >> 8) & 0xe) == 10) { - /* VFP, but failed disas_vfp. */ - goto illegal_op; - } - if (disas_coproc_insn(s, insn)) { - /* Coprocessor. */ - goto illegal_op; + /* TODO: convert xscale/iwmmxt decoder to decodetree ?? */ + if (arm_dc_feature(s, ARM_FEATURE_XSCALE)) { + if (((insn & 0x0c000e00) == 0x0c000000) + && ((insn & 0x03000000) != 0x03000000)) { + /* Coprocessor insn, coprocessor 0 or 1 */ + disas_xscale_insn(s, insn); + return; } - break; - default: - illegal_op: - unallocated_encoding(s); - break; } + +illegal_op: + unallocated_encoding(s); } static bool thumb_insn_is_16bit(DisasContext *s, uint32_t pc, uint32_t insn) @@ -8360,7 +8374,23 @@ static void disas_thumb2_insn(DisasContext *s, uint32_t insn) goto illegal_op; } } else if ((insn & 0xf800e800) != 0xf000e800) { - ARCH(6T2); + if (!arm_dc_feature(s, ARM_FEATURE_THUMB2)) { + unallocated_encoding(s); + return; + } + } + + if (arm_dc_feature(s, ARM_FEATURE_M)) { + /* + * NOCP takes precedence over any UNDEF for (almost) the + * entire wide range of coprocessor-space encodings, so check + * for it first before proceeding to actually decode eg VFP + * insns. This decode also handles the few insns which are + * in copro space but do not have NOCP checks (eg VLLDM, VLSTM). + */ + if (disas_m_nocp(s, insn)) { + return; + } } if ((insn & 0xef000000) == 0xef000000) { @@ -8401,52 +8431,9 @@ static void disas_thumb2_insn(DisasContext *s, uint32_t insn) ((insn >> 28) == 0xe && disas_vfp(s, insn))) { return; } - /* fall back to legacy decoder */ - switch ((insn >> 25) & 0xf) { - case 0: case 1: case 2: case 3: - /* 16-bit instructions. Should never happen. */ - abort(); - case 6: case 7: case 14: case 15: - /* Coprocessor. */ - if (arm_dc_feature(s, ARM_FEATURE_M)) { - /* 0b111x_11xx_xxxx_xxxx_xxxx_xxxx_xxxx_xxxx */ - if (extract32(insn, 24, 2) == 3) { - goto illegal_op; /* op0 = 0b11 : unallocated */ - } - - if (((insn >> 8) & 0xe) == 10 && - dc_isar_feature(aa32_fpsp_v2, s)) { - /* FP, and the CPU supports it */ - goto illegal_op; - } else { - /* All other insns: NOCP */ - gen_exception_insn(s, s->pc_curr, EXCP_NOCP, - syn_uncategorized(), - default_exception_el(s)); - } - break; - } - if (((insn >> 24) & 3) == 3) { - /* Neon DP, but failed disas_neon_dp() */ - goto illegal_op; - } else if (((insn >> 8) & 0xe) == 10) { - /* VFP, but failed disas_vfp. */ - goto illegal_op; - } else { - if (insn & (1 << 28)) - goto illegal_op; - if (disas_coproc_insn(s, insn)) { - goto illegal_op; - } - } - break; - case 12: - goto illegal_op; - default: - illegal_op: - unallocated_encoding(s); - } +illegal_op: + unallocated_encoding(s); } static void disas_thumb_insn(DisasContext *s, uint32_t insn) @@ -8567,7 +8554,6 @@ static void arm_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) cpu_V0 = tcg_temp_new_i64(); cpu_V1 = tcg_temp_new_i64(); - /* FIXME: cpu_M0 can probably be the same as cpu_V0. */ cpu_M0 = tcg_temp_new_i64(); } diff --git a/target/arm/translate.h b/target/arm/translate.h index 16f2699ad7..6d6d4c0f42 100644 --- a/target/arm/translate.h +++ b/target/arm/translate.h @@ -393,4 +393,56 @@ typedef void CryptoThreeOpIntFn(TCGv_ptr, TCGv_ptr, TCGv_i32); typedef void CryptoThreeOpFn(TCGv_ptr, TCGv_ptr, TCGv_ptr); typedef void AtomicThreeOpFn(TCGv_i64, TCGv_i64, TCGv_i64, TCGArg, MemOp); +/* + * Enum for argument to fpstatus_ptr(). + */ +typedef enum ARMFPStatusFlavour { + FPST_FPCR, + FPST_FPCR_F16, + FPST_STD, + FPST_STD_F16, +} ARMFPStatusFlavour; + +/** + * fpstatus_ptr: return TCGv_ptr to the specified fp_status field + * + * We have multiple softfloat float_status fields in the Arm CPU state struct + * (see the comment in cpu.h for details). Return a TCGv_ptr which has + * been set up to point to the requested field in the CPU state struct. + * The options are: + * + * FPST_FPCR + * for non-FP16 operations controlled by the FPCR + * FPST_FPCR_F16 + * for operations controlled by the FPCR where FPCR.FZ16 is to be used + * FPST_STD + * for A32/T32 Neon operations using the "standard FPSCR value" + * FPST_STD_F16 + * as FPST_STD, but where FPCR.FZ16 is to be used + */ +static inline TCGv_ptr fpstatus_ptr(ARMFPStatusFlavour flavour) +{ + TCGv_ptr statusptr = tcg_temp_new_ptr(); + int offset; + + switch (flavour) { + case FPST_FPCR: + offset = offsetof(CPUARMState, vfp.fp_status); + break; + case FPST_FPCR_F16: + offset = offsetof(CPUARMState, vfp.fp_status_f16); + break; + case FPST_STD: + offset = offsetof(CPUARMState, vfp.standard_fp_status); + break; + case FPST_STD_F16: + offset = offsetof(CPUARMState, vfp.standard_fp_status_f16); + break; + default: + g_assert_not_reached(); + } + tcg_gen_addi_ptr(statusptr, cpu_env, offset); + return statusptr; +} + #endif /* TARGET_ARM_TRANSLATE_H */ diff --git a/target/arm/vfp.decode b/target/arm/vfp.decode index 5fd70f975a..2c793e3e87 100644 --- a/target/arm/vfp.decode +++ b/target/arm/vfp.decode @@ -213,5 +213,3 @@ VCVT_sp_int ---- 1110 1.11 110 s:1 .... 1010 rz:1 1.0 .... \ vd=%vd_sp vm=%vm_sp VCVT_dp_int ---- 1110 1.11 110 s:1 .... 1011 rz:1 1.0 .... \ vd=%vd_sp vm=%vm_dp - -VLLDM_VLSTM 1110 1100 001 l:1 rn:4 0000 1010 0000 0000 diff --git a/target/arm/vfp_helper.c b/target/arm/vfp_helper.c index 60dcd4bf14..64266ece62 100644 --- a/target/arm/vfp_helper.c +++ b/target/arm/vfp_helper.c @@ -93,6 +93,8 @@ static uint32_t vfp_get_fpscr_from_host(CPUARMState *env) /* FZ16 does not generate an input denormal exception. */ i |= (get_float_exception_flags(&env->vfp.fp_status_f16) & ~float_flag_input_denormal); + i |= (get_float_exception_flags(&env->vfp.standard_fp_status_f16) + & ~float_flag_input_denormal); return vfp_exceptbits_from_host(i); } @@ -124,7 +126,9 @@ static void vfp_set_fpscr_to_host(CPUARMState *env, uint32_t val) if (changed & FPCR_FZ16) { bool ftz_enabled = val & FPCR_FZ16; set_flush_to_zero(ftz_enabled, &env->vfp.fp_status_f16); + set_flush_to_zero(ftz_enabled, &env->vfp.standard_fp_status_f16); set_flush_inputs_to_zero(ftz_enabled, &env->vfp.fp_status_f16); + set_flush_inputs_to_zero(ftz_enabled, &env->vfp.standard_fp_status_f16); } if (changed & FPCR_FZ) { bool ftz_enabled = val & FPCR_FZ; @@ -146,6 +150,7 @@ static void vfp_set_fpscr_to_host(CPUARMState *env, uint32_t val) set_float_exception_flags(i, &env->vfp.fp_status); set_float_exception_flags(0, &env->vfp.fp_status_f16); set_float_exception_flags(0, &env->vfp.standard_fp_status); + set_float_exception_flags(0, &env->vfp.standard_fp_status_f16); } #else diff --git a/target/avr/Makefile.objs b/target/avr/Makefile.objs deleted file mode 100644 index 6e35ba2c5c..0000000000 --- a/target/avr/Makefile.objs +++ /dev/null @@ -1,34 +0,0 @@ -# -# QEMU AVR -# -# Copyright (c) 2016-2020 Michael Rolnik -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, see -# <http://www.gnu.org/licenses/lgpl-2.1.html> -# - -DECODETREE = $(SRC_PATH)/scripts/decodetree.py -decode-y = $(SRC_PATH)/target/avr/insn.decode - -target/avr/decode_insn.inc.c: $(decode-y) $(DECODETREE) - $(call quiet-command, \ - $(PYTHON) $(DECODETREE) -o $@ --decode decode_insn --insnwidth 16 $<, \ - "GEN", $(TARGET_DIR)$@) - -target/avr/translate.o: target/avr/decode_insn.inc.c - -obj-y += translate.o cpu.o helper.o -obj-y += gdbstub.o -obj-y += disas.o -obj-$(CONFIG_SOFTMMU) += machine.o diff --git a/target/avr/disas.c b/target/avr/disas.c index 8e1bac4d76..b7689e8d7c 100644 --- a/target/avr/disas.c +++ b/target/avr/disas.c @@ -60,7 +60,7 @@ static int append_16(DisasContext *ctx, int x) /* Include the auto-generated decoder. */ static bool decode_insn(DisasContext *ctx, uint16_t insn); -#include "decode_insn.inc.c" +#include "decode-insn.c.inc" #define output(mnemonic, format, ...) \ (pctx->info->fprintf_func(pctx->info->stream, "%-9s " format, \ diff --git a/target/avr/meson.build b/target/avr/meson.build new file mode 100644 index 0000000000..7e8e29c59d --- /dev/null +++ b/target/avr/meson.build @@ -0,0 +1,20 @@ +gen = [ + decodetree.process('insn.decode', extra_args: [ '--decode', 'decode_insn', + '--insnwidth', '16' ]) +] + +avr_ss = ss.source_set() +avr_softmmu_ss = ss.source_set() + +avr_ss.add(gen) +avr_ss.add(files( + 'translate.c', + 'helper.c', + 'cpu.c', + 'gdbstub.c', + 'disas.c')) + +avr_softmmu_ss.add(files('machine.c')) + +target_arch += {'avr': avr_ss} +target_softmmu_arch += {'avr': avr_softmmu_ss} diff --git a/target/avr/translate.c b/target/avr/translate.c index 648dcd5c3e..850c5941d9 100644 --- a/target/avr/translate.c +++ b/target/avr/translate.c @@ -198,7 +198,7 @@ static bool avr_have_feature(DisasContext *ctx, int feature) } static bool decode_insn(DisasContext *ctx, uint16_t insn); -#include "decode_insn.inc.c" +#include "decode-insn.c.inc" /* * Arithmetic Instructions diff --git a/target/cris/Makefile.objs b/target/cris/Makefile.objs deleted file mode 100644 index 7779227fc4..0000000000 --- a/target/cris/Makefile.objs +++ /dev/null @@ -1,3 +0,0 @@ -obj-y += translate.o op_helper.o helper.o cpu.o -obj-y += gdbstub.o -obj-$(CONFIG_SOFTMMU) += mmu.o machine.o diff --git a/target/cris/meson.build b/target/cris/meson.build new file mode 100644 index 0000000000..67c3793c85 --- /dev/null +++ b/target/cris/meson.build @@ -0,0 +1,14 @@ +cris_ss = ss.source_set() +cris_ss.add(files( + 'cpu.c', + 'gdbstub.c', + 'helper.c', + 'op_helper.c', + 'translate.c', +)) + +cris_softmmu_ss = ss.source_set() +cris_softmmu_ss.add(files('mmu.c', 'machine.c')) + +target_arch += {'cris': cris_ss} +target_softmmu_arch += {'cris': cris_softmmu_ss} diff --git a/target/cris/translate.c b/target/cris/translate.c index aaa46b5bca..ee5e359c77 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -3037,7 +3037,7 @@ static unsigned int crisv32_decoder(CPUCRISState *env, DisasContext *dc) return insn_len; } -#include "translate_v10.inc.c" +#include "translate_v10.c.inc" /* * Delay slots on QEMU/CRIS. diff --git a/target/cris/translate_v10.inc.c b/target/cris/translate_v10.c.inc index ae34a0d1a3..ae34a0d1a3 100644 --- a/target/cris/translate_v10.inc.c +++ b/target/cris/translate_v10.c.inc diff --git a/target/hppa/Makefile.objs b/target/hppa/Makefile.objs deleted file mode 100644 index 174f50a96c..0000000000 --- a/target/hppa/Makefile.objs +++ /dev/null @@ -1,11 +0,0 @@ -obj-y += translate.o helper.o cpu.o op_helper.o gdbstub.o mem_helper.o -obj-y += int_helper.o -obj-$(CONFIG_SOFTMMU) += machine.o - -DECODETREE = $(SRC_PATH)/scripts/decodetree.py - -target/hppa/decode.inc.c: $(SRC_PATH)/target/hppa/insns.decode $(DECODETREE) - $(call quiet-command,\ - $(PYTHON) $(DECODETREE) -o $@ $<, "GEN", $(TARGET_DIR)$@) - -target/hppa/translate.o: target/hppa/decode.inc.c diff --git a/target/hppa/meson.build b/target/hppa/meson.build new file mode 100644 index 0000000000..8a7ff82efc --- /dev/null +++ b/target/hppa/meson.build @@ -0,0 +1,19 @@ +gen = decodetree.process('insns.decode') + +hppa_ss = ss.source_set() +hppa_ss.add(gen) +hppa_ss.add(files( + 'cpu.c', + 'gdbstub.c', + 'helper.c', + 'int_helper.c', + 'mem_helper.c', + 'op_helper.c', + 'translate.c', +)) + +hppa_softmmu_ss = ss.source_set() +hppa_softmmu_ss.add(files('machine.c')) + +target_arch += {'hppa': hppa_ss} +target_softmmu_arch += {'hppa': hppa_softmmu_ss} diff --git a/target/hppa/trace.h b/target/hppa/trace.h new file mode 100644 index 0000000000..810cc09692 --- /dev/null +++ b/target/hppa/trace.h @@ -0,0 +1 @@ +#include "trace/trace-target_hppa.h" diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 4bd22d4820..f5765ef688 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -334,7 +334,7 @@ static int expand_shl11(DisasContext *ctx, int val) /* Include the auto-generated decoder. */ -#include "decode.inc.c" +#include "decode-insns.c.inc" /* We are not using a goto_tb (for whatever reason), but have updated the iaq (for whatever reason), so don't do it again on exit. */ diff --git a/target/i386/Makefile.objs b/target/i386/Makefile.objs deleted file mode 100644 index 0b93143e27..0000000000 --- a/target/i386/Makefile.objs +++ /dev/null @@ -1,23 +0,0 @@ -obj-y += helper.o cpu.o gdbstub.o xsave_helper.o -obj-$(CONFIG_TCG) += translate.o -obj-$(CONFIG_TCG) += bpt_helper.o cc_helper.o excp_helper.o fpu_helper.o -obj-$(CONFIG_TCG) += int_helper.o mem_helper.o misc_helper.o mpx_helper.o -obj-$(CONFIG_TCG) += seg_helper.o smm_helper.o svm_helper.o -obj-$(call lnot,$(CONFIG_TCG)) += tcg-stub.o -obj-$(call lnot,$(CONFIG_KVM)) += kvm-stub.o -ifeq ($(CONFIG_SOFTMMU),y) -obj-y += machine.o arch_memory_mapping.o arch_dump.o monitor.o -obj-$(CONFIG_KVM) += kvm.o -obj-$(CONFIG_HYPERV) += hyperv.o -obj-$(call lnot,$(CONFIG_HYPERV)) += hyperv-stub.o -ifeq ($(CONFIG_WIN32),y) -obj-$(CONFIG_HAX) += hax-all.o hax-mem.o hax-windows.o -endif -ifeq ($(CONFIG_POSIX),y) -obj-$(CONFIG_HAX) += hax-all.o hax-mem.o hax-posix.o -endif -obj-$(CONFIG_HVF) += hvf/ -obj-$(CONFIG_WHPX) += whpx-all.o -endif -obj-$(CONFIG_SEV) += sev.o -obj-$(call lnot,$(CONFIG_SEV)) += sev-stub.o diff --git a/target/i386/hvf/Makefile.objs b/target/i386/hvf/Makefile.objs deleted file mode 100644 index 927b86bc67..0000000000 --- a/target/i386/hvf/Makefile.objs +++ /dev/null @@ -1,2 +0,0 @@ -obj-y += hvf.o -obj-y += x86.o x86_cpuid.o x86_decode.o x86_descr.o x86_emu.o x86_flags.o x86_mmu.o x86hvf.o x86_task.o diff --git a/target/i386/hvf/meson.build b/target/i386/hvf/meson.build new file mode 100644 index 0000000000..c8a43717ee --- /dev/null +++ b/target/i386/hvf/meson.build @@ -0,0 +1,12 @@ +i386_softmmu_ss.add(when: [hvf, 'CONFIG_HVF'], if_true: files( + 'hvf.c', + 'x86.c', + 'x86_cpuid.c', + 'x86_decode.c', + 'x86_descr.c', + 'x86_emu.c', + 'x86_flags.c', + 'x86_mmu.c', + 'x86_task.c', + 'x86hvf.c', +)) diff --git a/target/i386/meson.build b/target/i386/meson.build new file mode 100644 index 0000000000..e0b71ade56 --- /dev/null +++ b/target/i386/meson.build @@ -0,0 +1,40 @@ +i386_ss = ss.source_set() +i386_ss.add(files( + 'cpu.c', + 'gdbstub.c', + 'helper.c', + 'xsave_helper.c', +)) +i386_ss.add(when: 'CONFIG_TCG', if_true: files( + 'bpt_helper.c', + 'cc_helper.c', + 'excp_helper.c', + 'fpu_helper.c', + 'int_helper.c', + 'mem_helper.c', + 'misc_helper.c', + 'mpx_helper.c', + 'seg_helper.c', + 'smm_helper.c', + 'svm_helper.c', + 'translate.c'), if_false: files('tcg-stub.c')) +i386_ss.add(when: 'CONFIG_KVM', if_false: files('kvm-stub.c')) +i386_ss.add(when: 'CONFIG_SEV', if_true: files('sev.c'), if_false: files('sev-stub.c')) + +i386_softmmu_ss = ss.source_set() +i386_softmmu_ss.add(files( + 'arch_dump.c', + 'arch_memory_mapping.c', + 'machine.c', + 'monitor.c', +)) +i386_softmmu_ss.add(when: 'CONFIG_HYPERV', if_true: files('hyperv.c'), if_false: files('hyperv-stub.c')) +i386_softmmu_ss.add(when: 'CONFIG_KVM', if_true: files('kvm.c')) +i386_softmmu_ss.add(when: 'CONFIG_WHPX', if_true: files('whpx-all.c')) +i386_softmmu_ss.add(when: ['CONFIG_POSIX', 'CONFIG_HAX'], if_true: files('hax-all.c', 'hax-mem.c', 'hax-posix.c')) +i386_softmmu_ss.add(when: ['CONFIG_WIN32', 'CONFIG_HAX'], if_true: files('hax-all.c', 'hax-mem.c', 'hax-windows.c')) + +subdir('hvf') + +target_arch += {'i386': i386_ss} +target_softmmu_arch += {'i386': i386_softmmu_ss} diff --git a/target/i386/trace.h b/target/i386/trace.h new file mode 100644 index 0000000000..781e8ec55c --- /dev/null +++ b/target/i386/trace.h @@ -0,0 +1 @@ +#include "trace/trace-target_i386.h" diff --git a/target/lm32/Makefile.objs b/target/lm32/Makefile.objs deleted file mode 100644 index c3e1bd6bd6..0000000000 --- a/target/lm32/Makefile.objs +++ /dev/null @@ -1,4 +0,0 @@ -obj-y += translate.o op_helper.o helper.o cpu.o -obj-y += gdbstub.o -obj-y += lm32-semi.o -obj-$(CONFIG_SOFTMMU) += machine.o diff --git a/target/lm32/meson.build b/target/lm32/meson.build new file mode 100644 index 0000000000..ef0eef07f1 --- /dev/null +++ b/target/lm32/meson.build @@ -0,0 +1,15 @@ +lm32_ss = ss.source_set() +lm32_ss.add(files( + 'cpu.c', + 'gdbstub.c', + 'helper.c', + 'lm32-semi.c', + 'op_helper.c', + 'translate.c', +)) + +lm32_softmmu_ss = ss.source_set() +lm32_softmmu_ss.add(files('machine.c')) + +target_arch += {'lm32': lm32_ss} +target_softmmu_arch += {'lm32': lm32_softmmu_ss} diff --git a/target/m68k/Makefile.objs b/target/m68k/Makefile.objs deleted file mode 100644 index ac61948676..0000000000 --- a/target/m68k/Makefile.objs +++ /dev/null @@ -1,5 +0,0 @@ -obj-y += m68k-semi.o -obj-y += translate.o op_helper.o helper.o cpu.o -obj-y += fpu_helper.o softfloat.o -obj-y += gdbstub.o -obj-$(CONFIG_SOFTMMU) += monitor.o diff --git a/target/m68k/meson.build b/target/m68k/meson.build new file mode 100644 index 0000000000..05cd9fbd1e --- /dev/null +++ b/target/m68k/meson.build @@ -0,0 +1,17 @@ +m68k_ss = ss.source_set() +m68k_ss.add(files( + 'cpu.c', + 'fpu_helper.c', + 'gdbstub.c', + 'helper.c', + 'm68k-semi.c', + 'op_helper.c', + 'softfloat.c', + 'translate.c', +)) + +m68k_softmmu_ss = ss.source_set() +m68k_softmmu_ss.add(files('monitor.c')) + +target_arch += {'m68k': m68k_ss} +target_softmmu_arch += {'m68k': m68k_softmmu_ss} diff --git a/target/meson.build b/target/meson.build new file mode 100644 index 0000000000..9f0ae93b75 --- /dev/null +++ b/target/meson.build @@ -0,0 +1,23 @@ +subdir('alpha') +subdir('arm') +subdir('avr') +subdir('cris') +subdir('hppa') +subdir('i386') +subdir('lm32') +subdir('m68k') +subdir('microblaze') +subdir('mips') +subdir('moxie') +subdir('nios2') +subdir('openrisc') +subdir('ppc') +subdir('riscv') +subdir('rx') +subdir('s390x') +subdir('sh4') +subdir('sparc') +subdir('tilegx') +subdir('tricore') +subdir('unicore32') +subdir('xtensa') diff --git a/target/microblaze/Makefile.objs b/target/microblaze/Makefile.objs deleted file mode 100644 index f3d7b44c89..0000000000 --- a/target/microblaze/Makefile.objs +++ /dev/null @@ -1,3 +0,0 @@ -obj-y += translate.o op_helper.o helper.o cpu.o -obj-y += gdbstub.o -obj-$(CONFIG_SOFTMMU) += mmu.o diff --git a/target/microblaze/meson.build b/target/microblaze/meson.build new file mode 100644 index 0000000000..b8fe4afe61 --- /dev/null +++ b/target/microblaze/meson.build @@ -0,0 +1,14 @@ +microblaze_ss = ss.source_set() +microblaze_ss.add(files( + 'cpu.c', + 'gdbstub.c', + 'helper.c', + 'op_helper.c', + 'translate.c', +)) + +microblaze_softmmu_ss = ss.source_set() +microblaze_softmmu_ss.add(files('mmu.c')) + +target_arch += {'microblaze': microblaze_ss} +target_softmmu_arch += {'microblaze': microblaze_softmmu_ss} diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index f6ff2591c3..a96cb21d96 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -1075,14 +1075,16 @@ static void dec_store(DisasContext *dc) swx_skip = gen_new_label(); tcg_gen_brcond_tl(TCG_COND_NE, env_res_addr, addr, swx_skip); - /* Compare the value loaded at lwx with current contents of - the reserved location. - FIXME: This only works for system emulation where we can expect - this compare and the following write to be atomic. For user - emulation we need to add atomicity between threads. */ + /* + * Compare the value loaded at lwx with current contents of + * the reserved location. + */ tval = tcg_temp_new_i32(); - tcg_gen_qemu_ld_i32(tval, addr, cpu_mmu_index(&dc->cpu->env, false), - MO_TEUL); + + tcg_gen_atomic_cmpxchg_i32(tval, addr, env_res_val, + cpu_R[dc->rd], mem_index, + mop); + tcg_gen_brcond_i32(TCG_COND_NE, env_res_val, tval, swx_skip); write_carryi(dc, 0); tcg_temp_free_i32(tval); @@ -1108,7 +1110,10 @@ static void dec_store(DisasContext *dc) break; } } - tcg_gen_qemu_st_i32(cpu_R[dc->rd], addr, mem_index, mop); + + if (!ex) { + tcg_gen_qemu_st_i32(cpu_R[dc->rd], addr, mem_index, mop); + } /* Verify alignment if needed. */ if (dc->cpu->cfg.unaligned_exceptions && size > 1) { @@ -1229,13 +1234,27 @@ static void dec_br(DisasContext *dc) /* Memory barrier. */ mbar = (dc->ir >> 16) & 31; if (mbar == 2 && dc->imm == 4) { + uint16_t mbar_imm = dc->rd; + + LOG_DIS("mbar %d\n", mbar_imm); + + /* Data access memory barrier. */ + if ((mbar_imm & 2) == 0) { + tcg_gen_mb(TCG_BAR_SC | TCG_MO_ALL); + } + /* mbar IMM & 16 decodes to sleep. */ - if (dc->rd & 16) { + if (mbar_imm & 16) { TCGv_i32 tmp_hlt = tcg_const_i32(EXCP_HLT); TCGv_i32 tmp_1 = tcg_const_i32(1); LOG_DIS("sleep\n"); + if (trap_userspace(dc, true)) { + /* Sleep is a privileged instruction. */ + return; + } + t_sync_flags(dc); tcg_gen_st_i32(tmp_1, cpu_env, -offsetof(MicroBlazeCPU, env) @@ -1246,7 +1265,6 @@ static void dec_br(DisasContext *dc) tcg_temp_free_i32(tmp_1); return; } - LOG_DIS("mbar %d\n", dc->rd); /* Break the TB. */ dc->cpustate_changed = 1; return; diff --git a/target/mips/Makefile.objs b/target/mips/Makefile.objs deleted file mode 100644 index b820b3b7bc..0000000000 --- a/target/mips/Makefile.objs +++ /dev/null @@ -1,6 +0,0 @@ -obj-y += translate.o cpu.o gdbstub.o helper.o -obj-y += op_helper.o cp0_helper.o fpu_helper.o -obj-y += dsp_helper.o lmmi_helper.o msa_helper.o -obj-$(CONFIG_SOFTMMU) += mips-semi.o -obj-$(CONFIG_SOFTMMU) += machine.o cp0_timer.o -obj-$(CONFIG_KVM) += kvm.o diff --git a/target/mips/meson.build b/target/mips/meson.build new file mode 100644 index 0000000000..fa1f024e78 --- /dev/null +++ b/target/mips/meson.build @@ -0,0 +1,24 @@ +mips_ss = ss.source_set() +mips_ss.add(files( + 'cp0_helper.c', + 'cpu.c', + 'dsp_helper.c', + 'fpu_helper.c', + 'gdbstub.c', + 'helper.c', + 'lmmi_helper.c', + 'msa_helper.c', + 'op_helper.c', + 'translate.c', +)) +mips_ss.add(when: 'CONFIG_KVM', if_true: files('kvm.c')) + +mips_softmmu_ss = ss.source_set() +mips_softmmu_ss.add(files( + 'cp0_timer.c', + 'machine.c', + 'mips-semi.c', +)) + +target_arch += {'mips': mips_ss} +target_softmmu_arch += {'mips': mips_softmmu_ss} diff --git a/target/mips/trace.h b/target/mips/trace.h new file mode 100644 index 0000000000..f25b88ca6f --- /dev/null +++ b/target/mips/trace.h @@ -0,0 +1 @@ +#include "trace/trace-target_mips.h" diff --git a/target/mips/translate.c b/target/mips/translate.c index 9fad58ea2c..899b90ae0f 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -31322,7 +31322,7 @@ void mips_tcg_init(void) #endif } -#include "translate_init.inc.c" +#include "translate_init.c.inc" void cpu_mips_realize_env(CPUMIPSState *env) { diff --git a/target/mips/translate_init.inc.c b/target/mips/translate_init.c.inc index 637caccd89..637caccd89 100644 --- a/target/mips/translate_init.inc.c +++ b/target/mips/translate_init.c.inc diff --git a/target/moxie/Makefile.objs b/target/moxie/Makefile.objs deleted file mode 100644 index 6381d4d636..0000000000 --- a/target/moxie/Makefile.objs +++ /dev/null @@ -1,2 +0,0 @@ -obj-y += translate.o helper.o machine.o cpu.o machine.o -obj-$(CONFIG_SOFTMMU) += mmu.o diff --git a/target/moxie/meson.build b/target/moxie/meson.build new file mode 100644 index 0000000000..b4beb528cc --- /dev/null +++ b/target/moxie/meson.build @@ -0,0 +1,14 @@ +moxie_ss = ss.source_set() +moxie_ss.add(files( + 'cpu.c', + 'helper.c', + 'machine.c', + 'machine.c', + 'translate.c', +)) + +moxie_softmmu_ss = ss.source_set() +moxie_softmmu_ss.add(files('mmu.c')) + +target_arch += {'moxie': moxie_ss} +target_softmmu_arch += {'moxie': moxie_softmmu_ss} diff --git a/target/nios2/Makefile.objs b/target/nios2/Makefile.objs deleted file mode 100644 index 010de0e7a6..0000000000 --- a/target/nios2/Makefile.objs +++ /dev/null @@ -1,4 +0,0 @@ -obj-y += translate.o op_helper.o helper.o cpu.o mmu.o nios2-semi.o -obj-$(CONFIG_SOFTMMU) += monitor.o - -$(obj)/op_helper.o: QEMU_CFLAGS += $(HELPER_CFLAGS) diff --git a/target/nios2/meson.build b/target/nios2/meson.build new file mode 100644 index 0000000000..e643917db1 --- /dev/null +++ b/target/nios2/meson.build @@ -0,0 +1,15 @@ +nios2_ss = ss.source_set() +nios2_ss.add(files( + 'cpu.c', + 'helper.c', + 'mmu.c', + 'nios2-semi.c', + 'op_helper.c', + 'translate.c', +)) + +nios2_softmmu_ss = ss.source_set() +nios2_softmmu_ss.add(files('monitor.c')) + +target_arch += {'nios2': nios2_ss} +target_softmmu_arch += {'nios2': nios2_softmmu_ss} diff --git a/target/openrisc/Makefile.objs b/target/openrisc/Makefile.objs deleted file mode 100644 index b5432f4684..0000000000 --- a/target/openrisc/Makefile.objs +++ /dev/null @@ -1,15 +0,0 @@ -obj-$(CONFIG_SOFTMMU) += machine.o -obj-y += cpu.o exception.o interrupt.o mmu.o translate.o disas.o -obj-y += exception_helper.o fpu_helper.o \ - interrupt_helper.o sys_helper.o -obj-y += gdbstub.o - -DECODETREE = $(SRC_PATH)/scripts/decodetree.py - -target/openrisc/decode.inc.c: \ - $(SRC_PATH)/target/openrisc/insns.decode $(DECODETREE) - $(call quiet-command,\ - $(PYTHON) $(DECODETREE) -o $@ $<, "GEN", $(TARGET_DIR)$@) - -target/openrisc/translate.o: target/openrisc/decode.inc.c -target/openrisc/disas.o: target/openrisc/decode.inc.c diff --git a/target/openrisc/disas.c b/target/openrisc/disas.c index ce112640b9..dc025bd64d 100644 --- a/target/openrisc/disas.c +++ b/target/openrisc/disas.c @@ -25,7 +25,7 @@ typedef disassemble_info DisasContext; /* Include the auto-generated decoder. */ -#include "decode.inc.c" +#include "decode-insns.c.inc" #define output(mnemonic, format, ...) \ (info->fprintf_func(info->stream, "%-9s " format, \ diff --git a/target/openrisc/meson.build b/target/openrisc/meson.build new file mode 100644 index 0000000000..9774a58306 --- /dev/null +++ b/target/openrisc/meson.build @@ -0,0 +1,23 @@ +gen = decodetree.process('insns.decode') + +openrisc_ss = ss.source_set() +openrisc_ss.add(gen) +openrisc_ss.add(files( + 'cpu.c', + 'disas.c', + 'exception.c', + 'exception_helper.c', + 'fpu_helper.c', + 'gdbstub.c', + 'interrupt.c', + 'interrupt_helper.c', + 'mmu.c', + 'sys_helper.c', + 'translate.c', +)) + +openrisc_softmmu_ss = ss.source_set() +openrisc_softmmu_ss.add(files('machine.c')) + +target_arch += {'openrisc': openrisc_ss} +target_softmmu_arch += {'openrisc': openrisc_softmmu_ss} diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c index 52323a16df..c6dce879f1 100644 --- a/target/openrisc/translate.c +++ b/target/openrisc/translate.c @@ -65,7 +65,7 @@ static inline bool is_user(DisasContext *dc) } /* Include the auto-generated decoder. */ -#include "decode.inc.c" +#include "decode-insns.c.inc" static TCGv cpu_sr; static TCGv cpu_regs[32]; diff --git a/target/ppc/Makefile.objs b/target/ppc/Makefile.objs deleted file mode 100644 index e8fa18ce13..0000000000 --- a/target/ppc/Makefile.objs +++ /dev/null @@ -1,20 +0,0 @@ -obj-y += cpu-models.o -obj-y += cpu.o -obj-y += translate.o -ifeq ($(CONFIG_SOFTMMU),y) -obj-y += machine.o mmu_helper.o mmu-hash32.o monitor.o arch_dump.o -obj-$(TARGET_PPC64) += mmu-hash64.o mmu-book3s-v3.o compat.o -obj-$(TARGET_PPC64) += mmu-radix64.o -endif -obj-$(CONFIG_KVM) += kvm.o -obj-$(call lnot,$(CONFIG_KVM)) += kvm-stub.o -obj-y += dfp_helper.o -obj-y += excp_helper.o -obj-y += fpu_helper.o -obj-y += int_helper.o -obj-y += timebase_helper.o -obj-y += misc_helper.o -obj-y += mem_helper.o -obj-y += ../../libdecnumber/ -obj-$(CONFIG_USER_ONLY) += user_only_helper.o -obj-y += gdbstub.o diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index e7d382ac10..3c4e1b3475 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -2191,6 +2191,8 @@ enum { PPC2_PM_ISA206 = 0x0000000000040000ULL, /* POWER ISA 3.0 */ PPC2_ISA300 = 0x0000000000080000ULL, + /* POWER ISA 3.1 */ + PPC2_ISA310 = 0x0000000000100000ULL, #define PPC_TCG_INSNS2 (PPC2_BOOKE206 | PPC2_VSX | PPC2_PRCNTL | PPC2_DBRX | \ PPC2_ISA205 | PPC2_VSX207 | PPC2_PERM_ISA206 | \ @@ -2199,7 +2201,7 @@ enum { PPC2_BCTAR_ISA207 | PPC2_LSQ_ISA207 | \ PPC2_ALTIVEC_207 | PPC2_ISA207S | PPC2_DFP | \ PPC2_FP_CVT_S64 | PPC2_TM | PPC2_PM_ISA206 | \ - PPC2_ISA300) + PPC2_ISA300 | PPC2_ISA310) }; /*****************************************************************************/ diff --git a/target/ppc/helper.h b/target/ppc/helper.h index 90166cbabd..6a4dccf70c 100644 --- a/target/ppc/helper.h +++ b/target/ppc/helper.h @@ -184,7 +184,10 @@ DEF_HELPER_3(vmulosw, void, avr, avr, avr) DEF_HELPER_3(vmuloub, void, avr, avr, avr) DEF_HELPER_3(vmulouh, void, avr, avr, avr) DEF_HELPER_3(vmulouw, void, avr, avr, avr) -DEF_HELPER_3(vmuluwm, void, avr, avr, avr) +DEF_HELPER_3(vmulhsw, void, avr, avr, avr) +DEF_HELPER_3(vmulhuw, void, avr, avr, avr) +DEF_HELPER_3(vmulhsd, void, avr, avr, avr) +DEF_HELPER_3(vmulhud, void, avr, avr, avr) DEF_HELPER_3(vslo, void, avr, avr, avr) DEF_HELPER_3(vsro, void, avr, avr, avr) DEF_HELPER_3(vsrv, void, avr, avr, avr) diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c index d8bd3c234a..b45626f44c 100644 --- a/target/ppc/int_helper.c +++ b/target/ppc/int_helper.c @@ -398,7 +398,7 @@ target_ulong helper_divso(CPUPPCState *env, target_ulong arg1, target_ulong helper_602_mfrom(target_ulong arg) { if (likely(arg < 602)) { -#include "mfrom_table.inc.c" +#include "mfrom_table.c.inc" return mfrom_ROM_table[arg]; } else { return 0; @@ -523,19 +523,6 @@ void helper_vprtybq(ppc_avr_t *r, ppc_avr_t *b) r->VsrD(0) = 0; } -#define VARITH_DO(name, op, element) \ - void helper_v##name(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ - { \ - int i; \ - \ - for (i = 0; i < ARRAY_SIZE(r->element); i++) { \ - r->element[i] = a->element[i] op b->element[i]; \ - } \ - } -VARITH_DO(muluwm, *, u32) -#undef VARITH_DO -#undef VARITH - #define VARITHFP(suffix, func) \ void helper_v##suffix(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a, \ ppc_avr_t *b) \ @@ -1099,6 +1086,41 @@ VMUL(uw, u32, VsrW, VsrD, uint64_t) #undef VMUL_DO_ODD #undef VMUL +void helper_vmulhsw(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) +{ + int i; + + for (i = 0; i < 4; i++) { + r->s32[i] = (int32_t)(((int64_t)a->s32[i] * (int64_t)b->s32[i]) >> 32); + } +} + +void helper_vmulhuw(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) +{ + int i; + + for (i = 0; i < 4; i++) { + r->u32[i] = (uint32_t)(((uint64_t)a->u32[i] * + (uint64_t)b->u32[i]) >> 32); + } +} + +void helper_vmulhsd(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) +{ + uint64_t discard; + + muls64(&discard, &r->u64[0], a->s64[0], b->s64[0]); + muls64(&discard, &r->u64[1], a->s64[1], b->s64[1]); +} + +void helper_vmulhud(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) +{ + uint64_t discard; + + mulu64(&discard, &r->u64[0], a->u64[0], b->u64[0]); + mulu64(&discard, &r->u64[1], a->u64[1], b->u64[1]); +} + void helper_vperm(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c) { diff --git a/target/ppc/meson.build b/target/ppc/meson.build new file mode 100644 index 0000000000..bbfef90e08 --- /dev/null +++ b/target/ppc/meson.build @@ -0,0 +1,37 @@ +ppc_ss = ss.source_set() +ppc_ss.add(files( + 'cpu-models.c', + 'cpu.c', + 'dfp_helper.c', + 'excp_helper.c', + 'fpu_helper.c', + 'gdbstub.c', + 'int_helper.c', + 'mem_helper.c', + 'misc_helper.c', + 'timebase_helper.c', + 'translate.c', +)) + +ppc_ss.add(libdecnumber) + +ppc_ss.add(when: 'CONFIG_KVM', if_true: files('kvm.c'), if_false: files('kvm-stub.c')) +ppc_ss.add(when: 'CONFIG_USER_ONLY', if_true: files('user_only_helper.c')) + +ppc_softmmu_ss = ss.source_set() +ppc_softmmu_ss.add(files( + 'arch_dump.c', + 'machine.c', + 'mmu-hash32.c', + 'mmu_helper.c', + 'monitor.c', +)) +ppc_softmmu_ss.add(when: 'TARGET_PPC64', if_true: files( + 'compat.c', + 'mmu-book3s-v3.c', + 'mmu-hash64.c', + 'mmu-radix64.c', +)) + +target_arch += {'ppc': ppc_ss} +target_softmmu_arch += {'ppc': ppc_softmmu_ss} diff --git a/target/ppc/mfrom_table.inc.c b/target/ppc/mfrom_table.c.inc index 1653b974a4..1653b974a4 100644 --- a/target/ppc/mfrom_table.inc.c +++ b/target/ppc/mfrom_table.c.inc diff --git a/target/ppc/trace.h b/target/ppc/trace.h new file mode 100644 index 0000000000..a9e8962828 --- /dev/null +++ b/target/ppc/trace.h @@ -0,0 +1 @@ +#include "trace/trace-target_ppc.h" diff --git a/target/ppc/translate.c b/target/ppc/translate.c index 4ce3d664b5..fedb9b2271 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -6900,15 +6900,15 @@ static inline void set_avr64(int regno, TCGv_i64 src, bool high) tcg_gen_st_i64(src, cpu_env, avr64_offset(regno, high)); } -#include "translate/fp-impl.inc.c" +#include "translate/fp-impl.c.inc" -#include "translate/vmx-impl.inc.c" +#include "translate/vmx-impl.c.inc" -#include "translate/vsx-impl.inc.c" +#include "translate/vsx-impl.c.inc" -#include "translate/dfp-impl.inc.c" +#include "translate/dfp-impl.c.inc" -#include "translate/spe-impl.inc.c" +#include "translate/spe-impl.c.inc" /* Handles lfdp, lxsd, lxssp */ static void gen_dform39(DisasContext *ctx) @@ -6971,7 +6971,47 @@ static void gen_dform3D(DisasContext *ctx) return gen_invalid(ctx); } +#if defined(TARGET_PPC64) +/* brd */ +static void gen_brd(DisasContext *ctx) +{ + tcg_gen_bswap64_i64(cpu_gpr[rA(ctx->opcode)], cpu_gpr[rS(ctx->opcode)]); +} + +/* brw */ +static void gen_brw(DisasContext *ctx) +{ + tcg_gen_bswap64_i64(cpu_gpr[rA(ctx->opcode)], cpu_gpr[rS(ctx->opcode)]); + tcg_gen_rotli_i64(cpu_gpr[rA(ctx->opcode)], cpu_gpr[rA(ctx->opcode)], 32); + +} + +/* brh */ +static void gen_brh(DisasContext *ctx) +{ + TCGv_i64 t0 = tcg_temp_new_i64(); + TCGv_i64 t1 = tcg_temp_new_i64(); + TCGv_i64 t2 = tcg_temp_new_i64(); + + tcg_gen_movi_i64(t0, 0x00ff00ff00ff00ffull); + tcg_gen_shri_i64(t1, cpu_gpr[rS(ctx->opcode)], 8); + tcg_gen_and_i64(t2, t1, t0); + tcg_gen_and_i64(t1, cpu_gpr[rS(ctx->opcode)], t0); + tcg_gen_shli_i64(t1, t1, 8); + tcg_gen_or_i64(cpu_gpr[rA(ctx->opcode)], t1, t2); + + tcg_temp_free_i64(t0); + tcg_temp_free_i64(t1); + tcg_temp_free_i64(t2); +} +#endif + static opcode_t opcodes[] = { +#if defined(TARGET_PPC64) +GEN_HANDLER_E(brd, 0x1F, 0x1B, 0x05, 0x0000F801, PPC_NONE, PPC2_ISA310), +GEN_HANDLER_E(brw, 0x1F, 0x1B, 0x04, 0x0000F801, PPC_NONE, PPC2_ISA310), +GEN_HANDLER_E(brh, 0x1F, 0x1B, 0x06, 0x0000F801, PPC_NONE, PPC2_ISA310), +#endif GEN_HANDLER(invalid, 0x00, 0x00, 0x00, 0xFFFFFFFF, PPC_NONE), GEN_HANDLER(cmp, 0x1F, 0x00, 0x00, 0x00400000, PPC_INTEGER), GEN_HANDLER(cmpi, 0x0B, 0xFF, 0xFF, 0x00400000, PPC_INTEGER), @@ -7587,19 +7627,19 @@ GEN_HANDLER2_E(treclaim, "treclaim", 0x1F, 0x0E, 0x1D, 0x03E0F800, \ GEN_HANDLER2_E(trechkpt, "trechkpt", 0x1F, 0x0E, 0x1F, 0x03FFF800, \ PPC_NONE, PPC2_TM), -#include "translate/fp-ops.inc.c" +#include "translate/fp-ops.c.inc" -#include "translate/vmx-ops.inc.c" +#include "translate/vmx-ops.c.inc" -#include "translate/vsx-ops.inc.c" +#include "translate/vsx-ops.c.inc" -#include "translate/dfp-ops.inc.c" +#include "translate/dfp-ops.c.inc" -#include "translate/spe-ops.inc.c" +#include "translate/spe-ops.c.inc" }; #include "helper_regs.h" -#include "translate_init.inc.c" +#include "translate_init.c.inc" /*****************************************************************************/ /* Misc PowerPC helpers */ diff --git a/target/ppc/translate/dfp-impl.inc.c b/target/ppc/translate/dfp-impl.c.inc index 6c556dc2e1..6c556dc2e1 100644 --- a/target/ppc/translate/dfp-impl.inc.c +++ b/target/ppc/translate/dfp-impl.c.inc diff --git a/target/ppc/translate/dfp-ops.inc.c b/target/ppc/translate/dfp-ops.c.inc index 6ef38e5712..6ef38e5712 100644 --- a/target/ppc/translate/dfp-ops.inc.c +++ b/target/ppc/translate/dfp-ops.c.inc diff --git a/target/ppc/translate/fp-impl.inc.c b/target/ppc/translate/fp-impl.c.inc index 9f7868ee28..9f7868ee28 100644 --- a/target/ppc/translate/fp-impl.inc.c +++ b/target/ppc/translate/fp-impl.c.inc diff --git a/target/ppc/translate/fp-ops.inc.c b/target/ppc/translate/fp-ops.c.inc index 88fab65628..88fab65628 100644 --- a/target/ppc/translate/fp-ops.inc.c +++ b/target/ppc/translate/fp-ops.c.inc diff --git a/target/ppc/translate/spe-impl.inc.c b/target/ppc/translate/spe-impl.c.inc index 36b4d5654d..2e6e799a25 100644 --- a/target/ppc/translate/spe-impl.inc.c +++ b/target/ppc/translate/spe-impl.c.inc @@ -349,14 +349,24 @@ static inline void gen_evmergelohi(DisasContext *ctx) } static inline void gen_evsplati(DisasContext *ctx) { - uint64_t imm = ((int32_t)(rA(ctx->opcode) << 27)) >> 27; + uint64_t imm; + if (unlikely(!ctx->spe_enabled)) { + gen_exception(ctx, POWERPC_EXCP_SPEU); + return; + } + imm = ((int32_t)(rA(ctx->opcode) << 27)) >> 27; tcg_gen_movi_tl(cpu_gpr[rD(ctx->opcode)], imm); tcg_gen_movi_tl(cpu_gprh[rD(ctx->opcode)], imm); } static inline void gen_evsplatfi(DisasContext *ctx) { - uint64_t imm = rA(ctx->opcode) << 27; + uint64_t imm; + if (unlikely(!ctx->spe_enabled)) { + gen_exception(ctx, POWERPC_EXCP_SPEU); + return; + } + imm = rA(ctx->opcode) << 27; tcg_gen_movi_tl(cpu_gpr[rD(ctx->opcode)], imm); tcg_gen_movi_tl(cpu_gprh[rD(ctx->opcode)], imm); @@ -389,21 +399,37 @@ static inline void gen_evsel(DisasContext *ctx) static void gen_evsel0(DisasContext *ctx) { + if (unlikely(!ctx->spe_enabled)) { + gen_exception(ctx, POWERPC_EXCP_SPEU); + return; + } gen_evsel(ctx); } static void gen_evsel1(DisasContext *ctx) { + if (unlikely(!ctx->spe_enabled)) { + gen_exception(ctx, POWERPC_EXCP_SPEU); + return; + } gen_evsel(ctx); } static void gen_evsel2(DisasContext *ctx) { + if (unlikely(!ctx->spe_enabled)) { + gen_exception(ctx, POWERPC_EXCP_SPEU); + return; + } gen_evsel(ctx); } static void gen_evsel3(DisasContext *ctx) { + if (unlikely(!ctx->spe_enabled)) { + gen_exception(ctx, POWERPC_EXCP_SPEU); + return; + } gen_evsel(ctx); } @@ -518,6 +544,11 @@ static inline void gen_evmwsmia(DisasContext *ctx) { TCGv_i64 tmp; + if (unlikely(!ctx->spe_enabled)) { + gen_exception(ctx, POWERPC_EXCP_SPEU); + return; + } + gen_evmwsmi(ctx); /* rD := rA * rB */ tmp = tcg_temp_new_i64(); @@ -531,8 +562,13 @@ static inline void gen_evmwsmia(DisasContext *ctx) static inline void gen_evmwsmiaa(DisasContext *ctx) { - TCGv_i64 acc = tcg_temp_new_i64(); - TCGv_i64 tmp = tcg_temp_new_i64(); + TCGv_i64 acc; + TCGv_i64 tmp; + + if (unlikely(!ctx->spe_enabled)) { + gen_exception(ctx, POWERPC_EXCP_SPEU); + return; + } gen_evmwsmi(ctx); /* rD := rA * rB */ @@ -892,8 +928,14 @@ static inline void gen_##name(DisasContext *ctx) \ #define GEN_SPEFPUOP_CONV_32_64(name) \ static inline void gen_##name(DisasContext *ctx) \ { \ - TCGv_i64 t0 = tcg_temp_new_i64(); \ - TCGv_i32 t1 = tcg_temp_new_i32(); \ + TCGv_i64 t0; \ + TCGv_i32 t1; \ + if (unlikely(!ctx->spe_enabled)) { \ + gen_exception(ctx, POWERPC_EXCP_SPEU); \ + return; \ + } \ + t0 = tcg_temp_new_i64(); \ + t1 = tcg_temp_new_i32(); \ gen_load_gpr64(t0, rB(ctx->opcode)); \ gen_helper_##name(t1, cpu_env, t0); \ tcg_gen_extu_i32_tl(cpu_gpr[rD(ctx->opcode)], t1); \ @@ -903,8 +945,14 @@ static inline void gen_##name(DisasContext *ctx) \ #define GEN_SPEFPUOP_CONV_64_32(name) \ static inline void gen_##name(DisasContext *ctx) \ { \ - TCGv_i64 t0 = tcg_temp_new_i64(); \ - TCGv_i32 t1 = tcg_temp_new_i32(); \ + TCGv_i64 t0; \ + TCGv_i32 t1; \ + if (unlikely(!ctx->spe_enabled)) { \ + gen_exception(ctx, POWERPC_EXCP_SPEU); \ + return; \ + } \ + t0 = tcg_temp_new_i64(); \ + t1 = tcg_temp_new_i32(); \ tcg_gen_trunc_tl_i32(t1, cpu_gpr[rB(ctx->opcode)]); \ gen_helper_##name(t0, cpu_env, t1); \ gen_store_gpr64(rD(ctx->opcode), t0); \ @@ -914,7 +962,12 @@ static inline void gen_##name(DisasContext *ctx) \ #define GEN_SPEFPUOP_CONV_64_64(name) \ static inline void gen_##name(DisasContext *ctx) \ { \ - TCGv_i64 t0 = tcg_temp_new_i64(); \ + TCGv_i64 t0; \ + if (unlikely(!ctx->spe_enabled)) { \ + gen_exception(ctx, POWERPC_EXCP_SPEU); \ + return; \ + } \ + t0 = tcg_temp_new_i64(); \ gen_load_gpr64(t0, rB(ctx->opcode)); \ gen_helper_##name(t0, cpu_env, t0); \ gen_store_gpr64(rD(ctx->opcode), t0); \ @@ -923,13 +976,8 @@ static inline void gen_##name(DisasContext *ctx) \ #define GEN_SPEFPUOP_ARITH2_32_32(name) \ static inline void gen_##name(DisasContext *ctx) \ { \ - TCGv_i32 t0, t1; \ - if (unlikely(!ctx->spe_enabled)) { \ - gen_exception(ctx, POWERPC_EXCP_SPEU); \ - return; \ - } \ - t0 = tcg_temp_new_i32(); \ - t1 = tcg_temp_new_i32(); \ + TCGv_i32 t0 = tcg_temp_new_i32(); \ + TCGv_i32 t1 = tcg_temp_new_i32(); \ tcg_gen_trunc_tl_i32(t0, cpu_gpr[rA(ctx->opcode)]); \ tcg_gen_trunc_tl_i32(t1, cpu_gpr[rB(ctx->opcode)]); \ gen_helper_##name(t0, cpu_env, t0, t1); \ @@ -958,13 +1006,8 @@ static inline void gen_##name(DisasContext *ctx) \ #define GEN_SPEFPUOP_COMP_32(name) \ static inline void gen_##name(DisasContext *ctx) \ { \ - TCGv_i32 t0, t1; \ - if (unlikely(!ctx->spe_enabled)) { \ - gen_exception(ctx, POWERPC_EXCP_SPEU); \ - return; \ - } \ - t0 = tcg_temp_new_i32(); \ - t1 = tcg_temp_new_i32(); \ + TCGv_i32 t0 = tcg_temp_new_i32(); \ + TCGv_i32 t1 = tcg_temp_new_i32(); \ \ tcg_gen_trunc_tl_i32(t0, cpu_gpr[rA(ctx->opcode)]); \ tcg_gen_trunc_tl_i32(t1, cpu_gpr[rB(ctx->opcode)]); \ @@ -1074,28 +1117,16 @@ GEN_SPEFPUOP_ARITH2_32_32(efsmul); GEN_SPEFPUOP_ARITH2_32_32(efsdiv); static inline void gen_efsabs(DisasContext *ctx) { - if (unlikely(!ctx->spe_enabled)) { - gen_exception(ctx, POWERPC_EXCP_SPEU); - return; - } tcg_gen_andi_tl(cpu_gpr[rD(ctx->opcode)], cpu_gpr[rA(ctx->opcode)], (target_long)~0x80000000LL); } static inline void gen_efsnabs(DisasContext *ctx) { - if (unlikely(!ctx->spe_enabled)) { - gen_exception(ctx, POWERPC_EXCP_SPEU); - return; - } tcg_gen_ori_tl(cpu_gpr[rD(ctx->opcode)], cpu_gpr[rA(ctx->opcode)], 0x80000000); } static inline void gen_efsneg(DisasContext *ctx) { - if (unlikely(!ctx->spe_enabled)) { - gen_exception(ctx, POWERPC_EXCP_SPEU); - return; - } tcg_gen_xori_tl(cpu_gpr[rD(ctx->opcode)], cpu_gpr[rA(ctx->opcode)], 0x80000000); } diff --git a/target/ppc/translate/spe-ops.inc.c b/target/ppc/translate/spe-ops.c.inc index 7efe8b8746..7efe8b8746 100644 --- a/target/ppc/translate/spe-ops.inc.c +++ b/target/ppc/translate/spe-ops.c.inc diff --git a/target/ppc/translate/vmx-impl.inc.c b/target/ppc/translate/vmx-impl.c.inc index de2fd136ff..92b9527aff 100644 --- a/target/ppc/translate/vmx-impl.inc.c +++ b/target/ppc/translate/vmx-impl.c.inc @@ -801,18 +801,27 @@ static void trans_vclzd(DisasContext *ctx) GEN_VXFORM(vmuloub, 4, 0); GEN_VXFORM(vmulouh, 4, 1); GEN_VXFORM(vmulouw, 4, 2); -GEN_VXFORM(vmuluwm, 4, 2); +GEN_VXFORM_V(vmuluwm, MO_32, tcg_gen_gvec_mul, 4, 2); GEN_VXFORM_DUAL(vmulouw, PPC_ALTIVEC, PPC_NONE, vmuluwm, PPC_NONE, PPC2_ALTIVEC_207) GEN_VXFORM(vmulosb, 4, 4); GEN_VXFORM(vmulosh, 4, 5); GEN_VXFORM(vmulosw, 4, 6); +GEN_VXFORM_V(vmulld, MO_64, tcg_gen_gvec_mul, 4, 7); GEN_VXFORM(vmuleub, 4, 8); GEN_VXFORM(vmuleuh, 4, 9); GEN_VXFORM(vmuleuw, 4, 10); +GEN_VXFORM(vmulhuw, 4, 10); +GEN_VXFORM(vmulhud, 4, 11); +GEN_VXFORM_DUAL(vmuleuw, PPC_ALTIVEC, PPC_NONE, + vmulhuw, PPC_NONE, PPC2_ISA310); GEN_VXFORM(vmulesb, 4, 12); GEN_VXFORM(vmulesh, 4, 13); GEN_VXFORM(vmulesw, 4, 14); +GEN_VXFORM(vmulhsw, 4, 14); +GEN_VXFORM_DUAL(vmulesw, PPC_ALTIVEC, PPC_NONE, + vmulhsw, PPC_NONE, PPC2_ISA310); +GEN_VXFORM(vmulhsd, 4, 15); GEN_VXFORM_V(vslb, MO_8, tcg_gen_gvec_shlv, 2, 4); GEN_VXFORM_V(vslh, MO_16, tcg_gen_gvec_shlv, 2, 5); GEN_VXFORM_V(vslw, MO_32, tcg_gen_gvec_shlv, 2, 6); diff --git a/target/ppc/translate/vmx-ops.inc.c b/target/ppc/translate/vmx-ops.c.inc index 84e05fb827..f3f4855111 100644 --- a/target/ppc/translate/vmx-ops.inc.c +++ b/target/ppc/translate/vmx-ops.c.inc @@ -48,6 +48,9 @@ GEN_HANDLER_E(name, 0x04, opc2, opc3, inval, PPC_NONE, PPC2_ISA300) GEN_HANDLER_E_2(name, 0x04, opc2, opc3, opc4, 0x00000000, PPC_NONE, \ PPC2_ISA300) +#define GEN_VXFORM_310(name, opc2, opc3) \ +GEN_HANDLER_E(name, 0x04, opc2, opc3, 0x00000000, PPC_NONE, PPC2_ISA310) + #define GEN_VXFORM_DUAL(name0, name1, opc2, opc3, type0, type1) \ GEN_HANDLER_E(name0##_##name1, 0x4, opc2, opc3, 0x00000000, type0, type1) @@ -104,12 +107,15 @@ GEN_VXFORM_DUAL(vmulouw, vmuluwm, 4, 2, PPC_ALTIVEC, PPC_NONE), GEN_VXFORM(vmulosb, 4, 4), GEN_VXFORM(vmulosh, 4, 5), GEN_VXFORM_207(vmulosw, 4, 6), +GEN_VXFORM_310(vmulld, 4, 7), GEN_VXFORM(vmuleub, 4, 8), GEN_VXFORM(vmuleuh, 4, 9), -GEN_VXFORM_207(vmuleuw, 4, 10), +GEN_VXFORM_DUAL(vmuleuw, vmulhuw, 4, 10, PPC_ALTIVEC, PPC_NONE), +GEN_VXFORM_310(vmulhud, 4, 11), GEN_VXFORM(vmulesb, 4, 12), GEN_VXFORM(vmulesh, 4, 13), -GEN_VXFORM_207(vmulesw, 4, 14), +GEN_VXFORM_DUAL(vmulesw, vmulhsw, 4, 14, PPC_ALTIVEC, PPC_NONE), +GEN_VXFORM_310(vmulhsd, 4, 15), GEN_VXFORM(vslb, 2, 4), GEN_VXFORM(vslh, 2, 5), GEN_VXFORM_DUAL(vslw, vrlwnm, 2, 6, PPC_ALTIVEC, PPC_NONE), diff --git a/target/ppc/translate/vsx-impl.inc.c b/target/ppc/translate/vsx-impl.c.inc index b518de46db..b518de46db 100644 --- a/target/ppc/translate/vsx-impl.inc.c +++ b/target/ppc/translate/vsx-impl.c.inc diff --git a/target/ppc/translate/vsx-ops.inc.c b/target/ppc/translate/vsx-ops.c.inc index 7fd3942b84..7fd3942b84 100644 --- a/target/ppc/translate/vsx-ops.inc.c +++ b/target/ppc/translate/vsx-ops.c.inc diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.c.inc index 7e66822b5d..230a062d29 100644 --- a/target/ppc/translate_init.inc.c +++ b/target/ppc/translate_init.c.inc @@ -284,12 +284,24 @@ static void spr_write_atbu(DisasContext *ctx, int sprn, int gprn) ATTRIBUTE_UNUSED static void spr_read_purr(DisasContext *ctx, int gprn, int sprn) { + if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) { + gen_io_start(); + } gen_helper_load_purr(cpu_gpr[gprn], cpu_env); + if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) { + gen_stop_exception(ctx); + } } static void spr_write_purr(DisasContext *ctx, int sprn, int gprn) { + if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) { + gen_io_start(); + } gen_helper_store_purr(cpu_env, cpu_gpr[gprn]); + if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) { + gen_stop_exception(ctx); + } } /* HDECR */ @@ -319,17 +331,35 @@ static void spr_write_hdecr(DisasContext *ctx, int sprn, int gprn) static void spr_read_vtb(DisasContext *ctx, int gprn, int sprn) { + if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) { + gen_io_start(); + } gen_helper_load_vtb(cpu_gpr[gprn], cpu_env); + if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) { + gen_stop_exception(ctx); + } } static void spr_write_vtb(DisasContext *ctx, int sprn, int gprn) { + if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) { + gen_io_start(); + } gen_helper_store_vtb(cpu_env, cpu_gpr[gprn]); + if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) { + gen_stop_exception(ctx); + } } static void spr_write_tbu40(DisasContext *ctx, int sprn, int gprn) { + if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) { + gen_io_start(); + } gen_helper_store_tbu40(cpu_env, cpu_gpr[gprn]); + if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) { + gen_stop_exception(ctx); + } } #endif @@ -9201,7 +9231,7 @@ POWERPC_FAMILY(POWER10)(ObjectClass *oc, void *data) PPC2_FP_TST_ISA206 | PPC2_BCTAR_ISA207 | PPC2_LSQ_ISA207 | PPC2_ALTIVEC_207 | PPC2_ISA205 | PPC2_ISA207S | PPC2_FP_CVT_S64 | - PPC2_TM | PPC2_ISA300 | PPC2_PRCNTL; + PPC2_TM | PPC2_ISA300 | PPC2_PRCNTL | PPC2_ISA310; pcc->msr_mask = (1ull << MSR_SF) | (1ull << MSR_HV) | (1ull << MSR_TM) | diff --git a/target/riscv/Makefile.objs b/target/riscv/Makefile.objs deleted file mode 100644 index ff38df6219..0000000000 --- a/target/riscv/Makefile.objs +++ /dev/null @@ -1,28 +0,0 @@ -obj-y += translate.o op_helper.o cpu_helper.o cpu.o csr.o fpu_helper.o vector_helper.o gdbstub.o -obj-$(CONFIG_SOFTMMU) += pmp.o - -ifeq ($(CONFIG_SOFTMMU),y) -obj-y += monitor.o -endif - -DECODETREE = $(SRC_PATH)/scripts/decodetree.py - -decode32-y = $(SRC_PATH)/target/riscv/insn32.decode -decode32-$(TARGET_RISCV64) += $(SRC_PATH)/target/riscv/insn32-64.decode - -decode16-y = $(SRC_PATH)/target/riscv/insn16.decode -decode16-$(TARGET_RISCV32) += $(SRC_PATH)/target/riscv/insn16-32.decode -decode16-$(TARGET_RISCV64) += $(SRC_PATH)/target/riscv/insn16-64.decode - -target/riscv/decode_insn32.inc.c: $(decode32-y) $(DECODETREE) - $(call quiet-command, \ - $(PYTHON) $(DECODETREE) -o $@ --static-decode decode_insn32 \ - $(decode32-y), "GEN", $(TARGET_DIR)$@) - -target/riscv/decode_insn16.inc.c: $(decode16-y) $(DECODETREE) - $(call quiet-command, \ - $(PYTHON) $(DECODETREE) -o $@ --static-decode decode_insn16 \ - --insnwidth 16 $(decode16-y), "GEN", $(TARGET_DIR)$@) - -target/riscv/translate.o: target/riscv/decode_insn32.inc.c \ - target/riscv/decode_insn16.inc.c diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index 75d2ae3434..fd1d373b6f 100644 --- a/target/riscv/cpu_helper.c +++ b/target/riscv/cpu_helper.c @@ -543,7 +543,8 @@ restart: /* for superpage mappings, make a fake leaf PTE for the TLB's benefit. */ target_ulong vpn = addr >> PGSHIFT; - *physical = (ppn | (vpn & ((1L << ptshift) - 1))) << PGSHIFT; + *physical = ((ppn | (vpn & ((1L << ptshift) - 1))) << PGSHIFT) | + (addr & ~TARGET_PAGE_MASK); /* set permissions on the TLB entry */ if ((pte & PTE_R) || ((pte & PTE_X) && mxr)) { @@ -630,7 +631,7 @@ hwaddr riscv_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) } } - return phys_addr; + return phys_addr & TARGET_PAGE_MASK; } void riscv_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, @@ -692,6 +693,7 @@ bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address, int size, bool first_stage_error = true; int ret = TRANSLATE_FAIL; int mode = mmu_idx; + target_ulong tlb_size = 0; env->guest_phys_fault_addr = 0; @@ -783,8 +785,13 @@ bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address, int size, } if (ret == TRANSLATE_SUCCESS) { - tlb_set_page(cs, address & TARGET_PAGE_MASK, pa & TARGET_PAGE_MASK, - prot, mmu_idx, TARGET_PAGE_SIZE); + if (pmp_is_range_in_tlb(env, pa & TARGET_PAGE_MASK, &tlb_size)) { + tlb_set_page(cs, address & ~(tlb_size - 1), pa & ~(tlb_size - 1), + prot, mmu_idx, tlb_size); + } else { + tlb_set_page(cs, address & TARGET_PAGE_MASK, pa & TARGET_PAGE_MASK, + prot, mmu_idx, TARGET_PAGE_SIZE); + } return true; } else if (probe) { return false; diff --git a/target/riscv/fpu_helper.c b/target/riscv/fpu_helper.c index 4379756dc4..bb346a8249 100644 --- a/target/riscv/fpu_helper.c +++ b/target/riscv/fpu_helper.c @@ -81,10 +81,19 @@ void helper_set_rounding_mode(CPURISCVState *env, uint32_t rm) set_float_rounding_mode(softrm, &env->fp_status); } +static uint64_t do_fmadd_s(CPURISCVState *env, uint64_t rs1, uint64_t rs2, + uint64_t rs3, int flags) +{ + float32 frs1 = check_nanbox_s(rs1); + float32 frs2 = check_nanbox_s(rs2); + float32 frs3 = check_nanbox_s(rs3); + return nanbox_s(float32_muladd(frs1, frs2, frs3, flags, &env->fp_status)); +} + uint64_t helper_fmadd_s(CPURISCVState *env, uint64_t frs1, uint64_t frs2, uint64_t frs3) { - return float32_muladd(frs1, frs2, frs3, 0, &env->fp_status); + return do_fmadd_s(env, frs1, frs2, frs3, 0); } uint64_t helper_fmadd_d(CPURISCVState *env, uint64_t frs1, uint64_t frs2, @@ -96,8 +105,7 @@ uint64_t helper_fmadd_d(CPURISCVState *env, uint64_t frs1, uint64_t frs2, uint64_t helper_fmsub_s(CPURISCVState *env, uint64_t frs1, uint64_t frs2, uint64_t frs3) { - return float32_muladd(frs1, frs2, frs3, float_muladd_negate_c, - &env->fp_status); + return do_fmadd_s(env, frs1, frs2, frs3, float_muladd_negate_c); } uint64_t helper_fmsub_d(CPURISCVState *env, uint64_t frs1, uint64_t frs2, @@ -110,8 +118,7 @@ uint64_t helper_fmsub_d(CPURISCVState *env, uint64_t frs1, uint64_t frs2, uint64_t helper_fnmsub_s(CPURISCVState *env, uint64_t frs1, uint64_t frs2, uint64_t frs3) { - return float32_muladd(frs1, frs2, frs3, float_muladd_negate_product, - &env->fp_status); + return do_fmadd_s(env, frs1, frs2, frs3, float_muladd_negate_product); } uint64_t helper_fnmsub_d(CPURISCVState *env, uint64_t frs1, uint64_t frs2, @@ -124,8 +131,8 @@ uint64_t helper_fnmsub_d(CPURISCVState *env, uint64_t frs1, uint64_t frs2, uint64_t helper_fnmadd_s(CPURISCVState *env, uint64_t frs1, uint64_t frs2, uint64_t frs3) { - return float32_muladd(frs1, frs2, frs3, float_muladd_negate_c | - float_muladd_negate_product, &env->fp_status); + return do_fmadd_s(env, frs1, frs2, frs3, + float_muladd_negate_c | float_muladd_negate_product); } uint64_t helper_fnmadd_d(CPURISCVState *env, uint64_t frs1, uint64_t frs2, @@ -135,102 +142,126 @@ uint64_t helper_fnmadd_d(CPURISCVState *env, uint64_t frs1, uint64_t frs2, float_muladd_negate_product, &env->fp_status); } -uint64_t helper_fadd_s(CPURISCVState *env, uint64_t frs1, uint64_t frs2) +uint64_t helper_fadd_s(CPURISCVState *env, uint64_t rs1, uint64_t rs2) { - return float32_add(frs1, frs2, &env->fp_status); + float32 frs1 = check_nanbox_s(rs1); + float32 frs2 = check_nanbox_s(rs2); + return nanbox_s(float32_add(frs1, frs2, &env->fp_status)); } -uint64_t helper_fsub_s(CPURISCVState *env, uint64_t frs1, uint64_t frs2) +uint64_t helper_fsub_s(CPURISCVState *env, uint64_t rs1, uint64_t rs2) { - return float32_sub(frs1, frs2, &env->fp_status); + float32 frs1 = check_nanbox_s(rs1); + float32 frs2 = check_nanbox_s(rs2); + return nanbox_s(float32_sub(frs1, frs2, &env->fp_status)); } -uint64_t helper_fmul_s(CPURISCVState *env, uint64_t frs1, uint64_t frs2) +uint64_t helper_fmul_s(CPURISCVState *env, uint64_t rs1, uint64_t rs2) { - return float32_mul(frs1, frs2, &env->fp_status); + float32 frs1 = check_nanbox_s(rs1); + float32 frs2 = check_nanbox_s(rs2); + return nanbox_s(float32_mul(frs1, frs2, &env->fp_status)); } -uint64_t helper_fdiv_s(CPURISCVState *env, uint64_t frs1, uint64_t frs2) +uint64_t helper_fdiv_s(CPURISCVState *env, uint64_t rs1, uint64_t rs2) { - return float32_div(frs1, frs2, &env->fp_status); + float32 frs1 = check_nanbox_s(rs1); + float32 frs2 = check_nanbox_s(rs2); + return nanbox_s(float32_div(frs1, frs2, &env->fp_status)); } -uint64_t helper_fmin_s(CPURISCVState *env, uint64_t frs1, uint64_t frs2) +uint64_t helper_fmin_s(CPURISCVState *env, uint64_t rs1, uint64_t rs2) { - return float32_minnum(frs1, frs2, &env->fp_status); + float32 frs1 = check_nanbox_s(rs1); + float32 frs2 = check_nanbox_s(rs2); + return nanbox_s(float32_minnum(frs1, frs2, &env->fp_status)); } -uint64_t helper_fmax_s(CPURISCVState *env, uint64_t frs1, uint64_t frs2) +uint64_t helper_fmax_s(CPURISCVState *env, uint64_t rs1, uint64_t rs2) { - return float32_maxnum(frs1, frs2, &env->fp_status); + float32 frs1 = check_nanbox_s(rs1); + float32 frs2 = check_nanbox_s(rs2); + return nanbox_s(float32_maxnum(frs1, frs2, &env->fp_status)); } -uint64_t helper_fsqrt_s(CPURISCVState *env, uint64_t frs1) +uint64_t helper_fsqrt_s(CPURISCVState *env, uint64_t rs1) { - return float32_sqrt(frs1, &env->fp_status); + float32 frs1 = check_nanbox_s(rs1); + return nanbox_s(float32_sqrt(frs1, &env->fp_status)); } -target_ulong helper_fle_s(CPURISCVState *env, uint64_t frs1, uint64_t frs2) +target_ulong helper_fle_s(CPURISCVState *env, uint64_t rs1, uint64_t rs2) { + float32 frs1 = check_nanbox_s(rs1); + float32 frs2 = check_nanbox_s(rs2); return float32_le(frs1, frs2, &env->fp_status); } -target_ulong helper_flt_s(CPURISCVState *env, uint64_t frs1, uint64_t frs2) +target_ulong helper_flt_s(CPURISCVState *env, uint64_t rs1, uint64_t rs2) { + float32 frs1 = check_nanbox_s(rs1); + float32 frs2 = check_nanbox_s(rs2); return float32_lt(frs1, frs2, &env->fp_status); } -target_ulong helper_feq_s(CPURISCVState *env, uint64_t frs1, uint64_t frs2) +target_ulong helper_feq_s(CPURISCVState *env, uint64_t rs1, uint64_t rs2) { + float32 frs1 = check_nanbox_s(rs1); + float32 frs2 = check_nanbox_s(rs2); return float32_eq_quiet(frs1, frs2, &env->fp_status); } -target_ulong helper_fcvt_w_s(CPURISCVState *env, uint64_t frs1) +target_ulong helper_fcvt_w_s(CPURISCVState *env, uint64_t rs1) { + float32 frs1 = check_nanbox_s(rs1); return float32_to_int32(frs1, &env->fp_status); } -target_ulong helper_fcvt_wu_s(CPURISCVState *env, uint64_t frs1) +target_ulong helper_fcvt_wu_s(CPURISCVState *env, uint64_t rs1) { + float32 frs1 = check_nanbox_s(rs1); return (int32_t)float32_to_uint32(frs1, &env->fp_status); } #if defined(TARGET_RISCV64) -uint64_t helper_fcvt_l_s(CPURISCVState *env, uint64_t frs1) +uint64_t helper_fcvt_l_s(CPURISCVState *env, uint64_t rs1) { + float32 frs1 = check_nanbox_s(rs1); return float32_to_int64(frs1, &env->fp_status); } -uint64_t helper_fcvt_lu_s(CPURISCVState *env, uint64_t frs1) +uint64_t helper_fcvt_lu_s(CPURISCVState *env, uint64_t rs1) { + float32 frs1 = check_nanbox_s(rs1); return float32_to_uint64(frs1, &env->fp_status); } #endif uint64_t helper_fcvt_s_w(CPURISCVState *env, target_ulong rs1) { - return int32_to_float32((int32_t)rs1, &env->fp_status); + return nanbox_s(int32_to_float32((int32_t)rs1, &env->fp_status)); } uint64_t helper_fcvt_s_wu(CPURISCVState *env, target_ulong rs1) { - return uint32_to_float32((uint32_t)rs1, &env->fp_status); + return nanbox_s(uint32_to_float32((uint32_t)rs1, &env->fp_status)); } #if defined(TARGET_RISCV64) uint64_t helper_fcvt_s_l(CPURISCVState *env, uint64_t rs1) { - return int64_to_float32(rs1, &env->fp_status); + return nanbox_s(int64_to_float32(rs1, &env->fp_status)); } uint64_t helper_fcvt_s_lu(CPURISCVState *env, uint64_t rs1) { - return uint64_to_float32(rs1, &env->fp_status); + return nanbox_s(uint64_to_float32(rs1, &env->fp_status)); } #endif -target_ulong helper_fclass_s(uint64_t frs1) +target_ulong helper_fclass_s(uint64_t rs1) { + float32 frs1 = check_nanbox_s(rs1); return fclass_s(frs1); } @@ -266,12 +297,13 @@ uint64_t helper_fmax_d(CPURISCVState *env, uint64_t frs1, uint64_t frs2) uint64_t helper_fcvt_s_d(CPURISCVState *env, uint64_t rs1) { - return float64_to_float32(rs1, &env->fp_status); + return nanbox_s(float64_to_float32(rs1, &env->fp_status)); } uint64_t helper_fcvt_d_s(CPURISCVState *env, uint64_t rs1) { - return float32_to_float64(rs1, &env->fp_status); + float32 frs1 = check_nanbox_s(rs1); + return float32_to_float64(frs1, &env->fp_status); } uint64_t helper_fsqrt_d(CPURISCVState *env, uint64_t frs1) diff --git a/target/riscv/insn_trans/trans_privileged.inc.c b/target/riscv/insn_trans/trans_privileged.c.inc index 2a61a853bf..2a61a853bf 100644 --- a/target/riscv/insn_trans/trans_privileged.inc.c +++ b/target/riscv/insn_trans/trans_privileged.c.inc diff --git a/target/riscv/insn_trans/trans_rva.inc.c b/target/riscv/insn_trans/trans_rva.c.inc index be8a9f06dd..be8a9f06dd 100644 --- a/target/riscv/insn_trans/trans_rva.inc.c +++ b/target/riscv/insn_trans/trans_rva.c.inc diff --git a/target/riscv/insn_trans/trans_rvd.inc.c b/target/riscv/insn_trans/trans_rvd.c.inc index ea1044f13b..4f832637fa 100644 --- a/target/riscv/insn_trans/trans_rvd.inc.c +++ b/target/riscv/insn_trans/trans_rvd.c.inc @@ -20,10 +20,10 @@ static bool trans_fld(DisasContext *ctx, arg_fld *a) { - TCGv t0 = tcg_temp_new(); - gen_get_gpr(t0, a->rs1); REQUIRE_FPU; REQUIRE_EXT(ctx, RVD); + TCGv t0 = tcg_temp_new(); + gen_get_gpr(t0, a->rs1); tcg_gen_addi_tl(t0, t0, a->imm); tcg_gen_qemu_ld_i64(cpu_fpr[a->rd], t0, ctx->mem_idx, MO_TEQ); @@ -35,10 +35,10 @@ static bool trans_fld(DisasContext *ctx, arg_fld *a) static bool trans_fsd(DisasContext *ctx, arg_fsd *a) { - TCGv t0 = tcg_temp_new(); - gen_get_gpr(t0, a->rs1); REQUIRE_FPU; REQUIRE_EXT(ctx, RVD); + TCGv t0 = tcg_temp_new(); + gen_get_gpr(t0, a->rs1); tcg_gen_addi_tl(t0, t0, a->imm); tcg_gen_qemu_st_i64(cpu_fpr[a->rs2], t0, ctx->mem_idx, MO_TEQ); diff --git a/target/riscv/insn_trans/trans_rvf.inc.c b/target/riscv/insn_trans/trans_rvf.c.inc index 3bfd8881e7..3dfec8211d 100644 --- a/target/riscv/insn_trans/trans_rvf.inc.c +++ b/target/riscv/insn_trans/trans_rvf.c.inc @@ -23,30 +23,16 @@ return false; \ } while (0) -/* - * RISC-V requires NaN-boxing of narrower width floating - * point values. This applies when a 32-bit value is - * assigned to a 64-bit FP register. Thus this does not - * apply when the RVD extension is not present. - */ -static void gen_nanbox_fpr(DisasContext *ctx, int regno) -{ - if (has_ext(ctx, RVD)) { - tcg_gen_ori_i64(cpu_fpr[regno], cpu_fpr[regno], - MAKE_64BIT_MASK(32, 32)); - } -} - static bool trans_flw(DisasContext *ctx, arg_flw *a) { - TCGv t0 = tcg_temp_new(); - gen_get_gpr(t0, a->rs1); REQUIRE_FPU; REQUIRE_EXT(ctx, RVF); + TCGv t0 = tcg_temp_new(); + gen_get_gpr(t0, a->rs1); tcg_gen_addi_tl(t0, t0, a->imm); tcg_gen_qemu_ld_i64(cpu_fpr[a->rd], t0, ctx->mem_idx, MO_TEUL); - gen_nanbox_fpr(ctx, a->rd); + gen_nanbox_s(cpu_fpr[a->rd], cpu_fpr[a->rd]); tcg_temp_free(t0); mark_fs_dirty(ctx); @@ -55,11 +41,11 @@ static bool trans_flw(DisasContext *ctx, arg_flw *a) static bool trans_fsw(DisasContext *ctx, arg_fsw *a) { + REQUIRE_FPU; + REQUIRE_EXT(ctx, RVF); TCGv t0 = tcg_temp_new(); gen_get_gpr(t0, a->rs1); - REQUIRE_FPU; - REQUIRE_EXT(ctx, RVF); tcg_gen_addi_tl(t0, t0, a->imm); tcg_gen_qemu_st_i64(cpu_fpr[a->rs2], t0, ctx->mem_idx, MO_TEUL); @@ -175,11 +161,20 @@ static bool trans_fsgnj_s(DisasContext *ctx, arg_fsgnj_s *a) { REQUIRE_FPU; REQUIRE_EXT(ctx, RVF); + if (a->rs1 == a->rs2) { /* FMOV */ - tcg_gen_mov_i64(cpu_fpr[a->rd], cpu_fpr[a->rs1]); + gen_check_nanbox_s(cpu_fpr[a->rd], cpu_fpr[a->rs1]); } else { /* FSGNJ */ - tcg_gen_deposit_i64(cpu_fpr[a->rd], cpu_fpr[a->rs2], cpu_fpr[a->rs1], - 0, 31); + TCGv_i64 rs1 = tcg_temp_new_i64(); + TCGv_i64 rs2 = tcg_temp_new_i64(); + + gen_check_nanbox_s(rs1, cpu_fpr[a->rs1]); + gen_check_nanbox_s(rs2, cpu_fpr[a->rs2]); + + /* This formulation retains the nanboxing of rs2. */ + tcg_gen_deposit_i64(cpu_fpr[a->rd], rs2, rs1, 0, 31); + tcg_temp_free_i64(rs1); + tcg_temp_free_i64(rs2); } mark_fs_dirty(ctx); return true; @@ -187,32 +182,65 @@ static bool trans_fsgnj_s(DisasContext *ctx, arg_fsgnj_s *a) static bool trans_fsgnjn_s(DisasContext *ctx, arg_fsgnjn_s *a) { + TCGv_i64 rs1, rs2, mask; + REQUIRE_FPU; REQUIRE_EXT(ctx, RVF); + + rs1 = tcg_temp_new_i64(); + gen_check_nanbox_s(rs1, cpu_fpr[a->rs1]); + if (a->rs1 == a->rs2) { /* FNEG */ - tcg_gen_xori_i64(cpu_fpr[a->rd], cpu_fpr[a->rs1], INT32_MIN); + tcg_gen_xori_i64(cpu_fpr[a->rd], rs1, MAKE_64BIT_MASK(31, 1)); } else { - TCGv_i64 t0 = tcg_temp_new_i64(); - tcg_gen_not_i64(t0, cpu_fpr[a->rs2]); - tcg_gen_deposit_i64(cpu_fpr[a->rd], t0, cpu_fpr[a->rs1], 0, 31); - tcg_temp_free_i64(t0); + rs2 = tcg_temp_new_i64(); + gen_check_nanbox_s(rs2, cpu_fpr[a->rs2]); + + /* + * Replace bit 31 in rs1 with inverse in rs2. + * This formulation retains the nanboxing of rs1. + */ + mask = tcg_const_i64(~MAKE_64BIT_MASK(31, 1)); + tcg_gen_nor_i64(rs2, rs2, mask); + tcg_gen_and_i64(rs1, mask, rs1); + tcg_gen_or_i64(cpu_fpr[a->rd], rs1, rs2); + + tcg_temp_free_i64(mask); + tcg_temp_free_i64(rs2); } + tcg_temp_free_i64(rs1); + mark_fs_dirty(ctx); return true; } static bool trans_fsgnjx_s(DisasContext *ctx, arg_fsgnjx_s *a) { + TCGv_i64 rs1, rs2; + REQUIRE_FPU; REQUIRE_EXT(ctx, RVF); + + rs1 = tcg_temp_new_i64(); + gen_check_nanbox_s(rs1, cpu_fpr[a->rs1]); + if (a->rs1 == a->rs2) { /* FABS */ - tcg_gen_andi_i64(cpu_fpr[a->rd], cpu_fpr[a->rs1], ~INT32_MIN); + tcg_gen_andi_i64(cpu_fpr[a->rd], rs1, ~MAKE_64BIT_MASK(31, 1)); } else { - TCGv_i64 t0 = tcg_temp_new_i64(); - tcg_gen_andi_i64(t0, cpu_fpr[a->rs2], INT32_MIN); - tcg_gen_xor_i64(cpu_fpr[a->rd], cpu_fpr[a->rs1], t0); - tcg_temp_free_i64(t0); + rs2 = tcg_temp_new_i64(); + gen_check_nanbox_s(rs2, cpu_fpr[a->rs2]); + + /* + * Xor bit 31 in rs1 with that in rs2. + * This formulation retains the nanboxing of rs1. + */ + tcg_gen_andi_i64(rs2, rs2, MAKE_64BIT_MASK(31, 1)); + tcg_gen_xor_i64(cpu_fpr[a->rd], rs1, rs2); + + tcg_temp_free_i64(rs2); } + tcg_temp_free_i64(rs1); + mark_fs_dirty(ctx); return true; } @@ -378,11 +406,8 @@ static bool trans_fmv_w_x(DisasContext *ctx, arg_fmv_w_x *a) TCGv t0 = tcg_temp_new(); gen_get_gpr(t0, a->rs1); -#if defined(TARGET_RISCV64) - tcg_gen_mov_i64(cpu_fpr[a->rd], t0); -#else - tcg_gen_extu_i32_i64(cpu_fpr[a->rd], t0); -#endif + tcg_gen_extu_tl_i64(cpu_fpr[a->rd], t0); + gen_nanbox_s(cpu_fpr[a->rd], cpu_fpr[a->rd]); mark_fs_dirty(ctx); tcg_temp_free(t0); diff --git a/target/riscv/insn_trans/trans_rvh.inc.c b/target/riscv/insn_trans/trans_rvh.c.inc index 263b652d90..263b652d90 100644 --- a/target/riscv/insn_trans/trans_rvh.inc.c +++ b/target/riscv/insn_trans/trans_rvh.c.inc diff --git a/target/riscv/insn_trans/trans_rvi.inc.c b/target/riscv/insn_trans/trans_rvi.c.inc index d04ca0394c..d04ca0394c 100644 --- a/target/riscv/insn_trans/trans_rvi.inc.c +++ b/target/riscv/insn_trans/trans_rvi.c.inc diff --git a/target/riscv/insn_trans/trans_rvm.inc.c b/target/riscv/insn_trans/trans_rvm.c.inc index 47cd6edc72..47cd6edc72 100644 --- a/target/riscv/insn_trans/trans_rvm.inc.c +++ b/target/riscv/insn_trans/trans_rvm.c.inc diff --git a/target/riscv/insn_trans/trans_rvv.inc.c b/target/riscv/insn_trans/trans_rvv.c.inc index 887c6b8883..887c6b8883 100644 --- a/target/riscv/insn_trans/trans_rvv.inc.c +++ b/target/riscv/insn_trans/trans_rvv.c.inc diff --git a/target/riscv/internals.h b/target/riscv/internals.h index 37d33820ad..f1a546dba6 100644 --- a/target/riscv/internals.h +++ b/target/riscv/internals.h @@ -38,4 +38,20 @@ target_ulong fclass_d(uint64_t frs1); #define SEW32 2 #define SEW64 3 +static inline uint64_t nanbox_s(float32 f) +{ + return f | MAKE_64BIT_MASK(32, 32); +} + +static inline float32 check_nanbox_s(uint64_t f) +{ + uint64_t mask = MAKE_64BIT_MASK(32, 32); + + if (likely((f & mask) == mask)) { + return (uint32_t)f; + } else { + return 0x7fc00000u; /* default qnan */ + } +} + #endif diff --git a/target/riscv/meson.build b/target/riscv/meson.build new file mode 100644 index 0000000000..abd647fea1 --- /dev/null +++ b/target/riscv/meson.build @@ -0,0 +1,34 @@ +# FIXME extra_args should accept files() +dir = meson.current_source_dir() +gen32 = [ + decodetree.process('insn16.decode', extra_args: [dir / 'insn16-32.decode', '--static-decode=decode_insn16', '--insnwidth=16']), + decodetree.process('insn32.decode', extra_args: '--static-decode=decode_insn32'), +] + +gen64 = [ + decodetree.process('insn16.decode', extra_args: [dir / 'insn16-64.decode', '--static-decode=decode_insn16', '--insnwidth=16']), + decodetree.process('insn32.decode', extra_args: [dir / 'insn32-64.decode', '--static-decode=decode_insn32']), +] + +riscv_ss = ss.source_set() +riscv_ss.add(when: 'TARGET_RISCV32', if_true: gen32) +riscv_ss.add(when: 'TARGET_RISCV64', if_true: gen64) +riscv_ss.add(files( + 'cpu.c', + 'cpu_helper.c', + 'csr.c', + 'fpu_helper.c', + 'gdbstub.c', + 'op_helper.c', + 'vector_helper.c', + 'translate.c', +)) + +riscv_softmmu_ss = ss.source_set() +riscv_softmmu_ss.add(files( + 'pmp.c', + 'monitor.c' +)) + +target_arch += {'riscv': riscv_ss} +target_softmmu_arch += {'riscv': riscv_softmmu_ss} diff --git a/target/riscv/pmp.c b/target/riscv/pmp.c index 2a2b9f5363..c394e867f8 100644 --- a/target/riscv/pmp.c +++ b/target/riscv/pmp.c @@ -320,8 +320,7 @@ void pmpcfg_csr_write(CPURISCVState *env, uint32_t reg_index, for (i = 0; i < sizeof(target_ulong); i++) { cfg_val = (val >> 8 * i) & 0xff; - pmp_write_cfg(env, (reg_index * sizeof(target_ulong)) + i, - cfg_val); + pmp_write_cfg(env, (reg_index * 4) + i, cfg_val); } } @@ -336,7 +335,7 @@ target_ulong pmpcfg_csr_read(CPURISCVState *env, uint32_t reg_index) target_ulong val = 0; for (i = 0; i < sizeof(target_ulong); i++) { - val = pmp_read_cfg(env, (reg_index * sizeof(target_ulong)) + i); + val = pmp_read_cfg(env, (reg_index * 4) + i); cfg_val |= (val << (i * 8)); } trace_pmpcfg_csr_read(env->mhartid, reg_index, cfg_val); @@ -384,3 +383,55 @@ target_ulong pmpaddr_csr_read(CPURISCVState *env, uint32_t addr_index) return val; } + +/* + * Calculate the TLB size if the start address or the end address of + * PMP entry is presented in thie TLB page. + */ +static target_ulong pmp_get_tlb_size(CPURISCVState *env, int pmp_index, + target_ulong tlb_sa, target_ulong tlb_ea) +{ + target_ulong pmp_sa = env->pmp_state.addr[pmp_index].sa; + target_ulong pmp_ea = env->pmp_state.addr[pmp_index].ea; + + if (pmp_sa >= tlb_sa && pmp_ea <= tlb_ea) { + return pmp_ea - pmp_sa + 1; + } + + if (pmp_sa >= tlb_sa && pmp_sa <= tlb_ea && pmp_ea >= tlb_ea) { + return tlb_ea - pmp_sa + 1; + } + + if (pmp_ea <= tlb_ea && pmp_ea >= tlb_sa && pmp_sa <= tlb_sa) { + return pmp_ea - tlb_sa + 1; + } + + return 0; +} + +/* + * Check is there a PMP entry which range covers this page. If so, + * try to find the minimum granularity for the TLB size. + */ +bool pmp_is_range_in_tlb(CPURISCVState *env, hwaddr tlb_sa, + target_ulong *tlb_size) +{ + int i; + target_ulong val; + target_ulong tlb_ea = (tlb_sa + TARGET_PAGE_SIZE - 1); + + for (i = 0; i < MAX_RISCV_PMPS; i++) { + val = pmp_get_tlb_size(env, i, tlb_sa, tlb_ea); + if (val) { + if (*tlb_size == 0 || *tlb_size > val) { + *tlb_size = val; + } + } + } + + if (*tlb_size != 0) { + return true; + } + + return false; +} diff --git a/target/riscv/pmp.h b/target/riscv/pmp.h index 8e19793132..6a8f072871 100644 --- a/target/riscv/pmp.h +++ b/target/riscv/pmp.h @@ -60,5 +60,7 @@ void pmpaddr_csr_write(CPURISCVState *env, uint32_t addr_index, target_ulong pmpaddr_csr_read(CPURISCVState *env, uint32_t addr_index); bool pmp_hart_has_privs(CPURISCVState *env, target_ulong addr, target_ulong size, pmp_priv_t priv, target_ulong mode); +bool pmp_is_range_in_tlb(CPURISCVState *env, hwaddr tlb_sa, + target_ulong *tlb_size); #endif diff --git a/target/riscv/trace.h b/target/riscv/trace.h new file mode 100644 index 0000000000..03a89fcd9b --- /dev/null +++ b/target/riscv/trace.h @@ -0,0 +1 @@ +#include "trace/trace-target_riscv.h" diff --git a/target/riscv/translate.c b/target/riscv/translate.c index 9632e79cf3..3919f570f7 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -90,6 +90,35 @@ static inline bool has_ext(DisasContext *ctx, uint32_t ext) return ctx->misa & ext; } +/* + * RISC-V requires NaN-boxing of narrower width floating point values. + * This applies when a 32-bit value is assigned to a 64-bit FP register. + * For consistency and simplicity, we nanbox results even when the RVD + * extension is not present. + */ +static void gen_nanbox_s(TCGv_i64 out, TCGv_i64 in) +{ + tcg_gen_ori_i64(out, in, MAKE_64BIT_MASK(32, 32)); +} + +/* + * A narrow n-bit operation, where n < FLEN, checks that input operands + * are correctly Nan-boxed, i.e., all upper FLEN - n bits are 1. + * If so, the least-significant bits of the input are used, otherwise the + * input value is treated as an n-bit canonical NaN (v2.2 section 9.2). + * + * Here, the result is always nan-boxed, even the canonical nan. + */ +static void gen_check_nanbox_s(TCGv_i64 out, TCGv_i64 in) +{ + TCGv_i64 t_max = tcg_const_i64(0xffffffff00000000ull); + TCGv_i64 t_nan = tcg_const_i64(0xffffffff7fc00000ull); + + tcg_gen_movcond_i64(TCG_COND_GEU, out, in, t_max, in, t_nan); + tcg_temp_free_i64(t_max); + tcg_temp_free_i64(t_nan); +} + static void generate_exception(DisasContext *ctx, int excp) { tcg_gen_movi_tl(cpu_pc, ctx->base.pc_next); @@ -583,7 +612,7 @@ static int ex_rvc_shifti(DisasContext *ctx, int imm) } /* Include the auto-generated decoder for 32 bit insn */ -#include "decode_insn32.inc.c" +#include "decode-insn32.c.inc" static bool gen_arith_imm_fn(DisasContext *ctx, arg_i *a, void (*func)(TCGv, TCGv, target_long)) @@ -718,17 +747,17 @@ static bool gen_shift(DisasContext *ctx, arg_r *a, } /* Include insn module translation function */ -#include "insn_trans/trans_rvi.inc.c" -#include "insn_trans/trans_rvm.inc.c" -#include "insn_trans/trans_rva.inc.c" -#include "insn_trans/trans_rvf.inc.c" -#include "insn_trans/trans_rvd.inc.c" -#include "insn_trans/trans_rvh.inc.c" -#include "insn_trans/trans_rvv.inc.c" -#include "insn_trans/trans_privileged.inc.c" +#include "insn_trans/trans_rvi.c.inc" +#include "insn_trans/trans_rvm.c.inc" +#include "insn_trans/trans_rva.c.inc" +#include "insn_trans/trans_rvf.c.inc" +#include "insn_trans/trans_rvd.c.inc" +#include "insn_trans/trans_rvh.c.inc" +#include "insn_trans/trans_rvv.c.inc" +#include "insn_trans/trans_privileged.c.inc" /* Include the auto-generated decoder for 16 bit insn */ -#include "decode_insn16.inc.c" +#include "decode-insn16.c.inc" static void decode_opc(CPURISCVState *env, DisasContext *ctx, uint16_t opcode) { diff --git a/target/rx/Makefile.objs b/target/rx/Makefile.objs deleted file mode 100644 index a0018d5bc5..0000000000 --- a/target/rx/Makefile.objs +++ /dev/null @@ -1,11 +0,0 @@ -obj-y += translate.o op_helper.o helper.o cpu.o gdbstub.o disas.o - -DECODETREE = $(SRC_PATH)/scripts/decodetree.py - -target/rx/decode.inc.c: \ - $(SRC_PATH)/target/rx/insns.decode $(DECODETREE) - $(call quiet-command,\ - $(PYTHON) $(DECODETREE) --varinsnwidth 32 -o $@ $<, "GEN", $(TARGET_DIR)$@) - -target/rx/translate.o: target/rx/decode.inc.c -target/rx/disas.o: target/rx/decode.inc.c diff --git a/target/rx/disas.c b/target/rx/disas.c index 6dee7a0342..67b9328829 100644 --- a/target/rx/disas.c +++ b/target/rx/disas.c @@ -100,7 +100,7 @@ static int bdsp_s(DisasContext *ctx, int d) } /* Include the auto-generated decoder. */ -#include "decode.inc.c" +#include "decode-insns.c.inc" static void dump_bytes(DisasContext *ctx) { diff --git a/target/rx/meson.build b/target/rx/meson.build new file mode 100644 index 0000000000..8de0ad49b9 --- /dev/null +++ b/target/rx/meson.build @@ -0,0 +1,16 @@ +gen = [ + decodetree.process('insns.decode', extra_args: [ '--varinsnwidth', '32' ]) +] + +rx_ss = ss.source_set() +rx_ss.add(gen) +rx_ss.add(files( + 'translate.c', + 'op_helper.c', + 'helper.c', + 'cpu.c', + 'gdbstub.c', + 'disas.c')) + +target_arch += {'rx': rx_ss} +target_softmmu_arch += {'rx': ss.source_set()} diff --git a/target/rx/translate.c b/target/rx/translate.c index 61e86653a4..da9713d362 100644 --- a/target/rx/translate.c +++ b/target/rx/translate.c @@ -124,7 +124,7 @@ static int bdsp_s(DisasContext *ctx, int d) } /* Include the auto-generated decoder. */ -#include "decode.inc.c" +#include "decode-insns.c.inc" void rx_cpu_dump_state(CPUState *cs, FILE *f, int flags) { diff --git a/target/s390x/Makefile.objs b/target/s390x/Makefile.objs deleted file mode 100644 index 3e2745594a..0000000000 --- a/target/s390x/Makefile.objs +++ /dev/null @@ -1,30 +0,0 @@ -obj-y += cpu.o cpu_models.o cpu_features.o gdbstub.o interrupt.o helper.o -obj-$(CONFIG_TCG) += translate.o cc_helper.o excp_helper.o fpu_helper.o -obj-$(CONFIG_TCG) += int_helper.o mem_helper.o misc_helper.o crypto_helper.o -obj-$(CONFIG_TCG) += vec_helper.o vec_int_helper.o vec_string_helper.o -obj-$(CONFIG_TCG) += vec_fpu_helper.o -obj-$(CONFIG_SOFTMMU) += machine.o ioinst.o arch_dump.o mmu_helper.o diag.o -obj-$(CONFIG_SOFTMMU) += sigp.o -obj-$(CONFIG_KVM) += kvm.o -obj-$(call lnot,$(CONFIG_KVM)) += kvm-stub.o -obj-$(call lnot,$(CONFIG_TCG)) += tcg-stub.o - -# build and run feature list generator -feat-src = $(SRC_PATH)/target/$(TARGET_BASE_ARCH)/ -feat-dst = $(BUILD_DIR)/$(TARGET_DIR) -ifneq ($(MAKECMDGOALS),clean) -generated-files-y += $(feat-dst)gen-features.h -endif - -$(feat-dst)gen-features.h: $(feat-dst)gen-features.h-timestamp - @cmp $< $@ >/dev/null 2>&1 || cp $< $@ -$(feat-dst)gen-features.h-timestamp: $(feat-dst)gen-features - $(call quiet-command,$< >$@,"GEN","$(TARGET_DIR)gen-features.h") - -$(feat-dst)gen-features: $(feat-src)gen-features.c - $(call quiet-command,$(HOST_CC) $(QEMU_INCLUDES) -o $@ $<,"CC","$(TARGET_DIR)gen-features") - -clean-target: - rm -f gen-features.h-timestamp - rm -f gen-features.h - rm -f gen-features diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c index 9f817e3cfa..31ea8df246 100644 --- a/target/s390x/cpu_features.c +++ b/target/s390x/cpu_features.c @@ -23,7 +23,7 @@ .desc = _DESC, \ }, static const S390FeatDef s390_features[S390_FEAT_MAX] = { - #include "cpu_features_def.inc.h" + #include "cpu_features_def.h.inc" }; #undef DEF_FEAT diff --git a/target/s390x/cpu_features.h b/target/s390x/cpu_features.h index da695a8346..2a29475493 100644 --- a/target/s390x/cpu_features.h +++ b/target/s390x/cpu_features.h @@ -16,7 +16,7 @@ #include "qemu/bitmap.h" #include "cpu_features_def.h" -#include "gen-features.h" +#include "target/s390x/gen-features.h" /* CPU features are announced via different ways */ typedef enum { diff --git a/target/s390x/cpu_features_def.h b/target/s390x/cpu_features_def.h index 412d356feb..87df31848e 100644 --- a/target/s390x/cpu_features_def.h +++ b/target/s390x/cpu_features_def.h @@ -17,7 +17,7 @@ #define DEF_FEAT(_FEAT, ...) S390_FEAT_##_FEAT, typedef enum { - #include "cpu_features_def.inc.h" + #include "cpu_features_def.h.inc" S390_FEAT_MAX, } S390Feat; #undef DEF_FEAT diff --git a/target/s390x/cpu_features_def.inc.h b/target/s390x/cpu_features_def.h.inc index 5942f81f16..5942f81f16 100644 --- a/target/s390x/cpu_features_def.inc.h +++ b/target/s390x/cpu_features_def.h.inc diff --git a/target/s390x/cpu_models.h b/target/s390x/cpu_models.h index 88bd01a616..74d1f87e4f 100644 --- a/target/s390x/cpu_models.h +++ b/target/s390x/cpu_models.h @@ -14,7 +14,7 @@ #define TARGET_S390X_CPU_MODELS_H #include "cpu_features.h" -#include "gen-features.h" +#include "target/s390x/gen-features.h" #include "hw/core/cpu.h" /* static CPU definition */ diff --git a/target/s390x/meson.build b/target/s390x/meson.build new file mode 100644 index 0000000000..c42eadb7d2 --- /dev/null +++ b/target/s390x/meson.build @@ -0,0 +1,62 @@ +s390x_ss = ss.source_set() +s390x_ss.add(files( + 'cpu.c', + 'cpu_features.c', + 'cpu_models.c', + 'gdbstub.c', + 'helper.c', + 'interrupt.c', +)) + +s390x_ss.add(when: 'CONFIG_TCG', if_true: files( + 'cc_helper.c', + 'crypto_helper.c', + 'excp_helper.c', + 'fpu_helper.c', + 'int_helper.c', + 'mem_helper.c', + 'misc_helper.c', + 'translate.c', + 'vec_fpu_helper.c', + 'vec_helper.c', + 'vec_int_helper.c', + 'vec_string_helper.c', +), if_false: files('tcg-stub.c')) + +s390x_ss.add(when: 'CONFIG_KVM', if_true: files('kvm.c'), if_false: files('kvm-stub.c')) + +gen_features = executable('gen-features', 'gen-features.c', native: true, + build_by_default: false) + +gen_features_h = custom_target('gen-features.h', + output: 'gen-features.h', + capture: true, + command: gen_features) + +s390x_ss.add(gen_features_h) + +s390x_softmmu_ss = ss.source_set() +s390x_softmmu_ss.add(files( + 'arch_dump.c', + 'diag.c', + 'ioinst.c', + 'machine.c', + 'mmu_helper.c', + 'sigp.c', +)) + +# Newer kernels on s390 check for an S390_PGSTE program header and +# enable the pgste page table extensions in that case. This makes +# the vm.allocate_pgste sysctl unnecessary. We enable this program +# header if +# - we build on s390x +# - we build the system emulation for s390x (qemu-system-s390x) +# - KVM is enabled +# - the linker supports --s390-pgste +if host_machine.cpu_family() == 's390x' and cc.has_link_argument('-Wl,--s390-pgste') + s390x_softmmu_ss.add(when: 'CONFIG_KVM', + if_true: declare_dependency(link_args: ['-Wl,--s390-pgste'])) +endif + +target_arch += {'s390x': s390x_ss} +target_softmmu_arch += {'s390x': s390x_softmmu_ss} diff --git a/target/s390x/trace.h b/target/s390x/trace.h new file mode 100644 index 0000000000..d7d59d4aba --- /dev/null +++ b/target/s390x/trace.h @@ -0,0 +1 @@ +#include "trace/trace-target_s390x.h" diff --git a/target/s390x/translate.c b/target/s390x/translate.c index 4f6f1e31cd..a777343821 100644 --- a/target/s390x/translate.c +++ b/target/s390x/translate.c @@ -5120,7 +5120,7 @@ static DisasJumpType op_mpcifc(DisasContext *s, DisasOps *o) } #endif -#include "translate_vx.inc.c" +#include "translate_vx.c.inc" /* ====================================================================== */ /* The "Cc OUTput" generators. Given the generated output (and in some cases diff --git a/target/s390x/translate_vx.inc.c b/target/s390x/translate_vx.c.inc index eb767f5288..eb767f5288 100644 --- a/target/s390x/translate_vx.inc.c +++ b/target/s390x/translate_vx.c.inc diff --git a/target/sh4/Makefile.objs b/target/sh4/Makefile.objs deleted file mode 100644 index 2c25d96e65..0000000000 --- a/target/sh4/Makefile.objs +++ /dev/null @@ -1,3 +0,0 @@ -obj-y += translate.o op_helper.o helper.o cpu.o -obj-$(CONFIG_SOFTMMU) += monitor.o -obj-y += gdbstub.o diff --git a/target/sh4/meson.build b/target/sh4/meson.build new file mode 100644 index 0000000000..56a57576da --- /dev/null +++ b/target/sh4/meson.build @@ -0,0 +1,14 @@ +sh4_ss = ss.source_set() +sh4_ss.add(files( + 'cpu.c', + 'gdbstub.c', + 'helper.c', + 'op_helper.c', + 'translate.c', +)) + +sh4_softmmu_ss = ss.source_set() +sh4_softmmu_ss.add(files('monitor.c')) + +target_arch += {'sh4': sh4_ss} +target_softmmu_arch += {'sh4': sh4_softmmu_ss} diff --git a/target/sparc/Makefile.objs b/target/sparc/Makefile.objs deleted file mode 100644 index ec905698c5..0000000000 --- a/target/sparc/Makefile.objs +++ /dev/null @@ -1,7 +0,0 @@ -obj-$(CONFIG_SOFTMMU) += machine.o monitor.o -obj-y += translate.o helper.o cpu.o -obj-y += fop_helper.o cc_helper.o win_helper.o mmu_helper.o ldst_helper.o -obj-$(TARGET_SPARC) += int32_helper.o -obj-$(TARGET_SPARC64) += int64_helper.o -obj-$(TARGET_SPARC64) += vis_helper.o -obj-y += gdbstub.o diff --git a/target/sparc/meson.build b/target/sparc/meson.build new file mode 100644 index 0000000000..a3638b9503 --- /dev/null +++ b/target/sparc/meson.build @@ -0,0 +1,23 @@ +sparc_ss = ss.source_set() +sparc_ss.add(files( + 'cc_helper.c', + 'cpu.c', + 'fop_helper.c', + 'gdbstub.c', + 'helper.c', + 'ldst_helper.c', + 'mmu_helper.c', + 'translate.c', + 'win_helper.c', +)) +sparc_ss.add(when: 'TARGET_SPARC', if_true: files('int32_helper.c')) +sparc_ss.add(when: 'TARGET_SPARC64', if_true: files('int64_helper.c', 'vis_helper.c')) + +sparc_softmmu_ss = ss.source_set() +sparc_softmmu_ss.add(files( + 'machine.c', + 'monitor.c', +)) + +target_arch += {'sparc': sparc_ss} +target_softmmu_arch += {'sparc': sparc_softmmu_ss} diff --git a/target/sparc/trace.h b/target/sparc/trace.h new file mode 100644 index 0000000000..3b2f5a8e29 --- /dev/null +++ b/target/sparc/trace.h @@ -0,0 +1 @@ +#include "trace/trace-target_sparc.h" diff --git a/target/tilegx/Makefile.objs b/target/tilegx/Makefile.objs deleted file mode 100644 index 0db778f407..0000000000 --- a/target/tilegx/Makefile.objs +++ /dev/null @@ -1 +0,0 @@ -obj-y += cpu.o translate.o helper.o simd_helper.o diff --git a/target/tilegx/meson.build b/target/tilegx/meson.build new file mode 100644 index 0000000000..678590439c --- /dev/null +++ b/target/tilegx/meson.build @@ -0,0 +1,13 @@ +tilegx_ss = ss.source_set() +tilegx_ss.add(files( + 'cpu.c', + 'helper.c', + 'simd_helper.c', + 'translate.c', +)) +tilegx_ss.add(zlib) + +tilegx_softmmu_ss = ss.source_set() + +target_arch += {'tilegx': tilegx_ss} +target_softmmu_arch += {'tilegx': tilegx_softmmu_ss} diff --git a/target/tricore/Makefile.objs b/target/tricore/Makefile.objs deleted file mode 100644 index 281b55f08d..0000000000 --- a/target/tricore/Makefile.objs +++ /dev/null @@ -1 +0,0 @@ -obj-y += translate.o helper.o cpu.o op_helper.o fpu_helper.o gdbstub.o diff --git a/target/tricore/meson.build b/target/tricore/meson.build new file mode 100644 index 0000000000..0ccc829517 --- /dev/null +++ b/target/tricore/meson.build @@ -0,0 +1,15 @@ +tricore_ss = ss.source_set() +tricore_ss.add(files( + 'cpu.c', + 'fpu_helper.c', + 'helper.c', + 'op_helper.c', + 'translate.c', + 'gdbstub.c', +)) +tricore_ss.add(zlib) + +tricore_softmmu_ss = ss.source_set() + +target_arch += {'tricore': tricore_ss} +target_softmmu_arch += {'tricore': tricore_softmmu_ss} diff --git a/target/unicore32/Makefile.objs b/target/unicore32/Makefile.objs deleted file mode 100644 index 35d8bf530d..0000000000 --- a/target/unicore32/Makefile.objs +++ /dev/null @@ -1,8 +0,0 @@ -obj-y += translate.o op_helper.o helper.o cpu.o -obj-y += ucf64_helper.o - -obj-$(CONFIG_SOFTMMU) += softmmu.o - -# Huh? Uses curses directly instead of using ui/console.h interfaces ... -helper.o-cflags := $(CURSES_CFLAGS) -helper.o-libs := $(CURSES_LIBS) diff --git a/target/unicore32/meson.build b/target/unicore32/meson.build new file mode 100644 index 0000000000..0fa78772eb --- /dev/null +++ b/target/unicore32/meson.build @@ -0,0 +1,14 @@ +unicore32_ss = ss.source_set() +unicore32_ss.add(files( + 'cpu.c', + 'helper.c', + 'op_helper.c', + 'translate.c', + 'ucf64_helper.c', +), curses) + +unicore32_softmmu_ss = ss.source_set() +unicore32_softmmu_ss.add(files('softmmu.c')) + +target_arch += {'unicore32': unicore32_ss} +target_softmmu_arch += {'unicore32': unicore32_softmmu_ss} diff --git a/target/xtensa/Makefile.objs b/target/xtensa/Makefile.objs deleted file mode 100644 index c7e7fe6063..0000000000 --- a/target/xtensa/Makefile.objs +++ /dev/null @@ -1,16 +0,0 @@ -obj-y += core-dc232b.o -obj-y += core-dc233c.o -obj-y += core-de212.o -obj-y += core-fsf.o -obj-y += core-sample_controller.o -obj-y += core-test_kc705_be.o -obj-y += core-test_mmuhifi_c3.o -obj-$(CONFIG_SOFTMMU) += monitor.o xtensa-semi.o -obj-y += xtensa-isa.o -obj-y += translate.o op_helper.o helper.o cpu.o -obj-$(CONFIG_SOFTMMU) += dbg_helper.o -obj-y += exc_helper.o -obj-y += fpu_helper.o -obj-y += gdbstub.o -obj-$(CONFIG_SOFTMMU) += mmu_helper.o -obj-y += win_helper.o diff --git a/target/xtensa/core-dc232b.c b/target/xtensa/core-dc232b.c index 7851bcb636..c982d09c24 100644 --- a/target/xtensa/core-dc232b.c +++ b/target/xtensa/core-dc232b.c @@ -35,13 +35,13 @@ #include "overlay_tool.h" #define xtensa_modules xtensa_modules_dc232b -#include "core-dc232b/xtensa-modules.inc.c" +#include "core-dc232b/xtensa-modules.c.inc" static XtensaConfig dc232b __attribute__((unused)) = { .name = "dc232b", .gdb_regmap = { .reg = { -#include "core-dc232b/gdb-config.inc.c" +#include "core-dc232b/gdb-config.c.inc" } }, .isa_internal = &xtensa_modules, diff --git a/target/xtensa/core-dc232b/gdb-config.inc.c b/target/xtensa/core-dc232b/gdb-config.c.inc index d87168628b..d87168628b 100644 --- a/target/xtensa/core-dc232b/gdb-config.inc.c +++ b/target/xtensa/core-dc232b/gdb-config.c.inc diff --git a/target/xtensa/core-dc232b/xtensa-modules.inc.c b/target/xtensa/core-dc232b/xtensa-modules.c.inc index 164df3b1a4..164df3b1a4 100644 --- a/target/xtensa/core-dc232b/xtensa-modules.inc.c +++ b/target/xtensa/core-dc232b/xtensa-modules.c.inc diff --git a/target/xtensa/core-dc233c.c b/target/xtensa/core-dc233c.c index f8204f7045..595ab9a90f 100644 --- a/target/xtensa/core-dc233c.c +++ b/target/xtensa/core-dc233c.c @@ -34,13 +34,13 @@ #include "overlay_tool.h" #define xtensa_modules xtensa_modules_dc233c -#include "core-dc233c/xtensa-modules.inc.c" +#include "core-dc233c/xtensa-modules.c.inc" static XtensaConfig dc233c __attribute__((unused)) = { .name = "dc233c", .gdb_regmap = { .reg = { -#include "core-dc233c/gdb-config.inc.c" +#include "core-dc233c/gdb-config.c.inc" } }, .isa_internal = &xtensa_modules, diff --git a/target/xtensa/core-dc233c/gdb-config.inc.c b/target/xtensa/core-dc233c/gdb-config.c.inc index 7e8963227f..7e8963227f 100644 --- a/target/xtensa/core-dc233c/gdb-config.inc.c +++ b/target/xtensa/core-dc233c/gdb-config.c.inc diff --git a/target/xtensa/core-dc233c/xtensa-modules.inc.c b/target/xtensa/core-dc233c/xtensa-modules.c.inc index 0f32f0804a..0f32f0804a 100644 --- a/target/xtensa/core-dc233c/xtensa-modules.inc.c +++ b/target/xtensa/core-dc233c/xtensa-modules.c.inc diff --git a/target/xtensa/core-de212.c b/target/xtensa/core-de212.c index a061158f6e..50c995ba79 100644 --- a/target/xtensa/core-de212.c +++ b/target/xtensa/core-de212.c @@ -34,13 +34,13 @@ #include "overlay_tool.h" #define xtensa_modules xtensa_modules_de212 -#include "core-de212/xtensa-modules.inc.c" +#include "core-de212/xtensa-modules.c.inc" static XtensaConfig de212 __attribute__((unused)) = { .name = "de212", .gdb_regmap = { .reg = { -#include "core-de212/gdb-config.inc.c" +#include "core-de212/gdb-config.c.inc" } }, .isa_internal = &xtensa_modules, diff --git a/target/xtensa/core-de212/gdb-config.inc.c b/target/xtensa/core-de212/gdb-config.c.inc index 25510fc34c..25510fc34c 100644 --- a/target/xtensa/core-de212/gdb-config.inc.c +++ b/target/xtensa/core-de212/gdb-config.c.inc diff --git a/target/xtensa/core-de212/xtensa-modules.inc.c b/target/xtensa/core-de212/xtensa-modules.c.inc index 480c68d3c6..480c68d3c6 100644 --- a/target/xtensa/core-de212/xtensa-modules.inc.c +++ b/target/xtensa/core-de212/xtensa-modules.c.inc diff --git a/target/xtensa/core-fsf.c b/target/xtensa/core-fsf.c index 1221a296fa..3327c50b4f 100644 --- a/target/xtensa/core-fsf.c +++ b/target/xtensa/core-fsf.c @@ -34,7 +34,7 @@ #include "overlay_tool.h" #define xtensa_modules xtensa_modules_fsf -#include "core-fsf/xtensa-modules.inc.c" +#include "core-fsf/xtensa-modules.c.inc" static XtensaConfig fsf __attribute__((unused)) = { .name = "fsf", diff --git a/target/xtensa/core-fsf/xtensa-modules.inc.c b/target/xtensa/core-fsf/xtensa-modules.c.inc index c32683ff77..c32683ff77 100644 --- a/target/xtensa/core-fsf/xtensa-modules.inc.c +++ b/target/xtensa/core-fsf/xtensa-modules.c.inc diff --git a/target/xtensa/core-sample_controller.c b/target/xtensa/core-sample_controller.c index a1d220bb9a..fd5de5576b 100644 --- a/target/xtensa/core-sample_controller.c +++ b/target/xtensa/core-sample_controller.c @@ -34,13 +34,13 @@ #include "overlay_tool.h" #define xtensa_modules xtensa_modules_sample_controller -#include "core-sample_controller/xtensa-modules.inc.c" +#include "core-sample_controller/xtensa-modules.c.inc" static XtensaConfig sample_controller __attribute__((unused)) = { .name = "sample_controller", .gdb_regmap = { .reg = { -#include "core-sample_controller/gdb-config.inc.c" +#include "core-sample_controller/gdb-config.c.inc" } }, .isa_internal = &xtensa_modules, diff --git a/target/xtensa/core-sample_controller/gdb-config.inc.c b/target/xtensa/core-sample_controller/gdb-config.c.inc index 99e172d819..99e172d819 100644 --- a/target/xtensa/core-sample_controller/gdb-config.inc.c +++ b/target/xtensa/core-sample_controller/gdb-config.c.inc diff --git a/target/xtensa/core-sample_controller/xtensa-modules.inc.c b/target/xtensa/core-sample_controller/xtensa-modules.c.inc index 7e87d216bd..7e87d216bd 100644 --- a/target/xtensa/core-sample_controller/xtensa-modules.inc.c +++ b/target/xtensa/core-sample_controller/xtensa-modules.c.inc diff --git a/target/xtensa/core-test_kc705_be.c b/target/xtensa/core-test_kc705_be.c index ab73c3885f..294c16f2f4 100644 --- a/target/xtensa/core-test_kc705_be.c +++ b/target/xtensa/core-test_kc705_be.c @@ -34,13 +34,13 @@ #include "overlay_tool.h" #define xtensa_modules xtensa_modules_test_kc705_be -#include "core-test_kc705_be/xtensa-modules.inc.c" +#include "core-test_kc705_be/xtensa-modules.c.inc" static XtensaConfig test_kc705_be __attribute__((unused)) = { .name = "test_kc705_be", .gdb_regmap = { .reg = { -#include "core-test_kc705_be/gdb-config.inc.c" +#include "core-test_kc705_be/gdb-config.c.inc" } }, .isa_internal = &xtensa_modules, diff --git a/target/xtensa/core-test_kc705_be/gdb-config.inc.c b/target/xtensa/core-test_kc705_be/gdb-config.c.inc index eb3e03cd52..eb3e03cd52 100644 --- a/target/xtensa/core-test_kc705_be/gdb-config.inc.c +++ b/target/xtensa/core-test_kc705_be/gdb-config.c.inc diff --git a/target/xtensa/core-test_kc705_be/xtensa-modules.inc.c b/target/xtensa/core-test_kc705_be/xtensa-modules.c.inc index bc7cf44828..bc7cf44828 100644 --- a/target/xtensa/core-test_kc705_be/xtensa-modules.inc.c +++ b/target/xtensa/core-test_kc705_be/xtensa-modules.c.inc diff --git a/target/xtensa/core-test_mmuhifi_c3.c b/target/xtensa/core-test_mmuhifi_c3.c index 089ed7da5d..123c630b0d 100644 --- a/target/xtensa/core-test_mmuhifi_c3.c +++ b/target/xtensa/core-test_mmuhifi_c3.c @@ -35,13 +35,13 @@ #include "overlay_tool.h" #define xtensa_modules xtensa_modules_test_mmuhifi_c3 -#include "core-test_mmuhifi_c3/xtensa-modules.inc.c" +#include "core-test_mmuhifi_c3/xtensa-modules.c.inc" static XtensaConfig test_mmuhifi_c3 __attribute__((unused)) = { .name = "test_mmuhifi_c3", .gdb_regmap = { .reg = { -#include "core-test_mmuhifi_c3/gdb-config.inc.c" +#include "core-test_mmuhifi_c3/gdb-config.c.inc" } }, .isa_internal = &xtensa_modules, diff --git a/target/xtensa/core-test_mmuhifi_c3/gdb-config.inc.c b/target/xtensa/core-test_mmuhifi_c3/gdb-config.c.inc index 0bca70b5af..0bca70b5af 100644 --- a/target/xtensa/core-test_mmuhifi_c3/gdb-config.inc.c +++ b/target/xtensa/core-test_mmuhifi_c3/gdb-config.c.inc diff --git a/target/xtensa/core-test_mmuhifi_c3/xtensa-modules.inc.c b/target/xtensa/core-test_mmuhifi_c3/xtensa-modules.c.inc index 28561147fc..28561147fc 100644 --- a/target/xtensa/core-test_mmuhifi_c3/xtensa-modules.inc.c +++ b/target/xtensa/core-test_mmuhifi_c3/xtensa-modules.c.inc diff --git a/target/xtensa/import_core.sh b/target/xtensa/import_core.sh index 8f844cf9e2..c8626a8c02 100755 --- a/target/xtensa/import_core.sh +++ b/target/xtensa/import_core.sh @@ -23,7 +23,7 @@ tar -xf "$OVERLAY" -C "$TARGET" --strip-components=2 \ xtensa/config/core-isa.h \ xtensa/config/core-matmap.h tar -xf "$OVERLAY" -O gdb/xtensa-config.c | \ - sed -n '1,/*\//p;/XTREG/,/XTREG_END/p' > "$TARGET"/gdb-config.inc.c + sed -n '1,/*\//p;/XTREG/,/XTREG_END/p' > "$TARGET"/gdb-config.c.inc # # Fix up known issues in the xtensa-modules.c # @@ -35,7 +35,7 @@ tar -xf "$OVERLAY" -O binutils/xtensa-modules.c | \ -e '/^#include "ansidecl.h"/d' \ -e '/^Slot_[a-zA-Z0-9_]\+_decode (const xtensa_insnbuf insn)/,/^}/s/^ return 0;$/ return XTENSA_UNDEFINED;/' \ -e 's/#include <xtensa-isa.h>/#include "xtensa-isa.h"/' \ - > "$TARGET"/xtensa-modules.inc.c + > "$TARGET"/xtensa-modules.c.inc cat <<EOF > "${TARGET}.c" #include "qemu/osdep.h" @@ -49,13 +49,13 @@ cat <<EOF > "${TARGET}.c" #include "overlay_tool.h" #define xtensa_modules xtensa_modules_$NAME -#include "core-$NAME/xtensa-modules.inc.c" +#include "core-$NAME/xtensa-modules.c.inc" static XtensaConfig $NAME __attribute__((unused)) = { .name = "$NAME", .gdb_regmap = { .reg = { -#include "core-$NAME/gdb-config.inc.c" +#include "core-$NAME/gdb-config.c.inc" } }, .isa_internal = &xtensa_modules, diff --git a/target/xtensa/meson.build b/target/xtensa/meson.build new file mode 100644 index 0000000000..27e453e1d1 --- /dev/null +++ b/target/xtensa/meson.build @@ -0,0 +1,30 @@ +xtensa_ss = ss.source_set() +xtensa_ss.add(files( + 'core-dc232b.c', + 'core-dc233c.c', + 'core-de212.c', + 'core-fsf.c', + 'core-sample_controller.c', + 'core-test_kc705_be.c', + 'core-test_mmuhifi_c3.c', + 'cpu.c', + 'exc_helper.c', + 'fpu_helper.c', + 'gdbstub.c', + 'helper.c', + 'op_helper.c', + 'translate.c', + 'win_helper.c', + 'xtensa-isa.c', +)) + +xtensa_softmmu_ss = ss.source_set() +xtensa_softmmu_ss.add(files( + 'dbg_helper.c', + 'mmu_helper.c', + 'monitor.c', + 'xtensa-semi.c', +)) + +target_arch += {'xtensa': xtensa_ss} +target_softmmu_arch += {'xtensa': xtensa_softmmu_ss} diff --git a/tcg/README b/tcg/README index a64f67809b..2f051e5c97 100644 --- a/tcg/README +++ b/tcg/README @@ -652,7 +652,7 @@ function tcg_gen_xxx(args). 4) Backend -tcg-target.h contains the target specific definitions. tcg-target.inc.c +tcg-target.h contains the target specific definitions. tcg-target.c.inc contains the target specific code; it is #included by tcg/tcg.c, rather than being a standalone C file. diff --git a/tcg/aarch64/tcg-target.inc.c b/tcg/aarch64/tcg-target.c.inc index 760b0e742d..948c35d825 100644 --- a/tcg/aarch64/tcg-target.inc.c +++ b/tcg/aarch64/tcg-target.c.inc @@ -10,7 +10,7 @@ * See the COPYING file in the top-level directory for details. */ -#include "../tcg-pool.inc.c" +#include "../tcg-pool.c.inc" #include "qemu/bitops.h" /* We're going to re-use TCGType in setting of the SF bit, which controls @@ -1542,7 +1542,7 @@ static void tcg_out_cltz(TCGContext *s, TCGType ext, TCGReg d, } #ifdef CONFIG_SOFTMMU -#include "../tcg-ldst.inc.c" +#include "../tcg-ldst.c.inc" /* helper signature: helper_ret_ld_mmu(CPUState *env, target_ulong addr, * TCGMemOpIdx oi, uintptr_t ra) diff --git a/tcg/arm/tcg-target.inc.c b/tcg/arm/tcg-target.c.inc index 6aa7757aac..bc1e1b5a71 100644 --- a/tcg/arm/tcg-target.inc.c +++ b/tcg/arm/tcg-target.c.inc @@ -23,7 +23,7 @@ */ #include "elf.h" -#include "../tcg-pool.inc.c" +#include "../tcg-pool.c.inc" int arm_arch = __ARM_ARCH; @@ -1131,7 +1131,7 @@ static TCGCond tcg_out_cmp2(TCGContext *s, const TCGArg *args, } #ifdef CONFIG_SOFTMMU -#include "../tcg-ldst.inc.c" +#include "../tcg-ldst.c.inc" /* helper signature: helper_ret_ld_mmu(CPUState *env, target_ulong addr, * int mmu_idx, uintptr_t ra) diff --git a/tcg/i386/tcg-target.inc.c b/tcg/i386/tcg-target.c.inc index ae0228238b..0155c0691c 100644 --- a/tcg/i386/tcg-target.inc.c +++ b/tcg/i386/tcg-target.c.inc @@ -22,7 +22,7 @@ * THE SOFTWARE. */ -#include "../tcg-pool.inc.c" +#include "../tcg-pool.c.inc" #ifdef CONFIG_DEBUG_TCG static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { @@ -1647,7 +1647,7 @@ static void tcg_out_nopn(TCGContext *s, int n) } #if defined(CONFIG_SOFTMMU) -#include "../tcg-ldst.inc.c" +#include "../tcg-ldst.c.inc" /* helper signature: helper_ret_ld_mmu(CPUState *env, target_ulong addr, * int mmu_idx, uintptr_t ra) diff --git a/tcg/mips/tcg-target.inc.c b/tcg/mips/tcg-target.c.inc index 4d32ebc1df..bd5b8e09a0 100644 --- a/tcg/mips/tcg-target.inc.c +++ b/tcg/mips/tcg-target.c.inc @@ -1107,7 +1107,7 @@ static void tcg_out_call(TCGContext *s, tcg_insn_unit *arg) } #if defined(CONFIG_SOFTMMU) -#include "../tcg-ldst.inc.c" +#include "../tcg-ldst.c.inc" static void * const qemu_ld_helpers[16] = { [MO_UB] = helper_ret_ldub_mmu, diff --git a/tcg/ppc/tcg-target.inc.c b/tcg/ppc/tcg-target.c.inc index c8d1e765d9..393c4b30e0 100644 --- a/tcg/ppc/tcg-target.inc.c +++ b/tcg/ppc/tcg-target.c.inc @@ -23,7 +23,7 @@ */ #include "elf.h" -#include "../tcg-pool.inc.c" +#include "../tcg-pool.c.inc" #if defined _CALL_DARWIN || defined __APPLE__ #define TCG_TARGET_CALL_DARWIN @@ -564,6 +564,7 @@ static int tcg_target_const_match(tcg_target_long val, TCGType type, #define VMULOUH VX4(72) #define VMULOUW VX4(136) /* v2.07 */ #define VMULUWM VX4(137) /* v2.07 */ +#define VMULLD VX4(457) /* v3.10 */ #define VMSUMUHM VX4(38) #define VMRGHB VX4(12) @@ -1845,7 +1846,7 @@ static const uint32_t qemu_exts_opc[4] = { }; #if defined (CONFIG_SOFTMMU) -#include "../tcg-ldst.inc.c" +#include "../tcg-ldst.c.inc" /* helper signature: helper_ld_mmu(CPUState *env, target_ulong addr, * int mmu_idx, uintptr_t ra) @@ -3022,6 +3023,8 @@ int tcg_can_emit_vec_op(TCGOpcode opc, TCGType type, unsigned vece) return -1; case MO_32: return have_isa_2_07 ? 1 : -1; + case MO_64: + return have_isa_3_10; } return 0; case INDEX_op_bitsel_vec: @@ -3158,6 +3161,7 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, static const uint32_t add_op[4] = { VADDUBM, VADDUHM, VADDUWM, VADDUDM }, sub_op[4] = { VSUBUBM, VSUBUHM, VSUBUWM, VSUBUDM }, + mul_op[4] = { 0, 0, VMULUWM, VMULLD }, neg_op[4] = { 0, 0, VNEGW, VNEGD }, eq_op[4] = { VCMPEQUB, VCMPEQUH, VCMPEQUW, VCMPEQUD }, ne_op[4] = { VCMPNEB, VCMPNEH, VCMPNEW, 0 }, @@ -3208,8 +3212,7 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, a1 = 0; break; case INDEX_op_mul_vec: - tcg_debug_assert(vece == MO_32 && have_isa_2_07); - insn = VMULUWM; + insn = mul_op[vece]; break; case INDEX_op_ssadd_vec: insn = ssadd_op[vece]; @@ -3729,6 +3732,11 @@ static void tcg_target_init(TCGContext *s) have_isa = tcg_isa_3_00; } #endif +#ifdef PPC_FEATURE2_ARCH_3_10 + if (hwcap2 & PPC_FEATURE2_ARCH_3_10) { + have_isa = tcg_isa_3_10; + } +#endif #ifdef PPC_FEATURE2_HAS_ISEL /* Prefer explicit instruction from the kernel. */ diff --git a/tcg/ppc/tcg-target.h b/tcg/ppc/tcg-target.h index be5b2901c3..aee38157a2 100644 --- a/tcg/ppc/tcg-target.h +++ b/tcg/ppc/tcg-target.h @@ -63,6 +63,7 @@ typedef enum { tcg_isa_2_06, tcg_isa_2_07, tcg_isa_3_00, + tcg_isa_3_10, } TCGPowerISA; extern TCGPowerISA have_isa; @@ -72,6 +73,7 @@ extern bool have_vsx; #define have_isa_2_06 (have_isa >= tcg_isa_2_06) #define have_isa_2_07 (have_isa >= tcg_isa_2_07) #define have_isa_3_00 (have_isa >= tcg_isa_3_00) +#define have_isa_3_10 (have_isa >= tcg_isa_3_10) /* optional instructions automatically implemented */ #define TCG_TARGET_HAS_ext8u_i32 0 /* andi */ diff --git a/tcg/riscv/tcg-target.inc.c b/tcg/riscv/tcg-target.c.inc index 3c11ab8b7a..2dfb07e247 100644 --- a/tcg/riscv/tcg-target.inc.c +++ b/tcg/riscv/tcg-target.c.inc @@ -27,7 +27,7 @@ * THE SOFTWARE. */ -#include "../tcg-pool.inc.c" +#include "../tcg-pool.c.inc" #ifdef CONFIG_DEBUG_TCG static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { @@ -919,7 +919,7 @@ static void tcg_out_mb(TCGContext *s, TCGArg a0) */ #if defined(CONFIG_SOFTMMU) -#include "../tcg-ldst.inc.c" +#include "../tcg-ldst.c.inc" /* helper signature: helper_ret_ld_mmu(CPUState *env, target_ulong addr, * TCGMemOpIdx oi, uintptr_t ra) diff --git a/tcg/s390/tcg-target.inc.c b/tcg/s390/tcg-target.c.inc index b07e9ff7d6..985115acfb 100644 --- a/tcg/s390/tcg-target.inc.c +++ b/tcg/s390/tcg-target.c.inc @@ -29,7 +29,7 @@ #error "unsupported code generation mode" #endif -#include "../tcg-pool.inc.c" +#include "../tcg-pool.c.inc" #include "elf.h" /* ??? The translation blocks produced by TCG are generally small enough to @@ -1536,7 +1536,7 @@ static void tcg_out_qemu_st_direct(TCGContext *s, MemOp opc, TCGReg data, } #if defined(CONFIG_SOFTMMU) -#include "../tcg-ldst.inc.c" +#include "../tcg-ldst.c.inc" /* We're expecting to use a 20-bit negative offset on the tlb memory ops. */ QEMU_BUILD_BUG_ON(TLB_MASK_TABLE_OFS(0) > 0); diff --git a/tcg/sparc/tcg-target.inc.c b/tcg/sparc/tcg-target.c.inc index 65fddb310d..0f1d91fc21 100644 --- a/tcg/sparc/tcg-target.inc.c +++ b/tcg/sparc/tcg-target.c.inc @@ -22,7 +22,7 @@ * THE SOFTWARE. */ -#include "../tcg-pool.inc.c" +#include "../tcg-pool.c.inc" #ifdef CONFIG_DEBUG_TCG static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { diff --git a/tcg/tcg-ldst.inc.c b/tcg/tcg-ldst.c.inc index 05f9b3ccd6..05f9b3ccd6 100644 --- a/tcg/tcg-ldst.inc.c +++ b/tcg/tcg-ldst.c.inc diff --git a/tcg/tcg-pool.inc.c b/tcg/tcg-pool.c.inc index 4eaa84b631..82cbcc89bd 100644 --- a/tcg/tcg-pool.inc.c +++ b/tcg/tcg-pool.c.inc @@ -118,7 +118,7 @@ static inline void new_pool_l8(TCGContext *s, int rtype, tcg_insn_unit *label, new_pool_insert(s, n); } -/* To be provided by cpu/tcg-target.inc.c. */ +/* To be provided by cpu/tcg-target.c.inc. */ static void tcg_out_nop_fill(tcg_insn_unit *p, int count); static int tcg_out_pool_finalize(TCGContext *s) @@ -65,7 +65,7 @@ #include "exec/log.h" #include "sysemu/sysemu.h" -/* Forward declarations for functions declared in tcg-target.inc.c and +/* Forward declarations for functions declared in tcg-target.c.inc and used here. */ static void tcg_target_init(TCGContext *s); static const TCGTargetOpDef *tcg_target_op_def(TCGOpcode); @@ -101,7 +101,7 @@ static void tcg_register_jit_int(void *buf, size_t size, size_t debug_frame_size) __attribute__((unused)); -/* Forward declarations for functions declared and used in tcg-target.inc.c. */ +/* Forward declarations for functions declared and used in tcg-target.c.inc. */ static const char *target_parse_constraint(TCGArgConstraint *ct, const char *ct_str, TCGType type); static void tcg_out_ld(TCGContext *s, TCGType type, TCGReg ret, TCGReg arg1, @@ -341,7 +341,7 @@ static void set_jmp_reset_offset(TCGContext *s, int which) assert(s->tb_jmp_reset_offset[which] == off); } -#include "tcg-target.inc.c" +#include "tcg-target.c.inc" /* compare a pointer @ptr and a tb_tc @s */ static int ptr_cmp_tb_tc(const void *ptr, const struct tb_tc *s) diff --git a/tcg/tci/README b/tcg/tci/README index 386c3c7507..9bb7d7a5d3 100644 --- a/tcg/tci/README +++ b/tcg/tci/README @@ -21,7 +21,7 @@ This is what TCI (Tiny Code Interpreter) does. 2) Implementation Like each TCG host frontend, TCI implements the code generator in -tcg-target.inc.c, tcg-target.h. Both files are in directory tcg/tci. +tcg-target.c.inc, tcg-target.h. Both files are in directory tcg/tci. The additional file tcg/tci.c adds the interpreter. @@ -123,7 +123,7 @@ u1 = linux-user-test works would also improve speed for hosts which support byte alignment). * A better disassembler for the pseudo code would be nice (a very primitive - disassembler is included in tcg-target.inc.c). + disassembler is included in tcg-target.c.inc). * It might be useful to have a runtime option which selects the native TCG or TCI, so QEMU would have to include two TCGs. Today, selecting TCI diff --git a/tcg/tci/tcg-target.inc.c b/tcg/tci/tcg-target.c.inc index 992d50cb1e..992d50cb1e 100644 --- a/tcg/tci/tcg-target.inc.c +++ b/tcg/tci/tcg-target.c.inc diff --git a/tests/Makefile.include b/tests/Makefile.include index c7e4646ded..9ac8f5b86a 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -109,6 +109,7 @@ check-unit-y += tests/test-qht$(EXESUF) check-unit-y += tests/test-qht-par$(EXESUF) check-unit-y += tests/test-bitops$(EXESUF) check-unit-y += tests/test-bitcnt$(EXESUF) +check-unit-y += tests/test-qgraph$(EXESUF) check-unit-y += tests/check-qom-interface$(EXESUF) check-unit-y += tests/check-qom-proplist$(EXESUF) check-unit-y += tests/test-qemu-opts$(EXESUF) @@ -129,7 +130,7 @@ ifndef CONFIG_TSAN # https://github.com/google/sanitizers/issues/1116 check-unit-$(CONFIG_SOFTMMU) += tests/test-char$(EXESUF) check-unit-$(CONFIG_SOFTMMU) += tests/test-qdev-global-props$(EXESUF) -ifneq (,$(findstring qemu-ga,$(TOOLS))) +ifeq ($(CONFIG_GUEST_AGENT),y) check-unit-$(call land,$(CONFIG_LINUX),$(CONFIG_VIRTIO_SERIAL)) += tests/test-qga$(EXESUF) endif endif @@ -159,203 +160,6 @@ check-unit-y += tests/test-uuid$(EXESUF) check-unit-y += tests/ptimer-test$(EXESUF) check-unit-y += tests/test-qapi-util$(EXESUF) -check-block-$(call land,$(CONFIG_POSIX),$(CONFIG_SOFTMMU)) += tests/check-block.sh - -qapi-schema += alternate-any.json -qapi-schema += alternate-array.json -qapi-schema += alternate-base.json -qapi-schema += alternate-branch-if-invalid.json -qapi-schema += alternate-clash.json -qapi-schema += alternate-conflict-dict.json -qapi-schema += alternate-conflict-enum-bool.json -qapi-schema += alternate-conflict-enum-int.json -qapi-schema += alternate-conflict-string.json -qapi-schema += alternate-conflict-bool-string.json -qapi-schema += alternate-conflict-num-string.json -qapi-schema += alternate-empty.json -qapi-schema += alternate-invalid-dict.json -qapi-schema += alternate-nested.json -qapi-schema += alternate-unknown.json -qapi-schema += args-alternate.json -qapi-schema += args-any.json -qapi-schema += args-array-empty.json -qapi-schema += args-array-unknown.json -qapi-schema += args-bad-boxed.json -qapi-schema += args-boxed-anon.json -qapi-schema += args-boxed-string.json -qapi-schema += args-int.json -qapi-schema += args-invalid.json -qapi-schema += args-member-array-bad.json -qapi-schema += args-member-case.json -qapi-schema += args-member-unknown.json -qapi-schema += args-name-clash.json -qapi-schema += args-union.json -qapi-schema += args-unknown.json -qapi-schema += bad-base.json -qapi-schema += bad-data.json -qapi-schema += bad-ident.json -qapi-schema += bad-if.json -qapi-schema += bad-if-empty.json -qapi-schema += bad-if-empty-list.json -qapi-schema += bad-if-list.json -qapi-schema += bad-type-bool.json -qapi-schema += bad-type-dict.json -qapi-schema += bad-type-int.json -qapi-schema += base-cycle-direct.json -qapi-schema += base-cycle-indirect.json -qapi-schema += command-int.json -qapi-schema += comments.json -qapi-schema += doc-bad-alternate-member.json -qapi-schema += doc-bad-boxed-command-arg.json -qapi-schema += doc-bad-command-arg.json -qapi-schema += doc-bad-enum-member.json -qapi-schema += doc-bad-event-arg.json -qapi-schema += doc-bad-feature.json -qapi-schema += doc-bad-section.json -qapi-schema += doc-bad-symbol.json -qapi-schema += doc-bad-union-member.json -qapi-schema += doc-before-include.json -qapi-schema += doc-before-pragma.json -qapi-schema += doc-duplicated-arg.json -qapi-schema += doc-duplicated-return.json -qapi-schema += doc-duplicated-since.json -qapi-schema += doc-empty-arg.json -qapi-schema += doc-empty-section.json -qapi-schema += doc-empty-symbol.json -qapi-schema += doc-good.json -qapi-schema += doc-interleaved-section.json -qapi-schema += doc-invalid-end.json -qapi-schema += doc-invalid-end2.json -qapi-schema += doc-invalid-return.json -qapi-schema += doc-invalid-section.json -qapi-schema += doc-invalid-start.json -qapi-schema += doc-missing-colon.json -qapi-schema += doc-missing-expr.json -qapi-schema += doc-missing-space.json -qapi-schema += doc-missing.json -qapi-schema += doc-no-symbol.json -qapi-schema += doc-undoc-feature.json -qapi-schema += double-type.json -qapi-schema += duplicate-key.json -qapi-schema += empty.json -qapi-schema += enum-bad-member.json -qapi-schema += enum-bad-name.json -qapi-schema += enum-bad-prefix.json -qapi-schema += enum-clash-member.json -qapi-schema += enum-dict-member-unknown.json -qapi-schema += enum-if-invalid.json -qapi-schema += enum-int-member.json -qapi-schema += enum-member-case.json -qapi-schema += enum-missing-data.json -qapi-schema += enum-wrong-data.json -qapi-schema += event-boxed-empty.json -qapi-schema += event-case.json -qapi-schema += event-member-invalid-dict.json -qapi-schema += event-nest-struct.json -qapi-schema += features-bad-type.json -qapi-schema += features-deprecated-type.json -qapi-schema += features-duplicate-name.json -qapi-schema += features-if-invalid.json -qapi-schema += features-missing-name.json -qapi-schema += features-name-bad-type.json -qapi-schema += features-no-list.json -qapi-schema += features-unknown-key.json -qapi-schema += flat-union-array-branch.json -qapi-schema += flat-union-bad-base.json -qapi-schema += flat-union-bad-discriminator.json -qapi-schema += flat-union-base-any.json -qapi-schema += flat-union-base-union.json -qapi-schema += flat-union-clash-member.json -qapi-schema += flat-union-discriminator-bad-name.json -qapi-schema += flat-union-empty.json -qapi-schema += flat-union-inline.json -qapi-schema += flat-union-inline-invalid-dict.json -qapi-schema += flat-union-int-branch.json -qapi-schema += flat-union-invalid-branch-key.json -qapi-schema += flat-union-invalid-discriminator.json -qapi-schema += flat-union-invalid-if-discriminator.json -qapi-schema += flat-union-no-base.json -qapi-schema += flat-union-optional-discriminator.json -qapi-schema += flat-union-string-discriminator.json -qapi-schema += funny-char.json -qapi-schema += funny-word.json -qapi-schema += ident-with-escape.json -qapi-schema += include-before-err.json -qapi-schema += include-cycle.json -qapi-schema += include-extra-junk.json -qapi-schema += include-nested-err.json -qapi-schema += include-no-file.json -qapi-schema += include-non-file.json -qapi-schema += include-repetition.json -qapi-schema += include-self-cycle.json -qapi-schema += include-simple.json -qapi-schema += indented-expr.json -qapi-schema += leading-comma-list.json -qapi-schema += leading-comma-object.json -qapi-schema += missing-colon.json -qapi-schema += missing-comma-list.json -qapi-schema += missing-comma-object.json -qapi-schema += missing-type.json -qapi-schema += nested-struct-data.json -qapi-schema += nested-struct-data-invalid-dict.json -qapi-schema += non-objects.json -qapi-schema += oob-test.json -qapi-schema += allow-preconfig-test.json -qapi-schema += pragma-doc-required-crap.json -qapi-schema += pragma-extra-junk.json -qapi-schema += pragma-name-case-whitelist-crap.json -qapi-schema += pragma-non-dict.json -qapi-schema += pragma-unknown.json -qapi-schema += pragma-returns-whitelist-crap.json -qapi-schema += qapi-schema-test.json -qapi-schema += quoted-structural-chars.json -qapi-schema += redefined-builtin.json -qapi-schema += redefined-command.json -qapi-schema += redefined-event.json -qapi-schema += redefined-type.json -qapi-schema += reserved-command-q.json -qapi-schema += reserved-enum-q.json -qapi-schema += reserved-member-has.json -qapi-schema += reserved-member-q.json -qapi-schema += reserved-member-u.json -qapi-schema += reserved-member-underscore.json -qapi-schema += reserved-type-kind.json -qapi-schema += reserved-type-list.json -qapi-schema += returns-alternate.json -qapi-schema += returns-array-bad.json -qapi-schema += returns-dict.json -qapi-schema += returns-unknown.json -qapi-schema += returns-whitelist.json -qapi-schema += string-code-point-31.json -qapi-schema += string-code-point-127.json -qapi-schema += struct-base-clash-deep.json -qapi-schema += struct-base-clash.json -qapi-schema += struct-data-invalid.json -qapi-schema += struct-member-if-invalid.json -qapi-schema += struct-member-invalid-dict.json -qapi-schema += struct-member-invalid.json -qapi-schema += trailing-comma-list.json -qapi-schema += trailing-comma-object.json -qapi-schema += type-bypass-bad-gen.json -qapi-schema += unclosed-list.json -qapi-schema += unclosed-object.json -qapi-schema += unclosed-string.json -qapi-schema += union-base-empty.json -qapi-schema += union-base-no-discriminator.json -qapi-schema += union-branch-case.json -qapi-schema += union-branch-if-invalid.json -qapi-schema += union-branch-invalid-dict.json -qapi-schema += union-clash-branches.json -qapi-schema += union-empty.json -qapi-schema += union-invalid-base.json -qapi-schema += union-optional-branch.json -qapi-schema += union-unknown.json -qapi-schema += unknown-escape.json -qapi-schema += unknown-expr-key.json - - -check-qapi-schema-y := $(addprefix tests/qapi-schema/, $(qapi-schema)) - generated-files-y += tests/test-qapi-types.h generated-files-y += tests/include/test-qapi-types-sub-module.h generated-files-y += tests/test-qapi-types-sub-sub-module.h @@ -421,7 +225,8 @@ tests/test-iov$(EXESUF): tests/test-iov.o $(test-util-obj-y) tests/test-hbitmap$(EXESUF): tests/test-hbitmap.o $(test-util-obj-y) $(test-crypto-obj-y) tests/test-bitmap$(EXESUF): tests/test-bitmap.o $(test-util-obj-y) tests/test-x86-cpuid$(EXESUF): tests/test-x86-cpuid.o -tests/test-xbzrle$(EXESUF): tests/test-xbzrle.o migration/xbzrle.o migration/page_cache.o $(test-util-obj-y) +tests/test-xbzrle$(EXESUF): tests/test-xbzrle.o migration/libmigration.fa $(test-util-obj-y) \ + $(test-io-obj-y) tests/test-cutils$(EXESUF): tests/test-cutils.o util/cutils.o $(test-util-obj-y) tests/test-int128$(EXESUF): tests/test-int128.o tests/rcutorture$(EXESUF): tests/rcutorture.o $(test-util-obj-y) @@ -437,22 +242,9 @@ tests/test-bufferiszero$(EXESUF): tests/test-bufferiszero.o $(test-util-obj-y) tests/atomic_add-bench$(EXESUF): tests/atomic_add-bench.o $(test-util-obj-y) tests/atomic64-bench$(EXESUF): tests/atomic64-bench.o $(test-util-obj-y) -tests/fp/%: - $(MAKE) -C $(dir $@) $(notdir $@) - -tests/test-qdev-global-props$(EXESUF): tests/test-qdev-global-props.o \ - hw/core/qdev.o hw/core/qdev-properties.o hw/core/hotplug.o\ - hw/core/bus.o \ - hw/core/resettable.o \ - hw/core/irq.o \ - hw/core/fw-path-provider.o \ - hw/core/reset.o \ - hw/core/vmstate-if.o \ - hw/core/clock.o hw/core/qdev-clock.o \ +tests/test-qdev-global-props$(EXESUF): tests/test-qdev-global-props.o hw/core/libhwcore.fa \ $(test-qapi-obj-y) -tests/test-vmstate$(EXESUF): tests/test-vmstate.o \ - migration/vmstate.o migration/vmstate-types.o migration/qemu-file.o \ - migration/qemu-file-channel.o migration/qjson.o \ +tests/test-vmstate$(EXESUF): tests/test-vmstate.o migration/libmigration.fa \ $(test-io-obj-y) tests/test-timed-average$(EXESUF): tests/test-timed-average.o $(test-util-obj-y) tests/test-base64$(EXESUF): tests/test-base64.o $(test-util-obj-y) @@ -504,26 +296,6 @@ tests/test-qapi-gen-timestamp: \ @rm -f tests/test-qapi-doc.texi @>$@ -tests/qapi-schema/doc-good.test.texi: $(SRC_PATH)/tests/qapi-schema/doc-good.json $(qapi-py) - $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \ - -o tests/qapi-schema -p "doc-good-" $<, \ - "GEN","$@") - @mv tests/qapi-schema/doc-good-qapi-doc.texi $@ - @rm -f tests/qapi-schema/doc-good-qapi-*.[ch] tests/qapi-schema/doc-good-qmp-*.[ch] - -tests/qtest/dbus-vmstate1.h tests/qtest/dbus-vmstate1.c: tests/qtest/dbus-vmstate1-gen-timestamp ; -tests/qtest/dbus-vmstate1-gen-timestamp: $(SRC_PATH)/tests/qtest/dbus-vmstate1.xml - $(call quiet-command,$(GDBUS_CODEGEN) $< \ - --interface-prefix org.qemu --generate-c-code tests/qtest/dbus-vmstate1, \ - "GEN","$(@:%-timestamp=%)") - @>$@ - -tests/qtest/dbus-vmstate-test.o-cflags := -DSRCDIR="$(SRC_PATH)" -tests/qtest/dbus-vmstate1.o-cflags := $(GIO_CFLAGS) -tests/qtest/dbus-vmstate1.o-libs := $(GIO_LIBS) - -tests/qtest/dbus-vmstate-test.o: tests/qtest/dbus-vmstate1.h - tests/test-string-output-visitor$(EXESUF): tests/test-string-output-visitor.o $(test-qapi-obj-y) tests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(test-qapi-obj-y) tests/test-qmp-event$(EXESUF): tests/test-qmp-event.o $(test-qapi-obj-y) tests/test-qapi-emit-events.o tests/test-qapi-events.o @@ -538,6 +310,7 @@ tests/test-shift128$(EXESUF): tests/test-shift128.o $(test-util-obj-y) tests/test-mul64$(EXESUF): tests/test-mul64.o $(test-util-obj-y) tests/test-bitops$(EXESUF): tests/test-bitops.o $(test-util-obj-y) tests/test-bitcnt$(EXESUF): tests/test-bitcnt.o $(test-util-obj-y) +tests/test-qgraph$(EXESUF): tests/test-qgraph.o tests/qtest/libqos/qgraph.o $(test-util-obj-y) tests/test-crypto-hash$(EXESUF): tests/test-crypto-hash.o $(test-crypto-obj-y) tests/benchmark-crypto-hash$(EXESUF): tests/benchmark-crypto-hash.o $(test-crypto-obj-y) tests/test-crypto-hmac$(EXESUF): tests/test-crypto-hmac.o $(test-crypto-obj-y) @@ -601,10 +374,8 @@ tests/migration/initrd-stress.img: tests/migration/stress$(EXESUF) rm $(INITRD_WORK_DIR)/init rmdir $(INITRD_WORK_DIR) -include $(SRC_PATH)/tests/qtest/Makefile.include - -tests/test-qga$(EXESUF): qemu-ga$(EXESUF) -tests/test-qga$(EXESUF): tests/test-qga.o $(qtest-obj-y) +tests/test-qga$(EXESUF): qga/qemu-ga$(EXESUF) +tests/test-qga$(EXESUF): tests/test-qga.o tests/qtest/libqtest.o $(test-util-obj-y) tests/vhost-user-bridge$(EXESUF): tests/vhost-user-bridge.o $(test-util-obj-y) libvhost-user.a tests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_scm_helper.o @@ -645,14 +416,6 @@ define do_test_tap "TAP","$@") endef -.PHONY: $(patsubst %, check-qtest-%, $(QTEST_TARGETS)) -$(patsubst %, check-qtest-%, $(QTEST_TARGETS)): check-qtest-%: %-softmmu/all $(check-qtest-y) - $(call do_test_human,$(check-qtest-$*-y:%=tests/qtest/%$(EXESUF)) $(check-qtest-generic-y:%=tests/qtest/%$(EXESUF)), \ - QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \ - QTEST_QEMU_IMG=qemu-img$(EXESUF)) - -build-qtest: $(patsubst %, %-softmmu/all, $(QTEST_TARGETS)) $(check-qtest-y) - build-unit: $(check-unit-y) check-unit: $(check-unit-y) @@ -663,179 +426,9 @@ check-speed: $(check-speed-y) # gtester tests with TAP output -$(patsubst %, check-report-qtest-%.tap, $(QTEST_TARGETS)): check-report-qtest-%.tap: %-softmmu/all $(check-qtest-y) - $(call do_test_tap, $(check-qtest-$*-y:%=tests/qtest/%$(EXESUF)) $(check-qtest-generic-y:%=tests/qtest/%$(EXESUF)), \ - QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \ - QTEST_QEMU_IMG=qemu-img$(EXESUF)) - check-report-unit.tap: $(check-unit-y) $(call do_test_tap,$^) -# Reports and overall runs - -check-report.tap: $(patsubst %,check-report-qtest-%.tap, $(QTEST_TARGETS)) check-report-unit.tap - $(call quiet-command, cat $^ | scripts/tap-merge.pl >$@,"GEN","$@") - -# FPU Emulation tests (aka softfloat) -# -# As we still have some places that need fixing the rules are a little -# more complex than they need to be and have to override some of the -# generic Makefile expansions. Once we are cleanly passing all -# the tests we can simplify the make syntax. - -FP_TEST_BIN=$(BUILD_DIR)/tests/fp/fp-test - -# the build dir is created by configure -$(FP_TEST_BIN): config-host.h $(test-util-obj-y) - $(call quiet-command, \ - $(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" $(notdir $@), \ - "BUILD", "$(notdir $@)") - -# The full test suite can take a bit of time, default to a quick run -# "-l 2 -r all" can take more than a day for some operations and is best -# run manually -FP_TL=-l 1 -r all - -# $1 = tests, $2 = description, $3 = test flags -test-softfloat = $(call quiet-command, \ - cd $(BUILD_DIR)/tests/fp && \ - ./fp-test -s $(if $3,$3,$(FP_TL)) $1 > $2.out 2>&1 || \ - (cat $2.out && exit 1;), \ - "FLOAT TEST", $2) - -# Conversion Routines: Float to Float -# FIXME: f32_to_f128 (broken), f64_to_f128 (broken) -# FIXME: f128_to_f32(broken), f128_to_f64 (broken) -# FIXME: f128_to_extF80 (broken) -check-softfloat-conv-f2f: $(FP_TEST_BIN) - $(call test-softfloat, \ - f16_to_f32 f16_to_f64 \ - f16_to_extF80 f16_to_f128 \ - f32_to_f16 f32_to_f64 \ - f32_to_extF80 \ - f64_to_f16 f64_to_f32 \ - extF80_to_f16 extF80_to_f32 \ - extF80_to_f64 extF80_to_f128 \ - f128_to_f16, \ - float-to-float) - -# Conversion Routines: Int and Uint to Float -# FIXME: i32_to_extF80 (broken), i64_to_extF80 (broken) -# ui32_to_f128 (not implemented) -check-softfloat-conv-to-float: $(FP_TEST_BIN) - $(call test-softfloat, \ - i32_to_f16 i64_to_f16 \ - i32_to_f32 i64_to_f32 \ - i32_to_f64 i64_to_f64 \ - i32_to_f128 i64_to_f128, int-to-float) - $(call test-softfloat, \ - ui32_to_f16 ui64_to_f16 \ - ui32_to_f32 ui64_to_f32 \ - ui32_to_f64 ui64_to_f64 \ - ui32_to_extF80 ui64_to_extF80 \ - ui64_to_f128, uint-to-float) - -# Conversion Routines: Float to integers -# FIXME: extF80_roundToInt (broken) -check-softfloat-conv-to-int: $(FP_TEST_BIN) - $(call test-softfloat, \ - f16_to_i32 f16_to_i32_r_minMag \ - f32_to_i32 f32_to_i32_r_minMag \ - f64_to_i32 f64_to_i32_r_minMag \ - extF80_to_i32 extF80_to_i32_r_minMag \ - f128_to_i32 f128_to_i32_r_minMag \ - f16_to_i64 f16_to_i64_r_minMag \ - f32_to_i64 f32_to_i64_r_minMag \ - f64_to_i64 f64_to_i64_r_minMag \ - extF80_to_i64 extF80_to_i64_r_minMag \ - f128_to_i64 f128_to_i64_r_minMag, \ - float-to-int) - $(call test-softfloat, \ - f16_to_ui32 f16_to_ui32_r_minMag \ - f32_to_ui32 f32_to_ui32_r_minMag \ - f64_to_ui32 f64_to_ui32_r_minMag \ - extF80_to_ui32 extF80_to_ui32_r_minMag \ - f128_to_ui32 f128_to_ui32_r_minMag \ - f16_to_ui64 f16_to_ui64_r_minMag \ - f32_to_ui64 f32_to_ui64_r_minMag \ - f64_to_ui64 f64_to_ui64_r_minMag \ - extF80_to_ui64 extF80_to_ui64_r_minMag \ - f128_to_ui64 f128_to_ui64_r_minMag, \ - float-to-uint) - $(call test-softfloat, \ - f16_roundToInt f32_roundToInt \ - f64_roundToInt f128_roundToInt, \ - round-to-integer) - -.PHONY: check-softfloat-conv -check-softfloat-conv: check-softfloat-conv-f2f -check-softfloat-conv: check-softfloat-conv-to-float -check-softfloat-conv: check-softfloat-conv-to-int - -# Generic rule for all float operations -# -# Some patterns are overridden due to broken or missing tests. -# Hopefully these can be removed over time. - -check-softfloat-%: $(FP_TEST_BIN) - $(call test-softfloat, f16_$* f32_$* f64_$* extF80_$* f128_$*, $*) - -# Float Compare routines -SF_COMPARE_OPS=eq eq_signaling le le_quiet lt_quiet -SF_COMPARE_RULES=$(patsubst %,check-softfloat-%, $(SF_COMPARE_OPS)) - -# FIXME: extF80_lt_quiet (broken) -check-softfloat-lt_quiet: $(FP_TEST_BIN) - $(call test-softfloat, \ - f16_lt_quiet f32_lt_quiet f64_lt_quiet \ - f128_lt_quiet, \ - lt_quiet) - -.PHONY: check-softfloat-compare -check-softfloat-compare: $(SF_COMPARE_RULES) - -# Math Operations - -# FIXME: extF80_mulAdd (missing) -check-softfloat-mulAdd: $(FP_TEST_BIN) - $(call test-softfloat, \ - f16_mulAdd f32_mulAdd f64_mulAdd f128_mulAdd, \ - mulAdd,-l 1) - -# FIXME: extF80_rem (broken) -check-softfloat-rem: $(FP_TEST_BIN) - $(call test-softfloat, \ - f16_rem f32_rem f64_rem f128_rem, \ - rem) - -SF_MATH_OPS=add sub mul mulAdd div rem sqrt -SF_MATH_RULES=$(patsubst %,check-softfloat-%, $(SF_MATH_OPS)) - -.PHONY: check-softfloat-ops -check-softfloat-ops: $(SF_MATH_RULES) - -# Finally a generic rule to test all of softfoat. If TCG isnt't -# enabled we define a null operation which skips the tests. - -.PHONY: check-softfloat -ifeq ($(CONFIG_TCG),y) -build-softfloat: $(FP_TEST_BIN) -check-softfloat: build-softfloat check-softfloat-conv check-softfloat-compare check-softfloat-ops -else -build-softfloat check-softfloat: - $(call quiet-command, /bin/true, "FLOAT TEST", \ - "SKIPPED for non-TCG builds") -endif - -# Plugins -ifeq ($(CONFIG_PLUGIN),y) -.PHONY: plugins -plugins: - $(call quiet-command,\ - $(MAKE) $(SUBDIR_MAKEFLAGS) -C tests/plugin V="$(V)", \ - "BUILD", "plugins") -endif - # Per guest TCG tests BUILD_TCG_TARGET_RULES=$(patsubst %,build-tcg-tests-%, $(TARGET_DIRS)) @@ -853,7 +446,7 @@ build-tcg-tests-%: $(if $(CONFIG_PLUGIN),plugins) V="$(V)" TARGET="$*" guest-tests, \ "BUILD", "TCG tests for $*") -run-tcg-tests-%: build-tcg-tests-% %/all +run-tcg-tests-%: build-tcg-tests-% all $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) \ -f $(SRC_PATH)/tests/tcg/Makefile.qemu \ SRC_PATH=$(SRC_PATH) SPEED="$(SPEED)" \ @@ -875,32 +468,6 @@ check-tcg: $(RUN_TCG_TARGET_RULES) .PHONY: clean-tcg clean-tcg: $(CLEAN_TCG_TARGET_RULES) -# Other tests - -QEMU_IOTESTS_HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) = tests/qemu-iotests/socket_scm_helper$(EXESUF) - -.PHONY: check-tests/check-block.sh -check-tests/check-block.sh: tests/check-block.sh qemu-img$(EXESUF) \ - qemu-io$(EXESUF) qemu-nbd$(EXESUF) $(QEMU_IOTESTS_HELPERS-y) \ - $(patsubst %,%/all,$(filter %-softmmu,$(TARGET_DIRS))) - @$< - -.PHONY: check-tests/qapi-schema/frontend -check-tests/qapi-schema/frontend: $(addprefix $(SRC_PATH)/, $(check-qapi-schema-y)) - $(call quiet-command, PYTHONPATH=$(SRC_PATH)/scripts \ - PYTHONIOENCODING=utf-8 $(PYTHON) $(SRC_PATH)/tests/qapi-schema/test-qapi.py $^, \ - TEST, check-qapi-schema) - -.PHONY: check-tests/qapi-schema/doc-good.texi -check-tests/qapi-schema/doc-good.texi: tests/qapi-schema/doc-good.test.texi - @diff -u $(SRC_PATH)/tests/qapi-schema/doc-good.texi $< - -.PHONY: check-decodetree -check-decodetree: - $(call quiet-command, \ - cd $(SRC_PATH)/tests/decode && \ - ./check.sh "$(PYTHON)" "$(SRC_PATH)/scripts/decodetree.py", \ - TEST, decodetree.py) # Python venv for running tests @@ -955,31 +522,21 @@ check-acceptance: check-venv $(TESTS_RESULTS_DIR) get-vm-images # Consolidated targets -.PHONY: check-block check-qapi-schema check-qtest check-unit check check-clean get-vm-images -check-qapi-schema: check-tests/qapi-schema/frontend check-tests/qapi-schema/doc-good.texi -check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS)) -ifeq ($(CONFIG_TOOLS),y) -check-block: $(patsubst %,check-%, $(check-block-y)) -endif -check-build: build-unit build-softfloat build-qtest +.PHONY: check-block check-unit check check-clean get-vm-images +check-block: +check-build: build-unit check-clean: rm -rf $(check-unit-y) tests/*.o tests/*/*.o $(QEMU_IOTESTS_HELPERS-y) - rm -rf $(sort $(foreach target,$(SYSEMU_TARGET_LIST), $(check-qtest-$(target)-y:%=tests/qtest/%$(EXESUF))) $(check-qtest-generic-y:%=tests/qtest/%$(EXESUF))) rm -f tests/test-qapi-gen-timestamp - rm -f tests/qtest/dbus-vmstate1-gen-timestamp rm -rf $(TESTS_VENV_DIR) $(TESTS_RESULTS_DIR) -check: check-block check-qapi-schema check-unit check-softfloat check-qtest check-decodetree +check: check-unit clean: check-clean # Build the help program automatically -all: $(QEMU_IOTESTS_HELPERS-y) - -include $(wildcard tests/*.d) --include $(wildcard tests/qtest/*.d) --include $(wildcard tests/qtest/libqos/*.d) endif diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py index 77d1c1d9ff..db9c0f5d79 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -57,8 +57,7 @@ def pick_default_qemu_bin(arch=None): # qemu binary path does not match arch for powerpc, handle it if 'ppc64le' in arch: arch = 'ppc64' - qemu_bin_relative_path = os.path.join("%s-softmmu" % arch, - "qemu-system-%s" % arch) + qemu_bin_relative_path = "./qemu-system-%s" % arch if is_readable_executable_file(qemu_bin_relative_path): return qemu_bin_relative_path diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py index 73cc69c499..aaa781a581 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -335,15 +335,14 @@ class BootLinuxConsole(LinuxKernelTest): :avocado: tags=device:pl011 :avocado: tags=device:arm_gicv3 """ - kernel_url = ('http://ports.ubuntu.com/ubuntu-ports/dists/' - 'bionic-updates/main/installer-arm64/current/images/' - 'netboot/ubuntu-installer/arm64/linux') + images_url = ('http://ports.ubuntu.com/ubuntu-ports/dists/' + 'bionic-updates/main/installer-arm64/' + '20101020ubuntu543.15/images/') + kernel_url = images_url + 'netboot/ubuntu-installer/arm64/linux' kernel_hash = '5bfc54cf7ed8157d93f6e5b0241e727b6dc22c50' kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash) - initrd_url = ('http://ports.ubuntu.com/ubuntu-ports/dists/' - 'bionic-updates/main/installer-arm64/current/images/' - 'netboot/ubuntu-installer/arm64/initrd.gz') + initrd_url = images_url + 'netboot/ubuntu-installer/arm64/initrd.gz' initrd_hash = 'd385d3e88d53e2004c5d43cbe668b458a094f772' initrd_path = self.fetch_asset(initrd_url, asset_hash=initrd_hash) @@ -822,7 +821,7 @@ class BootLinuxConsole(LinuxKernelTest): :avocado: tags=machine:clipper """ kernel_url = ('http://archive.debian.org/debian/dists/lenny/main/' - 'installer-alpha/current/images/cdrom/vmlinuz') + 'installer-alpha/20090123lenny10/images/cdrom/vmlinuz') kernel_hash = '3a943149335529e2ed3e74d0d787b85fb5671ba3' kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash) diff --git a/tests/data/acpi/rebuild-expected-aml.sh b/tests/data/acpi/rebuild-expected-aml.sh index 76cd797d1e..fc78770544 100755 --- a/tests/data/acpi/rebuild-expected-aml.sh +++ b/tests/data/acpi/rebuild-expected-aml.sh @@ -12,7 +12,7 @@ # This work is licensed under the terms of the GNU GPLv2. # See the COPYING.LIB file in the top-level directory. -qemu_bins="x86_64-softmmu/qemu-system-x86_64 aarch64-softmmu/qemu-system-aarch64" +qemu_bins="./qemu-system-x86_64 ./qemu-system-aarch64" if [ ! -e "tests/qtest/bios-tables-test" ]; then echo "Test: bios-tables-test is required! Run make check before this script." diff --git a/tests/docker/test-static b/tests/docker/test-static new file mode 100755 index 0000000000..372ef6fac7 --- /dev/null +++ b/tests/docker/test-static @@ -0,0 +1,24 @@ +#!/bin/bash -e +# +# Compile QEMU user mode emulators as static binaries on Linux. +# +# Copyright (c) 2020 Red Hat Inc. +# +# Authors: +# Paolo Bonzini <pbonzini@redhat.com> +# +# This work is licensed under the terms of the GNU GPL, version 2 +# or (at your option) any later version. See the COPYING file in +# the top-level directory. + +. common.rc + +cd "$BUILD_DIR" + +build_qemu \ + --disable-system \ + --disable-tools \ + --disable-guest-agent \ + --disable-docs \ + --static +install_qemu diff --git a/tests/fp/Makefile b/tests/fp/Makefile deleted file mode 100644 index 56768ecfd2..0000000000 --- a/tests/fp/Makefile +++ /dev/null @@ -1,600 +0,0 @@ -BUILD_DIR := $(CURDIR)/../.. - -include $(BUILD_DIR)/config-host.mak -include $(SRC_PATH)/rules.mak - -SOFTFLOAT_DIR := $(SRC_PATH)/tests/fp/berkeley-softfloat-3 -TESTFLOAT_DIR := $(SRC_PATH)/tests/fp/berkeley-testfloat-3 - -SF_SOURCE_DIR := $(SOFTFLOAT_DIR)/source -SF_INCLUDE_DIR := $(SOFTFLOAT_DIR)/source/include -# we could use any specialize here, it doesn't matter -SF_SPECIALIZE := 8086-SSE -SF_SPECIALIZE_DIR := $(SF_SOURCE_DIR)/$(SF_SPECIALIZE) - -TF_SOURCE_DIR := $(TESTFLOAT_DIR)/source - -$(call set-vpath, $(SRC_PATH)/fpu $(SRC_PATH)/tests/fp) - -LIBQEMUUTIL := $(BUILD_DIR)/libqemuutil.a - -# Use this variable to be clear when we pull in our own implementation -# We build the object with a default rule thanks to the vpath above -QEMU_SOFTFLOAT_OBJ := softfloat.o - -QEMU_INCLUDES += -I$(SRC_PATH)/tests/fp -QEMU_INCLUDES += -I$(SF_INCLUDE_DIR) -QEMU_INCLUDES += -I$(SF_SPECIALIZE_DIR) -QEMU_INCLUDES += -I$(TF_SOURCE_DIR) - -# work around TARGET_* poisoning -QEMU_CFLAGS += -DHW_POISON_H -# define a target to match testfloat's implementation-defined choices, such as -# whether to raise the invalid flag when dealing with NaNs in muladd. -QEMU_CFLAGS += -DTARGET_ARM - -# capstone has a platform.h file that clashes with softfloat's -QEMU_CFLAGS := $(filter-out %capstone, $(QEMU_CFLAGS)) - -# softfloat defines -SF_OPTS := -SF_OPTS += -DSOFTFLOAT_ROUND_ODD -SF_OPTS += -DINLINE_LEVEL=5 -SF_OPTS += -DSOFTFLOAT_FAST_DIV32TO16 -SF_OPTS += -DSOFTFLOAT_FAST_DIV64TO32 -SF_OPTS += -DSOFTFLOAT_FAST_INT64 -QEMU_CFLAGS += $(SF_OPTS) - -# silence the build of softfloat objects -SF_CFLAGS += -Wno-missing-prototypes -SF_CFLAGS += -Wno-redundant-decls -SF_CFLAGS += -Wno-return-type -SF_CFLAGS += -Wno-error - -# testfloat defines -TF_OPTS := -TF_OPTS += -DFLOAT16 -TF_OPTS += -DFLOAT64 -TF_OPTS += -DEXTFLOAT80 -TF_OPTS += -DFLOAT128 -TF_OPTS += -DFLOAT_ROUND_ODD -TF_OPTS += -DLONG_DOUBLE_IS_EXTFLOAT80 -QEMU_CFLAGS += $(TF_OPTS) - -# silence the build of testfloat objects -TF_CFLAGS := -TF_CFLAGS += -Wno-strict-prototypes -TF_CFLAGS += -Wno-unknown-pragmas -TF_CFLAGS += -Wno-uninitialized -TF_CFLAGS += -Wno-missing-prototypes -TF_CFLAGS += -Wno-return-type -TF_CFLAGS += -Wno-unused-function -TF_CFLAGS += -Wno-error - -# softfloat objects -SF_OBJS_PRIMITIVES := -SF_OBJS_PRIMITIVES += s_eq128.o -SF_OBJS_PRIMITIVES += s_le128.o -SF_OBJS_PRIMITIVES += s_lt128.o -SF_OBJS_PRIMITIVES += s_shortShiftLeft128.o -SF_OBJS_PRIMITIVES += s_shortShiftRight128.o -SF_OBJS_PRIMITIVES += s_shortShiftRightJam64.o -SF_OBJS_PRIMITIVES += s_shortShiftRightJam64Extra.o -SF_OBJS_PRIMITIVES += s_shortShiftRightJam128.o -SF_OBJS_PRIMITIVES += s_shortShiftRightJam128Extra.o -SF_OBJS_PRIMITIVES += s_shiftRightJam32.o -SF_OBJS_PRIMITIVES += s_shiftRightJam64.o -SF_OBJS_PRIMITIVES += s_shiftRightJam64Extra.o -SF_OBJS_PRIMITIVES += s_shiftRightJam128.o -SF_OBJS_PRIMITIVES += s_shiftRightJam128Extra.o -SF_OBJS_PRIMITIVES += s_shiftRightJam256M.o -SF_OBJS_PRIMITIVES += s_countLeadingZeros8.o -SF_OBJS_PRIMITIVES += s_countLeadingZeros16.o -SF_OBJS_PRIMITIVES += s_countLeadingZeros32.o -SF_OBJS_PRIMITIVES += s_countLeadingZeros64.o -SF_OBJS_PRIMITIVES += s_add128.o -SF_OBJS_PRIMITIVES += s_add256M.o -SF_OBJS_PRIMITIVES += s_sub128.o -SF_OBJS_PRIMITIVES += s_sub256M.o -SF_OBJS_PRIMITIVES += s_mul64ByShifted32To128.o -SF_OBJS_PRIMITIVES += s_mul64To128.o -SF_OBJS_PRIMITIVES += s_mul128By32.o -SF_OBJS_PRIMITIVES += s_mul128To256M.o -SF_OBJS_PRIMITIVES += s_approxRecip_1Ks.o -SF_OBJS_PRIMITIVES += s_approxRecip32_1.o -SF_OBJS_PRIMITIVES += s_approxRecipSqrt_1Ks.o -SF_OBJS_PRIMITIVES += s_approxRecipSqrt32_1.o - -SF_OBJS_SPECIALIZE := -SF_OBJS_SPECIALIZE += softfloat_raiseFlags.o -SF_OBJS_SPECIALIZE += s_f16UIToCommonNaN.o -SF_OBJS_SPECIALIZE += s_commonNaNToF16UI.o -SF_OBJS_SPECIALIZE += s_propagateNaNF16UI.o -SF_OBJS_SPECIALIZE += s_f32UIToCommonNaN.o -SF_OBJS_SPECIALIZE += s_commonNaNToF32UI.o -SF_OBJS_SPECIALIZE += s_propagateNaNF32UI.o -SF_OBJS_SPECIALIZE += s_f64UIToCommonNaN.o -SF_OBJS_SPECIALIZE += s_commonNaNToF64UI.o -SF_OBJS_SPECIALIZE += s_propagateNaNF64UI.o -SF_OBJS_SPECIALIZE += extF80M_isSignalingNaN.o -SF_OBJS_SPECIALIZE += s_extF80UIToCommonNaN.o -SF_OBJS_SPECIALIZE += s_commonNaNToExtF80UI.o -SF_OBJS_SPECIALIZE += s_propagateNaNExtF80UI.o -SF_OBJS_SPECIALIZE += f128M_isSignalingNaN.o -SF_OBJS_SPECIALIZE += s_f128UIToCommonNaN.o -SF_OBJS_SPECIALIZE += s_commonNaNToF128UI.o -SF_OBJS_SPECIALIZE += s_propagateNaNF128UI.o - -SF_OBJS_OTHERS := -SF_OBJS_OTHERS += s_roundToUI32.o -SF_OBJS_OTHERS += s_roundToUI64.o -SF_OBJS_OTHERS += s_roundToI32.o -SF_OBJS_OTHERS += s_roundToI64.o -SF_OBJS_OTHERS += s_normSubnormalF16Sig.o -SF_OBJS_OTHERS += s_roundPackToF16.o -SF_OBJS_OTHERS += s_normRoundPackToF16.o -SF_OBJS_OTHERS += s_addMagsF16.o -SF_OBJS_OTHERS += s_subMagsF16.o -SF_OBJS_OTHERS += s_mulAddF16.o -SF_OBJS_OTHERS += s_normSubnormalF32Sig.o -SF_OBJS_OTHERS += s_roundPackToF32.o -SF_OBJS_OTHERS += s_normRoundPackToF32.o -SF_OBJS_OTHERS += s_addMagsF32.o -SF_OBJS_OTHERS += s_subMagsF32.o -SF_OBJS_OTHERS += s_mulAddF32.o -SF_OBJS_OTHERS += s_normSubnormalF64Sig.o -SF_OBJS_OTHERS += s_roundPackToF64.o -SF_OBJS_OTHERS += s_normRoundPackToF64.o -SF_OBJS_OTHERS += s_addMagsF64.o -SF_OBJS_OTHERS += s_subMagsF64.o -SF_OBJS_OTHERS += s_mulAddF64.o -SF_OBJS_OTHERS += s_normSubnormalExtF80Sig.o -SF_OBJS_OTHERS += s_roundPackToExtF80.o -SF_OBJS_OTHERS += s_normRoundPackToExtF80.o -SF_OBJS_OTHERS += s_addMagsExtF80.o -SF_OBJS_OTHERS += s_subMagsExtF80.o -SF_OBJS_OTHERS += s_normSubnormalF128Sig.o -SF_OBJS_OTHERS += s_roundPackToF128.o -SF_OBJS_OTHERS += s_normRoundPackToF128.o -SF_OBJS_OTHERS += s_addMagsF128.o -SF_OBJS_OTHERS += s_subMagsF128.o -SF_OBJS_OTHERS += s_mulAddF128.o -SF_OBJS_OTHERS += softfloat_state.o -SF_OBJS_OTHERS += ui32_to_f16.o -SF_OBJS_OTHERS += ui32_to_f32.o -SF_OBJS_OTHERS += ui32_to_f64.o -SF_OBJS_OTHERS += ui32_to_extF80.o -SF_OBJS_OTHERS += ui32_to_extF80M.o -SF_OBJS_OTHERS += ui32_to_f128.o -SF_OBJS_OTHERS += ui32_to_f128M.o -SF_OBJS_OTHERS += ui64_to_f16.o -SF_OBJS_OTHERS += ui64_to_f32.o -SF_OBJS_OTHERS += ui64_to_f64.o -SF_OBJS_OTHERS += ui64_to_extF80.o -SF_OBJS_OTHERS += ui64_to_extF80M.o -SF_OBJS_OTHERS += ui64_to_f128.o -SF_OBJS_OTHERS += ui64_to_f128M.o -SF_OBJS_OTHERS += i32_to_f16.o -SF_OBJS_OTHERS += i32_to_f32.o -SF_OBJS_OTHERS += i32_to_f64.o -SF_OBJS_OTHERS += i32_to_extF80.o -SF_OBJS_OTHERS += i32_to_extF80M.o -SF_OBJS_OTHERS += i32_to_f128.o -SF_OBJS_OTHERS += i32_to_f128M.o -SF_OBJS_OTHERS += i64_to_f16.o -SF_OBJS_OTHERS += i64_to_f32.o -SF_OBJS_OTHERS += i64_to_f64.o -SF_OBJS_OTHERS += i64_to_extF80.o -SF_OBJS_OTHERS += i64_to_extF80M.o -SF_OBJS_OTHERS += i64_to_f128.o -SF_OBJS_OTHERS += i64_to_f128M.o -SF_OBJS_OTHERS += f16_to_ui32.o -SF_OBJS_OTHERS += f16_to_ui64.o -SF_OBJS_OTHERS += f16_to_i32.o -SF_OBJS_OTHERS += f16_to_i64.o -SF_OBJS_OTHERS += f16_to_ui32_r_minMag.o -SF_OBJS_OTHERS += f16_to_ui64_r_minMag.o -SF_OBJS_OTHERS += f16_to_i32_r_minMag.o -SF_OBJS_OTHERS += f16_to_i64_r_minMag.o -SF_OBJS_OTHERS += f16_to_f32.o -SF_OBJS_OTHERS += f16_to_f64.o -SF_OBJS_OTHERS += f16_to_extF80.o -SF_OBJS_OTHERS += f16_to_extF80M.o -SF_OBJS_OTHERS += f16_to_f128.o -SF_OBJS_OTHERS += f16_to_f128M.o -SF_OBJS_OTHERS += f16_roundToInt.o -SF_OBJS_OTHERS += f16_add.o -SF_OBJS_OTHERS += f16_sub.o -SF_OBJS_OTHERS += f16_mul.o -SF_OBJS_OTHERS += f16_mulAdd.o -SF_OBJS_OTHERS += f16_div.o -SF_OBJS_OTHERS += f16_rem.o -SF_OBJS_OTHERS += f16_sqrt.o -SF_OBJS_OTHERS += f16_eq.o -SF_OBJS_OTHERS += f16_le.o -SF_OBJS_OTHERS += f16_lt.o -SF_OBJS_OTHERS += f16_eq_signaling.o -SF_OBJS_OTHERS += f16_le_quiet.o -SF_OBJS_OTHERS += f16_lt_quiet.o -SF_OBJS_OTHERS += f16_isSignalingNaN.o -SF_OBJS_OTHERS += f32_to_ui32.o -SF_OBJS_OTHERS += f32_to_ui64.o -SF_OBJS_OTHERS += f32_to_i32.o -SF_OBJS_OTHERS += f32_to_i64.o -SF_OBJS_OTHERS += f32_to_ui32_r_minMag.o -SF_OBJS_OTHERS += f32_to_ui64_r_minMag.o -SF_OBJS_OTHERS += f32_to_i32_r_minMag.o -SF_OBJS_OTHERS += f32_to_i64_r_minMag.o -SF_OBJS_OTHERS += f32_to_f16.o -SF_OBJS_OTHERS += f32_to_f64.o -SF_OBJS_OTHERS += f32_to_extF80.o -SF_OBJS_OTHERS += f32_to_extF80M.o -SF_OBJS_OTHERS += f32_to_f128.o -SF_OBJS_OTHERS += f32_to_f128M.o -SF_OBJS_OTHERS += f32_roundToInt.o -SF_OBJS_OTHERS += f32_add.o -SF_OBJS_OTHERS += f32_sub.o -SF_OBJS_OTHERS += f32_mul.o -SF_OBJS_OTHERS += f32_mulAdd.o -SF_OBJS_OTHERS += f32_div.o -SF_OBJS_OTHERS += f32_rem.o -SF_OBJS_OTHERS += f32_sqrt.o -SF_OBJS_OTHERS += f32_eq.o -SF_OBJS_OTHERS += f32_le.o -SF_OBJS_OTHERS += f32_lt.o -SF_OBJS_OTHERS += f32_eq_signaling.o -SF_OBJS_OTHERS += f32_le_quiet.o -SF_OBJS_OTHERS += f32_lt_quiet.o -SF_OBJS_OTHERS += f32_isSignalingNaN.o -SF_OBJS_OTHERS += f64_to_ui32.o -SF_OBJS_OTHERS += f64_to_ui64.o -SF_OBJS_OTHERS += f64_to_i32.o -SF_OBJS_OTHERS += f64_to_i64.o -SF_OBJS_OTHERS += f64_to_ui32_r_minMag.o -SF_OBJS_OTHERS += f64_to_ui64_r_minMag.o -SF_OBJS_OTHERS += f64_to_i32_r_minMag.o -SF_OBJS_OTHERS += f64_to_i64_r_minMag.o -SF_OBJS_OTHERS += f64_to_f16.o -SF_OBJS_OTHERS += f64_to_f32.o -SF_OBJS_OTHERS += f64_to_extF80.o -SF_OBJS_OTHERS += f64_to_extF80M.o -SF_OBJS_OTHERS += f64_to_f128.o -SF_OBJS_OTHERS += f64_to_f128M.o -SF_OBJS_OTHERS += f64_roundToInt.o -SF_OBJS_OTHERS += f64_add.o -SF_OBJS_OTHERS += f64_sub.o -SF_OBJS_OTHERS += f64_mul.o -SF_OBJS_OTHERS += f64_mulAdd.o -SF_OBJS_OTHERS += f64_div.o -SF_OBJS_OTHERS += f64_rem.o -SF_OBJS_OTHERS += f64_sqrt.o -SF_OBJS_OTHERS += f64_eq.o -SF_OBJS_OTHERS += f64_le.o -SF_OBJS_OTHERS += f64_lt.o -SF_OBJS_OTHERS += f64_eq_signaling.o -SF_OBJS_OTHERS += f64_le_quiet.o -SF_OBJS_OTHERS += f64_lt_quiet.o -SF_OBJS_OTHERS += f64_isSignalingNaN.o -SF_OBJS_OTHERS += extF80_to_ui32.o -SF_OBJS_OTHERS += extF80_to_ui64.o -SF_OBJS_OTHERS += extF80_to_i32.o -SF_OBJS_OTHERS += extF80_to_i64.o -SF_OBJS_OTHERS += extF80_to_ui32_r_minMag.o -SF_OBJS_OTHERS += extF80_to_ui64_r_minMag.o -SF_OBJS_OTHERS += extF80_to_i32_r_minMag.o -SF_OBJS_OTHERS += extF80_to_i64_r_minMag.o -SF_OBJS_OTHERS += extF80_to_f16.o -SF_OBJS_OTHERS += extF80_to_f32.o -SF_OBJS_OTHERS += extF80_to_f64.o -SF_OBJS_OTHERS += extF80_to_f128.o -SF_OBJS_OTHERS += extF80_roundToInt.o -SF_OBJS_OTHERS += extF80_add.o -SF_OBJS_OTHERS += extF80_sub.o -SF_OBJS_OTHERS += extF80_mul.o -SF_OBJS_OTHERS += extF80_div.o -SF_OBJS_OTHERS += extF80_rem.o -SF_OBJS_OTHERS += extF80_sqrt.o -SF_OBJS_OTHERS += extF80_eq.o -SF_OBJS_OTHERS += extF80_le.o -SF_OBJS_OTHERS += extF80_lt.o -SF_OBJS_OTHERS += extF80_eq_signaling.o -SF_OBJS_OTHERS += extF80_le_quiet.o -SF_OBJS_OTHERS += extF80_lt_quiet.o -SF_OBJS_OTHERS += extF80_isSignalingNaN.o -SF_OBJS_OTHERS += extF80M_to_ui32.o -SF_OBJS_OTHERS += extF80M_to_ui64.o -SF_OBJS_OTHERS += extF80M_to_i32.o -SF_OBJS_OTHERS += extF80M_to_i64.o -SF_OBJS_OTHERS += extF80M_to_ui32_r_minMag.o -SF_OBJS_OTHERS += extF80M_to_ui64_r_minMag.o -SF_OBJS_OTHERS += extF80M_to_i32_r_minMag.o -SF_OBJS_OTHERS += extF80M_to_i64_r_minMag.o -SF_OBJS_OTHERS += extF80M_to_f16.o -SF_OBJS_OTHERS += extF80M_to_f32.o -SF_OBJS_OTHERS += extF80M_to_f64.o -SF_OBJS_OTHERS += extF80M_to_f128M.o -SF_OBJS_OTHERS += extF80M_roundToInt.o -SF_OBJS_OTHERS += extF80M_add.o -SF_OBJS_OTHERS += extF80M_sub.o -SF_OBJS_OTHERS += extF80M_mul.o -SF_OBJS_OTHERS += extF80M_div.o -SF_OBJS_OTHERS += extF80M_rem.o -SF_OBJS_OTHERS += extF80M_sqrt.o -SF_OBJS_OTHERS += extF80M_eq.o -SF_OBJS_OTHERS += extF80M_le.o -SF_OBJS_OTHERS += extF80M_lt.o -SF_OBJS_OTHERS += extF80M_eq_signaling.o -SF_OBJS_OTHERS += extF80M_le_quiet.o -SF_OBJS_OTHERS += extF80M_lt_quiet.o -SF_OBJS_OTHERS += f128_to_ui32.o -SF_OBJS_OTHERS += f128_to_ui64.o -SF_OBJS_OTHERS += f128_to_i32.o -SF_OBJS_OTHERS += f128_to_i64.o -SF_OBJS_OTHERS += f128_to_ui32_r_minMag.o -SF_OBJS_OTHERS += f128_to_ui64_r_minMag.o -SF_OBJS_OTHERS += f128_to_i32_r_minMag.o -SF_OBJS_OTHERS += f128_to_i64_r_minMag.o -SF_OBJS_OTHERS += f128_to_f16.o -SF_OBJS_OTHERS += f128_to_f32.o -SF_OBJS_OTHERS += f128_to_extF80.o -SF_OBJS_OTHERS += f128_to_f64.o -SF_OBJS_OTHERS += f128_roundToInt.o -SF_OBJS_OTHERS += f128_add.o -SF_OBJS_OTHERS += f128_sub.o -SF_OBJS_OTHERS += f128_mul.o -SF_OBJS_OTHERS += f128_mulAdd.o -SF_OBJS_OTHERS += f128_div.o -SF_OBJS_OTHERS += f128_rem.o -SF_OBJS_OTHERS += f128_sqrt.o -SF_OBJS_OTHERS += f128_eq.o -SF_OBJS_OTHERS += f128_le.o -SF_OBJS_OTHERS += f128_lt.o -SF_OBJS_OTHERS += f128_eq_signaling.o -SF_OBJS_OTHERS += f128_le_quiet.o -SF_OBJS_OTHERS += f128_lt_quiet.o -SF_OBJS_OTHERS += f128_isSignalingNaN.o -SF_OBJS_OTHERS += f128M_to_ui32.o -SF_OBJS_OTHERS += f128M_to_ui64.o -SF_OBJS_OTHERS += f128M_to_i32.o -SF_OBJS_OTHERS += f128M_to_i64.o -SF_OBJS_OTHERS += f128M_to_ui32_r_minMag.o -SF_OBJS_OTHERS += f128M_to_ui64_r_minMag.o -SF_OBJS_OTHERS += f128M_to_i32_r_minMag.o -SF_OBJS_OTHERS += f128M_to_i64_r_minMag.o -SF_OBJS_OTHERS += f128M_to_f16.o -SF_OBJS_OTHERS += f128M_to_f32.o -SF_OBJS_OTHERS += f128M_to_extF80M.o -SF_OBJS_OTHERS += f128M_to_f64.o -SF_OBJS_OTHERS += f128M_roundToInt.o -SF_OBJS_OTHERS += f128M_add.o -SF_OBJS_OTHERS += f128M_sub.o -SF_OBJS_OTHERS += f128M_mul.o -SF_OBJS_OTHERS += f128M_mulAdd.o -SF_OBJS_OTHERS += f128M_div.o -SF_OBJS_OTHERS += f128M_rem.o -SF_OBJS_OTHERS += f128M_sqrt.o -SF_OBJS_OTHERS += f128M_eq.o -SF_OBJS_OTHERS += f128M_le.o -SF_OBJS_OTHERS += f128M_lt.o -SF_OBJS_OTHERS += f128M_eq_signaling.o -SF_OBJS_OTHERS += f128M_le_quiet.o -SF_OBJS_OTHERS += f128M_lt_quiet.o - -SF_OBJS_ALL_NOSPEC := -SF_OBJS_ALL_NOSPEC += $(SF_OBJS_PRIMITIVES) -SF_OBJS_ALL_NOSPEC += $(SF_OBJS_OTHERS) - -SF_OBJS_ALL := -SF_OBJS_ALL += $(SF_OBJS_ALL_NOSPEC) -SF_OBJS_ALL += $(SF_OBJS_SPECIALIZE) - -# testfloat objects -TF_OBJS_GENCASES := -TF_OBJS_GENCASES += genCases_ui32.o -TF_OBJS_GENCASES += genCases_ui64.o -TF_OBJS_GENCASES += genCases_i32.o -TF_OBJS_GENCASES += genCases_i64.o -TF_OBJS_GENCASES += genCases_f16.o -TF_OBJS_GENCASES += genCases_f32.o -TF_OBJS_GENCASES += genCases_f64.o -TF_OBJS_GENCASES += genCases_extF80.o -TF_OBJS_GENCASES += genCases_f128.o - -TF_OBJS_WRITECASE := -TF_OBJS_WRITECASE += writeCase_a_ui32.o -TF_OBJS_WRITECASE += writeCase_a_ui64.o -TF_OBJS_WRITECASE += writeCase_a_f16.o -TF_OBJS_WRITECASE += writeCase_ab_f16.o -TF_OBJS_WRITECASE += writeCase_abc_f16.o -TF_OBJS_WRITECASE += writeCase_a_f32.o -TF_OBJS_WRITECASE += writeCase_ab_f32.o -TF_OBJS_WRITECASE += writeCase_abc_f32.o -TF_OBJS_WRITECASE += writeCase_a_f64.o -TF_OBJS_WRITECASE += writeCase_ab_f64.o -TF_OBJS_WRITECASE += writeCase_abc_f64.o -TF_OBJS_WRITECASE += writeCase_a_extF80M.o -TF_OBJS_WRITECASE += writeCase_ab_extF80M.o -TF_OBJS_WRITECASE += writeCase_a_f128M.o -TF_OBJS_WRITECASE += writeCase_ab_f128M.o -TF_OBJS_WRITECASE += writeCase_abc_f128M.o -TF_OBJS_WRITECASE += writeCase_z_bool.o -TF_OBJS_WRITECASE += writeCase_z_ui32.o -TF_OBJS_WRITECASE += writeCase_z_ui64.o -TF_OBJS_WRITECASE += writeCase_z_f16.o -TF_OBJS_WRITECASE += writeCase_z_f32.o -TF_OBJS_WRITECASE += writeCase_z_f64.o -TF_OBJS_WRITECASE += writeCase_z_extF80M.o -TF_OBJS_WRITECASE += writeCase_z_f128M.o - -TF_OBJS_TEST := -TF_OBJS_TEST += test_a_ui32_z_f16.o -TF_OBJS_TEST += test_a_ui32_z_f32.o -TF_OBJS_TEST += test_a_ui32_z_f64.o -TF_OBJS_TEST += test_a_ui32_z_extF80.o -TF_OBJS_TEST += test_a_ui32_z_f128.o -TF_OBJS_TEST += test_a_ui64_z_f16.o -TF_OBJS_TEST += test_a_ui64_z_f32.o -TF_OBJS_TEST += test_a_ui64_z_f64.o -TF_OBJS_TEST += test_a_ui64_z_extF80.o -TF_OBJS_TEST += test_a_ui64_z_f128.o -TF_OBJS_TEST += test_a_i32_z_f16.o -TF_OBJS_TEST += test_a_i32_z_f32.o -TF_OBJS_TEST += test_a_i32_z_f64.o -TF_OBJS_TEST += test_a_i32_z_extF80.o -TF_OBJS_TEST += test_a_i32_z_f128.o -TF_OBJS_TEST += test_a_i64_z_f16.o -TF_OBJS_TEST += test_a_i64_z_f32.o -TF_OBJS_TEST += test_a_i64_z_f64.o -TF_OBJS_TEST += test_a_i64_z_extF80.o -TF_OBJS_TEST += test_a_i64_z_f128.o -TF_OBJS_TEST += test_a_f16_z_ui32_rx.o -TF_OBJS_TEST += test_a_f16_z_ui64_rx.o -TF_OBJS_TEST += test_a_f16_z_i32_rx.o -TF_OBJS_TEST += test_a_f16_z_i64_rx.o -TF_OBJS_TEST += test_a_f16_z_ui32_x.o -TF_OBJS_TEST += test_a_f16_z_ui64_x.o -TF_OBJS_TEST += test_a_f16_z_i32_x.o -TF_OBJS_TEST += test_a_f16_z_i64_x.o -TF_OBJS_TEST += test_a_f16_z_f32.o -TF_OBJS_TEST += test_a_f16_z_f64.o -TF_OBJS_TEST += test_a_f16_z_extF80.o -TF_OBJS_TEST += test_a_f16_z_f128.o -TF_OBJS_TEST += test_az_f16.o -TF_OBJS_TEST += test_az_f16_rx.o -TF_OBJS_TEST += test_abz_f16.o -TF_OBJS_TEST += test_abcz_f16.o -TF_OBJS_TEST += test_ab_f16_z_bool.o -TF_OBJS_TEST += test_a_f32_z_ui32_rx.o -TF_OBJS_TEST += test_a_f32_z_ui64_rx.o -TF_OBJS_TEST += test_a_f32_z_i32_rx.o -TF_OBJS_TEST += test_a_f32_z_i64_rx.o -TF_OBJS_TEST += test_a_f32_z_ui32_x.o -TF_OBJS_TEST += test_a_f32_z_ui64_x.o -TF_OBJS_TEST += test_a_f32_z_i32_x.o -TF_OBJS_TEST += test_a_f32_z_i64_x.o -TF_OBJS_TEST += test_a_f32_z_f16.o -TF_OBJS_TEST += test_a_f32_z_f64.o -TF_OBJS_TEST += test_a_f32_z_extF80.o -TF_OBJS_TEST += test_a_f32_z_f128.o -TF_OBJS_TEST += test_az_f32.o -TF_OBJS_TEST += test_az_f32_rx.o -TF_OBJS_TEST += test_abz_f32.o -TF_OBJS_TEST += test_abcz_f32.o -TF_OBJS_TEST += test_ab_f32_z_bool.o -TF_OBJS_TEST += test_a_f64_z_ui32_rx.o -TF_OBJS_TEST += test_a_f64_z_ui64_rx.o -TF_OBJS_TEST += test_a_f64_z_i32_rx.o -TF_OBJS_TEST += test_a_f64_z_i64_rx.o -TF_OBJS_TEST += test_a_f64_z_ui32_x.o -TF_OBJS_TEST += test_a_f64_z_ui64_x.o -TF_OBJS_TEST += test_a_f64_z_i32_x.o -TF_OBJS_TEST += test_a_f64_z_i64_x.o -TF_OBJS_TEST += test_a_f64_z_f16.o -TF_OBJS_TEST += test_a_f64_z_f32.o -TF_OBJS_TEST += test_a_f64_z_extF80.o -TF_OBJS_TEST += test_a_f64_z_f128.o -TF_OBJS_TEST += test_az_f64.o -TF_OBJS_TEST += test_az_f64_rx.o -TF_OBJS_TEST += test_abz_f64.o -TF_OBJS_TEST += test_abcz_f64.o -TF_OBJS_TEST += test_ab_f64_z_bool.o -TF_OBJS_TEST += test_a_extF80_z_ui32_rx.o -TF_OBJS_TEST += test_a_extF80_z_ui64_rx.o -TF_OBJS_TEST += test_a_extF80_z_i32_rx.o -TF_OBJS_TEST += test_a_extF80_z_i64_rx.o -TF_OBJS_TEST += test_a_extF80_z_ui32_x.o -TF_OBJS_TEST += test_a_extF80_z_ui64_x.o -TF_OBJS_TEST += test_a_extF80_z_i32_x.o -TF_OBJS_TEST += test_a_extF80_z_i64_x.o -TF_OBJS_TEST += test_a_extF80_z_f16.o -TF_OBJS_TEST += test_a_extF80_z_f32.o -TF_OBJS_TEST += test_a_extF80_z_f64.o -TF_OBJS_TEST += test_a_extF80_z_f128.o -TF_OBJS_TEST += test_az_extF80.o -TF_OBJS_TEST += test_az_extF80_rx.o -TF_OBJS_TEST += test_abz_extF80.o -TF_OBJS_TEST += test_ab_extF80_z_bool.o -TF_OBJS_TEST += test_a_f128_z_ui32_rx.o -TF_OBJS_TEST += test_a_f128_z_ui64_rx.o -TF_OBJS_TEST += test_a_f128_z_i32_rx.o -TF_OBJS_TEST += test_a_f128_z_i64_rx.o -TF_OBJS_TEST += test_a_f128_z_ui32_x.o -TF_OBJS_TEST += test_a_f128_z_ui64_x.o -TF_OBJS_TEST += test_a_f128_z_i32_x.o -TF_OBJS_TEST += test_a_f128_z_i64_x.o -TF_OBJS_TEST += test_a_f128_z_f16.o -TF_OBJS_TEST += test_a_f128_z_f32.o -TF_OBJS_TEST += test_a_f128_z_f64.o -TF_OBJS_TEST += test_a_f128_z_extF80.o -TF_OBJS_TEST += test_az_f128.o -TF_OBJS_TEST += test_az_f128_rx.o -TF_OBJS_TEST += test_abz_f128.o -TF_OBJS_TEST += test_abcz_f128.o -TF_OBJS_TEST += test_ab_f128_z_bool.o - -TF_OBJS_LIB := -TF_OBJS_LIB += uint128_inline.o -TF_OBJS_LIB += uint128.o -TF_OBJS_LIB += fail.o -TF_OBJS_LIB += functions_common.o -TF_OBJS_LIB += functionInfos.o -TF_OBJS_LIB += standardFunctionInfos.o -TF_OBJS_LIB += random.o -TF_OBJS_LIB += genCases_common.o -TF_OBJS_LIB += $(TF_OBJS_GENCASES) -TF_OBJS_LIB += genCases_writeTestsTotal.o -TF_OBJS_LIB += verCases_inline.o -TF_OBJS_LIB += verCases_common.o -TF_OBJS_LIB += verCases_writeFunctionName.o -TF_OBJS_LIB += readHex.o -TF_OBJS_LIB += writeHex.o -TF_OBJS_LIB += $(TF_OBJS_WRITECASE) -TF_OBJS_LIB += testLoops_common.o -TF_OBJS_LIB += $(TF_OBJS_TEST) - -BINARIES := fp-test$(EXESUF) fp-bench$(EXESUF) - -# We require artefacts from the main build including config-host.h -# because platform.h includes it. Rather than re-invoking the main -# build we just error out if things aren't there. -$(LIBQEMUUTIL) $(BUILD_DIR)/config-host.h: - $(error $@ missing, re-run parent build) - -all: $(BUILD_DIR)/config-host.h $(BINARIES) - -# libtestfloat.a depends on libsoftfloat.a, so specify it first -FP_TEST_LIBS := libtestfloat.a libsoftfloat.a $(LIBQEMUUTIL) - -fp-test$(EXESUF): fp-test.o slowfloat.o $(QEMU_SOFTFLOAT_OBJ) $(FP_TEST_LIBS) - -# Custom rule to build with SF_CFLAGS -SF_BUILD = $(call quiet-command,$(CC) $(QEMU_LOCAL_INCLUDES) $(QEMU_INCLUDES) \ - $(QEMU_CFLAGS) $(SF_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) \ - $($@-cflags) -c -o $@ $<,"CC","$(TARGET_DIR)$@") - -$(SF_OBJS_ALL_NOSPEC): %.o: $(SF_SOURCE_DIR)/%.c - $(SF_BUILD) -$(SF_OBJS_SPECIALIZE): %.o: $(SF_SPECIALIZE_DIR)/%.c - $(SF_BUILD) - -libsoftfloat.a: $(SF_OBJS_ALL) - -# Custom rule to build with TF_CFLAGS -$(TF_OBJS_LIB) slowfloat.o: %.o: $(TF_SOURCE_DIR)/%.c - $(call quiet-command,$(CC) $(QEMU_LOCAL_INCLUDES) $(QEMU_INCLUDES) \ - $(QEMU_CFLAGS) $(TF_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) \ - $($@-cflags) -c -o $@ $<,"CC","$(TARGET_DIR)$@") - -libtestfloat.a: $(TF_OBJS_LIB) - -fp-bench$(EXESUF): fp-bench.o $(QEMU_SOFTFLOAT_OBJ) $(LIBQEMUUTIL) - -clean: - rm -f *.o *.d $(BINARIES) - rm -f *.gcno *.gcda *.gcov - rm -f fp-test$(EXESUF) - rm -f fp-bench$(EXESUF) - rm -f libsoftfloat.a - rm -f libtestfloat.a - --include $(wildcard *.d) diff --git a/tests/fp/fp-test.c b/tests/fp/fp-test.c index 43ef9628c4..06ffebd6db 100644 --- a/tests/fp/fp-test.c +++ b/tests/fp/fp-test.c @@ -116,7 +116,7 @@ static void usage_complete(int argc, char *argv[]) } /* keep wrappers separate but do not bother defining headers for all of them */ -#include "wrap.inc.c" +#include "wrap.c.inc" static void not_implemented(void) { diff --git a/tests/fp/meson.build b/tests/fp/meson.build new file mode 100644 index 0000000000..8779a17aab --- /dev/null +++ b/tests/fp/meson.build @@ -0,0 +1,636 @@ +# There are namespace pollution issues on Windows, due to osdep.h +# bringing in Windows headers that define a FLOAT128 type. +if targetos == 'windows' + subdir_done() +endif + +fpcflags = [ + # softfloat defines + '-DSOFTFLOAT_ROUND_ODD', + '-DINLINE_LEVEL=5', + '-DSOFTFLOAT_FAST_DIV32TO16', + '-DSOFTFLOAT_FAST_DIV64TO32', + '-DSOFTFLOAT_FAST_INT64', + # testfloat defines + '-DFLOAT16', + '-DFLOAT64', + '-DEXTFLOAT80', + '-DFLOAT128', + '-DFLOAT_ROUND_ODD', + '-DLONG_DOUBLE_IS_EXTFLOAT80', +] + +sfdir = 'berkeley-softfloat-3/source' +sfspedir = sfdir / '8086-SSE' +tfdir = 'berkeley-testfloat-3/source' + +sfinc = include_directories(sfdir / 'include', sfspedir) + +tfcflags = [ + '-Wno-strict-prototypes', + '-Wno-unknown-pragmas', + '-Wno-uninitialized', + '-Wno-missing-prototypes', + '-Wno-return-type', + '-Wno-unused-function', + '-Wno-error', +] + +tfgencases = [ + tfdir / 'genCases_ui32.c', + tfdir / 'genCases_ui64.c', + tfdir / 'genCases_i32.c', + tfdir / 'genCases_i64.c', + tfdir / 'genCases_f16.c', + tfdir / 'genCases_f32.c', + tfdir / 'genCases_f64.c', + tfdir / 'genCases_extF80.c', + tfdir / 'genCases_f128.c', +] + +tfwritecase = [ + tfdir / 'writeCase_a_ui32.c', + tfdir / 'writeCase_a_ui64.c', + tfdir / 'writeCase_a_f16.c', + tfdir / 'writeCase_ab_f16.c', + tfdir / 'writeCase_abc_f16.c', + tfdir / 'writeCase_a_f32.c', + tfdir / 'writeCase_ab_f32.c', + tfdir / 'writeCase_abc_f32.c', + tfdir / 'writeCase_a_f64.c', + tfdir / 'writeCase_ab_f64.c', + tfdir / 'writeCase_abc_f64.c', + tfdir / 'writeCase_a_extF80M.c', + tfdir / 'writeCase_ab_extF80M.c', + tfdir / 'writeCase_a_f128M.c', + tfdir / 'writeCase_ab_f128M.c', + tfdir / 'writeCase_abc_f128M.c', + tfdir / 'writeCase_z_bool.c', + tfdir / 'writeCase_z_ui32.c', + tfdir / 'writeCase_z_ui64.c', + tfdir / 'writeCase_z_f16.c', + tfdir / 'writeCase_z_f32.c', + tfdir / 'writeCase_z_f64.c', + tfdir / 'writeCase_z_extF80M.c', + tfdir / 'writeCase_z_f128M.c', +] + +tftest = [ + tfdir / 'test_a_ui32_z_f16.c', + tfdir / 'test_a_ui32_z_f32.c', + tfdir / 'test_a_ui32_z_f64.c', + tfdir / 'test_a_ui32_z_extF80.c', + tfdir / 'test_a_ui32_z_f128.c', + tfdir / 'test_a_ui64_z_f16.c', + tfdir / 'test_a_ui64_z_f32.c', + tfdir / 'test_a_ui64_z_f64.c', + tfdir / 'test_a_ui64_z_extF80.c', + tfdir / 'test_a_ui64_z_f128.c', + tfdir / 'test_a_i32_z_f16.c', + tfdir / 'test_a_i32_z_f32.c', + tfdir / 'test_a_i32_z_f64.c', + tfdir / 'test_a_i32_z_extF80.c', + tfdir / 'test_a_i32_z_f128.c', + tfdir / 'test_a_i64_z_f16.c', + tfdir / 'test_a_i64_z_f32.c', + tfdir / 'test_a_i64_z_f64.c', + tfdir / 'test_a_i64_z_extF80.c', + tfdir / 'test_a_i64_z_f128.c', + tfdir / 'test_a_f16_z_ui32_rx.c', + tfdir / 'test_a_f16_z_ui64_rx.c', + tfdir / 'test_a_f16_z_i32_rx.c', + tfdir / 'test_a_f16_z_i64_rx.c', + tfdir / 'test_a_f16_z_ui32_x.c', + tfdir / 'test_a_f16_z_ui64_x.c', + tfdir / 'test_a_f16_z_i32_x.c', + tfdir / 'test_a_f16_z_i64_x.c', + tfdir / 'test_a_f16_z_f32.c', + tfdir / 'test_a_f16_z_f64.c', + tfdir / 'test_a_f16_z_extF80.c', + tfdir / 'test_a_f16_z_f128.c', + tfdir / 'test_az_f16.c', + tfdir / 'test_az_f16_rx.c', + tfdir / 'test_abz_f16.c', + tfdir / 'test_abcz_f16.c', + tfdir / 'test_ab_f16_z_bool.c', + tfdir / 'test_a_f32_z_ui32_rx.c', + tfdir / 'test_a_f32_z_ui64_rx.c', + tfdir / 'test_a_f32_z_i32_rx.c', + tfdir / 'test_a_f32_z_i64_rx.c', + tfdir / 'test_a_f32_z_ui32_x.c', + tfdir / 'test_a_f32_z_ui64_x.c', + tfdir / 'test_a_f32_z_i32_x.c', + tfdir / 'test_a_f32_z_i64_x.c', + tfdir / 'test_a_f32_z_f16.c', + tfdir / 'test_a_f32_z_f64.c', + tfdir / 'test_a_f32_z_extF80.c', + tfdir / 'test_a_f32_z_f128.c', + tfdir / 'test_az_f32.c', + tfdir / 'test_az_f32_rx.c', + tfdir / 'test_abz_f32.c', + tfdir / 'test_abcz_f32.c', + tfdir / 'test_ab_f32_z_bool.c', + tfdir / 'test_a_f64_z_ui32_rx.c', + tfdir / 'test_a_f64_z_ui64_rx.c', + tfdir / 'test_a_f64_z_i32_rx.c', + tfdir / 'test_a_f64_z_i64_rx.c', + tfdir / 'test_a_f64_z_ui32_x.c', + tfdir / 'test_a_f64_z_ui64_x.c', + tfdir / 'test_a_f64_z_i32_x.c', + tfdir / 'test_a_f64_z_i64_x.c', + tfdir / 'test_a_f64_z_f16.c', + tfdir / 'test_a_f64_z_f32.c', + tfdir / 'test_a_f64_z_extF80.c', + tfdir / 'test_a_f64_z_f128.c', + tfdir / 'test_az_f64.c', + tfdir / 'test_az_f64_rx.c', + tfdir / 'test_abz_f64.c', + tfdir / 'test_abcz_f64.c', + tfdir / 'test_ab_f64_z_bool.c', + tfdir / 'test_a_extF80_z_ui32_rx.c', + tfdir / 'test_a_extF80_z_ui64_rx.c', + tfdir / 'test_a_extF80_z_i32_rx.c', + tfdir / 'test_a_extF80_z_i64_rx.c', + tfdir / 'test_a_extF80_z_ui32_x.c', + tfdir / 'test_a_extF80_z_ui64_x.c', + tfdir / 'test_a_extF80_z_i32_x.c', + tfdir / 'test_a_extF80_z_i64_x.c', + tfdir / 'test_a_extF80_z_f16.c', + tfdir / 'test_a_extF80_z_f32.c', + tfdir / 'test_a_extF80_z_f64.c', + tfdir / 'test_a_extF80_z_f128.c', + tfdir / 'test_az_extF80.c', + tfdir / 'test_az_extF80_rx.c', + tfdir / 'test_abz_extF80.c', + tfdir / 'test_ab_extF80_z_bool.c', + tfdir / 'test_a_f128_z_ui32_rx.c', + tfdir / 'test_a_f128_z_ui64_rx.c', + tfdir / 'test_a_f128_z_i32_rx.c', + tfdir / 'test_a_f128_z_i64_rx.c', + tfdir / 'test_a_f128_z_ui32_x.c', + tfdir / 'test_a_f128_z_ui64_x.c', + tfdir / 'test_a_f128_z_i32_x.c', + tfdir / 'test_a_f128_z_i64_x.c', + tfdir / 'test_a_f128_z_f16.c', + tfdir / 'test_a_f128_z_f32.c', + tfdir / 'test_a_f128_z_f64.c', + tfdir / 'test_a_f128_z_extF80.c', + tfdir / 'test_az_f128.c', + tfdir / 'test_az_f128_rx.c', + tfdir / 'test_abz_f128.c', + tfdir / 'test_abcz_f128.c', + tfdir / 'test_ab_f128_z_bool.c', +] + +libtestfloat = static_library( + 'testfloat', + files( + tfdir / 'uint128_inline.c', + tfdir / 'uint128.c', + tfdir / 'fail.c', + tfdir / 'functions_common.c', + tfdir / 'functionInfos.c', + tfdir / 'standardFunctionInfos.c', + tfdir / 'random.c', + tfdir / 'genCases_common.c', + tfgencases, + tfdir / 'genCases_writeTestsTotal.c', + tfdir / 'verCases_inline.c', + tfdir / 'verCases_common.c', + tfdir / 'verCases_writeFunctionName.c', + tfdir / 'readHex.c', + tfdir / 'writeHex.c', + tfwritecase, + tfdir / 'testLoops_common.c', + tftest, + ), + include_directories: sfinc, + c_args: tfcflags + fpcflags, +) + +sfcflags = [ + '-Wno-missing-prototypes', + '-Wno-redundant-decls', + '-Wno-return-type', + '-Wno-error', +] + +libsoftfloat = static_library( + 'softfloat', + files( + # primitives + sfdir / 's_eq128.c', + sfdir / 's_le128.c', + sfdir / 's_lt128.c', + sfdir / 's_shortShiftLeft128.c', + sfdir / 's_shortShiftRight128.c', + sfdir / 's_shortShiftRightJam64.c', + sfdir / 's_shortShiftRightJam64Extra.c', + sfdir / 's_shortShiftRightJam128.c', + sfdir / 's_shortShiftRightJam128Extra.c', + sfdir / 's_shiftRightJam32.c', + sfdir / 's_shiftRightJam64.c', + sfdir / 's_shiftRightJam64Extra.c', + sfdir / 's_shiftRightJam128.c', + sfdir / 's_shiftRightJam128Extra.c', + sfdir / 's_shiftRightJam256M.c', + sfdir / 's_countLeadingZeros8.c', + sfdir / 's_countLeadingZeros16.c', + sfdir / 's_countLeadingZeros32.c', + sfdir / 's_countLeadingZeros64.c', + sfdir / 's_add128.c', + sfdir / 's_add256M.c', + sfdir / 's_sub128.c', + sfdir / 's_sub256M.c', + sfdir / 's_mul64ByShifted32To128.c', + sfdir / 's_mul64To128.c', + sfdir / 's_mul128By32.c', + sfdir / 's_mul128To256M.c', + sfdir / 's_approxRecip_1Ks.c', + sfdir / 's_approxRecip32_1.c', + sfdir / 's_approxRecipSqrt_1Ks.c', + sfdir / 's_approxRecipSqrt32_1.c', + # others + sfdir / 's_roundToUI32.c', + sfdir / 's_roundToUI64.c', + sfdir / 's_roundToI32.c', + sfdir / 's_roundToI64.c', + sfdir / 's_normSubnormalF16Sig.c', + sfdir / 's_roundPackToF16.c', + sfdir / 's_normRoundPackToF16.c', + sfdir / 's_addMagsF16.c', + sfdir / 's_subMagsF16.c', + sfdir / 's_mulAddF16.c', + sfdir / 's_normSubnormalF32Sig.c', + sfdir / 's_roundPackToF32.c', + sfdir / 's_normRoundPackToF32.c', + sfdir / 's_addMagsF32.c', + sfdir / 's_subMagsF32.c', + sfdir / 's_mulAddF32.c', + sfdir / 's_normSubnormalF64Sig.c', + sfdir / 's_roundPackToF64.c', + sfdir / 's_normRoundPackToF64.c', + sfdir / 's_addMagsF64.c', + sfdir / 's_subMagsF64.c', + sfdir / 's_mulAddF64.c', + sfdir / 's_normSubnormalExtF80Sig.c', + sfdir / 's_roundPackToExtF80.c', + sfdir / 's_normRoundPackToExtF80.c', + sfdir / 's_addMagsExtF80.c', + sfdir / 's_subMagsExtF80.c', + sfdir / 's_normSubnormalF128Sig.c', + sfdir / 's_roundPackToF128.c', + sfdir / 's_normRoundPackToF128.c', + sfdir / 's_addMagsF128.c', + sfdir / 's_subMagsF128.c', + sfdir / 's_mulAddF128.c', + sfdir / 'softfloat_state.c', + sfdir / 'ui32_to_f16.c', + sfdir / 'ui32_to_f32.c', + sfdir / 'ui32_to_f64.c', + sfdir / 'ui32_to_extF80.c', + sfdir / 'ui32_to_extF80M.c', + sfdir / 'ui32_to_f128.c', + sfdir / 'ui32_to_f128M.c', + sfdir / 'ui64_to_f16.c', + sfdir / 'ui64_to_f32.c', + sfdir / 'ui64_to_f64.c', + sfdir / 'ui64_to_extF80.c', + sfdir / 'ui64_to_extF80M.c', + sfdir / 'ui64_to_f128.c', + sfdir / 'ui64_to_f128M.c', + sfdir / 'i32_to_f16.c', + sfdir / 'i32_to_f32.c', + sfdir / 'i32_to_f64.c', + sfdir / 'i32_to_extF80.c', + sfdir / 'i32_to_extF80M.c', + sfdir / 'i32_to_f128.c', + sfdir / 'i32_to_f128M.c', + sfdir / 'i64_to_f16.c', + sfdir / 'i64_to_f32.c', + sfdir / 'i64_to_f64.c', + sfdir / 'i64_to_extF80.c', + sfdir / 'i64_to_extF80M.c', + sfdir / 'i64_to_f128.c', + sfdir / 'i64_to_f128M.c', + sfdir / 'f16_to_ui32.c', + sfdir / 'f16_to_ui64.c', + sfdir / 'f16_to_i32.c', + sfdir / 'f16_to_i64.c', + sfdir / 'f16_to_ui32_r_minMag.c', + sfdir / 'f16_to_ui64_r_minMag.c', + sfdir / 'f16_to_i32_r_minMag.c', + sfdir / 'f16_to_i64_r_minMag.c', + sfdir / 'f16_to_f32.c', + sfdir / 'f16_to_f64.c', + sfdir / 'f16_to_extF80.c', + sfdir / 'f16_to_extF80M.c', + sfdir / 'f16_to_f128.c', + sfdir / 'f16_to_f128M.c', + sfdir / 'f16_roundToInt.c', + sfdir / 'f16_add.c', + sfdir / 'f16_sub.c', + sfdir / 'f16_mul.c', + sfdir / 'f16_mulAdd.c', + sfdir / 'f16_div.c', + sfdir / 'f16_rem.c', + sfdir / 'f16_sqrt.c', + sfdir / 'f16_eq.c', + sfdir / 'f16_le.c', + sfdir / 'f16_lt.c', + sfdir / 'f16_eq_signaling.c', + sfdir / 'f16_le_quiet.c', + sfdir / 'f16_lt_quiet.c', + sfdir / 'f16_isSignalingNaN.c', + sfdir / 'f32_to_ui32.c', + sfdir / 'f32_to_ui64.c', + sfdir / 'f32_to_i32.c', + sfdir / 'f32_to_i64.c', + sfdir / 'f32_to_ui32_r_minMag.c', + sfdir / 'f32_to_ui64_r_minMag.c', + sfdir / 'f32_to_i32_r_minMag.c', + sfdir / 'f32_to_i64_r_minMag.c', + sfdir / 'f32_to_f16.c', + sfdir / 'f32_to_f64.c', + sfdir / 'f32_to_extF80.c', + sfdir / 'f32_to_extF80M.c', + sfdir / 'f32_to_f128.c', + sfdir / 'f32_to_f128M.c', + sfdir / 'f32_roundToInt.c', + sfdir / 'f32_add.c', + sfdir / 'f32_sub.c', + sfdir / 'f32_mul.c', + sfdir / 'f32_mulAdd.c', + sfdir / 'f32_div.c', + sfdir / 'f32_rem.c', + sfdir / 'f32_sqrt.c', + sfdir / 'f32_eq.c', + sfdir / 'f32_le.c', + sfdir / 'f32_lt.c', + sfdir / 'f32_eq_signaling.c', + sfdir / 'f32_le_quiet.c', + sfdir / 'f32_lt_quiet.c', + sfdir / 'f32_isSignalingNaN.c', + sfdir / 'f64_to_ui32.c', + sfdir / 'f64_to_ui64.c', + sfdir / 'f64_to_i32.c', + sfdir / 'f64_to_i64.c', + sfdir / 'f64_to_ui32_r_minMag.c', + sfdir / 'f64_to_ui64_r_minMag.c', + sfdir / 'f64_to_i32_r_minMag.c', + sfdir / 'f64_to_i64_r_minMag.c', + sfdir / 'f64_to_f16.c', + sfdir / 'f64_to_f32.c', + sfdir / 'f64_to_extF80.c', + sfdir / 'f64_to_extF80M.c', + sfdir / 'f64_to_f128.c', + sfdir / 'f64_to_f128M.c', + sfdir / 'f64_roundToInt.c', + sfdir / 'f64_add.c', + sfdir / 'f64_sub.c', + sfdir / 'f64_mul.c', + sfdir / 'f64_mulAdd.c', + sfdir / 'f64_div.c', + sfdir / 'f64_rem.c', + sfdir / 'f64_sqrt.c', + sfdir / 'f64_eq.c', + sfdir / 'f64_le.c', + sfdir / 'f64_lt.c', + sfdir / 'f64_eq_signaling.c', + sfdir / 'f64_le_quiet.c', + sfdir / 'f64_lt_quiet.c', + sfdir / 'f64_isSignalingNaN.c', + sfdir / 'extF80_to_ui32.c', + sfdir / 'extF80_to_ui64.c', + sfdir / 'extF80_to_i32.c', + sfdir / 'extF80_to_i64.c', + sfdir / 'extF80_to_ui32_r_minMag.c', + sfdir / 'extF80_to_ui64_r_minMag.c', + sfdir / 'extF80_to_i32_r_minMag.c', + sfdir / 'extF80_to_i64_r_minMag.c', + sfdir / 'extF80_to_f16.c', + sfdir / 'extF80_to_f32.c', + sfdir / 'extF80_to_f64.c', + sfdir / 'extF80_to_f128.c', + sfdir / 'extF80_roundToInt.c', + sfdir / 'extF80_add.c', + sfdir / 'extF80_sub.c', + sfdir / 'extF80_mul.c', + sfdir / 'extF80_div.c', + sfdir / 'extF80_rem.c', + sfdir / 'extF80_sqrt.c', + sfdir / 'extF80_eq.c', + sfdir / 'extF80_le.c', + sfdir / 'extF80_lt.c', + sfdir / 'extF80_eq_signaling.c', + sfdir / 'extF80_le_quiet.c', + sfdir / 'extF80_lt_quiet.c', + sfdir / 'extF80_isSignalingNaN.c', + sfdir / 'extF80M_to_ui32.c', + sfdir / 'extF80M_to_ui64.c', + sfdir / 'extF80M_to_i32.c', + sfdir / 'extF80M_to_i64.c', + sfdir / 'extF80M_to_ui32_r_minMag.c', + sfdir / 'extF80M_to_ui64_r_minMag.c', + sfdir / 'extF80M_to_i32_r_minMag.c', + sfdir / 'extF80M_to_i64_r_minMag.c', + sfdir / 'extF80M_to_f16.c', + sfdir / 'extF80M_to_f32.c', + sfdir / 'extF80M_to_f64.c', + sfdir / 'extF80M_to_f128M.c', + sfdir / 'extF80M_roundToInt.c', + sfdir / 'extF80M_add.c', + sfdir / 'extF80M_sub.c', + sfdir / 'extF80M_mul.c', + sfdir / 'extF80M_div.c', + sfdir / 'extF80M_rem.c', + sfdir / 'extF80M_sqrt.c', + sfdir / 'extF80M_eq.c', + sfdir / 'extF80M_le.c', + sfdir / 'extF80M_lt.c', + sfdir / 'extF80M_eq_signaling.c', + sfdir / 'extF80M_le_quiet.c', + sfdir / 'extF80M_lt_quiet.c', + sfdir / 'f128_to_ui32.c', + sfdir / 'f128_to_ui64.c', + sfdir / 'f128_to_i32.c', + sfdir / 'f128_to_i64.c', + sfdir / 'f128_to_ui32_r_minMag.c', + sfdir / 'f128_to_ui64_r_minMag.c', + sfdir / 'f128_to_i32_r_minMag.c', + sfdir / 'f128_to_i64_r_minMag.c', + sfdir / 'f128_to_f16.c', + sfdir / 'f128_to_f32.c', + sfdir / 'f128_to_extF80.c', + sfdir / 'f128_to_f64.c', + sfdir / 'f128_roundToInt.c', + sfdir / 'f128_add.c', + sfdir / 'f128_sub.c', + sfdir / 'f128_mul.c', + sfdir / 'f128_mulAdd.c', + sfdir / 'f128_div.c', + sfdir / 'f128_rem.c', + sfdir / 'f128_sqrt.c', + sfdir / 'f128_eq.c', + sfdir / 'f128_le.c', + sfdir / 'f128_lt.c', + sfdir / 'f128_eq_signaling.c', + sfdir / 'f128_le_quiet.c', + sfdir / 'f128_lt_quiet.c', + sfdir / 'f128_isSignalingNaN.c', + sfdir / 'f128M_to_ui32.c', + sfdir / 'f128M_to_ui64.c', + sfdir / 'f128M_to_i32.c', + sfdir / 'f128M_to_i64.c', + sfdir / 'f128M_to_ui32_r_minMag.c', + sfdir / 'f128M_to_ui64_r_minMag.c', + sfdir / 'f128M_to_i32_r_minMag.c', + sfdir / 'f128M_to_i64_r_minMag.c', + sfdir / 'f128M_to_f16.c', + sfdir / 'f128M_to_f32.c', + sfdir / 'f128M_to_extF80M.c', + sfdir / 'f128M_to_f64.c', + sfdir / 'f128M_roundToInt.c', + sfdir / 'f128M_add.c', + sfdir / 'f128M_sub.c', + sfdir / 'f128M_mul.c', + sfdir / 'f128M_mulAdd.c', + sfdir / 'f128M_div.c', + sfdir / 'f128M_rem.c', + sfdir / 'f128M_sqrt.c', + sfdir / 'f128M_eq.c', + sfdir / 'f128M_le.c', + sfdir / 'f128M_lt.c', + sfdir / 'f128M_eq_signaling.c', + sfdir / 'f128M_le_quiet.c', + sfdir / 'f128M_lt_quiet.c', + # spe + sfspedir / 'softfloat_raiseFlags.c', + sfspedir / 's_f16UIToCommonNaN.c', + sfspedir / 's_commonNaNToF16UI.c', + sfspedir / 's_propagateNaNF16UI.c', + sfspedir / 's_f32UIToCommonNaN.c', + sfspedir / 's_commonNaNToF32UI.c', + sfspedir / 's_propagateNaNF32UI.c', + sfspedir / 's_f64UIToCommonNaN.c', + sfspedir / 's_commonNaNToF64UI.c', + sfspedir / 's_propagateNaNF64UI.c', + sfspedir / 'extF80M_isSignalingNaN.c', + sfspedir / 's_extF80UIToCommonNaN.c', + sfspedir / 's_commonNaNToExtF80UI.c', + sfspedir / 's_propagateNaNExtF80UI.c', + sfspedir / 'f128M_isSignalingNaN.c', + sfspedir / 's_f128UIToCommonNaN.c', + sfspedir / 's_commonNaNToF128UI.c', + sfspedir / 's_propagateNaNF128UI.c', + ), + include_directories: sfinc, + c_args: sfcflags + fpcflags, +) + +fpcflags += [ + # work around TARGET_* poisoning + '-DHW_POISON_H', + # define a target to match testfloat's implementation-defined choices, such as + # whether to raise the invalid flag when dealing with NaNs in muladd. + '-DTARGET_ARM', + # FIXME: uiZ may be used uninitialized in this function + '-Wno-uninitialized', +] + +fptest = executable( + 'fp-test', + ['fp-test.c', tfdir / 'slowfloat.c', '../../fpu/softfloat.c'], + build_by_default: false, + link_with: [libtestfloat, libsoftfloat], + dependencies: [qemuutil], + include_directories: [sfinc, include_directories(tfdir)], + c_args: fpcflags, +) +softfloat_conv_tests = { + 'float-to-float': 'f16_to_f32 f16_to_f64 f16_to_extF80 f16_to_f128 ' + + 'f32_to_f16 f32_to_f64 f32_to_extF80 ' + + 'f64_to_f16 f64_to_f32 ' + + 'extF80_to_f16 extF80_to_f32 ' + + 'extF80_to_f64 extF80_to_f128 ' + + 'f128_to_f16', + 'int-to-float': 'i32_to_f16 i64_to_f16 i32_to_f32 i64_to_f32 ' + + 'i32_to_f64 i64_to_f64 i32_to_f128 i64_to_f128', + 'uint-to-float': 'ui32_to_f16 ui64_to_f16 ui32_to_f32 ui64_to_f32 ' + + 'ui32_to_f64 ui64_to_f64 ui64_to_f128 ' + + 'ui32_to_extF80 ui64_to_extF80', + 'float-to-int': 'f16_to_i32 f16_to_i32_r_minMag ' + + 'f32_to_i32 f32_to_i32_r_minMag ' + + 'f64_to_i32 f64_to_i32_r_minMag ' + + 'extF80_to_i32 extF80_to_i32_r_minMag ' + + 'f128_to_i32 f128_to_i32_r_minMag ' + + 'f16_to_i64 f16_to_i64_r_minMag ' + + 'f32_to_i64 f32_to_i64_r_minMag ' + + 'f64_to_i64 f64_to_i64_r_minMag ' + + 'extF80_to_i64 extF80_to_i64_r_minMag ' + + 'f128_to_i64 f128_to_i64_r_minMag', + 'float-to-uint': 'f16_to_ui32 f16_to_ui32_r_minMag ' + + 'f32_to_ui32 f32_to_ui32_r_minMag ' + + 'f64_to_ui32 f64_to_ui32_r_minMag ' + + 'extF80_to_ui32 extF80_to_ui32_r_minMag ' + + 'f128_to_ui32 f128_to_ui32_r_minMag ' + + 'f16_to_ui64 f16_to_ui64_r_minMag ' + + 'f32_to_ui64 f32_to_ui64_r_minMag ' + + 'f64_to_ui64 f64_to_ui64_r_minMag ' + + 'extF80_to_ui64 extF80_to_ui64_r_minMag ' + + 'f128_to_ui64 f128_to_ui64_r_minMag', + 'round-to-integer': 'f16_roundToInt f32_roundToInt ' + + 'f64_roundToInt f128_roundToInt' +} +softfloat_tests = { + 'eq_signaling' : 'compare', + 'le' : 'compare', + 'le_quiet' : 'compare', + 'lt_quiet' : 'compare', + 'add': 'ops', + 'sub': 'ops', + 'mul': 'ops', + 'div': 'ops', + 'rem': 'ops', + 'sqrt': 'ops' +} +# The full test suite can take a bit of time, default to a quick run +# "-l 2 -r all" can take more than a day for some operations and is best +# run manually +fptest_args = ['-s', '-l', '1'] +fptest_rounding_args = ['-r', 'all'] + +# Conversion Routines: +# FIXME: i32_to_extF80 (broken), i64_to_extF80 (broken) +# extF80_roundToInt (broken) +foreach k, v : softfloat_conv_tests + test('fp-test:' + k, fptest, + args: fptest_args + fptest_rounding_args + v.split(), + suite: ['softfloat', 'softfloat-conv']) +endforeach + +# FIXME: extF80_{lt_quiet, rem} (broken), +# extF80_{mulAdd} (missing) +foreach k, v : softfloat_tests + extF80_broken = ['lt_quiet', 'rem'].contains(k) + test('fp-test:' + k, fptest, + args: fptest_args + fptest_rounding_args + + ['f16_' + k, 'f32_' + k, 'f64_' + k, 'f128_' + k] + + (extF80_broken ? [] : ['extF80_' + k]), + suite: ['softfloat', 'softfloat-' + v]) +endforeach +test('fp-test:mulAdd', fptest, + # no fptest_rounding_args + args: fptest_args + + ['f16_mulAdd', 'f32_mulAdd', 'f64_mulAdd', 'f128_mulAdd'], + suite: ['softfloat-slow', 'softfloat-ops-slow'], timeout: 60) + +fpbench = executable( + 'fp-bench', + ['fp-bench.c', '../../fpu/softfloat.c'], + build_by_default: false, + link_with: [libtestfloat, libsoftfloat], + dependencies: [qemuutil], + include_directories: [sfinc, include_directories(tfdir)], + c_args: fpcflags, +) diff --git a/tests/fp/wrap.inc.c b/tests/fp/wrap.c.inc index 0cbd20013e..0cbd20013e 100644 --- a/tests/fp/wrap.inc.c +++ b/tests/fp/wrap.c.inc diff --git a/tests/meson.build b/tests/meson.build new file mode 100644 index 0000000000..fe2c6d8e6b --- /dev/null +++ b/tests/meson.build @@ -0,0 +1,18 @@ +if have_system and 'CONFIG_POSIX' in config_host + subdir('qemu-iotests') +endif + +test('decodetree', sh, + args: [ files('decode/check.sh'), config_host['PYTHON'], files('../scripts/decodetree.py') ], + workdir: meson.current_source_dir() / 'decode', + suite: 'decodetree') + +if 'CONFIG_TCG' in config_host + subdir('fp') + if 'CONFIG_PLUGIN' in config_host + subdir('plugin') + endif +endif + +subdir('qapi-schema') +subdir('qtest') diff --git a/tests/multiboot/run_test.sh b/tests/multiboot/run_test.sh index 98df91e6af..f968bf797e 100755 --- a/tests/multiboot/run_test.sh +++ b/tests/multiboot/run_test.sh @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -QEMU=${QEMU:-"../../x86_64-softmmu/qemu-system-x86_64"} +QEMU=${QEMU:-"../../qemu-system-x86_64"} run_qemu() { local kernel=$1 diff --git a/tests/plugin/Makefile b/tests/plugin/Makefile deleted file mode 100644 index e9348fde4a..0000000000 --- a/tests/plugin/Makefile +++ /dev/null @@ -1,46 +0,0 @@ -# -*- Mode: makefile -*- -# -# This Makefile example is fairly independent from the main makefile -# so users can take and adapt it for their build. We only really -# include config-host.mak so we don't have to repeat probing for -# cflags that the main configure has already done for us. -# - -BUILD_DIR := $(CURDIR)/../.. - -include $(BUILD_DIR)/config-host.mak - -VPATH += $(SRC_PATH)/tests/plugin - -NAMES := -NAMES += bb -NAMES += empty -NAMES += insn -NAMES += mem -NAMES += hotblocks -NAMES += howvec -NAMES += hotpages -NAMES += lockstep - -SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES))) - -# The main QEMU uses Glib extensively so it's perfectly fine to use it -# in plugins (which many example do). -CFLAGS = $(GLIB_CFLAGS) -CFLAGS += -fPIC -CFLAGS += $(if $(findstring no-psabi,$(QEMU_CFLAGS)),-Wpsabi) -CFLAGS += -I$(SRC_PATH)/include/qemu - -all: $(SONAMES) - -%.o: %.c - $(CC) $(CFLAGS) -c -o $@ $< - -lib%.so: %.o - $(CC) -shared -Wl,-soname,$@ -o $@ $^ $(LDLIBS) - -clean: - rm -f *.o *.so *.d - rm -Rf .libs - -.PHONY: all clean diff --git a/tests/plugin/meson.build b/tests/plugin/meson.build new file mode 100644 index 0000000000..dbbdcbaa67 --- /dev/null +++ b/tests/plugin/meson.build @@ -0,0 +1,7 @@ +t = [] +foreach i : ['bb', 'empty', 'insn', 'mem', 'hotblocks', 'howvec', 'hotpages', 'lockstep'] + t += shared_module(i, files(i + '.c'), + include_directories: '../../include/qemu', + dependencies: glib) +endforeach +alias_target('plugins', t) diff --git a/tests/qapi-schema/meson.build b/tests/qapi-schema/meson.build new file mode 100644 index 0000000000..c87d141417 --- /dev/null +++ b/tests/qapi-schema/meson.build @@ -0,0 +1,225 @@ +test_env = environment() +test_env.set('PYTHONPATH', meson.source_root() / 'scripts') +test_env.set('PYTHONIOENCODING', 'utf-8') + +schemas = [ + 'alternate-any.json', + 'alternate-array.json', + 'alternate-base.json', + 'alternate-branch-if-invalid.json', + 'alternate-clash.json', + 'alternate-conflict-dict.json', + 'alternate-conflict-enum-bool.json', + 'alternate-conflict-enum-int.json', + 'alternate-conflict-string.json', + 'alternate-conflict-bool-string.json', + 'alternate-conflict-num-string.json', + 'alternate-empty.json', + 'alternate-invalid-dict.json', + 'alternate-nested.json', + 'alternate-unknown.json', + 'args-alternate.json', + 'args-any.json', + 'args-array-empty.json', + 'args-array-unknown.json', + 'args-bad-boxed.json', + 'args-boxed-anon.json', + 'args-boxed-string.json', + 'args-int.json', + 'args-invalid.json', + 'args-member-array-bad.json', + 'args-member-case.json', + 'args-member-unknown.json', + 'args-name-clash.json', + 'args-union.json', + 'args-unknown.json', + 'bad-base.json', + 'bad-data.json', + 'bad-ident.json', + 'bad-if.json', + 'bad-if-empty.json', + 'bad-if-empty-list.json', + 'bad-if-list.json', + 'bad-type-bool.json', + 'bad-type-dict.json', + 'bad-type-int.json', + 'base-cycle-direct.json', + 'base-cycle-indirect.json', + 'command-int.json', + 'comments.json', + 'doc-bad-alternate-member.json', + 'doc-bad-boxed-command-arg.json', + 'doc-bad-command-arg.json', + 'doc-bad-enum-member.json', + 'doc-bad-event-arg.json', + 'doc-bad-feature.json', + 'doc-bad-section.json', + 'doc-bad-symbol.json', + 'doc-bad-union-member.json', + 'doc-before-include.json', + 'doc-before-pragma.json', + 'doc-duplicated-arg.json', + 'doc-duplicated-return.json', + 'doc-duplicated-since.json', + 'doc-empty-arg.json', + 'doc-empty-section.json', + 'doc-empty-symbol.json', + 'doc-good.json', + 'doc-interleaved-section.json', + 'doc-invalid-end.json', + 'doc-invalid-end2.json', + 'doc-invalid-return.json', + 'doc-invalid-section.json', + 'doc-invalid-start.json', + 'doc-missing-colon.json', + 'doc-missing-expr.json', + 'doc-missing-space.json', + 'doc-missing.json', + 'doc-no-symbol.json', + 'doc-undoc-feature.json', + 'double-type.json', + 'duplicate-key.json', + 'empty.json', + 'enum-bad-member.json', + 'enum-bad-name.json', + 'enum-bad-prefix.json', + 'enum-clash-member.json', + 'enum-dict-member-unknown.json', + 'enum-if-invalid.json', + 'enum-int-member.json', + 'enum-member-case.json', + 'enum-missing-data.json', + 'enum-wrong-data.json', + 'event-boxed-empty.json', + 'event-case.json', + 'event-member-invalid-dict.json', + 'event-nest-struct.json', + 'features-bad-type.json', + 'features-deprecated-type.json', + 'features-duplicate-name.json', + 'features-if-invalid.json', + 'features-missing-name.json', + 'features-name-bad-type.json', + 'features-no-list.json', + 'features-unknown-key.json', + 'flat-union-array-branch.json', + 'flat-union-bad-base.json', + 'flat-union-bad-discriminator.json', + 'flat-union-base-any.json', + 'flat-union-base-union.json', + 'flat-union-clash-member.json', + 'flat-union-discriminator-bad-name.json', + 'flat-union-empty.json', + 'flat-union-inline.json', + 'flat-union-inline-invalid-dict.json', + 'flat-union-int-branch.json', + 'flat-union-invalid-branch-key.json', + 'flat-union-invalid-discriminator.json', + 'flat-union-invalid-if-discriminator.json', + 'flat-union-no-base.json', + 'flat-union-optional-discriminator.json', + 'flat-union-string-discriminator.json', + 'funny-char.json', + 'funny-word.json', + 'ident-with-escape.json', + 'include-before-err.json', + 'include-cycle.json', + 'include-extra-junk.json', + 'include-nested-err.json', + 'include-no-file.json', + 'include-non-file.json', + 'include-repetition.json', + 'include-self-cycle.json', + 'include-simple.json', + 'indented-expr.json', + 'leading-comma-list.json', + 'leading-comma-object.json', + 'missing-colon.json', + 'missing-comma-list.json', + 'missing-comma-object.json', + 'missing-type.json', + 'nested-struct-data.json', + 'nested-struct-data-invalid-dict.json', + 'non-objects.json', + 'oob-test.json', + 'allow-preconfig-test.json', + 'pragma-doc-required-crap.json', + 'pragma-extra-junk.json', + 'pragma-name-case-whitelist-crap.json', + 'pragma-non-dict.json', + 'pragma-unknown.json', + 'pragma-returns-whitelist-crap.json', + 'qapi-schema-test.json', + 'quoted-structural-chars.json', + 'redefined-builtin.json', + 'redefined-command.json', + 'redefined-event.json', + 'redefined-type.json', + 'reserved-command-q.json', + 'reserved-enum-q.json', + 'reserved-member-has.json', + 'reserved-member-q.json', + 'reserved-member-u.json', + 'reserved-member-underscore.json', + 'reserved-type-kind.json', + 'reserved-type-list.json', + 'returns-alternate.json', + 'returns-array-bad.json', + 'returns-dict.json', + 'returns-unknown.json', + 'returns-whitelist.json', + 'string-code-point-31.json', + 'string-code-point-127.json', + 'struct-base-clash-deep.json', + 'struct-base-clash.json', + 'struct-data-invalid.json', + 'struct-member-if-invalid.json', + 'struct-member-invalid-dict.json', + 'struct-member-invalid.json', + 'trailing-comma-list.json', + 'trailing-comma-object.json', + 'type-bypass-bad-gen.json', + 'unclosed-list.json', + 'unclosed-object.json', + 'unclosed-string.json', + 'union-base-empty.json', + 'union-base-no-discriminator.json', + 'union-branch-case.json', + 'union-branch-if-invalid.json', + 'union-branch-invalid-dict.json', + 'union-clash-branches.json', + 'union-empty.json', + 'union-invalid-base.json', + 'union-optional-branch.json', + 'union-unknown.json', + 'unknown-escape.json', + 'unknown-expr-key.json', +] + +# Because people may want to use test-qapi.py from the command line, we +# are not using the "#! /usr/bin/env python3" trick here. See +# docs/devel/build-system.txt +test('QAPI schema regression tests', python, args: files('test-qapi.py', schemas), + env: test_env, suite: ['qapi-schema', 'qapi-frontend']) + +diff = find_program('diff') + +qapi_doc = custom_target('QAPI doc', + output: ['doc-good-qapi-doc.texi', + 'doc-good-qapi-commands.c', 'doc-good-qapi-commands.h', + 'doc-good-qapi-emit-events.c', 'doc-good-qapi-emit-events.h', + 'doc-good-qapi-events.c', 'doc-good-qapi-events.h', + 'doc-good-qapi-init-commands.c', 'doc-good-qapi-init-commands.h', + 'doc-good-qapi-introspect.c', 'doc-good-qapi-introspect.h', + 'doc-good-qapi-types.c', 'doc-good-qapi-types.h', + 'doc-good-qapi-visit.c', 'doc-good-qapi-visit.h' ], + input: files('doc-good.json'), + command: [ qapi_gen, '-o', meson.current_build_dir(), + '-p', 'doc-good-', '@INPUT0@' ], + depend_files: qapi_gen_depends) + +# "full_path()" needed here to work around +# https://github.com/mesonbuild/meson/issues/7585 +test('QAPI doc', diff, args: ['-u', files('doc-good.texi'), qapi_doc[0].full_path()], + depends: qapi_doc, + suite: ['qapi-schema', 'qapi-doc']) diff --git a/tests/qemu-iotests/300 b/tests/qemu-iotests/300 new file mode 100755 index 0000000000..5b75121b84 --- /dev/null +++ b/tests/qemu-iotests/300 @@ -0,0 +1,593 @@ +#!/usr/bin/env python3 +# +# Copyright (C) 2020 Red Hat, Inc. +# +# Tests for dirty bitmaps migration with node aliases +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +import os +import random +import re +from typing import Dict, List, Optional, Union +import iotests +import qemu + +BlockBitmapMapping = List[Dict[str, Union[str, List[Dict[str, str]]]]] + +assert iotests.sock_dir is not None +mig_sock = os.path.join(iotests.sock_dir, 'mig_sock') + + +class TestDirtyBitmapMigration(iotests.QMPTestCase): + src_node_name: str = '' + dst_node_name: str = '' + src_bmap_name: str = '' + dst_bmap_name: str = '' + + def setUp(self) -> None: + self.vm_a = iotests.VM(path_suffix='-a') + self.vm_a.add_blockdev(f'node-name={self.src_node_name},' + 'driver=null-co') + self.vm_a.launch() + + self.vm_b = iotests.VM(path_suffix='-b') + self.vm_b.add_blockdev(f'node-name={self.dst_node_name},' + 'driver=null-co') + self.vm_b.add_incoming(f'unix:{mig_sock}') + self.vm_b.launch() + + result = self.vm_a.qmp('block-dirty-bitmap-add', + node=self.src_node_name, + name=self.src_bmap_name) + self.assert_qmp(result, 'return', {}) + + # Dirty some random megabytes + for _ in range(9): + mb_ofs = random.randrange(1024) + self.vm_a.hmp_qemu_io(self.src_node_name, f'discard {mb_ofs}M 1M') + + result = self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256', + node=self.src_node_name, + name=self.src_bmap_name) + self.bitmap_hash_reference = result['return']['sha256'] + + caps = [{'capability': name, 'state': True} + for name in ('dirty-bitmaps', 'events')] + + for vm in (self.vm_a, self.vm_b): + result = vm.qmp('migrate-set-capabilities', capabilities=caps) + self.assert_qmp(result, 'return', {}) + + def tearDown(self) -> None: + self.vm_a.shutdown() + self.vm_b.shutdown() + try: + os.remove(mig_sock) + except OSError: + pass + + def check_bitmap(self, bitmap_name_valid: bool) -> None: + result = self.vm_b.qmp('x-debug-block-dirty-bitmap-sha256', + node=self.dst_node_name, + name=self.dst_bmap_name) + if bitmap_name_valid: + self.assert_qmp(result, 'return/sha256', + self.bitmap_hash_reference) + else: + self.assert_qmp(result, 'error/desc', + f"Dirty bitmap '{self.dst_bmap_name}' not found") + + def migrate(self, bitmap_name_valid: bool = True, + migration_success: bool = True) -> None: + result = self.vm_a.qmp('migrate', uri=f'unix:{mig_sock}') + self.assert_qmp(result, 'return', {}) + + with iotests.Timeout(5, 'Timeout waiting for migration to complete'): + self.assertEqual(self.vm_a.wait_migration('postmigrate'), + migration_success) + self.assertEqual(self.vm_b.wait_migration('running'), + migration_success) + + if migration_success: + self.check_bitmap(bitmap_name_valid) + + def verify_dest_error(self, msg: Optional[str]) -> None: + """ + Check whether the given error message is present in vm_b's log. + (vm_b is shut down to do so.) + If @msg is None, check that there has not been any error. + """ + self.vm_b.shutdown() + if msg is None: + self.assertNotIn('qemu-system-', self.vm_b.get_log()) + else: + self.assertIn(msg, self.vm_b.get_log()) + + @staticmethod + def mapping(node_name: str, node_alias: str, + bitmap_name: str, bitmap_alias: str) -> BlockBitmapMapping: + return [{ + 'node-name': node_name, + 'alias': node_alias, + 'bitmaps': [{ + 'name': bitmap_name, + 'alias': bitmap_alias + }] + }] + + def set_mapping(self, vm: iotests.VM, mapping: BlockBitmapMapping, + error: Optional[str] = None) -> None: + """ + Invoke migrate-set-parameters on @vm to set the given @mapping. + Check for success if @error is None, or verify the error message + if it is not. + On success, verify that "info migrate_parameters" on HMP returns + our mapping. (Just to check its formatting code.) + """ + result = vm.qmp('migrate-set-parameters', + block_bitmap_mapping=mapping) + + if error is None: + self.assert_qmp(result, 'return', {}) + + result = vm.qmp('human-monitor-command', + command_line='info migrate_parameters') + + m = re.search(r'^block-bitmap-mapping:\r?(\n .*)*\n', + result['return'], flags=re.MULTILINE) + hmp_mapping = m.group(0).replace('\r', '') if m else None + + self.assertEqual(hmp_mapping, self.to_hmp_mapping(mapping)) + else: + self.assert_qmp(result, 'error/desc', error) + + @staticmethod + def to_hmp_mapping(mapping: BlockBitmapMapping) -> str: + result = 'block-bitmap-mapping:\n' + + for node in mapping: + result += f" '{node['node-name']}' -> '{node['alias']}'\n" + + assert isinstance(node['bitmaps'], list) + for bitmap in node['bitmaps']: + result += f" '{bitmap['name']}' -> '{bitmap['alias']}'\n" + + return result + + +class TestAliasMigration(TestDirtyBitmapMigration): + src_node_name = 'node0' + dst_node_name = 'node0' + src_bmap_name = 'bmap0' + dst_bmap_name = 'bmap0' + + def test_migration_without_alias(self) -> None: + self.migrate(self.src_node_name == self.dst_node_name and + self.src_bmap_name == self.dst_bmap_name) + + # Check for error message on the destination + if self.src_node_name != self.dst_node_name: + self.verify_dest_error(f"Cannot find " + f"device={self.src_node_name} nor " + f"node_name={self.src_node_name}") + else: + self.verify_dest_error(None) + + def test_alias_on_src_migration(self) -> None: + mapping = self.mapping(self.src_node_name, self.dst_node_name, + self.src_bmap_name, self.dst_bmap_name) + + self.set_mapping(self.vm_a, mapping) + self.migrate() + self.verify_dest_error(None) + + def test_alias_on_dst_migration(self) -> None: + mapping = self.mapping(self.dst_node_name, self.src_node_name, + self.dst_bmap_name, self.src_bmap_name) + + self.set_mapping(self.vm_b, mapping) + self.migrate() + self.verify_dest_error(None) + + def test_alias_on_both_migration(self) -> None: + src_map = self.mapping(self.src_node_name, 'node-alias', + self.src_bmap_name, 'bmap-alias') + + dst_map = self.mapping(self.dst_node_name, 'node-alias', + self.dst_bmap_name, 'bmap-alias') + + self.set_mapping(self.vm_a, src_map) + self.set_mapping(self.vm_b, dst_map) + self.migrate() + self.verify_dest_error(None) + + +class TestNodeAliasMigration(TestAliasMigration): + src_node_name = 'node-src' + dst_node_name = 'node-dst' + + +class TestBitmapAliasMigration(TestAliasMigration): + src_bmap_name = 'bmap-src' + dst_bmap_name = 'bmap-dst' + + +class TestFullAliasMigration(TestAliasMigration): + src_node_name = 'node-src' + dst_node_name = 'node-dst' + src_bmap_name = 'bmap-src' + dst_bmap_name = 'bmap-dst' + + +class TestLongBitmapNames(TestAliasMigration): + # Giving long bitmap names is OK, as long as there is a short alias for + # migration + src_bmap_name = 'a' * 512 + dst_bmap_name = 'b' * 512 + + # Skip all tests that do not use the intermediate alias + def test_migration_without_alias(self) -> None: + pass + + def test_alias_on_src_migration(self) -> None: + pass + + def test_alias_on_dst_migration(self) -> None: + pass + + +class TestBlockBitmapMappingErrors(TestDirtyBitmapMigration): + src_node_name = 'node0' + dst_node_name = 'node0' + src_bmap_name = 'bmap0' + dst_bmap_name = 'bmap0' + + """ + Note that mapping nodes or bitmaps that do not exist is not an error. + """ + + def test_non_injective_node_mapping(self) -> None: + mapping: BlockBitmapMapping = [ + { + 'node-name': 'node0', + 'alias': 'common-alias', + 'bitmaps': [{ + 'name': 'bmap0', + 'alias': 'bmap-alias0' + }] + }, + { + 'node-name': 'node1', + 'alias': 'common-alias', + 'bitmaps': [{ + 'name': 'bmap1', + 'alias': 'bmap-alias1' + }] + } + ] + + self.set_mapping(self.vm_a, mapping, + "Invalid mapping given for block-bitmap-mapping: " + "The node alias 'common-alias' is used twice") + + def test_non_injective_bitmap_mapping(self) -> None: + mapping: BlockBitmapMapping = [{ + 'node-name': 'node0', + 'alias': 'node-alias0', + 'bitmaps': [ + { + 'name': 'bmap0', + 'alias': 'common-alias' + }, + { + 'name': 'bmap1', + 'alias': 'common-alias' + } + ] + }] + + self.set_mapping(self.vm_a, mapping, + "Invalid mapping given for block-bitmap-mapping: " + "The bitmap alias 'node-alias0'/'common-alias' is " + "used twice") + + def test_ambiguous_node_mapping(self) -> None: + mapping: BlockBitmapMapping = [ + { + 'node-name': 'node0', + 'alias': 'node-alias0', + 'bitmaps': [{ + 'name': 'bmap0', + 'alias': 'bmap-alias0' + }] + }, + { + 'node-name': 'node0', + 'alias': 'node-alias1', + 'bitmaps': [{ + 'name': 'bmap0', + 'alias': 'bmap-alias0' + }] + } + ] + + self.set_mapping(self.vm_a, mapping, + "Invalid mapping given for block-bitmap-mapping: " + "The node name 'node0' is mapped twice") + + def test_ambiguous_bitmap_mapping(self) -> None: + mapping: BlockBitmapMapping = [{ + 'node-name': 'node0', + 'alias': 'node-alias0', + 'bitmaps': [ + { + 'name': 'bmap0', + 'alias': 'bmap-alias0' + }, + { + 'name': 'bmap0', + 'alias': 'bmap-alias1' + } + ] + }] + + self.set_mapping(self.vm_a, mapping, + "Invalid mapping given for block-bitmap-mapping: " + "The bitmap 'node0'/'bmap0' is mapped twice") + + def test_migratee_node_is_not_mapped_on_src(self) -> None: + self.set_mapping(self.vm_a, []) + # Should just ignore all bitmaps on unmapped nodes + self.migrate(False) + self.verify_dest_error(None) + + def test_migratee_node_is_not_mapped_on_dst(self) -> None: + self.set_mapping(self.vm_b, []) + self.migrate(False) + self.verify_dest_error(f"Unknown node alias '{self.src_node_name}'") + + def test_migratee_bitmap_is_not_mapped_on_src(self) -> None: + mapping: BlockBitmapMapping = [{ + 'node-name': self.src_node_name, + 'alias': self.dst_node_name, + 'bitmaps': [] + }] + + self.set_mapping(self.vm_a, mapping) + # Should just ignore all unmapped bitmaps + self.migrate(False) + self.verify_dest_error(None) + + def test_migratee_bitmap_is_not_mapped_on_dst(self) -> None: + mapping: BlockBitmapMapping = [{ + 'node-name': self.dst_node_name, + 'alias': self.src_node_name, + 'bitmaps': [] + }] + + self.set_mapping(self.vm_b, mapping) + self.migrate(False) + self.verify_dest_error(f"Unknown bitmap alias " + f"'{self.src_bmap_name}' " + f"on node '{self.dst_node_name}' " + f"(alias '{self.src_node_name}')") + + def test_unused_mapping_on_dst(self) -> None: + # Let the source not send any bitmaps + self.set_mapping(self.vm_a, []) + + # Establish some mapping on the destination + self.set_mapping(self.vm_b, []) + + # The fact that there is a mapping on B without any bitmaps + # being received should be fine, not fatal + self.migrate(False) + self.verify_dest_error(None) + + def test_non_wellformed_node_alias(self) -> None: + alias = '123-foo' + + mapping: BlockBitmapMapping = [{ + 'node-name': self.src_node_name, + 'alias': alias, + 'bitmaps': [] + }] + + self.set_mapping(self.vm_a, mapping, + f"Invalid mapping given for block-bitmap-mapping: " + f"The node alias '{alias}' is not well-formed") + + def test_node_alias_too_long(self) -> None: + alias = 'a' * 256 + + mapping: BlockBitmapMapping = [{ + 'node-name': self.src_node_name, + 'alias': alias, + 'bitmaps': [] + }] + + self.set_mapping(self.vm_a, mapping, + f"Invalid mapping given for block-bitmap-mapping: " + f"The node alias '{alias}' is longer than 255 bytes") + + def test_bitmap_alias_too_long(self) -> None: + alias = 'a' * 256 + + mapping = self.mapping(self.src_node_name, self.dst_node_name, + self.src_bmap_name, alias) + + self.set_mapping(self.vm_a, mapping, + f"Invalid mapping given for block-bitmap-mapping: " + f"The bitmap alias '{alias}' is longer than 255 " + f"bytes") + + def test_bitmap_name_too_long(self) -> None: + name = 'a' * 256 + + result = self.vm_a.qmp('block-dirty-bitmap-add', + node=self.src_node_name, + name=name) + self.assert_qmp(result, 'return', {}) + + self.migrate(False, False) + + # Check for the error in the source's log + self.vm_a.shutdown() + self.assertIn(f"Cannot migrate bitmap '{name}' on node " + f"'{self.src_node_name}': Name is longer than 255 bytes", + self.vm_a.get_log()) + + # Expect abnormal shutdown of the destination VM because of + # the failed migration + try: + self.vm_b.shutdown() + except qemu.machine.AbnormalShutdown: + pass + + def test_aliased_bitmap_name_too_long(self) -> None: + # Longer than the maximum for bitmap names + self.dst_bmap_name = 'a' * 1024 + + mapping = self.mapping(self.dst_node_name, self.src_node_name, + self.dst_bmap_name, self.src_bmap_name) + + # We would have to create this bitmap during migration, and + # that would fail, because the name is too long. Better to + # catch it early. + self.set_mapping(self.vm_b, mapping, + f"Invalid mapping given for block-bitmap-mapping: " + f"The bitmap name '{self.dst_bmap_name}' is longer " + f"than 1023 bytes") + + def test_node_name_too_long(self) -> None: + # Longer than the maximum for node names + self.dst_node_name = 'a' * 32 + + mapping = self.mapping(self.dst_node_name, self.src_node_name, + self.dst_bmap_name, self.src_bmap_name) + + # During migration, this would appear simply as a node that + # cannot be found. Still better to catch impossible node + # names early (similar to test_non_wellformed_node_alias). + self.set_mapping(self.vm_b, mapping, + f"Invalid mapping given for block-bitmap-mapping: " + f"The node name '{self.dst_node_name}' is longer " + f"than 31 bytes") + + +class TestCrossAliasMigration(TestDirtyBitmapMigration): + """ + Swap aliases, both to see that qemu does not get confused, and + that we can migrate multiple things at once. + + So we migrate this: + node-a.bmap-a -> node-b.bmap-b + node-a.bmap-b -> node-b.bmap-a + node-b.bmap-a -> node-a.bmap-b + node-b.bmap-b -> node-a.bmap-a + """ + + src_node_name = 'node-a' + dst_node_name = 'node-b' + src_bmap_name = 'bmap-a' + dst_bmap_name = 'bmap-b' + + def setUp(self) -> None: + TestDirtyBitmapMigration.setUp(self) + + # Now create another block device and let both have two bitmaps each + result = self.vm_a.qmp('blockdev-add', + node_name='node-b', driver='null-co') + self.assert_qmp(result, 'return', {}) + + result = self.vm_b.qmp('blockdev-add', + node_name='node-a', driver='null-co') + self.assert_qmp(result, 'return', {}) + + bmaps_to_add = (('node-a', 'bmap-b'), + ('node-b', 'bmap-a'), + ('node-b', 'bmap-b')) + + for (node, bmap) in bmaps_to_add: + result = self.vm_a.qmp('block-dirty-bitmap-add', + node=node, name=bmap) + self.assert_qmp(result, 'return', {}) + + @staticmethod + def cross_mapping() -> BlockBitmapMapping: + return [ + { + 'node-name': 'node-a', + 'alias': 'node-b', + 'bitmaps': [ + { + 'name': 'bmap-a', + 'alias': 'bmap-b' + }, + { + 'name': 'bmap-b', + 'alias': 'bmap-a' + } + ] + }, + { + 'node-name': 'node-b', + 'alias': 'node-a', + 'bitmaps': [ + { + 'name': 'bmap-b', + 'alias': 'bmap-a' + }, + { + 'name': 'bmap-a', + 'alias': 'bmap-b' + } + ] + } + ] + + def verify_dest_has_all_bitmaps(self) -> None: + bitmaps = self.vm_b.query_bitmaps() + + # Extract and sort bitmap names + for node in bitmaps: + bitmaps[node] = sorted((bmap['name'] for bmap in bitmaps[node])) + + self.assertEqual(bitmaps, + {'node-a': ['bmap-a', 'bmap-b'], + 'node-b': ['bmap-a', 'bmap-b']}) + + def test_alias_on_src(self) -> None: + self.set_mapping(self.vm_a, self.cross_mapping()) + + # Checks that node-a.bmap-a was migrated to node-b.bmap-b, and + # that is enough + self.migrate() + self.verify_dest_has_all_bitmaps() + self.verify_dest_error(None) + + def test_alias_on_dst(self) -> None: + self.set_mapping(self.vm_b, self.cross_mapping()) + + # Checks that node-a.bmap-a was migrated to node-b.bmap-b, and + # that is enough + self.migrate() + self.verify_dest_has_all_bitmaps() + self.verify_dest_error(None) + + +if __name__ == '__main__': + iotests.main(supported_protocols=['file']) diff --git a/tests/qemu-iotests/300.out b/tests/qemu-iotests/300.out new file mode 100644 index 0000000000..cafb8161f7 --- /dev/null +++ b/tests/qemu-iotests/300.out @@ -0,0 +1,5 @@ +..................................... +---------------------------------------------------------------------- +Ran 37 tests + +OK diff --git a/tests/qemu-iotests/303 b/tests/qemu-iotests/303 new file mode 100755 index 0000000000..6c21774483 --- /dev/null +++ b/tests/qemu-iotests/303 @@ -0,0 +1,63 @@ +#!/usr/bin/env python3 +# +# Test for dumping of qcow2 image metadata +# +# Copyright (c) 2020 Virtuozzo International GmbH +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +import iotests +import subprocess +from iotests import qemu_img_create, qemu_io, file_path, log, filter_qemu_io + +iotests.script_initialize(supported_fmts=['qcow2']) + +disk = file_path('disk') +chunk = 1024 * 1024 + + +def create_bitmap(bitmap_number, disabled): + granularity = 1 << (14 + bitmap_number) + bitmap_name = 'bitmap-' + str(bitmap_number) + args = ['bitmap', '--add', '-g', f'{granularity}', '-f', iotests.imgfmt, + disk, bitmap_name] + if disabled: + args.append('--disable') + + iotests.qemu_img_pipe(*args) + + +def write_to_disk(offset, size): + write = f'write {offset} {size}' + log(qemu_io('-c', write, disk), filters=[filter_qemu_io]) + + +def add_bitmap(num, begin, end, disabled): + log(f'Add bitmap {num}') + create_bitmap(num, disabled) + for i in range(begin, end): + write_to_disk((i) * chunk, chunk) + log('') + + +qemu_img_create('-f', iotests.imgfmt, disk, '10M') + +add_bitmap(1, 0, 6, False) +add_bitmap(2, 6, 8, True) +dump = ['qcow2.py', disk, 'dump-header'] +subprocess.run(dump) +# Dump the metadata in JSON format +dump.append('-j') +subprocess.run(dump) diff --git a/tests/qemu-iotests/303.out b/tests/qemu-iotests/303.out new file mode 100644 index 0000000000..7fa1edef0d --- /dev/null +++ b/tests/qemu-iotests/303.out @@ -0,0 +1,158 @@ +Add bitmap 1 +wrote 1048576/1048576 bytes at offset 0 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +wrote 1048576/1048576 bytes at offset 1048576 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +wrote 1048576/1048576 bytes at offset 2097152 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +wrote 1048576/1048576 bytes at offset 3145728 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +wrote 1048576/1048576 bytes at offset 4194304 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +wrote 1048576/1048576 bytes at offset 5242880 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + + +Add bitmap 2 +wrote 1048576/1048576 bytes at offset 6291456 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +wrote 1048576/1048576 bytes at offset 7340032 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + + +magic 0x514649fb +version 3 +backing_file_offset 0x0 +backing_file_size 0x0 +cluster_bits 16 +size 10485760 +crypt_method 0 +l1_size 1 +l1_table_offset 0x30000 +refcount_table_offset 0x10000 +refcount_table_clusters 1 +nb_snapshots 0 +snapshot_offset 0x0 +incompatible_features [] +compatible_features [] +autoclear_features [0] +refcount_order 4 +header_length 112 + +Header extension: +magic 0x6803f857 (Feature table) +length 336 +data <binary> + +Header extension: +magic 0x23852875 (Bitmaps) +length 24 +nb_bitmaps 2 +reserved32 0 +bitmap_directory_size 0x40 +bitmap_directory_offset 0x9d0000 + +Bitmap name bitmap-1 +bitmap_table_offset 0x9b0000 +bitmap_table_size 1 +flags 0x2 (['auto']) +type 1 +granularity_bits 15 +name_size 8 +extra_data_size 0 +Bitmap table type size offset +0 serialized 65536 10092544 + +Bitmap name bitmap-2 +bitmap_table_offset 0x9c0000 +bitmap_table_size 1 +flags 0x0 ([]) +type 1 +granularity_bits 16 +name_size 8 +extra_data_size 0 +Bitmap table type size offset +0 all-zeroes 0 0 + +{ + "magic": 1363560955, + "version": 3, + "backing_file_offset": 0, + "backing_file_size": 0, + "cluster_bits": 16, + "size": 10485760, + "crypt_method": 0, + "l1_size": 1, + "l1_table_offset": 196608, + "refcount_table_offset": 65536, + "refcount_table_clusters": 1, + "nb_snapshots": 0, + "snapshot_offset": 0, + "incompatible_features": 0, + "compatible_features": 0, + "autoclear_features": 1, + "refcount_order": 4, + "header_length": 112 +} + +[ + { + "name": "Feature table", + "magic": 1745090647, + "length": 336, + "data_str": "<binary>" + }, + { + "name": "Bitmaps", + "magic": 595929205, + "length": 24, + "data": { + "nb_bitmaps": 2, + "reserved32": 0, + "bitmap_directory_size": 64, + "bitmap_directory_offset": 10289152, + "bitmap_directory": [ + { + "name": "bitmap-1", + "bitmap_table_offset": 10158080, + "bitmap_table_size": 1, + "flags": 2, + "type": 1, + "granularity_bits": 15, + "name_size": 8, + "extra_data_size": 0, + "bitmap_table": [ + { + "type": "serialized", + "offset": 10092544, + "reserved": 0 + } + ] + }, + { + "name": "bitmap-2", + "bitmap_table_offset": 10223616, + "bitmap_table_size": 1, + "flags": 0, + "type": 1, + "granularity_bits": 16, + "name_size": 8, + "extra_data_size": 0, + "bitmap_table": [ + { + "type": "all-zeroes", + "offset": 0, + "reserved": 0 + } + ] + } + ] + } + } +] diff --git a/tests/qemu-iotests/304 b/tests/qemu-iotests/304 new file mode 100755 index 0000000000..aaf9e14617 --- /dev/null +++ b/tests/qemu-iotests/304 @@ -0,0 +1,60 @@ +#!/usr/bin/env python3 +# +# Tests dirty-bitmap backup with unaligned bitmap granularity +# +# Copyright (c) 2020 Proxmox Server Solutions +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +# owner=s.reiter@proxmox.com + +import iotests +from iotests import qemu_img_create, qemu_img_log, file_path + +iotests.script_initialize(supported_fmts=['qcow2'], + supported_protocols=['file']) + +test_img = file_path('test.qcow2') +target_img = file_path('target.qcow2') + +# unaligned by one byte +image_len = 4097 +bitmap_granularity = 4096 + +qemu_img_create('-f', iotests.imgfmt, test_img, str(image_len)) + +# create VM +vm = iotests.VM().add_drive(test_img) +vm.launch() + +# write to the entire image +vm.hmp_qemu_io('drive0', 'write -P0x16 0 4096'); +vm.hmp_qemu_io('drive0', 'write -P0x17 4096 1'); + +# do backup and wait for completion +vm.qmp('drive-backup', **{ + 'device': 'drive0', + 'sync': 'full', + 'target': target_img +}) + +event = vm.event_wait(name='BLOCK_JOB_COMPLETED', + match={'data': {'device': 'drive0'}}, + timeout=5.0) + +# shutdown to sync images +vm.shutdown() + +# backup succeeded, check if image is correct +qemu_img_log('compare', test_img, target_img) diff --git a/tests/qemu-iotests/304.out b/tests/qemu-iotests/304.out new file mode 100644 index 0000000000..381cc056f7 --- /dev/null +++ b/tests/qemu-iotests/304.out @@ -0,0 +1,2 @@ +Images are identical. + diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index 0657f7286c..3ab859ac1a 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -577,11 +577,11 @@ if [ -z "$QEMU_PROG" ] then if [ -x "$build_iotests/qemu" ]; then export QEMU_PROG="$build_iotests/qemu" - elif [ -x "$build_root/${qemu_arch}-softmmu/qemu-system-${qemu_arch}" ]; then - export QEMU_PROG="$build_root/${qemu_arch}-softmmu/qemu-system-${qemu_arch}" + elif [ -x "$build_root/qemu-system-${qemu_arch}" ]; then + export QEMU_PROG="$build_root/qemu-system-${qemu_arch}" else pushd "$build_root" > /dev/null - for binary in *-softmmu/qemu-system-* + for binary in qemu-system-* do if [ -x "$binary" ] then diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group index 025ed5238d..a53ea7f78b 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -307,5 +307,8 @@ 296 rw 297 meta 299 auto quick +300 migration 301 backing quick 302 quick +303 rw quick +304 rw quick diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 717b5b652c..e197c73ca5 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -729,16 +729,22 @@ class VM(qtest.QEMUQtestMachine): } ])) - def wait_migration(self, expect_runstate): + def wait_migration(self, expect_runstate: Optional[str]) -> bool: while True: event = self.event_wait('MIGRATION') log(event, filters=[filter_qmp_event]) - if event['data']['status'] == 'completed': + if event['data']['status'] in ('completed', 'failed'): break - # The event may occur in finish-migrate, so wait for the expected - # post-migration runstate - while self.qmp('query-status')['return']['status'] != expect_runstate: - pass + + if event['data']['status'] == 'completed': + # The event may occur in finish-migrate, so wait for the expected + # post-migration runstate + runstate = None + while runstate != expect_runstate: + runstate = self.qmp('query-status')['return']['status'] + return True + else: + return False def node_info(self, node_name): nodes = self.qmp('query-named-block-nodes') diff --git a/tests/qemu-iotests/meson.build b/tests/qemu-iotests/meson.build new file mode 100644 index 0000000000..3de09fb8fa --- /dev/null +++ b/tests/qemu-iotests/meson.build @@ -0,0 +1,10 @@ +if 'CONFIG_LINUX' in config_host + socket_scm_helper = executable('socket_scm_helper', 'socket_scm_helper.c', + build_by_default: false) +else + socket_scm_helper = [] +endif +test('qemu-iotests', sh, args: [files('../check-block.sh')], + depends: [qemu_block_tools, emulators, socket_scm_helper], + suite: 'block', timeout: 10000) + diff --git a/tests/qemu-iotests/qcow2.py b/tests/qemu-iotests/qcow2.py index 0910e6ac07..77ca59cc66 100755 --- a/tests/qemu-iotests/qcow2.py +++ b/tests/qemu-iotests/qcow2.py @@ -26,16 +26,19 @@ from qcow2_format import ( ) +is_json = False + + def cmd_dump_header(fd): h = QcowHeader(fd) - h.dump() + h.dump(is_json) print() - h.dump_extensions() + h.dump_extensions(is_json) def cmd_dump_header_exts(fd): h = QcowHeader(fd) - h.dump_extensions() + h.dump_extensions(is_json) def cmd_set_header(fd, name, value): @@ -151,11 +154,14 @@ def main(filename, cmd, args): def usage(): - print("Usage: %s <file> <cmd> [<arg>, ...]" % sys.argv[0]) + print("Usage: %s <file> <cmd> [<arg>, ...] [<key>, ...]" % sys.argv[0]) print("") print("Supported commands:") for name, handler, num_args, desc in cmds: print(" %-20s - %s" % (name, desc)) + print("") + print("Supported keys:") + print(" %-20s - %s" % ('-j', 'Dump in JSON format')) if __name__ == '__main__': @@ -163,4 +169,8 @@ if __name__ == '__main__': usage() sys.exit(1) + is_json = '-j' in sys.argv + if is_json: + sys.argv.remove('-j') + main(sys.argv[1], sys.argv[2], sys.argv[3:]) diff --git a/tests/qemu-iotests/qcow2_format.py b/tests/qemu-iotests/qcow2_format.py index cc432e7ae0..8adc9959e1 100644 --- a/tests/qemu-iotests/qcow2_format.py +++ b/tests/qemu-iotests/qcow2_format.py @@ -19,6 +19,15 @@ import struct import string +import json + + +class ComplexEncoder(json.JSONEncoder): + def default(self, obj): + if hasattr(obj, 'to_json'): + return obj.to_json() + else: + return json.JSONEncoder.default(self, obj) class Qcow2Field: @@ -40,6 +49,22 @@ class Flags64(Qcow2Field): return str(bits) +class BitmapFlags(Qcow2Field): + + flags = { + 0x1: 'in-use', + 0x2: 'auto' + } + + def __str__(self): + bits = [] + for bit in range(64): + flag = self.value & (1 << bit) + if flag: + bits.append(self.flags.get(flag, f'bit-{bit}')) + return f'{self.value:#x} ({bits})' + + class Enum(Qcow2Field): def __str__(self): @@ -93,7 +118,11 @@ class Qcow2Struct(metaclass=Qcow2StructMeta): self.__dict__ = dict((field[2], values[i]) for i, field in enumerate(self.fields)) - def dump(self): + def dump(self, is_json=False): + if is_json: + print(json.dumps(self.to_json(), indent=4, cls=ComplexEncoder)) + return + for f in self.fields: value = self.__dict__[f[2]] if isinstance(f[1], str): @@ -103,6 +132,9 @@ class Qcow2Struct(metaclass=Qcow2StructMeta): print('{:<25} {}'.format(f[2], value_str)) + def to_json(self): + return dict((f[2], self.__dict__[f[2]]) for f in self.fields) + class Qcow2BitmapExt(Qcow2Struct): @@ -113,6 +145,131 @@ class Qcow2BitmapExt(Qcow2Struct): ('u64', '{:#x}', 'bitmap_directory_offset') ) + def __init__(self, fd, cluster_size): + super().__init__(fd=fd) + tail = struct.calcsize(self.fmt) % 8 + if tail: + fd.seek(8 - tail, 1) + position = fd.tell() + self.cluster_size = cluster_size + self.read_bitmap_directory(fd) + fd.seek(position) + + def read_bitmap_directory(self, fd): + fd.seek(self.bitmap_directory_offset) + self.bitmap_directory = \ + [Qcow2BitmapDirEntry(fd, cluster_size=self.cluster_size) + for _ in range(self.nb_bitmaps)] + + def dump(self): + super().dump() + for entry in self.bitmap_directory: + print() + entry.dump() + + def to_json(self): + fields_dict = super().to_json() + fields_dict['bitmap_directory'] = self.bitmap_directory + return fields_dict + + +class Qcow2BitmapDirEntry(Qcow2Struct): + + fields = ( + ('u64', '{:#x}', 'bitmap_table_offset'), + ('u32', '{}', 'bitmap_table_size'), + ('u32', BitmapFlags, 'flags'), + ('u8', '{}', 'type'), + ('u8', '{}', 'granularity_bits'), + ('u16', '{}', 'name_size'), + ('u32', '{}', 'extra_data_size') + ) + + def __init__(self, fd, cluster_size): + super().__init__(fd=fd) + self.cluster_size = cluster_size + # Seek relative to the current position in the file + fd.seek(self.extra_data_size, 1) + bitmap_name = fd.read(self.name_size) + self.name = bitmap_name.decode('ascii') + # Move position to the end of the entry in the directory + entry_raw_size = self.bitmap_dir_entry_raw_size() + padding = ((entry_raw_size + 7) & ~7) - entry_raw_size + fd.seek(padding, 1) + self.bitmap_table = Qcow2BitmapTable(fd=fd, + offset=self.bitmap_table_offset, + nb_entries=self.bitmap_table_size, + cluster_size=self.cluster_size) + + def bitmap_dir_entry_raw_size(self): + return struct.calcsize(self.fmt) + self.name_size + \ + self.extra_data_size + + def dump(self): + print(f'{"Bitmap name":<25} {self.name}') + super(Qcow2BitmapDirEntry, self).dump() + self.bitmap_table.dump() + + def to_json(self): + # Put the name ahead of the dict + return { + 'name': self.name, + **super().to_json(), + 'bitmap_table': self.bitmap_table + } + + +class Qcow2BitmapTableEntry(Qcow2Struct): + + fields = ( + ('u64', '{}', 'entry'), + ) + + BME_TABLE_ENTRY_RESERVED_MASK = 0xff000000000001fe + BME_TABLE_ENTRY_OFFSET_MASK = 0x00fffffffffffe00 + BME_TABLE_ENTRY_FLAG_ALL_ONES = 1 + + def __init__(self, fd): + super().__init__(fd=fd) + self.reserved = self.entry & self.BME_TABLE_ENTRY_RESERVED_MASK + self.offset = self.entry & self.BME_TABLE_ENTRY_OFFSET_MASK + if self.offset: + if self.entry & self.BME_TABLE_ENTRY_FLAG_ALL_ONES: + self.type = 'invalid' + else: + self.type = 'serialized' + elif self.entry & self.BME_TABLE_ENTRY_FLAG_ALL_ONES: + self.type = 'all-ones' + else: + self.type = 'all-zeroes' + + def to_json(self): + return {'type': self.type, 'offset': self.offset, + 'reserved': self.reserved} + + +class Qcow2BitmapTable: + + def __init__(self, fd, offset, nb_entries, cluster_size): + self.cluster_size = cluster_size + position = fd.tell() + fd.seek(offset) + self.entries = [Qcow2BitmapTableEntry(fd) for _ in range(nb_entries)] + fd.seek(position) + + def dump(self): + bitmap_table = enumerate(self.entries) + print(f'{"Bitmap table":<14} {"type":<15} {"size":<12} {"offset"}') + for i, entry in bitmap_table: + if entry.type == 'serialized': + size = self.cluster_size + else: + size = 0 + print(f'{i:<14} {entry.type:<15} {size:<12} {entry.offset}') + + def to_json(self): + return self.entries + QCOW2_EXT_MAGIC_BITMAPS = 0x23852875 @@ -128,6 +285,9 @@ class QcowHeaderExtension(Qcow2Struct): 0x44415441: 'Data file' } + def to_json(self): + return self.mapping.get(self.value, "<unknown>") + fields = ( ('u32', Magic, 'magic'), ('u32', '{}', 'length') @@ -135,11 +295,13 @@ class QcowHeaderExtension(Qcow2Struct): # then padding to next multiply of 8 ) - def __init__(self, magic=None, length=None, data=None, fd=None): + def __init__(self, magic=None, length=None, data=None, fd=None, + cluster_size=None): """ Support both loading from fd and creation from user data. For fd-based creation current position in a file will be used to read the data. + The cluster_size value may be obtained by dependent structures. This should be somehow refactored and functionality should be moved to superclass (to allow creation of any qcow2 struct), but then, fields @@ -161,28 +323,43 @@ class QcowHeaderExtension(Qcow2Struct): else: assert all(v is None for v in (magic, length, data)) super().__init__(fd=fd) - padded = (self.length + 7) & ~7 - self.data = fd.read(padded) - assert self.data is not None + if self.magic == QCOW2_EXT_MAGIC_BITMAPS: + self.obj = Qcow2BitmapExt(fd=fd, cluster_size=cluster_size) + self.data = None + else: + padded = (self.length + 7) & ~7 + self.data = fd.read(padded) + assert self.data is not None + self.obj = None + + if self.data is not None: + data_str = self.data[:self.length] + if all(c in string.printable.encode( + 'ascii') for c in data_str): + data_str = f"'{ data_str.decode('ascii') }'" + else: + data_str = '<binary>' + self.data_str = data_str - if self.magic == QCOW2_EXT_MAGIC_BITMAPS: - self.obj = Qcow2BitmapExt(data=self.data) - else: - self.obj = None def dump(self): super().dump() if self.obj is None: - data = self.data[:self.length] - if all(c in string.printable.encode('ascii') for c in data): - data = f"'{ data.decode('ascii') }'" - else: - data = '<binary>' - print(f'{"data":<25} {data}') + print(f'{"data":<25} {self.data_str}') else: self.obj.dump() + def to_json(self): + # Put the name ahead of the dict + res = {'name': self.Magic(self.magic), **super().to_json()} + if self.obj is not None: + res['data'] = self.obj + else: + res['data_str'] = self.data_str + + return res + @classmethod def create(cls, magic, data): return QcowHeaderExtension(magic, len(data), data) @@ -246,7 +423,7 @@ class QcowHeader(Qcow2Struct): end = self.cluster_size while fd.tell() < end: - ext = QcowHeaderExtension(fd=fd) + ext = QcowHeaderExtension(fd=fd, cluster_size=self.cluster_size) if ext.magic == 0: break else: @@ -280,7 +457,11 @@ class QcowHeader(Qcow2Struct): buf = buf[0:header_bytes-1] fd.write(buf) - def dump_extensions(self): + def dump_extensions(self, is_json=False): + if is_json: + print(json.dumps(self.extensions, indent=4, cls=ComplexEncoder)) + return + for ex in self.extensions: print('Header extension:') ex.dump() diff --git a/tests/qtest/Makefile.include b/tests/qtest/Makefile.include deleted file mode 100644 index b0204e44f2..0000000000 --- a/tests/qtest/Makefile.include +++ /dev/null @@ -1,332 +0,0 @@ -# All QTests for now are POSIX-only, but the dependencies are -# really in libqtest, not in the testcases themselves. - -check-qtest-generic-y += cdrom-test -check-qtest-generic-y += device-introspect-test -check-qtest-generic-y += machine-none-test -check-qtest-generic-y += qmp-test -check-qtest-generic-y += qmp-cmd-test -check-qtest-generic-y += qom-test -check-qtest-generic-$(CONFIG_MODULES) += modules-test -check-qtest-generic-y += test-hmp - -check-qtest-pci-$(CONFIG_RTL8139_PCI) += rtl8139-test -check-qtest-pci-$(CONFIG_VGA) += display-vga-test -check-qtest-pci-$(CONFIG_HDA) += intel-hda-test -check-qtest-pci-$(CONFIG_IVSHMEM_DEVICE) += ivshmem-test - -DBUS_DAEMON := $(shell which dbus-daemon 2>/dev/null) -ifneq ($(GDBUS_CODEGEN),) -ifneq ($(DBUS_DAEMON),) -# Temporarily disabled due to Patchew failures: -#check-qtest-pci-$(CONFIG_GIO) += dbus-vmstate-test -endif -endif - -check-qtest-i386-$(CONFIG_ISA_TESTDEV) = endianness-test -check-qtest-i386-y += fdc-test -check-qtest-i386-y += ide-test -check-qtest-i386-$(CONFIG_TOOLS) += ahci-test -check-qtest-i386-y += hd-geo-test -check-qtest-i386-y += boot-order-test -check-qtest-i386-y += bios-tables-test -check-qtest-i386-$(CONFIG_SGA) += boot-serial-test -check-qtest-i386-$(CONFIG_SLIRP) += pxe-test -check-qtest-i386-y += rtc-test -check-qtest-i386-$(CONFIG_ISA_IPMI_KCS) += ipmi-kcs-test -ifdef CONFIG_LINUX -check-qtest-i386-$(CONFIG_ISA_IPMI_BT) += ipmi-bt-test -endif -check-qtest-i386-y += i440fx-test -check-qtest-i386-y += fw_cfg-test -check-qtest-i386-y += device-plug-test -check-qtest-i386-y += drive_del-test -check-qtest-i386-$(CONFIG_WDT_IB700) += wdt_ib700-test -check-qtest-i386-y += tco-test -check-qtest-i386-y += $(check-qtest-pci-y) -check-qtest-i386-$(CONFIG_PVPANIC) += pvpanic-test -check-qtest-i386-$(CONFIG_I82801B11) += i82801b11-test -check-qtest-i386-$(CONFIG_IOH3420) += ioh3420-test -check-qtest-i386-$(CONFIG_USB_UHCI) += usb-hcd-uhci-test -check-qtest-i386-$(call land,$(CONFIG_USB_EHCI),$(CONFIG_USB_UHCI)) += usb-hcd-ehci-test -check-qtest-i386-$(CONFIG_USB_XHCI_NEC) += usb-hcd-xhci-test -check-qtest-i386-y += cpu-plug-test -check-qtest-i386-y += q35-test -check-qtest-i386-y += vmgenid-test -check-qtest-i386-$(CONFIG_TPM_CRB) += tpm-crb-swtpm-test -check-qtest-i386-$(CONFIG_TPM_CRB) += tpm-crb-test -check-qtest-i386-$(CONFIG_TPM_TIS_ISA) += tpm-tis-swtpm-test -check-qtest-i386-$(CONFIG_TPM_TIS_ISA) += tpm-tis-test -check-qtest-i386-$(CONFIG_SLIRP) += test-netfilter -check-qtest-i386-$(CONFIG_POSIX) += test-filter-mirror -check-qtest-i386-$(CONFIG_RTL8139_PCI) += test-filter-redirector -check-qtest-i386-y += migration-test -check-qtest-i386-y += test-x86-cpuid-compat -check-qtest-i386-y += numa-test - -check-qtest-x86_64-y += $(check-qtest-i386-y) - -check-qtest-avr-y += boot-serial-test - -check-qtest-alpha-y += boot-serial-test -check-qtest-alpha-$(CONFIG_VGA) += display-vga-test - -check-qtest-hppa-y += boot-serial-test -check-qtest-hppa-$(CONFIG_VGA) += display-vga-test - -check-qtest-m68k-y = boot-serial-test - -check-qtest-microblaze-y += boot-serial-test - -check-qtest-mips-$(CONFIG_ISA_TESTDEV) = endianness-test -check-qtest-mips-$(CONFIG_VGA) += display-vga-test - -check-qtest-mips64-$(CONFIG_ISA_TESTDEV) = endianness-test -check-qtest-mips64-$(CONFIG_VGA) += display-vga-test - -check-qtest-mips64el-$(CONFIG_ISA_TESTDEV) = endianness-test -check-qtest-mips64el-$(CONFIG_VGA) += display-vga-test - -check-qtest-moxie-y += boot-serial-test - -check-qtest-ppc-$(CONFIG_ISA_TESTDEV) = endianness-test -check-qtest-ppc-y += boot-order-test -check-qtest-ppc-y += prom-env-test -check-qtest-ppc-y += drive_del-test -check-qtest-ppc-y += boot-serial-test -check-qtest-ppc-$(CONFIG_M48T59) += m48t59-test - -check-qtest-ppc64-y += $(check-qtest-ppc-y) -check-qtest-ppc64-$(CONFIG_PSERIES) += device-plug-test -check-qtest-ppc64-$(CONFIG_POWERNV) += pnv-xscom-test -check-qtest-ppc64-y += migration-test -check-qtest-ppc64-$(CONFIG_PSERIES) += rtas-test -check-qtest-ppc64-$(CONFIG_SLIRP) += pxe-test -check-qtest-ppc64-$(CONFIG_USB_UHCI) += usb-hcd-uhci-test -check-qtest-ppc64-$(CONFIG_USB_XHCI_NEC) += usb-hcd-xhci-test -check-qtest-ppc64-$(CONFIG_SLIRP) += test-netfilter -check-qtest-ppc64-$(CONFIG_POSIX) += test-filter-mirror -check-qtest-ppc64-$(CONFIG_RTL8139_PCI) += test-filter-redirector -check-qtest-ppc64-$(CONFIG_VGA) += display-vga-test -check-qtest-ppc64-y += numa-test -check-qtest-ppc64-$(CONFIG_IVSHMEM_DEVICE) += ivshmem-test -check-qtest-ppc64-y += cpu-plug-test - -check-qtest-sh4-$(CONFIG_ISA_TESTDEV) = endianness-test - -check-qtest-sh4eb-$(CONFIG_ISA_TESTDEV) = endianness-test - -check-qtest-sparc-y += prom-env-test -check-qtest-sparc-y += m48t59-test -check-qtest-sparc-y += boot-serial-test - -check-qtest-sparc64-$(CONFIG_ISA_TESTDEV) = endianness-test -check-qtest-sparc64-y += prom-env-test -check-qtest-sparc64-y += boot-serial-test - -check-qtest-arm-y += arm-cpu-features -check-qtest-arm-y += microbit-test -check-qtest-arm-y += m25p80-test -check-qtest-arm-y += test-arm-mptimer -check-qtest-arm-y += boot-serial-test -check-qtest-arm-y += hexloader-test -check-qtest-arm-$(CONFIG_PFLASH_CFI02) += pflash-cfi02-test - -check-qtest-aarch64-y += arm-cpu-features -check-qtest-aarch64-$(CONFIG_TPM_TIS_SYSBUS) += tpm-tis-device-test -check-qtest-aarch64-$(CONFIG_TPM_TIS_SYSBUS) += tpm-tis-device-swtpm-test -check-qtest-aarch64-y += numa-test -check-qtest-aarch64-y += boot-serial-test -check-qtest-aarch64-y += migration-test - -# TODO: once aarch64 TCG is fixed on ARM 32 bit host, make test unconditional -ifneq ($(ARCH),arm) -check-qtest-aarch64-y += bios-tables-test -endif - -check-qtest-microblazeel-y += $(check-qtest-microblaze-y) - -check-qtest-xtensaeb-y += $(check-qtest-xtensa-y) - -check-qtest-s390x-y = boot-serial-test -check-qtest-s390x-$(CONFIG_SLIRP) += pxe-test -check-qtest-s390x-$(CONFIG_SLIRP) += test-netfilter -check-qtest-s390x-$(CONFIG_POSIX) += test-filter-mirror -check-qtest-s390x-$(CONFIG_POSIX) += test-filter-redirector -check-qtest-s390x-y += drive_del-test -check-qtest-s390x-y += device-plug-test -check-qtest-s390x-y += virtio-ccw-test -check-qtest-s390x-y += cpu-plug-test -check-qtest-s390x-y += migration-test - -# libqos / qgraph : -libqgraph-obj-y = tests/qtest/libqos/qgraph.o - -libqos-core-obj-y = $(libqgraph-obj-y) tests/qtest/libqos/pci.o tests/qtest/libqos/fw_cfg.o -libqos-core-obj-y += tests/qtest/libqos/malloc.o -libqos-core-obj-y += tests/qtest/libqos/libqos.o -libqos-spapr-obj-y = $(libqos-core-obj-y) tests/qtest/libqos/malloc-spapr.o -libqos-spapr-obj-y += tests/qtest/libqos/libqos-spapr.o -libqos-spapr-obj-y += tests/qtest/libqos/rtas.o -libqos-spapr-obj-y += tests/qtest/libqos/pci-spapr.o -libqos-pc-obj-y = $(libqos-core-obj-y) tests/qtest/libqos/pci-pc.o -libqos-pc-obj-y += tests/qtest/libqos/malloc-pc.o tests/qtest/libqos/libqos-pc.o -libqos-pc-obj-y += tests/qtest/libqos/ahci.o -libqos-usb-obj-y = $(libqos-spapr-obj-y) $(libqos-pc-obj-y) tests/qtest/libqos/usb.o - -# qos devices: -libqos-obj-y = $(libqgraph-obj-y) -libqos-obj-y += $(libqos-pc-obj-y) $(libqos-spapr-obj-y) -libqos-obj-y += tests/qtest/libqos/qos_external.o -libqos-obj-y += tests/qtest/libqos/e1000e.o -libqos-obj-y += tests/qtest/libqos/i2c.o -libqos-obj-y += tests/qtest/libqos/i2c-imx.o -libqos-obj-y += tests/qtest/libqos/i2c-omap.o -libqos-obj-y += tests/qtest/libqos/sdhci.o -libqos-obj-y += tests/qtest/libqos/tpci200.o -libqos-obj-y += tests/qtest/libqos/virtio.o -libqos-obj-$(CONFIG_VIRTFS) += tests/qtest/libqos/virtio-9p.o -libqos-obj-y += tests/qtest/libqos/virtio-balloon.o -libqos-obj-y += tests/qtest/libqos/virtio-blk.o -libqos-obj-y += tests/qtest/libqos/virtio-mmio.o -libqos-obj-y += tests/qtest/libqos/virtio-net.o -libqos-obj-y += tests/qtest/libqos/virtio-pci.o -libqos-obj-y += tests/qtest/libqos/virtio-pci-modern.o -libqos-obj-y += tests/qtest/libqos/virtio-rng.o -libqos-obj-y += tests/qtest/libqos/virtio-scsi.o -libqos-obj-y += tests/qtest/libqos/virtio-serial.o - -# qos machines: -libqos-obj-y += tests/qtest/libqos/aarch64-xlnx-zcu102-machine.o -libqos-obj-y += tests/qtest/libqos/arm-imx25-pdk-machine.o -libqos-obj-y += tests/qtest/libqos/arm-n800-machine.o -libqos-obj-y += tests/qtest/libqos/arm-raspi2-machine.o -libqos-obj-y += tests/qtest/libqos/arm-sabrelite-machine.o -libqos-obj-y += tests/qtest/libqos/arm-smdkc210-machine.o -libqos-obj-y += tests/qtest/libqos/arm-virt-machine.o -libqos-obj-y += tests/qtest/libqos/arm-xilinx-zynq-a9-machine.o -libqos-obj-y += tests/qtest/libqos/ppc64_pseries-machine.o -libqos-obj-y += tests/qtest/libqos/x86_64_pc-machine.o - -# qos tests: -qos-test-obj-y += tests/qtest/qos-test.o -qos-test-obj-y += tests/qtest/ac97-test.o -qos-test-obj-y += tests/qtest/ds1338-test.o -qos-test-obj-y += tests/qtest/e1000-test.o -qos-test-obj-y += tests/qtest/e1000e-test.o -qos-test-obj-y += tests/qtest/eepro100-test.o -qos-test-obj-y += tests/qtest/es1370-test.o -qos-test-obj-y += tests/qtest/ipoctal232-test.o -qos-test-obj-y += tests/qtest/megasas-test.o -qos-test-obj-y += tests/qtest/ne2000-test.o -qos-test-obj-y += tests/qtest/tulip-test.o -qos-test-obj-y += tests/qtest/nvme-test.o -qos-test-obj-y += tests/qtest/pca9552-test.o -qos-test-obj-y += tests/qtest/pci-test.o -qos-test-obj-y += tests/qtest/pcnet-test.o -qos-test-obj-y += tests/qtest/sdhci-test.o -qos-test-obj-y += tests/qtest/spapr-phb-test.o -qos-test-obj-y += tests/qtest/tmp105-test.o -qos-test-obj-y += tests/qtest/usb-hcd-ohci-test.o $(libqos-usb-obj-y) -qos-test-obj-$(CONFIG_VHOST_NET_USER) += tests/qtest/vhost-user-test.o $(chardev-obj-y) $(test-io-obj-y) -qos-test-obj-y += tests/qtest/virtio-test.o -qos-test-obj-$(CONFIG_VIRTFS) += tests/qtest/virtio-9p-test.o -qos-test-obj-y += tests/qtest/virtio-blk-test.o -qos-test-obj-y += tests/qtest/virtio-net-test.o -qos-test-obj-y += tests/qtest/virtio-rng-test.o -qos-test-obj-y += tests/qtest/virtio-scsi-test.o -qos-test-obj-y += tests/qtest/virtio-serial-test.o -qos-test-obj-y += tests/qtest/vmxnet3-test.o - -check-unit-y += tests/test-qgraph$(EXESUF) -tests/test-qgraph$(EXESUF): tests/test-qgraph.o $(libqgraph-obj-y) - -check-qtest-generic-y += qos-test -tests/qtest/qos-test$(EXESUF): $(qos-test-obj-y) $(libqos-obj-y) - -# QTest dependencies: -tests/qtest/qmp-test$(EXESUF): tests/qtest/qmp-test.o -tests/qtest/qmp-cmd-test$(EXESUF): tests/qtest/qmp-cmd-test.o -tests/qtest/device-introspect-test$(EXESUF): tests/qtest/device-introspect-test.o -tests/qtest/rtc-test$(EXESUF): tests/qtest/rtc-test.o -tests/qtest/m48t59-test$(EXESUF): tests/qtest/m48t59-test.o -tests/qtest/hexloader-test$(EXESUF): tests/qtest/hexloader-test.o -tests/qtest/pflash-cfi02$(EXESUF): tests/qtest/pflash-cfi02-test.o -tests/qtest/endianness-test$(EXESUF): tests/qtest/endianness-test.o -tests/qtest/prom-env-test$(EXESUF): tests/qtest/prom-env-test.o $(libqos-obj-y) -tests/qtest/rtas-test$(EXESUF): tests/qtest/rtas-test.o $(libqos-spapr-obj-y) -tests/qtest/fdc-test$(EXESUF): tests/qtest/fdc-test.o -tests/qtest/ide-test$(EXESUF): tests/qtest/ide-test.o $(libqos-pc-obj-y) -tests/qtest/ahci-test$(EXESUF): tests/qtest/ahci-test.o $(libqos-pc-obj-y) qemu-img$(EXESUF) -tests/qtest/ipmi-kcs-test$(EXESUF): tests/qtest/ipmi-kcs-test.o -tests/qtest/ipmi-bt-test$(EXESUF): tests/qtest/ipmi-bt-test.o -tests/qtest/hd-geo-test$(EXESUF): tests/qtest/hd-geo-test.o $(libqos-obj-y) -tests/qtest/boot-order-test$(EXESUF): tests/qtest/boot-order-test.o $(libqos-obj-y) -tests/qtest/boot-serial-test$(EXESUF): tests/qtest/boot-serial-test.o $(libqos-obj-y) -tests/qtest/bios-tables-test$(EXESUF): tests/qtest/bios-tables-test.o \ - tests/qtest/tpm-emu.o $(test-io-obj-y) \ - tests/qtest/boot-sector.o tests/qtest/acpi-utils.o $(libqos-obj-y) -tests/qtest/pxe-test$(EXESUF): tests/qtest/pxe-test.o tests/qtest/boot-sector.o $(libqos-obj-y) -tests/qtest/microbit-test$(EXESUF): tests/qtest/microbit-test.o -tests/qtest/m25p80-test$(EXESUF): tests/qtest/m25p80-test.o -tests/qtest/i440fx-test$(EXESUF): tests/qtest/i440fx-test.o $(libqos-pc-obj-y) -tests/qtest/q35-test$(EXESUF): tests/qtest/q35-test.o $(libqos-pc-obj-y) -tests/qtest/fw_cfg-test$(EXESUF): tests/qtest/fw_cfg-test.o $(libqos-pc-obj-y) -tests/qtest/rtl8139-test$(EXESUF): tests/qtest/rtl8139-test.o $(libqos-pc-obj-y) -tests/qtest/pnv-xscom-test$(EXESUF): tests/qtest/pnv-xscom-test.o -tests/qtest/wdt_ib700-test$(EXESUF): tests/qtest/wdt_ib700-test.o -tests/qtest/tco-test$(EXESUF): tests/qtest/tco-test.o $(libqos-pc-obj-y) -tests/qtest/virtio-ccw-test$(EXESUF): tests/qtest/virtio-ccw-test.o -tests/qtest/display-vga-test$(EXESUF): tests/qtest/display-vga-test.o -tests/qtest/qom-test$(EXESUF): tests/qtest/qom-test.o -tests/qtest/modules-test$(EXESUF): tests/qtest/modules-test.o -tests/qtest/test-hmp$(EXESUF): tests/qtest/test-hmp.o -tests/qtest/machine-none-test$(EXESUF): tests/qtest/machine-none-test.o -tests/qtest/device-plug-test$(EXESUF): tests/qtest/device-plug-test.o -tests/qtest/drive_del-test$(EXESUF): tests/qtest/drive_del-test.o -tests/qtest/pvpanic-test$(EXESUF): tests/qtest/pvpanic-test.o -tests/qtest/i82801b11-test$(EXESUF): tests/qtest/i82801b11-test.o -tests/qtest/intel-hda-test$(EXESUF): tests/qtest/intel-hda-test.o -tests/qtest/ioh3420-test$(EXESUF): tests/qtest/ioh3420-test.o -tests/qtest/usb-hcd-uhci-test$(EXESUF): tests/qtest/usb-hcd-uhci-test.o $(libqos-usb-obj-y) -tests/qtest/usb-hcd-ehci-test$(EXESUF): tests/qtest/usb-hcd-ehci-test.o $(libqos-usb-obj-y) -tests/qtest/usb-hcd-xhci-test$(EXESUF): tests/qtest/usb-hcd-xhci-test.o $(libqos-usb-obj-y) -tests/qtest/cpu-plug-test$(EXESUF): tests/qtest/cpu-plug-test.o -tests/qtest/migration-test$(EXESUF): tests/qtest/migration-test.o tests/qtest/migration-helpers.o -tests/qtest/test-netfilter$(EXESUF): tests/qtest/test-netfilter.o $(qtest-obj-y) -tests/qtest/test-filter-mirror$(EXESUF): tests/qtest/test-filter-mirror.o $(qtest-obj-y) -tests/qtest/test-filter-redirector$(EXESUF): tests/qtest/test-filter-redirector.o $(qtest-obj-y) -tests/qtest/test-x86-cpuid-compat$(EXESUF): tests/qtest/test-x86-cpuid-compat.o $(qtest-obj-y) -tests/qtest/ivshmem-test$(EXESUF): tests/qtest/ivshmem-test.o contrib/ivshmem-server/ivshmem-server.o $(libqos-pc-obj-y) $(libqos-spapr-obj-y) -tests/qtest/dbus-vmstate-test$(EXESUF): tests/qtest/dbus-vmstate-test.o tests/qtest/migration-helpers.o tests/qtest/dbus-vmstate1.o $(libqos-pc-obj-y) $(libqos-spapr-obj-y) -tests/qtest/test-arm-mptimer$(EXESUF): tests/qtest/test-arm-mptimer.o -tests/qtest/numa-test$(EXESUF): tests/qtest/numa-test.o -tests/qtest/vmgenid-test$(EXESUF): tests/qtest/vmgenid-test.o tests/qtest/boot-sector.o tests/qtest/acpi-utils.o -tests/qtest/cdrom-test$(EXESUF): tests/qtest/cdrom-test.o tests/qtest/boot-sector.o $(libqos-obj-y) -tests/qtest/arm-cpu-features$(EXESUF): tests/qtest/arm-cpu-features.o -tests/qtest/tpm-crb-swtpm-test$(EXESUF): tests/qtest/tpm-crb-swtpm-test.o tests/qtest/tpm-emu.o \ - tests/qtest/tpm-util.o tests/qtest/tpm-tests.o $(test-io-obj-y) -tests/qtest/tpm-crb-test$(EXESUF): tests/qtest/tpm-crb-test.o tests/qtest/tpm-emu.o $(test-io-obj-y) -tests/qtest/tpm-tis-swtpm-test$(EXESUF): tests/qtest/tpm-tis-swtpm-test.o tests/qtest/tpm-emu.o \ - tests/qtest/tpm-util.o tests/qtest/tpm-tests.o $(test-io-obj-y) -tests/qtest/tpm-tis-device-swtpm-test$(EXESUF): tests/qtest/tpm-tis-device-swtpm-test.o tests/qtest/tpm-emu.o \ - tests/qtest/tpm-util.o tests/qtest/tpm-tests.o $(test-io-obj-y) -tests/qtest/tpm-tis-test$(EXESUF): tests/qtest/tpm-tis-test.o tests/qtest/tpm-tis-util.o tests/qtest/tpm-emu.o $(test-io-obj-y) -tests/qtest/tpm-tis-device-test$(EXESUF): tests/qtest/tpm-tis-device-test.o tests/qtest/tpm-tis-util.o tests/qtest/tpm-emu.o $(test-io-obj-y) - -# QTest rules - -TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGET_DIRS))) -QTEST_TARGETS = -# The qtests are not runnable (yet) under TSan due to a known issue. -# https://github.com/google/sanitizers/issues/1116 -ifndef CONFIG_TSAN -ifeq ($(CONFIG_POSIX),y) -QTEST_TARGETS = $(TARGETS) -check-qtest-y=$(foreach TARGET,$(TARGETS), $(check-qtest-$(TARGET)-y:%=tests/qtest/%$(EXESUF))) -check-qtest-y += $(check-qtest-generic-y:%=tests/qtest/%$(EXESUF)) -endif -endif - -qtest-obj-y = tests/qtest/libqtest.o $(test-util-obj-y) -$(check-qtest-y): $(qtest-obj-y) diff --git a/tests/qtest/ac97-test.c b/tests/qtest/ac97-test.c index b084e31bff..e09f2495d2 100644 --- a/tests/qtest/ac97-test.c +++ b/tests/qtest/ac97-test.c @@ -8,7 +8,7 @@ */ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qemu/module.h" #include "libqos/qgraph.h" #include "libqos/pci.h" diff --git a/tests/qtest/acpi-utils.h b/tests/qtest/acpi-utils.h index 0c86780689..261784d251 100644 --- a/tests/qtest/acpi-utils.h +++ b/tests/qtest/acpi-utils.h @@ -13,7 +13,7 @@ #ifndef TEST_ACPI_UTILS_H #define TEST_ACPI_UTILS_H -#include "libqtest.h" +#include "libqos/libqtest.h" /* DSDT and SSDTs format */ typedef struct { diff --git a/tests/qtest/ahci-test.c b/tests/qtest/ahci-test.c index c8d42ceea0..ca4294f44f 100644 --- a/tests/qtest/ahci-test.c +++ b/tests/qtest/ahci-test.c @@ -25,7 +25,7 @@ #include "qemu/osdep.h" #include <getopt.h> -#include "libqtest.h" +#include "libqos/libqtest.h" #include "libqos/libqos-pc.h" #include "libqos/ahci.h" #include "libqos/pci-pc.h" diff --git a/tests/qtest/arm-cpu-features.c b/tests/qtest/arm-cpu-features.c index f7e062c189..77b5e30a9c 100644 --- a/tests/qtest/arm-cpu-features.c +++ b/tests/qtest/arm-cpu-features.c @@ -10,7 +10,7 @@ */ #include "qemu/osdep.h" #include "qemu/bitops.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qapi/qmp/qdict.h" #include "qapi/qmp/qjson.h" diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index d49b3988ec..d25ff35492 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -88,7 +88,7 @@ typedef struct { static char disk[] = "tests/acpi-test-disk-XXXXXX"; static const char *data_dir = "tests/data/acpi"; #ifdef CONFIG_IASL -static const char *iasl = stringify(CONFIG_IASL); +static const char *iasl = CONFIG_IASL; #else static const char *iasl; #endif diff --git a/tests/qtest/boot-order-test.c b/tests/qtest/boot-order-test.c index 2f1c07221c..fac580d6c4 100644 --- a/tests/qtest/boot-order-test.c +++ b/tests/qtest/boot-order-test.c @@ -12,7 +12,7 @@ #include "qemu/osdep.h" #include "libqos/fw_cfg.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qapi/qmp/qdict.h" #include "standard-headers/linux/qemu_fw_cfg.h" diff --git a/tests/qtest/boot-sector.c b/tests/qtest/boot-sector.c index 9e66c6d013..24df5c4734 100644 --- a/tests/qtest/boot-sector.c +++ b/tests/qtest/boot-sector.c @@ -13,7 +13,7 @@ #include "qemu/osdep.h" #include "boot-sector.h" #include "qemu-common.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #define LOW(x) ((x) & 0xff) #define HIGH(x) ((x) >> 8) diff --git a/tests/qtest/boot-sector.h b/tests/qtest/boot-sector.h index 6ee6bb4d97..b339fdee4c 100644 --- a/tests/qtest/boot-sector.h +++ b/tests/qtest/boot-sector.h @@ -14,7 +14,7 @@ #ifndef TEST_BOOT_SECTOR_H #define TEST_BOOT_SECTOR_H -#include "libqtest.h" +#include "libqos/libqtest.h" /* Create boot disk file. fname must be a suitable string for mkstemp() */ int boot_sector_init(char *fname); diff --git a/tests/qtest/boot-serial-test.c b/tests/qtest/boot-serial-test.c index bfe7624dc6..b6b1c23cd0 100644 --- a/tests/qtest/boot-serial-test.c +++ b/tests/qtest/boot-serial-test.c @@ -14,7 +14,7 @@ */ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "libqos/libqos-spapr.h" static const uint8_t bios_avr[] = { diff --git a/tests/qtest/cdrom-test.c b/tests/qtest/cdrom-test.c index 833a0508a1..e9afab693c 100644 --- a/tests/qtest/cdrom-test.c +++ b/tests/qtest/cdrom-test.c @@ -11,7 +11,7 @@ */ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "boot-sector.h" #include "qapi/qmp/qdict.h" diff --git a/tests/qtest/dbus-vmstate-test.c b/tests/qtest/dbus-vmstate-test.c index 2e5e47dec2..aca9b98b7a 100644 --- a/tests/qtest/dbus-vmstate-test.c +++ b/tests/qtest/dbus-vmstate-test.c @@ -1,7 +1,7 @@ #include "qemu/osdep.h" #include <glib/gstdio.h> #include <gio/gio.h> -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qemu-common.h" #include "dbus-vmstate1.h" #include "migration-helpers.h" diff --git a/tests/qtest/device-introspect-test.c b/tests/qtest/device-introspect-test.c index d68b7856a7..9f22340ee5 100644 --- a/tests/qtest/device-introspect-test.c +++ b/tests/qtest/device-introspect-test.c @@ -22,7 +22,7 @@ #include "qapi/qmp/qstring.h" #include "qapi/qmp/qdict.h" #include "qapi/qmp/qlist.h" -#include "libqtest.h" +#include "libqos/libqtest.h" const char common_args[] = "-nodefaults -machine none"; diff --git a/tests/qtest/device-plug-test.c b/tests/qtest/device-plug-test.c index 318e422d51..9214892741 100644 --- a/tests/qtest/device-plug-test.c +++ b/tests/qtest/device-plug-test.c @@ -11,7 +11,7 @@ */ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qapi/qmp/qdict.h" #include "qapi/qmp/qstring.h" diff --git a/tests/qtest/drive_del-test.c b/tests/qtest/drive_del-test.c index 5f8839b232..2ab11ad225 100644 --- a/tests/qtest/drive_del-test.c +++ b/tests/qtest/drive_del-test.c @@ -11,7 +11,7 @@ */ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "libqos/virtio.h" #include "qapi/qmp/qdict.h" diff --git a/tests/qtest/ds1338-test.c b/tests/qtest/ds1338-test.c index f6ade9a050..c5d46bcc64 100644 --- a/tests/qtest/ds1338-test.c +++ b/tests/qtest/ds1338-test.c @@ -18,7 +18,7 @@ */ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "libqos/i2c.h" #define DS1338_ADDR 0x68 diff --git a/tests/qtest/e1000-test.c b/tests/qtest/e1000-test.c index c387984ef6..ea286d1793 100644 --- a/tests/qtest/e1000-test.c +++ b/tests/qtest/e1000-test.c @@ -8,7 +8,7 @@ */ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qemu/module.h" #include "libqos/qgraph.h" #include "libqos/pci.h" diff --git a/tests/qtest/eepro100-test.c b/tests/qtest/eepro100-test.c index 8dbffff0b8..d72ad099f1 100644 --- a/tests/qtest/eepro100-test.c +++ b/tests/qtest/eepro100-test.c @@ -8,7 +8,7 @@ */ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qemu/module.h" #include "libqos/qgraph.h" #include "libqos/pci.h" diff --git a/tests/qtest/endianness-test.c b/tests/qtest/endianness-test.c index cc088ac01a..4e79e22c28 100644 --- a/tests/qtest/endianness-test.c +++ b/tests/qtest/endianness-test.c @@ -13,7 +13,7 @@ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qemu/bswap.h" typedef struct TestCase TestCase; diff --git a/tests/qtest/es1370-test.c b/tests/qtest/es1370-test.c index adccdac1be..2fd7fd2d3d 100644 --- a/tests/qtest/es1370-test.c +++ b/tests/qtest/es1370-test.c @@ -8,7 +8,7 @@ */ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qemu/module.h" #include "libqos/qgraph.h" #include "libqos/pci.h" diff --git a/tests/qtest/fuzz/Makefile.include b/tests/qtest/fuzz/Makefile.include deleted file mode 100644 index 5bde793bf2..0000000000 --- a/tests/qtest/fuzz/Makefile.include +++ /dev/null @@ -1,39 +0,0 @@ -QEMU_PROG_FUZZ=qemu-fuzz-$(TARGET_NAME)$(EXESUF) - -fuzz-obj-y += tests/qtest/libqtest.o -fuzz-obj-y += $(libqos-obj-y) -fuzz-obj-y += tests/qtest/fuzz/fuzz.o # Fuzzer skeleton -fuzz-obj-y += tests/qtest/fuzz/fork_fuzz.o -fuzz-obj-y += tests/qtest/fuzz/qos_fuzz.o -fuzz-obj-y += tests/qtest/fuzz/qtest_wrappers.o - -# Targets -fuzz-obj-$(CONFIG_PCI_I440FX) += tests/qtest/fuzz/i440fx_fuzz.o -fuzz-obj-$(CONFIG_VIRTIO_NET) += tests/qtest/fuzz/virtio_net_fuzz.o -fuzz-obj-$(CONFIG_SCSI) += tests/qtest/fuzz/virtio_scsi_fuzz.o - -FUZZ_CFLAGS += -I$(SRC_PATH)/tests -I$(SRC_PATH)/tests/qtest - -# Linker Script to force coverage-counters into known regions which we can mark -# shared -FUZZ_LDFLAGS += -Xlinker -T$(SRC_PATH)/tests/qtest/fuzz/fork_fuzz.ld - -FUZZ_LDFLAGS += -Wl,-wrap,qtest_inb -FUZZ_LDFLAGS += -Wl,-wrap,qtest_inw -FUZZ_LDFLAGS += -Wl,-wrap,qtest_inl -FUZZ_LDFLAGS += -Wl,-wrap,qtest_outb -FUZZ_LDFLAGS += -Wl,-wrap,qtest_outw -FUZZ_LDFLAGS += -Wl,-wrap,qtest_outl -FUZZ_LDFLAGS += -Wl,-wrap,qtest_readb -FUZZ_LDFLAGS += -Wl,-wrap,qtest_readw -FUZZ_LDFLAGS += -Wl,-wrap,qtest_readl -FUZZ_LDFLAGS += -Wl,-wrap,qtest_readq -FUZZ_LDFLAGS += -Wl,-wrap,qtest_writeb -FUZZ_LDFLAGS += -Wl,-wrap,qtest_writew -FUZZ_LDFLAGS += -Wl,-wrap,qtest_writel -FUZZ_LDFLAGS += -Wl,-wrap,qtest_writeq -FUZZ_LDFLAGS += -Wl,-wrap,qtest_memread -FUZZ_LDFLAGS += -Wl,-wrap,qtest_bufread -FUZZ_LDFLAGS += -Wl,-wrap,qtest_memwrite -FUZZ_LDFLAGS += -Wl,-wrap,qtest_bufwrite -FUZZ_LDFLAGS += -Wl,-wrap,qtest_memset diff --git a/tests/qtest/fuzz/fuzz.c b/tests/qtest/fuzz/fuzz.c index 031594a686..1ceea84702 100644 --- a/tests/qtest/fuzz/fuzz.c +++ b/tests/qtest/fuzz/fuzz.c @@ -20,7 +20,7 @@ #include "sysemu/sysemu.h" #include "qemu/main-loop.h" #include "qemu/rcu.h" -#include "tests/qtest/libqtest.h" +#include "tests/qtest/libqos/libqtest.h" #include "tests/qtest/libqos/qgraph.h" #include "fuzz.h" diff --git a/tests/qtest/fuzz/fuzz.h b/tests/qtest/fuzz/fuzz.h index 9ca3d107c5..8eb765edc8 100644 --- a/tests/qtest/fuzz/fuzz.h +++ b/tests/qtest/fuzz/fuzz.h @@ -18,7 +18,7 @@ #include "qemu/units.h" #include "qapi/error.h" -#include "tests/qtest/libqtest.h" +#include "tests/qtest/libqos/libqtest.h" /** * A libfuzzer fuzzing target diff --git a/tests/qtest/fuzz/i440fx_fuzz.c b/tests/qtest/fuzz/i440fx_fuzz.c index bf966d478b..86796bff2b 100644 --- a/tests/qtest/fuzz/i440fx_fuzz.c +++ b/tests/qtest/fuzz/i440fx_fuzz.c @@ -13,12 +13,12 @@ #include "qemu/osdep.h" #include "qemu/main-loop.h" -#include "tests/qtest/libqtest.h" +#include "tests/qtest/libqos/libqtest.h" #include "tests/qtest/libqos/pci.h" #include "tests/qtest/libqos/pci-pc.h" #include "fuzz.h" -#include "fuzz/qos_fuzz.h" -#include "fuzz/fork_fuzz.h" +#include "qos_fuzz.h" +#include "fork_fuzz.h" #define I440FX_PCI_HOST_BRIDGE_CFG 0xcf8 diff --git a/tests/qtest/fuzz/meson.build b/tests/qtest/fuzz/meson.build new file mode 100644 index 0000000000..bb0a3f271d --- /dev/null +++ b/tests/qtest/fuzz/meson.build @@ -0,0 +1,35 @@ +specific_fuzz_ss.add(files('fuzz.c', 'fork_fuzz.c', 'qos_fuzz.c', + 'qtest_wrappers.c'), qos) + +# Targets +specific_fuzz_ss.add(when: 'CONFIG_I440FX', if_true: files('i440fx_fuzz.c')) +specific_fuzz_ss.add(when: 'CONFIG_VIRTIO_NET', if_true: files('virtio_net_fuzz.c')) +specific_fuzz_ss.add(when: 'CONFIG_VIRTIO_SCSI', if_true: files('virtio_scsi_fuzz.c')) + +# unfortunately declare_dependency does not support link_depends, so +# this will be duplicated in meson.build +fork_fuzz = declare_dependency( + link_args: ['-fsanitize=fuzzer', + '-Wl,-T,' + (meson.current_source_dir() / 'fork_fuzz.ld'), + '-Wl,-wrap,qtest_inb', + '-Wl,-wrap,qtest_inw', + '-Wl,-wrap,qtest_inl', + '-Wl,-wrap,qtest_outb', + '-Wl,-wrap,qtest_outw', + '-Wl,-wrap,qtest_outl', + '-Wl,-wrap,qtest_readb', + '-Wl,-wrap,qtest_readw', + '-Wl,-wrap,qtest_readl', + '-Wl,-wrap,qtest_readq', + '-Wl,-wrap,qtest_writeb', + '-Wl,-wrap,qtest_writew', + '-Wl,-wrap,qtest_writel', + '-Wl,-wrap,qtest_writeq', + '-Wl,-wrap,qtest_memread', + '-Wl,-wrap,qtest_bufread', + '-Wl,-wrap,qtest_memwrite', + '-Wl,-wrap,qtest_bufwrite', + '-Wl,-wrap,qtest_memset'] +) + +specific_fuzz_ss.add(fork_fuzz) diff --git a/tests/qtest/fuzz/qos_fuzz.c b/tests/qtest/fuzz/qos_fuzz.c index d52f3ebd83..b943577b8c 100644 --- a/tests/qtest/fuzz/qos_fuzz.c +++ b/tests/qtest/fuzz/qos_fuzz.c @@ -25,7 +25,7 @@ #include "sysemu/sysemu.h" #include "qemu/main-loop.h" -#include "tests/qtest/libqtest.h" +#include "tests/qtest/libqos/libqtest.h" #include "tests/qtest/libqos/malloc.h" #include "tests/qtest/libqos/qgraph.h" #include "tests/qtest/libqos/qgraph_internal.h" diff --git a/tests/qtest/fuzz/qtest_wrappers.c b/tests/qtest/fuzz/qtest_wrappers.c index 713c830cdb..0580f8df86 100644 --- a/tests/qtest/fuzz/qtest_wrappers.c +++ b/tests/qtest/fuzz/qtest_wrappers.c @@ -12,7 +12,7 @@ */ #include "qemu/osdep.h" -#include "cpu.h" +#include "hw/core/cpu.h" #include "exec/ioport.h" #include "fuzz.h" diff --git a/tests/qtest/fuzz/virtio_net_fuzz.c b/tests/qtest/fuzz/virtio_net_fuzz.c index a33bd73067..0e873ab8e2 100644 --- a/tests/qtest/fuzz/virtio_net_fuzz.c +++ b/tests/qtest/fuzz/virtio_net_fuzz.c @@ -13,7 +13,7 @@ #include "qemu/osdep.h" #include "standard-headers/linux/virtio_config.h" -#include "tests/qtest/libqtest.h" +#include "tests/qtest/libqos/libqtest.h" #include "tests/qtest/libqos/virtio-net.h" #include "fuzz.h" #include "fork_fuzz.h" @@ -61,7 +61,8 @@ static void virtio_net_fuzz_multi(QTestState *s, * backend. Otherwise, always place the input on a virtqueue. */ if (vqa.rx && sockfds_initialized) { - write(sockfds[0], Data, vqa.length); + int ignored = write(sockfds[0], Data, vqa.length); + (void) ignored; } else { vqa.rx = 0; uint64_t req_addr = guest_alloc(t_alloc, vqa.length); diff --git a/tests/qtest/fuzz/virtio_scsi_fuzz.c b/tests/qtest/fuzz/virtio_scsi_fuzz.c index 3a9ea13736..6ff6fabe4a 100644 --- a/tests/qtest/fuzz/virtio_scsi_fuzz.c +++ b/tests/qtest/fuzz/virtio_scsi_fuzz.c @@ -12,10 +12,10 @@ #include "qemu/osdep.h" -#include "tests/qtest/libqtest.h" -#include "libqos/virtio-scsi.h" -#include "libqos/virtio.h" -#include "libqos/virtio-pci.h" +#include "tests/qtest/libqos/libqtest.h" +#include "tests/qtest/libqos/virtio-scsi.h" +#include "tests/qtest/libqos/virtio.h" +#include "tests/qtest/libqos/virtio-pci.h" #include "standard-headers/linux/virtio_ids.h" #include "standard-headers/linux/virtio_pci.h" #include "standard-headers/linux/virtio_scsi.h" diff --git a/tests/qtest/fw_cfg-test.c b/tests/qtest/fw_cfg-test.c index 5dc807ba23..95b3907c18 100644 --- a/tests/qtest/fw_cfg-test.c +++ b/tests/qtest/fw_cfg-test.c @@ -12,7 +12,7 @@ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "standard-headers/linux/qemu_fw_cfg.h" #include "libqos/fw_cfg.h" #include "qemu/bswap.h" diff --git a/tests/qtest/hd-geo-test.c b/tests/qtest/hd-geo-test.c index 48e8e02d6e..f7b7cfbc2d 100644 --- a/tests/qtest/hd-geo-test.c +++ b/tests/qtest/hd-geo-test.c @@ -19,7 +19,7 @@ #include "qemu-common.h" #include "qemu/bswap.h" #include "qapi/qmp/qlist.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "libqos/fw_cfg.h" #include "libqos/libqos.h" #include "standard-headers/linux/qemu_fw_cfg.h" diff --git a/tests/qtest/hexloader-test.c b/tests/qtest/hexloader-test.c index 8b7aa2d72d..561502052a 100644 --- a/tests/qtest/hexloader-test.c +++ b/tests/qtest/hexloader-test.c @@ -10,7 +10,7 @@ */ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" /* Load 'test.hex' and verify that the in-memory contents are as expected. * 'test.hex' is a memory test pattern stored in Hexadecimal Object diff --git a/tests/qtest/ide-test.c b/tests/qtest/ide-test.c index 5cfd97f915..3f8081e77d 100644 --- a/tests/qtest/ide-test.c +++ b/tests/qtest/ide-test.c @@ -25,7 +25,7 @@ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "libqos/libqos.h" #include "libqos/pci-pc.h" #include "libqos/malloc-pc.h" diff --git a/tests/qtest/ipoctal232-test.c b/tests/qtest/ipoctal232-test.c index 53a8c9b13c..65ce10b81b 100644 --- a/tests/qtest/ipoctal232-test.c +++ b/tests/qtest/ipoctal232-test.c @@ -8,7 +8,7 @@ */ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qemu/module.h" #include "libqos/qgraph.h" diff --git a/tests/qtest/ivshmem-test.c b/tests/qtest/ivshmem-test.c index ecda256472..d5c8b9f128 100644 --- a/tests/qtest/ivshmem-test.c +++ b/tests/qtest/ivshmem-test.c @@ -13,7 +13,7 @@ #include "contrib/ivshmem-server/ivshmem-server.h" #include "libqos/libqos-pc.h" #include "libqos/libqos-spapr.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qemu-common.h" #define TMPSHMSIZE (1 << 20) diff --git a/tests/qtest/libqos/aarch64-xlnx-zcu102-machine.c b/tests/qtest/libqos/aarch64-xlnx-zcu102-machine.c index 8f827aeb52..79631cc7a9 100644 --- a/tests/qtest/libqos/aarch64-xlnx-zcu102-machine.c +++ b/tests/qtest/libqos/aarch64-xlnx-zcu102-machine.c @@ -19,8 +19,8 @@ #include "qemu/osdep.h" #include "libqtest.h" #include "qemu/module.h" -#include "libqos/malloc.h" -#include "libqos/qgraph.h" +#include "malloc.h" +#include "qgraph.h" #include "sdhci.h" typedef struct QXlnxZCU102Machine QXlnxZCU102Machine; diff --git a/tests/qtest/libqos/ahci.c b/tests/qtest/libqos/ahci.c index cc1b08eabe..2946abc15a 100644 --- a/tests/qtest/libqos/ahci.c +++ b/tests/qtest/libqos/ahci.c @@ -25,8 +25,8 @@ #include "qemu/osdep.h" #include "libqtest.h" -#include "libqos/ahci.h" -#include "libqos/pci-pc.h" +#include "ahci.h" +#include "pci-pc.h" #include "qemu-common.h" #include "qemu/host-utils.h" @@ -579,7 +579,7 @@ void ahci_write_fis(AHCIQState *ahci, AHCICommand *cmd) /* NCQ commands use exclusively 8 bit fields and needs no adjustment. * Only the count field needs to be adjusted for non-NCQ commands. * The auxiliary FIS fields are defined per-command and are not currently - * implemented in libqos/ahci.o, but may or may not need to be flipped. */ + * implemented in ahci.o, but may or may not need to be flipped. */ if (!cmd->props->ncq) { tmp.count = cpu_to_le16(tmp.count); } diff --git a/tests/qtest/libqos/ahci.h b/tests/qtest/libqos/ahci.h index 44ab1104b5..88835b6228 100644 --- a/tests/qtest/libqos/ahci.h +++ b/tests/qtest/libqos/ahci.h @@ -25,9 +25,9 @@ * THE SOFTWARE. */ -#include "libqos/libqos.h" -#include "libqos/pci.h" -#include "libqos/malloc-pc.h" +#include "libqos.h" +#include "pci.h" +#include "malloc-pc.h" /*** Supplementary PCI Config Space IDs & Masks ***/ #define PCI_DEVICE_ID_INTEL_Q35_AHCI (0x2922) diff --git a/tests/qtest/libqos/arm-imx25-pdk-machine.c b/tests/qtest/libqos/arm-imx25-pdk-machine.c index 0da3f19c0e..6692adfa4f 100644 --- a/tests/qtest/libqos/arm-imx25-pdk-machine.c +++ b/tests/qtest/libqos/arm-imx25-pdk-machine.c @@ -20,9 +20,9 @@ #include "qemu/osdep.h" #include "libqtest.h" -#include "libqos/malloc.h" -#include "libqos/qgraph.h" -#include "libqos/i2c.h" +#include "malloc.h" +#include "qgraph.h" +#include "i2c.h" #define ARM_PAGE_SIZE 4096 #define IMX25_PDK_RAM_START 0x80000000 diff --git a/tests/qtest/libqos/arm-n800-machine.c b/tests/qtest/libqos/arm-n800-machine.c index 35f82070fa..ff2049c3a7 100644 --- a/tests/qtest/libqos/arm-n800-machine.c +++ b/tests/qtest/libqos/arm-n800-machine.c @@ -20,9 +20,9 @@ #include "qemu/osdep.h" #include "libqtest.h" -#include "libqos/malloc.h" -#include "libqos/qgraph.h" -#include "libqos/i2c.h" +#include "malloc.h" +#include "qgraph.h" +#include "i2c.h" #define ARM_PAGE_SIZE 4096 #define N800_RAM_START 0x80000000 diff --git a/tests/qtest/libqos/arm-raspi2-machine.c b/tests/qtest/libqos/arm-raspi2-machine.c index 8480d80669..35bb4709a4 100644 --- a/tests/qtest/libqos/arm-raspi2-machine.c +++ b/tests/qtest/libqos/arm-raspi2-machine.c @@ -19,8 +19,8 @@ #include "qemu/osdep.h" #include "libqtest.h" #include "qemu/module.h" -#include "libqos/malloc.h" -#include "libqos/qgraph.h" +#include "malloc.h" +#include "qgraph.h" #include "sdhci.h" #define ARM_PAGE_SIZE 4096 diff --git a/tests/qtest/libqos/arm-sabrelite-machine.c b/tests/qtest/libqos/arm-sabrelite-machine.c index f6e403b538..72425f0ad4 100644 --- a/tests/qtest/libqos/arm-sabrelite-machine.c +++ b/tests/qtest/libqos/arm-sabrelite-machine.c @@ -19,8 +19,8 @@ #include "qemu/osdep.h" #include "libqtest.h" #include "qemu/module.h" -#include "libqos/malloc.h" -#include "libqos/qgraph.h" +#include "malloc.h" +#include "qgraph.h" #include "sdhci.h" #define ARM_PAGE_SIZE 4096 diff --git a/tests/qtest/libqos/arm-smdkc210-machine.c b/tests/qtest/libqos/arm-smdkc210-machine.c index eebac7feeb..321b8826d4 100644 --- a/tests/qtest/libqos/arm-smdkc210-machine.c +++ b/tests/qtest/libqos/arm-smdkc210-machine.c @@ -19,8 +19,8 @@ #include "qemu/osdep.h" #include "libqtest.h" #include "qemu/module.h" -#include "libqos/malloc.h" -#include "libqos/qgraph.h" +#include "malloc.h" +#include "qgraph.h" #include "sdhci.h" #define ARM_PAGE_SIZE 4096 diff --git a/tests/qtest/libqos/arm-virt-machine.c b/tests/qtest/libqos/arm-virt-machine.c index 9316598f9e..e0f5932284 100644 --- a/tests/qtest/libqos/arm-virt-machine.c +++ b/tests/qtest/libqos/arm-virt-machine.c @@ -19,9 +19,9 @@ #include "qemu/osdep.h" #include "libqtest.h" #include "qemu/module.h" -#include "libqos/malloc.h" -#include "libqos/qgraph.h" -#include "libqos/virtio-mmio.h" +#include "malloc.h" +#include "qgraph.h" +#include "virtio-mmio.h" #define ARM_PAGE_SIZE 4096 #define VIRTIO_MMIO_BASE_ADDR 0x0A003E00 diff --git a/tests/qtest/libqos/arm-xilinx-zynq-a9-machine.c b/tests/qtest/libqos/arm-xilinx-zynq-a9-machine.c index 473acce993..56e53c745b 100644 --- a/tests/qtest/libqos/arm-xilinx-zynq-a9-machine.c +++ b/tests/qtest/libqos/arm-xilinx-zynq-a9-machine.c @@ -19,8 +19,8 @@ #include "qemu/osdep.h" #include "libqtest.h" #include "qemu/module.h" -#include "libqos/malloc.h" -#include "libqos/qgraph.h" +#include "malloc.h" +#include "qgraph.h" #include "sdhci.h" typedef struct QXilinxZynqA9Machine QXilinxZynqA9Machine; diff --git a/tests/qtest/libqos/e1000e.c b/tests/qtest/libqos/e1000e.c index e2927ed2da..a451f6168f 100644 --- a/tests/qtest/libqos/e1000e.c +++ b/tests/qtest/libqos/e1000e.c @@ -18,13 +18,13 @@ #include "qemu/osdep.h" #include "libqtest.h" -#include "libqos/pci-pc.h" +#include "pci-pc.h" #include "qemu/sockets.h" #include "qemu/iov.h" #include "qemu/module.h" #include "qemu/bitops.h" -#include "libqos/malloc.h" -#include "libqos/qgraph.h" +#include "malloc.h" +#include "qgraph.h" #include "e1000e.h" #define E1000E_IMS (0x00d0) diff --git a/tests/qtest/libqos/e1000e.h b/tests/qtest/libqos/e1000e.h index 35183b2875..a22f5fdbad 100644 --- a/tests/qtest/libqos/e1000e.h +++ b/tests/qtest/libqos/e1000e.h @@ -19,7 +19,7 @@ #ifndef QGRAPH_E1000E_H #define QGRAPH_E1000E_H -#include "libqos/qgraph.h" +#include "qgraph.h" #include "pci.h" #define E1000E_RX0_MSG_ID (0) diff --git a/tests/qtest/libqos/fw_cfg.c b/tests/qtest/libqos/fw_cfg.c index 1f46258f96..6b8e1babe5 100644 --- a/tests/qtest/libqos/fw_cfg.c +++ b/tests/qtest/libqos/fw_cfg.c @@ -13,7 +13,7 @@ */ #include "qemu/osdep.h" -#include "libqos/fw_cfg.h" +#include "fw_cfg.h" #include "libqtest.h" #include "qemu/bswap.h" #include "hw/nvram/fw_cfg.h" diff --git a/tests/qtest/libqos/i2c-imx.c b/tests/qtest/libqos/i2c-imx.c index f33ece55a3..8f9a7e3831 100644 --- a/tests/qtest/libqos/i2c-imx.c +++ b/tests/qtest/libqos/i2c-imx.c @@ -18,7 +18,7 @@ */ #include "qemu/osdep.h" -#include "libqos/i2c.h" +#include "i2c.h" #include "libqtest.h" diff --git a/tests/qtest/libqos/i2c-omap.c b/tests/qtest/libqos/i2c-omap.c index 9ae8214fa8..eb4e453485 100644 --- a/tests/qtest/libqos/i2c-omap.c +++ b/tests/qtest/libqos/i2c-omap.c @@ -7,7 +7,7 @@ * See the COPYING file in the top-level directory. */ #include "qemu/osdep.h" -#include "libqos/i2c.h" +#include "i2c.h" #include "qemu/bswap.h" diff --git a/tests/qtest/libqos/i2c.c b/tests/qtest/libqos/i2c.c index 38f800dbab..ade1bdb40e 100644 --- a/tests/qtest/libqos/i2c.c +++ b/tests/qtest/libqos/i2c.c @@ -7,7 +7,7 @@ * See the COPYING file in the top-level directory. */ #include "qemu/osdep.h" -#include "libqos/i2c.h" +#include "i2c.h" #include "libqtest.h" void qi2c_send(QI2CDevice *i2cdev, const uint8_t *buf, uint16_t len) diff --git a/tests/qtest/libqos/i2c.h b/tests/qtest/libqos/i2c.h index c65f087834..1341bac1c5 100644 --- a/tests/qtest/libqos/i2c.h +++ b/tests/qtest/libqos/i2c.h @@ -10,7 +10,7 @@ #define LIBQOS_I2C_H #include "libqtest.h" -#include "libqos/qgraph.h" +#include "qgraph.h" typedef struct I2CAdapter I2CAdapter; struct I2CAdapter { diff --git a/tests/qtest/libqos/libqos-pc.c b/tests/qtest/libqos/libqos-pc.c index d04abc548b..db420a596e 100644 --- a/tests/qtest/libqos/libqos-pc.c +++ b/tests/qtest/libqos/libqos-pc.c @@ -1,7 +1,7 @@ #include "qemu/osdep.h" -#include "libqos/libqos-pc.h" -#include "libqos/malloc-pc.h" -#include "libqos/pci-pc.h" +#include "libqos-pc.h" +#include "malloc-pc.h" +#include "pci-pc.h" static QOSOps qos_ops = { .alloc_init = pc_alloc_init, diff --git a/tests/qtest/libqos/libqos-pc.h b/tests/qtest/libqos/libqos-pc.h index a0e4c45516..1a9923ead4 100644 --- a/tests/qtest/libqos/libqos-pc.h +++ b/tests/qtest/libqos/libqos-pc.h @@ -1,7 +1,7 @@ #ifndef LIBQOS_PC_H #define LIBQOS_PC_H -#include "libqos/libqos.h" +#include "libqos.h" QOSState *qtest_pc_vboot(const char *cmdline_fmt, va_list ap); QOSState *qtest_pc_boot(const char *cmdline_fmt, ...); diff --git a/tests/qtest/libqos/libqos-spapr.c b/tests/qtest/libqos/libqos-spapr.c index 8766d543ce..db0e87ba5c 100644 --- a/tests/qtest/libqos/libqos-spapr.c +++ b/tests/qtest/libqos/libqos-spapr.c @@ -1,7 +1,7 @@ #include "qemu/osdep.h" -#include "libqos/libqos-spapr.h" -#include "libqos/malloc-spapr.h" -#include "libqos/pci-spapr.h" +#include "libqos-spapr.h" +#include "malloc-spapr.h" +#include "pci-spapr.h" static QOSOps qos_ops = { .alloc_init = spapr_alloc_init, diff --git a/tests/qtest/libqos/libqos-spapr.h b/tests/qtest/libqos/libqos-spapr.h index 49bd72d20b..c61338917a 100644 --- a/tests/qtest/libqos/libqos-spapr.h +++ b/tests/qtest/libqos/libqos-spapr.h @@ -1,7 +1,7 @@ #ifndef LIBQOS_SPAPR_H #define LIBQOS_SPAPR_H -#include "libqos/libqos.h" +#include "libqos.h" QOSState *qtest_spapr_vboot(const char *cmdline_fmt, va_list ap); QOSState *qtest_spapr_boot(const char *cmdline_fmt, ...); diff --git a/tests/qtest/libqos/libqos.c b/tests/qtest/libqos/libqos.c index f229eb2cb8..2251e864ef 100644 --- a/tests/qtest/libqos/libqos.c +++ b/tests/qtest/libqos/libqos.c @@ -2,8 +2,8 @@ #include <sys/wait.h> #include "libqtest.h" -#include "libqos/libqos.h" -#include "libqos/pci.h" +#include "libqos.h" +#include "pci.h" #include "qapi/qmp/qdict.h" /*** Test Setup & Teardown ***/ diff --git a/tests/qtest/libqos/libqos.h b/tests/qtest/libqos/libqos.h index 8e971c25a3..e0b2bfe7ca 100644 --- a/tests/qtest/libqos/libqos.h +++ b/tests/qtest/libqos/libqos.h @@ -2,8 +2,8 @@ #define LIBQOS_H #include "libqtest.h" -#include "libqos/pci.h" -#include "libqos/malloc.h" +#include "pci.h" +#include "malloc.h" typedef struct QOSState QOSState; diff --git a/tests/qtest/libqtest.h b/tests/qtest/libqos/libqtest.h index f5cf93c386..f5cf93c386 100644 --- a/tests/qtest/libqtest.h +++ b/tests/qtest/libqos/libqtest.h diff --git a/tests/qtest/libqos/malloc-pc.c b/tests/qtest/libqos/malloc-pc.c index 6f92ce4135..16ff9609cc 100644 --- a/tests/qtest/libqos/malloc-pc.c +++ b/tests/qtest/libqos/malloc-pc.c @@ -11,8 +11,8 @@ */ #include "qemu/osdep.h" -#include "libqos/malloc-pc.h" -#include "libqos/fw_cfg.h" +#include "malloc-pc.h" +#include "fw_cfg.h" #include "standard-headers/linux/qemu_fw_cfg.h" diff --git a/tests/qtest/libqos/malloc-pc.h b/tests/qtest/libqos/malloc-pc.h index 21e75ae004..d8d79853c8 100644 --- a/tests/qtest/libqos/malloc-pc.h +++ b/tests/qtest/libqos/malloc-pc.h @@ -13,7 +13,7 @@ #ifndef LIBQOS_MALLOC_PC_H #define LIBQOS_MALLOC_PC_H -#include "libqos/malloc.h" +#include "malloc.h" void pc_alloc_init(QGuestAllocator *s, QTestState *qts, QAllocOpts flags); diff --git a/tests/qtest/libqos/malloc-spapr.c b/tests/qtest/libqos/malloc-spapr.c index 2a6b7e3776..84862e4876 100644 --- a/tests/qtest/libqos/malloc-spapr.c +++ b/tests/qtest/libqos/malloc-spapr.c @@ -6,7 +6,7 @@ */ #include "qemu/osdep.h" -#include "libqos/malloc-spapr.h" +#include "malloc-spapr.h" #include "qemu-common.h" diff --git a/tests/qtest/libqos/malloc-spapr.h b/tests/qtest/libqos/malloc-spapr.h index e5fe9bfc4b..f99572fd71 100644 --- a/tests/qtest/libqos/malloc-spapr.h +++ b/tests/qtest/libqos/malloc-spapr.h @@ -8,7 +8,7 @@ #ifndef LIBQOS_MALLOC_SPAPR_H #define LIBQOS_MALLOC_SPAPR_H -#include "libqos/malloc.h" +#include "malloc.h" void spapr_alloc_init(QGuestAllocator *s, QTestState *qts, QAllocOpts flags); diff --git a/tests/qtest/libqos/malloc.c b/tests/qtest/libqos/malloc.c index 615422a5c4..f708b01432 100644 --- a/tests/qtest/libqos/malloc.c +++ b/tests/qtest/libqos/malloc.c @@ -11,7 +11,7 @@ */ #include "qemu/osdep.h" -#include "libqos/malloc.h" +#include "malloc.h" #include "qemu-common.h" #include "qemu/host-utils.h" diff --git a/tests/qtest/libqos/meson.build b/tests/qtest/libqos/meson.build new file mode 100644 index 0000000000..19931b9248 --- /dev/null +++ b/tests/qtest/libqos/meson.build @@ -0,0 +1,57 @@ +libqos = static_library('qos', + files('../libqtest.c', + 'qgraph.c', + 'qos_external.c', + 'pci.c', + 'fw_cfg.c', + 'malloc.c', + 'libqos.c', + + # spapr + 'malloc-spapr.c', + 'libqos-spapr.c', + 'rtas.c', + 'pci-spapr.c', + + # pc + 'pci-pc.c', + 'malloc-pc.c', + 'libqos-pc.c', + 'ahci.c', + + # usb + 'usb.c', + + # qgraph devices: + 'e1000e.c', + 'i2c.c', + 'i2c-imx.c', + 'i2c-omap.c', + 'sdhci.c', + 'tpci200.c', + 'virtio.c', + 'virtio-9p.c', + 'virtio-balloon.c', + 'virtio-blk.c', + 'virtio-mmio.c', + 'virtio-net.c', + 'virtio-pci.c', + 'virtio-pci-modern.c', + 'virtio-rng.c', + 'virtio-scsi.c', + 'virtio-serial.c', + + # qgraph machines: + 'aarch64-xlnx-zcu102-machine.c', + 'arm-imx25-pdk-machine.c', + 'arm-n800-machine.c', + 'arm-raspi2-machine.c', + 'arm-sabrelite-machine.c', + 'arm-smdkc210-machine.c', + 'arm-virt-machine.c', + 'arm-xilinx-zynq-a9-machine.c', + 'ppc64_pseries-machine.c', + 'x86_64_pc-machine.c', +), build_by_default: false) + +qos = declare_dependency(link_whole: libqos) diff --git a/tests/qtest/libqos/pci-pc.c b/tests/qtest/libqos/pci-pc.c index 3bb2eb3ba8..f97844289f 100644 --- a/tests/qtest/libqos/pci-pc.c +++ b/tests/qtest/libqos/pci-pc.c @@ -12,7 +12,7 @@ #include "qemu/osdep.h" #include "libqtest.h" -#include "libqos/pci-pc.h" +#include "pci-pc.h" #include "qapi/qmp/qdict.h" #include "hw/pci/pci_regs.h" diff --git a/tests/qtest/libqos/pci-pc.h b/tests/qtest/libqos/pci-pc.h index 4690005232..49ec9507f2 100644 --- a/tests/qtest/libqos/pci-pc.h +++ b/tests/qtest/libqos/pci-pc.h @@ -13,9 +13,9 @@ #ifndef LIBQOS_PCI_PC_H #define LIBQOS_PCI_PC_H -#include "libqos/pci.h" -#include "libqos/malloc.h" -#include "libqos/qgraph.h" +#include "pci.h" +#include "malloc.h" +#include "qgraph.h" typedef struct QPCIBusPC { QOSGraphObject obj; diff --git a/tests/qtest/libqos/pci-spapr.c b/tests/qtest/libqos/pci-spapr.c index d6f8c01cb7..262226985f 100644 --- a/tests/qtest/libqos/pci-spapr.c +++ b/tests/qtest/libqos/pci-spapr.c @@ -7,9 +7,9 @@ #include "qemu/osdep.h" #include "libqtest.h" -#include "libqos/pci-spapr.h" -#include "libqos/rtas.h" -#include "libqos/qgraph.h" +#include "pci-spapr.h" +#include "rtas.h" +#include "qgraph.h" #include "hw/pci/pci_regs.h" diff --git a/tests/qtest/libqos/pci-spapr.h b/tests/qtest/libqos/pci-spapr.h index d9e25631c6..20a43718b7 100644 --- a/tests/qtest/libqos/pci-spapr.h +++ b/tests/qtest/libqos/pci-spapr.h @@ -8,9 +8,9 @@ #ifndef LIBQOS_PCI_SPAPR_H #define LIBQOS_PCI_SPAPR_H -#include "libqos/malloc.h" -#include "libqos/pci.h" -#include "libqos/qgraph.h" +#include "malloc.h" +#include "pci.h" +#include "qgraph.h" /* From include/hw/pci-host/spapr.h */ diff --git a/tests/qtest/libqos/pci.c b/tests/qtest/libqos/pci.c index 2309a724e4..e1e96189c8 100644 --- a/tests/qtest/libqos/pci.c +++ b/tests/qtest/libqos/pci.c @@ -11,11 +11,11 @@ */ #include "qemu/osdep.h" -#include "libqos/pci.h" +#include "pci.h" #include "hw/pci/pci_regs.h" #include "qemu/host-utils.h" -#include "libqos/qgraph.h" +#include "qgraph.h" void qpci_device_foreach(QPCIBus *bus, int vendor_id, int device_id, void (*func)(QPCIDevice *dev, int devfn, void *data), diff --git a/tests/qtest/libqos/pci.h b/tests/qtest/libqos/pci.h index 590c175190..ee64fdecbd 100644 --- a/tests/qtest/libqos/pci.h +++ b/tests/qtest/libqos/pci.h @@ -14,7 +14,7 @@ #define LIBQOS_PCI_H #include "libqtest.h" -#include "libqos/qgraph.h" +#include "qgraph.h" #define QPCI_PIO_LIMIT 0x10000 diff --git a/tests/qtest/libqos/ppc64_pseries-machine.c b/tests/qtest/libqos/ppc64_pseries-machine.c index 5d7bd88f2f..24ca179976 100644 --- a/tests/qtest/libqos/ppc64_pseries-machine.c +++ b/tests/qtest/libqos/ppc64_pseries-machine.c @@ -18,10 +18,10 @@ #include "qemu/osdep.h" #include "libqtest.h" -#include "libqos/qgraph.h" +#include "qgraph.h" #include "pci-spapr.h" #include "qemu/module.h" -#include "libqos/malloc-spapr.h" +#include "malloc-spapr.h" typedef struct QSPAPR_pci_host QSPAPR_pci_host; typedef struct Qppc64_pseriesMachine Qppc64_pseriesMachine; diff --git a/tests/qtest/libqos/qgraph.c b/tests/qtest/libqos/qgraph.c index eb0af8ab4a..fc49cfa879 100644 --- a/tests/qtest/libqos/qgraph.c +++ b/tests/qtest/libqos/qgraph.c @@ -19,8 +19,8 @@ #include "qemu/osdep.h" #include "libqtest.h" #include "qemu/queue.h" -#include "libqos/qgraph_internal.h" -#include "libqos/qgraph.h" +#include "qgraph_internal.h" +#include "qgraph.h" #define QGRAPH_PRINT_DEBUG 0 #define QOS_ROOT "" diff --git a/tests/qtest/libqos/qgraph.h b/tests/qtest/libqos/qgraph.h index db1244eb59..5f63d352ca 100644 --- a/tests/qtest/libqos/qgraph.h +++ b/tests/qtest/libqos/qgraph.h @@ -106,7 +106,7 @@ typedef void *(*QOSBeforeTest) (GString *cmd_line, void *arg); * <example> * <title>Creating new driver an its interface</title> * <programlisting> - #include "libqos/qgraph.h" + #include "qgraph.h" struct My_driver { QOSGraphObject obj; @@ -190,7 +190,7 @@ typedef void *(*QOSBeforeTest) (GString *cmd_line, void *arg); * <example> * <title>Creating new test</title> * <programlisting> - * #include "libqos/qgraph.h" + * #include "qgraph.h" * * static void my_test_function(void *obj, void *data) * { @@ -226,11 +226,11 @@ typedef void *(*QOSBeforeTest) (GString *cmd_line, void *arg); * my_test <--consumed_by-- my_interface <--produces--+ * * Assuming there the binary is - * QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 + * QTEST_QEMU_BINARY=./qemu-system-x86_64 * a valid test path will be: * "/x86_64/pc/other_node/my_driver/my_interface/my_test". * - * Additional examples are also in libqos/test-qgraph.c + * Additional examples are also in test-qgraph.c * * Command line: * Command line is built by using node names and optional arguments diff --git a/tests/qtest/libqos/qgraph_internal.h b/tests/qtest/libqos/qgraph_internal.h index aa3123f0f2..968fa69450 100644 --- a/tests/qtest/libqos/qgraph_internal.h +++ b/tests/qtest/libqos/qgraph_internal.h @@ -20,11 +20,11 @@ #define QGRAPH_INTERNAL_H /* This header is declaring additional helper functions defined in - * libqos/qgraph.c + * qgraph.c * It should not be included in tests */ -#include "libqos/qgraph.h" +#include "qgraph.h" typedef struct QOSGraphMachine QOSGraphMachine; typedef enum QOSEdgeType QOSEdgeType; diff --git a/tests/qtest/libqos/qos_external.c b/tests/qtest/libqos/qos_external.c index 0dfc05cfb6..10ee0f75b2 100644 --- a/tests/qtest/libqos/qos_external.c +++ b/tests/qtest/libqos/qos_external.c @@ -24,10 +24,10 @@ #include "qapi/qmp/qstring.h" #include "qemu/module.h" #include "qapi/qmp/qlist.h" -#include "libqos/malloc.h" -#include "libqos/qgraph.h" -#include "libqos/qgraph_internal.h" -#include "libqos/qos_external.h" +#include "malloc.h" +#include "qgraph.h" +#include "qgraph_internal.h" +#include "qos_external.h" static void machine_apply_to_node(const char *name) { diff --git a/tests/qtest/libqos/qos_external.h b/tests/qtest/libqos/qos_external.h index 56a2f37fde..8446e3df0b 100644 --- a/tests/qtest/libqos/qos_external.h +++ b/tests/qtest/libqos/qos_external.h @@ -19,7 +19,9 @@ #ifndef QOS_EXTERNAL_H #define QOS_EXTERNAL_H -#include "libqos/malloc.h" +#include "qgraph.h" + +#include "malloc.h" #include "qapi/qapi-types-machine.h" #include "qapi/qapi-types-qom.h" diff --git a/tests/qtest/libqos/rtas.c b/tests/qtest/libqos/rtas.c index d81ff4274d..db29d5554d 100644 --- a/tests/qtest/libqos/rtas.c +++ b/tests/qtest/libqos/rtas.c @@ -5,7 +5,7 @@ #include "qemu/osdep.h" #include "libqtest.h" -#include "libqos/rtas.h" +#include "rtas.h" static void qrtas_copy_args(QTestState *qts, uint64_t target_args, uint32_t nargs, uint32_t *args) diff --git a/tests/qtest/libqos/rtas.h b/tests/qtest/libqos/rtas.h index 459e23aaf4..f38f99dfab 100644 --- a/tests/qtest/libqos/rtas.h +++ b/tests/qtest/libqos/rtas.h @@ -5,7 +5,7 @@ #ifndef LIBQOS_RTAS_H #define LIBQOS_RTAS_H -#include "libqos/malloc.h" +#include "malloc.h" int qrtas_get_time_of_day(QTestState *qts, QGuestAllocator *alloc, struct tm *tm, uint32_t *ns); diff --git a/tests/qtest/libqos/sdhci.c b/tests/qtest/libqos/sdhci.c index fbf2e36aec..65f0d07fc5 100644 --- a/tests/qtest/libqos/sdhci.c +++ b/tests/qtest/libqos/sdhci.c @@ -18,7 +18,7 @@ #include "qemu/osdep.h" #include "libqtest.h" -#include "libqos/qgraph.h" +#include "qgraph.h" #include "pci.h" #include "qemu/module.h" #include "sdhci.h" diff --git a/tests/qtest/libqos/sdhci.h b/tests/qtest/libqos/sdhci.h index 1acd3096e2..22d647b1fd 100644 --- a/tests/qtest/libqos/sdhci.h +++ b/tests/qtest/libqos/sdhci.h @@ -19,7 +19,7 @@ #ifndef QGRAPH_QSDHCI_H #define QGRAPH_QSDHCI_H -#include "libqos/qgraph.h" +#include "qgraph.h" #include "pci.h" typedef struct QSDHCI QSDHCI; diff --git a/tests/qtest/libqos/tpci200.c b/tests/qtest/libqos/tpci200.c index ae590a456e..1787b1f188 100644 --- a/tests/qtest/libqos/tpci200.c +++ b/tests/qtest/libqos/tpci200.c @@ -10,8 +10,8 @@ #include "qemu/osdep.h" #include "libqtest.h" #include "qemu/module.h" -#include "libqos/qgraph.h" -#include "libqos/pci.h" +#include "qgraph.h" +#include "pci.h" typedef struct QTpci200 QTpci200; typedef struct QIpack QIpack; diff --git a/tests/qtest/libqos/usb.c b/tests/qtest/libqos/usb.c index d7a9cb3c72..8b45b02984 100644 --- a/tests/qtest/libqos/usb.c +++ b/tests/qtest/libqos/usb.c @@ -14,7 +14,7 @@ #include "qemu/osdep.h" #include "libqtest.h" #include "hw/usb/uhci-regs.h" -#include "libqos/usb.h" +#include "usb.h" void qusb_pci_init_one(QPCIBus *pcibus, struct qhc *hc, uint32_t devfn, int bar) { diff --git a/tests/qtest/libqos/usb.h b/tests/qtest/libqos/usb.h index eeced39a2f..50030d7fb1 100644 --- a/tests/qtest/libqos/usb.h +++ b/tests/qtest/libqos/usb.h @@ -1,7 +1,7 @@ #ifndef LIBQOS_USB_H #define LIBQOS_USB_H -#include "libqos/pci-pc.h" +#include "pci-pc.h" struct qhc { QPCIDevice *dev; diff --git a/tests/qtest/libqos/virtio-9p.c b/tests/qtest/libqos/virtio-9p.c index c87b56132a..2e300063e3 100644 --- a/tests/qtest/libqos/virtio-9p.c +++ b/tests/qtest/libqos/virtio-9p.c @@ -20,8 +20,8 @@ #include "libqtest.h" #include "qemu/module.h" #include "standard-headers/linux/virtio_ids.h" -#include "libqos/virtio-9p.h" -#include "libqos/qgraph.h" +#include "virtio-9p.h" +#include "qgraph.h" static QGuestAllocator *alloc; diff --git a/tests/qtest/libqos/virtio-9p.h b/tests/qtest/libqos/virtio-9p.h index be9621a5e3..b1e6badc4a 100644 --- a/tests/qtest/libqos/virtio-9p.h +++ b/tests/qtest/libqos/virtio-9p.h @@ -19,9 +19,9 @@ #ifndef TESTS_LIBQOS_VIRTIO_9P_H #define TESTS_LIBQOS_VIRTIO_9P_H -#include "libqos/qgraph.h" -#include "libqos/virtio.h" -#include "libqos/virtio-pci.h" +#include "qgraph.h" +#include "virtio.h" +#include "virtio-pci.h" typedef struct QVirtio9P QVirtio9P; typedef struct QVirtio9PPCI QVirtio9PPCI; diff --git a/tests/qtest/libqos/virtio-balloon.c b/tests/qtest/libqos/virtio-balloon.c index 9745f4a83c..a3da5c234d 100644 --- a/tests/qtest/libqos/virtio-balloon.c +++ b/tests/qtest/libqos/virtio-balloon.c @@ -19,8 +19,8 @@ #include "qemu/osdep.h" #include "libqtest.h" #include "qemu/module.h" -#include "libqos/qgraph.h" -#include "libqos/virtio-balloon.h" +#include "qgraph.h" +#include "virtio-balloon.h" /* virtio-balloon-device */ static void *qvirtio_balloon_get_driver(QVirtioBalloon *v_balloon, diff --git a/tests/qtest/libqos/virtio-balloon.h b/tests/qtest/libqos/virtio-balloon.h index 5b919303a6..309894c338 100644 --- a/tests/qtest/libqos/virtio-balloon.h +++ b/tests/qtest/libqos/virtio-balloon.h @@ -19,9 +19,9 @@ #ifndef TESTS_LIBQOS_VIRTIO_BALLOON_H #define TESTS_LIBQOS_VIRTIO_BALLOON_H -#include "libqos/qgraph.h" -#include "libqos/virtio.h" -#include "libqos/virtio-pci.h" +#include "qgraph.h" +#include "virtio.h" +#include "virtio-pci.h" typedef struct QVirtioBalloon QVirtioBalloon; typedef struct QVirtioBalloonPCI QVirtioBalloonPCI; diff --git a/tests/qtest/libqos/virtio-blk.c b/tests/qtest/libqos/virtio-blk.c index 5fc69401be..5da02591bc 100644 --- a/tests/qtest/libqos/virtio-blk.c +++ b/tests/qtest/libqos/virtio-blk.c @@ -20,8 +20,8 @@ #include "libqtest.h" #include "qemu/module.h" #include "standard-headers/linux/virtio_blk.h" -#include "libqos/qgraph.h" -#include "libqos/virtio-blk.h" +#include "qgraph.h" +#include "virtio-blk.h" #define PCI_SLOT 0x04 #define PCI_FN 0x00 diff --git a/tests/qtest/libqos/virtio-blk.h b/tests/qtest/libqos/virtio-blk.h index 5170f13cfe..dcef38851e 100644 --- a/tests/qtest/libqos/virtio-blk.h +++ b/tests/qtest/libqos/virtio-blk.h @@ -19,9 +19,9 @@ #ifndef TESTS_LIBQOS_VIRTIO_BLK_H #define TESTS_LIBQOS_VIRTIO_BLK_H -#include "libqos/qgraph.h" -#include "libqos/virtio.h" -#include "libqos/virtio-pci.h" +#include "qgraph.h" +#include "virtio.h" +#include "virtio-pci.h" typedef struct QVirtioBlk QVirtioBlk; typedef struct QVirtioBlkPCI QVirtioBlkPCI; diff --git a/tests/qtest/libqos/virtio-mmio.c b/tests/qtest/libqos/virtio-mmio.c index e0a2bd7bc6..75efda3029 100644 --- a/tests/qtest/libqos/virtio-mmio.c +++ b/tests/qtest/libqos/virtio-mmio.c @@ -10,10 +10,10 @@ #include "qemu/osdep.h" #include "libqtest.h" #include "qemu/module.h" -#include "libqos/virtio.h" -#include "libqos/virtio-mmio.h" -#include "libqos/malloc.h" -#include "libqos/qgraph.h" +#include "virtio.h" +#include "virtio-mmio.h" +#include "malloc.h" +#include "qgraph.h" #include "standard-headers/linux/virtio_ring.h" static uint8_t qvirtio_mmio_config_readb(QVirtioDevice *d, uint64_t off) diff --git a/tests/qtest/libqos/virtio-mmio.h b/tests/qtest/libqos/virtio-mmio.h index 0e45778b07..30803bc91c 100644 --- a/tests/qtest/libqos/virtio-mmio.h +++ b/tests/qtest/libqos/virtio-mmio.h @@ -10,8 +10,8 @@ #ifndef LIBQOS_VIRTIO_MMIO_H #define LIBQOS_VIRTIO_MMIO_H -#include "libqos/virtio.h" -#include "libqos/qgraph.h" +#include "virtio.h" +#include "qgraph.h" #define QVIRTIO_MMIO_MAGIC_VALUE 0x000 #define QVIRTIO_MMIO_VERSION 0x004 diff --git a/tests/qtest/libqos/virtio-net.c b/tests/qtest/libqos/virtio-net.c index a9e253afe4..1cae07f60d 100644 --- a/tests/qtest/libqos/virtio-net.c +++ b/tests/qtest/libqos/virtio-net.c @@ -19,8 +19,8 @@ #include "qemu/osdep.h" #include "libqtest.h" #include "qemu/module.h" -#include "libqos/qgraph.h" -#include "libqos/virtio-net.h" +#include "qgraph.h" +#include "virtio-net.h" #include "hw/virtio/virtio-net.h" diff --git a/tests/qtest/libqos/virtio-net.h b/tests/qtest/libqos/virtio-net.h index b8cbec04af..5ba2161de2 100644 --- a/tests/qtest/libqos/virtio-net.h +++ b/tests/qtest/libqos/virtio-net.h @@ -19,9 +19,9 @@ #ifndef TESTS_LIBQOS_VIRTIO_NET_H #define TESTS_LIBQOS_VIRTIO_NET_H -#include "libqos/qgraph.h" -#include "libqos/virtio.h" -#include "libqos/virtio-pci.h" +#include "qgraph.h" +#include "virtio.h" +#include "virtio-pci.h" typedef struct QVirtioNet QVirtioNet; typedef struct QVirtioNetPCI QVirtioNetPCI; diff --git a/tests/qtest/libqos/virtio-pci.c b/tests/qtest/libqos/virtio-pci.c index 62851c29bb..cd3c0f5bf3 100644 --- a/tests/qtest/libqos/virtio-pci.c +++ b/tests/qtest/libqos/virtio-pci.c @@ -9,13 +9,13 @@ #include "qemu/osdep.h" #include "libqtest.h" -#include "libqos/virtio.h" -#include "libqos/virtio-pci.h" -#include "libqos/pci.h" -#include "libqos/pci-pc.h" -#include "libqos/malloc.h" -#include "libqos/malloc-pc.h" -#include "libqos/qgraph.h" +#include "virtio.h" +#include "virtio-pci.h" +#include "pci.h" +#include "pci-pc.h" +#include "malloc.h" +#include "malloc-pc.h" +#include "qgraph.h" #include "standard-headers/linux/virtio_ring.h" #include "standard-headers/linux/virtio_pci.h" diff --git a/tests/qtest/libqos/virtio-pci.h b/tests/qtest/libqos/virtio-pci.h index 294d5567ee..f5115cacba 100644 --- a/tests/qtest/libqos/virtio-pci.h +++ b/tests/qtest/libqos/virtio-pci.h @@ -10,9 +10,9 @@ #ifndef LIBQOS_VIRTIO_PCI_H #define LIBQOS_VIRTIO_PCI_H -#include "libqos/virtio.h" -#include "libqos/pci.h" -#include "libqos/qgraph.h" +#include "virtio.h" +#include "pci.h" +#include "qgraph.h" typedef struct QVirtioPCIMSIXOps QVirtioPCIMSIXOps; diff --git a/tests/qtest/libqos/virtio-rng.c b/tests/qtest/libqos/virtio-rng.c index 46f8d95b1f..2e09dd7c48 100644 --- a/tests/qtest/libqos/virtio-rng.c +++ b/tests/qtest/libqos/virtio-rng.c @@ -19,8 +19,8 @@ #include "qemu/osdep.h" #include "libqtest.h" #include "qemu/module.h" -#include "libqos/qgraph.h" -#include "libqos/virtio-rng.h" +#include "qgraph.h" +#include "virtio-rng.h" /* virtio-rng-device */ static void *qvirtio_rng_get_driver(QVirtioRng *v_rng, diff --git a/tests/qtest/libqos/virtio-rng.h b/tests/qtest/libqos/virtio-rng.h index 9342372efa..9ca102b599 100644 --- a/tests/qtest/libqos/virtio-rng.h +++ b/tests/qtest/libqos/virtio-rng.h @@ -19,9 +19,9 @@ #ifndef TESTS_LIBQOS_VIRTIO_RNG_H #define TESTS_LIBQOS_VIRTIO_RNG_H -#include "libqos/qgraph.h" -#include "libqos/virtio.h" -#include "libqos/virtio-pci.h" +#include "qgraph.h" +#include "virtio.h" +#include "virtio-pci.h" typedef struct QVirtioRng QVirtioRng; typedef struct QVirtioRngPCI QVirtioRngPCI; diff --git a/tests/qtest/libqos/virtio-scsi.c b/tests/qtest/libqos/virtio-scsi.c index c8c3598428..5644e32fc3 100644 --- a/tests/qtest/libqos/virtio-scsi.c +++ b/tests/qtest/libqos/virtio-scsi.c @@ -20,8 +20,8 @@ #include "libqtest.h" #include "qemu/module.h" #include "standard-headers/linux/virtio_ids.h" -#include "libqos/qgraph.h" -#include "libqos/virtio-scsi.h" +#include "qgraph.h" +#include "virtio-scsi.h" /* virtio-scsi-device */ static void *qvirtio_scsi_get_driver(QVirtioSCSI *v_scsi, diff --git a/tests/qtest/libqos/virtio-scsi.h b/tests/qtest/libqos/virtio-scsi.h index 9e3774d99a..531315e6ad 100644 --- a/tests/qtest/libqos/virtio-scsi.h +++ b/tests/qtest/libqos/virtio-scsi.h @@ -19,9 +19,9 @@ #ifndef TESTS_LIBQOS_VIRTIO_SCSI_H #define TESTS_LIBQOS_VIRTIO_SCSI_H -#include "libqos/qgraph.h" -#include "libqos/virtio.h" -#include "libqos/virtio-pci.h" +#include "qgraph.h" +#include "virtio.h" +#include "virtio-pci.h" typedef struct QVirtioSCSI QVirtioSCSI; typedef struct QVirtioSCSIPCI QVirtioSCSIPCI; diff --git a/tests/qtest/libqos/virtio-serial.c b/tests/qtest/libqos/virtio-serial.c index b95654085d..ee34afd95a 100644 --- a/tests/qtest/libqos/virtio-serial.c +++ b/tests/qtest/libqos/virtio-serial.c @@ -19,8 +19,8 @@ #include "qemu/osdep.h" #include "libqtest.h" #include "qemu/module.h" -#include "libqos/qgraph.h" -#include "libqos/virtio-serial.h" +#include "qgraph.h" +#include "virtio-serial.h" static void *qvirtio_serial_get_driver(QVirtioSerial *v_serial, const char *interface) diff --git a/tests/qtest/libqos/virtio-serial.h b/tests/qtest/libqos/virtio-serial.h index 3328c6cf19..3db43b2bb8 100644 --- a/tests/qtest/libqos/virtio-serial.h +++ b/tests/qtest/libqos/virtio-serial.h @@ -19,9 +19,9 @@ #ifndef TESTS_LIBQOS_VIRTIO_SERIAL_H #define TESTS_LIBQOS_VIRTIO_SERIAL_H -#include "libqos/qgraph.h" -#include "libqos/virtio.h" -#include "libqos/virtio-pci.h" +#include "qgraph.h" +#include "virtio.h" +#include "virtio-pci.h" typedef struct QVirtioSerial QVirtioSerial; typedef struct QVirtioSerialPCI QVirtioSerialPCI; diff --git a/tests/qtest/libqos/virtio.c b/tests/qtest/libqos/virtio.c index 9aa360620c..6fe7bf9555 100644 --- a/tests/qtest/libqos/virtio.c +++ b/tests/qtest/libqos/virtio.c @@ -10,7 +10,7 @@ #include "qemu/osdep.h" #include "qemu/bswap.h" #include "libqtest.h" -#include "libqos/virtio.h" +#include "virtio.h" #include "standard-headers/linux/virtio_config.h" #include "standard-headers/linux/virtio_ring.h" diff --git a/tests/qtest/libqos/virtio.h b/tests/qtest/libqos/virtio.h index 529ef7555a..b8bd06e1b8 100644 --- a/tests/qtest/libqos/virtio.h +++ b/tests/qtest/libqos/virtio.h @@ -10,7 +10,7 @@ #ifndef LIBQOS_VIRTIO_H #define LIBQOS_VIRTIO_H -#include "libqos/malloc.h" +#include "malloc.h" #include "standard-headers/linux/virtio_ring.h" #define QVIRTIO_F_BAD_FEATURE 0x40000000ull diff --git a/tests/qtest/libqos/x86_64_pc-machine.c b/tests/qtest/libqos/x86_64_pc-machine.c index 0edb1c9144..ad96742a92 100644 --- a/tests/qtest/libqos/x86_64_pc-machine.c +++ b/tests/qtest/libqos/x86_64_pc-machine.c @@ -18,7 +18,7 @@ #include "qemu/osdep.h" #include "libqtest.h" -#include "libqos/qgraph.h" +#include "qgraph.h" #include "pci-pc.h" #include "qemu/module.h" #include "malloc-pc.h" diff --git a/tests/qtest/libqtest-single.h b/tests/qtest/libqtest-single.h index 6f1bb1331c..176979a2ce 100644 --- a/tests/qtest/libqtest-single.h +++ b/tests/qtest/libqtest-single.h @@ -11,7 +11,7 @@ #ifndef LIBQTEST_SINGLE_H #define LIBQTEST_SINGLE_H -#include "libqtest.h" +#include "libqos/libqtest.h" QTestState *global_qtest __attribute__((common, weak)); diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index fd4680590d..26f1223642 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -20,7 +20,7 @@ #include <sys/wait.h> #include <sys/un.h> -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qemu-common.h" #include "qemu/ctype.h" #include "qemu/cutils.h" diff --git a/tests/qtest/m48t59-test.c b/tests/qtest/m48t59-test.c index b94a1230f7..6db3234100 100644 --- a/tests/qtest/m48t59-test.c +++ b/tests/qtest/m48t59-test.c @@ -14,7 +14,7 @@ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #define RTC_SECONDS 0x9 #define RTC_MINUTES 0xa diff --git a/tests/qtest/machine-none-test.c b/tests/qtest/machine-none-test.c index 57107f1aec..aab06b9fc2 100644 --- a/tests/qtest/machine-none-test.c +++ b/tests/qtest/machine-none-test.c @@ -14,7 +14,7 @@ #include "qemu-common.h" #include "qemu/cutils.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qapi/qmp/qdict.h" diff --git a/tests/qtest/megasas-test.c b/tests/qtest/megasas-test.c index d6796b9bd7..eae70ff95f 100644 --- a/tests/qtest/megasas-test.c +++ b/tests/qtest/megasas-test.c @@ -8,7 +8,7 @@ */ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qemu/bswap.h" #include "qemu/module.h" #include "libqos/qgraph.h" diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build new file mode 100644 index 0000000000..8f8fdb1336 --- /dev/null +++ b/tests/qtest/meson.build @@ -0,0 +1,257 @@ +# All QTests for now are POSIX-only, but the dependencies are +# really in libqtest, not in the testcases themselves. +if not config_host.has_key('CONFIG_POSIX') + subdir_done() +endif + +qtests_generic = [ + 'cdrom-test', + 'device-introspect-test', + 'machine-none-test', + 'qmp-test', + 'qmp-cmd-test', + 'qom-test', + 'test-hmp', + 'qos-test', +] +if config_host.has_key('CONFIG_MODULES') + qtests_generic += [ 'modules-test' ] +endif + +qtests_pci = \ + (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) + \ + (config_all_devices.has_key('CONFIG_IVSHMEM_DEVICE') ? ['ivshmem-test'] : []) + +qtests_i386 = \ + (config_host.has_key('CONFIG_SLIRP') ? ['pxe-test', 'test-netfilter'] : []) + \ + (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \ + (have_tools ? ['ahci-test'] : []) + \ + (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \ + (config_all_devices.has_key('CONFIG_SGA') ? ['boot-serial-test'] : []) + \ + (config_all_devices.has_key('CONFIG_RTL8139_PCI') ? ['test-filter-redirector'] : []) + \ + (config_all_devices.has_key('CONFIG_ISA_IPMI_KCS') ? ['ipmi-kcs-test'] : []) + \ + (config_host.has_key('CONFIG_LINUX') and \ + config_all_devices.has_key('CONFIG_ISA_IPMI_BT') ? ['ipmi-bt-test'] : []) + \ + (config_all_devices.has_key('CONFIG_WDT_IB700') ? ['wdt_ib700-test'] : []) + \ + (config_all_devices.has_key('CONFIG_PVPANIC') ? ['pvpanic-test'] : []) + \ + (config_all_devices.has_key('CONFIG_HDA') ? ['intel-hda-test'] : []) + \ + (config_all_devices.has_key('CONFIG_I82801B11') ? ['i82801b11-test'] : []) + \ + (config_all_devices.has_key('CONFIG_IOH3420') ? ['ioh3420-test'] : []) + \ + (config_all_devices.has_key('CONFIG_USB_UHCI') ? ['usb-hcd-uhci-test'] : []) + \ + (config_all_devices.has_key('CONFIG_USB_UHCI') and \ + config_all_devices.has_key('CONFIG_USB_EHCI') ? ['usb-hcd-ehci-test'] : []) + \ + (config_all_devices.has_key('CONFIG_USB_XHCI_NEC') ? ['usb-hcd-xhci-test'] : []) + \ + (config_all_devices.has_key('CONFIG_TPM_CRB') ? ['tpm-crb-test'] : []) + \ + (config_all_devices.has_key('CONFIG_TPM_CRB') ? ['tpm-crb-swtpm-test'] : []) + \ + (config_all_devices.has_key('CONFIG_TPM_TIS_ISA') ? ['tpm-tis-test'] : []) + \ + (config_all_devices.has_key('CONFIG_TPM_TIS_ISA') ? ['tpm-tis-swtpm-test'] : []) + \ + (config_all_devices.has_key('CONFIG_RTL8139_PCI') ? ['rtl8139-test'] : []) + \ + qtests_pci + \ + ['fdc-test', + 'ide-test', + 'ahci-test', + 'hd-geo-test', + 'boot-order-test', + 'bios-tables-test', + 'rtc-test', + 'i440fx-test', + 'fw_cfg-test', + 'device-plug-test', + 'drive_del-test', + 'tco-test', + 'cpu-plug-test', + 'q35-test', + 'vmgenid-test', + 'migration-test', + 'test-x86-cpuid-compat', + 'numa-test'] + +dbus_daemon = find_program('dbus-daemon', required: false) +if dbus_daemon.found() and config_host.has_key('GDBUS_CODEGEN') + # Temporarily disabled due to Patchew failures: + #qtests_i386 += ['dbus-vmstate-test'] + dbus_vmstate1 = custom_target('dbus-vmstate description', + output: ['dbus-vmstate1.h', 'dbus-vmstate1.c'], + input: files('dbus-vmstate1.xml'), + command: [config_host['GDBUS_CODEGEN'], + '@INPUT@', + '--interface-prefix', 'org.qemu', + '--generate-c-code', '@BASENAME@']).to_list() +else + dbus_vmstate1 = [] +endif + +qtests_x86_64 = qtests_i386 + +qtests_alpha = [ 'boot-serial-test' ] + \ + (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) + +qtests_avr = [ 'boot-serial-test' ] + +qtests_hppa = [ 'boot-serial-test' ] + \ + (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) + +qtests_m68k = [ 'boot-serial-test' ] +qtests_microblaze = [ 'boot-serial-test' ] +qtests_microblazeel = qtests_microblaze + +qtests_mips = \ + (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \ + (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) + +qtests_mips64 = \ + (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \ + (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) + +qtests_mips64el = \ + (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \ + (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) + +qtests_moxie = [ 'boot-serial-test' ] + +qtests_ppc = \ + (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \ + (config_all_devices.has_key('CONFIG_M48T59') ? ['m48t59-test'] : []) + \ + ['boot-order-test', 'prom-env-test', 'drive_del-test', 'boot-serial-test'] \ + +qtests_ppc64 = \ + (config_all_devices.has_key('CONFIG_PSERIES') ? ['device-plug-test'] : []) + \ + (config_all_devices.has_key('CONFIG_POWERNV') ? ['pnv-xscom-test'] : []) + \ + (config_all_devices.has_key('CONFIG_PSERIES') ? ['rtas-test'] : []) + \ + (config_host.has_key('CONFIG_SLIRP') ? ['pxe-test', 'test-netfilter'] : []) + \ + (config_all_devices.has_key('CONFIG_USB_UHCI') ? ['usb-hcd-uhci-test'] : []) + \ + (config_all_devices.has_key('CONFIG_USB_XHCI_NEC') ? ['usb-hcd-xhci-test'] : []) + \ + (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \ + qtests_pci + ['migration-test', 'numa-test', 'cpu-plug-test'] + +qtests_sh4 = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) +qtests_sh4eb = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + +qtests_sparc = ['prom-env-test', 'm48t59-test', 'boot-serial-test'] + +qtests_sparc64 = \ + (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \ + ['prom-env-test', 'boot-serial-test'] + +qtests_arm = \ + (config_all_devices.has_key('CONFIG_PFLASH_CFI02') ? ['pflash-cfi02-test'] : []) + \ + ['arm-cpu-features', + 'microbit-test', + 'm25p80-test', + 'test-arm-mptimer', + 'boot-serial-test', + 'hexloader-test'] + +# TODO: once aarch64 TCG is fixed on ARM 32 bit host, make bios-tables-test unconditional +qtests_aarch64 = \ + (cpu != 'arm' ? ['bios-tables-test'] : []) + \ + (config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ? ['tpm-tis-device-test'] : []) + \ + (config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ? ['tpm-tis-device-swtpm-test'] : []) + \ + ['numa-test', + 'boot-serial-test', + 'migration-test'] + +qtests_s390x = \ + (config_host.has_key('CONFIG_SLIRP') ? ['pxe-test', 'test-netfilter'] : []) + \ + (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \ + (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) + \ + ['boot-serial-test', + 'drive_del-test', + 'device-plug-test', + 'virtio-ccw-test', + 'cpu-plug-test', + 'migration-test'] + +qos_test_ss = ss.source_set() +qos_test_ss.add( + 'ac97-test.c', + 'ds1338-test.c', + 'e1000-test.c', + 'e1000e-test.c', + 'eepro100-test.c', + 'es1370-test.c', + 'ipoctal232-test.c', + 'megasas-test.c', + 'ne2000-test.c', + 'tulip-test.c', + 'nvme-test.c', + 'pca9552-test.c', + 'pci-test.c', + 'pcnet-test.c', + 'sdhci-test.c', + 'spapr-phb-test.c', + 'tmp105-test.c', + 'usb-hcd-ohci-test.c', + 'virtio-test.c', + 'virtio-blk-test.c', + 'virtio-net-test.c', + 'virtio-rng-test.c', + 'virtio-scsi-test.c', + 'virtio-serial-test.c', + 'vmxnet3-test.c', +) +qos_test_ss.add(when: 'CONFIG_VIRTFS', if_true: files('virtio-9p-test.c')) +qos_test_ss.add(when: 'CONFIG_VHOST_USER', if_true: files('vhost-user-test.c')) + +extra_qtest_deps = { + 'bios-tables-test': [io], + 'ivshmem-test': [rt], + 'qos-test': [chardev, io], + 'tpm-crb-swtpm-test': [io], + 'tpm-crb-test': [io], + 'tpm-tis-swtpm-test': [io], + 'tpm-tis-test': [io], + 'tpm-tis-device-swtpm-test': [io], + 'tpm-tis-device-test': [io], +} +extra_qtest_srcs = { + 'bios-tables-test': files('boot-sector.c', 'acpi-utils.c', 'tpm-emu.c'), + 'pxe-test': files('boot-sector.c'), + 'cdrom-test': files('boot-sector.c'), + 'migration-test': files('migration-helpers.c'), + 'ivshmem-test': files('../../contrib/ivshmem-server/ivshmem-server.c'), + 'dbus-vmstate-test': files('migration-helpers.c') + dbus_vmstate1, + 'vmgenid-test': files('boot-sector.c', 'acpi-utils.c'), + 'tpm-crb-swtpm-test': files('tpm-emu.c', 'tpm-util.c', 'tpm-tests.c'), + 'tpm-crb-test': files('tpm-emu.c', 'tpm-util.c', 'tpm-tests.c'), + 'tpm-tis-device-swtpm-test': files('tpm-emu.c', 'tpm-util.c', 'tpm-tis-util.c', 'tpm-tests.c'), + 'tpm-tis-device-test': files('tpm-emu.c', 'tpm-util.c', 'tpm-tis-util.c', 'tpm-tests.c'), + 'tpm-tis-swtpm-test': files('tpm-emu.c', 'tpm-util.c', 'tpm-tis-util.c', 'tpm-tests.c'), + 'tpm-tis-test': files('tpm-emu.c', 'tpm-util.c', 'tpm-tis-util.c', 'tpm-tests.c'), + 'qos-test': qos_test_ss.apply(config_host, strict: false).sources() +} + + +qtest_executables = {} +foreach dir : target_dirs + if not dir.endswith('-softmmu') + continue + endif + + target_base = dir.split('-')[0] + qtests = get_variable('qtests_' + target_base, []) + qtests_generic + + qtest_env = environment() + qtest_env.set('QTEST_QEMU_IMG', './qemu-img') + qtest_env.set('G_TEST_DBUS_DAEMON', meson.source_root() / 'tests/dbus-vmstate-daemon.sh') + qtest_env.set('QTEST_QEMU_BINARY', './qemu-system-' + target_base) + + foreach test : qtests + # Executables are shared across targets, declare them only the first time we + # encounter them + if not qtest_executables.has_key(test) + qtest_executables += { + test: executable(test, + files(test + '.c') + extra_qtest_srcs.get(test, []), + dependencies: [qemuutil, qos] + extra_qtest_deps.get(test, [])) + } + endif + # FIXME: missing dependency on the emulator binary and qemu-img + test('qtest-@0@: @1@'.format(target_base, test), + qtest_executables[test], + env: qtest_env, + args: ['--tap', '-k'], + protocol: 'tap', + suite: ['qtest', 'qtest-' + target_base]) + endforeach +endforeach diff --git a/tests/qtest/microbit-test.c b/tests/qtest/microbit-test.c index 04e199ec33..2b255579df 100644 --- a/tests/qtest/microbit-test.c +++ b/tests/qtest/microbit-test.c @@ -16,7 +16,7 @@ #include "qemu/osdep.h" #include "exec/hwaddr.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "hw/arm/nrf51.h" #include "hw/char/nrf51_uart.h" diff --git a/tests/qtest/migration-helpers.h b/tests/qtest/migration-helpers.h index a11808b3b7..d63bba9630 100644 --- a/tests/qtest/migration-helpers.h +++ b/tests/qtest/migration-helpers.h @@ -12,7 +12,7 @@ #ifndef MIGRATION_HELPERS_H_ #define MIGRATION_HELPERS_H_ -#include "libqtest.h" +#include "libqos/libqtest.h" extern bool got_stop; diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 21ea5ba1d2..00a233cd8c 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -12,7 +12,7 @@ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qapi/error.h" #include "qapi/qmp/qdict.h" #include "qemu/module.h" @@ -25,7 +25,7 @@ #include "qapi/qobject-output-visitor.h" #include "migration-helpers.h" -#include "migration/migration-test.h" +#include "tests/migration/migration-test.h" /* TODO actually test the results and get rid of this */ #define qtest_qmp_discard_response(...) qobject_unref(qtest_qmp(__VA_ARGS__)) diff --git a/tests/qtest/modules-test.c b/tests/qtest/modules-test.c index 88217686e1..c238b3f422 100644 --- a/tests/qtest/modules-test.c +++ b/tests/qtest/modules-test.c @@ -1,5 +1,5 @@ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" const char common_args[] = "-nodefaults -machine none"; diff --git a/tests/qtest/ne2000-test.c b/tests/qtest/ne2000-test.c index 3fc0e555d5..43cfc4535a 100644 --- a/tests/qtest/ne2000-test.c +++ b/tests/qtest/ne2000-test.c @@ -8,7 +8,7 @@ */ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qemu/module.h" #include "libqos/qgraph.h" #include "libqos/pci.h" diff --git a/tests/qtest/numa-test.c b/tests/qtest/numa-test.c index e1ed6d4322..b25ebf97d8 100644 --- a/tests/qtest/numa-test.c +++ b/tests/qtest/numa-test.c @@ -10,7 +10,7 @@ */ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qapi/qmp/qdict.h" #include "qapi/qmp/qlist.h" diff --git a/tests/qtest/nvme-test.c b/tests/qtest/nvme-test.c index ff0442150c..d32c953a38 100644 --- a/tests/qtest/nvme-test.c +++ b/tests/qtest/nvme-test.c @@ -10,7 +10,7 @@ #include "qemu/osdep.h" #include "qemu/module.h" #include "qemu/units.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "libqos/qgraph.h" #include "libqos/pci.h" diff --git a/tests/qtest/pca9552-test.c b/tests/qtest/pca9552-test.c index d80ed93cd3..42a1312665 100644 --- a/tests/qtest/pca9552-test.c +++ b/tests/qtest/pca9552-test.c @@ -9,7 +9,7 @@ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "libqos/qgraph.h" #include "libqos/i2c.h" #include "hw/misc/pca9552_regs.h" diff --git a/tests/qtest/pci-test.c b/tests/qtest/pci-test.c index 4b2092b949..e15d4d94d1 100644 --- a/tests/qtest/pci-test.c +++ b/tests/qtest/pci-test.c @@ -8,7 +8,7 @@ */ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qemu/module.h" #include "libqos/qgraph.h" #include "libqos/pci.h" diff --git a/tests/qtest/pcnet-test.c b/tests/qtest/pcnet-test.c index 900944fa7e..7583aeb3c3 100644 --- a/tests/qtest/pcnet-test.c +++ b/tests/qtest/pcnet-test.c @@ -8,7 +8,7 @@ */ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qemu/module.h" #include "libqos/qgraph.h" #include "libqos/pci.h" diff --git a/tests/qtest/pflash-cfi02-test.c b/tests/qtest/pflash-cfi02-test.c index 17aa669b2e..afb702b565 100644 --- a/tests/qtest/pflash-cfi02-test.c +++ b/tests/qtest/pflash-cfi02-test.c @@ -8,7 +8,7 @@ */ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" /* * To test the pflash_cfi02 device, we run QEMU with the musicpal machine with diff --git a/tests/qtest/pnv-xscom-test.c b/tests/qtest/pnv-xscom-test.c index 2c46d5cf6d..c8d4043362 100644 --- a/tests/qtest/pnv-xscom-test.c +++ b/tests/qtest/pnv-xscom-test.c @@ -8,7 +8,7 @@ */ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" typedef enum PnvChipType { PNV_CHIP_POWER8E, /* AKA Murano (default) */ diff --git a/tests/qtest/prom-env-test.c b/tests/qtest/prom-env-test.c index 60e6ec3153..f41d80154a 100644 --- a/tests/qtest/prom-env-test.c +++ b/tests/qtest/prom-env-test.c @@ -20,7 +20,7 @@ */ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "libqos/libqos-spapr.h" #define MAGIC 0xcafec0de diff --git a/tests/qtest/pvpanic-test.c b/tests/qtest/pvpanic-test.c index ff9176adf3..e57639481e 100644 --- a/tests/qtest/pvpanic-test.c +++ b/tests/qtest/pvpanic-test.c @@ -8,7 +8,7 @@ */ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qapi/qmp/qdict.h" static void test_panic(void) diff --git a/tests/qtest/pxe-test.c b/tests/qtest/pxe-test.c index 1161a773a4..32bbae33c5 100644 --- a/tests/qtest/pxe-test.c +++ b/tests/qtest/pxe-test.c @@ -15,7 +15,7 @@ #include "qemu/osdep.h" #include <glib/gstdio.h> #include "qemu-common.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "boot-sector.h" #include "libqos/libqos-spapr.h" diff --git a/tests/qtest/q35-test.c b/tests/qtest/q35-test.c index c922d81bc0..b7cf144990 100644 --- a/tests/qtest/q35-test.c +++ b/tests/qtest/q35-test.c @@ -10,7 +10,7 @@ */ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "libqos/pci.h" #include "libqos/pci-pc.h" #include "hw/pci-host/q35.h" diff --git a/tests/qtest/qmp-cmd-test.c b/tests/qtest/qmp-cmd-test.c index f7b1aa7fdc..f34e68858a 100644 --- a/tests/qtest/qmp-cmd-test.c +++ b/tests/qtest/qmp-cmd-test.c @@ -11,7 +11,7 @@ */ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qapi/error.h" #include "qapi/qapi-visit-introspect.h" #include "qapi/qmp/qdict.h" diff --git a/tests/qtest/qmp-test.c b/tests/qtest/qmp-test.c index 1a8876b6ca..5950c3ebbb 100644 --- a/tests/qtest/qmp-test.c +++ b/tests/qtest/qmp-test.c @@ -11,7 +11,7 @@ */ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qapi/error.h" #include "qapi/qapi-visit-control.h" #include "qapi/qmp/qdict.h" diff --git a/tests/qtest/qom-test.c b/tests/qtest/qom-test.c index 1acf0d7369..eb34af843b 100644 --- a/tests/qtest/qom-test.c +++ b/tests/qtest/qom-test.c @@ -13,7 +13,7 @@ #include "qapi/qmp/qdict.h" #include "qapi/qmp/qlist.h" #include "qemu/cutils.h" -#include "libqtest.h" +#include "libqos/libqtest.h" static void test_properties(QTestState *qts, const char *path, bool recurse) { diff --git a/tests/qtest/rtas-test.c b/tests/qtest/rtas-test.c index 167b42db38..16751dbd2f 100644 --- a/tests/qtest/rtas-test.c +++ b/tests/qtest/rtas-test.c @@ -1,6 +1,6 @@ #include "qemu/osdep.h" #include "qemu/cutils.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "libqos/libqos-spapr.h" #include "libqos/rtas.h" @@ -31,7 +31,7 @@ int main(int argc, char *argv[]) g_test_init(&argc, &argv, NULL); if (strcmp(arch, "ppc64")) { - g_printerr("RTAS requires ppc64-softmmu/qemu-system-ppc64\n"); + g_printerr("RTAS requires qemu-system-ppc64\n"); exit(EXIT_FAILURE); } qtest_add_func("rtas/get-time-of-day", test_rtas_get_time_of_day); diff --git a/tests/qtest/sdhci-test.c b/tests/qtest/sdhci-test.c index 6275e7626c..a110cfe321 100644 --- a/tests/qtest/sdhci-test.c +++ b/tests/qtest/sdhci-test.c @@ -10,7 +10,7 @@ #include "qemu/osdep.h" #include "hw/registerfields.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qemu/module.h" #include "libqos/pci-pc.h" #include "hw/pci/pci.h" diff --git a/tests/qtest/spapr-phb-test.c b/tests/qtest/spapr-phb-test.c index 093dc22f2f..ea8d596507 100644 --- a/tests/qtest/spapr-phb-test.c +++ b/tests/qtest/spapr-phb-test.c @@ -9,7 +9,7 @@ */ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qemu/module.h" #include "libqos/qgraph.h" diff --git a/tests/qtest/tco-test.c b/tests/qtest/tco-test.c index 254f735370..47bc7ad301 100644 --- a/tests/qtest/tco-test.c +++ b/tests/qtest/tco-test.c @@ -9,7 +9,7 @@ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "libqos/pci.h" #include "libqos/pci-pc.h" #include "qapi/qmp/qdict.h" diff --git a/tests/qtest/test-filter-mirror.c b/tests/qtest/test-filter-mirror.c index 1e3ced84a9..bc0dee64dd 100644 --- a/tests/qtest/test-filter-mirror.c +++ b/tests/qtest/test-filter-mirror.c @@ -10,7 +10,7 @@ #include "qemu/osdep.h" #include "qemu-common.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qapi/qmp/qdict.h" #include "qemu/iov.h" #include "qemu/sockets.h" diff --git a/tests/qtest/test-filter-redirector.c b/tests/qtest/test-filter-redirector.c index e4d53220fd..829db8c2ea 100644 --- a/tests/qtest/test-filter-redirector.c +++ b/tests/qtest/test-filter-redirector.c @@ -52,7 +52,7 @@ #include "qemu/osdep.h" #include "qemu-common.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qapi/qmp/qdict.h" #include "qemu/iov.h" #include "qemu/sockets.h" diff --git a/tests/qtest/test-hmp.c b/tests/qtest/test-hmp.c index d5e7ebd176..aea1384bac 100644 --- a/tests/qtest/test-hmp.c +++ b/tests/qtest/test-hmp.c @@ -15,7 +15,7 @@ */ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" static int verbose; diff --git a/tests/qtest/tpm-crb-swtpm-test.c b/tests/qtest/tpm-crb-swtpm-test.c index 55fdb5657d..1d82a48c04 100644 --- a/tests/qtest/tpm-crb-swtpm-test.c +++ b/tests/qtest/tpm-crb-swtpm-test.c @@ -15,7 +15,7 @@ #include "qemu/osdep.h" #include <glib/gstdio.h> -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qemu/module.h" #include "tpm-tests.h" #include "hw/acpi/tpm.h" diff --git a/tests/qtest/tpm-tis-device-swtpm-test.c b/tests/qtest/tpm-tis-device-swtpm-test.c index 7b20035142..f7126eff9e 100644 --- a/tests/qtest/tpm-tis-device-swtpm-test.c +++ b/tests/qtest/tpm-tis-device-swtpm-test.c @@ -16,7 +16,7 @@ #include "qemu/osdep.h" #include <glib/gstdio.h> -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qemu/module.h" #include "tpm-tests.h" #include "hw/acpi/tpm.h" diff --git a/tests/qtest/tpm-tis-swtpm-test.c b/tests/qtest/tpm-tis-swtpm-test.c index 90131cb3c4..fa590e68f1 100644 --- a/tests/qtest/tpm-tis-swtpm-test.c +++ b/tests/qtest/tpm-tis-swtpm-test.c @@ -15,7 +15,7 @@ #include "qemu/osdep.h" #include <glib/gstdio.h> -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qemu/module.h" #include "tpm-tests.h" #include "hw/acpi/tpm.h" diff --git a/tests/qtest/tpm-util.c b/tests/qtest/tpm-util.c index 58a9593745..e2b29ef0f8 100644 --- a/tests/qtest/tpm-util.c +++ b/tests/qtest/tpm-util.c @@ -15,7 +15,7 @@ #include "qemu/osdep.h" #include "hw/acpi/tpm.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "tpm-util.h" #include "qapi/qmp/qdict.h" diff --git a/tests/qtest/tulip-test.c b/tests/qtest/tulip-test.c index 2fb6c4d5a7..da16cbfafc 100644 --- a/tests/qtest/tulip-test.c +++ b/tests/qtest/tulip-test.c @@ -8,7 +8,7 @@ */ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qemu/module.h" #include "libqos/qgraph.h" #include "libqos/pci.h" diff --git a/tests/qtest/virtio-rng-test.c b/tests/qtest/virtio-rng-test.c index 092ba13068..e6b8cd8e0c 100644 --- a/tests/qtest/virtio-rng-test.c +++ b/tests/qtest/virtio-rng-test.c @@ -8,7 +8,7 @@ */ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qemu/module.h" #include "libqos/qgraph.h" #include "libqos/virtio-rng.h" diff --git a/tests/qtest/virtio-test.c b/tests/qtest/virtio-test.c index f7c6afdcf1..6313417630 100644 --- a/tests/qtest/virtio-test.c +++ b/tests/qtest/virtio-test.c @@ -8,7 +8,7 @@ */ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qemu/module.h" #include "libqos/qgraph.h" #include "libqos/pci.h" diff --git a/tests/qtest/vmgenid-test.c b/tests/qtest/vmgenid-test.c index efba76e716..6781a51447 100644 --- a/tests/qtest/vmgenid-test.c +++ b/tests/qtest/vmgenid-test.c @@ -14,7 +14,7 @@ #include "hw/acpi/acpi-defs.h" #include "boot-sector.h" #include "acpi-utils.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qapi/qmp/qdict.h" #define VGID_GUID "324e6eaf-d1d1-4bf6-bf41-b9bb6c91fb87" diff --git a/tests/qtest/vmxnet3-test.c b/tests/qtest/vmxnet3-test.c index a81025252c..97c23fd3a8 100644 --- a/tests/qtest/vmxnet3-test.c +++ b/tests/qtest/vmxnet3-test.c @@ -8,7 +8,7 @@ */ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qemu/module.h" #include "libqos/qgraph.h" #include "libqos/pci.h" diff --git a/tests/qtest/wdt_ib700-test.c b/tests/qtest/wdt_ib700-test.c index 797288d939..6c36e43fb8 100644 --- a/tests/qtest/wdt_ib700-test.c +++ b/tests/qtest/wdt_ib700-test.c @@ -8,7 +8,7 @@ */ #include "qemu/osdep.h" -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qapi/qmp/qdict.h" #include "qemu/timer.h" diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh index 102578caa5..7d714f902a 100755 --- a/tests/tcg/configure.sh +++ b/tests/tcg/configure.sh @@ -193,11 +193,11 @@ for target in $target_list; do case $target in *-linux-user | *-bsd-user) echo "CONFIG_USER_ONLY=y" >> $config_target_mak - echo "QEMU=\$(BUILD_DIR)/$target/qemu-$arch" >> $config_target_mak + echo "QEMU=\$(BUILD_DIR)/qemu-$arch" >> $config_target_mak ;; *-softmmu) echo "CONFIG_SOFTMMU=y" >> $config_target_mak - echo "QEMU=\$(BUILD_DIR)/$target/qemu-system-$arch" >> $config_target_mak + echo "QEMU=\$(BUILD_DIR)/qemu-system-$arch" >> $config_target_mak ;; esac diff --git a/tests/test-qga.c b/tests/test-qga.c index d2b2435bb4..4ac4c22109 100644 --- a/tests/test-qga.c +++ b/tests/test-qga.c @@ -4,7 +4,7 @@ #include <sys/socket.h> #include <sys/un.h> -#include "libqtest.h" +#include "libqos/libqtest.h" #include "qapi/qmp/qdict.h" #include "qapi/qmp/qlist.h" @@ -61,8 +61,8 @@ fixture_setup(TestFixture *fixture, gconstpointer data, gchar **envp) path = g_build_filename(fixture->test_dir, "sock", NULL); cwd = g_get_current_dir(); - cmd = g_strdup_printf("%s%cqemu-ga -m unix-listen -t %s -p %s %s %s", - cwd, G_DIR_SEPARATOR, + cmd = g_strdup_printf("%s%cqga%cqemu-ga -m unix-listen -t %s -p %s %s %s", + cwd, G_DIR_SEPARATOR, G_DIR_SEPARATOR, fixture->test_dir, path, getenv("QTEST_LOG") ? "-v" : "", extra_arg ?: ""); @@ -699,8 +699,8 @@ static void test_qga_config(gconstpointer data) GKeyFile *kf; cwd = g_get_current_dir(); - cmd = g_strdup_printf("%s%cqemu-ga -D", - cwd, G_DIR_SEPARATOR); + cmd = g_strdup_printf("%s%cqga%cqemu-ga -D", + cwd, G_DIR_SEPARATOR, G_DIR_SEPARATOR); g_free(cwd); g_shell_parse_argv(cmd, NULL, &argv, &error); g_free(cmd); diff --git a/tests/test-qgraph.c b/tests/test-qgraph.c index 5c7e457075..267291c6ed 100644 --- a/tests/test-qgraph.c +++ b/tests/test-qgraph.c @@ -17,9 +17,8 @@ */ #include "qemu/osdep.h" -#include "libqtest.h" -#include "libqos/qgraph.h" -#include "libqos/qgraph_internal.h" +#include "qtest/libqos/qgraph.h" +#include "qtest/libqos/qgraph_internal.h" #define MACHINE_PC "x86_64/pc" #define MACHINE_RASPI2 "arm/raspi2" diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include index f21948c46a..61f893ffdc 100644 --- a/tests/vm/Makefile.include +++ b/tests/vm/Makefile.include @@ -2,6 +2,8 @@ .PHONY: vm-build-all vm-clean-all +EFI_AARCH64 = $(wildcard $(BUILD_DIR)/pc-bios/edk2-aarch64-code.fd) + IMAGES := freebsd netbsd openbsd centos fedora ifneq ($(GENISOIMAGE),) IMAGES += ubuntu.i386 centos @@ -15,6 +17,10 @@ IMAGE_FILES := $(patsubst %, $(IMAGES_DIR)/%.img, $(IMAGES)) .PRECIOUS: $(IMAGE_FILES) +ifneq ($(PYTHON),) +HAVE_PYTHON_YAML = $(shell $(PYTHON) -c "import yaml" 2> /dev/null && echo yes) +endif + # 'vm-help' target was historically named 'vm-test' vm-help vm-test: @echo "vm-help: Test QEMU in preconfigured virtual machines" @@ -54,7 +60,7 @@ endif @echo " QEMU_LOCAL=1 - Use QEMU binary local to this build." @echo " QEMU=/path/to/qemu - Change path to QEMU binary" @echo " QEMU_IMG=/path/to/qemu-img - Change path to qemu-img tool" -ifeq ($(PYTHON_YAML),yes) +ifeq ($(HAVE_PYTHON_YAML),yes) @echo " QEMU_CONFIG=/path/conf.yml - Change path to VM configuration .yml file." else @echo " (install python3-yaml to enable support for yaml file to configure a VM.)" diff --git a/tests/vm/freebsd b/tests/vm/freebsd index 29252fa4a6..5f866e09c4 100755 --- a/tests/vm/freebsd +++ b/tests/vm/freebsd @@ -33,11 +33,13 @@ class FreeBSDVM(basevm.BaseVM): "pkgconf", "bzip2", "python37", + "py37-setuptools", # gnu tools "bash", "gmake", "gsed", + "gettext", # libs: crypto "gnutls", diff --git a/tests/vm/netbsd b/tests/vm/netbsd index 2e87199211..ffb65a89be 100755 --- a/tests/vm/netbsd +++ b/tests/vm/netbsd @@ -31,11 +31,13 @@ class NetBSDVM(basevm.BaseVM): "pkgconf", "xz", "python37", + "py37-setuptools", # gnu tools "bash", "gmake", "gsed", + "gettext", # libs: crypto "gnutls", diff --git a/tests/vm/openbsd b/tests/vm/openbsd index dfe633e453..8356646f21 100755 --- a/tests/vm/openbsd +++ b/tests/vm/openbsd @@ -30,11 +30,13 @@ class OpenBSDVM(basevm.BaseVM): "git", "pkgconf", "bzip2", "xz", + "py3-setuptools", # gnu tools "bash", "gmake", "gsed", + "gettext", # libs: usb "libusb1", diff --git a/tools/meson.build b/tools/meson.build new file mode 100644 index 0000000000..513bd2ff4f --- /dev/null +++ b/tools/meson.build @@ -0,0 +1,10 @@ +have_virtiofsd = (have_system and + have_tools and + 'CONFIG_LINUX' in config_host and + 'CONFIG_SECCOMP' in config_host and + 'CONFIG_LIBCAP_NG' in config_host and + 'CONFIG_VHOST_USER' in config_host) + +if have_virtiofsd + subdir('virtiofsd') +endif diff --git a/tools/virtiofsd/Makefile.objs b/tools/virtiofsd/Makefile.objs deleted file mode 100644 index 076f667e46..0000000000 --- a/tools/virtiofsd/Makefile.objs +++ /dev/null @@ -1,12 +0,0 @@ -virtiofsd-obj-y = buffer.o \ - fuse_opt.o \ - fuse_log.o \ - fuse_lowlevel.o \ - fuse_signals.o \ - fuse_virtio.o \ - helper.o \ - passthrough_ll.o \ - seccomp.o - -seccomp.o-cflags := $(SECCOMP_CFLAGS) -seccomp.o-libs := $(SECCOMP_LIBS) diff --git a/tools/virtiofsd/meson.build b/tools/virtiofsd/meson.build new file mode 100644 index 0000000000..d1e23c5760 --- /dev/null +++ b/tools/virtiofsd/meson.build @@ -0,0 +1,19 @@ +executable('virtiofsd', files( + 'buffer.c', + 'fuse_opt.c', + 'fuse_log.c', + 'fuse_lowlevel.c', + 'fuse_signals.c', + 'fuse_virtio.c', + 'helper.c', + 'passthrough_ll.c', + 'passthrough_seccomp.c'), + link_with: libvhost_user, + dependencies: [seccomp, qemuutil, libcap_ng], + install: true, + install_dir: get_option('libexecdir')) + +configure_file(input: '50-qemu-virtiofsd.json.in', + output: '50-qemu-virtiofsd.json', + configuration: config_host, + install_dir: config_host['qemu_datadir'] / 'vhost-user') diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c index 94e0de2d2b..63d1d00565 100644 --- a/tools/virtiofsd/passthrough_ll.c +++ b/tools/virtiofsd/passthrough_ll.c @@ -65,7 +65,7 @@ #include <unistd.h> #include "passthrough_helpers.h" -#include "seccomp.h" +#include "passthrough_seccomp.h" /* Keep track of inode posix locks for each owner. */ struct lo_inode_plock { diff --git a/tools/virtiofsd/seccomp.c b/tools/virtiofsd/passthrough_seccomp.c index 3b1522acdd..19fee60011 100644 --- a/tools/virtiofsd/seccomp.c +++ b/tools/virtiofsd/passthrough_seccomp.c @@ -7,7 +7,7 @@ */ #include "qemu/osdep.h" -#include "seccomp.h" +#include "passthrough_seccomp.h" #include "fuse_i.h" #include "fuse_log.h" #include <errno.h> diff --git a/tools/virtiofsd/seccomp.h b/tools/virtiofsd/passthrough_seccomp.h index d47c8eade6..d47c8eade6 100644 --- a/tools/virtiofsd/seccomp.h +++ b/tools/virtiofsd/passthrough_seccomp.h diff --git a/trace/Makefile.objs b/trace/Makefile.objs deleted file mode 100644 index c544509adf..0000000000 --- a/trace/Makefile.objs +++ /dev/null @@ -1,59 +0,0 @@ -# -*- mode: makefile -*- - -$(BUILD_DIR)/trace-events-all: $(trace-events-files) - $(call quiet-command,cat $^ > $@) - - -################################################## -# Translation level - -$(obj)/generated-helpers-wrappers.h: $(obj)/generated-helpers-wrappers.h-timestamp - @cmp $< $@ >/dev/null 2>&1 || cp $< $@ -$(obj)/generated-helpers-wrappers.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak $(tracetool-y) - $(call quiet-command,$(TRACETOOL) \ - --group=root \ - --format=tcg-helper-wrapper-h \ - --backend=$(TRACE_BACKENDS) \ - $< > $@,"GEN","$(patsubst %-timestamp,%,$@)") - -$(obj)/generated-helpers.h: $(obj)/generated-helpers.h-timestamp - @cmp $< $@ >/dev/null 2>&1 || cp $< $@ -$(obj)/generated-helpers.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak $(tracetool-y) - $(call quiet-command,$(TRACETOOL) \ - --group=root \ - --format=tcg-helper-h \ - --backend=$(TRACE_BACKENDS) \ - $< > $@,"GEN","$(patsubst %-timestamp,%,$@)") - -$(obj)/generated-helpers.c: $(obj)/generated-helpers.c-timestamp - @cmp $< $@ >/dev/null 2>&1 || cp $< $@ -$(obj)/generated-helpers.c-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak $(tracetool-y) - $(call quiet-command,$(TRACETOOL) \ - --group=root \ - --format=tcg-helper-c \ - --backend=$(TRACE_BACKENDS) \ - $< > $@,"GEN","$(patsubst %-timestamp,%,$@)") - -$(obj)/generated-helpers.o: $(obj)/generated-helpers.c - -obj-y += generated-helpers.o - - -$(obj)/generated-tcg-tracers.h: $(obj)/generated-tcg-tracers.h-timestamp - @cmp $< $@ >/dev/null 2>&1 || cp $< $@ -$(obj)/generated-tcg-tracers.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak $(tracetool-y) - $(call quiet-command,$(TRACETOOL) \ - --group=root \ - --format=tcg-h \ - --backend=$(TRACE_BACKENDS) \ - $< > $@,"GEN","$(patsubst %-timestamp,%,$@)") - - -###################################################################### -# Backend code - -util-obj-$(CONFIG_TRACE_SIMPLE) += simple.o -util-obj-$(CONFIG_TRACE_FTRACE) += ftrace.o -util-obj-y += control.o -obj-y += control-target.o -util-obj-y += qmp.o diff --git a/trace/control-target.c b/trace/control-target.c index ceb55c70ce..e293eeed7c 100644 --- a/trace/control-target.c +++ b/trace/control-target.c @@ -9,7 +9,7 @@ #include "qemu/osdep.h" #include "cpu.h" -#include "trace-root.h" +#include "trace/trace-root.h" #include "trace/control.h" diff --git a/trace/control.c b/trace/control.c index 6558b5c906..c63a4de732 100644 --- a/trace/control.c +++ b/trace/control.c @@ -27,7 +27,7 @@ #include "qemu/error-report.h" #include "qemu/config-file.h" #include "monitor/monitor.h" -#include "trace-root.h" +#include "trace/trace-root.h" int trace_events_enabled_count; diff --git a/trace/meson.build b/trace/meson.build new file mode 100644 index 0000000000..56e870848e --- /dev/null +++ b/trace/meson.build @@ -0,0 +1,93 @@ +specific_ss.add(files('control-target.c')) + +trace_events_files = [] +foreach dir : [ '.' ] + trace_events_subdirs + trace_events_file = meson.source_root() / dir / 'trace-events' + trace_events_files += [ trace_events_file ] + group_name = dir == '.' ? 'root' : dir.underscorify() + group = '--group=' + group_name + fmt = '@0@-' + group_name + '.@1@' + + trace_h = custom_target(fmt.format('trace', 'h'), + output: fmt.format('trace', 'h'), + input: trace_events_file, + command: [ tracetool, group, '--format=h', '@INPUT@' ], + capture: true) + genh += trace_h + trace_c = custom_target(fmt.format('trace', 'c'), + output: fmt.format('trace', 'c'), + input: trace_events_file, + command: [ tracetool, group, '--format=c', '@INPUT@' ], + capture: true) + if 'CONFIG_TRACE_UST' in config_host + trace_ust_h = custom_target(fmt.format('trace-ust', 'h'), + output: fmt.format('trace-ust', 'h'), + input: trace_events_file, + command: [ tracetool, group, '--format=ust-events-h', '@INPUT@' ], + capture: true) + trace_ss.add(trace_ust_h, lttng, urcubp) + genh += trace_ust_h + endif + trace_ss.add(trace_h, trace_c) + if 'CONFIG_TRACE_DTRACE' in config_host + trace_dtrace = custom_target(fmt.format('trace-dtrace', 'dtrace'), + output: fmt.format('trace-dtrace', 'dtrace'), + input: trace_events_file, + command: [ tracetool, group, '--format=d', '@INPUT@' ], + capture: true) + trace_dtrace_h = custom_target(fmt.format('trace-dtrace', 'h'), + output: fmt.format('trace-dtrace', 'h'), + input: trace_dtrace, + command: [ 'dtrace', '-o', '@OUTPUT@', '-h', '-s', '@INPUT@' ]) + trace_dtrace_o = custom_target(fmt.format('trace-dtrace', 'o'), + output: fmt.format('trace-dtrace', 'o'), + input: trace_dtrace, + command: [ 'dtrace', '-o', '@OUTPUT@', '-G', '-s', '@INPUT@' ]) + + trace_ss.add(trace_dtrace_h, trace_dtrace_o) + genh += trace_dtrace_h + endif +endforeach + +trace_events_all = custom_target('trace-events-all', + output: 'trace-events-all', + input: trace_events_files, + command: [ 'cat', '@INPUT@' ], + capture: true, + install: true, + install_dir: config_host['qemu_datadir']) + +foreach d : [ + ['generated-tcg-tracers.h', 'tcg-h'], + ['generated-helpers.c', 'tcg-helper-c'], + ['generated-helpers.h', 'tcg-helper-h'], + ['generated-helpers-wrappers.h', 'tcg-helper-wrapper-h'], +] + gen = custom_target(d[0], + output: d[0], + input: meson.source_root() / 'trace-events', + command: [ tracetool, '--group=root', '--format=@0@'.format(d[1]), '@INPUT@' ], + build_by_default: true, # to be removed when added to a target + capture: true) + specific_ss.add(gen) +endforeach + +if 'CONFIG_TRACE_UST' in config_host + trace_ust_all_h = custom_target('trace-ust-all.h', + output: 'trace-ust-all.h', + input: trace_events_files, + command: [ tracetool, '--group=all', '--format=ust-events-h', '@INPUT@' ], + capture: true) + trace_ust_all_c = custom_target('trace-ust-all.c', + output: 'trace-ust-all.c', + input: trace_events_files, + command: [ tracetool, '--group=all', '--format=ust-events-c', '@INPUT@' ], + capture: true) + trace_ss.add(trace_ust_all_h, trace_ust_all_c) + genh += trace_ust_all_h +endif + +trace_ss.add(when: 'CONFIG_TRACE_SIMPLE', if_true: files('simple.c')) +trace_ss.add(when: 'CONFIG_TRACE_FTRACE', if_true: files('ftrace.c')) +trace_ss.add(files('control.c')) +trace_ss.add(files('qmp.c')) diff --git a/ui/Makefile.objs b/ui/Makefile.objs deleted file mode 100644 index 504b196479..0000000000 --- a/ui/Makefile.objs +++ /dev/null @@ -1,73 +0,0 @@ -vnc-obj-y += vnc.o -vnc-obj-y += vnc-enc-zlib.o vnc-enc-hextile.o -vnc-obj-y += vnc-enc-tight.o vnc-palette.o -vnc-obj-y += vnc-enc-zrle.o -vnc-obj-y += vnc-auth-vencrypt.o -vnc-obj-$(CONFIG_VNC_SASL) += vnc-auth-sasl.o -vnc-obj-y += vnc-ws.o -vnc-obj-y += vnc-jobs.o - -common-obj-y += keymaps.o console.o cursor.o qemu-pixman.o -common-obj-y += input.o input-keymap.o input-legacy.o kbd-state.o -common-obj-y += input-barrier.o -common-obj-$(CONFIG_LINUX) += input-linux.o -common-obj-$(CONFIG_SPICE) += spice-core.o spice-input.o spice-display.o -common-obj-$(CONFIG_COCOA) += cocoa.o -common-obj-$(CONFIG_VNC) += $(vnc-obj-y) -common-obj-$(call lnot,$(CONFIG_VNC)) += vnc-stubs.o -ifneq (,$(findstring m,$(CONFIG_SDL)$(CONFIG_GTK))) -common-obj-$(CONFIG_WIN32) += win32-kbd-hook.o -endif - -# ui-sdl module -common-obj-$(CONFIG_SDL) += sdl.mo -sdl.mo-objs := sdl2.o sdl2-input.o sdl2-2d.o -ifeq ($(CONFIG_OPENGL),y) -sdl.mo-objs += sdl2-gl.o -endif -sdl.mo-cflags := $(SDL_CFLAGS) -sdl.mo-libs := $(SDL_LIBS) - -# ui-gtk module -common-obj-$(CONFIG_GTK) += gtk.mo -gtk.mo-objs := gtk.o -gtk.mo-cflags := $(GTK_CFLAGS) $(VTE_CFLAGS) -gtk.mo-libs := $(GTK_LIBS) $(VTE_LIBS) -ifeq ($(CONFIG_OPENGL),y) -gtk.mo-objs += gtk-egl.o -gtk.mo-libs += $(OPENGL_LIBS) -ifeq ($(CONFIG_GTK_GL),y) -gtk.mo-objs += gtk-gl-area.o -endif -endif - -ifeq ($(CONFIG_X11),y) -sdl.mo-objs += x_keymap.o -gtk.mo-objs += x_keymap.o -x_keymap.o-cflags := $(X11_CFLAGS) -x_keymap.o-libs := $(X11_LIBS) -endif - -common-obj-$(CONFIG_CURSES) += curses.mo -curses.mo-objs := curses.o -curses.mo-cflags := $(CURSES_CFLAGS) $(ICONV_CFLAGS) -curses.mo-libs := $(CURSES_LIBS) $(ICONV_LIBS) - -ifeq ($(CONFIG_GIO)$(CONFIG_SPICE),yy) -common-obj-$(if $(CONFIG_MODULES),m,y) += spice-app.mo -endif -spice-app.mo-objs := spice-app.o -spice-app.mo-cflags := $(GIO_CFLAGS) -spice-app.mo-libs := $(GIO_LIBS) - -common-obj-$(CONFIG_OPENGL) += shader.o -common-obj-$(CONFIG_OPENGL) += console-gl.o -common-obj-$(CONFIG_OPENGL) += egl-helpers.o -common-obj-$(CONFIG_OPENGL) += egl-context.o -common-obj-$(CONFIG_OPENGL_DMABUF) += egl-headless.o - -shader.o-libs += $(OPENGL_LIBS) -console-gl.o-libs += $(OPENGL_LIBS) -egl-helpers.o-libs += $(OPENGL_LIBS) -egl-context.o-libs += $(OPENGL_LIBS) -egl-headless.o-libs += $(OPENGL_LIBS) diff --git a/ui/input-keymap.c b/ui/input-keymap.c index c4301851bd..1b756a6970 100644 --- a/ui/input-keymap.c +++ b/ui/input-keymap.c @@ -4,23 +4,23 @@ #include "standard-headers/linux/input.h" -#include "ui/input-keymap-atset1-to-qcode.c" -#include "ui/input-keymap-linux-to-qcode.c" -#include "ui/input-keymap-qcode-to-atset1.c" -#include "ui/input-keymap-qcode-to-atset2.c" -#include "ui/input-keymap-qcode-to-atset3.c" -#include "ui/input-keymap-qcode-to-linux.c" -#include "ui/input-keymap-qcode-to-qnum.c" -#include "ui/input-keymap-qcode-to-sun.c" -#include "ui/input-keymap-qnum-to-qcode.c" -#include "ui/input-keymap-usb-to-qcode.c" -#include "ui/input-keymap-win32-to-qcode.c" -#include "ui/input-keymap-x11-to-qcode.c" -#include "ui/input-keymap-xorgevdev-to-qcode.c" -#include "ui/input-keymap-xorgkbd-to-qcode.c" -#include "ui/input-keymap-xorgxquartz-to-qcode.c" -#include "ui/input-keymap-xorgxwin-to-qcode.c" -#include "ui/input-keymap-osx-to-qcode.c" +#include "ui/input-keymap-atset1-to-qcode.c.inc" +#include "ui/input-keymap-linux-to-qcode.c.inc" +#include "ui/input-keymap-qcode-to-atset1.c.inc" +#include "ui/input-keymap-qcode-to-atset2.c.inc" +#include "ui/input-keymap-qcode-to-atset3.c.inc" +#include "ui/input-keymap-qcode-to-linux.c.inc" +#include "ui/input-keymap-qcode-to-qnum.c.inc" +#include "ui/input-keymap-qcode-to-sun.c.inc" +#include "ui/input-keymap-qnum-to-qcode.c.inc" +#include "ui/input-keymap-usb-to-qcode.c.inc" +#include "ui/input-keymap-win32-to-qcode.c.inc" +#include "ui/input-keymap-x11-to-qcode.c.inc" +#include "ui/input-keymap-xorgevdev-to-qcode.c.inc" +#include "ui/input-keymap-xorgkbd-to-qcode.c.inc" +#include "ui/input-keymap-xorgxquartz-to-qcode.c.inc" +#include "ui/input-keymap-xorgxwin-to-qcode.c.inc" +#include "ui/input-keymap-osx-to-qcode.c.inc" int qemu_input_linux_to_qcode(unsigned int lnx) { diff --git a/ui/meson.build b/ui/meson.build new file mode 100644 index 0000000000..81fd393432 --- /dev/null +++ b/ui/meson.build @@ -0,0 +1,114 @@ +softmmu_ss.add(files( + 'console.c', + 'cursor.c', + 'input-keymap.c', + 'input-legacy.c', + 'input-barrier.c', + 'input.c', + 'kbd-state.c', + 'keymaps.c', + 'qemu-pixman.c', +)) +softmmu_ss.add(pixman) + +softmmu_ss.add(when: 'CONFIG_LINUX', if_true: files('input-linux.c')) +softmmu_ss.add(when: 'CONFIG_SPICE', if_true: files('spice-core.c', 'spice-input.c', 'spice-display.c')) +softmmu_ss.add(when: [cocoa, 'CONFIG_COCOA'], if_true: files('cocoa.m')) + +vnc_ss = ss.source_set() +vnc_ss.add(files( + 'vnc.c', + 'vnc-enc-zlib.c', + 'vnc-enc-hextile.c', + 'vnc-enc-tight.c', + 'vnc-palette.c', + 'vnc-enc-zrle.c', + 'vnc-auth-vencrypt.c', + 'vnc-ws.c', + 'vnc-jobs.c', +)) +vnc_ss.add(zlib, png, jpeg) +vnc_ss.add(when: sasl, if_true: files('vnc-auth-sasl.c')) +softmmu_ss.add_all(when: vnc, if_true: vnc_ss) +softmmu_ss.add(when: vnc, if_false: files('vnc-stubs.c')) +softmmu_ss.add(when: [opengl, 'CONFIG_OPENGL'], if_true: files('shader.c', 'console-gl.c', 'egl-helpers.c', 'egl-context.c')) +softmmu_ss.add(when: [opengl, 'CONFIG_OPENGL_DMABUF'], if_true: files('egl-headless.c')) + +ui_modules = {} + +if config_host.has_key('CONFIG_CURSES') + curses_ss = ss.source_set() + curses_ss.add(when: [curses, iconv], if_true: files('curses.c')) + ui_modules += {'curses' : curses_ss} +endif + +if config_host.has_key('CONFIG_GTK') and config_host.has_key('CONFIG_VTE') + softmmu_ss.add(when: 'CONFIG_WIN32', if_true: files('win32-kbd-hook.c')) + + gtk_ss = ss.source_set() + gtk_ss.add(gtk, vte, files('gtk.c')) + gtk_ss.add(when: [x11, 'CONFIG_X11'], if_true: files('x_keymap.c')) + gtk_ss.add(when: [opengl, 'CONFIG_OPENGL'], if_true: files('gtk-egl.c')) + gtk_ss.add(when: [opengl, 'CONFIG_GTK_GL'], if_true: files('gtk-gl-area.c')) + ui_modules += {'gtk' : gtk_ss} +endif + +if sdl.found() + softmmu_ss.add(when: 'CONFIG_WIN32', if_true: files('win32-kbd-hook.c')) + + sdl_ss = ss.source_set() + sdl_ss.add(sdl, sdl_image, pixman, glib, files( + 'sdl2-2d.c', + 'sdl2-input.c', + 'sdl2.c', + )) + sdl_ss.add(when: [opengl, 'CONFIG_OPENGL'], if_true: files('sdl2-gl.c')) + sdl_ss.add(when: [x11, 'CONFIG_X11'], if_true: files('x_keymap.c')) + ui_modules += {'sdl' : sdl_ss} +endif + +if config_host.has_key('CONFIG_SPICE') and config_host.has_key('CONFIG_GIO') + spice_ss = ss.source_set() + spice_ss.add(spice, gio, files('spice-app.c')) + ui_modules += {'spice-app': spice_ss} +endif + +keymap_gen = find_program('keycodemapdb/tools/keymap-gen') + +keymaps = [ + ['atset1', 'qcode'], + ['linux', 'qcode'], + ['qcode', 'atset1'], + ['qcode', 'atset2'], + ['qcode', 'atset3'], + ['qcode', 'linux'], + ['qcode', 'qnum'], + ['qcode', 'sun'], + ['qnum', 'qcode'], + ['usb', 'qcode'], + ['win32', 'qcode'], + ['x11', 'qcode'], + ['xorgevdev', 'qcode'], + ['xorgkbd', 'qcode'], + ['xorgxquartz', 'qcode'], + ['xorgxwin', 'qcode'], + ['osx', 'qcode'], +] + +if have_system or 'CONFIG_XKBCOMMON' in config_host + foreach e : keymaps + output = 'input-keymap-@0@-to-@1@.c.inc'.format(e[0], e[1]) + genh += custom_target(output, + output: output, + capture: true, + input: files('keycodemapdb/data/keymaps.csv'), + command: [python.full_path(), files('keycodemapdb/tools/keymap-gen'), + '--lang', 'glib2', + '--varname', 'qemu_input_map_@0@_to_@1@'.format(e[0], e[1]), + 'code-map', '@INPUT0@', e[0], e[1]]) + endforeach +endif + +subdir('shader') + +modules += {'ui': ui_modules} diff --git a/ui/shader.c b/ui/shader.c index d78829f43b..e8b8d321b7 100644 --- a/ui/shader.c +++ b/ui/shader.c @@ -27,9 +27,9 @@ #include "qemu/osdep.h" #include "ui/shader.h" -#include "shader/texture-blit-vert.h" -#include "shader/texture-blit-flip-vert.h" -#include "shader/texture-blit-frag.h" +#include "ui/shader/texture-blit-vert.h" +#include "ui/shader/texture-blit-flip-vert.h" +#include "ui/shader/texture-blit-frag.h" struct QemuGLShader { GLint texture_blit_prog; diff --git a/ui/shader/meson.build b/ui/shader/meson.build new file mode 100644 index 0000000000..f69e44ed89 --- /dev/null +++ b/ui/shader/meson.build @@ -0,0 +1,15 @@ +shaders = [ + ['texture-blit', 'frag'], + ['texture-blit', 'vert'], + ['texture-blit-flip', 'vert'], +] + +foreach e : shaders + output = '@0@-@1@.h'.format(e[0], e[1]) + genh += custom_target(output, + output: output, + capture: true, + build_by_default: true, # to be removed when added to a target + input: files('@0@.@1@'.format(e[0], e[1])), + command: [shaderinclude, '@INPUT0@']) +endforeach diff --git a/ui/trace.h b/ui/trace.h new file mode 100644 index 0000000000..a89d769623 --- /dev/null +++ b/ui/trace.h @@ -0,0 +1 @@ +#include "trace/trace-ui.h" diff --git a/ui/vnc-enc-zrle.c b/ui/vnc-enc-zrle.c index b4f71e32cf..bd33b89063 100644 --- a/ui/vnc-enc-zrle.c +++ b/ui/vnc-enc-zrle.c @@ -199,56 +199,56 @@ static void zrle_write_u8(VncState *vs, uint8_t value) #define ZRLE_BPP 8 #define ZYWRLE_ENDIAN ENDIAN_NO -#include "vnc-enc-zrle.inc.c" +#include "vnc-enc-zrle.c.inc" #undef ZRLE_BPP #define ZRLE_BPP 15 #undef ZYWRLE_ENDIAN #define ZYWRLE_ENDIAN ENDIAN_LITTLE -#include "vnc-enc-zrle.inc.c" +#include "vnc-enc-zrle.c.inc" #undef ZYWRLE_ENDIAN #define ZYWRLE_ENDIAN ENDIAN_BIG -#include "vnc-enc-zrle.inc.c" +#include "vnc-enc-zrle.c.inc" #undef ZRLE_BPP #define ZRLE_BPP 16 #undef ZYWRLE_ENDIAN #define ZYWRLE_ENDIAN ENDIAN_LITTLE -#include "vnc-enc-zrle.inc.c" +#include "vnc-enc-zrle.c.inc" #undef ZYWRLE_ENDIAN #define ZYWRLE_ENDIAN ENDIAN_BIG -#include "vnc-enc-zrle.inc.c" +#include "vnc-enc-zrle.c.inc" #undef ZRLE_BPP #define ZRLE_BPP 32 #undef ZYWRLE_ENDIAN #define ZYWRLE_ENDIAN ENDIAN_LITTLE -#include "vnc-enc-zrle.inc.c" +#include "vnc-enc-zrle.c.inc" #undef ZYWRLE_ENDIAN #define ZYWRLE_ENDIAN ENDIAN_BIG -#include "vnc-enc-zrle.inc.c" +#include "vnc-enc-zrle.c.inc" #define ZRLE_COMPACT_PIXEL 24a #undef ZYWRLE_ENDIAN #define ZYWRLE_ENDIAN ENDIAN_LITTLE -#include "vnc-enc-zrle.inc.c" +#include "vnc-enc-zrle.c.inc" #undef ZYWRLE_ENDIAN #define ZYWRLE_ENDIAN ENDIAN_BIG -#include "vnc-enc-zrle.inc.c" +#include "vnc-enc-zrle.c.inc" #undef ZRLE_COMPACT_PIXEL #define ZRLE_COMPACT_PIXEL 24b #undef ZYWRLE_ENDIAN #define ZYWRLE_ENDIAN ENDIAN_LITTLE -#include "vnc-enc-zrle.inc.c" +#include "vnc-enc-zrle.c.inc" #undef ZYWRLE_ENDIAN #define ZYWRLE_ENDIAN ENDIAN_BIG -#include "vnc-enc-zrle.inc.c" +#include "vnc-enc-zrle.c.inc" #undef ZRLE_COMPACT_PIXEL #undef ZRLE_BPP diff --git a/ui/vnc-enc-zrle.inc.c b/ui/vnc-enc-zrle.c.inc index c107d8affc..c107d8affc 100644 --- a/ui/vnc-enc-zrle.inc.c +++ b/ui/vnc-enc-zrle.c.inc diff --git a/util/Makefile.objs b/util/Makefile.objs deleted file mode 100644 index cc5e37177a..0000000000 --- a/util/Makefile.objs +++ /dev/null @@ -1,83 +0,0 @@ -util-obj-y = osdep.o cutils.o unicode.o qemu-timer-common.o -util-obj-$(call lnot,$(CONFIG_ATOMIC64)) += atomic64.o -util-obj-$(CONFIG_POSIX) += aio-posix.o -util-obj-$(CONFIG_POSIX) += fdmon-poll.o -util-obj-$(CONFIG_EPOLL_CREATE1) += fdmon-epoll.o -util-obj-$(CONFIG_LINUX_IO_URING) += fdmon-io_uring.o -util-obj-$(CONFIG_POSIX) += compatfd.o -util-obj-$(CONFIG_POSIX) += event_notifier-posix.o -util-obj-$(CONFIG_POSIX) += mmap-alloc.o -util-obj-$(CONFIG_POSIX) += oslib-posix.o -util-obj-$(CONFIG_POSIX) += qemu-openpty.o -util-obj-$(CONFIG_POSIX) += qemu-thread-posix.o -util-obj-$(CONFIG_POSIX) += memfd.o -util-obj-$(CONFIG_WIN32) += aio-win32.o -util-obj-$(CONFIG_WIN32) += event_notifier-win32.o -util-obj-$(CONFIG_WIN32) += oslib-win32.o -util-obj-$(CONFIG_WIN32) += qemu-thread-win32.o -util-obj-y += envlist.o path.o module.o -util-obj-y += host-utils.o -util-obj-y += bitmap.o bitops.o -util-obj-y += fifo8.o -util-obj-y += cacheinfo.o -util-obj-y += error.o qemu-error.o -util-obj-y += qemu-print.o -util-obj-y += id.o -util-obj-y += qemu-config.o notify.o -util-obj-y += qemu-option.o qemu-progress.o -util-obj-y += keyval.o -util-obj-y += crc32c.o -util-obj-y += uuid.o -util-obj-y += getauxval.o -util-obj-y += rcu.o -util-obj-$(CONFIG_MEMBARRIER) += sys_membarrier.o -util-obj-y += log.o -util-obj-y += pagesize.o -util-obj-y += qdist.o -util-obj-y += qht.o -util-obj-y += qsp.o -util-obj-y += range.o -util-obj-y += stats64.o -util-obj-y += systemd.o -util-obj-$(CONFIG_POSIX) += drm.o -util-obj-y += guest-random.o -util-obj-$(CONFIG_GIO) += dbus.o -dbus.o-cflags = $(GIO_CFLAGS) -dbus.o-libs = $(GIO_LIBS) -util-obj-$(CONFIG_USER_ONLY) += selfmap.o - -####################################################################### -# code used by both qemu system emulation and qemu-img - -ifeq ($(call lor,$(CONFIG_SOFTMMU),$(CONFIG_TOOLS)),y) - -util-obj-y += aio-wait.o -util-obj-y += aiocb.o -util-obj-y += async.o -util-obj-y += base64.o -util-obj-y += buffer.o -util-obj-y += bufferiszero.o -util-obj-y += coroutine-$(CONFIG_COROUTINE_BACKEND).o -util-obj-y += hexdump.o -util-obj-y += lockcnt.o -util-obj-y += iov.o -util-obj-y += iova-tree.o -util-obj-y += hbitmap.o -util-obj-y += main-loop.o -util-obj-y += nvdimm-utils.o -util-obj-y += qemu-coroutine.o qemu-coroutine-lock.o qemu-coroutine-io.o -util-obj-y += qemu-coroutine-sleep.o -util-obj-y += qemu-co-shared-resource.o -util-obj-y += qemu-sockets.o -util-obj-y += qemu-timer.o -util-obj-y += thread-pool.o -util-obj-y += throttle.o -util-obj-y += timed-average.o -util-obj-y += uri.o - -util-obj-$(CONFIG_LINUX) += vfio-helpers.o -util-obj-$(CONFIG_INOTIFY1) += filemonitor-inotify.o -util-obj-$(call lnot,$(CONFIG_INOTIFY1)) += filemonitor-stub.o -util-obj-$(CONFIG_BLOCK) += readline.o - -endif # CONFIG_SOFTMMU || CONFIG_TOOLS diff --git a/util/aio-posix.c b/util/aio-posix.c index 1b2a3af65b..f7f13ebfc2 100644 --- a/util/aio-posix.c +++ b/util/aio-posix.c @@ -464,9 +464,6 @@ static bool remove_idle_poll_handlers(AioContext *ctx, int64_t now) * * Polls for a given time. * - * Note that ctx->notify_me must be non-zero so this function can detect - * aio_notify(). - * * Note that the caller must have incremented ctx->list_lock. * * Returns: true if progress was made, false otherwise @@ -476,7 +473,6 @@ static bool run_poll_handlers(AioContext *ctx, int64_t max_ns, int64_t *timeout) bool progress; int64_t start_time, elapsed_time; - assert(ctx->notify_me); assert(qemu_lockcnt_count(&ctx->list_lock) > 0); trace_run_poll_handlers_begin(ctx, max_ns, *timeout); @@ -520,8 +516,6 @@ static bool run_poll_handlers(AioContext *ctx, int64_t max_ns, int64_t *timeout) * @timeout: timeout for blocking wait, computed by the caller and updated if * polling succeeds. * - * ctx->notify_me must be non-zero so this function can detect aio_notify(). - * * Note that the caller must have incremented ctx->list_lock. * * Returns: true if progress was made, false otherwise @@ -556,6 +550,7 @@ bool aio_poll(AioContext *ctx, bool blocking) AioHandlerList ready_list = QLIST_HEAD_INITIALIZER(ready_list); int ret = 0; bool progress; + bool use_notify_me; int64_t timeout; int64_t start = 0; @@ -566,33 +561,39 @@ bool aio_poll(AioContext *ctx, bool blocking) */ assert(in_aio_context_home_thread(ctx)); - /* aio_notify can avoid the expensive event_notifier_set if + qemu_lockcnt_inc(&ctx->list_lock); + + if (ctx->poll_max_ns) { + start = qemu_clock_get_ns(QEMU_CLOCK_REALTIME); + } + + timeout = blocking ? aio_compute_timeout(ctx) : 0; + progress = try_poll_mode(ctx, &timeout); + assert(!(timeout && progress)); + + /* + * aio_notify can avoid the expensive event_notifier_set if * everything (file descriptors, bottom halves, timers) will * be re-evaluated before the next blocking poll(). This is * already true when aio_poll is called with blocking == false; * if blocking == true, it is only true after poll() returns, * so disable the optimization now. */ - if (blocking) { + use_notify_me = timeout != 0; + if (use_notify_me) { atomic_set(&ctx->notify_me, atomic_read(&ctx->notify_me) + 2); /* - * Write ctx->notify_me before computing the timeout - * (reading bottom half flags, etc.). Pairs with + * Write ctx->notify_me before reading ctx->notified. Pairs with * smp_mb in aio_notify(). */ smp_mb(); - } - - qemu_lockcnt_inc(&ctx->list_lock); - if (ctx->poll_max_ns) { - start = qemu_clock_get_ns(QEMU_CLOCK_REALTIME); + /* Don't block if aio_notify() was called */ + if (atomic_read(&ctx->notified)) { + timeout = 0; + } } - timeout = blocking ? aio_compute_timeout(ctx) : 0; - progress = try_poll_mode(ctx, &timeout); - assert(!(timeout && progress)); - /* If polling is allowed, non-blocking aio_poll does not need the * system call---a single round of run_poll_handlers_once suffices. */ @@ -600,12 +601,14 @@ bool aio_poll(AioContext *ctx, bool blocking) ret = ctx->fdmon_ops->wait(ctx, &ready_list, timeout); } - if (blocking) { + if (use_notify_me) { /* Finish the poll before clearing the flag. */ - atomic_store_release(&ctx->notify_me, atomic_read(&ctx->notify_me) - 2); - aio_notify_accept(ctx); + atomic_store_release(&ctx->notify_me, + atomic_read(&ctx->notify_me) - 2); } + aio_notify_accept(ctx); + /* Adjust polling time */ if (ctx->poll_max_ns) { int64_t block_ns = qemu_clock_get_ns(QEMU_CLOCK_REALTIME) - start; diff --git a/util/async.c b/util/async.c index 1319eee3bc..4266745dee 100644 --- a/util/async.c +++ b/util/async.c @@ -419,25 +419,32 @@ LuringState *aio_get_linux_io_uring(AioContext *ctx) void aio_notify(AioContext *ctx) { - /* Write e.g. bh->scheduled before reading ctx->notify_me. Pairs + /* + * Write e.g. bh->flags before writing ctx->notified. Pairs with smp_mb in + * aio_notify_accept. + */ + smp_wmb(); + atomic_set(&ctx->notified, true); + + /* + * Write ctx->notified before reading ctx->notify_me. Pairs * with smp_mb in aio_ctx_prepare or aio_poll. */ smp_mb(); if (atomic_read(&ctx->notify_me)) { event_notifier_set(&ctx->notifier); - atomic_mb_set(&ctx->notified, true); } } void aio_notify_accept(AioContext *ctx) { - if (atomic_xchg(&ctx->notified, false) -#ifdef WIN32 - || true -#endif - ) { - event_notifier_test_and_clear(&ctx->notifier); - } + atomic_set(&ctx->notified, false); + + /* + * Write ctx->notified before reading e.g. bh->flags. Pairs with smp_wmb + * in aio_notify. + */ + smp_mb(); } static void aio_timerlist_notify(void *opaque, QEMUClockType type) @@ -445,12 +452,15 @@ static void aio_timerlist_notify(void *opaque, QEMUClockType type) aio_notify(opaque); } -static void event_notifier_dummy_cb(EventNotifier *e) +static void aio_context_notifier_cb(EventNotifier *e) { + AioContext *ctx = container_of(e, AioContext, notifier); + + event_notifier_test_and_clear(&ctx->notifier); } /* Returns true if aio_notify() was called (e.g. a BH was scheduled) */ -static bool event_notifier_poll(void *opaque) +static bool aio_context_notifier_poll(void *opaque) { EventNotifier *e = opaque; AioContext *ctx = container_of(e, AioContext, notifier); @@ -508,8 +518,8 @@ AioContext *aio_context_new(Error **errp) aio_set_event_notifier(ctx, &ctx->notifier, false, - event_notifier_dummy_cb, - event_notifier_poll); + aio_context_notifier_cb, + aio_context_notifier_poll); #ifdef CONFIG_LINUX_AIO ctx->linux_aio = NULL; #endif diff --git a/util/meson.build b/util/meson.build new file mode 100644 index 0000000000..e6b207a99e --- /dev/null +++ b/util/meson.build @@ -0,0 +1,78 @@ +util_ss.add(dependency('threads')) +util_ss.add(files('osdep.c', 'cutils.c', 'unicode.c', 'qemu-timer-common.c')) +util_ss.add(when: 'CONFIG_ATOMIC64', if_false: files('atomic64.c')) +util_ss.add(when: 'CONFIG_POSIX', if_true: files('aio-posix.c')) +util_ss.add(when: 'CONFIG_POSIX', if_true: files('fdmon-poll.c')) +util_ss.add(when: 'CONFIG_EPOLL_CREATE1', if_true: files('fdmon-epoll.c')) +util_ss.add(when: ['CONFIG_LINUX_IO_URING', linux_io_uring], if_true: files('fdmon-io_uring.c')) +util_ss.add(when: 'CONFIG_POSIX', if_true: files('compatfd.c')) +util_ss.add(when: 'CONFIG_POSIX', if_true: files('event_notifier-posix.c')) +util_ss.add(when: 'CONFIG_POSIX', if_true: files('mmap-alloc.c')) +util_ss.add(when: 'CONFIG_POSIX', if_true: files('oslib-posix.c')) +util_ss.add(when: 'CONFIG_POSIX', if_true: [files('qemu-openpty.c'), util]) +util_ss.add(when: 'CONFIG_POSIX', if_true: files('qemu-thread-posix.c')) +util_ss.add(when: 'CONFIG_POSIX', if_true: files('memfd.c')) +util_ss.add(when: 'CONFIG_WIN32', if_true: files('aio-win32.c')) +util_ss.add(when: 'CONFIG_WIN32', if_true: files('event_notifier-win32.c')) +util_ss.add(when: 'CONFIG_WIN32', if_true: files('oslib-win32.c')) +util_ss.add(when: 'CONFIG_WIN32', if_true: files('qemu-thread-win32.c')) +util_ss.add(when: 'CONFIG_WIN32', if_true: winmm) +util_ss.add(files('envlist.c', 'path.c', 'module.c')) +util_ss.add(files('host-utils.c')) +util_ss.add(files('bitmap.c', 'bitops.c')) +util_ss.add(files('fifo8.c')) +util_ss.add(files('cacheinfo.c')) +util_ss.add(files('error.c', 'qemu-error.c')) +util_ss.add(files('qemu-print.c')) +util_ss.add(files('id.c')) +util_ss.add(files('qemu-config.c', 'notify.c')) +util_ss.add(files('qemu-option.c', 'qemu-progress.c')) +util_ss.add(files('keyval.c')) +util_ss.add(files('crc32c.c')) +util_ss.add(files('uuid.c')) +util_ss.add(files('getauxval.c')) +util_ss.add(files('rcu.c')) +util_ss.add(when: 'CONFIG_MEMBARRIER', if_true: files('sys_membarrier.c')) +util_ss.add(files('log.c')) +util_ss.add(files('pagesize.c')) +util_ss.add(files('qdist.c')) +util_ss.add(files('qht.c')) +util_ss.add(files('qsp.c')) +util_ss.add(files('range.c')) +util_ss.add(files('stats64.c')) +util_ss.add(files('systemd.c')) +util_ss.add(when: 'CONFIG_POSIX', if_true: files('drm.c')) +util_ss.add(files('guest-random.c')) + +if have_user + util_ss.add(files('selfmap.c')) +endif + +if have_system + util_ss.add(when: 'CONFIG_GIO', if_true: [files('dbus.c'), gio]) +endif + +if have_block + util_ss.add(files('aiocb.c', 'async.c', 'aio-wait.c')) + util_ss.add(files('base64.c')) + util_ss.add(files('buffer.c')) + util_ss.add(files('bufferiszero.c')) + util_ss.add(files('coroutine-@0@.c'.format(config_host['CONFIG_COROUTINE_BACKEND']))) + util_ss.add(files('hbitmap.c')) + util_ss.add(files('hexdump.c')) + util_ss.add(files('iova-tree.c')) + util_ss.add(files('iov.c', 'qemu-sockets.c', 'uri.c')) + util_ss.add(files('lockcnt.c')) + util_ss.add(files('main-loop.c')) + util_ss.add(files('nvdimm-utils.c')) + util_ss.add(files('qemu-coroutine.c', 'qemu-coroutine-lock.c', 'qemu-coroutine-io.c')) + util_ss.add(files('qemu-coroutine-sleep.c')) + util_ss.add(files('qemu-co-shared-resource.c')) + util_ss.add(files('thread-pool.c', 'qemu-timer.c')) + util_ss.add(files('readline.c')) + util_ss.add(files('throttle.c')) + util_ss.add(files('timed-average.c')) + util_ss.add(when: 'CONFIG_INOTIFY1', if_true: files('filemonitor-inotify.c'), + if_false: files('filemonitor-stub.c')) + util_ss.add(when: 'CONFIG_LINUX', if_true: files('vfio-helpers.c')) +endif diff --git a/util/module.c b/util/module.c index 0ab00851f0..6e63006a8f 100644 --- a/util/module.c +++ b/util/module.c @@ -113,7 +113,7 @@ static int module_load_file(const char *fname) { GModule *g_module; void (*sym)(void); - const char *dsosuf = HOST_DSOSUF; + const char *dsosuf = CONFIG_HOST_DSOSUF; int len = strlen(fname); int suf_len = strlen(dsosuf); ModuleEntry *e, *next; @@ -205,7 +205,6 @@ bool module_load_one(const char *prefix, const char *lib_name) dirs[n_dirs++] = g_strdup_printf("%s", search_dir); } dirs[n_dirs++] = g_strdup_printf("%s", CONFIG_QEMU_MODDIR); - dirs[n_dirs++] = g_strdup_printf("%s/..", exec_dir ? : ""); dirs[n_dirs++] = g_strdup_printf("%s", exec_dir ? : ""); #ifdef CONFIG_MODULE_UPGRADES @@ -222,7 +221,7 @@ bool module_load_one(const char *prefix, const char *lib_name) for (i = 0; i < n_dirs; i++) { fname = g_strdup_printf("%s/%s%s", - dirs[i], module_name, HOST_DSOSUF); + dirs[i], module_name, CONFIG_HOST_DSOSUF); ret = module_load_file(fname); g_free(fname); fname = NULL; diff --git a/util/trace.h b/util/trace.h new file mode 100644 index 0000000000..86ff7a390c --- /dev/null +++ b/util/trace.h @@ -0,0 +1 @@ +#include "trace/trace-util.h" diff --git a/version.texi.in b/version.texi.in new file mode 100644 index 0000000000..0a723b8be6 --- /dev/null +++ b/version.texi.in @@ -0,0 +1,2 @@ +@set VERSION @VERSION@ +@set CONFDIR @qemu_confdir@ |