Re: [Qemu-devel] [PATCH V12 01/19] filter-rewriter: Add TCP state machine and fix memory leak in connection_track_table

2018-09-12 Thread Jason Wang
On 2018年09月03日 12:38, Zhang Chen wrote: We add almost full TCP state machine in filter-rewriter, except TCPS_LISTEN and some simplify in VM active close FIN states. Need to explain why it can be simplified. After a net connection is closed, we didn't clear its releated resources in

Re: [Qemu-devel] [RFC 3/3] vhost-user: support programming VFIO group in master

2018-09-12 Thread Tiwei Bie
On Mon, Jul 30, 2018 at 12:30:58PM +0300, Michael S. Tsirkin wrote: [...] > > I generally wonder how are restarts of the backend handled > with this approach: closing the VFIO device tends to reset > the whole device. Hi Michael, I missed this comment previously.. This is a good point! In this

Re: [Qemu-devel] [PATCH] fw_cfg_mem: add read memory region callback

2018-09-12 Thread Li Qiang
Hi, Marc-André Lureau 于2018年9月12日周三 下午3:16写道: > Hi > > On Wed, Sep 12, 2018 at 9:22 AM Li Qiang wrote: > > > > The write/read should be paired, this can avoid the > > NULL-deref while the guest reads the fw_cfg port. > > > > Signed-off-by: Li Qiang > > Do you have a reproducer and/or a

Re: [Qemu-devel] [PATCH v3 0/1] ppc/pnv: Add model for Power8 PHB3 PCIe Host bridge

2018-09-12 Thread Cédric Le Goater
On 07/30/2018 07:17 PM, Cédric Le Goater wrote: > This is a model of the PCIe Host Bridge (PHB3) controller found on a > Power8 processor. The Power8 processor comes in different flavors: > Venice, Murano, Naple, each having a different number of PHBs. Multi > chip is supported, each chip adding

[Qemu-devel] [PATCH v6 03/25] replay: update docs for record/replay with block devices

2018-09-12 Thread Pavel Dovgalyuk
This patch updates the description of the command lines for using record/replay with attached block devices. Signed-off-by: Pavel Dovgalyuk --- docs/replay.txt | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/replay.txt b/docs/replay.txt index

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

2018-09-12 Thread Pavel Dovgalyuk
GDB remote protocol supports reverse debugging of the targets. It includes 'reverse step' and 'reverse continue' operations. The first one finds the previous step of the execution, and the second one is intended to stop at the last breakpoint that would happen when the program is executed

[Qemu-devel] [PATCH v6 01/25] block: implement bdrv_snapshot_goto for blkreplay

2018-09-12 Thread Pavel Dovgalyuk
From: Pavel Dovgalyuk This patch enables making snapshots with blkreplay used in block devices. This function is required to make bdrv_snapshot_goto without calling .bdrv_open which is not implemented. Signed-off-by: Pavel Dovgalyuk --- block/blkreplay.c |8 1 file changed, 8

[Qemu-devel] [PATCH v6 08/25] replay: provide and accessor for rr filename

2018-09-12 Thread Pavel Dovgalyuk
This patch adds an accessor function for the name of the record/replay log file. Adding an accessor instead of making variable global, prevents accidental modification of this variable by other modules. Signed-off-by: Pavel Dovgalyuk --- include/sysemu/replay.h |2 ++ replay/replay.c

[Qemu-devel] [PATCH v6 12/25] replay: flush events when exiting

2018-09-12 Thread 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 --- replay/replay-events.c | 14

[Qemu-devel] [PATCH v6 19/25] replay: allow loading any snapshots before recording

2018-09-12 Thread 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. Signed-off-by: Pavel

[Qemu-devel] [PATCH v6 16/25] gdbstub: add reverse step support in replay mode

2018-09-12 Thread Pavel Dovgalyuk
GDB remote protocol supports two reverse debugging commands: reverse step and reverse continue. This patch adds support of the first one to the gdbstub. Reverse step is intended to step one instruction in the backwards direction. This is not possible in regular execution. But replayed execution is

[Qemu-devel] [PATCH v6 22/25] replay: add BH oneshot event for block layer

2018-09-12 Thread Pavel Dovgalyuk
Replay is capable of recording normal BH events, but sometimes there are single use callbacks scheduled with aio_bh_schedule_oneshot function. This patch enables recording and replaying such callbacks. Block layer uses these events for calling the completion function. Replaying these calls makes

Re: [Qemu-devel] [PATCH v6 24/25] slirp: fix ipv6 timers

2018-09-12 Thread Samuel Thibault
Pavel Dovgalyuk, le mer. 12 sept. 2018 11:20:07 +0300, a ecrit: > 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

Re: [Qemu-devel] [PATCH] util/async: use qemu_aio_coroutine_enter in co_schedule_bh_cb

2018-09-12 Thread Fam Zheng
On Wed, 09/05 11:33, Sergio Lopez wrote: > AIO Coroutines shouldn't by managed by an AioContext different than the > one assigned when they are created. aio_co_enter avoids entering a > coroutine from a different AioContext, calling aio_co_schedule instead. > > Scheduled coroutines are then

[Qemu-devel] [PATCH v6 10/25] replay: introduce breakpoint at the specified step

