- Oct 02, 2018
-
-
Peter Maydell authored
* configure fix for environment variables (Daniel) * fix memory leaks (Alex) * x86_64 MTTCG fixes (Emilio) * introduce atomic64 (Emilio) * Fix for virtio hang (Fam, myself) * SH serial port fix (Geert) * Deprecate rotation_rate for scsi-block (Fam) * Extend memory-backend-file availability to all POSIX hosts (Hikaru) * Memory API cleanups and fixes (Igor, Li Qiang, Peter, Philippe) * MSI/IOMMU fix (Jan) * Socket reconnection fixes (Marc-André) * icount fixes (Emilio, myself) * QSP fixes for Coverity (myself) * Some record/replay improovements (Pavel) * Packed struct fixes (Peter) * Windows dump fixes and elf2dmp (Viktor) * kbmclock fix (Yongji) # gpg: Signature made Tue 02 Oct 2018 18:13:12 BST # gpg: using RSA key BFFBD25F78C7AE83 # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * remotes/bonzini/tags/for-upstream: (80 commits) hw/scsi/mptendian: Avoid taking address of fields in packed structs cpus: fix TCG kick timer leak docs/devel/memory.txt: Document _with_attrs accessors hw/nvram/fw_cfg: Use memberwise copy of MemoryRegionOps struct memory: Remove old_mmio accessors memory: Fix access_with_adjusted_size(small size) on big-endian memory regions memory: Refactor common shifting code from accessors memory: Use MAKE_64BIT_MASK() virtio: do not take address of packed members replay: replay BH for IDE trim operation hostmem-file: make available memory-backend-file on POSIX-based hosts target/i386: fix translation for icount mode hvf: drop unused variable qom/object: add some interface asserts accel/tcg: Remove dead code lsi53c895a: convert to trace-events scsi-block: Deprecate rotation_rate kvmclock: run KVM_KVMCLOCK_CTRL ioctl in vcpu thread MAINTAINERS: add myself as elf2dmp maintainer contrib: add elf2dmp tool ... Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Peter Maydell authored
Taking the address of a field in a packed struct is a bad idea, because it might not be actually aligned enough for that pointer type (and thus cause a crash on dereference on some host architectures). Newer versions of clang warn about this. Avoid the bug by not using the "modify in place" byte swapping functions. This patch was produced with the following simple spatch script: @@ expression E; @@ -le16_to_cpus(&E); +E = le16_to_cpu(E); @@ expression E; @@ -le32_to_cpus(&E); +E = le32_to_cpu(E); @@ expression E; @@ -le64_to_cpus(&E); +E = le64_to_cpu(E); @@ expression E; @@ -cpu_to_le16s(&E); +E = cpu_to_le16(E); @@ expression E; @@ -cpu_to_le32s(&E); +E = cpu_to_le32(E); @@ expression E; @@ -cpu_to_le64s(&E); +E = cpu_to_le64(E); followed by some minor tidying of overlong lines and bad indent. Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Message-Id: <20180927134852.21490-1-peter.maydell@linaro.org> Reviewed-by:
Fam Zheng <famz@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Alex Bennée authored
This is an alternative fix to Marc-André's original patch. Reported-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Suggested-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Message-Id: <20180927171724.30128-1-alex.bennee@linaro.org> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Peter Maydell authored
When we added the _with_attrs accessors we forgot to mention them in the documentation. Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Message-Id: <20180824170422.5783-4-peter.maydell@linaro.org> Based-on: <20180802174042.29234-1-peter.maydell@linaro.org> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Peter Maydell authored
We've now removed the 'old_mmio' member from MemoryRegionOps, so we can perform the copy as a simple struct copy rather than having to do it via a memberwise copy. Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Message-Id: <20180824170422.5783-3-peter.maydell@linaro.org> Based-on: <20180802174042.29234-1-peter.maydell@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Peter Maydell authored
Now that all the users of old_mmio MemoryRegion accessors have been converted, we can remove the core code support. Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Message-Id: <20180824170422.5783-2-peter.maydell@linaro.org> Based-on: <20180802174042.29234-1-peter.maydell@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Philippe Mathieu-Daudé authored
Memory regions configured as DEVICE_BIG_ENDIAN (or DEVICE_NATIVE_ENDIAN on big-endian guest) behave incorrectly when the memory access 'size' is smaller than the implementation 'access_size'. In the following code segment from access_with_adjusted_size(): if (memory_region_big_endian(mr)) { for (i = 0; i < size; i += access_size) { r |= access_fn(mr, addr + i, value, access_size, (size - access_size - i) * 8, access_mask, attrs); } (size - access_size - i) * 8 is the number of bits that will arithmetic shift the current value. Currently we can only 'left' shift a read() access, and 'right' shift a write(). When the access 'size' is smaller than the implementation, we get a negative number of bits to shift. For the read() case, a negative 'left' shift is a 'right' shift :) However since the 'shift' type is unsigned, there is currently no way to right shift. Fix this by changing the access_fn() prototype to handle signed shift values, and modify the memory_region_shift_read|write_access() helpers to correctly arithmetic shift the opposite direction when the 'shift' value is negative. Signed-off-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20180927002416.1781-4-f4bug@amsat.org> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Philippe Mathieu-Daudé authored
Signed-off-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20180927002416.1781-3-f4bug@amsat.org> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Philippe Mathieu-Daudé authored
Suggested-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20180927002416.1781-2-f4bug@amsat.org> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
The address of a packed member is not packed, which may cause accesses to unaligned pointers. Avoid this by reading the packed value before passing it to another function. Cc: Jason Wang <jasowang@redhat.com> Cc: Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Pavel Dovgaluk authored
This patch makes IDE trim BH deterministic, because it affects the device state. Therefore its invocation should be replayed instead of running at the random moment. Signed-off-by:
Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20180912081950.3228.68987.stgit@pasha-VirtualBox> Acked-by:
John Snow <jsnow@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Hikaru Nishida authored
Before this change, memory-backend-file object is valid for Linux hosts only because hostmem-file.c is compiled only on Linux hosts. However, other POSIX-based hosts (such as macOS) can support memory-backend-file object in the same way as on Linux hosts. This patch makes hostmem-file.c and related functions to be compiled on all POSIX-based hosts to make available memory-backend-file on them. Signed-off-by:
Hikaru Nishida <hikarupsp@gmail.com> Message-Id: <20180924123205.29651-1-hikarupsp@gmail.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Pavel Dovgaluk authored
This patch fixes the checking of boundary crossing instructions. In icount mode only first instruction of the block may cross the page boundary to keep the translation deterministic. These conditions already existed, but compared the wrong variable. Signed-off-by:
Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> Message-Id: <20180920071702.22477.43980.stgit@pasha-VirtualBox> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Marc-André Lureau authored
An interface can't have any instance size or callback, or itself implement other interfaces (this is unsupported). Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20180912125303.29158-1-marcandre.lureau@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Thomas Huth authored
The global cpu_single_env variable has been removed more than 5 years ago, so apparently nobody used this dead debug code in that timeframe anymore. Thus let's remove it completely now. Signed-off-by:
Thomas Huth <thuth@redhat.com> Message-Id: <1537204134-15905-1-git-send-email-thuth@redhat.com> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Mark Cave-Ayland authored
Signed-off-by:
Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Message-Id: <20180917053229.4853-1-mark.cave-ayland@ilande.co.uk> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Fam Zheng authored
This option is added together with scsi-disk but is never honoured, becuase we don't emulate the VPD page for scsi-block. We could intercept and inject the user specified value like for max xfer len, but it's probably not helpful since the intent of 070f8009 was for random entropy aspects, not for performance. If emulated rotation rate is desired, scsi-hd is more suitable. Signed-off-by:
Fam Zheng <famz@redhat.com> Message-Id: <20180917083138.3948-1-famz@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Yongji Xie authored
According to KVM API Documentation, we should only run vcpu ioctls from the same thread that was used to create the vcpu. This patch makes KVM_KVMCLOCK_CTRL ioctl consistent with the Documentation. No functional change. Signed-off-by:
Yongji Xie <xieyongji@baidu.com> Signed-off-by:
Chai Wen <chaiwen@baidu.com> Message-Id: <1531315364-2551-1-git-send-email-xieyongji@baidu.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Yongji Xie <elohimes@gmail.com>
-
Viktor Prutyanov authored
Add myself as contrib/elf2dmp maintainer and elf2dmp as maintained. Signed-off-by:
Viktor Prutyanov <viktor.prutyanov@phystech.edu> Message-Id: <20180918095422.4468-1-viktor.prutyanov@phystech.edu> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Viktor Prutyanov authored
elf2dmp is a converter from ELF dump (produced by 'dump-guest-memory') to Windows MEMORY.DMP format (also know as 'Complete Memory Dump') which can be opened in WinDbg. This tool can help if VMCoreInfo device/driver is absent in Windows VM and 'dump-guest-memory -w' is not available but dump can be created in ELF format. The tool works as follows: 1. Determine the system paging root looking at GS_BASE or KERNEL_GS_BASE to locate the PRCB structure and finds the kernel CR3 nearby if QEMU CPU state CR3 is not suitable. 2. Find an address within the kernel image by dereferencing the first IDT entry and scans virtual memory upwards until the start of the kernel. 3. Download a PDB matching the kernel from the Microsoft symbol store, and figure out the layout of certain relevant structures necessary for the dump. 4. Populate the corresponding structures in the memory image and create the appropriate dump header. Signed-off-by:
Viktor Prutyanov <viktor.prutyanov@virtuozzo.com> Message-Id: <1535546488-30208-3-git-send-email-viktor.prutyanov@virtuozzo.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Viktor Prutyanov authored
This patch moves definitions of Windows dump structures to include/qemu/win_dump_defs.h to keep create_win_dump() prototype separate. Signed-off-by:
Viktor Prutyanov <viktor.prutyanov@virtuozzo.com> Message-Id: <1535546488-30208-2-git-send-email-viktor.prutyanov@virtuozzo.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Li Qiang authored
Just as other devices do. Signed-off-by:
Li Qiang <liq3ea@gmail.com> Message-Id: <1536901871-2729-1-git-send-email-liq3ea@gmail.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Liran Alon authored
While at it, also rename var to indicate it is not used only in KVM. Reviewed-by:
Nikita Leshchenko <nikita.leshchenko@oracle.com> Reviewed-by:
Patrick Colp <patrick.colp@oracle.com> Signed-off-by:
Liran Alon <liran.alon@oracle.com> Message-Id: <20180914003827.124570-2-liran.alon@oracle.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
This flag will be used for KVM's nested VMX migration; the HF_GUEST_MASK name is already used in KVM, adopt it in QEMU as well. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
Interrupt handling depends on various flags in env->hflags or env->hflags2, and the exact detail were not exactly replicated between x86_cpu_has_work and x86_cpu_exec_interrupt. Create a new function that extracts the highest-priority non-masked interrupt, and use it in both functions. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
For some reason __APPLE__ was not checked in pty code. However, the #ifdef is redundant: this file is already compiled only if CONFIG_POSIX, same as util/qemu-openpty.c which it uses. Reported-by:
Roman Bolshakov <r.bolshakov@yadro.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Marc-André Lureau authored
This test exhibits a regression fixed by the previous reverts. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20180817135224.22971-5-marcandre.lureau@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Marc-André Lureau authored
Peter reported a test failure on FreeBSD with the new reconnect test: MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))} gtester -k --verbose -m=quick tests/test-char TEST: tests/test-char... (pid=16190) /char/null: OK /char/invalid: OK /char/ringbuf: OK /char/mux: OK /char/stdio: OK /char/pipe: OK /char/file: OK /char/file-fifo: OK /char/udp: OK /char/serial: OK /char/hotswap: OK /char/socket/basic: OK /char/socket/reconnect: FAIL GTester: last random seed: R02S521380d9c12f1dac3ad1763bf5665c27 (pid=16367) /char/socket/fdpass: OK FAIL: tests/test-char ** ERROR:tests/test-char.c:353:char_socket_test_common: assertion failed: (object_property_get_bool(OBJECT(chr_client), "connected", &error_abort)) It turns out that the socket test code checks both server and client connection states, but doesn't wait for both. Wait for the client side as well. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20180823143125.16767-5-marcandre.lureau@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Marc-André Lureau authored
So far, tcp_chr_update_read_handler() only updated the read handler. Let's also update the hup handler. Factorize the code while at it. (note that s->ioc != NULL when s->connected) Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20180817135224.22971-4-marcandre.lureau@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Marc-André Lureau authored
This reverts commit 25679e5d. This commit broke "reconnect socket" chardev that are created after "machine_done": they no longer try to connect. It broke also vhost-user-test that uses chardev while there is no "machine_done" event. The goal of this patch was to move the "connect" source to the frontend context. chr->gcontext is set with qemu_chr_fe_set_handlers(). But there is no guarantee that it will be called, so we can't delay connection until then: the chardev should still attempt to connect during open(). qemu_chr_fe_set_handlers() is eventually called later and will update the context. Unless there is a good reason to not use initially the default context, I think we should revert to the previous state to fix the regressions. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20180817135224.22971-3-marcandre.lureau@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Marc-André Lureau authored
This reverts commit 99f2f541. See next commit reverting 25679e5d as well for rationale. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20180817135224.22971-2-marcandre.lureau@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Igor Mammedov authored
if MemoryRegion intialization fails it's left in semi-initialized state, where it's size is not 0 and attached as child to owner object. And this leds to crash in following use-case: (monitor) object_add memory-backend-file,id=mem1,size=99999G,mem-path=/tmp/foo,discard-data=yes memory.c:2083: memory_region_get_ram_ptr: Assertion `mr->ram_block' failed Aborted (core dumped) it happens due to assumption that memory region is intialized when memory_region_size() != 0 and therefore it's ok to access it in file_backend_unparent() if (memory_region_size() != 0) memory_region_get_ram_ptr() which happens when object_add fails and unparents failed backend making file_backend_unparent() access invalid memory region. Fix it by making sure that memory_region_init_foo() APIs cleanup externally visible side effects on failure (like set size to 0 and unparenting object) Signed-off-by:
Igor Mammedov <imammedo@redhat.com> Message-Id: <1536064777-42312-1-git-send-email-imammedo@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Li Qiang authored
Signed-off-by:
Li Qiang <liq3ea@gmail.com> Message-Id: <20180912160118.21158-4-liq3ea@163.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Li Qiang authored
Also change the write callback name. Signed-off-by:
Li Qiang <liq3ea@gmail.com> Message-Id: <20180912160118.21158-5-liq3ea@163.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Li Qiang authored
Signed-off-by:
Li Qiang <liq3ea@gmail.com> Message-Id: <20180912160118.21158-3-liq3ea@163.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Li Qiang authored
Signed-off-by:
Li Qiang <liq3ea@gmail.com> Message-Id: <20180912160118.21158-2-liq3ea@163.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Pavel Dovgaluk authored
UI uses timers based on virtual clock for managing key queue. This is incorrect because this service is not related to the guest state, and its events should not be recorded and replayed. But these timers should stop when the guest is not executing. This patch changes using virtual clock to the new virtual_ext clock, which runs as virtual clock, but its timers are not saved to the log. Signed-off-by:
Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> Message-Id: <20180912082013.3228.33664.stgit@pasha-VirtualBox> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Pavel Dovgaluk authored
ICMP implementation for IPv6 uses timers based on virtual clock. This is incorrect because this service is not related to the guest state, and its events should not be recorded and replayed. This patch changes using virtual clock to the new virtual_ext clock. Signed-off-by:
Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> Message-Id: <20180912082007.3228.91491.stgit@pasha-VirtualBox> Reviewed-by:
Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Pavel Dovgaluk authored
Slirp and VNC modules use virtual clock for processing some events that are related to the guest execution speed. But virtual clock-related events are consideres to be deterministic and are recorded/replayed by icount mechanism. But slirp and VNC lie outside the recorded guest core (which includes CPU and peripherals). Therefore slirp and VNC are external for the guest, but should work at guest speed. This patch introduces new virtual clock which can be used for external subsystems for running timers that are synchronized with the guest. Signed-off-by:
Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> Message-Id: <20180912082002.3228.82417.stgit@pasha-VirtualBox> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-