Re: [PATCH v9 34/34] iotests: Add tests for qcow2 images with extended L2 entries

2020-07-06 Thread Eric Blake
On 7/3/20 8:06 AM, Alberto Garcia wrote: +printf -v expected_bitmap "%llu" $expected_bitmap # Convert to unsigned Does the length modifier “ll” actually do anything? + +printf "L2 entry #%d: 0x%016lx %016lx\n" "$entry_no" "$entry" "$bitmap" Or the “l” here? Actually they don't

[Bug 1885827] Re: building plugin failed on Windows with mingw

2020-07-06 Thread Emilio G. Cota
You're getting close. 1. From the build directory, find the import library created, e.g. `find . -name 'libqemu_plugin.dll.a'`. If you're building x86_64-linux-user, it should be in `x86_64-linux-user/libqemu_plugin.dll.a`. 2. Go back to the `build/tests/plugin` directory. 3. Link the empty

Re: [PATCH v3 00/44] Less clumsy error checking

2020-07-06 Thread Eric Blake
On 7/6/20 3:12 AM, Markus Armbruster wrote: diff between v2 rebased and v3, with hunks that change only whitespace dropped: Thanks, that's useful. Overall, the series looks ready to go from my perspective. It looks like the changes from v2 were minimal enough that I don't have any R-b to

[RFC PATCH 2/2] block/block-backend: Let blk_attach_dev() provide helpful error

2020-07-06 Thread Philippe Mathieu-Daudé
Let blk_attach_dev() take an Error* object to return helpful information. Adapt the callers. $ qemu-system-arm -M n800 qemu-system-arm: sd_init failed: cannot attach blk 'sd0' to device 'sd-card' because it is already attached by device 'omap2-mmc' Drive 'sd0' is already in use because it

[PATCH 1/2] block/block-backend: Trace blk_attach_dev()

2020-07-06 Thread Philippe Mathieu-Daudé
Add a trace event to follow devices attaching block drives: $ qemu-system-arm -M n800 -trace blk_\* 9513@1594040428.738162:blk_attach_dev attaching blk 'sd0' to device 'omap2-mmc' 9513@1594040428.738189:blk_attach_dev attaching blk 'sd0' to device 'sd-card' qemu-system-arm: sd_init

Re: [PATCH v2 4/9] hw/arm/smmu: Simplify the IOTLB key format

2020-07-06 Thread Peter Maydell
On Thu, 2 Jul 2020 at 16:27, Eric Auger wrote: > > Instead of using a Jenkins hash function to generate > the key let's just use a 64 bit unsigned integer that > contains the asid and the 40 upper bits of the iova. > A maximum of 52-bit IOVA is supported. This change in the > key format also

[PATCH 0/2] block/block-backend: Let blk_attach_dev() provide helpful error

2020-07-06 Thread Philippe Mathieu-Daudé
A pair of patches which helps me debug an issue with block drive already attached. Suggestions to correctly/better use the Error API welcome, in particular in qdev-properties-system::set_drive_helper(). Philippe Mathieu-Daudé (2): block/block-backend: Trace blk_attach_dev()

Re: [PATCH v4 1/5] virtio-pci: add virtio_pci_optimal_num_queues() helper

2020-07-06 Thread Stefan Hajnoczi
On Thu, May 28, 2020 at 05:35:55PM +0200, Cornelia Huck wrote: > On Wed, 27 May 2020 11:29:21 +0100 > Stefan Hajnoczi wrote: > > > Multi-queue devices achieve the best performance when each vCPU has a > > dedicated queue. This ensures that virtqueue used notifications are > > handled on the same

Re: [PULL 00/10] Modules 20200702 patches