2018-09-12 Thread Pavel Dovgalyuk
This patch introduces replay_break qmp and hmp commands. These commands allow stopping at the specified instruction. It may be useful for debugging when there are some known events that should be investigated. The commands have one argument - number of instructions executed since the start of the

[Qemu-devel] [PATCH v6 02/25] replay: disable default snapshot for record/replay

2018-09-12 Thread Pavel Dovgalyuk
From: Pavel Dovgalyuk This patch disables setting '-snapshot' option on by default in record/replay mode. This is needed for creating vmstates in record and replay modes. Signed-off-by: Pavel Dovgalyuk --- vl.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git

[Qemu-devel] [PATCH v6 05/25] replay: finish record/replay before closing the disks

2018-09-12 Thread Pavel Dovgalyuk
After recent updates block devices cannot be closed on qemu exit. This happens due to the block request polling when replay is not finished. Therefore now we stop execution recording before closing the block devices. Signed-off-by: Pavel Dovgalyuk --- replay/replay.c |2 ++ vl.c

[Qemu-devel] [PATCH v6 04/25] replay: don't drain/flush bdrv queue while RR is working

2018-09-12 Thread Pavel Dovgalyuk
In record/replay mode bdrv queue is controlled by replay mechanism. It does not allow saving or loading the snapshots when bdrv queue is not empty. Stopping the VM is not blocked by nonempty queue, but flushing the queue is still impossible there, because it may cause deadlocks in replay mode.

Re: [Qemu-devel] [PATCH v2 4/4] qemu_thread_create: propagate the error to callers to handle

2018-09-12 Thread Fam Zheng
On Fri, 09/07 21:39, Fei Li wrote: > Make qemu_thread_create() return a Boolean to indicate if it succeeds > rather than failing with an error. And add an Error parameter to hold > the error message and let the callers handle it. > > Besides, directly return if thread->data is NULL to avoid the >

[Qemu-devel] [PATCH v6 07/25] migration: introduce icount field for snapshots

2018-09-12 Thread Pavel Dovgalyuk
Saving icount as a parameters of the snapshot allows navigation between them in the execution replay scenario. This information can be used for finding a specific snapshot for rewinding the recorded execution to the specific moment of the time. E.g., 'reverse step' action needs to load the nearest

[Qemu-devel] [PATCH v6 14/25] translator: fix breakpoint processing

2018-09-12 Thread 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 breakpoints - instruction with

[Qemu-devel] [PATCH v6 13/25] replay: refine replay-time module

2018-09-12 Thread Pavel Dovgalyuk
This patch removes refactoring artifacts from the replay/replay-time.c Signed-off-by: Pavel Dovgalyuk --- replay/replay-time.c | 32 +--- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/replay/replay-time.c b/replay/replay-time.c index

[Qemu-devel] [PATCH v6 17/25] gdbstub: add reverse continue support in replay mode

2018-09-12 Thread Pavel Dovgalyuk
This patch adds support of the reverse continue operation for gdbstub. Reverse continue finds the last breakpoint that would happen in normal execution from the beginning to the current moment. Implementation of the reverse continue replays the execution twice: to find the breakpoints that were

Re: [Qemu-devel] [PATCH v8 0/8] Take the image size into account when allocating the L2 cache

2018-09-12 Thread Leonid Bloch
Hi Kevin & All, Sorry it took so long to send a new version! I had some very urgent things popping up on several fronts. I will send the new version over this weekend. Thanks for the reminder, and sorry again. Leonid. ___ On 9/10/18 5:33 PM, Kevin Wolf wrote: Hi Leonid, Am 13.08.2018 um

[Qemu-devel] [PATCH v6 24/25] slirp: fix ipv6 timers

2018-09-12 Thread 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: Pavel Dovgalyuk ---

[Qemu-devel] [PATCH v6 23/25] timer: introduce new virtual clock

