Re: [Qemu-devel] [PATCH qemu v2] hw/char/sh_serial: Add timeout handling to unbreak serial input

2018-09-30 Thread Paolo Bonzini
On 28/09/2018 14:36, Geert Uytterhoeven wrote: > Hi Paolo, > > On Tue, Sep 11, 2018 at 3:11 PM Paolo Bonzini wrote: >> On 05/09/2018 15:11, Geert Uytterhoeven wrote: >>> As of commit 18e8cf159177100e ("serial: sh-sci: increase RX FIFO trigger >>> defaults for (H)SCIF") in Linux v4.11-rc1, the ser

Re: [Qemu-devel] Problem translating very high virtual addresses to physical on x86

2018-09-30 Thread Paolo Bonzini
On 28/09/2018 14:28, Aldo Mazzeo wrote: > I was trying to translate a very high virtual address (like > 0x0011) to physical on x86-64 with *paging disabled*. The > problem is that the obtained physical page is 0 because PG_ADDRESS_MASK > is applied to the pte in the virtual to physical

Re: [Qemu-devel] [PATCH RFC v4 7/7] qemu_thread_create: propagate theerror to callers to handle

2018-09-30 Thread Fei Li
On 09/29/2018 11:04 AM, Fam Zheng wrote: > On Wed, Sep 26, 2018 at 7:13 PM Fei Li wrote: >> >> >> On 09/26/2018 06:36 PM, Fam Zheng wrote: >>> On Wed, 09/26 18:02, Fei Li wrote: diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c index 289af4fab5..8b044e2798 100644 -

[Qemu-devel] [PULL 05/79] atomic: fix comment s/x64_64/x86_64/

2018-09-30 Thread Paolo Bonzini
From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Message-Id: <20180903171831.15446-4-c...@braap.org> Reviewed-by: Alex Bennée Signed-off-by: Paolo Bonzini --- include/qemu/atomic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/qemu/atomic.h b/include/qemu/ato

[Qemu-devel] [PULL 03/79] es1370: fix ADC_FRAMEADR and ADC_FRAMECNT

2018-09-30 Thread Paolo Bonzini
They are not consecutive with DAC1_FRAME* and DAC2_FRAME*. Fixes: 154c1d1f960c5147a3f8ef00907504112f271cd8 Signed-off-by: Paolo Bonzini --- hw/audio/es1370.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c index dd75c9e..4f980a

[Qemu-devel] [PULL 06/79] cpus: initialize timers_state.vm_clock_lock

2018-09-30 Thread Paolo Bonzini
From: "Emilio G. Cota" We forgot to initialize the spinlock introduced in 94377115b2 ("cpus: protect TimerState writes with a spinlock", 2018-08-23). Fix it. Signed-off-by: Emilio G. Cota Message-Id: <20180903171831.15446-5-c...@braap.org> Reviewed-by: Alex Bennée Signed-off-by: Paolo Bonzini

[Qemu-devel] [PULL 02/79] qsp: hide indirect function calls from Coverity

2018-09-30 Thread Paolo Bonzini
Coverity does not see anymore that qemu_mutex_lock is taking a lock. Hide all the QSP magic so that static analysis works again. Signed-off-by: Paolo Bonzini --- include/qemu/thread.h | 17 + 1 file changed, 17 insertions(+) diff --git a/include/qemu/thread.h b/include/qemu/thre

[Qemu-devel] [PULL 07/79] cacheinfo: add i/d cache_linesize_log

2018-09-30 Thread Paolo Bonzini
From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Message-Id: <20180910232752.31565-2-c...@braap.org> Signed-off-by: Paolo Bonzini --- include/qemu/osdep.h | 2 ++ util/cacheinfo.c | 8 2 files changed, 10 insertions(+) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h

[Qemu-devel] [PULL 01/79] virtio: Return true from virtio_queue_empty if broken

2018-09-30 Thread Paolo Bonzini
From: Fam Zheng Both virtio-blk and virtio-scsi use virtio_queue_empty() as the loop condition in VQ handlers (virtio_blk_handle_vq, virtio_scsi_handle_cmd_vq). When a device is marked broken in virtqueue_pop, for example if a vIOMMU address translation failed, we want to break out of the loop.

[Qemu-devel] [PULL 15/79] dump: fix Windows dump memory run mapping

2018-09-30 Thread Paolo Bonzini
From: Viktor Prutyanov We should map and use guest memory run by parts if it can't be mapped as a whole. After this patch, continuos guest physical memory blocks which are not continuos in host virtual address space will be processed correctly. Signed-off-by: Viktor Prutyanov Message-Id: <15355

[Qemu-devel] [PULL 04/79] ps2: prevent changing irq state on save and load

