Re: [Qemu-devel] [PATCH v3 3/3] migration: add bitmap for received page

2017-06-23 Thread Perevalov Alexey
On Fri, Jun 23, 2017 at 11:29:42AM +0100, Dr. David Alan Gilbert wrote: > * Alexey Perevalov (a.pereva...@samsung.com) wrote: > > This patch adds ability to track down already received > > pages, it's necessary for calculation vCPU block time in > > postcopy migration feature, maybe for restore aft

Re: [Qemu-devel] [PATCH v3 3/3] migration: add bitmap for received page

2017-06-23 Thread Perevalov Alexey
On Wed, Jun 21, 2017 at 09:22:07PM +0200, Juan Quintela wrote: > Alexey Perevalov wrote: > > This patch adds ability to track down already received > > pages, it's necessary for calculation vCPU block time in > > postcopy migration feature, maybe for restore after > > postcopy migration failure. >

Re: [Qemu-devel] [PATCH v2 3/4] qcow2: add shrink image support

2017-06-23 Thread Max Reitz
On 2017-06-22 15:57, Pavel Butsykin wrote: > > On 22.06.2017 01:55, Max Reitz wrote: >> On 2017-06-13 14:16, Pavel Butsykin wrote: >>> This patch add shrinking of the image file for qcow2. As a result, >>> this allows >>> us to reduce the virtual image size and free up space on the disk >>> withou

Re: [Qemu-devel] [PATCH v2 4/4] qemu-iotests: add shrinking image test

2017-06-23 Thread Max Reitz
On 2017-06-13 14:16, Pavel Butsykin wrote: > Signed-off-by: Pavel Butsykin > --- > tests/qemu-iotests/163 | 113 > + > tests/qemu-iotests/163.out | 5 ++ > tests/qemu-iotests/group | 1 + > 3 files changed, 119 insertions(+) > create mode 10

Re: [Qemu-devel] [PATCH v3 13/18] target/s390x: Implement CONVERT UNICODE insns