2018-09-12 Thread 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 guest core (which includes

Re: [Qemu-devel] [PATCH v5 00/24] Fixing record/replay and adding reverse debugging

2018-09-12 Thread dovgaluk
Hi, Ciro! I found several issues in your command lines. Ciro Santilli писал 2018-08-08 02:13: OK, finally got some time to try it out, I'm using c42634d8e3428cfa60672c3ba89cabefc720cde9 from rr-180725. Replay works well as far as I can tell, so I moved to the reverse debugging:

Re: [Qemu-devel] [PATCH v2 2/4] ui/vnc.c: polish vnc_init_func

2018-09-12 Thread Fam Zheng
On Fri, 09/07 21:39, Fei Li wrote: > Add a new Error parameter for vnc_display_init() to handle errors > in its caller: vnc_init_func(), just like vnc_display_open() does. > And let the call trace propagate the Error. > > Besides, make vnc_start_worker_thread() return a bool to indicate > whether

[Qemu-devel] [PATCH v6 11/25] replay: implement replay-seek command to proceed to the desired step

2018-09-12 Thread Pavel Dovgalyuk
This patch adds hmp/qmp commands replay_seek/replay-seek that proceed the execution to the specified step. The commands automatically loads nearest snapshot and replay the execution to find the desired step. Signed-off-by: Pavel Dovgalyuk -- v2: - renamed replay_seek qmp command into

[Qemu-devel] [PATCH v6 20/25] replay: wake up vCPU when replaying

2018-09-12 Thread 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 could be the following

Re: [Qemu-devel] [PATCH] fw_cfg_mem: add read memory region callback

2018-09-12 Thread Marc-André Lureau
Hi On Wed, Sep 12, 2018 at 9:22 AM Li Qiang wrote: > > The write/read should be paired, this can avoid the > NULL-deref while the guest reads the fw_cfg port. > > Signed-off-by: Li Qiang Do you have a reproducer and/or a backtrace? memory_region_dispatch_write() checks if ops->write != NULL.

Re: [Qemu-devel] [PATCH v2 1/4] Fix segmentation fault when qemu_signal_init fails

2018-09-12 Thread Fam Zheng
On Fri, 09/07 21:38, Fei Li wrote: > Currently, when qemu_signal_init() fails it only returns a non-zero > value but without propagating any Error. But its callers need a > non-null err when runs error_report_err(err), or else 0->msg occurs. > > To avoid such segmentation fault, add a new Error

Re: [Qemu-devel] [PATCH V12 19/19] docs: Add COLO status diagram to COLO-FT.txt

2018-09-12 Thread Jason Wang
On 2018年09月03日 12:39, Zhang Chen wrote: From: Zhang Chen This diagram make user better understand COLO. Suggested by Markus Armbruster. Signed-off-by: Zhang Chen Signed-off-by: Zhang Chen --- docs/COLO-FT.txt | 34 ++ 1 file changed, 34 insertions(+)

Re: [Qemu-devel] Can I convert backing file to internal snapshot?

2018-09-12 Thread Fam Zheng
On Wed, 09/12 15:35, lampahome wrote: > I have two qcow2 A & B, and A is backing file of B. > > Can I convert both A to one image and containing data of both? > > ex: > one new image will contain data of A and B. When I check it by qemu-img > info, I can see one snapshot in the new image. I

[Qemu-devel] [PATCH v6 06/25] qcow2: introduce icount field for snapshots

2018-09-12 Thread Pavel Dovgalyuk
This patch introduces the icount field for saving within the snapshot. It is required for navigation between the snapshots in record/replay mode. Signed-off-by: Pavel Dovgalyuk -- v2: - documented format changes in docs/interop/qcow2.txt (suggested by Eric Blake) ---

[Qemu-devel] [PATCH v6 09/25] replay: introduce info hmp/qmp command

2018-09-12 Thread Pavel Dovgalyuk
This patch introduces 'info replay' monitor command and corresponding qmp request. These commands request the current record/replay mode, replay log file name, and the execution step (number or recorded/replayed instructions). Signed-off-by: Pavel Dovgalyuk Acked-by: Dr. David Alan Gilbert --

[Qemu-devel] [PATCH v6 18/25] replay: describe reverse debugging in docs/replay.txt

2018-09-12 Thread Pavel Dovgalyuk
This patch updates the documentation and describes usage of the reverse debugging in QEMU+GDB. Signed-off-by: Pavel Dovgalyuk --- docs/replay.txt | 33 + 1 file changed, 33 insertions(+) diff --git a/docs/replay.txt b/docs/replay.txt index f7def53..086d3f8

[Qemu-devel] [PATCH v6 15/25] replay: flush rr queue before loading the vmstate

2018-09-12 Thread Pavel Dovgalyuk
Non-empty record/replay queue prevents saving and loading the VM state, because it includes pending bottom halves and block coroutines. But when the new VM state is loaded, we don't have to preserve the consistency of the current state anymore. Therefore this patch just flushes the queue allowing

[Qemu-devel] [PATCH v6 25/25] ui: fix virtual timers

2018-09-12 Thread 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 virtual clock to the

[Qemu-devel] [PATCH] change get_image_size return type to int64_t

2018-09-12 Thread 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 directory

Re: [Qemu-devel] virtio-net sporadic error with QNX 7.0 guest: virtio-net ctrl missing headers

2018-09-12 Thread Claudio
Thank you both for your responses, and ciao Paolo, On 09/12/2018 02:37 PM, Michael S. Tsirkin wrote: > On Wed, Sep 12, 2018 at 10:01:34AM +0200, Claudio wrote: >> Hello Michael, Jason and all, >> >> I am currently using latest mainline QEMU on x86_64 to run a QNX 7 guest. >> >> QNX 7 is not free

[Qemu-devel] [PATCH 4/8] hw: pc-testdev: add read memory region callback

2018-09-12 Thread Li Qiang
From: Li Qiang Also change the write callback name. Signed-off-by: Li Qiang --- hw/misc/pc-testdev.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/hw/misc/pc-testdev.c b/hw/misc/pc-testdev.c index b81d820084..697eb88c97 100644 ---

[Qemu-devel] [PATCH 2/8] hw: debugexit: add read callback

2018-09-12 Thread Li Qiang
From: Li Qiang Signed-off-by: Li Qiang --- hw/misc/debugexit.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/misc/debugexit.c b/hw/misc/debugexit.c index 84fa1a5b9d..bed293247e 100644 --- a/hw/misc/debugexit.c +++ b/hw/misc/debugexit.c @@ -23,6 +23,11 @@ typedef struct

Re: [Qemu-devel] [RFC 3/3] vhost-user: support programming VFIO group in master

2018-09-12 Thread Alex Williamson
On Wed, 12 Sep 2018 12:14:44 -0400 "Michael S. Tsirkin" wrote: > On Wed, Sep 12, 2018 at 04:04:00PM +0800, Tiwei Bie wrote: > > On Mon, Jul 30, 2018 at 12:30:58PM +0300, Michael S. Tsirkin wrote: > > [...] > > > > > > I generally wonder how are restarts of the backend handled > > > with this

[Qemu-devel] [PATCH 1/3] aio-posix: fix concurrent access to poll_disable_cnt

2018-09-12 Thread Paolo Bonzini
It is valid for an aio_set_fd_handler to happen concurrently with aio_poll. In that case, poll_disable_cnt can change under the heels of aio_poll, and the assertion on poll_disable_cnt can fail in run_poll_handlers. Therefore, this patch simply checks the counter on every polling iteration.

[Qemu-devel] [PATCH 3/3] aio-posix: do skip system call if ctx->notifier polling succeeds

2018-09-12 Thread Paolo Bonzini
Commit 70232b5253 ("aio-posix: Don't count ctx->notifier as progress when 2018-08-15), by not reporting progress, causes aio_poll to execute the system call when polling succeeds because of ctx->notifier. This introduces latency before the call to aio_bh_poll() and negates the advantages of

[Qemu-devel] [Bug 1792193] [NEW] AMD Athlon(tm) X2 Dual-Core QL-64 bug

2018-09-12 Thread Kirill Bugaev
Public bug reported: I upgrade my qemu 2.12.0-2 => 3.0.0-1. After that I can't load virtual machine with "-cpu host" option. Full command line is qemu-system-x86_64 \ -monitor stdio \ -enable-kvm \ -cpu host \ -smp cpus=2 \ -m 1G \ -vga virtio \

Re: [Qemu-devel] [PATCH 1/3] display/edid: add edid generator to qemu.

2018-09-12 Thread Eric Blake
On 9/12/18 7:36 AM, Gerd Hoffmann wrote: EDID is a metadata format to describe monitors. On physical hardware the monitor has an eeprom with that data block which can be read over i2c bus. On a linux system you can usually find the EDID data block in /sys/class/drm/$card/$connector/edid. xorg

Re: [Qemu-devel] [PATCH v0 2/2] block: postpone the coroutine executing if the BDS's is drained

2018-09-12 Thread Denis Plotnikov
On 12.09.2018 16:15, Kevin Wolf wrote: Am 12.09.2018 um 14:03 hat Denis Plotnikov geschrieben: On 10.09.2018 15:41, Kevin Wolf wrote: Am 29.06.2018 um 14:40 hat Denis Plotnikov geschrieben: Fixes the problem of ide request appearing when the BDS is in the "drained section". Without the

[Qemu-devel] [PATCH v7 1/2] vl.c deprecate incorrect CPUs topology

2018-09-12 Thread Igor Mammedov
-smp [cpus],sockets/cores/threads[,maxcpus] should describe topology so that total number of logical CPUs [sockets * cores * threads] would be equal to [maxcpus], however historically we didn't have such check in QEMU and it is possible to start VM with an invalid topology. Deprecate invalid

[Qemu-devel] [PATCH v7 2/2] vl:c: make sure that sockets are calculated correctly in '-smp X' case

2018-09-12 Thread Igor Mammedov
commit (5cdc9b76e3 vl.c: Remove dead assignment) removed sockets calculation when 'sockets' weren't provided on CLI since there wasn't any users for it back then. Exiting checks are neither reachable } else if (sockets * cores * threads < cpus) { or nor triggable if (sockets * cores *

Re: [Qemu-devel] [PATCH] target/xtensa: fix s32c1i TCGMemOp flags

2018-09-12 Thread Richard Henderson
On 09/10/2018 06:32 PM, Max Filippov wrote: > s32c1i must load and store value with target endianness, not host. > This results in an infinite loop in atomic cmpxchg sequences when target > endianness doesn't match host endianness. > > Fixes: 9fb40342d4b3 ("target/xtensa: support MTTCG") > Cc:

Re: [Qemu-devel] [PATCH] qemu: Add virtio pmem device

2018-09-12 Thread Luiz Capitulino
On Fri, 31 Aug 2018 19:00:19 +0530 Pankaj Gupta wrote: > This patch adds virtio-pmem Qemu device. > > This device presents memory address range information to guest > which is backed by file backend type. It acts like persistent > memory device for KVM guest. Guest can perform read and >

Re: [Qemu-devel] [RFC 3/3] vhost-user: support programming VFIO group in master

2018-09-12 Thread Michael S. Tsirkin
On Wed, Sep 12, 2018 at 11:15:32AM -0600, Alex Williamson wrote: > On Wed, 12 Sep 2018 12:44:15 -0400 > "Michael S. Tsirkin" wrote: > > > On Wed, Sep 12, 2018 at 10:34:43AM -0600, Alex Williamson wrote: > > > On Wed, 12 Sep 2018 12:14:44 -0400 > > > "Michael S. Tsirkin" wrote: > > > > > > >

[Qemu-devel] Debugging PCI Enhanced Allocation - IOMMU of a bridge?

2018-09-12 Thread Alexander von Gluck IV
Good morning! I'm working through adding support (or at least ignoring) PCI Enhance Allocation devices under Haiku. We run into one of these devices, and crash at boot due to attempting to read an invalid address. Our testing showed that with a USB C dongle plugged in, we don't crash. Without

Re: [Qemu-devel] [PATCH] memory region: check the old.mmio.read status

2018-09-12 Thread Laszlo Ersek
On 09/12/18 16:28, Li Qiang wrote: > Peter Maydell 于2018年9月12日周三 下午8:55写道: > >> On 12 September 2018 at 13:32, Li Qiang wrote: >>> To avoid NULL-deref for the devices without read callbacks >>> >>> Signed-off-by: Li Qiang >>> --- >>> memory.c | 4 >>> 1 file changed, 4 insertions(+) >>>

Re: [Qemu-devel] [PATCH] Fix breakpoints in nios2 user-mode emulation.

2018-09-12 Thread Sandra Loosemore
On 09/12/2018 11:49 AM, Richard Henderson wrote: On 09/11/2018 02:29 PM, Sandra Loosemore wrote: Without this patch, QEMU exits immediately when it execution stops at a breakpoint, instead of reporting it to GDB. Signed-off-by: Sandra Loosemore --- linux-user/nios2/cpu_loop.c | 3 +++ 1

[Qemu-devel] [PATCH 0/8] Add missed read callback for some memory region

2018-09-12 Thread Li Qiang
From: Li Qiang This patch set try to add the missed read callback for memory region. Without this patchset, when the guest reads the IO port/memory, it will cause an NULL-dereference issue. For example, add "-device isa-debug-exit" to command, then read the 0x501 port, it causes a SIGSEGV.

Re: [Qemu-devel] [PATCH v5 1/2] vl.c deprecate incorrect CPUs topology

2018-09-12 Thread Igor Mammedov
On Mon, 10 Sep 2018 14:49:23 -0300 Eduardo Habkost wrote: > On Thu, Sep 06, 2018 at 10:02:13AM +0200, Igor Mammedov wrote: > > On Wed, 5 Sep 2018 10:45:12 -0300 > > Eduardo Habkost wrote: > > > > > On Wed, Sep 05, 2018 at 11:25:11AM +0200, Igor Mammedov wrote: > > > > On Tue, 4 Sep 2018

[Qemu-devel] [PATCH 7/8] hw: sun4c: add read memory region callback

2018-09-12 Thread Li Qiang
From: Li Qiang Signed-off-by: Li Qiang --- hw/sparc64/sun4u.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index d16843b30e..74c55a82f4 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -212,6 +212,11 @@ typedef struct PowerDevice

[Qemu-devel] [PATCH 3/8] hw: hyperv_testdev: add read callback

2018-09-12 Thread Li Qiang
From: Li Qiang Signed-off-by: Li Qiang --- 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 bf6bbfa8cf..7549f470b1 100644 --- a/hw/misc/hyperv_testdev.c +++

Re: [Qemu-devel] [RFC 3/3] vhost-user: support programming VFIO group in master

2018-09-12 Thread Michael S. Tsirkin
On Wed, Sep 12, 2018 at 04:04:00PM +0800, Tiwei Bie wrote: > On Mon, Jul 30, 2018 at 12:30:58PM +0300, Michael S. Tsirkin wrote: > [...] > > > > I generally wonder how are restarts of the backend handled > > with this approach: closing the VFIO device tends to reset > > the whole device. > > Hi

[Qemu-devel] [PATCH 6/8] hw: pvrdma: add read memory region callback

2018-09-12 Thread Li Qiang
From: Li Qiang Signed-off-by: Li Qiang --- hw/rdma/vmw/pvrdma_main.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/rdma/vmw/pvrdma_main.c b/hw/rdma/vmw/pvrdma_main.c index ca5fa8d981..a6211d416d 100644 --- a/hw/rdma/vmw/pvrdma_main.c +++ b/hw/rdma/vmw/pvrdma_main.c @@ -455,6

Re: [Qemu-devel] [PATCH 1/8] fw_cfg_mem: add read memory region callback

2018-09-12 Thread Eric Blake
On 9/12/18 11:01 AM, Li Qiang wrote: From: Li Qiang Signed-off-by: Li Qiang This commit message doesn't state why. The cover letter does, but that doesn't get checked into git. A year from now, if someone lands on this commit during a bisect, it would help if the commit message told them

Re: [Qemu-devel] [PATCH 0/8] Add missed read callback for some memory region

2018-09-12 Thread Philippe Mathieu-Daudé
Hi Li, On 9/12/18 6:01 PM, Li Qiang wrote: > From: Li Qiang > > This patch set try to add the missed read callback for memory region. > Without this patchset, when the guest reads the IO port/memory, it will > cause an NULL-dereference issue. For example, add > "-device isa-debug-exit" to

[Qemu-devel] [PATCH 2/3] aio-posix: compute timeout before polling

2018-09-12 Thread Paolo Bonzini
This is a preparation for the next patch, and also a very small optimization. Compute the timeout only once, before invoking try_poll_mode, and adjust it in run_poll_handlers. The adjustment is the polling time when polling fails, or zero (non-blocking) if polling succeeds. Fixes:

Re: [Qemu-devel] [PATCH] linux-user: don't short-circuit read with zero length

2018-09-12 Thread Richard Henderson
On 09/11/2018 05:03 AM, Andreas Schwab wrote: > +if (!(p = lock_user(VERIFY_WRITE, arg2, arg3, 0))) > +goto efault; The goto should not compile on head, after 2852aafd9d05. r~

Re: [Qemu-devel] [PATCH 3/3] display/stdvga: add edid support.

2018-09-12 Thread Eric Blake
On 9/12/18 7:37 AM, Gerd Hoffmann wrote: This patch adds edid support to the qemu stdvga. It is turned off by default and can be enabled with the new edid property. The patch also adds xres and yres properties to specify the video mode you want the guest use. Works only with edid enabled and

Re: [Qemu-devel] [PATCH v0 2/2] block: postpone the coroutine executing if the BDS's is drained

2018-09-12 Thread Kevin Wolf
Am 12.09.2018 um 16:53 hat Denis Plotnikov geschrieben: > On 12.09.2018 16:15, Kevin Wolf wrote: > > Am 12.09.2018 um 14:03 hat Denis Plotnikov geschrieben: > > > On 10.09.2018 15:41, Kevin Wolf wrote: > > > > Am 29.06.2018 um 14:40 hat Denis Plotnikov geschrieben: > > > > > Fixes the problem of

Re: [Qemu-devel] [libvirt] [PATCH v7 2/2] vl:c: make sure that sockets are calculated correctly in '-smp X' case

2018-09-12 Thread Eric Blake
On 9/12/18 11:19 AM, Igor Mammedov wrote: commit (5cdc9b76e3 vl.c: Remove dead assignment) removed sockets calculation when 'sockets' weren't provided on CLI since there wasn't any users for it back then. Exiting checks are neither reachable } else if (sockets * cores * threads < cpus) {

Re: [Qemu-devel] [RFC PATCH 06/10] block: Allow changing the backing file on reopen

2018-09-12 Thread Alberto Garcia
On Thu 21 Jun 2018 03:06:22 PM CEST, Kevin Wolf wrote: >> > Actually, do we ever use bdrv_reopen() for flags other than >> > read-only? Maybe we should get rid of that flags nonsense and >> > simply make it a bdrv_reopen_set_readonly() taking a boolean. >> >> I think that's a good idea. There's

[Qemu-devel] [PATCH 8/8] exec: add read callback for notdirty memory region

2018-09-12 Thread Li Qiang
From: Li Qiang Signed-off-by: Li Qiang --- exec.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/exec.c b/exec.c index 6826c8337d..3cd5ad2cae 100644 --- a/exec.c +++ b/exec.c @@ -2681,6 +2681,11 @@ void memory_notdirty_write_complete(NotDirtyInfo *ndi) } } +static uint64_t

[Qemu-devel] [PATCH 1/8] fw_cfg_mem: add read memory region callback

2018-09-12 Thread Li Qiang
From: Li Qiang Signed-off-by: Li Qiang --- 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 d79a568f54..6de7809f1a 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -434,6 +434,11 @@ static bool

[Qemu-devel] [PATCH v7 0/2] deprecate incorrect CPUs topolog

2018-09-12 Thread Igor Mammedov
Changelog since v5: * add(v6) and then remove(v7) Notes section to/from deprication doc (Eduardo Habkost ) * fix up wording and math formating in deprication doc (Eduardo Habkost ) * drop !socket check as it always evaluates to true at that point (Eduardo Habkost ) Changelog

Re: [Qemu-devel] [PATCH 4/6] i386: acpi: add IVHD device entry for IOAPIC

2018-09-12 Thread Igor Mammedov
On Tue, 11 Sep 2018 11:49:47 -0500 Brijesh Singh wrote: > When interrupt remapping is enabled, add a special IVHD device > (type IOAPIC) -- which is typically PCI device 14:0.0. Linux IOMMU driver > checks for this special device. > > Cc: "Michael S. Tsirkin" > Cc: Paolo Bonzini > Cc: Richard

Re: [Qemu-devel] [PATCH 3/3] virtio-pmem: Add virtio pmem driver

2018-09-12 Thread Luiz Capitulino
On Fri, 31 Aug 2018 19:00:18 +0530 Pankaj Gupta wrote: > This patch adds virtio-pmem driver for KVM guest. > > Guest reads the persistent memory range information from > Qemu over VIRTIO and registers it on nvdimm_bus. It also > creates a nd_region object with the persistent memory > range

Re: [Qemu-devel] virtio-net sporadic error with QNX 7.0 guest: virtio-net ctrl missing headers

2018-09-12 Thread Claudio
Hi Michael, On 09/12/2018 05:31 PM, Michael S. Tsirkin wrote: > On Wed, Sep 12, 2018 at 05:16:38PM +0200, Claudio wrote: >> Thank you both for your responses, >> >> and ciao Paolo, >> >> On 09/12/2018 02:37 PM, Michael S. Tsirkin wrote: >>> On Wed, Sep 12, 2018 at 10:01:34AM +0200, Claudio wrote:

Re: [Qemu-devel] [RFC 3/3] vhost-user: support programming VFIO group in master

2018-09-12 Thread Alex Williamson
On Wed, 12 Sep 2018 12:44:15 -0400 "Michael S. Tsirkin" wrote: > On Wed, Sep 12, 2018 at 10:34:43AM -0600, Alex Williamson wrote: > > On Wed, 12 Sep 2018 12:14:44 -0400 > > "Michael S. Tsirkin" wrote: > > > > > On Wed, Sep 12, 2018 at 04:04:00PM +0800, Tiwei Bie wrote: > > > > On Mon, Jul

Re: [Qemu-devel] virtio-net sporadic error with QNX 7.0 guest: virtio-net ctrl missing headers

2018-09-12 Thread Michael S. Tsirkin
On Wed, Sep 12, 2018 at 07:12:58PM +0200, Claudio wrote: > Hi Michael, > > On 09/12/2018 05:31 PM, Michael S. Tsirkin wrote: > > On Wed, Sep 12, 2018 at 05:16:38PM +0200, Claudio wrote: > >> Thank you both for your responses, > >> > >> and ciao Paolo, > >> > >> On 09/12/2018 02:37 PM, Michael S.

Re: [Qemu-devel] Debugging PCI Enhanced Allocation - IOMMU of a bridge?

2018-09-12 Thread Michael S. Tsirkin
On Wed, Sep 12, 2018 at 05:30:29PM +, Alexander von Gluck IV wrote: > Good morning! > > I'm working through adding support (or at least ignoring) PCI Enhance > Allocation devices under Haiku. > We run into one of these devices, and crash at boot due to attempting to read > an invalid address.

Re: [Qemu-devel] [PATCH] memory region: check the old.mmio.read status

2018-09-12 Thread Laszlo Ersek
On 09/12/18 14:54, Peter Maydell wrote: > On 12 September 2018 at 13:32, Li Qiang wrote: >> To avoid NULL-deref for the devices without read callbacks >> >> Signed-off-by: Li Qiang >> --- >> memory.c | 4 >> 1 file changed, 4 insertions(+) >> >> diff --git a/memory.c b/memory.c >> index

Re: [Qemu-devel] [PATCH] Fix breakpoints in nios2 user-mode emulation.

2018-09-12 Thread Richard Henderson
On 09/11/2018 02:29 PM, Sandra Loosemore wrote: > Without this patch, QEMU exits immediately when it execution stops at > a breakpoint, instead of reporting it to GDB. > > Signed-off-by: Sandra Loosemore > --- > linux-user/nios2/cpu_loop.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff

Re: [Qemu-devel] [PATCH 1/3] display/edid: add edid generator to qemu.

2018-09-12 Thread Richard Henderson
On 09/12/2018 05:36 AM, Gerd Hoffmann wrote: > +static struct edid_mode { > +uint32_t xres; > +uint32_t yres; > +uint32_t byte; > +uint32_t xtra3; > +uint32_t bit; > +} modes[] = { static const? r~

Re: [Qemu-devel] [RFC 3/3] vhost-user: support programming VFIO group in master

2018-09-12 Thread Michael S. Tsirkin
On Wed, Sep 12, 2018 at 10:34:43AM -0600, Alex Williamson wrote: > On Wed, 12 Sep 2018 12:14:44 -0400 > "Michael S. Tsirkin" wrote: > > > On Wed, Sep 12, 2018 at 04:04:00PM +0800, Tiwei Bie wrote: > > > On Mon, Jul 30, 2018 at 12:30:58PM +0300, Michael S. Tsirkin wrote: > > > [...] > > > > >

Re: [Qemu-devel] [PATCH] fw_cfg_mem: add read memory region callback

2018-09-12 Thread Eric Blake
On 9/12/18 7:33 AM, Li Qiang wrote: Do you have a reproducer and/or a backtrace? memory_region_dispatch_write() checks if ops->write != NULL. FWIW, looking at the codebase, there's a good number of static MemoryRegionOps structures for which the "read_with_attrs" and "read" members are

[Qemu-devel] [PATCH 0/3] aio-posix: polling mode bug fixes

2018-09-12 Thread Paolo Bonzini
Patch 1 fixes a too-strict assertion that could fire when aio_poll is called in parallel with aio_set_fd_handler. Patch 2 and 3 reinstate the performance benefits of polling, which were essentially disabled by commit 70232b5253 ("aio-posix: Don't count ctx->notifier as progress when polling",

Re: [Qemu-devel] virtio-net sporadic error with QNX 7.0 guest: virtio-net ctrl missing headers

2018-09-12 Thread Michael S. Tsirkin
On Wed, Sep 12, 2018 at 05:16:38PM +0200, Claudio wrote: > Thank you both for your responses, > > and ciao Paolo, > > On 09/12/2018 02:37 PM, Michael S. Tsirkin wrote: > > On Wed, Sep 12, 2018 at 10:01:34AM +0200, Claudio wrote: > >> Hello Michael, Jason and all, > >> > >> I am currently using

[Qemu-devel] [PATCH 5/8] hw: designware: add read memory region callback

2018-09-12 Thread Li Qiang
From: Li Qiang Signed-off-by: Li Qiang --- hw/pci-host/designware.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/hw/pci-host/designware.c b/hw/pci-host/designware.c index 29ea313798..f5641b5c8c 100644 --- a/hw/pci-host/designware.c +++ b/hw/pci-host/designware.c @@ -57,6 +57,12

Re: [Qemu-devel] [PATCH v0 2/2] block: postpone the coroutine executing if the BDS's is drained

2018-09-12 Thread Denis V. Lunev
On 09/12/2018 04:15 PM, Kevin Wolf wrote: > Am 12.09.2018 um 14:03 hat Denis Plotnikov geschrieben: >> On 10.09.2018 15:41, Kevin Wolf wrote: >>> Am 29.06.2018 um 14:40 hat Denis Plotnikov geschrieben: Fixes the problem of ide request appearing when the BDS is in the "drained section".

Re: [Qemu-devel] [PATCH 6/6] x86_iommu/amd: Enable Guest virtual APIC support

2018-09-12 Thread Igor Mammedov
On Tue, 11 Sep 2018 11:49:49 -0500 Brijesh Singh wrote: > Now that amd-iommu support interrupt remapping, enable the GASup in IVRS > table and GASup in extended feature register to indicate that IOMMU > support guest virtual APIC mode. > > Note that the GAMSup is set to zero to indicate that

Re: [Qemu-devel] [PATCH v2 00/12] qht improvements for 3.1

2018-09-12 Thread Richard Henderson
On 09/10/2018 11:58 AM, Emilio G. Cota wrote: > v1: https://github.com/cota/qemu/tree/qht-for-3.1-v2 > > Changes since v1: > > - Added Alex's R-b tags to patches 1-6 > - Added a patch to drop *ht from qht_iter and qht_iter_remove, > as suggested by Alex. > - Added some constification patches >

Re: [Qemu-devel] [libvirt] [PATCH v7 1/2] vl.c deprecate incorrect CPUs topology

2018-09-12 Thread Eric Blake
On 9/12/18 11:19 AM, Igor Mammedov wrote: -smp [cpus],sockets/cores/threads[,maxcpus] should describe topology so that total number of logical CPUs [sockets * cores * threads] would be equal to [maxcpus], however historically we didn't have such check in QEMU and it is possible to start VM with

Re: [Qemu-devel] [PATCH 2/2] hw/vfio/display: add ramfb support

2018-09-12 Thread Alex Williamson
On Tue, 11 Sep 2018 06:38:43 +0200 Gerd Hoffmann wrote: > Hi, > > > > type_register_static(_pci_dev_info); > > > +type_register_static(_pci_ramfb_dev_info); > > > My concern here is still all of the extra tooling that needs to be > > added to management layers above QEMU for this

Re: [Qemu-devel] [RFC 3/3] vhost-user: support programming VFIO group in master

2018-09-12 Thread Alex Williamson
On Wed, 12 Sep 2018 13:29:33 -0400 "Michael S. Tsirkin" wrote: > On Wed, Sep 12, 2018 at 11:15:32AM -0600, Alex Williamson wrote: > > On Wed, 12 Sep 2018 12:44:15 -0400 > > "Michael S. Tsirkin" wrote: > > > > > On Wed, Sep 12, 2018 at 10:34:43AM -0600, Alex Williamson wrote: > > > > On

[Qemu-devel] [PATCH v8 6/6] s390: doc: detailed specifications for AP virtualization

2018-09-12 Thread Tony Krowiak
This patch provides documentation describing the AP architecture and design concepts behind the virtualization of AP devices. It also includes an example of how to configure AP devices for exclusive use of KVM guests. Signed-off-by: Tony Krowiak --- MAINTAINERS |1 + docs/vfio-ap.txt |

[Qemu-devel] [PATCH v8 5/6] s390x/vfio: ap: Introduce VFIO AP device

2018-09-12 Thread Tony Krowiak
Introduces a VFIO based AP device. The device is defined via the QEMU command line by specifying: -device vfio-ap,sysfsdev= There may be only one vfio-ap device configured for a guest. The mediated matrix device is created by the VFIO AP device driver by writing a UUID to a sysfs attribute

Re: [Qemu-devel] [PATCH v4 1/9] target/mips: Introduce MXU registers

2018-09-12 Thread Richard Henderson
On 08/30/2018 12:30 PM, Craig Janeczek via Qemu-devel wrote: > +static const char * const mxuregnames[] = { > +"XR1", "XR2", "XR3", "XR4", "XR5", "XR6", "XR7", "XR8", > +"XR9", "XR10", "XR11", "XR12", "XR13", "XR14", "XR15", "XR16", > +}; XR16 is unused. Otherwise, Reviewed-by:

Re: [Qemu-devel] [PATCH v4 5/9] target/mips: Add MXU instruction S8LDD

2018-09-12 Thread Richard Henderson
On 08/30/2018 12:30 PM, Craig Janeczek via Qemu-devel wrote: > +gen_load_mxu_cr(t0); > +tcg_gen_andi_tl(t0, t0, MXUEN); > +tcg_gen_brcondi_tl(TCG_COND_NE, t0, MXUEN, l0); Probably MXUEN should be included in env->hflags, and therefore tested via ctx->hflags. (Which also means ending

Re: [Qemu-devel] [PATCH v2] target/mips: Initial support for MIPS R5900

2018-09-12 Thread Maciej W. Rozycki
Hi Fredrik, > Aleksandar, Aurelien, Maciej -- are you happy with this initial v2 patch? I have been more thorough on this occasion, and I do hope I have caught everything. See the notes below, in addition to what the others wrote. Please apply to v3 accordingly; I started writing this

Re: [Qemu-devel] [PATCH 4/6] i386: acpi: add IVHD device entry for IOAPIC

2018-09-12 Thread Brijesh Singh
On 09/11/2018 11:35 PM, Peter Xu wrote: On Tue, Sep 11, 2018 at 11:49:47AM -0500, Brijesh Singh wrote: When interrupt remapping is enabled, add a special IVHD device (type IOAPIC) -- which is typically PCI device 14:0.0. Linux IOMMU driver checks for this special device. Cc: "Michael S.

  1   2   >