2018-09-30 Thread Paolo Bonzini
From: Pavel Dovgalyuk Commit 2858ab09e6f708e381fc1a1cc87e747a690c4884 changed PS/2 keyboard/mouse buffers to the standard size. However, its state may change when migrating from the old buffer size and therefore irq needs updating. But this change made wrong, because it throws the whole queue if

[Qemu-devel] [PULL 08/79] util: add atomic64

2018-09-30 Thread Paolo Bonzini
From: "Emilio G. Cota" This introduces read/set accessors for int64_t and uint64_t. Signed-off-by: Emilio G. Cota Message-Id: <20180910232752.31565-3-c...@braap.org> Signed-off-by: Paolo Bonzini --- include/qemu/atomic.h | 34 + util/Makefile.objs| 1 + util/atomic64.

[Qemu-devel] [PULL 11/79] test-rcu-list: access n_reclaims and n_nodes_removed with atomic64

2018-09-30 Thread Paolo Bonzini
From: "Emilio G. Cota" To avoid undefined behaviour. Note that these "atomics" are atomic in the "access once" sense. The variables are updated by a single thread at a time, so no "full" atomics are necessary. Signed-off-by: Emilio G. Cota Message-Id: <20180910232752.31565-6-c...@braap.org> Si

[Qemu-devel] [PULL 00/79] Misc QEMU patches for 2018-09-30

2018-09-30 Thread Paolo Bonzini
The following changes since commit 042938f46e1c477419d1931381fdadffaa49d45e: Merge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20180926a' into staging (2018-09-28 17:07:23 +0100) are available in the git repository at: git://github.com/bonzini/qemu.git tags/for-upstream f

[Qemu-devel] [PULL 16/79] hostmem-memfd: add checks before adding hostmem-memfd & properties

2018-09-30 Thread Paolo Bonzini
From: Marc-André Lureau Run some memfd-related checks before registering hostmem-memfd & various properties. This will help libvirt to figure out what the host is supposed to be capable of. qemu_memfd_check() is changed to a less optimized version, since it is used with various flags, it no long

[Qemu-devel] [PULL 30/79] target/i386: move cpu_tmp4 to DisasContext

2018-09-30 Thread Paolo Bonzini
From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/translate.c | 78 - 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/target/i386/translate.c b/target

[Qemu-devel] [PULL 13/79] cpus: access .qemu_icount with atomic64

2018-09-30 Thread Paolo Bonzini
From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Message-Id: <20180910232752.31565-10-c...@braap.org> Signed-off-by: Paolo Bonzini --- cpus.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cpus.c b/cpus.c index 6e1a892..fed8ec1 100644 --- a/cpus.c +++ b/cpus.c

[Qemu-devel] [PULL 12/79] cpus: take seqlock across qemu_icount updates

2018-09-30 Thread Paolo Bonzini
Even though writes of qemu_icount can safely race with reads in qemu_icount_raw, qemu_icount is also read by icount_adjust, which runs in the I/O thread. Therefore, writes do needs protection of the vm_clock_lock; for simplicity the patch protects it with both seqlock+spinlock, which we already do

[Qemu-devel] [PULL 19/79] hw/char/sh_serial: Add timeout handling to unbreak serial input

2018-09-30 Thread Paolo Bonzini
From: Geert Uytterhoeven As of commit 18e8cf159177100e ("serial: sh-sci: increase RX FIFO trigger defaults for (H)SCIF") in Linux v4.11-rc1, the serial console on the QEMU SH4 target is broken: it delays serial input until enough data has been received. Since aforementioned commit, the Linux SCI

[Qemu-devel] [PULL 10/79] qsp: use atomic64 accessors

