Merge remote-tracking branch 'remotes/dgilbert-gitlab/tags/pull-migration-20210726a' into staging
Migration fixes 2021-07-26
Peter's fix for a bunch of races
-> Seem to fix the occasional crash seen by Peter
Wei's fix for migration with free page hinting
-> Bug has been around for a while, but makes a huge difference
My fix for OpenBSD test corner case
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
# gpg: Signature made Mon 26 Jul 2021 13:42:16 BST
# gpg: using RSA key 45F5C71B4A0CB7FB977A9FA90516331EBC5BFDE7
# gpg: Good signature from "Dr. David Alan Gilbert (RH2) <dgilbert@redhat.com>" [full]
# Primary key fingerprint: 45F5 C71B 4A0C B7FB 977A 9FA9 0516 331E BC5B FDE7
* remotes/dgilbert-gitlab/tags/pull-migration-20210726a:
migration: clear the memory region dirty bitmap when skipping free pages
migration: Move the yank unregister of channel_close out
migration: Teach QEMUFile to be QIOChannel-aware
migration: Introduce migration_ioc_[un]register_yank()
migration: Make from_dst_file accesses thread-safe
migration: Fix missing join() of rp_thread
tests/qtest/migration-test.c: use 127.0.0.1 instead of 0
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
diff --git a/.gitignore b/.gitignore
index 75a4be0..eb25530 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,5 @@
*~
*.ast_raw
*.depend_raw
+*.swp
+*.patch
diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml
index 80b57b7..ee0c83b 100644
--- a/.gitlab-ci.d/buildtest.yml
+++ b/.gitlab-ci.d/buildtest.yml
@@ -354,6 +354,17 @@
TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
MAKE_CHECK_ARGS: check-tcg
+# We build tricore in a very minimal tricore only container
+build-tricore-softmmu:
+ extends: .native_build_job_template
+ needs:
+ job: tricore-debian-cross-container
+ variables:
+ IMAGE: debian-tricore-cross
+ CONFIGURE_ARGS: --disable-tools --disable-fdt --enable-debug
+ TARGETS: tricore-softmmu
+ MAKE_CHECK_ARGS: check-tcg
+
clang-system:
extends: .native_build_job_template
needs:
diff --git a/.gitlab-ci.d/cirrus.yml b/.gitlab-ci.d/cirrus.yml
index 60b13ed..675db69 100644
--- a/.gitlab-ci.d/cirrus.yml
+++ b/.gitlab-ci.d/cirrus.yml
@@ -85,18 +85,3 @@
PATH_EXTRA: /usr/local/opt/ccache/libexec:/usr/local/opt/gettext/bin
PKG_CONFIG_PATH: /usr/local/opt/curl/lib/pkgconfig:/usr/local/opt/ncurses/lib/pkgconfig:/usr/local/opt/readline/lib/pkgconfig
TEST_TARGETS: check-unit check-block check-qapi-schema check-softfloat check-qtest-x86_64
-
-x64-macos-11-xcode-build:
- extends: .cirrus_build_job
- variables:
- NAME: macos-11
- CIRRUS_VM_INSTANCE_TYPE: osx_instance
- CIRRUS_VM_IMAGE_SELECTOR: image
- CIRRUS_VM_IMAGE_NAME: big-sur-xcode
- CIRRUS_VM_CPUS: 12
- CIRRUS_VM_RAM: 24G
- UPDATE_COMMAND: brew update
- INSTALL_COMMAND: brew install
- PATH_EXTRA: /usr/local/opt/ccache/libexec:/usr/local/opt/gettext/bin
- PKG_CONFIG_PATH: /usr/local/opt/curl/lib/pkgconfig:/usr/local/opt/ncurses/lib/pkgconfig:/usr/local/opt/readline/lib/pkgconfig
- TEST_TARGETS: check-unit check-block check-qapi-schema check-softfloat check-qtest-x86_64
diff --git a/.gitlab-ci.d/opensbi.yml b/.gitlab-ci.d/opensbi.yml
index f66cd1d..d8a0456 100644
--- a/.gitlab-ci.d/opensbi.yml
+++ b/.gitlab-ci.d/opensbi.yml
@@ -1,10 +1,23 @@
-docker-opensbi:
- stage: containers
- rules: # Only run this job when the Dockerfile is modified
+# All jobs needing docker-opensbi must use the same rules it uses.
+.opensbi_job_rules:
+ rules: # Only run this job when ...
- changes:
+ # this file is modified
- .gitlab-ci.d/opensbi.yml
+ # or the Dockerfile is modified
- .gitlab-ci.d/opensbi/Dockerfile
when: always
+ - changes: # or roms/opensbi/ is modified (submodule updated)
+ - roms/opensbi/*
+ when: always
+ - if: '$CI_COMMIT_REF_NAME =~ /^opensbi/' # or the branch/tag starts with 'opensbi'
+ when: always
+ - if: '$CI_COMMIT_MESSAGE =~ /opensbi/i' # or last commit description contains 'OpenSBI'
+ when: always
+
+docker-opensbi:
+ extends: .opensbi_job_rules
+ stage: containers
image: docker:19.03.1
services:
- docker:19.03.1-dind
@@ -24,16 +37,9 @@
- docker push $IMAGE_TAG
build-opensbi:
+ extends: .opensbi_job_rules
stage: build
needs: ['docker-opensbi']
- rules: # Only run this job when ...
- - changes: # ... roms/opensbi/ is modified (submodule updated)
- - roms/opensbi/*
- when: always
- - if: '$CI_COMMIT_REF_NAME =~ /^opensbi/' # or the branch/tag starts with 'opensbi'
- when: always
- - if: '$CI_COMMIT_MESSAGE =~ /opensbi/i' # or last commit description contains 'OpenSBI'
- when: always
artifacts:
paths: # 'artifacts.zip' will contains the following files:
- pc-bios/opensbi-riscv32-generic-fw_dynamic.bin
diff --git a/.mailmap b/.mailmap
index a1bd659..082ff89 100644
--- a/.mailmap
+++ b/.mailmap
@@ -27,6 +27,10 @@
Thiemo Seufer <ths@networkno.de> ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>
malc <av1474@comtv.ru> malc <malc@c046a42c-6fe2-441c-8c8c-71466251a162>
+# Corrupted Author fields
+Marek Dolata <mkdolata@us.ibm.com> mkdolata@us.ibm.com <mkdolata@us.ibm.com>
+Nick Hudson <hnick@vmware.com> hnick@vmware.com <hnick@vmware.com>
+
# There is also a:
# (no author) <(no author)@c046a42c-6fe2-441c-8c8c-71466251a162>
# for the cvs2svn initialization commit e63c3dc74bf.
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index fc895cf..e5c0ccd 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -834,7 +834,7 @@
/* Ensure global icount has gone forward */
icount_update(cpu);
/* Refill decrementer and continue execution. */
- insns_left = MIN(CF_COUNT_MASK, cpu->icount_budget);
+ insns_left = MIN(0xffff, cpu->icount_budget);
cpu_neg(cpu)->icount_decr.u16.low = insns_left;
cpu->icount_extra = cpu->icount_budget - insns_left;
@@ -843,7 +843,9 @@
* execute we need to ensure we find/generate a TB with exactly
* insns_left instructions in it.
*/
- if (!cpu->icount_extra && insns_left > 0 && insns_left < tb->icount) {
+ if (insns_left > 0 && insns_left < tb->icount) {
+ assert(insns_left <= CF_COUNT_MASK);
+ assert(cpu->icount_extra == 0);
cpu->cflags_next_tb = (tb->cflags & ~CF_COUNT_MASK) | insns_left;
}
#endif
@@ -853,7 +855,6 @@
int cpu_exec(CPUState *cpu)
{
- CPUClass *cc = CPU_GET_CLASS(cpu);
int ret;
SyncClocks sc = { 0 };
@@ -887,19 +888,14 @@
* that we support, but is still unfixed in clang:
* https://bugs.llvm.org/show_bug.cgi?id=21183
*
- * Reload essential local variables here for those compilers.
+ * Reload an essential local variable here for those compilers.
* Newer versions of gcc would complain about this code (-Wclobbered),
* so we only perform the workaround for clang.
*/
cpu = current_cpu;
- cc = CPU_GET_CLASS(cpu);
#else
- /*
- * Non-buggy compilers preserve these locals; assert that
- * they have the correct value.
- */
+ /* Non-buggy compilers preserve this; assert the correct value. */
g_assert(cpu == current_cpu);
- g_assert(cc == CPU_GET_CLASS(cpu));
#endif
#ifndef CONFIG_SOFTMMU
diff --git a/block/nvme.c b/block/nvme.c
index 2b5421e..e8dbbc2 100644
--- a/block/nvme.c
+++ b/block/nvme.c
@@ -1030,7 +1030,29 @@
r = qemu_vfio_dma_map(s->vfio,
qiov->iov[i].iov_base,
len, true, &iova);
+ if (r == -ENOSPC) {
+ /*
+ * In addition to the -ENOMEM error, the VFIO_IOMMU_MAP_DMA
+ * ioctl returns -ENOSPC to signal the user exhausted the DMA
+ * mappings available for a container since Linux kernel commit
+ * 492855939bdb ("vfio/type1: Limit DMA mappings per container",
+ * April 2019, see CVE-2019-3882).
+ *
+ * This block driver already handles this error path by checking
+ * for the -ENOMEM error, so we directly replace -ENOSPC by
+ * -ENOMEM. Beside, -ENOSPC has a specific meaning for blockdev
+ * coroutines: it triggers BLOCKDEV_ON_ERROR_ENOSPC and
+ * BLOCK_ERROR_ACTION_STOP which stops the VM, asking the operator
+ * to add more storage to the blockdev. Not something we can do
+ * easily with an IOMMU :)
+ */
+ r = -ENOMEM;
+ }
if (r == -ENOMEM && retry) {
+ /*
+ * We exhausted the DMA mappings available for our container:
+ * recycle the volatile IOVA mappings.
+ */
retry = false;
trace_nvme_dma_flush_queue_wait(s);
if (s->dma_map_count) {
diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c
index 7d986e9..3f44311 100644
--- a/bsd-user/syscall.c
+++ b/bsd-user/syscall.c
@@ -335,7 +335,7 @@
_mcleanup();
#endif
gdb_exit(arg1);
- qemu_plugin_atexit_cb();
+ qemu_plugin_user_exit();
/* XXX: should free thread stack and CPU env */
_exit(arg1);
ret = 0; /* avoid warning */
@@ -437,7 +437,7 @@
_mcleanup();
#endif
gdb_exit(arg1);
- qemu_plugin_atexit_cb();
+ qemu_plugin_user_exit();
/* XXX: should free thread stack and CPU env */
_exit(arg1);
ret = 0; /* avoid warning */
@@ -516,7 +516,7 @@
_mcleanup();
#endif
gdb_exit(arg1);
- qemu_plugin_atexit_cb();
+ qemu_plugin_user_exit();
/* XXX: should free thread stack and CPU env */
_exit(arg1);
ret = 0; /* avoid warning */
diff --git a/configure b/configure
index 0005cd1..69cef68 100755
--- a/configure
+++ b/configure
@@ -5103,12 +5103,10 @@
echo "[properties]" >> $cross
# unroll any custom device configs
- if test -n "$device_archs"; then
- for a in $device_archs; do
- eval "c=\$devices_${a}"
- echo "${a}-softmmu = '$c'" >> $cross
- done
- fi
+ for a in $device_archs; do
+ eval "c=\$devices_${a}"
+ echo "${a}-softmmu = '$c'" >> $cross
+ done
test -z "$cxx" && echo "link_language = 'c'" >> $cross
echo "[built-in options]" >> $cross
diff --git a/contrib/gitdm/aliases b/contrib/gitdm/aliases
index c1e7443..4792413 100644
--- a/contrib/gitdm/aliases
+++ b/contrib/gitdm/aliases
@@ -31,6 +31,12 @@
ths@c046a42c-6fe2-441c-8c8c-71466251a162 ths@networkno.de
malc@c046a42c-6fe2-441c-8c8c-71466251a162 av1474@comtv.ru
+# canonical emails
+liq3ea@163.com liq3ea@gmail.com
+
+# some broken tags
+yuval.shaia.ml.gmail.com yuval.shaia.ml@gmail.com
+
# There is also a:
# (no author) <(no author)@c046a42c-6fe2-441c-8c8c-71466251a162>
# for the cvs2svn initialization commit e63c3dc74bf.
diff --git a/contrib/gitdm/domain-map b/contrib/gitdm/domain-map
index 0074da6..2800d9f 100644
--- a/contrib/gitdm/domain-map
+++ b/contrib/gitdm/domain-map
@@ -9,6 +9,8 @@
bytedance.com ByteDance
cmss.chinamobile.com China Mobile
citrix.com Citrix
+crudebyte.com Crudebyte
+eldorado.org.br Instituto de Pesquisas Eldorado
fujitsu.com Fujitsu
google.com Google
greensocs.com GreenSocs
@@ -17,20 +19,25 @@
igalia.com Igalia
intel.com Intel
linaro.org Linaro
+lwn.net LWN
microsoft.com Microsoft
+mvista.com MontaVista
nokia.com Nokia
nuviainc.com NUVIA
+nvidia.com NVIDIA
oracle.com Oracle
proxmox.com Proxmox
quicinc.com Qualcomm Innovation Center
redhat.com Red Hat
rt-rk.com RT-RK
+samsung.com Samsung
siemens.com Siemens
sifive.com SiFive
suse.com SUSE
suse.de SUSE
virtuozzo.com Virtuozzo
wdc.com Western Digital
+windriver.com Wind River
xilinx.com Xilinx
yadro.com YADRO
yandex-team.ru Yandex
diff --git a/contrib/gitdm/group-map-academics b/contrib/gitdm/group-map-academics
index bf3c894..44745ca 100644
--- a/contrib/gitdm/group-map-academics
+++ b/contrib/gitdm/group-map-academics
@@ -16,3 +16,6 @@
uni-paderborn.de
edu
edu.cn
+
+# Boston University
+bu.edu
diff --git a/contrib/gitdm/group-map-individuals b/contrib/gitdm/group-map-individuals
index 36bbb77..f816aa8 100644
--- a/contrib/gitdm/group-map-individuals
+++ b/contrib/gitdm/group-map-individuals
@@ -29,3 +29,8 @@
huth@tuxfamily.org
jhogan@kernel.org
atar4qemu@gmail.com
+minwoo.im.dev@gmail.com
+bmeng.cn@gmail.com
+liq3ea@gmail.com
+chetan4windows@gmail.com
+akihiko.odaki@gmail.com
diff --git a/contrib/gitdm/group-map-interns b/contrib/gitdm/group-map-interns
new file mode 100644
index 0000000..fe33a32
--- /dev/null
+++ b/contrib/gitdm/group-map-interns
@@ -0,0 +1,13 @@
+#
+# Group together everyone working as an intern via one of the various
+# outreach programs.
+#
+
+# GSoC 2020 Virtual FIDO/U2F security key
+cesar.belley@lse.epita.fr
+
+# GSoC 2020 TCG performance
+ahmedkhaledkaraman@gmail.com
+
+# GSoC 2021 TCG plugins
+ma.mandourr@gmail.com
diff --git a/contrib/gitdm/group-map-netflix b/contrib/gitdm/group-map-netflix
new file mode 100644
index 0000000..468f95d
--- /dev/null
+++ b/contrib/gitdm/group-map-netflix
@@ -0,0 +1,5 @@
+#
+# Netflix contributors using their personal emails
+#
+
+imp@bsdimp.com
diff --git a/contrib/gitdm/group-map-robots b/contrib/gitdm/group-map-robots
new file mode 100644
index 0000000..ffd956c
--- /dev/null
+++ b/contrib/gitdm/group-map-robots
@@ -0,0 +1,7 @@
+#
+# There are various automatic robots that occasionally scan and report
+# bugs. Let's group them together here.
+#
+
+# Euler Robot
+euler.robot@huawei.com
diff --git a/contrib/plugins/cache.c b/contrib/plugins/cache.c
index bf0d2f6..066ea6d 100644
--- a/contrib/plugins/cache.c
+++ b/contrib/plugins/cache.c
@@ -200,7 +200,7 @@
{
int i;
- for (i = 0; i < cache->assoc; i++) {
+ for (i = 0; i < cache->num_sets; i++) {
g_queue_free(cache->sets[i].fifo_queue);
}
}
@@ -355,15 +355,14 @@
struct qemu_plugin_hwaddr *hwaddr;
InsnData *insn;
- g_mutex_lock(&mtx);
hwaddr = qemu_plugin_get_hwaddr(info, vaddr);
if (hwaddr && qemu_plugin_hwaddr_is_io(hwaddr)) {
- g_mutex_unlock(&mtx);
return;
}
effective_addr = hwaddr ? qemu_plugin_hwaddr_phys_addr(hwaddr) : vaddr;
+ g_mutex_lock(&mtx);
if (!access_cache(dcache, effective_addr)) {
insn = (InsnData *) userdata;
insn->dmisses++;
@@ -470,7 +469,7 @@
return insn_a->imisses < insn_b->imisses ? 1 : -1;
}
-static void log_stats()
+static void log_stats(void)
{
g_autoptr(GString) rep = g_string_new("");
g_string_append_printf(rep,
@@ -488,7 +487,7 @@
qemu_plugin_outs(rep->str);
}
-static void log_top_insns()
+static void log_top_insns(void)
{
int i;
GList *curr, *miss_insns;
@@ -537,7 +536,7 @@
g_hash_table_destroy(miss_ht);
}
-static void policy_init()
+static void policy_init(void)
{
switch (policy) {
case LRU:
diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst
index d6085f7..7fc6935 100644
--- a/docs/interop/vhost-user.rst
+++ b/docs/interop/vhost-user.rst
@@ -1,3 +1,5 @@
+.. _vhost_user_proto:
+
===================
Vhost-user Protocol
===================
diff --git a/docs/system/device-emulation.rst b/docs/system/device-emulation.rst
new file mode 100644
index 0000000..7afcfd8
--- /dev/null
+++ b/docs/system/device-emulation.rst
@@ -0,0 +1,90 @@
+.. _device-emulation:
+
+Device Emulation
+----------------
+
+QEMU supports the emulation of a large number of devices from
+peripherals such network cards and USB devices to integrated systems
+on a chip (SoCs). Configuration of these is often a source of
+confusion so it helps to have an understanding of some of the terms
+used to describes devices within QEMU.
+
+Common Terms
+~~~~~~~~~~~~
+
+Device Front End
+================
+
+A device front end is how a device is presented to the guest. The type
+of device presented should match the hardware that the guest operating
+system is expecting to see. All devices can be specified with the
+``--device`` command line option. Running QEMU with the command line
+options ``--device help`` will list all devices it is aware of. Using
+the command line ``--device foo,help`` will list the additional
+configuration options available for that device.
+
+A front end is often paired with a back end, which describes how the
+host's resources are used in the emulation.
+
+Device Buses
+============
+
+Most devices will exist on a BUS of some sort. Depending on the
+machine model you choose (``-M foo``) a number of buses will have been
+automatically created. In most cases the BUS a device is attached to
+can be inferred, for example PCI devices are generally automatically
+allocated to the next free address of first PCI bus found. However in
+complicated configurations you can explicitly specify what bus
+(``bus=ID``) a device is attached to along with its address
+(``addr=N``).
+
+Some devices, for example a PCI SCSI host controller, will add an
+additional buses to the system that other devices can be attached to.
+A hypothetical chain of devices might look like:
+
+ --device foo,bus=pci.0,addr=0,id=foo
+ --device bar,bus=foo.0,addr=1,id=baz
+
+which would be a bar device (with the ID of baz) which is attached to
+the first foo bus (foo.0) at address 1. The foo device which provides
+that bus is itself is attached to the first PCI bus (pci.0).
+
+
+Device Back End
+===============
+
+The back end describes how the data from the emulated device will be
+processed by QEMU. The configuration of the back end is usually
+specific to the class of device being emulated. For example serial
+devices will be backed by a ``--chardev`` which can redirect the data
+to a file or socket or some other system. Storage devices are handled
+by ``--blockdev`` which will specify how blocks are handled, for
+example being stored in a qcow2 file or accessing a raw host disk
+partition. Back ends can sometimes be stacked to implement features
+like snapshots.
+
+While the choice of back end is generally transparent to the guest,
+there are cases where features will not be reported to the guest if
+the back end is unable to support it.
+
+Device Pass Through
+===================
+
+Device pass through is where the device is actually given access to
+the underlying hardware. This can be as simple as exposing a single
+USB device on the host system to the guest or dedicating a video card
+in a PCI slot to the exclusive use of the guest.
+
+
+Emulated Devices
+~~~~~~~~~~~~~~~~
+
+.. toctree::
+ :maxdepth: 1
+
+ devices/ivshmem.rst
+ devices/net.rst
+ devices/nvme.rst
+ devices/usb.rst
+ devices/vhost-user.rst
+ devices/virtio-pmem.rst
diff --git a/docs/system/ivshmem.rst b/docs/system/devices/ivshmem.rst
similarity index 100%
rename from docs/system/ivshmem.rst
rename to docs/system/devices/ivshmem.rst
diff --git a/docs/system/net.rst b/docs/system/devices/net.rst
similarity index 100%
rename from docs/system/net.rst
rename to docs/system/devices/net.rst
diff --git a/docs/system/nvme.rst b/docs/system/devices/nvme.rst
similarity index 100%
rename from docs/system/nvme.rst
rename to docs/system/devices/nvme.rst
diff --git a/docs/system/usb.rst b/docs/system/devices/usb.rst
similarity index 100%
rename from docs/system/usb.rst
rename to docs/system/devices/usb.rst
diff --git a/docs/system/devices/vhost-user.rst b/docs/system/devices/vhost-user.rst
new file mode 100644
index 0000000..8612811
--- /dev/null
+++ b/docs/system/devices/vhost-user.rst
@@ -0,0 +1,59 @@
+.. _vhost_user:
+
+vhost-user back ends
+--------------------
+
+vhost-user back ends are way to service the request of VirtIO devices
+outside of QEMU itself. To do this there are a number of things
+required.
+
+vhost-user device
+===================
+
+These are simple stub devices that ensure the VirtIO device is visible
+to the guest. The code is mostly boilerplate although each device has
+a ``chardev`` option which specifies the ID of the ``--chardev``
+device that connects via a socket to the vhost-user *daemon*.
+
+vhost-user daemon
+=================
+
+This is a separate process that is connected to by QEMU via a socket
+following the :ref:`vhost_user_proto`. There are a number of daemons
+that can be built when enabled by the project although any daemon that
+meets the specification for a given device can be used.
+
+Shared memory object
+====================
+
+In order for the daemon to access the VirtIO queues to process the
+requests it needs access to the guest's address space. This is
+achieved via the ``memory-backend-file`` or ``memory-backend-memfd``
+objects. A reference to a file-descriptor which can access this object
+will be passed via the socket as part of the protocol negotiation.
+
+Currently the shared memory object needs to match the size of the main
+system memory as defined by the ``-m`` argument.
+
+Example
+=======
+
+First start you daemon.
+
+.. parsed-literal::
+
+ $ virtio-foo --socket-path=/var/run/foo.sock $OTHER_ARGS
+
+The you start your QEMU instance specifying the device, chardev and
+memory objects.
+
+.. parsed-literal::
+
+ $ |qemu_system| \\
+ -m 4096 \\
+ -chardev socket,id=ba1,path=/var/run/foo.sock \\
+ -device vhost-user-foo,chardev=ba1,$OTHER_ARGS \\
+ -object memory-backend-memfd,id=mem,size=4G,share=on \\
+ -numa node,memdev=mem \\
+ ...
+
diff --git a/docs/system/virtio-pmem.rst b/docs/system/devices/virtio-pmem.rst
similarity index 100%
rename from docs/system/virtio-pmem.rst
rename to docs/system/devices/virtio-pmem.rst
diff --git a/docs/system/index.rst b/docs/system/index.rst
index fda4b1b..64a424a 100644
--- a/docs/system/index.rst
+++ b/docs/system/index.rst
@@ -11,15 +11,12 @@
quickstart
invocation
+ device-emulation
keys
mux-chardev
monitor
images
- net
virtio-net-failover
- usb
- nvme
- ivshmem
linuxboot
generic-loader
guest-loader
@@ -30,7 +27,6 @@
gdb
managed-startup
cpu-hotplug
- virtio-pmem
pr-manager
targets
security
diff --git a/gitdm.config b/gitdm.config
index c01c219..288b100 100644
--- a/gitdm.config
+++ b/gitdm.config
@@ -28,20 +28,25 @@
#
# Use GroupMap to map a file full of addresses to the
# same employer. This is used for people that don't post from easily
-# identifiable corporate emails.
+# identifiable corporate emails. Please keep this list sorted.
#
-GroupMap contrib/gitdm/group-map-redhat Red Hat
-GroupMap contrib/gitdm/group-map-wavecomp Wave Computing
GroupMap contrib/gitdm/group-map-cadence Cadence Design Systems
GroupMap contrib/gitdm/group-map-codeweavers CodeWeavers
GroupMap contrib/gitdm/group-map-ibm IBM
GroupMap contrib/gitdm/group-map-janustech Janus Technologies
+GroupMap contrib/gitdm/group-map-netflix Netflix
+GroupMap contrib/gitdm/group-map-redhat Red Hat
+GroupMap contrib/gitdm/group-map-wavecomp Wave Computing
# Also group together our prolific individual contributors
-# and those working under academic auspices
+# and those working under academic or intern auspices
GroupMap contrib/gitdm/group-map-individuals (None)
GroupMap contrib/gitdm/group-map-academics Academics (various)
+GroupMap contrib/gitdm/group-map-interns GSoC/Outreachy Interns
+
+# Group together robots and other auto-reporters
+GroupMap contrib/gitdm/group-map-robots Robots (various)
#
#
diff --git a/hw/audio/adlib.c b/hw/audio/adlib.c
index 42d50d2..5f979b1 100644
--- a/hw/audio/adlib.c
+++ b/hw/audio/adlib.c
@@ -186,7 +186,7 @@
static void adlib_callback (void *opaque, int free)
{
AdlibState *s = opaque;
- int samples, net = 0, to_play, written;
+ int samples, to_play, written;
samples = free >> SHIFT;
if (!(s->active && s->enabled) || !samples) {
@@ -219,7 +219,6 @@
written = write_audio (s, samples);
if (written) {
- net += written;
samples -= written;
s->pos = (s->pos + written) % s->samples;
}
diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c
index 6817c8b..ac0a130 100644
--- a/hw/m68k/q800.c
+++ b/hw/m68k/q800.c
@@ -334,7 +334,7 @@
prom = memory_region_get_ram_ptr(dp8393x_prom);
checksum = 0;
for (i = 0; i < 6; i++) {
- prom[i] = bitrev8(nd_table[0].macaddr.a[i]);
+ prom[i] = revbit8(nd_table[0].macaddr.a[i]);
checksum ^= prom[i];
}
prom[7] = 0xff - checksum;
diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c
index 54f57c6..5c375a9 100644
--- a/hw/pci-host/pnv_phb4.c
+++ b/hw/pci-host/pnv_phb4.c
@@ -392,7 +392,7 @@
v &= 0xffffffffffff0000ull;
v |= 0x000000000000cfffull & val;
}
- *tptr = val;
+ *tptr = v;
break;
}
case IODA3_TBL_MBT:
diff --git a/hw/ppc/spapr_events.c b/hw/ppc/spapr_events.c
index 0cfc19b..23e2e2f 100644
--- a/hw/ppc/spapr_events.c
+++ b/hw/ppc/spapr_events.c
@@ -934,7 +934,6 @@
uint32_t nret, target_ulong rets)
{
uint32_t mask, buf, len, event_len;
- uint64_t xinfo;
SpaprEventLogEntry *event;
struct rtas_error_log header;
int i;
@@ -944,13 +943,9 @@
return;
}
- xinfo = rtas_ld(args, 1);
mask = rtas_ld(args, 2);
buf = rtas_ld(args, 4);
len = rtas_ld(args, 5);
- if (nargs == 7) {
- xinfo |= (uint64_t)rtas_ld(args, 6) << 32;
- }
event = rtas_event_log_dequeue(spapr, mask);
if (!event) {
diff --git a/include/qemu/bitops.h b/include/qemu/bitops.h
index 110c56e..03213ce 100644
--- a/include/qemu/bitops.h
+++ b/include/qemu/bitops.h
@@ -618,26 +618,4 @@
return x;
}
-/**
- * bitrev8:
- * @x: 8-bit value to be reversed
- *
- * Given an input value with bits::
- *
- * ABCDEFGH
- *
- * return the value with its bits reversed from left to right::
- *
- * HGFEDCBA
- *
- * Returns: the bit-reversed value.
- */
-static inline uint8_t bitrev8(uint8_t x)
-{
- x = ((x >> 1) & 0x55) | ((x << 1) & 0xaa);
- x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc);
- x = (x >> 4) | (x << 4) ;
- return x;
-}
-
#endif
diff --git a/include/qemu/plugin.h b/include/qemu/plugin.h
index 0fefbc6..9a8438f 100644
--- a/include/qemu/plugin.h
+++ b/include/qemu/plugin.h
@@ -190,6 +190,16 @@
void qemu_plugin_disable_mem_helpers(CPUState *cpu);
+/**
+ * qemu_plugin_user_exit(): clean-up callbacks before calling exit callbacks
+ *
+ * This is a user-mode only helper that ensure we have fully cleared
+ * callbacks from all threads before calling the exit callbacks. This
+ * is so the plugins themselves don't have to jump through hoops to
+ * guard against race conditions.
+ */
+void qemu_plugin_user_exit(void);
+
#else /* !CONFIG_PLUGIN */
static inline void qemu_plugin_add_opts(void)
@@ -250,6 +260,8 @@
static inline void qemu_plugin_disable_mem_helpers(CPUState *cpu)
{ }
+static inline void qemu_plugin_user_exit(void)
+{ }
#endif /* !CONFIG_PLUGIN */
#endif /* QEMU_PLUGIN_H */
diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h
index dc3496f..e6e815a 100644
--- a/include/qemu/qemu-plugin.h
+++ b/include/qemu/qemu-plugin.h
@@ -549,6 +549,19 @@
void qemu_plugin_register_flush_cb(qemu_plugin_id_t id,
qemu_plugin_simple_cb_t cb);
+/**
+ * qemu_plugin_register_atexit_cb() - register exit callback
+ * @id: plugin ID
+ * @cb: callback
+ * @userdata: user data for callback
+ *
+ * The @cb function is called once execution has finished. Plugins
+ * should be able to free all their resources at this point much like
+ * after a reset/uninstall callback is called.
+ *
+ * In user-mode it is possible a few un-instrumented instructions from
+ * child threads may run before the host kernel reaps the threads.
+ */
void qemu_plugin_register_atexit_cb(qemu_plugin_id_t id,
qemu_plugin_udata_cb_t cb, void *userdata);
diff --git a/include/ui/gtk.h b/include/ui/gtk.h
index 9516670..80d6bbd 100644
--- a/include/ui/gtk.h
+++ b/include/ui/gtk.h
@@ -25,6 +25,9 @@
#include "ui/egl-helpers.h"
#include "ui/egl-context.h"
#endif
+#ifdef CONFIG_VTE
+#include "qemu/fifo8.h"
+#endif
#define MAX_VCS 10
@@ -62,6 +65,7 @@
GtkWidget *scrollbar;
GtkWidget *terminal;
Chardev *chr;
+ Fifo8 out_fifo;
bool echo;
} VirtualVteConsole;
#endif
diff --git a/linux-user/exit.c b/linux-user/exit.c
index 70b3440..527e29c 100644
--- a/linux-user/exit.c
+++ b/linux-user/exit.c
@@ -35,5 +35,5 @@
__gcov_dump();
#endif
gdb_exit(code);
- qemu_plugin_atexit_cb();
+ qemu_plugin_user_exit();
}
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 376629c..ccd3892 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8364,7 +8364,6 @@
abi_ulong guest_envp;
abi_ulong addr;
char **q;
- int total_size = 0;
argc = 0;
guest_argp = arg2;
@@ -8396,7 +8395,6 @@
break;
if (!(*q = lock_user_string(addr)))
goto execve_efault;
- total_size += strlen(*q) + 1;
}
*q = NULL;
@@ -8408,7 +8406,6 @@
break;
if (!(*q = lock_user_string(addr)))
goto execve_efault;
- total_size += strlen(*q) + 1;
}
*q = NULL;
diff --git a/nbd/server.c b/nbd/server.c
index b60ebc3..3927f77 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -973,7 +973,8 @@
{
int ret;
g_autofree char *export_name = NULL;
- g_autofree bool *bitmaps = NULL;
+ /* Mark unused to work around https://bugs.llvm.org/show_bug.cgi?id=3888 */
+ g_autofree G_GNUC_UNUSED bool *bitmaps = NULL;
NBDExportMetaContexts local_meta = {0};
uint32_t nb_queries;
size_t i;
diff --git a/net/checksum.c b/net/checksum.c
index 70f4eae..68245fd 100644
--- a/net/checksum.c
+++ b/net/checksum.c
@@ -186,12 +186,11 @@
net_checksum_add_iov(const struct iovec *iov, const unsigned int iov_cnt,
uint32_t iov_off, uint32_t size, uint32_t csum_offset)
{
- size_t iovec_off, buf_off;
+ size_t iovec_off;
unsigned int i;
uint32_t res = 0;
iovec_off = 0;
- buf_off = 0;
for (i = 0; i < iov_cnt && size; i++) {
if (iov_off < (iovec_off + iov[i].iov_len)) {
size_t len = MIN((iovec_off + iov[i].iov_len) - iov_off , size);
@@ -200,7 +199,6 @@
res += net_checksum_add_cont(len, chunk_buf, csum_offset);
csum_offset += len;
- buf_off += len;
iov_off += len;
size -= len;
}
diff --git a/plugins/api.c b/plugins/api.c
index 78b563c..2d521e6 100644
--- a/plugins/api.c
+++ b/plugins/api.c
@@ -319,7 +319,7 @@
return block->offset + offset + block->mr->addr;
} else {
MemoryRegionSection *mrs = haddr->v.io.section;
- return haddr->v.io.offset + mrs->mr->addr;
+ return mrs->offset_within_address_space + haddr->v.io.offset;
}
}
#endif
diff --git a/plugins/core.c b/plugins/core.c
index 474db28..6b2490f 100644
--- a/plugins/core.c
+++ b/plugins/core.c
@@ -488,6 +488,45 @@
}
/*
+ * Handle exit from linux-user. Unlike the normal atexit() mechanism
+ * we need to handle the clean-up manually as it's possible threads
+ * are still running. We need to remove all callbacks from code
+ * generation, flush the current translations and then we can safely
+ * trigger the exit callbacks.
+ */
+
+void qemu_plugin_user_exit(void)
+{
+ enum qemu_plugin_event ev;
+ CPUState *cpu;
+
+ QEMU_LOCK_GUARD(&plugin.lock);
+
+ start_exclusive();
+
+ /* un-register all callbacks except the final AT_EXIT one */
+ for (ev = 0; ev < QEMU_PLUGIN_EV_MAX; ev++) {
+ if (ev != QEMU_PLUGIN_EV_ATEXIT) {
+ struct qemu_plugin_ctx *ctx;
+ QTAILQ_FOREACH(ctx, &plugin.ctxs, entry) {
+ plugin_unregister_cb__locked(ctx, ev);
+ }
+ }
+ }
+
+ tb_flush(current_cpu);
+
+ CPU_FOREACH(cpu) {
+ qemu_plugin_disable_mem_helpers(cpu);
+ }
+
+ end_exclusive();
+
+ /* now it's safe to handle the exit case */
+ qemu_plugin_atexit_cb();
+}
+
+/*
* Call this function after longjmp'ing to the main loop. It's possible that the
* last instruction of a TB might have used helpers, and therefore the
* "disable" instruction will never execute because it ended up as dead code.
diff --git a/target/hexagon/op_helper.c b/target/hexagon/op_helper.c
index 4595559..61d5cde 100644
--- a/target/hexagon/op_helper.c
+++ b/target/hexagon/op_helper.c
@@ -16,7 +16,9 @@
*/
#include "qemu/osdep.h"
-#include "qemu.h"
+#include "qemu/log.h"
+#include "exec/exec-all.h"
+#include "exec/cpu_ldst.h"
#include "exec/helper-proto.h"
#include "fpu/softfloat.h"
#include "cpu.h"
@@ -140,22 +142,22 @@
void HELPER(commit_store)(CPUHexagonState *env, int slot_num)
{
- switch (env->mem_log_stores[slot_num].width) {
+ uintptr_t ra = GETPC();
+ uint8_t width = env->mem_log_stores[slot_num].width;
+ target_ulong va = env->mem_log_stores[slot_num].va;
+
+ switch (width) {
case 1:
- put_user_u8(env->mem_log_stores[slot_num].data32,
- env->mem_log_stores[slot_num].va);
+ cpu_stb_data_ra(env, va, env->mem_log_stores[slot_num].data32, ra);
break;
case 2:
- put_user_u16(env->mem_log_stores[slot_num].data32,
- env->mem_log_stores[slot_num].va);
+ cpu_stw_data_ra(env, va, env->mem_log_stores[slot_num].data32, ra);
break;
case 4:
- put_user_u32(env->mem_log_stores[slot_num].data32,
- env->mem_log_stores[slot_num].va);
+ cpu_stl_data_ra(env, va, env->mem_log_stores[slot_num].data32, ra);
break;
case 8:
- put_user_u64(env->mem_log_stores[slot_num].data64,
- env->mem_log_stores[slot_num].va);
+ cpu_stq_data_ra(env, va, env->mem_log_stores[slot_num].data64, ra);
break;
default:
g_assert_not_reached();
@@ -393,37 +395,33 @@
static uint8_t mem_load1(CPUHexagonState *env, uint32_t slot,
target_ulong vaddr)
{
- uint8_t retval;
+ uintptr_t ra = GETPC();
check_noshuf(env, slot);
- get_user_u8(retval, vaddr);
- return retval;
+ return cpu_ldub_data_ra(env, vaddr, ra);
}
static uint16_t mem_load2(CPUHexagonState *env, uint32_t slot,
target_ulong vaddr)
{
- uint16_t retval;
+ uintptr_t ra = GETPC();
check_noshuf(env, slot);
- get_user_u16(retval, vaddr);
- return retval;
+ return cpu_lduw_data_ra(env, vaddr, ra);
}
static uint32_t mem_load4(CPUHexagonState *env, uint32_t slot,
target_ulong vaddr)
{
- uint32_t retval;
+ uintptr_t ra = GETPC();
check_noshuf(env, slot);
- get_user_u32(retval, vaddr);
- return retval;
+ return cpu_ldl_data_ra(env, vaddr, ra);
}
static uint64_t mem_load8(CPUHexagonState *env, uint32_t slot,
target_ulong vaddr)
{
- uint64_t retval;
+ uintptr_t ra = GETPC();
check_noshuf(env, slot);
- get_user_u64(retval, vaddr);
- return retval;
+ return cpu_ldq_data_ra(env, vaddr, ra);
}
/* Floating point */
diff --git a/tests/docker/dockerfiles/debian-tricore-cross.docker b/tests/docker/dockerfiles/debian-tricore-cross.docker
index 9859251..d8df2c6 100644
--- a/tests/docker/dockerfiles/debian-tricore-cross.docker
+++ b/tests/docker/dockerfiles/debian-tricore-cross.docker
@@ -1,23 +1,47 @@
#
# Docker TriCore cross-compiler target
#
-# This docker target builds on the debian Stretch base image.
+# This docker target builds on the Debian Buster base image but
+# doesn't inherit from the common one to avoid bringing in unneeded
+# dependencies.
#
# Copyright (c) 2018 Philippe Mathieu-Daudé
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
-FROM qemu/debian10
+FROM docker.io/library/debian:buster-slim
MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
+RUN apt update && \
+ DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \
+ DEBIAN_FRONTEND=noninteractive eatmydata apt install -yy \
+ bzip2 \
+ ca-certificates \
+ ccache \
+ g++ \
+ gcc \
+ git \
+ libglib2.0-dev \
+ libpixman-1-dev \
+ libtest-harness-perl \
+ locales \
+ make \
+ ninja-build \
+ perl-base \
+ pkgconf \
+ python3-pip \
+ python3-setuptools \
+ python3-wheel
+
RUN git clone --single-branch \
https://github.com/bkoppelmann/tricore-binutils.git \
/usr/src/binutils && \
cd /usr/src/binutils && chmod +x missing && \
- CFLAGS=-w ./configure --prefix=/usr --disable-nls --target=tricore && \
+ CFLAGS=-w ./configure --prefix=/usr/local --disable-nls --target=tricore && \
make && make install && \
rm -rf /usr/src/binutils
-# This image isn't designed for building QEMU but building tests
-ENV QEMU_CONFIGURE_OPTS --disable-system --disable-user
+# This image can only build a very minimal QEMU as well as the tests
+ENV DEF_TARGET_LIST tricore-softmmu
+ENV QEMU_CONFIGURE_OPTS --disable-user --disable-tools --disable-fdt
diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh
index aa7c243..1f985cc 100755
--- a/tests/tcg/configure.sh
+++ b/tests/tcg/configure.sh
@@ -72,6 +72,10 @@
: ${cross_cc_x86_64="x86_64-linux-gnu-gcc"}
: ${cross_cc_cflags_x86_64="-m64"}
+# tricore is special as it doesn't have a compiler
+: ${cross_as_tricore="tricore-as"}
+: ${cross_ld_tricore="tricore-ld"}
+
for target in $target_list; do
arch=${target%%-*}
@@ -247,6 +251,20 @@
fi
fi
fi
+
+ # Special handling for assembler only tests
+ eval "target_as=\"\${cross_as_$arch}\""
+ eval "target_ld=\"\${cross_ld_$arch}\""
+ if has $target_as && has $target_ld; then
+ case $target in
+ tricore-softmmu)
+ echo "CROSS_CC_GUEST=$target_as" >> $config_target_mak
+ echo "CROSS_AS_GUEST=$target_as" >> $config_target_mak
+ echo "CROSS_LD_GUEST=$target_ld" >> $config_target_mak
+ got_cross_cc=yes
+ ;;
+ esac
+ fi
fi
if test $got_cross_cc = yes; then
diff --git a/tests/unit/test-iov.c b/tests/unit/test-iov.c
index 9c415e2..5371066 100644
--- a/tests/unit/test-iov.c
+++ b/tests/unit/test-iov.c
@@ -158,7 +158,7 @@
int sv[2];
int r;
- unsigned i, j, k, s, t;
+ unsigned i, j, k, s;
fd_set fds;
unsigned niov;
struct iovec *iov, *siov;
@@ -182,7 +182,6 @@
FD_ZERO(&fds);
- t = 0;
if (fork() == 0) {
/* writer */
@@ -201,7 +200,6 @@
g_assert(memcmp(iov, siov, sizeof(*iov)*niov) == 0);
if (r >= 0) {
k += r;
- t += r;
usleep(g_test_rand_int_range(0, 30));
} else if (errno == EAGAIN) {
select(sv[1]+1, NULL, &fds, NULL, NULL);
@@ -238,7 +236,6 @@
g_assert(memcmp(iov, siov, sizeof(*iov)*niov) == 0);
if (r > 0) {
k += r;
- t += r;
} else if (!r) {
if (s) {
break;
diff --git a/ui/cocoa.m b/ui/cocoa.m
index 9f72844..68a6302 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -1888,12 +1888,12 @@
exit(status);
}
-int main (int argc, const char * argv[]) {
+int main (int argc, char **argv) {
QemuThread thread;
COCOA_DEBUG("Entered main()\n");
gArgc = argc;
- gArgv = (char **)argv;
+ gArgv = argv;
qemu_sem_init(&display_init_sem, 0);
qemu_sem_init(&app_started_sem, 0);
diff --git a/ui/egl-headless.c b/ui/egl-headless.c
index 75404e0..a26a252 100644
--- a/ui/egl-headless.c
+++ b/ui/egl-headless.c
@@ -214,6 +214,4 @@
type_init(register_egl);
-#ifdef CONFIG_OPENGL
module_dep("ui-opengl");
-#endif
diff --git a/ui/gtk.c b/ui/gtk.c
index 376b4d5..974e4df 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -865,37 +865,25 @@
GdkWindow *win = gtk_widget_get_window(widget);
GdkMonitor *monitor = gdk_display_get_monitor_at_window(dpy, win);
GdkRectangle geometry;
- int screen_width, screen_height;
int x = (int)motion->x_root;
int y = (int)motion->y_root;
gdk_monitor_get_geometry(monitor, &geometry);
- screen_width = geometry.width;
- screen_height = geometry.height;
/* In relative mode check to see if client pointer hit
- * one of the screen edges, and if so move it back by
- * 200 pixels. This is important because the pointer
+ * one of the monitor edges, and if so move it back to the
+ * center of the monitor. This is important because the pointer
* in the server doesn't correspond 1-for-1, and so
* may still be only half way across the screen. Without
* this warp, the server pointer would thus appear to hit
* an invisible wall */
- if (x == 0) {
- x += 200;
- }
- if (y == 0) {
- y += 200;
- }
- if (x == (screen_width - 1)) {
- x -= 200;
- }
- if (y == (screen_height - 1)) {
- y -= 200;
- }
-
- if (x != (int)motion->x_root || y != (int)motion->y_root) {
+ if (x <= geometry.x || x - geometry.x >= geometry.width - 1 ||
+ y <= geometry.y || y - geometry.y >= geometry.height - 1) {
GdkDevice *dev = gdk_event_get_device((GdkEvent *)motion);
+ x = geometry.x + geometry.width / 2;
+ y = geometry.y + geometry.height / 2;
+
gdk_device_warp(dev, screen, x, y);
s->last_set = FALSE;
return FALSE;
@@ -1652,6 +1640,25 @@
}
}
+static void gd_vc_send_chars(VirtualConsole *vc)
+{
+ uint32_t len, avail;
+
+ len = qemu_chr_be_can_write(vc->vte.chr);
+ avail = fifo8_num_used(&vc->vte.out_fifo);
+ if (len > avail) {
+ len = avail;
+ }
+ while (len > 0) {
+ const uint8_t *buf;
+ uint32_t size;
+
+ buf = fifo8_pop_buf(&vc->vte.out_fifo, len, &size);
+ qemu_chr_be_write(vc->vte.chr, (uint8_t *)buf, size);
+ len -= size;
+ }
+}
+
static int gd_vc_chr_write(Chardev *chr, const uint8_t *buf, int len)
{
VCChardev *vcd = VC_CHARDEV(chr);
@@ -1661,6 +1668,14 @@
return len;
}
+static void gd_vc_chr_accept_input(Chardev *chr)
+{
+ VCChardev *vcd = VC_CHARDEV(chr);
+ VirtualConsole *vc = vcd->console;
+
+ gd_vc_send_chars(vc);
+}
+
static void gd_vc_chr_set_echo(Chardev *chr, bool echo)
{
VCChardev *vcd = VC_CHARDEV(chr);
@@ -1700,6 +1715,7 @@
cc->parse = qemu_chr_parse_vc;
cc->open = gd_vc_open;
cc->chr_write = gd_vc_chr_write;
+ cc->chr_accept_input = gd_vc_chr_accept_input;
cc->chr_set_echo = gd_vc_chr_set_echo;
}
@@ -1714,6 +1730,7 @@
gpointer user_data)
{
VirtualConsole *vc = user_data;
+ uint32_t free;
if (vc->vte.echo) {
VteTerminal *term = VTE_TERMINAL(vc->vte.terminal);
@@ -1733,16 +1750,10 @@
}
}
- int remaining = size;
- uint8_t* p = (uint8_t *)text;
- while (remaining > 0) {
- int can_write = qemu_chr_be_can_write(vc->vte.chr);
- int written = MIN(remaining, can_write);
- qemu_chr_be_write(vc->vte.chr, p, written);
+ free = fifo8_num_free(&vc->vte.out_fifo);
+ fifo8_push_all(&vc->vte.out_fifo, (uint8_t *)text, MIN(free, size));
+ gd_vc_send_chars(vc);
- remaining -= written;
- p += written;
- }
return TRUE;
}
@@ -1759,6 +1770,7 @@
vc->s = s;
vc->vte.echo = vcd->echo;
vc->vte.chr = chr;
+ fifo8_create(&vc->vte.out_fifo, 4096);
vcd->console = vc;
snprintf(buffer, sizeof(buffer), "vc%d", idx);
diff --git a/ui/keycodemapdb b/ui/keycodemapdb
index 6119e6e..d21009b 160000
--- a/ui/keycodemapdb
+++ b/ui/keycodemapdb
@@ -1 +1 @@
-Subproject commit 6119e6e19a050df847418de7babe5166779955e4
+Subproject commit d21009b1c9f94b740ea66be8e48a1d8ad8124023
diff --git a/ui/spice-app.c b/ui/spice-app.c
index 641f4a9..7e71e18 100644
--- a/ui/spice-app.c
+++ b/ui/spice-app.c
@@ -27,6 +27,7 @@
#include <gio/gio.h>
#include "ui/console.h"
+#include "ui/spice-display.h"
#include "qemu/config-file.h"
#include "qemu/option.h"
#include "qemu/cutils.h"
@@ -175,7 +176,7 @@
qemu_opt_set(qopts, "addr", sock_path, &error_abort);
qemu_opt_set(qopts, "image-compression", "off", &error_abort);
qemu_opt_set(qopts, "streaming-video", "off", &error_abort);
-#ifdef CONFIG_OPENGL
+#ifdef HAVE_SPICE_GL
qemu_opt_set(qopts, "gl", opts->has_gl ? "on" : "off", &error_abort);
display_opengl = opts->has_gl;
#endif
diff --git a/ui/spice-core.c b/ui/spice-core.c
index 86d4378..0371055 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -1039,6 +1039,6 @@
opts_init(spice_register_config);
module_opts("spice");
-#ifdef CONFIG_OPENGL
+#ifdef HAVE_SPICE_GL
module_dep("ui-opengl");
#endif
diff --git a/util/selfmap.c b/util/selfmap.c
index 2ec99df..2c14f01 100644
--- a/util/selfmap.c
+++ b/util/selfmap.c
@@ -23,29 +23,34 @@
gchar **fields = g_strsplit(lines[i], " ", 6);
if (g_strv_length(fields) > 4) {
MapInfo *e = g_new0(MapInfo, 1);
- int errors;
+ int errors = 0;
const char *end;
- errors = qemu_strtoul(fields[0], &end, 16, &e->start);
- errors += qemu_strtoul(end + 1, NULL, 16, &e->end);
+ errors |= qemu_strtoul(fields[0], &end, 16, &e->start);
+ errors |= qemu_strtoul(end + 1, NULL, 16, &e->end);
e->is_read = fields[1][0] == 'r';
e->is_write = fields[1][1] == 'w';
e->is_exec = fields[1][2] == 'x';
e->is_priv = fields[1][3] == 'p';
- errors += qemu_strtoul(fields[2], NULL, 16, &e->offset);
+ errors |= qemu_strtoul(fields[2], NULL, 16, &e->offset);
e->dev = g_strdup(fields[3]);
- errors += qemu_strtou64(fields[4], NULL, 10, &e->inode);
+ errors |= qemu_strtou64(fields[4], NULL, 10, &e->inode);
- /*
- * The last field may have leading spaces which we
- * need to strip.
- */
- if (g_strv_length(fields) == 6) {
- e->path = g_strdup(g_strchug(fields[5]));
+ if (!errors) {
+ /*
+ * The last field may have leading spaces which we
+ * need to strip.
+ */
+ if (g_strv_length(fields) == 6) {
+ e->path = g_strdup(g_strchug(fields[5]));
+ }
+ map_info = g_slist_prepend(map_info, e);
+ } else {
+ g_free(e->dev);
+ g_free(e);
}
- map_info = g_slist_prepend(map_info, e);
}
g_strfreev(fields);