[Qemu-devel] [PATCH v1 1/2] xlnx-zdma: Add a model of the Xilinx ZynqMP generic DMA

2018-04-28 Thread Francisco Iglesias
Add a model of the generic DMA found on Xilinx ZynqMP. Signed-off-by: Francisco Iglesias Signed-off-by: Edgar E. Iglesias --- hw/dma/Makefile.objs | 1 + hw/dma/xlnx-zdma.c | 833 + include/hw/dma/xlnx-zdma.h | 84 + 3 files chang

[Qemu-devel] [PATCH v1 2/2] xlnx-zynqmp: Connect the ZynqMP GDMA and ADMA

2018-04-28 Thread Francisco Iglesias
The ZynqMP contains two instances of a generic DMA, the GDMA, located in the FPD (full power domain), and the ADMA, located in LPD (low power domain). This patch adds these two DMAs to the ZynqMP board. Signed-off-by: Francisco Iglesias --- hw/arm/xlnx-zynqmp.c | 53

[Qemu-devel] [PATCH v1 0/2] xlnx-zynqmp: Add emulation of the ZynqMP GDMA and ADMA

2018-04-28 Thread Francisco Iglesias
Hi, The ZynqMP Soc contains two separate instances of a generic DMA, one located in the FPD (full power domain) called GDMA and a second one located in the LPD (low power domain) called ADMA. This patch series attempts to add emulation support for these two DMAs on the ZynqMP board. The first patc

[Qemu-devel] Unix signal to send ACPI-shutdown to Guest

2018-04-28 Thread Andrew Wood via Qemu-devel
Ive been looking into the possibility of using a unix signal to send an acpi shutdown request to a VM, and came across a posting on this l in March 1. See https://lists.nongnu.org/archive/html/qemu-devel/2017-03/msg04169.html To summarise to refresh memories  there was a patch proposed using

[Qemu-devel] [Bug 1766904] Re: Creating high hdd load (with constant fsyncs) on a SATA disk leads to freezes and errors in guest dmesg

2018-04-28 Thread Jake
I am getting the exact same issue. The freeze occurred when I tried to install Ubuntu 18.04 with qemu-2.12. However, it seems to be working just fine with qemu-2.11.1. So it seems that something in between 2.11.1 and 2.12 is the culprit. -- You received this bug notification because you are a mem

[Qemu-devel] [PATCH 1/2] qcow2: Repair OFLAG_COPIED when fixing leaks

2018-04-28 Thread Max Reitz
Repairing OFLAG_COPIED is usually safe because it is done after the refcounts have been repaired. Therefore, it we did not find anyone else referencing a data or L2 cluster, it makes no sense to not set OFLAG_COPIED -- and the other direction (clearing OFLAG_COPIED) is always safe, anyway, it may

[Qemu-devel] [PATCH 2/2] iotests: Repairing error during snapshot deletion

2018-04-28 Thread Max Reitz
This adds a test for an I/O error during snapshot deletion, and maybe more importantly, for how to repair the resulting image. If the snapshot has been deleted before the error occurs, the only negative result will be leaked clusters -- and those should be repairable with qemu-img check -r leaks.

[Qemu-devel] [PATCH 0/2] qcow2: Repair OFLAG_COPIED when fixing leaks

2018-04-28 Thread Max Reitz
Suppose you have an image with consistent OFLAG_COPIED and refcounts. Now further suppose that image has leaked clusters (single reference, but refcount 2). When checking such an image with qemu-img check, it will notify you of the leakage, and that's it. Now when trying to repair that image, you

[Qemu-devel] [PATCH 1/5] qemu-io: Drop command functions' return values

2018-04-28 Thread Max Reitz
For qemu-io, a function returns an integer with two possible values: 0 for "qemu-io may continue execution", or 1 for "qemu-io should exit". However, there is only a single command that returns 1, and that is "quit". So let's turn this case into a global variable instead so we can make better use

[Qemu-devel] [PATCH 5/5] iotests: Let 216 make use of qemu-io's exit code

2018-04-28 Thread Max Reitz
As a showcase of how you can use qemu-io's exit code to determine success or failure (same for qemu-img), this test is changed to use qemu_io_silent() instead of qemu_io(), and to assert the exit code instead of logging the filtered result. One real advantage of this is that in case of an error, y

