mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'remotes/stsquad/tags/pull-for-7.0-180122-2' into staging
Various testing and other misc updates: - fix compiler warnings with ui and sdl - update QXL/spice dependancy - skip I/O tests on Alpine - update fedora image to latest version - integrate lcitool and regenerate docker images - favour CONFIG_LINUX_USER over CONFIG_LINUX - add libfuse3 dependencies to docker images - add dtb-kaslr-seed control knob to virt machine - fix build breakage from HMP update - update docs for C standard and suffix usage - add more logging for debugging user hole finding - expand reserve for brk() for static 64 bit programs - fix bug with linux-user hole calculation - avoid affecting flags when printing results in float tests - add float reference files for ppc64 - update FreeBSD to 12.3 - add bison dependancy to tricore images # gpg: Signature made Tue 18 Jan 2022 16:47:42 GMT # gpg: using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44 # gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [full] # Primary key fingerprint: 6685 AE99 E751 67BC AFC8 DF35 FBD0 DB09 5A9E 2A44 * remotes/stsquad/tags/pull-for-7.0-180122-2: (31 commits) docker: include bison in debian-tricore-cross FreeBSD: Upgrade to 12.3 release test/tcg/ppc64le: Add float reference files tests/tcg/multiarch: Read fp flags before printf linux-user: don't adjust base of found hole linux-user/elfload: add extra logging for hole finding linux-user: expand reserved brk space for 64bit guests docs/devel: more documentation on the use of suffixes docs/devel: update C standard to C11 monitor: move x-query-profile into accel/tcg to fix build hw/arm: add control knob to disable kaslr_seed via DTB tests/docker: add libfuse3 development headers tests/tcg: use CONFIG_LINUX_USER, not CONFIG_LINUX tests/docker: auto-generate alpine.docker with lcitool tests/docker: fully expand the alpine package list tests/docker: fix sorting of alpine image package lists tests/docker: updates to alpine package list .gitlab-ci.d/cirrus: auto-generate variables with lcitool tests/docker: remove ubuntu.docker container tests/docker: auto-generate opensuse-leap.docker with lcitool ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
@@ -24,7 +24,7 @@ check-system-alpine:
|
||||
artifacts: true
|
||||
variables:
|
||||
IMAGE: alpine
|
||||
MAKE_CHECK_ARGS: check
|
||||
MAKE_CHECK_ARGS: check-unit check-qtest
|
||||
|
||||
avocado-system-alpine:
|
||||
extends: .avocado_test_job_template
|
||||
|
||||
@@ -52,14 +52,11 @@ x64-freebsd-12-build:
|
||||
NAME: freebsd-12
|
||||
CIRRUS_VM_INSTANCE_TYPE: freebsd_instance
|
||||
CIRRUS_VM_IMAGE_SELECTOR: image_family
|
||||
CIRRUS_VM_IMAGE_NAME: freebsd-12-2
|
||||
CIRRUS_VM_IMAGE_NAME: freebsd-12-3
|
||||
CIRRUS_VM_CPUS: 8
|
||||
CIRRUS_VM_RAM: 8G
|
||||
UPDATE_COMMAND: pkg update
|
||||
INSTALL_COMMAND: pkg install -y
|
||||
# TODO: Enable gnutls again once FreeBSD's libtasn1 got fixed
|
||||
# See: https://gitlab.com/gnutls/libtasn1/-/merge_requests/71
|
||||
CONFIGURE_ARGS: --disable-gnutls
|
||||
TEST_TARGETS: check
|
||||
|
||||
x64-freebsd-13-build:
|
||||
|
||||
@@ -2,12 +2,15 @@
|
||||
#
|
||||
# $ lcitool variables freebsd-12 qemu
|
||||
#
|
||||
# https://gitlab.com/libvirt/libvirt-ci/-/commit/c7e275ab27ac0dcd09da290817b9adeea1fd1eb1
|
||||
# https://gitlab.com/libvirt/libvirt-ci
|
||||
|
||||
PACKAGING_COMMAND='pkg'
|
||||
CCACHE='/usr/local/bin/ccache'
|
||||
CPAN_PKGS=''
|
||||
CROSS_PKGS=''
|
||||
MAKE='/usr/local/bin/gmake'
|
||||
NINJA='/usr/local/bin/ninja'
|
||||
PYTHON='/usr/local/bin/python3'
|
||||
PACKAGING_COMMAND='pkg'
|
||||
PIP3='/usr/local/bin/pip-3.8'
|
||||
PKGS='alsa-lib bash bzip2 ca_root_nss capstone4 ccache cdrkit-genisoimage ctags curl cyrus-sasl dbus diffutils gettext git glib gmake gnutls gsed gtk3 libepoxy libffi libgcrypt libjpeg-turbo libnfs libspice-server libssh libtasn1 libxml2 llvm lttng-ust lzo2 meson ncurses nettle ninja opencv p5-Test-Harness perl5 pixman pkgconf png py38-numpy py38-pillow py38-pip py38-sphinx py38-sphinx_rtd_theme py38-virtualenv py38-yaml python3 rpm2cpio sdl2 sdl2_image snappy spice-protocol tesseract texinfo usbredir virglrenderer vte3 zstd'
|
||||
PKGS='alsa-lib bash bzip2 ca_root_nss capstone4 ccache cdrkit-genisoimage ctags curl cyrus-sasl dbus diffutils dtc gettext git glib gmake gnutls gsed gtk3 libepoxy libffi libgcrypt libjpeg-turbo libnfs libspice-server libssh libtasn1 libxml2 llvm lttng-ust lzo2 meson ncurses nettle ninja opencv p5-Test-Harness perl5 pixman pkgconf png py38-numpy py38-pillow py38-pip py38-sphinx py38-sphinx_rtd_theme py38-virtualenv py38-yaml python3 rpm2cpio sdl2 sdl2_image snappy spice-protocol tesseract texinfo usbredir virglrenderer vte3 zstd'
|
||||
PYPI_PKGS=''
|
||||
PYTHON='/usr/local/bin/python3'
|
||||
|
||||
@@ -2,12 +2,15 @@
|
||||
#
|
||||
# $ lcitool variables freebsd-13 qemu
|
||||
#
|
||||
# https://gitlab.com/libvirt/libvirt-ci/-/commit/c7e275ab27ac0dcd09da290817b9adeea1fd1eb1
|
||||
# https://gitlab.com/libvirt/libvirt-ci
|
||||
|
||||
PACKAGING_COMMAND='pkg'
|
||||
CCACHE='/usr/local/bin/ccache'
|
||||
CPAN_PKGS=''
|
||||
CROSS_PKGS=''
|
||||
MAKE='/usr/local/bin/gmake'
|
||||
NINJA='/usr/local/bin/ninja'
|
||||
PYTHON='/usr/local/bin/python3'
|
||||
PACKAGING_COMMAND='pkg'
|
||||
PIP3='/usr/local/bin/pip-3.8'
|
||||
PKGS='alsa-lib bash bzip2 ca_root_nss capstone4 ccache cdrkit-genisoimage ctags curl cyrus-sasl dbus diffutils gettext git glib gmake gnutls gsed gtk3 libepoxy libffi libgcrypt libjpeg-turbo libnfs libspice-server libssh libtasn1 libxml2 llvm lttng-ust lzo2 meson ncurses nettle ninja opencv p5-Test-Harness perl5 pixman pkgconf png py38-numpy py38-pillow py38-pip py38-sphinx py38-sphinx_rtd_theme py38-virtualenv py38-yaml python3 rpm2cpio sdl2 sdl2_image snappy spice-protocol tesseract texinfo usbredir virglrenderer vte3 zstd'
|
||||
PKGS='alsa-lib bash bzip2 ca_root_nss capstone4 ccache cdrkit-genisoimage ctags curl cyrus-sasl dbus diffutils dtc gettext git glib gmake gnutls gsed gtk3 libepoxy libffi libgcrypt libjpeg-turbo libnfs libspice-server libssh libtasn1 libxml2 llvm lttng-ust lzo2 meson ncurses nettle ninja opencv p5-Test-Harness perl5 pixman pkgconf png py38-numpy py38-pillow py38-pip py38-sphinx py38-sphinx_rtd_theme py38-virtualenv py38-yaml python3 rpm2cpio sdl2 sdl2_image snappy spice-protocol tesseract texinfo usbredir virglrenderer vte3 zstd'
|
||||
PYPI_PKGS=''
|
||||
PYTHON='/usr/local/bin/python3'
|
||||
|
||||
@@ -2,14 +2,15 @@
|
||||
#
|
||||
# $ lcitool variables macos-11 qemu
|
||||
#
|
||||
# https://gitlab.com/libvirt/libvirt-ci/-/commit/c7e275ab27ac0dcd09da290817b9adeea1fd1eb1
|
||||
# https://gitlab.com/libvirt/libvirt-ci
|
||||
|
||||
PACKAGING_COMMAND='brew'
|
||||
CCACHE='/usr/local/bin/ccache'
|
||||
CPAN_PKGS='Test::Harness'
|
||||
CROSS_PKGS=''
|
||||
MAKE='/usr/local/bin/gmake'
|
||||
NINJA='/usr/local/bin/ninja'
|
||||
PYTHON='/usr/local/bin/python3'
|
||||
PACKAGING_COMMAND='brew'
|
||||
PIP3='/usr/local/bin/pip3'
|
||||
PKGS='bash bc bzip2 capstone ccache cpanminus ctags curl dbus diffutils gcovr gettext git glib gnu-sed gnutls gtk+3 jemalloc jpeg-turbo libepoxy libffi libgcrypt libiscsi libnfs libpng libslirp libssh libtasn1 libusb libxml2 llvm lzo make meson ncurses nettle ninja perl pixman pkg-config python3 rpm2cpio sdl2 sdl2_image snappy sparse spice-protocol tesseract texinfo usbredir vde vte3 zlib zstd'
|
||||
PKGS='bash bc bzip2 capstone ccache cpanminus ctags curl dbus diffutils dtc gcovr gettext git glib gnu-sed gnutls gtk+3 jemalloc jpeg-turbo libepoxy libffi libgcrypt libiscsi libnfs libpng libslirp libssh libtasn1 libusb libxml2 llvm lzo make meson ncurses nettle ninja perl pixman pkg-config python3 rpm2cpio sdl2 sdl2_image snappy sparse spice-protocol tesseract texinfo usbredir vde vte3 zlib zstd'
|
||||
PYPI_PKGS='PyYAML numpy pillow sphinx sphinx-rtd-theme virtualenv'
|
||||
CPAN_PKGS='Test::Harness'
|
||||
PYTHON='/usr/local/bin/python3'
|
||||
|
||||
@@ -29,11 +29,6 @@ amd64-ubuntu2004-container:
|
||||
variables:
|
||||
NAME: ubuntu2004
|
||||
|
||||
amd64-ubuntu-container:
|
||||
extends: .container_job_template
|
||||
variables:
|
||||
NAME: ubuntu
|
||||
|
||||
amd64-opensuse-leap-container:
|
||||
extends: .container_job_template
|
||||
variables:
|
||||
|
||||
@@ -64,3 +64,6 @@
|
||||
[submodule "roms/vbootrom"]
|
||||
path = roms/vbootrom
|
||||
url = https://gitlab.com/qemu-project/vbootrom.git
|
||||
[submodule "tests/lcitool/libvirt-ci"]
|
||||
path = tests/lcitool/libvirt-ci
|
||||
url = http://gitlab.com/libvirt/libvirt-ci
|
||||
|
||||
@@ -285,6 +285,7 @@ cscope:
|
||||
# Needed by "meson install"
|
||||
export DESTDIR
|
||||
|
||||
include $(SRC_PATH)/tests/lcitool/Makefile.include
|
||||
include $(SRC_PATH)/tests/docker/Makefile.include
|
||||
include $(SRC_PATH)/tests/vm/Makefile.include
|
||||
|
||||
@@ -314,6 +315,7 @@ endif
|
||||
@echo 'Test targets:'
|
||||
$(call print-help,check,Run all tests (check-help for details))
|
||||
$(call print-help,bench,Run all benchmarks)
|
||||
$(call print-help,lcitool-help,Help about targets for managing build environment manifests)
|
||||
$(call print-help,docker-help,Help about targets running tests inside containers)
|
||||
$(call print-help,vm-help,Help about targets running tests inside VM)
|
||||
@echo ''
|
||||
|
||||
@@ -1090,4 +1090,35 @@ HumanReadableText *qmp_x_query_opcount(Error **errp)
|
||||
return human_readable_text_from_str(buf);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PROFILER
|
||||
|
||||
int64_t dev_time;
|
||||
|
||||
HumanReadableText *qmp_x_query_profile(Error **errp)
|
||||
{
|
||||
g_autoptr(GString) buf = g_string_new("");
|
||||
static int64_t last_cpu_exec_time;
|
||||
int64_t cpu_exec_time;
|
||||
int64_t delta;
|
||||
|
||||
cpu_exec_time = tcg_cpu_exec_time();
|
||||
delta = cpu_exec_time - last_cpu_exec_time;
|
||||
|
||||
g_string_append_printf(buf, "async time %" PRId64 " (%0.3f)\n",
|
||||
dev_time, dev_time / (double)NANOSECONDS_PER_SECOND);
|
||||
g_string_append_printf(buf, "qemu time %" PRId64 " (%0.3f)\n",
|
||||
delta, delta / (double)NANOSECONDS_PER_SECOND);
|
||||
last_cpu_exec_time = cpu_exec_time;
|
||||
dev_time = 0;
|
||||
|
||||
return human_readable_text_from_str(buf);
|
||||
}
|
||||
#else
|
||||
HumanReadableText *qmp_x_query_profile(Error **errp)
|
||||
{
|
||||
error_setg(errp, "Internal profiler not compiled");
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !CONFIG_USER_ONLY */
|
||||
|
||||
+10
-4
@@ -151,6 +151,12 @@ If there are two versions of a function to be called with or without a
|
||||
lock held, the function that expects the lock to be already held
|
||||
usually uses the suffix ``_locked``.
|
||||
|
||||
If a function is a shim designed to deal with compatibility
|
||||
workarounds we use the suffix ``_compat``. These are generally not
|
||||
called directly and aliased to the plain function name via the
|
||||
pre-processor. Another common suffix is ``_impl``; it is used for the
|
||||
concrete implementation of a function that will not be called
|
||||
directly, but rather through a macro or an inline function.
|
||||
|
||||
Block structure
|
||||
===============
|
||||
@@ -483,11 +489,11 @@ of arguments.
|
||||
C standard, implementation defined and undefined behaviors
|
||||
==========================================================
|
||||
|
||||
C code in QEMU should be written to the C99 language specification. A copy
|
||||
of the final version of the C99 standard with corrigenda TC1, TC2, and TC3
|
||||
included, formatted as a draft, can be downloaded from:
|
||||
C code in QEMU should be written to the C11 language specification. A
|
||||
copy of the final version of the C11 standard formatted as a draft,
|
||||
can be downloaded from:
|
||||
|
||||
`<http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf>`_
|
||||
`<http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf>`_
|
||||
|
||||
The C language specification defines regions of undefined behavior and
|
||||
implementation defined behavior (to give compiler authors enough leeway to
|
||||
|
||||
+101
-3
@@ -382,14 +382,112 @@ Along with many other images, the ``centos8`` image is defined in a Dockerfile
|
||||
in ``tests/docker/dockerfiles/``, called ``centos8.docker``. ``make docker-help``
|
||||
command will list all the available images.
|
||||
|
||||
To add a new image, simply create a new ``.docker`` file under the
|
||||
``tests/docker/dockerfiles/`` directory.
|
||||
|
||||
A ``.pre`` script can be added beside the ``.docker`` file, which will be
|
||||
executed before building the image under the build context directory. This is
|
||||
mainly used to do necessary host side setup. One such setup is ``binfmt_misc``,
|
||||
for example, to make qemu-user powered cross build containers work.
|
||||
|
||||
Most of the existing Dockerfiles were written by hand, simply by creating a
|
||||
a new ``.docker`` file under the ``tests/docker/dockerfiles/`` directory.
|
||||
This has led to an inconsistent set of packages being present across the
|
||||
different containers.
|
||||
|
||||
Thus going forward, QEMU is aiming to automatically generate the Dockerfiles
|
||||
using the ``lcitool`` program provided by the ``libvirt-ci`` project:
|
||||
|
||||
https://gitlab.com/libvirt/libvirt-ci
|
||||
|
||||
In that project, there is a ``mappings.yml`` file defining the distro native
|
||||
package names for a wide variety of third party projects. This is processed
|
||||
in combination with a project defined list of build pre-requisites to determine
|
||||
the list of native packages to install on each distribution. This can be used
|
||||
to generate dockerfiles, VM package lists and Cirrus CI variables needed to
|
||||
setup build environments across OS distributions with a consistent set of
|
||||
packages present.
|
||||
|
||||
When preparing a patch series that adds a new build pre-requisite to QEMU,
|
||||
updates to various lcitool data files may be required.
|
||||
|
||||
|
||||
Adding new build pre-requisites
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
In the simple case where the pre-requisite is already known to ``libvirt-ci``
|
||||
the following steps are needed
|
||||
|
||||
* Edit ``tests/lcitool/projects/qemu.yml`` and add the pre-requisite
|
||||
|
||||
* Run ``make lcitool-refresh`` to re-generate all relevant build environment
|
||||
manifests
|
||||
|
||||
In some cases ``libvirt-ci`` will not know about the build pre-requisite and
|
||||
thus some extra preparation steps will be required first
|
||||
|
||||
* Fork the ``libvirt-ci`` project on gitlab
|
||||
|
||||
* Edit the ``mappings.yml`` change to add an entry for the new build
|
||||
prerequisite, listing its native package name on as many OS distros
|
||||
as practical.
|
||||
|
||||
* Commit the ``mappings.yml`` change and submit a merge request to
|
||||
the ``libvirt-ci`` project, noting in the description that this
|
||||
is a new build pre-requisite desired for use with QEMU
|
||||
|
||||
* CI pipeline will run to validate that the changes to ``mappings.yml``
|
||||
are correct, by attempting to install the newly listed package on
|
||||
all OS distributions supported by ``libvirt-ci``.
|
||||
|
||||
* Once the merge request is accepted, go back to QEMU and update
|
||||
the ``libvirt-ci`` submodule to point to a commit that contains
|
||||
the ``mappings.yml`` update.
|
||||
|
||||
|
||||
Adding new OS distros
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
In some cases ``libvirt-ci`` will not know about the OS distro that is
|
||||
desired to be tested. Before adding a new OS distro, discuss the proposed
|
||||
addition:
|
||||
|
||||
* Send a mail to qemu-devel, copying people listed in the
|
||||
MAINTAINERS file for ``Build and test automation``.
|
||||
|
||||
There are limited CI compute resources available to QEMU, so the
|
||||
cost/benefit tradeoff of adding new OS distros needs to be considered.
|
||||
|
||||
* File an issue at https://gitlab.com/libvirt/libvirt-ci/-/issues
|
||||
pointing to the qemu-devel mail thread in the archives.
|
||||
|
||||
This alerts other people who might be interested in the work
|
||||
to avoid duplication, as well as to get feedback from libvirt-ci
|
||||
maintainers on any tips to ease the addition
|
||||
|
||||
Assuming there is agreement to add a new OS distro then
|
||||
|
||||
* Fork the ``libvirt-ci`` project on gitlab
|
||||
|
||||
* Add metadata under ``guests/lcitool/lcitool/ansible/group_vars/``
|
||||
for the new OS distro. There might be code changes required if
|
||||
the OS distro uses a package format not currently known. The
|
||||
``libvirt-ci`` maintainers can advise on this when the issue
|
||||
is file.
|
||||
|
||||
* Edit the ``mappings.yml`` change to update all the existing package
|
||||
entries, providing details of the new OS distro
|
||||
|
||||
* Commit the ``mappings.yml`` change and submit a merge request to
|
||||
the ``libvirt-ci`` project, noting in the description that this
|
||||
is a new build pre-requisite desired for use with QEMU
|
||||
|
||||
* CI pipeline will run to validate that the changes to ``mappings.yml``
|
||||
are correct, by attempting to install the newly listed package on
|
||||
all OS distributions supported by ``libvirt-ci``.
|
||||
|
||||
* Once the merge request is accepted, go back to QEMU and update
|
||||
the ``libvirt-ci`` submodule to point to a commit that contains
|
||||
the ``mappings.yml`` update.
|
||||
|
||||
|
||||
Tests
|
||||
~~~~~
|
||||
|
||||
|
||||
@@ -121,6 +121,14 @@ ras
|
||||
Set ``on``/``off`` to enable/disable reporting host memory errors to a guest
|
||||
using ACPI and guest external abort exceptions. The default is off.
|
||||
|
||||
dtb-kaslr-seed
|
||||
Set ``on``/``off`` to pass a random seed via the guest dtb
|
||||
kaslr-seed node (in both "/chosen" and /secure-chosen) to use
|
||||
for features like address space randomisation. The default is
|
||||
``on``. You will want to disable it if your trusted boot chain will
|
||||
verify the DTB it is passed. It would be the responsibility of the
|
||||
firmware to come up with a seed and pass it on if it wants to.
|
||||
|
||||
Linux guest kernel configuration
|
||||
""""""""""""""""""""""""""""""""
|
||||
|
||||
|
||||
@@ -358,6 +358,7 @@ SRST
|
||||
Show host USB devices.
|
||||
ERST
|
||||
|
||||
#if defined(CONFIG_TCG)
|
||||
{
|
||||
.name = "profile",
|
||||
.args_type = "",
|
||||
@@ -365,6 +366,7 @@ ERST
|
||||
.help = "show profiling information",
|
||||
.cmd_info_hrt = qmp_x_query_profile,
|
||||
},
|
||||
#endif
|
||||
|
||||
SRST
|
||||
``info profile``
|
||||
|
||||
+30
-2
@@ -247,11 +247,15 @@ static void create_fdt(VirtMachineState *vms)
|
||||
|
||||
/* /chosen must exist for load_dtb to fill in necessary properties later */
|
||||
qemu_fdt_add_subnode(fdt, "/chosen");
|
||||
create_kaslr_seed(ms, "/chosen");
|
||||
if (vms->dtb_kaslr_seed) {
|
||||
create_kaslr_seed(ms, "/chosen");
|
||||
}
|
||||
|
||||
if (vms->secure) {
|
||||
qemu_fdt_add_subnode(fdt, "/secure-chosen");
|
||||
create_kaslr_seed(ms, "/secure-chosen");
|
||||
if (vms->dtb_kaslr_seed) {
|
||||
create_kaslr_seed(ms, "/secure-chosen");
|
||||
}
|
||||
}
|
||||
|
||||
/* Clock node, for the benefit of the UART. The kernel device tree
|
||||
@@ -2235,6 +2239,20 @@ static void virt_set_its(Object *obj, bool value, Error **errp)
|
||||
vms->its = value;
|
||||
}
|
||||
|
||||
static bool virt_get_dtb_kaslr_seed(Object *obj, Error **errp)
|
||||
{
|
||||
VirtMachineState *vms = VIRT_MACHINE(obj);
|
||||
|
||||
return vms->dtb_kaslr_seed;
|
||||
}
|
||||
|
||||
static void virt_set_dtb_kaslr_seed(Object *obj, bool value, Error **errp)
|
||||
{
|
||||
VirtMachineState *vms = VIRT_MACHINE(obj);
|
||||
|
||||
vms->dtb_kaslr_seed = value;
|
||||
}
|
||||
|
||||
static char *virt_get_oem_id(Object *obj, Error **errp)
|
||||
{
|
||||
VirtMachineState *vms = VIRT_MACHINE(obj);
|
||||
@@ -2764,6 +2782,13 @@ static void virt_machine_class_init(ObjectClass *oc, void *data)
|
||||
"Set on/off to enable/disable "
|
||||
"ITS instantiation");
|
||||
|
||||
object_class_property_add_bool(oc, "dtb-kaslr-seed",
|
||||
virt_get_dtb_kaslr_seed,
|
||||
virt_set_dtb_kaslr_seed);
|
||||
object_class_property_set_description(oc, "dtb-kaslr-seed",
|
||||
"Set off to disable passing of kaslr-seed "
|
||||
"dtb node to guest");
|
||||
|
||||
object_class_property_add_str(oc, "x-oem-id",
|
||||
virt_get_oem_id,
|
||||
virt_set_oem_id);
|
||||
@@ -2828,6 +2853,9 @@ static void virt_instance_init(Object *obj)
|
||||
/* MTE is disabled by default. */
|
||||
vms->mte = false;
|
||||
|
||||
/* Supply a kaslr-seed by default */
|
||||
vms->dtb_kaslr_seed = true;
|
||||
|
||||
vms->irqmap = a15irqmap;
|
||||
|
||||
virt_flash_create(vms);
|
||||
|
||||
+13
-1
@@ -517,13 +517,20 @@ static int qxl_track_command(PCIQXLDevice *qxl, struct QXLCommandExt *ext)
|
||||
|
||||
/* spice display interface callbacks */
|
||||
|
||||
static void interface_attach_worker(QXLInstance *sin, QXLWorker *qxl_worker)
|
||||
static void interface_attached_worker(QXLInstance *sin)
|
||||
{
|
||||
PCIQXLDevice *qxl = container_of(sin, PCIQXLDevice, ssd.qxl);
|
||||
|
||||
trace_qxl_interface_attach_worker(qxl->id);
|
||||
}
|
||||
|
||||
#if !(SPICE_HAS_ATTACHED_WORKER)
|
||||
static void interface_attach_worker(QXLInstance *sin, QXLWorker *qxl_worker)
|
||||
{
|
||||
interface_attached_worker(sin);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void interface_set_compression_level(QXLInstance *sin, int level)
|
||||
{
|
||||
PCIQXLDevice *qxl = container_of(sin, PCIQXLDevice, ssd.qxl);
|
||||
@@ -1131,7 +1138,12 @@ static const QXLInterface qxl_interface = {
|
||||
.base.major_version = SPICE_INTERFACE_QXL_MAJOR,
|
||||
.base.minor_version = SPICE_INTERFACE_QXL_MINOR,
|
||||
|
||||
#if SPICE_HAS_ATTACHED_WORKER
|
||||
.attached_worker = interface_attached_worker,
|
||||
#else
|
||||
.attache_worker = interface_attach_worker,
|
||||
#endif
|
||||
|
||||
.set_compression_level = interface_set_compression_level,
|
||||
#if SPICE_NEEDS_SET_MM_TIME
|
||||
.set_mm_time = interface_set_mm_time,
|
||||
|
||||
@@ -46,9 +46,9 @@
|
||||
* int g_foo(const char *wibble)
|
||||
*
|
||||
* We must define a static inline function with the same signature that does
|
||||
* what we need, but with a "_qemu" suffix e.g.
|
||||
* what we need, but with a "_compat" suffix e.g.
|
||||
*
|
||||
* static inline void g_foo_qemu(const char *wibble)
|
||||
* static inline void g_foo_compat(const char *wibble)
|
||||
* {
|
||||
* #if GLIB_CHECK_VERSION(X, Y, 0)
|
||||
* g_foo(wibble)
|
||||
@@ -61,7 +61,7 @@
|
||||
* ensuring this wrapper function impl doesn't trigger the compiler warning
|
||||
* about using too new glib APIs. Finally we can do
|
||||
*
|
||||
* #define g_foo(a) g_foo_qemu(a)
|
||||
* #define g_foo(a) g_foo_compat(a)
|
||||
*
|
||||
* So now the code elsewhere in QEMU, which *does* have the
|
||||
* -Wdeprecated-declarations warning active, can call g_foo(...) as normal,
|
||||
|
||||
@@ -148,6 +148,7 @@ struct VirtMachineState {
|
||||
bool virt;
|
||||
bool ras;
|
||||
bool mte;
|
||||
bool dtb_kaslr_seed;
|
||||
OnOffAuto acpi;
|
||||
VirtGICType gic_version;
|
||||
VirtIOMMUType iommu;
|
||||
|
||||
@@ -40,6 +40,12 @@ int qemu_spice_migrate_info(const char *hostname, int port, int tls_port,
|
||||
#define SPICE_NEEDS_SET_MM_TIME 0
|
||||
#endif
|
||||
|
||||
#if defined(SPICE_SERVER_VERSION) && (SPICE_SERVER_VERSION >= 0x000f00)
|
||||
#define SPICE_HAS_ATTACHED_WORKER 1
|
||||
#else
|
||||
#define SPICE_HAS_ATTACHED_WORKER 0
|
||||
#endif
|
||||
|
||||
#else /* CONFIG_SPICE */
|
||||
|
||||
#include "qemu/error-report.h"
|
||||
|
||||
@@ -5,7 +5,18 @@
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
|
||||
#include <SDL.h>
|
||||
|
||||
/* with Alpine / muslc SDL headers pull in directfb headers
|
||||
* which in turn trigger warning about redundant decls for
|
||||
* direct_waitqueue_deinit.
|
||||
*/
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wredundant-decls"
|
||||
|
||||
#include <SDL_syswm.h>
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
#ifdef CONFIG_SDL_IMAGE
|
||||
# include <SDL_image.h>
|
||||
#endif
|
||||
|
||||
+29
-6
@@ -2267,6 +2267,9 @@ static void pgb_have_guest_base(const char *image_name, abi_ulong guest_loaddr,
|
||||
if (test != addr) {
|
||||
pgb_fail_in_use(image_name);
|
||||
}
|
||||
qemu_log_mask(CPU_LOG_PAGE,
|
||||
"%s: base @ %p for " TARGET_ABI_FMT_ld " bytes\n",
|
||||
__func__, addr, guest_hiaddr - guest_loaddr);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2309,6 +2312,9 @@ static uintptr_t pgd_find_hole_fallback(uintptr_t guest_size, uintptr_t brk,
|
||||
if (mmap_start != MAP_FAILED) {
|
||||
munmap(mmap_start, guest_size);
|
||||
if (mmap_start == (void *) align_start) {
|
||||
qemu_log_mask(CPU_LOG_PAGE,
|
||||
"%s: base @ %p for %" PRIdPTR" bytes\n",
|
||||
__func__, mmap_start + offset, guest_size);
|
||||
return (uintptr_t) mmap_start + offset;
|
||||
}
|
||||
}
|
||||
@@ -2333,8 +2339,7 @@ static uintptr_t pgb_find_hole(uintptr_t guest_loaddr, uintptr_t guest_size,
|
||||
brk = (uintptr_t)sbrk(0);
|
||||
|
||||
if (!maps) {
|
||||
ret = pgd_find_hole_fallback(guest_size, brk, align, offset);
|
||||
return ret == -1 ? -1 : ret - guest_loaddr;
|
||||
return pgd_find_hole_fallback(guest_size, brk, align, offset);
|
||||
}
|
||||
|
||||
/* The first hole is before the first map entry. */
|
||||
@@ -2374,7 +2379,7 @@ static uintptr_t pgb_find_hole(uintptr_t guest_loaddr, uintptr_t guest_size,
|
||||
|
||||
/* Record the lowest successful match. */
|
||||
if (ret < 0) {
|
||||
ret = align_start - guest_loaddr;
|
||||
ret = align_start;
|
||||
}
|
||||
/* If this hole contains the identity map, select it. */
|
||||
if (align_start <= guest_loaddr &&
|
||||
@@ -2388,6 +2393,12 @@ static uintptr_t pgb_find_hole(uintptr_t guest_loaddr, uintptr_t guest_size,
|
||||
}
|
||||
free_self_maps(maps);
|
||||
|
||||
if (ret != -1) {
|
||||
qemu_log_mask(CPU_LOG_PAGE, "%s: base @ %" PRIxPTR
|
||||
" for %" PRIuPTR " bytes\n",
|
||||
__func__, ret, guest_size);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -2439,6 +2450,9 @@ static void pgb_static(const char *image_name, abi_ulong orig_loaddr,
|
||||
}
|
||||
|
||||
guest_base = addr;
|
||||
|
||||
qemu_log_mask(CPU_LOG_PAGE, "%s: base @ %"PRIxPTR" for %" PRIuPTR" bytes\n",
|
||||
__func__, addr, hiaddr - loaddr);
|
||||
}
|
||||
|
||||
static void pgb_dynamic(const char *image_name, long align)
|
||||
@@ -2495,6 +2509,9 @@ static void pgb_reserved_va(const char *image_name, abi_ulong guest_loaddr,
|
||||
"using -R option)", reserved_va, test, strerror(errno));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
qemu_log_mask(CPU_LOG_PAGE, "%s: base @ %p for %lu bytes\n",
|
||||
__func__, addr, reserved_va);
|
||||
}
|
||||
|
||||
void probe_guest_base(const char *image_name, abi_ulong guest_loaddr,
|
||||
@@ -2783,11 +2800,17 @@ static void load_elf_image(const char *image_name, int image_fd,
|
||||
* and the stack, lest they be placed immediately after
|
||||
* the data segment and block allocation from the brk.
|
||||
*
|
||||
* 16MB is chosen as "large enough" without being so large
|
||||
* as to allow the result to not fit with a 32-bit guest on
|
||||
* a 32-bit host.
|
||||
* 16MB is chosen as "large enough" without being so large as
|
||||
* to allow the result to not fit with a 32-bit guest on a
|
||||
* 32-bit host. However some 64 bit guests (e.g. s390x)
|
||||
* attempt to place their heap further ahead and currently
|
||||
* nothing stops them smashing into QEMUs address space.
|
||||
*/
|
||||
#if TARGET_LONG_BITS == 64
|
||||
info->reserve_brk = 32 * MiB;
|
||||
#else
|
||||
info->reserve_brk = 16 * MiB;
|
||||
#endif
|
||||
hiaddr += info->reserve_brk;
|
||||
|
||||
if (ehdr->e_type == ET_EXEC) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user