2020-07-06 Thread Gerd Hoffmann
Hi, > >>> build: fix device module builds > >> No code review at all? :-( > > > > Well, there have been 5 revisions on the list, partly due to bugs being > > fixed, partly with changes as response to review comments. So it got > > some review (not much though) even though the v5 series

Re: [PATCH] scripts: improve message when TAP based tests fail

2020-07-06 Thread Paolo Bonzini
On 06/07/20 14:50, Daniel P. Berrangé wrote: > If one of the qtests fails, the TAP driver prints out a message like: > > ERROR - too few tests run (expected 3, got 1) > > which fails to tell you which test program failed. This is a critical > ommission when many tests are running in parallel

Re: [PULL 04/10] build: fix device module builds

2020-07-06 Thread Gerd Hoffmann
Hi, > Hi, if I recall correctly I encountered this. > > It has to do with the convoluted rules in rules.mak for modules. > > There are multiple specific problems there, beyond design issues. I guess you just figured why there is a plan to replace the current build system with a meson based

Re: [PATCH v2 3/9] hw/arm/smmu: Introduce smmu_get_iotlb_key()

2020-07-06 Thread Peter Maydell
On Thu, 2 Jul 2020 at 16:27, Eric Auger wrote: > > Introduce the smmu_get_iotlb_key() helper and the > SMMU_IOTLB_ASID() macro. Also move smmu_get_iotlb_key and > smmu_iotlb_key_hash in the IOTLB related code section. > > Signed-off-by: Eric Auger > > --- > > v1 -> v2: > - creation > ---

Re: [PATCH v2 1/9] hw/arm/smmu-common: Factorize some code in smmu_ptw_64()

2020-07-06 Thread Peter Maydell
On Thu, 2 Jul 2020 at 16:27, Eric Auger wrote: > > Page and block PTE decoding can share some code. Let's > first handle table PTE and factorize some code shared by > page and block PTEs. > > Signed-off-by: Eric Auger > > --- > > v1 -> v2: > - restore goto error in case get_pte() fails > ---

Re: [PATCH] softfloat,m68k: disable floatx80_invalid_encoding() for m68k

2020-07-06 Thread Laurent Vivier
Hi, any comments from FPU emulation maintainers? Thanks, Laurent Le 12/06/2020 à 16:04, Laurent Vivier a écrit : > According to the comment, this definition of invalid encoding is given > by intel developer's manual, and doesn't comply with 680x0 FPU. > > With m68k, the explicit integer bit

[PATCH] scripts: improve message when TAP based tests fail

2020-07-06 Thread Daniel P . Berrangé
If one of the qtests fails, the TAP driver prints out a message like: ERROR - too few tests run (expected 3, got 1) which fails to tell you which test program failed. This is a critical ommission when many tests are running in parallel as their output is interleaved. The improved message is:

[PATCH v4 1/1] tricore: added triboard with tc27x_soc

2020-07-06 Thread David Brenken
From: Andreas Konopik Signed-off-by: Andreas Konopik Signed-off-by: David Brenken Signed-off-by: Georg Hofstetter Signed-off-by: Robert Rasche Signed-off-by: Lars Biermanski --- hw/tricore/Kconfig | 8 ++ hw/tricore/Makefile.objs | 2 + hw/tricore/tc27x_soc.c

[PATCH v4 0/1] tricore: added triboard with tc27x_soc

2020-07-06 Thread David Brenken
From: Andreas Konopik Hello everyone, this patch adds the AURIX TC277 D-Step TriBoard as QEMU machine (-M AURIX_TriBoard_TC277D). Memory maps are implemented according to the "AURIX TC27x D-Step User's Manual V2.2 2014-12". AURIX memory layouts are specified by the processor, that is why this

Re: [PATCH v3 16/16] block/nvme: Use per-queuepair IRQ notifier and AIO context

2020-07-06 Thread Philippe Mathieu-Daudé
On 7/6/20 2:04 PM, Stefan Hajnoczi wrote: > On Sat, Jul 04, 2020 at 11:30:51PM +0200, Philippe Mathieu-Daudé wrote: >> @@ -683,6 +676,17 @@ static bool nvme_add_io_queue(BlockDriverState *bs, >> Error **errp) >> s->queues = g_renew(NVMeQueuePair *, s->queues, n + 1); >> s->queues[n] =

Re: [PATCH v3 16/16] block/nvme: Use per-queuepair IRQ notifier and AIO context

2020-07-06 Thread Stefan Hajnoczi
On Sat, Jul 04, 2020 at 11:30:51PM +0200, Philippe Mathieu-Daudé wrote: > @@ -683,6 +676,17 @@ static bool nvme_add_io_queue(BlockDriverState *bs, > Error **errp) > s->queues = g_renew(NVMeQueuePair *, s->queues, n + 1); > s->queues[n] = q; > s->nr_queues++; > + > +ret =

Re: [PULL 36/37] qdev: remove QDEV_PROP_PTR

2020-07-06 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > On 7/6/20 12:01 PM, Marc-André Lureau wrote: >> Hi >> >> On Mon, Jul 6, 2020 at 12:44 PM Philippe Mathieu-Daudé >> wrote: [...] >>> Yet another sneaky way to force forks to either update to QOM or die... >> >> You can't blame upstream from doing cleanups and

Re: [PATCH v3] migration: Count new_dirty instead of real_dirty

2020-07-06 Thread zhukeqian
Hi Dave, On 2020/7/3 22:20, Dr. David Alan Gilbert wrote: > * Keqian Zhu (zhukeqi...@huawei.com) wrote: >> real_dirty_pages becomes equal to total ram size after dirty log sync >> in ram_init_bitmaps, the reason is that the bitmap of ramblock is >> initialized to be all set, so old path counts

Re: [PATCH v3 15/16] block/nvme: Move nvme_poll_cb() earlier

2020-07-06 Thread Stefan Hajnoczi
On Sat, Jul 04, 2020 at 11:30:50PM +0200, Philippe Mathieu-Daudé wrote: > We are going to use this callback in nvme_add_io_queue() > in the next commit. To avoid forward-declaring it, move > it before. No logical change. > > Signed-off-by: Philippe Mathieu-Daudé > --- > block/nvme.c | 18

Re: [PATCH v3 14/16] block/nvme: Extract nvme_poll_queue()

2020-07-06 Thread Stefan Hajnoczi
On Sat, Jul 04, 2020 at 11:30:49PM +0200, Philippe Mathieu-Daudé wrote: > As we want to do per-queue polling, extract the nvme_poll_queue() > method which operates on a single queue. > > Signed-off-by: Philippe Mathieu-Daudé > --- > Stefan better double check here! > --- > block/nvme.c | 44

Re: [PATCH] hw/arm/bcm2836: Remove unused 'cpu_type' field

2020-07-06 Thread Peter Maydell
On Fri, 3 Jul 2020 at 21:05, Philippe Mathieu-Daudé wrote: > > The 'cpu_type' has been moved from BCM283XState to BCM283XClass > in commit 210f47840d, but we forgot to remove the old variable. > Do it now. > > Fixes: 210f47840d ("hw/arm/bcm2836: Hardcode correct CPU type") > Signed-off-by:

Re: [PULL 13/14] virtio-ccw: fix virtio_set_ind_atomic

2020-07-06 Thread Cornelia Huck
On Mon, 6 Jul 2020 13:23:11 +0200 Halil Pasic wrote: > On Fri, 3 Jul 2020 12:06:49 +0200 > Cornelia Huck wrote: > > > From: Halil Pasic > > > > The atomic_cmpxchg() loop is broken because we occasionally end up with > > old and _old having different values (a legit compiler can generate

Re: [PATCH v3 06/16] block/nvme: Use common error path in nvme_add_io_queue()

2020-07-06 Thread Stefan Hajnoczi
On Sat, Jul 04, 2020 at 11:30:41PM +0200, Philippe Mathieu-Daudé wrote: > Rearrange nvme_add_io_queue() by using a common error path. > This will be proven useful in few commits where we add IRQ > notification to the IO queues. > > Signed-off-by: Philippe Mathieu-Daudé > --- > block/nvme.c | 9

Re: [PATCH v3 03/44] qdev: Use returned bool to check for qdev_realize() etc. failure

2020-07-06 Thread Markus Armbruster
Greg Kurz writes: > On Mon, 6 Jul 2020 10:09:09 +0200 > Markus Armbruster wrote: > >> Convert >> >> foo(..., ); >> if (err) { >> ... >> } >> >> to >> >> if (!foo(..., )) { >> ... >> } >> >> for qdev_realize(), qdev_realize_and_unref(), qbus_realize() and

Re: [PATCH 2/2] linux-user: Adjust guest page protection for the host

2020-07-06 Thread Peter Maydell
On Tue, 19 May 2020 at 19:57, Richard Henderson wrote: > > Executable guest pages are never directly executed by > the host, but do need to be readable for translation. > > Signed-off-by: Richard Henderson > --- > linux-user/mmap.c | 6 +- > 1 file changed, 5 insertions(+), 1 deletion(-) >

Re: [PATCH 1/2] linux-user: Validate mmap/mprotect prot value

2020-07-06 Thread Peter Maydell
On Tue, 19 May 2020 at 19:57, Richard Henderson wrote: > > The kernel will return -EINVAL for bits set in the prot argument > that are unknown or invalid. Previously we were simply cropping > out the bits that we care about. > > Introduce validate_prot_to_pageflags to perform this check in a >

Re: [PATCH v9 4/5] linux-user: Parse NT_GNU_PROPERTY_TYPE_0 notes

2020-07-06 Thread Peter Maydell
On Wed, 20 May 2020 at 18:28, Richard Henderson wrote: > > For aarch64, this includes the GNU_PROPERTY_AARCH64_FEATURE_1_BTI bit, > which indicates that the image should be mapped with guarded pages. > > Signed-off-by: Richard Henderson > --- > v9: Only map the startup executable with BTI;

Re: [PULL 14/14] s390x/pci: fix set_ind_atomic

2020-07-06 Thread Halil Pasic
On Fri, 3 Jul 2020 12:06:50 +0200 Cornelia Huck wrote: > From: Halil Pasic > > The atomic_cmpxchg() loop is broken because we occasionally end up with > old and _old having different values (a legit compiler can generate code > that accessed *ind_addr again to pick up a value for _old instead

Re: [PULL 13/14] virtio-ccw: fix virtio_set_ind_atomic

2020-07-06 Thread Halil Pasic
On Fri, 3 Jul 2020 12:06:49 +0200 Cornelia Huck wrote: > From: Halil Pasic > > The atomic_cmpxchg() loop is broken because we occasionally end up with > old and _old having different values (a legit compiler can generate code > that accessed *ind_addr again to pick up a value for _old instead

Re: [PATCH v3 24/44] qom: Use return values to check for error where that's simpler

2020-07-06 Thread Vladimir Sementsov-Ogievskiy
06.07.2020 11:09, Markus Armbruster wrote: When using the Error object to check for error, we need to receive it into a local variable, then propagate() it to @errp. Using the return value permits allows receiving it straight to @errp. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake

Re: [PATCH 1/2] virtio-ccw: fix virtio_set_ind_atomic

2020-07-06 Thread Halil Pasic
On Sat, 4 Jul 2020 14:34:04 -0400 "Michael S. Tsirkin" wrote: > On Tue, Jun 16, 2020 at 06:50:34AM +0200, Halil Pasic wrote: > > The atomic_cmpxchg() loop is broken because we occasionally end up with > > old and _old having different values (a legit compiler can generate code > > that accessed

Re: [PATCH v9 5/5] tests/tcg/aarch64: Add bti smoke test

2020-07-06 Thread Peter Maydell
On Wed, 20 May 2020 at 18:28, Richard Henderson wrote: > > This test requires gcc 10 for -mbranch-protection=standard. > > Signed-off-by: Richard Henderson > --- > v9: Expect and require gcc 10. > --- > tests/tcg/aarch64/bti-1.c | 62 +++ >

Re: [PATCH v9 2/5] linux-user: Set PAGE_TARGET_1 for TARGET_PROT_BTI

2020-07-06 Thread Peter Maydell
On Wed, 20 May 2020 at 18:28, Richard Henderson wrote: > > Transform the prot bit to a qemu internal page bit, and save > it in the page tables. > > Signed-off-by: Richard Henderson > --- > include/exec/cpu-all.h | 2 ++ > linux-user/syscall_defs.h | 4 > linux-user/mmap.c

Re: [PATCH v9 1/5] linux-user/aarch64: Reset btype for signals

2020-07-06 Thread Peter Maydell
On Wed, 20 May 2020 at 18:28, Richard Henderson wrote: > > The kernel sets btype for the signal handler as if for a call. > > Signed-off-by: Richard Henderson > --- > linux-user/aarch64/signal.c | 10 -- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git

DMA region abruptly removed from PCI device

2020-07-06 Thread Thanos Makatos
We have an issue when using the VFIO-over-socket libmuser PoC (https://www.mail-archive.com/qemu-devel@nongnu.org/msg692251.html) instead of the VFIO kernel module: we notice that DMA regions used by the emulated device can be abruptly removed while the device is still using them. The PCI device

[PATCH] virtio-pci: Changed vdev to proxy for VirtIO PCI BAR callbacks.

2020-07-06 Thread andrew
From: Andrew Melnychenko There is an issue when callback may be called with invalid vdev. It happens on unplug when vdev already deleted and VirtIOPciProxy is not. So now, callbacks accept proxy device, and vdev retrieved from it. Technically memio callbacks should be removed during the flatview

Re: [PATCH v3 05/16] block/nvme: Improve error message when IO queue creation failed

2020-07-06 Thread Stefan Hajnoczi
On Sat, Jul 04, 2020 at 11:30:40PM +0200, Philippe Mathieu-Daudé wrote: > Do not use the same error message for different failures. > Display a different error whether it is the CQ or the SQ. > > Signed-off-by: Philippe Mathieu-Daudé > --- > block/nvme.c | 4 ++-- > 1 file changed, 2

[REPORT] [GSoC - TCG Continuous Benchmarking] [#3] QEMU 5.0 and 5.1-pre-soft-freeze Dissect Comparison

2020-07-06 Thread Ahmed Karaman
Hi, The third report of the TCG Continuous Benchmarking series utilizes the tools presented in the previous report for comparing the performance of 17 different targets across two versions of QEMU. The two versions addressed are 5.0 and 5.1-pre-soft-freeze (current state of QEMU). After

Re: [PULL 00/31] Block patches

2020-07-06 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200706100432.2301919-1-mre...@redhat.com/ Hi, This series seems to have some coding style problems. See output below for more information: Subject: [PULL 00/31] Block patches Type: series Message-id: 20200706100432.2301919-1-mre...@redhat.com === TEST

Re: [PATCH v2 4/7] vhost: involve device backends in feature negotiation

2020-07-06 Thread Stefan Hajnoczi
On Tue, Jun 09, 2020 at 02:07:44PM -0400, Michael S. Tsirkin wrote: > On Tue, Jun 09, 2020 at 06:02:15PM +0100, Stefan Hajnoczi wrote: > > Many vhost devices in QEMU currently do not involve the device backend > > in feature negotiation. This seems fine at first glance when no > > device-specific

Re: [PULL 36/37] qdev: remove QDEV_PROP_PTR

2020-07-06 Thread Philippe Mathieu-Daudé
On 7/6/20 12:01 PM, Marc-André Lureau wrote: > Hi > > On Mon, Jul 6, 2020 at 12:44 PM Philippe Mathieu-Daudé > wrote: >> >> On 1/7/20 4:04 PM, Marc-André Lureau wrote: >>> No longer used in the tree. The comment about user_creatable is still >>> quite relevant, but there is already a similar

Re: [PATCH] Fix MIPS add.s after 1ace099f2acb952eaaef0ba7725879949a7e4406

2020-07-06 Thread Alexander Richardson
Hi Philippe, On Fri, 3 Jul 2020 at 19:40, Philippe Mathieu-Daudé wrote: > > Hi Alex, > > On 7/3/20 6:15 PM, Alex Richardson wrote: > > After merging latest QEMU upstream into our CHERI fork, I noticed that > > some of the FPU tests in our MIPS baremetal testsuite > > I understand by baremetal

[PULL 30/31] block: drop unallocated_blocks_are_zero

2020-07-06 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy Currently this field only set by qed and qcow2. But in fact, all backing-supporting formats (parallels, qcow, qcow2, qed, vmdk) share these semantics: on unallocated blocks, if there is no backing file they just memset the buffer with zeroes. So, document this

[PULL 29/31] block/vhdx: drop unallocated_blocks_are_zero

2020-07-06 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy vhdx doesn't have .bdrv_co_block_status handler, so DATA|ALLOCATED is always assumed for it in bdrv_co_block_status(). unallocated_blocks_are_zero is useless (it doesn't affect the only user of the field: bdrv_co_block_status()), drop it. Signed-off-by:

[PULL 18/31] block/core: add generic infrastructure for x-blockdev-amend qmp command

2020-07-06 Thread Max Reitz
From: Maxim Levitsky blockdev-amend will be used similiar to blockdev-create to allow on the fly changes of the structure of the format based block devices. Current plan is to first support encryption keyslot management for luks based formats (raw and embedded in qcow2) Signed-off-by: Maxim

Re: [PATCH v3 03/44] qdev: Use returned bool to check for qdev_realize() etc. failure

2020-07-06 Thread Greg Kurz
On Mon, 6 Jul 2020 10:09:09 +0200 Markus Armbruster wrote: > Convert > > foo(..., ); > if (err) { > ... > } > > to > > if (!foo(..., )) { > ... > } > > for qdev_realize(), qdev_realize_and_unref(), qbus_realize() and their > wrappers

[PULL 25/31] block/vpc: return ZERO block-status when appropriate

2020-07-06 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy In case when get_image_offset() returns -1, we do zero out the corresponding chunk of qiov. So, this should be reported as ZERO. Note that this changes visible output of "qemu-img map --output=json" and "qemu-io -c map" commands. For qemu-img map, the change

[PULL 16/31] block/qcow2: extend qemu-img amend interface with crypto options

2020-07-06 Thread Max Reitz
From: Maxim Levitsky Now that we have all the infrastructure in place, wire it in the qcow2 driver and expose this to the user. Signed-off-by: Maxim Levitsky Reviewed-by: Daniel P. Berrangé Reviewed-by: Max Reitz Message-Id: <20200608094030.670121-9-mlevi...@redhat.com> Signed-off-by: Max

[PULL 27/31] block/iscsi: drop unallocated_blocks_are_zero

2020-07-06 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy We set bdi->unallocated_blocks_are_zero = iscsilun->lbprz, but iscsi_co_block_status doesn't return 0 in case of iscsilun->lbprz, it returns ZERO when appropriate. So actually unallocated_blocks_are_zero is useless (it doesn't affect the only user of the field:

[PULL 31/31] qed: Simplify backing reads

2020-07-06 Thread Max Reitz
From: Eric Blake The other four drivers that support backing files (qcow, qcow2, parallels, vmdk) all rely on the block layer to populate zeroes when reading beyond EOF of a short backing file. We can simplify the qed code by doing likewise. Signed-off-by: Eric Blake Reviewed-by: Vladimir

[PULL 28/31] block/file-posix: drop unallocated_blocks_are_zero

2020-07-06 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy raw_co_block_status() in block/file-posix.c never returns 0, so unallocated_blocks_are_zero is useless (it doesn't affect the only user of the field: bdrv_co_block_status()). Drop it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake

[PULL 12/31] block/amend: separate amend and create options for qemu-img

2020-07-06 Thread Max Reitz
From: Maxim Levitsky Some options are only useful for creation (or hard to be amended, like cluster size for qcow2), while some other options are only useful for amend, like upcoming keyslot management options for luks Since currently only qcow2 supports amend, move all its options to a common

[PULL 26/31] block/crypto: drop unallocated_blocks_are_zero

2020-07-06 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy It's false by default, no needs to set it. We are going to drop this variable at all, so drop it now here, it doesn't hurt. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake Message-Id: <20200528094405.145708-6-vsement...@virtuozzo.com>

[PULL 23/31] block: inline bdrv_unallocated_blocks_are_zero()

2020-07-06 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy The function has only one user: bdrv_co_block_status(). Inline it to simplify reviewing of the following patches, which will finally drop unallocated_blocks_are_zero field too. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake Message-Id:

[PULL 24/31] block/vdi: return ZERO block-status when appropriate

2020-07-06 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy In case of !VDI_IS_ALLOCATED[], we do zero out the corresponding chunk of qiov. So, this should be reported as ZERO. Note that this changes visible output of "qemu-img map --output=json" and "qemu-io -c map" commands. For qemu-img map, the change is obvious:

[PULL 19/31] block/crypto: implement blockdev-amend

2020-07-06 Thread Max Reitz
From: Maxim Levitsky Signed-off-by: Maxim Levitsky Reviewed-by: Daniel P. Berrangé Reviewed-by: Max Reitz Message-Id: <20200608094030.670121-13-mlevi...@redhat.com> Signed-off-by: Max Reitz --- qapi/block-core.json | 14 - block/crypto.c | 72

[PULL 22/31] qemu-img: convert: don't use unallocated_blocks_are_zero

2020-07-06 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy qemu-img convert wants to distinguish ZERO which comes from short backing files. unallocated_blocks_are_zero field of bdi is unrelated: space after EOF is always considered to be zero anyway. So, just make post_backing_zero true in case of short backing file.

[PULL 11/31] block/amend: add 'force' option

2020-07-06 Thread Max Reitz
From: Maxim Levitsky 'force' option will be used for some unsafe amend operations. This includes things like erasing last keyslot in luks based formats (which destroys the data, unless the master key is backed up by external means), but that _might_ be desired result. Signed-off-by: Maxim

[PULL 17/31] iotests: qemu-img tests for luks key management

2020-07-06 Thread Max Reitz
From: Maxim Levitsky This commit adds two tests, which test the new amend interface of both luks raw images and qcow2 luks encrypted images. Signed-off-by: Maxim Levitsky Reviewed-by: Daniel P. Berrangé [mreitz: Let 293 verify that LUKS works; drop $(seq) usage from 293; drop 293 and

[PULL 10/31] qcrypto/luks: implement encryption key management

2020-07-06 Thread Max Reitz
From: Maxim Levitsky Next few patches will expose that functionality to the user. Signed-off-by: Maxim Levitsky Reviewed-by: Daniel P. Berrangé Message-Id: <20200608094030.670121-3-mlevi...@redhat.com> Signed-off-by: Max Reitz --- qapi/crypto.json| 59 ++- crypto/block-luks.c | 416

[PULL 15/31] block/crypto: implement the encryption key management

2020-07-06 Thread Max Reitz
From: Maxim Levitsky This implements the encryption key management using the generic code in qcrypto layer and exposes it to the user via qemu-img This code adds another 'write_func' because the initialization write_func works directly on the underlying file, and amend works on instance of luks

[PULL 21/31] iotests: add tests for blockdev-amend

2020-07-06 Thread Max Reitz
From: Maxim Levitsky This commit adds two tests that cover the new blockdev-amend functionality of luks and qcow2 driver Signed-off-by: Maxim Levitsky Reviewed-by: Daniel P. Berrangé [mreitz: Let 295 verify that LUKS works; drop 295 and 296 from the auto group] Signed-off-by: Max

[PULL 09/31] qcrypto/core: add generic infrastructure for crypto options amendment

2020-07-06 Thread Max Reitz
From: Maxim Levitsky This will be used first to implement luks keyslot management. block_crypto_amend_opts_init will be used to convert qemu-img cmdline to QCryptoBlockAmendOptions Signed-off-by: Maxim Levitsky Reviewed-by: Daniel P. Berrangé Message-Id:

[PULL 20/31] block/qcow2: implement blockdev-amend

2020-07-06 Thread Max Reitz
From: Maxim Levitsky Currently the implementation only supports amending the encryption options, unlike the qemu-img version Signed-off-by: Maxim Levitsky Reviewed-by: Daniel P. Berrangé Reviewed-by: Max Reitz Message-Id: <20200608094030.670121-14-mlevi...@redhat.com> Signed-off-by: Max

[PULL 06/31] iotests.py: Add qemu_img_pipe_and_status()

2020-07-06 Thread Max Reitz
This function will be used by the next patch, which intends to check both the exit code and qemu-img's output. Signed-off-by: Max Reitz Message-Id: <20200625125548.870061-5-mre...@redhat.com> Reviewed-by: Maxim Levitsky [mreitz: Rebased on 49438972b8c2e] Signed-off-by: Max Reitz ---

[PULL 13/31] block/amend: refactor qcow2 amend options

2020-07-06 Thread Max Reitz
From: Maxim Levitsky Some qcow2 create options can't be used for amend. Remove them from the qcow2 create options and add generic logic to detect such options in qemu-img Signed-off-by: Maxim Levitsky Reviewed-by: Daniel P. Berrangé [mreitz: Dropped some iotests reference output hunks that

[PULL 04/31] iotests: filter few more luks specific create options

2020-07-06 Thread Max Reitz
From: Maxim Levitsky This allows more tests to be able to have same output on both qcow2 luks encrypted images and raw luks images Signed-off-by: Maxim Levitsky Signed-off-by: Max Reitz Reviewed-by: Maxim Levitsky Message-Id: <20200625125548.870061-3-mre...@redhat.com> ---

[PULL 14/31] block/crypto: rename two functions

2020-07-06 Thread Max Reitz
From: Maxim Levitsky rename the write_func to create_write_func, and init_func to create_init_func. This is preparation for other write_func that will be used to update the encryption keys. No functional changes Signed-off-by: Maxim Levitsky Reviewed-by: Daniel P. Berrangé Message-Id:

[PULL 07/31] iotests.py: Add (verify|has)_working_luks()

2020-07-06 Thread Max Reitz
Similar to _require_working_luks for bash tests, these functions can be used to check whether our luks driver can actually create images. Signed-off-by: Max Reitz Message-Id: <20200625125548.870061-6-mre...@redhat.com> Reviewed-by: Maxim Levitsky --- tests/qemu-iotests/iotests.py | 39

[PULL 08/31] iotests: Check whether luks works

2020-07-06 Thread Max Reitz
Whenever running an iotest for the luks format, we should check whether luks actually really works. Tests that try to create luks-encrypted qcow2 images should do the same. Signed-off-by: Max Reitz Message-Id: <20200625125548.870061-7-mre...@redhat.com> Reviewed-by: Maxim Levitsky ---

[PULL 05/31] iotests/common.rc: Add _require_working_luks

2020-07-06 Thread Max Reitz
That the luks driver is present is little indication on whether it is actually working. Without the crypto libraries linked in, it does not work. So add this function, which tries to create a luks image to see whether that actually works. Signed-off-by: Max Reitz Message-Id:

[PULL 03/31] iotests: Make _filter_img_create more active

2020-07-06 Thread Max Reitz
Right now, _filter_img_create just filters out everything that looks format-dependent, and applies some filename filters. That means that we have to add another filter line every time some format gets a new creation option. This can be avoided by instead discarding everything and just keeping

[PULL 00/31] Block patches

2020-07-06 Thread Max Reitz
The following changes since commit eb6490f544388dd24c0d054a96dd304bc7284450: Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200703' into staging (2020-07-04 16:08:41 +0100) are available in the Git repository at: https://github.com/XanClic/qemu.git

[PULL 01/31] block/block-copy: block_copy_dirty_clusters: fix failure check

2020-07-06 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy ret may be > 0 on success path at this point. Fix assertion, which may crash currently. Fixes: 4ce5dd3e9b5ee0fac18625860eb3727399ee965e Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20200526181347.489557-1-vsement...@virtuozzo.com> Signed-off-by:

[PULL 02/31] qcow2: Fix preallocation on images with unaligned sizes

2020-07-06 Thread Max Reitz
From: Alberto Garcia When resizing an image with qcow2_co_truncate() using the falloc or full preallocation modes the code assumes that both the old and new sizes are cluster-aligned. There are two problems with this: 1) The calculation of how many clusters are involved does not always

Re: [PULL 36/37] qdev: remove QDEV_PROP_PTR

2020-07-06 Thread Marc-André Lureau
Hi On Mon, Jul 6, 2020 at 12:44 PM Philippe Mathieu-Daudé wrote: > > On 1/7/20 4:04 PM, Marc-André Lureau wrote: > > No longer used in the tree. The comment about user_creatable is still > > quite relevant, but there is already a similar comment in qdev-core.h. > > > > Reviewed-by: Peter Maydell

Re: [PATCH v3 02/18] hw/block/nvme: fix missing endian conversion

2020-07-06 Thread Philippe Mathieu-Daudé
On 7/6/20 8:12 AM, Klaus Jensen wrote: > From: Klaus Jensen > > Fix a missing cpu_to conversion by moving conversion to just before > returning instead. > > Signed-off-by: Klaus Jensen > Suggested-by: Philippe Mathieu-Daudé > --- > hw/block/nvme.c | 6 +++--- > 1 file changed, 3

Re: [PATCH v3 03/18] hw/block/nvme: additional tracing

2020-07-06 Thread Philippe Mathieu-Daudé
On 7/6/20 8:12 AM, Klaus Jensen wrote: > From: Klaus Jensen > > Add various additional tracing and streamline nvme_identify_ns and > nvme_identify_nslist (they do not need to repeat the command, it is > already in the trace name). > > Signed-off-by: Klaus Jensen > --- > hw/block/nvme.c

Re: [PATCH v3 15/18] hw/block/nvme: reject invalid nsid values in active namespace id list

2020-07-06 Thread Philippe Mathieu-Daudé
On 7/6/20 8:13 AM, Klaus Jensen wrote: > From: Klaus Jensen > > Reject the nsid broadcast value (0x) and 0xfffe in the > Active Namespace ID list. > > Signed-off-by: Klaus Jensen > --- > hw/block/nvme.c | 10 ++ > 1 file changed, 10 insertions(+) > > diff --git

Re: [PATCH v3 17/18] hw/block/nvme: provide the mandatory subnqn field

2020-07-06 Thread Philippe Mathieu-Daudé
On 7/6/20 8:13 AM, Klaus Jensen wrote: > From: Klaus Jensen > > The SUBNQN field is mandatory in NVM Express 1.3. > > Signed-off-by: Klaus Jensen > --- > hw/block/nvme.c | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/hw/block/nvme.c b/hw/block/nvme.c > index

Re: [PATCH v3 16/16] block/nvme: Use per-queuepair IRQ notifier and AIO context

2020-07-06 Thread Philippe Mathieu-Daudé
On 7/4/20 11:30 PM, Philippe Mathieu-Daudé wrote: > To be able to use multiple queues on the same hardware, > we need to have each queuepair able to receive IRQ > notifications in the correct AIO context. > > The AIO context and the notification handler have to be proper > to each queue, not to

[PATCH v1] target/riscv: fix pmp implementation

2020-07-06 Thread Alexandre Mergnat
The end address calculation for NA4 mode is wrong because the address used isn't shifted. That imply all NA4 setup are not applied by the PMP. The solution is to use the shifted address calculated for start address variable. Modifications are tested on Zephyr OS userspace test suite which works

Re: [PATCH v2 3/7] docs: document non-net VHOST_USER_GET_FEATURES behavior

2020-07-06 Thread Stefan Hajnoczi
On Wed, Jun 10, 2020 at 01:01:26AM -0400, Michael S. Tsirkin wrote: > On Tue, Jun 09, 2020 at 06:02:14PM +0100, Stefan Hajnoczi wrote: > > +For devices other than the networking device, masters may assume the > > following > > +feature bits are always set in ``VHOST_USER_GET_FEATURES`` for > >

Re: [PATCH 0/2] Add new features for intel processor

2020-07-06 Thread Paolo Bonzini
On 06/07/20 01:17, Cathy Zhang wrote: > This patchset is to add two new features for intel processors > which support them, like Sapphire Rapids. SERIALIZE is a faster > serializing instruction which does not modify registers, > arithmetic flags or memory, will not cause VM exit. TSX suspend >

Re: [PATCH v3 04/10] block/vpc: return ZERO block-status when appropriate

2020-07-06 Thread Vladimir Sementsov-Ogievskiy
06.07.2020 11:28, Max Reitz wrote: On 28.05.20 11:43, Vladimir Sementsov-Ogievskiy wrote: In case when get_image_offset() returns -1, we do zero out the corresponding chunk of qiov. So, this should be reported as ZERO. Note that this changes visible output of "qemu-img map --output=json" and

Re: [PATCH v3 2/2] PCI: vmd: Use Shadow MEMBAR registers for QEMU/KVM guests

2020-07-06 Thread Lorenzo Pieralisi
On Wed, May 27, 2020 at 11:02:40PM -0400, Jon Derrick wrote: > VMD device 28C0 natively assists guest passthrough of the VMD endpoint > through the use of shadow registers that provide Host Physical Addresses > to correctly assign bridge windows. These shadow registers are only > available if VMD

Re: [PATCH v7 09/17] hw/sd/sdcard: Special case the -ENOMEDIUM error

2020-07-06 Thread Peter Maydell
On Mon, 6 Jul 2020 at 06:52, Markus Armbruster wrote: > This is TYPE_SD_CARD's ("sd-card"). What exactly does that device > model? It is I think supposed to be an SD card. The modelling may well be odd -- it's a qomification of a pre-existing abstraction layer that predates QOM and qbus. > If

Re: [PATCH 3/3] target/nios2: Use gen_io_start around wrctl instruction

2020-07-06 Thread Peter Maydell
On Sun, 5 Jul 2020 at 21:54, Max Filippov wrote: > > On Sun, Jul 5, 2020 at 11:16 AM Max Filippov wrote: > > On Sun, Jul 5, 2020 at 10:09 AM Peter Maydell > > wrote: > > > On Thu, 2 Jul 2020 at 19:53, Richard Henderson > > > wrote: > > > > This isn't right. Not so much the gen_io_start

Re: [PATCH v2] fcntl: Add 32bit filesystem mode

2020-07-06 Thread Linus Walleij
On Tue, Jun 23, 2020 at 12:08 PM Peter Maydell wrote: > On Fri, 29 May 2020 at 08:22, Linus Walleij wrote: > > > > It was brought to my attention that this bug from 2018 was > > still unresolved: 32 bit emulators like QEMU were given > > 64 bit hashes when running 32 bit emulation on 64 bit

Re: [PATCH v2] MAINTAINERS: Cover the firmware JSON schema

2020-07-06 Thread Daniel P . Berrangé
On Fri, Jul 03, 2020 at 08:34:50PM +0200, Philippe Mathieu-Daudé wrote: > Add an entry to cover firmware.json (see commit 3a0adfc9bf: > schema that describes the different uses and properties of > virtual machine firmware). > > Cc: Laszlo Ersek > Cc: Gerd Hoffmann > Cc: Michael S. Tsirkin >

Re: [PATCH v3 2/2] net: detect errors from probing vnet hdr flag for TAP devices

2020-07-06 Thread Philippe Mathieu-Daudé
On 7/1/20 9:39 PM, Laurent Vivier wrote: > From: "Daniel P. Berrange" > > When QEMU sets up a tap based network device backend, it mostly ignores errors > reported from various ioctl() calls it makes, assuming the TAP file descriptor > is valid. This assumption can easily be violated when the

Re: [PATCH v3 1/2] net: tap: check if the file descriptor is valid before using it

2020-07-06 Thread Philippe Mathieu-Daudé
On 7/2/20 10:18 AM, Philippe Mathieu-Daudé wrote: > On 7/2/20 10:17 AM, Laurent Vivier wrote: >> On 02/07/2020 10:00, Philippe Mathieu-Daudé wrote: >>> On 7/1/20 9:39 PM, Laurent Vivier wrote: qemu_set_nonblock() checks that the file descriptor can be used and, if not, crashes QEMU. An

Re: [PULL 36/37] qdev: remove QDEV_PROP_PTR

2020-07-06 Thread Philippe Mathieu-Daudé
On 1/7/20 4:04 PM, Marc-André Lureau wrote: > No longer used in the tree. The comment about user_creatable is still > quite relevant, but there is already a similar comment in qdev-core.h. > > Reviewed-by: Peter Maydell > Signed-off-by: Marc-André Lureau > --- > include/hw/qdev-properties.h |

Re: [PATCH v3 04/10] block/vpc: return ZERO block-status when appropriate

2020-07-06 Thread Max Reitz
On 28.05.20 11:43, Vladimir Sementsov-Ogievskiy wrote: > In case when get_image_offset() returns -1, we do zero out the > corresponding chunk of qiov. So, this should be reported as ZERO. > > Note that this changes visible output of "qemu-img map --output=json" > and "qemu-io -c map" commands.

[PATCH v3 37/44] block/parallels: Simplify parallels_open() after previous commit

2020-07-06 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/parallels.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index 180dd41e2b..cb5259ac44 100644 --- a/block/parallels.c

[PATCH v3 42/44] qemu-img: Ignore Error objects where the return value suffices

2020-07-06 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- qemu-img.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index fc405ee171..a6af0eaf80 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -464,22 +464,18 @@ static int

Re: [PATCH v3 00/44] Less clumsy error checking

2020-07-06 Thread Markus Armbruster
diff between v2 rebased and v3, with hunks that change only whitespace dropped: diff --git a/qapi/opts-visitor.c b/qapi/opts-visitor.c index 6d8f4b6928..7781c23a42 100644 --- a/qapi/opts-visitor.c +++ b/qapi/opts-visitor.c @@ -235,12 +235,12 @@ opts_start_list(Visitor *v, const char *name,

<    1   2   3   4   5   >