[Qemu-devel] [PATCH 2/5] qemu-io: Let command functions return error code

2018-04-28 Thread Max Reitz
This is basically what everything else in the qemu code base does, so we can do it here, too. Signed-off-by: Max Reitz --- include/qemu-io.h | 4 +- qemu-io-cmds.c| 346 -- qemu-io.c | 34 -- 3 files changed, 227 insertions(+

[Qemu-devel] [PATCH 3/5] qemu-io: Exit with error when a command failed

2018-04-28 Thread Max Reitz
Currently, qemu-io basically always returns success when it gets to interactive mode (so once the whole command line has been parsed; even before the commands on the command line are interpreted). That is not very useful. This patch makes qemu-io return failure when any of the executed commands f

[Qemu-devel] [PATCH 4/5] iotests.py: Add qemu_io_silent

2018-04-28 Thread Max Reitz
With qemu-io now returning a useful exit code, some tests may find it sufficient to just query that instead of logging (and filtering) the whole output. Signed-off-by: Max Reitz --- tests/qemu-iotests/iotests.py | 9 + 1 file changed, 9 insertions(+) diff --git a/tests/qemu-iotests/iote

[Qemu-devel] [PATCH 0/5] qemu-io: Exit with error when a command failed

2018-04-28 Thread Max Reitz
Right now, qemu-io's exit code is rather useless as it is usually 0. Except sometimes, then it's 1 in case of an error (mostly when you specify a filename as an argument and it cannot open that). At the same time, most command functions' return values are rather useless as they are usually 0 (mean

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

2018-04-28 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 Dovga

[Qemu-devel] [RFC PATCH v2 15/19] replay: flush rr queue before loading the vmstate

2018-04-28 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 t

[Qemu-devel] [RFC PATCH v2 12/19] timer: remove replay clock probe in deadline calculation

2018-04-28 Thread Pavel Dovgalyuk
Ciro Santilli reported that commit a5ed352596a8b7eb2f9acce34371b944ac3056c4 breaks the execution replay. It happens due to the probing the clock for the new instances of iothread. However, this probing was made in replay mode for the timer lists that are empty. This patch removes clock probing in r

[Qemu-devel] [RFC PATCH v2 11/19] replay: flush events when exitting

2018-04-28 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] [RFC PATCH v2 06/19] qcow2: introduce icount field for snapshots

2018-04-28 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) --- block/qcow2-snapshot.c

[Qemu-devel] [RFC PATCH v2 17/19] gdbstub: add reverse continue support in replay mode

2018-04-28 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 hit

[Qemu-devel] [RFC PATCH v2 18/19] replay: describe reverse debugging in docs/replay.txt

2018-04-28 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 1006

[Qemu-devel] [RFC PATCH v2 08/19] replay: introduce info hmp/qmp command

2018-04-28 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 -- v2: - renamed info_replay qmp int

[Qemu-devel] [RFC PATCH v2 14/19] translator: fix breakpoint processing

2018-04-28 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 bre

[Qemu-devel] [RFC PATCH v2 16/19] gdbstub: add reverse step support in replay mode

2018-04-28 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] [RFC PATCH v2 07/19] migration: introduce icount field for snapshots

2018-04-28 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] [RFC PATCH v2 05/19] replay: finish record/replay before closing the disks

2018-04-28 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] [RFC PATCH v2 13/19] replay: refine replay-time module

2018-04-28 Thread Pavel Dovgalyuk
This patch removes refactoring artifacts from the replay/replay-time.c Signed-off-by: Pavel Dovgalyuk --- replay/replay-time.c | 27 ++- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/replay/replay-time.c b/replay/replay-time.c index 6a7565e..40030b8 10

[Qemu-devel] [RFC PATCH v2 03/19] replay: update docs for record/replay with block devices

2018-04-28 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 2e21e9c..f7de

[Qemu-devel] [RFC PATCH v2 09/19] replay: introduce breakpoint at the specified step

2018-04-28 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 r

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

2018-04-28 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. This

[Qemu-devel] [RFC PATCH v2 10/19] replay: implement replay-seek command to proceed to the desired step

2018-04-28 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 replay-se

[Qemu-devel] [RFC PATCH v2 00/19] reverse debugging