2017-06-23 Thread Aurelien Jarno
On 2017-06-19 17:04, Richard Henderson wrote: > diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def > index 9c8f184..634ef98 100644 > --- a/target/s390x/insn-data.def > +++ b/target/s390x/insn-data.def > @@ -313,6 +313,19 @@ > C(0xb3a1, CDLGBR, RRF_e, FPE, 0, r2_o, f1, 0, cdl

Re: [Qemu-devel] [PATCH v3 15/18] target/s390x: Implement SRSTU

2017-06-23 Thread Aurelien Jarno
On 2017-06-19 17:04, Richard Henderson wrote: > Signed-off-by: Richard Henderson > --- > target/s390x/helper.h | 1 + > target/s390x/insn-data.def | 2 ++ > target/s390x/mem_helper.c | 44 > target/s390x/translate.c | 8 > 4 files c

Re: [Qemu-devel] [PATCH v3 18/18] target/s390x: Clean up TB flag bits

2017-06-23 Thread Aurelien Jarno
On 2017-06-19 17:04, Richard Henderson wrote: > Most of the PSW bits that were being copied into TB->flags > are not relevant to translation. Removing those that are > unnecessary reduces the amount of translation required. > > Signed-off-by: Richard Henderson > --- > target/s390x/cpu.h |

Re: [Qemu-devel] [PATCHv6 3/5] fw_cfg: move assert() and linking of fw_cfg device to the machine into instance_init()

2017-06-23 Thread Laszlo Ersek
On 06/23/17 13:50, Eduardo Habkost wrote: > On Fri, Jun 23, 2017 at 09:12:01AM +0100, Mark Cave-Ayland wrote: >> On 21/06/17 14:23, Eduardo Habkost wrote: >> >>> I now have a v7 patchset ready to go (currently hosted at >>> https://github.com/mcayland/qemu/tree/fwcfg7 for the curious). Lasz

Re: [Qemu-devel] [PATCH v3 14/18] target/s390x: Tidy SRST

2017-06-23 Thread Aurelien Jarno
On 2017-06-19 17:04, Richard Henderson wrote: > Since we require all registers saved on input, read R0 from ENV instead > of passing it manually. Recognize the specification exception when R0 > contains incorrect data. > > Signed-off-by: Richard Henderson > --- > target/s390x/helper.h | 2

Re: [Qemu-devel] [PATCH v3 16/18] target/s390x: Implement TRTR

2017-06-23 Thread Aurelien Jarno
On 2017-06-19 17:04, Richard Henderson wrote: > Drop TRT from the set of insns handled internally by EXECUTE. > It's more important to adjust the existing helper to handle > both TRT and TRTR. > > Signed-off-by: Richard Henderson > --- > target/s390x/helper.h | 1 + > target/s390x/insn-dat

Re: [Qemu-devel] [PATCH v3 17/18] target/s390x: Mark ETF3 and ETF3_ENH facilities as available

2017-06-23 Thread Aurelien Jarno
On 2017-06-19 17:04, Richard Henderson wrote: > Signed-off-by: Richard Henderson > --- > target/s390x/cpu_models.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c > index be7757c..16129f6 100644 > --- a/target/s390x/cpu_models.c >

Re: [Qemu-devel] [PATCH v2 1/4] qapi/qnull: Add own header

2017-06-23 Thread Max Reitz
On 2017-06-22 16:41, Markus Armbruster wrote: > Max Reitz writes: > >> On 2017-06-21 18:24, Markus Armbruster wrote: >>> Max Reitz writes: >>> Reviewed-by: Kevin Wolf Signed-off-by: Max Reitz --- include/qapi/qmp/qnull.h | 26 ++ include/qapi

Re: [Qemu-devel] [PATCH v3 00/18] target/s390x improvements

2017-06-23 Thread Aurelien Jarno
On 2017-06-19 17:03, Richard Henderson wrote: > Changes since v2: > * Dropped the enforcement of PGM_OPERATION for insns for > which the feature bit is set. There's no agreement on > exactly how to do this yet. > * Add implementations of insns for 6 more facilities. > > I think we can

Re: [Qemu-devel] [PATCH] target/ppc/cpu-models: set POWER9_v1.0 as POWER9 DD1

2017-06-23 Thread Thomas Huth
On 23.06.2017 11:21, David Gibson wrote: > On Thu, Jun 22, 2017 at 01:31:24PM +0200, Thomas Huth wrote: >> On 22.06.2017 13:26, Laurent Vivier wrote: >>> CPU_POWERPC_POWER9_DD1 is 0x004E0100, so this is the POWER9 v1.0. >>> >>> When we run qemu on a POWER9 DD1 host, we must use either >>> "-cpu hos

Re: [Qemu-devel] [RFC v2 3/8] virtio_iommu: add skeleton

2017-06-23 Thread Jean-Philippe Brucker
On 06/08/2017 12:09 PM, Bharat Bhushan wrote: >> From: Eric Auger [mailto:eric.au...@redhat.com] >> Sent: Wednesday, June 07, 2017 9:31 PM >> To: eric.auger@gmail.com; eric.au...@redhat.com; >> peter.mayd...@linaro.org; alex.william...@redhat.com; m...@redhat.com; >> qemu-...@nongnu.org; qemu-d

Re: [Qemu-devel] [RFC v2 6/8] virtio-iommu: Implement the translation and commands

2017-06-23 Thread Jean-Philippe Brucker
On 07/06/17 17:01, Eric Auger wrote: > This patch adds the actual implementation for the translation routine > and the virtio-iommu commands. > > Signed-off-by: Eric Auger > > ---[...] > static int virtio_iommu_attach(VirtIOIOMMU *s, > struct virtio_iommu_req_att

Re: [Qemu-devel] [PATCHv6 3/5] fw_cfg: move assert() and linking of fw_cfg device to the machine into instance_init()

2017-06-23 Thread Eduardo Habkost
On Fri, Jun 23, 2017 at 05:52:03PM +0200, Laszlo Ersek wrote: > On 06/23/17 13:50, Eduardo Habkost wrote: > > On Fri, Jun 23, 2017 at 09:12:01AM +0100, Mark Cave-Ayland wrote: > >> On 21/06/17 14:23, Eduardo Habkost wrote: > >> > >>> I now have a v7 patchset ready to go (currently hosted at > >

[Qemu-devel] [PATCH v3 1/2] hw/unimp: add missing include

2017-06-23 Thread Philippe Mathieu-Daudé
inlined create_unimplemented_device() calls sysbus_mmio_map_overlap(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Eric Blake --- include/hw/misc/unimp.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/hw/misc/unimp.h b/include/hw/misc/unimp.h index 3462d85836..52e068ec3e 1

[Qemu-devel] [PATCH v3 0/2] hw/unimp: add MAINTAINERS entry and missing include

2017-06-23 Thread Philippe Mathieu-Daudé
I separated these patches from the previous series "various easy cleanups". Add an entry in MAINTAINERS for the "Unimplemented" device, voluntary myself as reviewer, fix a missing include. Regards, Phil. Philippe Mathieu-Daudé (2): hw/unimp: add missing include MAINTAINERS: add entry for "U

[Qemu-devel] [PATCH v3 2/2] MAINTAINERS: add entry for "Unimplemented" device

2017-06-23 Thread Philippe Mathieu-Daudé
Also voluntary myself as reviewer Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 7b7543a54e..6febb4f9ab 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1160,6 +1160,13 @@ F: docs/specs/vmgenid.txt F

[Qemu-devel] [PULL 02/61] qemu-iotests: Allow starting new qemu after cleanup

2017-06-23 Thread Kevin Wolf
After _cleanup_qemu(), test cases should be able to start the next qemu process and call _cleanup_qemu() for that one as well. For this to work cleanly, we need to improve the cleanup so that the second invocation doesn't try to kill the qemu instances from the first invocation a second time (which

[Qemu-devel] [PULL 01/61] commit: Fix completion with extra reference

2017-06-23 Thread Kevin Wolf
commit_complete() can't assume that after its block_job_completed() the job is actually immediately freed; someone else may still be holding references. In this case, the op blockers on the intermediate nodes make the graph reconfiguration in the completion code fail. Call block_job_remove_all_bdr

[Qemu-devel] [PULL 04/61] block: count bdrv_co_rw_vmstate() requests

2017-06-23 Thread Kevin Wolf
From: Stefan Hajnoczi Call bdrv_inc/dec_in_flight() for vmstate reads/writes. This seems unnecessary at first glance because vmstate reads/writes are done synchronously while the guest is stopped. But we need the bdrv_wakeup() in bdrv_dec_in_flight() so the main loop sees request completion. Be

[Qemu-devel] [PULL 12/61] migration: hold AioContext lock for loadvm qemu_fclose()

2017-06-23 Thread Kevin Wolf
From: Stefan Hajnoczi migration_incoming_state_destroy() uses qemu_fclose() on the vmstate file. Make sure to call it inside an AioContext acquire/release region. This fixes an 'qemu: qemu_mutex_unlock: Operation not permitted' abort in loadvm. This patch closes the vmstate file before ending

[Qemu-devel] [PULL 00/61] Block layer patches

2017-06-23 Thread Kevin Wolf
The following changes since commit 4c8c1cc544dbd5e2564868e61c5037258e393832: Merge remote-tracking branch 'remotes/vivier/tags/m68k-for-2.10-pull-request' into staging (2017-06-22 19:01:58 +0100) are available in the git repository at: git://repo.or.cz/qemu/kevin.git tags/for-upstream for

[Qemu-devel] [PULL 05/61] block: use BDRV_POLL_WHILE() in bdrv_rw_vmstate()

2017-06-23 Thread Kevin Wolf
From: Stefan Hajnoczi Calling aio_poll() directly may have been fine previously, but this is the future, man! The difference between an aio_poll() loop and BDRV_POLL_WHILE() is that BDRV_POLL_WHILE() releases the AioContext around aio_poll(). This allows the IOThread to run fd handlers or BHs t

[Qemu-devel] [PULL 03/61] qemu-iotests: Test exiting qemu with running job

2017-06-23 Thread Kevin Wolf
When qemu is exited, all running jobs should be cancelled successfully. This adds a test for this for all types of block jobs that currently exist in qemu. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- tests/qemu-iotests/185 | 206 + tests

[Qemu-devel] [PULL 19/61] qcow2: Make perform_cow() call do_perform_cow() twice

2017-06-23 Thread Kevin Wolf
From: Alberto Garcia Instead of calling perform_cow() twice with a different COW region each time, call it just once and make perform_cow() handle both regions. This patch simply moves code around. The next one will do the actual reordering of the COW operations. Signed-off-by: Alberto Garcia

[Qemu-devel] [PULL 06/61] migration: avoid recursive AioContext locking in save_vmstate()

2017-06-23 Thread Kevin Wolf
From: Stefan Hajnoczi AioContext was designed to allow nested acquire/release calls. It uses a recursive mutex so callers don't need to worry about nesting...or so we thought. BDRV_POLL_WHILE() is used to wait for block I/O requests. It releases the AioContext temporarily around aio_poll(). T

[Qemu-devel] [PULL 10/61] throttle: Update throttle-groups.c documentation

2017-06-23 Thread Kevin Wolf
From: Alberto Garcia There used to be throttle_timers_{detach,attach}_aio_context() calls in bdrv_set_aio_context(), but since 7ca7f0f6db1fedd28d490795d778cf239 they are now in blk_set_aio_context(). Signed-off-by: Alberto Garcia Reviewed-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- blo

[Qemu-devel] [PULL 20/61] qcow2: Split do_perform_cow() into _read(), _encrypt() and _write()

2017-06-23 Thread Kevin Wolf
From: Alberto Garcia This patch splits do_perform_cow() into three separate functions to read, encrypt and write the COW regions. perform_cow() can now read both regions first, then encrypt them and finally write them to disk. The memory allocation is also done in this function now, using one si

[Qemu-devel] [PULL 09/61] doc: Document driver-specific -blockdev options

2017-06-23 Thread Kevin Wolf
This documents the driver-specific options for the raw, qcow2 and file block drivers for the man page. For everything else, we refer to the QAPI documentation. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Max Reitz --- qemu-options.hx | 115 +++

[Qemu-devel] [PULL 08/61] doc: Document generic -blockdev options

2017-06-23 Thread Kevin Wolf
This adds documentation for the -blockdev options that apply to all nodes independent of the block driver used. All options that are shared by -blockdev and -drive are now explained in the section for -blockdev. The documentation of -drive mentions that all -blockdev options are accepted as well.

[Qemu-devel] [PULL 11/61] virtio-pci: use ioeventfd even when KVM is disabled

2017-06-23 Thread Kevin Wolf
From: Stefan Hajnoczi Old kvm.ko versions only supported a tiny number of ioeventfds so virtio-pci avoids ioeventfds when kvm_has_many_ioeventfds() returns 0. Do not check kvm_has_many_ioeventfds() when KVM is disabled since it always returns 0. Since commit 8c56c1a592b5092d91da8d8943c1d646

[Qemu-devel] [PULL 07/61] migration: use bdrv_drain_all_begin/end() instead bdrv_drain_all()

2017-06-23 Thread Kevin Wolf
From: Stefan Hajnoczi blk/bdrv_drain_all() only takes effect for a single instant and then resumes block jobs, guest devices, and other external clients like the NBD server. This can be handy when performing a synchronous drain before terminating the program, for example. Monitor commands usual

[Qemu-devel] [PULL 28/61] qed: Remove callback from qed_read_l2_table()

2017-06-23 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi --- block/qed-cluster.c | 94 ++--- block/qed-table.c | 15 +++-- block/qed.h | 3 +- 3 files changed, 36 insertions(+), 76 deletions(-) diff --git a/bl

[Qemu-devel] [PULL 13/61] qemu-iotests: 068: extract _qemu() function

2017-06-23 Thread Kevin Wolf
From: Stefan Hajnoczi Avoid duplicating the QEMU command-line. Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- tests/qemu-iotests/068 | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/qemu-iotests/068 b/tests/qemu-iotests/068 index 9c1687d.

[Qemu-devel] [PULL 15/61] qemu-iotests: 068: test iothread mode

2017-06-23 Thread Kevin Wolf
From: Stefan Hajnoczi Perform the savevm/loadvm test with both iothread on and off. This covers the recently found savevm/loadvm hang when iothread is enabled. Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- tests/qemu-iotests/068 | 23 ++- tests/qemu-iot

[Qemu-devel] [PULL 30/61] qed: Make qed_read_backing_file() synchronous

2017-06-23 Thread Kevin Wolf
Note that this code is generally not running in coroutine context, so this is an actual blocking synchronous operation. We'll fix this in a moment. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi --- block/qed.c | 32 ++-- 1 file chang

[Qemu-devel] [PULL 17/61] qcow2: Remove unused Error variable in do_perform_cow()

2017-06-23 Thread Kevin Wolf
From: Alberto Garcia We are using the return value of qcow2_encrypt_sectors() to detect problems but we are throwing away the returned Error since we have no way to report it to the user. Therefore we can simply get rid of the local Error variable and pass NULL instead. Alternatively we could tr

[Qemu-devel] [PULL 14/61] qemu-iotests: 068: use -drive/-device instead of -hda

2017-06-23 Thread Kevin Wolf
From: Stefan Hajnoczi The legacy -hda option does not support -drive/-device parameters. They will be required by the next patch that extends this test case. Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- tests/qemu-iotests/068 | 7 ++- 1 file changed, 6 insertions(+), 1 de

[Qemu-devel] [PULL 18/61] qcow2: Use unsigned int for both members of Qcow2COWRegion

2017-06-23 Thread Kevin Wolf
From: Alberto Garcia Qcow2COWRegion has two attributes: - The offset of the COW region from the start of the first cluster touched by the I/O request. Since it's always going to be positive and the maximum request size is at most INT_MAX, we can use a regular unsigned int to store this off

[Qemu-devel] [PULL 31/61] qed: Make qed_copy_from_backing_file() synchronous

2017-06-23 Thread Kevin Wolf
Note that this code is generally not running in coroutine context, so this is an actual blocking synchronous operation. We'll fix this in a moment. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi --- block/qed.c | 78 +++---

[Qemu-devel] [PULL 21/61] qcow2: Allow reading both COW regions with only one request

2017-06-23 Thread Kevin Wolf
From: Alberto Garcia Reading both COW regions requires two separate requests, but it's perfectly possible to merge them and perform only one. This generally improves performance, particularly on rotating disk drives. The downside is that the data in the middle region is read but discarded. This

[Qemu-devel] [PULL 24/61] qcow2: Use offset_into_cluster() and offset_to_l2_index()

2017-06-23 Thread Kevin Wolf
From: Alberto Garcia We already have functions for doing these calculations, so let's use them instead of doing everything by hand. This makes the code a bit more readable. Signed-off-by: Alberto Garcia Signed-off-by: Kevin Wolf --- block/qcow2-cluster.c | 4 ++-- block/qcow2.c | 2 +-

[Qemu-devel] [PULL 16/61] nvme: Add support for Read Data and Write Data in CMBs.

2017-06-23 Thread Kevin Wolf
From: Stephen Bates Add the ability for the NVMe model to support both the RDS and WDS modes in the Controller Memory Buffer. Although not currently supported in the upstreamed Linux kernel a fork with support exists [1] and user-space test programs that build on this also exist [2]. Useful for

[Qemu-devel] [PULL 01/15] target/s390x: Map existing FAC_* names to S390_FEAT_* names

2017-06-23 Thread Richard Henderson
The FAC_ names were placeholders prior to the introduction of the current facility modeling. Reviewed-by: Aurelien Jarno Signed-off-by: Richard Henderson --- target/s390x/translate.c | 59 1 file changed, 29 insertions(+), 30 deletions(-) diff -

[Qemu-devel] [PULL 25/61] qed: Use bottom half to resume waiting requests

2017-06-23 Thread Kevin Wolf
The qed driver serialises allocating write requests. When the active allocation is finished, the AIO callback is called, but after this, the next allocating request is immediately processed instead of leaving the coroutine. Resuming another allocation request in the same request coroutine means tha

[Qemu-devel] [PULL 04/15] target/s390x: Mark FPSEH facility as available

2017-06-23 Thread Richard Henderson
This facility bit includes DFP-rounding, FPR-GR-transfer, FPS-sign-handling, and IEEE-exception-simulation. We do support all of these. Reviewed-by: Aurelien Jarno Signed-off-by: Richard Henderson --- target/s390x/cpu_models.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/s390x/cp

[Qemu-devel] [PULL 22/61] qcow2: Pass a QEMUIOVector to do_perform_cow_{read, write}()

2017-06-23 Thread Kevin Wolf
From: Alberto Garcia Instead of passing a single buffer pointer to do_perform_cow_write(), pass a QEMUIOVector. This will allow us to merge the write requests for the COW regions and the actual data into a single one. Although do_perform_cow_read() does not strictly need to change its API, we're

[Qemu-devel] [PULL 07/15] target/s390x: Mark STFLE_53 facility as available

2017-06-23 Thread Richard Henderson
This facility bit includes load-on-condition-2 and load-and-zero-rightmost-byte. Reviewed-by: Aurelien Jarno Signed-off-by: Richard Henderson --- target/s390x/cpu_models.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index e676d7d..c5

[Qemu-devel] [PULL 08/15] target/s390x: Implement execution-hint insns

2017-06-23 Thread Richard Henderson
Reviewed-by: Aurelien Jarno Signed-off-by: Richard Henderson --- target/s390x/insn-data.def | 9 + target/s390x/translate.c | 5 - 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def index 0555686..8e3f7db 100644 --

[Qemu-devel] [PULL 26/61] qed: Make qed_read_table() synchronous

2017-06-23 Thread Kevin Wolf
Note that this code is generally not running in coroutine context, so this is an actual blocking synchronous operation. We'll fix this in a moment. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi --- block/qed-table.c | 56 ++--

[Qemu-devel] [PULL 27/61] qed: Remove callback from qed_read_table()

2017-06-23 Thread Kevin Wolf
Instead of passing the return value to a callback, return it to the caller so that the callback can be inlined there. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi --- block/qed-table.c | 79 ++- 1 file change

[Qemu-devel] [PULL 38/61] qed: Make qed_aio_read_data() synchronous

2017-06-23 Thread Kevin Wolf
Note that this code is generally not running in coroutine context, so this is an actual blocking synchronous operation. We'll fix this in a moment. Signed-off-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi --- block/qed.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/

[Qemu-devel] [PULL 10/15] target/s390x: Mark STFLE_49 facility as available

2017-06-23 Thread Richard Henderson
This facility bit includes execution-hint, load-and-trap, miscellaneous-instruction-extensions and processor-assist. Reviewed-by: Aurelien Jarno Signed-off-by: Richard Henderson --- target/s390x/cpu_models.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/s390x/cpu_models.c b/target/

[Qemu-devel] [PULL 33/61] qed: Make qed_write_header() synchronous

2017-06-23 Thread Kevin Wolf
Note that this code is generally not running in coroutine context, so this is an actual blocking synchronous operation. We'll fix this in a moment. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi --- block/qed.c | 76 +++---

[Qemu-devel] [PULL 23/61] qcow2: Merge the writing of the COW regions with the guest data

2017-06-23 Thread Kevin Wolf
From: Alberto Garcia If the guest tries to write data that results on the allocation of a new cluster, instead of writing the guest data first and then the data from the COW regions, write everything together using one single I/O operation. This can improve the write performance by 25% or more,

[Qemu-devel] [PULL 37/61] qed: Remove callback from qed_write_table()

2017-06-23 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi --- block/qed-table.c | 47 --- block/qed.c | 12 +++- block/qed.h | 8 +++- 3 files changed, 22 insertions(+), 45 deletions(-) diff --git a/block/qed-table.c b/block/qed-

[Qemu-devel] [PULL 12/15] target/s390x: Clean up TB flag bits

2017-06-23 Thread Richard Henderson
Most of the PSW bits that were being copied into TB->flags are not relevant to translation. Removing those that are unnecessary reduces the amount of translation required. Reviewed-by: Aurelien Jarno Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/s390x/cpu.h

[Qemu-devel] [PULL 32/61] qed: Remove callback from qed_copy_from_backing_file()

2017-06-23 Thread Kevin Wolf
With this change, qed_aio_write_prefill() and qed_aio_write_postfill() collapse into a single function. This is reflected by a rename of the combined function to qed_aio_write_cow(). Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi --- block/qed.c | 57 +++

[Qemu-devel] [PULL 39/61] qed: Make qed_aio_write_main() synchronous

2017-06-23 Thread Kevin Wolf
Note that this code is generally not running in coroutine context, so this is an actual blocking synchronous operation. We'll fix this in a moment. Signed-off-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi --- block/qed.c | 61 +++-- 1 file c

[Qemu-devel] [PULL 29/61] qed: Remove callback from qed_find_cluster()

2017-06-23 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi --- block/qed-cluster.c | 39 ++- block/qed.c | 24 +++- block/qed.h | 4 ++-- 3 files changed, 35 insertions(+), 32 deletions(-) diff --git a/block/qed-cluster.c b/bl

[Qemu-devel] [PULL 34/61] qed: Remove callback from qed_write_header()

2017-06-23 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi --- block/qed.c | 32 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/block/qed.c b/block/qed.c index 2665efc..95f1050 100644 --- a/block/qed.c +++ b/block/qed.c @@ -98,8 +98,7 @@ int qed_writ

[Qemu-devel] [PULL 43/61] qed: Add return value to qed_aio_write_main()

2017-06-23 Thread Kevin Wolf
Don't recurse into qed_aio_next_io() and qed_aio_complete() here, but just return an error code and let the caller handle it. Signed-off-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi --- block/qed.c | 55 ++- 1 file changed, 30 insertions(+), 25

[Qemu-devel] [PULL 13/15] target/s390x: Indicate and check for local tlb clearing

2017-06-23 Thread Richard Henderson
From: David Hildenbrand Let's allow to enable it for the qemu cpu model and correctly emulate it. Signed-off-by: David Hildenbrand Message-Id: <20170622094151.28633-2-da...@redhat.com> Signed-off-by: Richard Henderson --- target/s390x/cpu_models.c | 1 + target/s390x/mem_helper.c | 2 -- targ

[Qemu-devel] [PULL 35/61] qed: Make qed_write_table() synchronous

2017-06-23 Thread Kevin Wolf
Note that this code is generally not running in coroutine context, so this is an actual blocking synchronous operation. We'll fix this in a moment. Signed-off-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi --- block/qed-table.c | 84 --- 1 file c

[Qemu-devel] [PULL 02/15] target/s390x: change PSW_SHIFT_KEY

2017-06-23 Thread Richard Henderson
From: David Hildenbrand Such shifts are usually used to easily extract the PSW KEY from the PSW mask, so let's avoid the confusing offset of 4. Reviewed-by: Aurelien Jarno Reviewed-by: Thomas Huth Signed-off-by: David Hildenbrand Message-Id: <20170614133819.18480-2-da...@redhat.com> Signed-of

[Qemu-devel] [PULL 48/61] qed: Remove recursion in qed_aio_next_io()

2017-06-23 Thread Kevin Wolf
Instead of calling itself recursively as the last thing, just convert qed_aio_next_io() into a loop. This patch is best reviewed with 'git show -w' because most of it is just whitespace changes. Signed-off-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi --- block/qed.c | 63 +++

[Qemu-devel] [PULL 00/15] Queued target/s390x patches

2017-06-23 Thread Richard Henderson
; into staging (2017-06-22 15:09:48 +0100) are available in the git repository at: git://github.com/rth7680/qemu.git tags/pull-s390-20170623 for you to fetch changes up to be7f28de5d7f635647d7991ace96c54d9f724be4: target/s390x: Implement idte instruction (2017-06-23

[Qemu-devel] [PULL 14/15] target/s390x: Improve heuristic for ipte

2017-06-23 Thread Richard Henderson
From: David Hildenbrand If only the page index is set, most likely we don't have a valid virtual address. Let's do a full tlb flush for that case. Signed-off-by: David Hildenbrand Message-Id: <20170622094151.28633-3-da...@redhat.com> Signed-off-by: Richard Henderson --- target/s390x/mem_helpe

[Qemu-devel] [PULL 36/61] qed: Remove GenericCB

2017-06-23 Thread Kevin Wolf
The GenericCB infrastructure isn't used any more. Remove it. Signed-off-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi --- block/Makefile.objs | 2 +- block/qed-gencb.c | 33 - block/qed.h | 11 --- 3 files changed, 1 insertion(+), 45 deletions(-)

[Qemu-devel] [PULL 46/61] qed: Add return value to qed_aio_read/write_data()

2017-06-23 Thread Kevin Wolf
Don't recurse into qed_aio_next_io() and qed_aio_complete() here, but just return an error code and let the caller handle it. Signed-off-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi --- block/qed.c | 72 ++--- block/qed.h | 21 -

[Qemu-devel] [PULL 03/15] target/s390x: implement mvcos instruction

2017-06-23 Thread Richard Henderson
From: David Hildenbrand This adds support for the MOVE WITH OPTIONAL SPECIFICATIONS (MVCOS) instruction. Allow to enable it for the qemu cpu model using qemu-system-s390x ... -cpu qemu,mvcos=on ... This allows to boot linux kernel that uses it for uacccess. We are missing (as for most other pa

[Qemu-devel] [PULL 15/15] target/s390x: Implement idte instruction

2017-06-23 Thread Richard Henderson
From: David Hildenbrand Let's keep it very simple for now and flush the complete tlb, we currently can't find the right entries in our tlb, we would have to store the used tables for each element. As we now fully implement the DAT-enhancement facility, we can allow to enable it for the qemu CPU

[Qemu-devel] [PULL 11/15] target/s390x: Finish implementing ETF2-ENH

2017-06-23 Thread Richard Henderson
Missed the proper alignment in TRTO/TRTT, and ignoring the M3 field for all TRXX insns without ETF2-ENH. Reviewed-by: Aurelien Jarno Signed-off-by: Richard Henderson --- target/s390x/mem_helper.c | 11 ++- target/s390x/translate.c | 5 +++-- 2 files changed, 13 insertions(+), 3 deleti

[Qemu-devel] [PULL 05/15] target/s390x: Implement load-on-condition-2 insns

2017-06-23 Thread Richard Henderson
Reviewed-by: Aurelien Jarno Signed-off-by: Richard Henderson --- target/s390x/insn-data.def | 9 + target/s390x/insn-format.def | 1 + target/s390x/translate.c | 18 +++--- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/target/s390x/insn-data.def b/ta

[Qemu-devel] [PULL 49/61] qed: Implement .bdrv_co_readv/writev

2017-06-23 Thread Kevin Wolf
Most of the qed code is now synchronous and matches the coroutine model. One notable exception is the serialisation between requests which can still schedule a callback. Before we can replace this with coroutine locks, let's convert the driver's external interfaces to the coroutine versions. We ne

[Qemu-devel] [PULL 54/61] qed: Use bdrv_co_* for coroutine_fns

2017-06-23 Thread Kevin Wolf
All functions that are marked coroutine_fn can directly call the bdrv_co_* version of functions instead of going through the wrapper. Signed-off-by: Kevin Wolf Reviewed-by: Manos Pitsidianakis Reviewed-by: Stefan Hajnoczi --- block/qed.c | 16 +--- 1 file changed, 9 insertions(+),

[Qemu-devel] [PULL 40/61] qed: Inline qed_commit_l2_update()

2017-06-23 Thread Kevin Wolf
qed_commit_l2_update() is unconditionally called at the end of qed_aio_write_l1_update(). Inline it. Signed-off-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi --- block/qed.c | 36 ++-- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/block/qed.c b/bl

[Qemu-devel] [PULL 47/61] qed: Remove ret argument from qed_aio_next_io()

2017-06-23 Thread Kevin Wolf
All callers pass ret = 0, so we can just remove it. Signed-off-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi --- block/qed.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/block/qed.c b/block/qed.c index 6f83831..db80987 100644 --- a/block/qed.c +++ b/block

[Qemu-devel] [PULL 56/61] block: change variable names in BlockDriverState

2017-06-23 Thread Kevin Wolf
From: Manos Pitsidianakis Change the 'int count' parameter in *pwrite_zeros, *pdiscard related functions (and some others) to 'int bytes', as they both refer to bytes. This helps with code legibility. Signed-off-by: Manos Pitsidianakis Message-id: 20170609101808.13506-1-el13...@mail.ntua.gr Rev

[Qemu-devel] [PULL 41/61] qed: Add return value to qed_aio_write_l1_update()

2017-06-23 Thread Kevin Wolf
Don't recurse into qed_aio_next_io() and qed_aio_complete() here, but just return an error code and let the caller handle it. Signed-off-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi --- block/qed.c | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/block/qed

[Qemu-devel] [PULL 52/61] qed: Use a coroutine for need_check_timer

2017-06-23 Thread Kevin Wolf
This fixes the last place where we degraded from AIO to actual blocking synchronous I/O requests. Putting it into a coroutine means that instead of blocking, the coroutine simply yields while doing I/O. Signed-off-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi --- block/qed.c | 33

[Qemu-devel] [PULL 61/61] qemu-img: don't shadow opts variable in img_dd()

2017-06-23 Thread Kevin Wolf
From: Stefan Hajnoczi It's confusing when two different variables have the same name in one function. Cc: Reda Sallahi Signed-off-by: Stefan Hajnoczi Message-id: 20170619150002.3033-1-stefa...@redhat.com Signed-off-by: Max Reitz --- qemu-img.c | 9 +++-- 1 file changed, 3 insertions(+),

[Qemu-devel] [PULL 60/61] block: Do not strcmp() with NULL uri->scheme

2017-06-23 Thread Kevin Wolf
From: Max Reitz uri_parse(...)->scheme may be NULL. In fact, probably every field may be NULL, and the callers do test this for all of the other fields but not for scheme (except for block/gluster.c; block/vxhs.c does not access that field at all). We can easily fix this by using g_strcmp0() ins

[Qemu-devel] [PATCH v10 01/20] block: expose crypto option names / defs to other drivers

2017-06-23 Thread Daniel P. Berrange
The block/crypto.c defines a set of QemuOpts that provide parameters for encryption. This will also be needed by the qcow/qcow2 integration, so expose the relevant pieces in a new block/crypto.h header. Some helper methods taking QemuOpts are changed to take QDict to simplify usage in other places.

[Qemu-devel] [PULL 42/61] qed: Add return value to qed_aio_write_l2_update()

2017-06-23 Thread Kevin Wolf
Don't recurse into qed_aio_next_io() and qed_aio_complete() here, but just return an error code and let the caller handle it. Signed-off-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi --- block/qed.c | 43 ++- 1 file changed, 26 insertions(+), 17 deletions(-

[Qemu-devel] [PULL 57/61] fix: avoid an infinite loop or a dangling pointer problem in img_commit

2017-06-23 Thread Kevin Wolf
From: "sochin.jiang" img_commit could fall into an infinite loop calling run_block_job() if its blockjob fails on any I/O error, fix this already known problem. Signed-off-by: sochin.jiang Message-id: 1497509253-28941-1-git-send-email-sochin.ji...@huawei.com Signed-off-by: Max Reitz --- block

[Qemu-devel] [PATCH v10 03/20] qcow: document another weakness of qcow AES encryption

2017-06-23 Thread Daniel P. Berrange
Document that use of guest virtual sector numbers as the basis for the initialization vectors is a potential weakness, when combined with internal snapshots or multiple images using the same passphrase. This fixes the formatting of the itemized list too. Reviewed-by: Max Reitz Reviewed-by: Albert

[Qemu-devel] [PULL 09/15] target/s390x: Implement processor-assist insn

2017-06-23 Thread Richard Henderson
Reviewed-by: Aurelien Jarno Signed-off-by: Richard Henderson --- target/s390x/insn-data.def | 3 +++ target/s390x/translate.c | 1 + 2 files changed, 4 insertions(+) diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def index 8e3f7db..5ba7822 100644 --- a/target/s390x/insn-data

[Qemu-devel] [PULL 55/61] block: Remove bdrv_aio_readv/writev/flush()

2017-06-23 Thread Kevin Wolf
These functions are unused now. Signed-off-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi --- block/io.c| 171 -- block/trace-events| 3 - include/block/block.h | 8 --- 3 files changed, 182 deletions(-) diff --git a/block/io.c b

[Qemu-devel] [PATCH v10 00/20] Convert QCow[2] to QCryptoBlock & add LUKS support

2017-06-23 Thread Daniel P. Berrange
Previously posted: v1: https://lists.gnu.org/archive/html/qemu-devel/2017-01/msg00201.html v2: https://lists.gnu.org/archive/html/qemu-devel/2017-01/msg05147.html v3: https://lists.gnu.org/archive/html/qemu-devel/2017-01/msg05671.html v4: https://lists.gnu.org/archive/html/qemu-devel/2017-02/m

[Qemu-devel] [PULL 59/61] blkverify: Catch bs->exact_filename overflow

2017-06-23 Thread Kevin Wolf
From: Max Reitz The bs->exact_filename field may not be sufficient to store the full blkverify node filename. In this case, we should not generate a filename at all instead of an unusable one. Cc: qemu-sta...@nongnu.org Reported-by: Qu Wenruo Signed-off-by: Max Reitz Message-id: 20170613172006

[Qemu-devel] [PULL 45/61] qed: Add return value to qed_aio_write_inplace/alloc()

2017-06-23 Thread Kevin Wolf
Don't recurse into qed_aio_next_io() and qed_aio_complete() here, but just return an error code and let the caller handle it. Signed-off-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi --- block/qed.c | 43 --- 1 file changed, 20 insertions(+), 23 deletions(-

[Qemu-devel] [PATCH v10 04/20] qcow: require image size to be > 1 for new images

2017-06-23 Thread Daniel P. Berrange
The qcow driver refuses to open images which are less than 2 bytes in size, but will happily create such images. Add a check in the create path to avoid this discrepancy. Reviewed-by: Max Reitz Reviewed-by: Alberto Garcia Reviewed-by: Eric Blake Signed-off-by: Daniel P. Berrange --- block/qco

[Qemu-devel] [PATCH v10 14/20] qcow2: add iotests to cover LUKS encryption support

2017-06-23 Thread Daniel P. Berrange
This extends the 087 iotest to cover LUKS encryption when doing blockdev-add. Two further tests are added to validate read/write of LUKS encrypted images with a single file and with a backing file. Reviewed-by: Alberto Garcia Reviewed-by: Max Reitz Signed-off-by: Daniel P. Berrange --- tests/

[Qemu-devel] [PULL 44/61] qed: Add return value to qed_aio_write_cow()

2017-06-23 Thread Kevin Wolf
Don't recurse into qed_aio_next_io() and qed_aio_complete() here, but just return an error code and let the caller handle it. While refactoring qed_aio_write_alloc() to accomodate the change, qed_aio_write_zero_cluster() ended up with a single line, so I chose to inline that line and remove the fu

[Qemu-devel] [PATCH v10 05/20] iotests: skip 042 with qcow which dosn't support zero sized images

2017-06-23 Thread Daniel P. Berrange
Test 042 is designed to verify operation with zero sized images. Such images are not supported with qcow (v1), so this test has always failed. Reviewed-by: Max Reitz Reviewed-by: Alberto Garcia Signed-off-by: Daniel P. Berrange --- tests/qemu-iotests/042 | 2 +- 1 file changed, 1 insertion(+),

[Qemu-devel] [PATCH v10 13/20] qcow2: add support for LUKS encryption format

2017-06-23 Thread Daniel P. Berrange
This adds support for using LUKS as an encryption format with the qcow2 file, using the new encrypt.format parameter to request "luks" format. e.g. # qemu-img create --object secret,data=123456,id=sec0 \ -f qcow2 -o encrypt.format=luks,encrypt.key-secret=sec0 \ test.qcow2 10G The

<    1   2   3   >