2018-09-30 Thread Paolo Bonzini
From: "Emilio G. Cota" With the seqlock, we either have to use atomics to remain within defined behaviour (and note that 64-bit atomics aren't always guaranteed to compile, irrespective of __nocheck), or drop the atomics and be in undefined behaviour territory. Fix it by dropping the seqlock and

[Qemu-devel] [PULL 14/79] cpus: access .qemu_icount_bias with atomic64

2018-09-30 Thread Paolo Bonzini
From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Message-Id: <20180910232752.31565-11-c...@braap.org> Signed-off-by: Paolo Bonzini --- cpus.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/cpus.c b/cpus.c index fed8ec1..d8b3b46 100644 --- a/cpus

[Qemu-devel] [PULL 42/79] timer: introduce new virtual clock

2018-09-30 Thread Paolo Bonzini
From: Pavel Dovgalyuk 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 gue

[Qemu-devel] [PULL 20/79] util: add qemu_write_pidfile()

2018-09-30 Thread Paolo Bonzini
From: Marc-André Lureau There are variants of qemu_create_pidfile() in qemu-pr-helper and qemu-ga. Let's have a common implementation in libqemuutil. The code is initially based from pr-helper write_pidfile(), with various improvements and suggestions from Daniel Berrangé: QEMU will leave th

[Qemu-devel] [PULL 44/79] ui: fix virtual timers

2018-09-30 Thread Paolo Bonzini
From: Pavel Dovgalyuk 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

[Qemu-devel] [PULL 09/79] tests: add atomic64-bench

2018-09-30 Thread Paolo Bonzini
From: "Emilio G. Cota" - With CONFIG_ATOMIC64: $ tests/atomic64-bench -n 1 Throughput: 310.40 Mops/s - Without: $ tests/atomic64-bench -n 1 Throughput: 149.08 Mops/s Signed-off-by: Emilio G. Cota Message-Id: <20180910232752.31565-4-c...@braap.org> Signed-off-by: Paolo Bonzi

[Qemu-devel] [PULL 22/79] serial: fix DLL writes

2018-09-30 Thread Paolo Bonzini
Commit 0147883450fe84bb8de2d4a58381881f4262ce9b tries to handle word-sized writes to DLL/DLH, but due to a typo, this patch is causing tracebacks in all Linux kernels running the PXA serial driver, due to an unexpected DLL register value. Here is the surrounding code from drivers/tty/serial/pxa.c:

[Qemu-devel] [PULL 24/79] change get_image_size return type to int64_t

2018-09-30 Thread Paolo Bonzini
From: Li Zhijian Previously, if the size of initrd >=2G, qemu exits with error: root@haswell-OptiPlex-9020:/home/lizj# /home/lizhijian/lkp/qemu-colo/x86_64-softmmu/qemu-system-x86_64 -kernel ./vmlinuz-4.16.0-rc4 -initrd large.cgz -nographic qemu: error reading initrd large.cgz: No such file or

[Qemu-devel] [PULL 46/79] hw: debugexit: add read callback

2018-09-30 Thread Paolo Bonzini
From: Li Qiang Signed-off-by: Li Qiang Message-Id: <20180912160118.21158-3-liq...@163.com> Signed-off-by: Paolo Bonzini --- hw/misc/debugexit.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/misc/debugexit.c b/hw/misc/debugexit.c index 84fa1a5..bed2932 100644 --- a/hw/misc/debuge

[Qemu-devel] [PULL 26/79] target/i386: move cpu_A0 to DisasContext

2018-09-30 Thread Paolo Bonzini
From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/translate.c | 472 1 file changed, 236 insertions(+), 236 deletions(-) diff --git a/target/i386/translate.c b/targ

[Qemu-devel] [PULL 17/79] kvm: x86: Fix kvm_arch_fixup_msi_route for remap-less case

2018-09-30 Thread Paolo Bonzini
From: Jan Kiszka The AMD IOMMU does not (yet) support interrupt remapping. But kvm_arch_fixup_msi_route assumes that all implementations do and crashes when the AMD IOMMU is used in KVM mode. Fixes: 8b5ed7dffa1f ("intel_iommu: add support for split irqchip") Reported-by: Christopher Goldsworthy

[Qemu-devel] [PULL 32/79] target/i386: move cpu_ptr1 to DisasContext

2018-09-30 Thread Paolo Bonzini
From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/translate.c | 52 - 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/target/i386/translate.c b/target

[Qemu-devel] [PULL 18/79] configure: preserve various environment variables in config.status

2018-09-30 Thread Paolo Bonzini
From: Daniel P. Berrangé The config.status script is auto-generated by configure upon completion. The intention is that config.status can be later invoked by the developer directly, or by make indirectly, to re-detect the same environment that configure originally used. The current config.status

[Qemu-devel] [PULL 48/79] hw: hyperv_testdev: add read callback

2018-09-30 Thread Paolo Bonzini
From: Li Qiang Signed-off-by: Li Qiang Message-Id: <20180912160118.21158-4-liq...@163.com> Signed-off-by: Paolo Bonzini --- hw/misc/hyperv_testdev.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hw/misc/hyperv_testdev.c b/hw/misc/hyperv_testdev.c index bf6bbfa.

[Qemu-devel] [PULL 31/79] target/i386: move cpu_ptr0 to DisasContext

2018-09-30 Thread Paolo Bonzini
From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/translate.c | 101 +--- 1 file changed, 52 insertions(+), 49 deletions(-) diff --git a/target/i386/translate.c b/target

[Qemu-devel] [PULL 34/79] target/i386: move cpu_tmp3_i32 to DisasContext

2018-09-30 Thread Paolo Bonzini
From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/translate.c | 64 - 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/target/i386/translate.c b/target

[Qemu-devel] [PULL 70/79] replay: replay BH for IDE trim operation

2018-09-30 Thread Paolo Bonzini
From: Pavel Dovgalyuk 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 Reviewed-by: Paolo Bonzini Message-Id: <20180912081950.3228.68987.stgit@pas

[Qemu-devel] [PULL 21/79] util: use fcntl() for qemu_write_pidfile() locking

2018-09-30 Thread Paolo Bonzini
From: Marc-André Lureau Daniel Berrangé suggested to use fcntl() locks rather than lockf(). 'man lockf': On Linux, lockf() is just an interface on top of fcntl(2) locking. Many other systems implement lockf() in this way, but note that POSIX.1 leaves the relationship between lockf() a

[Qemu-devel] [PULL 28/79] target/i386: move cpu_T1 to DisasContext

2018-09-30 Thread Paolo Bonzini
From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/translate.c | 341 1 file changed, 170 insertions(+), 171 deletions(-) diff --git a/target/i386/translate.c b/targ

[Qemu-devel] [PULL 33/79] target/i386: move cpu_tmp2_i32 to DisasContext

2018-09-30 Thread Paolo Bonzini
From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/translate.c | 347 1 file changed, 174 insertions(+), 173 deletions(-) diff --git a/target/i386/translate.c b/targ

[Qemu-devel] [PULL 66/79] qom/object: add some interface asserts

2018-09-30 Thread Paolo Bonzini
From: Marc-André Lureau An interface can't have any instance size or callback, or itself implement other interfaces (this is unsupported). Signed-off-by: Marc-André Lureau Message-Id: <20180912125303.29158-1-marcandre.lur...@redhat.com> Signed-off-by: Paolo Bonzini Signed-off-by: Marc-André L

[Qemu-devel] [PULL 23/79] Delete PID file on exit

2018-09-30 Thread Paolo Bonzini
From: Marc-André Lureau Register an exit notifier to remove the PID file. By the time atexit() is called, qemu_write_pidfile() guarantees QEMU owns the PID file, thus we could safely remove it when exiting. Signed-off-by: Marc-André Lureau Message-Id: <20180907121319.8607-4-marcandre.lur...@re

[Qemu-devel] [PULL 38/79] replay: wake up vCPU when replaying

2018-09-30 Thread Paolo Bonzini
From: Pavel Dovgalyuk In record/replay icount mode vCPU thread and iothread synchronize the execution using the checkpoints. vCPU thread processes the virtual timers and iothread processes all others. When iothread wants to wake up sleeping vCPU thread, it sends dummy queued work. Therefore it co

[Qemu-devel] [PULL 37/79] configure: enable mttcg for i386 and x86_64

2018-09-30 Thread Paolo Bonzini
From: "Emilio G. Cota" Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota Signed-off-by: Paolo Bonzini --- configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure b/configure index 95462f8..3c33c9f 100755 --- a/configure +++ b/configure @@ -7024,12 +7024,14 @@ TARG

[Qemu-devel] [PULL 25/79] target/i386: move cpu_cc_srcT to DisasContext

2018-09-30 Thread Paolo Bonzini
From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/translate.c | 32 ++-- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/target/i386/translate.c b/target/i386/translate.c

[Qemu-devel] [PULL 65/79] accel/tcg: Remove dead code

2018-09-30 Thread Paolo Bonzini
From: Thomas Huth 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 Message-Id: <1537204134-15905-1-git-send-email-th...@redhat.com>

[Qemu-devel] [PULL 40/79] translator: fix breakpoint processing

2018-09-30 Thread Paolo Bonzini
From: Pavel Dovgalyuk QEMU cannot pass through the breakpoints when 'si' command is used in remote gdb. This patch disables inserting the breakpoints when we are already single stepping though the gdb remote protocol. This patch also fixes icount calculation for the blocks that include breakpoint

[Qemu-devel] [PULL 27/79] target/i386: move cpu_T0 to DisasContext

2018-09-30 Thread Paolo Bonzini
From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/translate.c | 1174 --- 1 file changed, 594 insertions(+), 580 deletions(-) diff --git a/target/i386/translate.c b/targ

[Qemu-devel] [PULL 29/79] target/i386: move cpu_tmp0 to DisasContext

2018-09-30 Thread Paolo Bonzini
From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/translate.c | 282 1 file changed, 144 insertions(+), 138 deletions(-) diff --git a/target/i386/translate.c b/targ

[Qemu-devel] [PULL 36/79] target/i386: move x86_64_hregs to DisasContext

2018-09-30 Thread Paolo Bonzini
From: "Emilio G. Cota" And convert it to a bool to use an existing hole in the struct. Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/translate.c | 307 1 file changed, 154 insertions(

[Qemu-devel] [PULL 43/79] slirp: fix ipv6 timers

2018-09-30 Thread Paolo Bonzini
From: Pavel Dovgalyuk 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:

[Qemu-devel] [PULL 35/79] target/i386: move cpu_tmp1_i64 to DisasContext

2018-09-30 Thread Paolo Bonzini
From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/translate.c | 160 1 file changed, 80 insertions(+), 80 deletions(-) diff --git a/target/i386/translate.c b/target

[Qemu-devel] [PULL 62/79] kvmclock: run KVM_KVMCLOCK_CTRL ioctl in vcpu thread

2018-09-30 Thread Paolo Bonzini
From: Yongji Xie 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 Signed-off-by: Chai Wen Messag

[Qemu-devel] [PULL 54/79] char-pty: remove unnecessary #ifdef

2018-09-30 Thread Paolo Bonzini
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 Signed-off-by: Paolo Bonzini --- chardev/char-pty.c | 6 -- 1 file changed, 6

[Qemu-devel] [PULL 58/79] hw: edu: replace device name with macro

2018-09-30 Thread Paolo Bonzini
From: Li Qiang Just as other devices do. Signed-off-by: Li Qiang Message-Id: <1536901871-2729-1-git-send-email-liq...@gmail.com> Signed-off-by: Paolo Bonzini --- hw/misc/edu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/misc/edu.c b/hw/misc/edu.c index df26a4d.

[Qemu-devel] [PULL 39/79] replay: flush events when exiting

2018-09-30 Thread Paolo Bonzini
From: Pavel Dovgalyuk This patch adds events processing when emulation finishes instead of just cleaning the queue. Now the bdrv coroutines will be in consistent state when emulator closes. It allows correct polling of the block layer at exit. Signed-off-by: Pavel Dovgalyuk Message-Id: <2018091

[Qemu-devel] [PULL 51/79] Revert "chardev: tcp: postpone async connection setup"

2018-09-30 Thread Paolo Bonzini
From: Marc-André Lureau This reverts commit 25679e5d58e258e9950685ffbd0cae4cd40d9cc2. 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 go

[Qemu-devel] [PULL 69/79] hostmem-file: make available memory-backend-file on POSIX-based hosts

2018-09-30 Thread Paolo Bonzini
From: Hikaru Nishida 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 hos

[Qemu-devel] [PULL 67/79] hvf: drop unused variable

2018-09-30 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- target/i386/hvf/hvf.c | 1 - 1 file changed, 1 deletion(-) diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c index 5db167d..9f52bc4 100644 --- a/target/i386/hvf/hvf.c +++ b/target/i386/hvf/hvf.c @@ -72,7 +72,6 @@ #include "sysemu/sysemu.h" #include "ta

[Qemu-devel] [PULL 41/79] replay: allow loading any snapshots before recording

2018-09-30 Thread Paolo Bonzini
From: Pavel Dovgalyuk This patch enables using -loadvm in recording mode to allow starting the execution recording from any of the available snapshots. It also fixes loading of the record/replay state, therefore snapshots created in replay mode may also be used for starting the new recording. Si

[Qemu-devel] [PULL 71/79] virtio: do not take address of packed members

2018-09-30 Thread Paolo Bonzini
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 Cc: Peter Maydell Signed-off-by: Paolo Bonzini --- hw/char/virtio-serial-bus.c | 6 +++--- 1 file changed,

[Qemu-devel] [PULL 45/79] fw_cfg_mem: add read memory region callback

2018-09-30 Thread Paolo Bonzini
From: Li Qiang Signed-off-by: Li Qiang Message-Id: <20180912160118.21158-2-liq...@163.com> Signed-off-by: Paolo Bonzini --- hw/nvram/fw_cfg.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index d79a568..6de7809 100644 --- a/hw/nvram/fw_cfg.c ++

[Qemu-devel] [PULL 72/79] memory: Use MAKE_64BIT_MASK()

2018-09-30 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20180927002416.1781-2-f4...@amsat.org> Signed-off-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé --- memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --gi

[Qemu-devel] [PULL 73/79] memory: Refactor common shifting code from accessors

2018-09-30 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20180927002416.1781-3-f4...@amsat.org> Signed-off-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé --- memory.c | 30 +- 1 file changed, 21 insertions(+), 9 deletions(-) diff -

[Qemu-devel] [PULL 52/79] char-socket: update all ioc handlers when changing context

2018-09-30 Thread Paolo Bonzini
From: Marc-André Lureau 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 Message-Id: <20180817135224.22971-4-marcandre.lur...@re

[Qemu-devel] [PULL 57/79] i386: Compile CPUX86State xsave_buf only when support KVM or HVF

2018-09-30 Thread Paolo Bonzini
From: Liran Alon While at it, also rename var to indicate it is not used only in KVM. Reviewed-by: Nikita Leshchenko Reviewed-by: Patrick Colp Signed-off-by: Liran Alon Message-Id: <20180914003827.124570-2-liran.a...@oracle.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 4

[Qemu-devel] [PULL 49/79] memory: cleanup side effects of memory_region_init_foo() on failure

2018-09-30 Thread Paolo Bonzini
From: Igor Mammedov 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=9G,mem-path=/tmp/foo,discard-da

[Qemu-devel] [PULL 76/79] hw/nvram/fw_cfg: Use memberwise copy of MemoryRegionOps struct

2018-09-30 Thread Paolo Bonzini
From: Peter Maydell 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 Message-Id: <20180824170422.5783-3-peter.mayd...@linaro.org> Based-on: <2018080217

[Qemu-devel] [PULL 59/79] dump: move Windows dump structures definitions

2018-09-30 Thread Paolo Bonzini
From: Viktor Prutyanov 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 Message-Id: <1535546488-30208-2-git-send-email-viktor.prutya...@virtuozzo.com> Signed-off-by: Paolo Bonzin

[Qemu-devel] [PULL 75/79] memory: Remove old_mmio accessors

2018-09-30 Thread Paolo Bonzini
From: Peter Maydell 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 Message-Id: <20180824170422.5783-2-peter.mayd...@linaro.org> Based-on: <20180802174042.29234-1-peter.mayd...@linaro.org> Reviewed-

[Qemu-devel] [PULL 53/79] test-char: add socket reconnect test

2018-09-30 Thread Paolo Bonzini
From: Marc-André Lureau This test exhibits a regression fixed by the previous reverts. Signed-off-by: Marc-André Lureau Message-Id: <20180817135224.22971-5-marcandre.lur...@redhat.com> Signed-off-by: Paolo Bonzini Signed-off-by: Marc-André Lureau --- tests/test-char.c | 18 ++---

[Qemu-devel] [PULL 78/79] cpus: fix TCG kick timer leak

2018-09-30 Thread Paolo Bonzini
From: Alex Bennée This is an alternative fix to Marc-André's original patch. Reported-by: Marc-André Lureau Suggested-by: Paolo Bonzini Signed-off-by: Alex Bennée Message-Id: <20180927171724.30128-1-alex.ben...@linaro.org> Signed-off-by: Paolo Bonzini --- cpus.c | 5 +++-- 1 file changed, 3

[Qemu-devel] [PULL 56/79] target/i386: rename HF_SVMI_MASK to HF_GUEST_MASK

2018-09-30 Thread Paolo Bonzini
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 --- target/i386/cpu.h | 4 ++-- target/i386/excp_helper.c | 2 +- target/i386/seg_helper.c | 6 +++--- target/i386/svm_helper.c |

[Qemu-devel] [PULL 61/79] MAINTAINERS: add myself as elf2dmp maintainer

2018-09-30 Thread Paolo Bonzini
From: Viktor Prutyanov Add myself as contrib/elf2dmp maintainer and elf2dmp as maintained. Signed-off-by: Viktor Prutyanov Message-Id: <20180918095422.4468-1-viktor.prutya...@phystech.edu> Signed-off-by: Paolo Bonzini --- MAINTAINERS | 5 + 1 file changed, 5 insertions(+) diff --git a/MA

[Qemu-devel] [PULL 50/79] Revert "chardev: tcp: postpone TLS work until machine done"

2018-09-30 Thread Paolo Bonzini
From: Marc-André Lureau This reverts commit 99f2f54174a595e3ada6e4332fcd2b37ebb0d55d. See next commit reverting 25679e5d58e258e9950685ffbd0cae4cd40d9cc2 as well for rationale. Signed-off-by: Marc-André Lureau Message-Id: <20180817135224.22971-2-marcandre.lur...@redhat.com> Signed-off-by: Paol

[Qemu-devel] [PULL 64/79] lsi53c895a: convert to trace-events

2018-09-30 Thread Paolo Bonzini
From: Mark Cave-Ayland Signed-off-by: Mark Cave-Ayland Message-Id: <20180917053229.4853-1-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Paolo Bonzini --- hw/scsi/lsi53c895a.c | 214 +-- hw/scsi/trace-events | 62 +++ 2 files changed,

[Qemu-devel] [PULL 63/79] scsi-block: Deprecate rotation_rate

2018-09-30 Thread Paolo Bonzini
From: Fam Zheng 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 070f80095ad was for random entr

[Qemu-devel] [PULL 74/79] memory: Fix access_with_adjusted_size(small size) on big-endian memory regions

2018-09-30 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé 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 (me

[Qemu-devel] [PULL 55/79] target/i386: unify masking of interrupts

2018-09-30 Thread Paolo Bonzini
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

[Qemu-devel] virtio-console downgrade the virtio-pci-blk performance

2018-09-30 Thread Feng Li
Hi, I found an obvious performance downgrade when virtio-console combined with virtio-pci-blk. This phenomenon exists in nearly all Qemu versions and all Linux (CentOS7, Fedora 28, Ubuntu 18.04) distros. This is a disk cmd: -drive file=iscsi://127.0.0.1:3260/iqn.2016-02.com.test:system:fl-iscsi/

[Qemu-devel] [PULL 77/79] docs/devel/memory.txt: Document _with_attrs accessors

2018-09-30 Thread Paolo Bonzini
From: Peter Maydell When we added the _with_attrs accessors we forgot to mention them in the documentation. Signed-off-by: Peter Maydell Message-Id: <20180824170422.5783-4-peter.mayd...@linaro.org> Based-on: <20180802174042.29234-1-peter.mayd...@linaro.org> Signed-off-by: Paolo Bonzini --- do

[Qemu-devel] [PULL 68/79] target/i386: fix translation for icount mode

2018-09-30 Thread Paolo Bonzini
From: Pavel Dovgalyuk 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 Dov

[Qemu-devel] [PULL 79/79] hw/scsi/mptendian: Avoid taking address of fields in packed structs

2018-09-30 Thread Paolo Bonzini
From: Peter Maydell 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 "mo

[Qemu-devel] [PATCH v6 00/25] Fixing record/replay and adding reverse debugging

2018-09-30 Thread Artem Pisarenko
Feature still broken :( Brief description of my tests. Guest image is Linux, which just powers off after kernel boots (instead of proceeding to user-space /init or /sbin/init). Base cmdline: qemu-system-x86_64 -nodefaults -machine pc,accel=tcg -m 2048 -cpu qemu64 -rtc clock=vm,base=2000-01-01T00:

Re: [Qemu-devel] [Query] Live Migration between machines with different processor ids

2018-09-30 Thread Jaggi, Manish
> On 05-Sep-2018, at 6:11 PM, Jaggi, Manish wrote: > > > >> On 05-Sep-2018, at 5:50 PM, Andrew Jones wrote: >> >> External Email >> >> On Wed, Sep 05, 2018 at 11:46:11AM +, Jaggi, Manish wrote: >>> (a) Changes in KVM: >>> >>> - Introducing a specific error code (KVM_EINVARIANT) in cas

Re: [Qemu-devel] [PATCH v4 03/24] pc-dimm: pass PCDIMMDevice to pc_dimm_.*plug

2018-09-30 Thread Auger Eric
Hi David, On 9/26/18 11:41 AM, David Hildenbrand wrote: > We're plugging/unplugging a PCDIMMDevice, so directly pass this type > instead of a more generic DeviceState. > > Signed-off-by: David Hildenbrand Reviewed-by: Eric Auger Thanks Eric > --- > hw/i386/pc.c | 6 +++--- > hw/

Re: [Qemu-devel] [PATCH v4 07/24] memory-device: forward errors in get_region_size()/get_plugged_size()

2018-09-30 Thread Auger Eric
Hi David, On 9/26/18 11:42 AM, David Hildenbrand wrote: > Let's properly forward the errors, so errors from get_region_size() / > get_plugged_size() can be handled. > > Users right now call both functions after the device has been realized, > which is will never fail, so it is fine to continue usi

Re: [Qemu-devel] [PATCH v4 08/24] memory-device: document MemoryDeviceClass

2018-09-30 Thread Auger Eric
Hi David, On 9/26/18 11:42 AM, David Hildenbrand wrote: > Document the functions and when to not expect errors. > > Reviewed-by: David Gibson > Signed-off-by: David Hildenbrand > --- > include/hw/mem/memory-device.h | 16 > 1 file changed, 16 insertions(+) > > diff --git a/i

Re: [Qemu-devel] [PULL 00/79] Misc QEMU patches for 2018-09-30

2018-09-30 Thread Philippe Mathieu-Daudé
Hi Paolo, Peter. On 9/30/18 10:11 AM, Paolo Bonzini wrote: > The following changes since commit 042938f46e1c477419d1931381fdadffaa49d45e: > > Merge remote-tracking branch > 'remotes/dgilbert/tags/pull-migration-20180926a' into staging (2018-09-28 > 17:07:23 +0100) > > are available in the gi

Re: [Qemu-devel] [PULL 00/79] Misc QEMU patches for 2018-09-30

2018-09-30 Thread Peter Maydell
On 30 September 2018 at 15:54, Philippe Mathieu-Daudé wrote: > Paolo, thanks for queuing all of this, however I note some UTF-8 issues. > > Alex got lucky: > > Signed-off-by: Alex Bennée > > But Marc-André and myself have: > > Signed-off-by: Philippe Mathieu-Daudé > Signed-off-by: Marc-AndrÃ

Re: [Qemu-devel] [PATCH v6 7/7] elf: Toshiba/Sony rather than MIPS are the implementors of the R5900

2018-09-30 Thread Philippe Mathieu-Daudé
On 9/15/18 12:28 PM, Fredrik Noring wrote: > Sources [1][2] indicate that the Emotion Engine was designed by Toshiba > and licensed to Sony. Others [3][4][5] claim it was a joint effort. It > therefore makes sense to refer to the CPU as "Toshiba/Sony R5900". > > [1] > http://cs.nyu.edu/courses/sp

Re: [Qemu-devel] [PATCH v6 4/7] target/mips: R5900 DMULT[U], DDIV[U], LL[D] and SC[D] are user only

2018-09-30 Thread Philippe Mathieu-Daudé
On 9/16/18 5:13 PM, Fredrik Noring wrote: > The Linux kernel traps certain reserved instruction exceptions to > emulate the corresponding instructions. QEMU is the kernel in user > mode, so those traps are emulated by accepting the instructions. > > This change adds the function check_insn_opc_use

Re: [Qemu-devel] [PATCH v6 6/7] linux-user/mips: Recognise the R5900 CPU model

2018-09-30 Thread Philippe Mathieu-Daudé
On 9/15/18 11:08 AM, Fredrik Noring wrote: > This kind of ELF for the R5900 relies on an IEEE 754-1985 compliant FPU. > The R5900 FPU hardware is noncompliant and it is therefore emulated in > software by the Linux kernel. QEMU emulates a compliant FPU accordingly. > > Signed-off-by: Fredrik Norin

Re: [Qemu-devel] [PATCH v6 3/7] target/mips: Support R5900 instructions MOVN, MOVZ and PREF from MIPS IV

2018-09-30 Thread Philippe Mathieu-Daudé
On 9/15/18 10:43 AM, Fredrik Noring wrote: > The R5900 is taken to be MIPS III with certain modifications. From > MIPS IV it implements the instructions MOVN, MOVZ and PREF. Again, you can keep R-b tag for simple rewording. > > Signed-off-by: Fredrik Noring Reviewed-by: Philippe Mathieu-Daudé

Re: [Qemu-devel] [PATCH v6 1/7] target/mips: Define R5900 instructions and CPU preprocessor constants

2018-09-30 Thread Philippe Mathieu-Daudé
On 9/7/18 7:43 PM, Fredrik Noring wrote: > The R5900 implements the 64-bit MIPS III instruction set except DMULT, > DMULTU, DDIV, DDIVU, LL, SC, LLD and SCD. The MIPS IV instructions MOVN, > MOVZ and PREF are implemented. It has the R5900 specific three-operand > instructions MADD, MADDU, MULT and

Re: [Qemu-devel] [PATCH v4 12/24] memory-device: add device class function set_addr()

2018-09-30 Thread Auger Eric
Hi David, On 9/26/18 11:42 AM, David Hildenbrand wrote: > To be able to factor out address asignment of memory devices, we will s/asignment/assignment > have to read (get_addr()) and write (set_addr()) the address. > > We can't use properties for this purpose, as properties are device > specific.

Re: [Qemu-devel] [PATCH v6 2/7] target/mips: Support R5900 specific three-operand MULT and MULTU

2018-09-30 Thread Philippe Mathieu-Daudé
On 9/15/18 11:25 AM, Fredrik Noring wrote: > The three-operand MULT and MULTU are the only R5900 specific > instructions emitted by GCC 7.3. The R5900 also implements the three- > operand MADD and MADDU instructions, but they are omitted in QEMU for > now since they are absent in programs compiled

Re: [Qemu-devel] [PATCH v4 14/24] memory-device: complete factoring out plug handling

2018-09-30 Thread Auger Eric
Hi David, On 9/26/18 11:42 AM, David Hildenbrand wrote: > With the new memory device functions in place, we can factor out > plugging of memory devices completely. > > Reviewed-by: David Gibson > Reviewed-by: Igor Mammedov > Signed-off-by: David Hildenbrand > --- > hw/mem/memory-device.c

Re: [Qemu-devel] [PATCH v4 15/24] memory-device: complete factoring out unplug handling

2018-09-30 Thread Auger Eric
Hi David, On 9/26/18 11:42 AM, David Hildenbrand wrote: > With the new memory device functions in place, we can factor out > unplugging of memory devices completely. > > Reviewed-by: David Gibson > Reviewed-by: Igor Mammedov > Signed-off-by: David Hildenbrand > --- > hw/mem/memory-device.c

Re: [Qemu-devel] [PATCH v6 5/7] target/mips: Define the R5900 CPU

2018-09-30 Thread Philippe Mathieu-Daudé
On 9/15/18 11:50 AM, Fredrik Noring wrote: > The primary purpose of this change is to support programs compiled by > GCC for the R5900 target and thereby run R5900 Linux distributions, for > example Gentoo. > > GCC in version 7.3, by itself, by inspection of the GCC source code > and inspection of

Re: [Qemu-devel] [PATCH v4 16/24] memory-device: trace when pre_assigning/assigning/unassigning addresses

2018-09-30 Thread Auger Eric
Hi David, On 9/26/18 11:42 AM, David Hildenbrand wrote: > Let's trace the address when pre_pluggin/plugging/unplugging a memory device. > > Trace it when pre_plugging as well as when plugging, so we really know > when a specific address is actually used. > > Reviewed-by: David Gibson > Reviewed

  1   2   >