2018-04-28 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 normally.

[Qemu-devel] [RFC PATCH v2 02/19] replay: disable default snapshot for record/replay

2018-04-28 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 a/vl

[Qemu-devel] [RFC PATCH v2 01/19] block: implement bdrv_snapshot_goto for blkreplay

2018-04-28 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 inse

Re: [Qemu-devel] [PATCH v2 3/9] block: Add BDRV_REQ_WRITE_UNCHANGED flag

2018-04-28 Thread Max Reitz
On 2018-04-26 04:12, Eric Blake wrote: > On 04/25/2018 10:08 AM, Max Reitz wrote: > >> >>> Also, that does raise the question of whether you have more work to >>> support write-zero requests with WRITE_UNCHANGED (which indeed sounds >>> like something plausible to support). >> >> I'm afraid I don'

Re: [Qemu-devel] [PATCH 2/3] block/file-posix: File locking during creation

2018-04-28 Thread Max Reitz
On 2018-04-27 08:22, Fam Zheng wrote: > On Sat, 04/21 00:09, Max Reitz wrote: >> When creating a file, we should take the WRITE and RESIZE permissions. >> We do not need either for the creation itself, but we do need them for >> clearing and resizing it. So we can take the proper permissions by >>

Re: [Qemu-devel] [RFC v2 1/2] virtio: add pmem driver

2018-04-28 Thread Pankaj Gupta
> > > > +int err; > > > > + > > > > +sg_init_one(&sg, buf, sizeof(buf)); > > > > + > > > > +err = virtqueue_add_outbuf(vpmem->req_vq, &sg, 1, buf, > > > > GFP_KERNEL); > > > > + > > > > +if (err) { > > > > +dev_err(&vdev->dev, "failed to send comman

Re: [Qemu-devel] [RFC PATCH 00/17] reverse debugging

2018-04-28 Thread Ciro Santilli
On Sat, Apr 28, 2018 at 10:27 AM, Pavel Dovgalyuk wrote: > > >> -Original Message- >> From: Ciro Santilli [mailto:ciro.santi...@gmail.com] >> Sent: Saturday, April 28, 2018 11:13 AM >> To: Pavel Dovgalyuk >> Subject: Re: [RFC PATCH 00/17] reverse debugging >> >> Forgetting about debugging,

[Qemu-devel] [RFC v2] tcg: workaround branch instruction overflow in tcg_out_qemu_ld/st

2018-04-28 Thread Laurent Vivier
ppc64 uses a BC instruction to call the tcg_out_qemu_ld/st slow path. BC instruction uses a relative address encoded on 14 bits. The slow path functions are added at the end of the generated instructions buffer, in the reverse order of the callers. So more we have slow path functions more the dist

Re: [Qemu-devel] [RFC PATCH 00/17] reverse debugging

2018-04-28 Thread Ciro Santilli
On Sat, Apr 28, 2018 at 9:12 AM, Pavel Dovgalyuk wrote: >> From: Ciro Santilli [mailto:ciro.santi...@gmail.com] >> On Thu, Apr 26, 2018 at 1:34 PM, Pavel Dovgalyuk wrote: >> >> From: Ciro Santilli [mailto:ciro.santi...@gmail.com] >> >> On Wed, Apr 25, 2018 at 1:45 PM, Pavel Dovgalyuk >> >> wrote

[Qemu-devel] Fwd: [RFC PATCH 00/17] reverse debugging

2018-04-28 Thread Ciro Santilli
Forgetting about debugging, I belive there is a deadlock in the replay at 63d426dfa4fbfac3d50cda3f553cd975de2b85ea , but it is rare. I have only reproduced it on ARM so far, and I haven't checked pre-patch. The setup is https://github.com/cirosantilli/qemu-test/tree/6a3497f0d84e7c86ef80f7322e24e

[Qemu-devel] [PATCH] migration: fix saving normal page even if it's been compressed

2018-04-28 Thread guangrong . xiao
From: Xiao Guangrong Fix the bug introduced by da3f56cb2e767016 (migration: remove ram_save_compressed_page()), It should be 'return' rather than 'res' Sorry for this stupid mistake :( Signed-off-by: Xiao Guangrong --- migration/ram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) dif