Re: [Qemu-devel] [PATCH] migration: not necessary to check ops again

2019-05-14 Thread Dr. David Alan Gilbert
* Wei Yang (richardw.y...@linux.intel.com) wrote: > During each iteration, se->ops is checked before each loop. So it is not > necessary to check it again and simplify the following check a little. > > Signed-off-by: Wei Yang Queued > --- > migration/savevm.c | 14 ++ > 1 file chan

Re: [Qemu-devel] [PATCH] docs: provide documentation on the POWER9 XIVE interrupt controller

2019-05-14 Thread Cédric Le Goater
On 5/14/19 11:17 AM, Peter Maydell wrote: > On Tue, 14 May 2019 at 07:46, Cédric Le Goater wrote: >> >> This documents the overall XIVE architecture and gives an overview of >> the QEMU models. It also provides documentation on the 'info pic' >> command. >> >> Signed-off-by: Cédric Le Goater >> -

Re: [Qemu-devel] [PATCH v2 13/13] qemu-iotests: Test the x-blockdev-reopen QMP command

2019-05-14 Thread Alberto Garcia
On Sat 13 Apr 2019 02:53:42 AM CEST, Max Reitz wrote: >> Calling x-blockdev-reopen without 'backing' should only fail if >> >> a) the image has a backing file attached to it. >> In this case it doesn't: we just detached it in the previous line. >> >> b) there's a default backing file writte

Re: [Qemu-devel] [Qemu-ppc] [PATCH] docs: provide documentation on the POWER9 XIVE interrupt controller

2019-05-14 Thread Cédric Le Goater
On 5/14/19 9:33 AM, Satheesh Rajendran wrote: > On Tue, May 14, 2019 at 08:46:27AM +0200, Cédric Le Goater wrote: >> This documents the overall XIVE architecture and gives an overview of >> the QEMU models. It also provides documentation on the 'info pic' >> command. >> >> Signed-off-by: Cédric Le

Re: [Qemu-devel] [PATCH 3/5] s390: vfio_pci: Use a PCI Group structure

2019-05-14 Thread Cornelia Huck
On Fri, 10 May 2019 16:38:51 +0200 Pierre Morel wrote: > We use a S390PCIGroup structure to hold the information > related to zPCI Function group. > > This allows us to be ready to support multiple groups and to retrieve > the group information from the host. What if there is no host to retriev

Re: [Qemu-devel] [PATCH v4 1/3] libvhost-user: fix cast warnings on 32 bits

2019-05-14 Thread Philippe Mathieu-Daudé
On 5/14/19 12:41 PM, Marc-André Lureau wrote: > Fixes warnings: > warning: cast to pointer from integer of different size > [-Wint-to-pointer-cast] > > Signed-off-by: Marc-André Lureau > --- > contrib/libvhost-user/libvhost-user.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) >

Re: [Qemu-devel] [PATCH v4 2/3] libvhost-user: fix -Werror=format= on ppc64

2019-05-14 Thread Philippe Mathieu-Daudé
Hi Marc-André, On 5/14/19 12:41 PM, Marc-André Lureau wrote: > That should fix the following warning: > > /home/pm215/qemu/contrib/libvhost-user/libvhost-user.c: In function > ‘vu_set_mem_table_exec_postcopy’: > /home/pm215/qemu/contrib/libvhost-user/libvhost-user.c:666:9: error: > format ‘%llx’

[Qemu-devel] [PATCH v7 1/9] qapi: group BlockDeviceStats fields

2019-05-14 Thread Anton Nefedov
Make the stat fields definition slightly more readable. Also reorder total_time_ns stats read-write-flush as done elsewhere. Cosmetic change only. Signed-off-by: Anton Nefedov Reviewed-by: Alberto Garcia Reviewed-by: Vladimir Sementsov-Ogievskiy --- qapi/block-core.json | 26 +++---

[Qemu-devel] [PATCH v7 4/9] ide: account UNMAP (TRIM) operations

2019-05-14 Thread Anton Nefedov
Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy --- hw/ide/core.c | 12 1 file changed, 12 insertions(+) diff --git a/hw/ide/core.c b/hw/ide/core.c index 6afadf894f..3a7ac93777 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -441,6 +441,14 @@ static void id

[Qemu-devel] [PATCH v7 5/9] scsi: store unmap offset and nb_sectors in request struct

2019-05-14 Thread Anton Nefedov
it allows to report it in the error handler Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alberto Garcia --- hw/scsi/scsi-disk.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c inde

[Qemu-devel] [PATCH v7 2/9] qapi: add unmap to BlockDeviceStats

2019-05-14 Thread Anton Nefedov
Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alberto Garcia Reviewed-by: Eric Blake --- qapi/block-core.json | 29 +++-- include/block/accounting.h | 1 + block/qapi.c | 6 ++ tests/qemu-iotests/227.out |

[Qemu-devel] [PATCH v7 0/9] discard blockstats

2019-05-14 Thread Anton Nefedov
hi, yet another take for this patch series; please kindly consider these for 4.1 Just a few cosmetic comments were received for v6 so this is mostly a rebase+ping. new in v7: - general rebase - since clauses -> 4.1 - patch 8: not completely trivial rebase: raw_account_discard moved t

[Qemu-devel] [PATCH v7 9/9] qapi: query-blockstat: add driver specific file-posix stats

2019-05-14 Thread Anton Nefedov
A block driver can provide a callback to report driver-specific statistics. file-posix driver now reports discard statistics Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy Acked-by: Markus Armbruster --- qapi/block-core.json | 38 ++

[Qemu-devel] [PATCH v7 3/9] block: add empty account cookie type

2019-05-14 Thread Anton Nefedov
This adds some protection from accounting uninitialized cookie. That is, block_acct_failed/done without previous block_acct_start; in that case, cookie probably holds values from previous operation. (Note: it might also be uninitialized holding garbage value and there is still "< BLOCK_MAX_IOTYPE

[Qemu-devel] [PATCH v7 6/9] scsi: move unmap error checking to the complete callback

2019-05-14 Thread Anton Nefedov
This will help to account the operation in the following commit. The difference is that we don't call scsi_disk_req_check_error() before the 1st discard iteration anymore. That function also checks if the request is cancelled, however it shouldn't get canceled until it yields in blk_aio() function

Re: [Qemu-devel] [PATCH 1/6] qemu-bridge-helper: Fix misuse of isspace()

2019-05-14 Thread Markus Armbruster
Peter Maydell writes: > On Mon, 13 May 2019 at 14:21, Markus Armbruster wrote: >> Perhaps I should do it just for this file while I touch it anyway. The >> question to ask: should parse_acl_file() obey the locale for whitespace >> recognition? > > I vote for "no". > > Q: do we document the form

[Qemu-devel] [PATCH v7 7/9] scsi: account unmap operations

2019-05-14 Thread Anton Nefedov
Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy --- hw/scsi/scsi-disk.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 6eff496b54..5c77981d60 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/sc

[Qemu-devel] [PATCH v7 8/9] file-posix: account discard operations

2019-05-14 Thread Anton Nefedov
This will help to identify how many of the user-issued discard operations (accounted on a device level) have actually suceeded down on the host file (even though the numbers will not be exactly the same if non-raw format driver is used (e.g. qcow2 sending metadata discards)). Note that these numbe

Re: [Qemu-devel] [PATCH 00/13] target/arm/kvm: enable SVE in guests

2019-05-14 Thread Andrea Bolognani
On Mon, 2019-05-13 at 14:36 +0200, Andrew Jones wrote: > On Mon, May 13, 2019 at 11:32:46AM +0200, Andrea Bolognani wrote: > > On Sun, 2019-05-12 at 10:36 +0200, Andrew Jones wrote: > > [...] > > >CPU type | accel | sve-max-vq | sve-vls-map > > >--- >

Re: [Qemu-devel] [PULL 00/31] tcg: gvec improvments

2019-05-14 Thread Peter Maydell
On Tue, 14 May 2019 at 01:22, Richard Henderson wrote: > > Most of these patches are in support of David's guest vector > patches for target/s390x. > > > r~ > > > The following changes since commit e24f44dbeab8e54c72bdaedbd35453fb2a6c38da: > > Merge remote-tracking branch > 'remotes/huth-gitlab

Re: [Qemu-devel] [PULL v2 00/27] tcg: Add CPUClass::tlb_fill

2019-05-14 Thread Peter Maydell
On Fri, 10 May 2019 at 19:54, Richard Henderson wrote: > > Changes in v2: > > * Fix --disable-tcg compilation for x86 and s390x. > I adjusted every target/ that used any CONFIG_TCG in cpu.c. > but then afterward I see that only x86 and s390x have had > their Makefiles adjusted to mak

Re: [Qemu-devel] [PATCH v4 2/3] libvhost-user: fix -Werror=format= on ppc64

2019-05-14 Thread Marc-André Lureau
Hi On Tue, May 14, 2019 at 2:10 PM Philippe Mathieu-Daudé wrote: > > Hi Marc-André, > > On 5/14/19 12:41 PM, Marc-André Lureau wrote: > > That should fix the following warning: > > > > /home/pm215/qemu/contrib/libvhost-user/libvhost-user.c: In function > > ‘vu_set_mem_table_exec_postcopy’: > > /h

Re: [Qemu-devel] [PATCH 00/13] target/arm/kvm: enable SVE in guests

2019-05-14 Thread Andrew Jones
On Tue, May 14, 2019 at 02:29:51PM +0200, Andrea Bolognani wrote: > On Mon, 2019-05-13 at 14:36 +0200, Andrew Jones wrote: > > On Mon, May 13, 2019 at 11:32:46AM +0200, Andrea Bolognani wrote: > > > On Sun, 2019-05-12 at 10:36 +0200, Andrew Jones wrote: > > > [...] > > > >CPU type | accel | sve

Re: [Qemu-devel] [PATCH v2 13/13] qemu-iotests: Test the x-blockdev-reopen QMP command

2019-05-14 Thread Max Reitz
On 14.05.19 13:30, Alberto Garcia wrote: > On Sat 13 Apr 2019 02:53:42 AM CEST, Max Reitz wrote: >>> Calling x-blockdev-reopen without 'backing' should only fail if >>> >>> a) the image has a backing file attached to it. >>> In this case it doesn't: we just detached it in the previous line. >>

Re: [Qemu-devel] [PATCH v2 13/13] qemu-iotests: Test the x-blockdev-reopen QMP command

2019-05-14 Thread Alberto Garcia
On Tue 14 May 2019 03:02:33 PM CEST, Max Reitz wrote: >> Why would both be fine? backing_file refers to the backing file >> currently attached, and auto_backing_file refers to the one written >> on the image metadata, or am I wrong? > > After my series, backing_file refers to the image metadata. I

[Qemu-devel] [PATCH RESEND] monitor: Fix return type of monitor_fdset_dup_fd_find

2019-05-14 Thread Yury Kotov
monitor_fdset_dup_fd_find_remove() and monitor_fdset_dup_fd_find() returns mon_fdset->id which is int64_t. Downcast from int64_t to int leads to a bug with removing fd from fdset which id >= 2^32. So, fix return types for these function. Signed-off-by: Yury Kotov --- include/monitor/monitor.h |

Re: [Qemu-devel] [PATCH] migration: remove not used field xfer_limit

2019-05-14 Thread Dr. David Alan Gilbert
* Dr. David Alan Gilbert (dgilb...@redhat.com) wrote: > * Wei Yang (richardw.y...@linux.intel.com) wrote: > > MigrationState->xfer_limit is only set to 0 in migrate_init(). > > > > Remove this unnecessary field. > > > > Signed-off-by: Wei Yang > > Nice; I think that field has been unneeded sinc

Re: [Qemu-devel] How do we do user input bitmap properties?

2019-05-14 Thread Markus Armbruster
Andrew Jones writes: > On Tue, May 14, 2019 at 06:54:03AM +0200, Markus Armbruster wrote: >> Andrew Jones writes: >> >> > On Thu, Apr 18, 2019 at 07:48:09PM +0200, Markus Armbruster wrote: >> >> Daniel P. Berrangé writes: >> >> >> >> > On Thu, Apr 18, 2019 at 11:28:41AM +0200, Andrew Jones wr

Re: [Qemu-devel] [PATCH v2] vmstate: check subsection_found is enough

2019-05-14 Thread Dr. David Alan Gilbert
* Wei Yang (richardw.y...@linux.intel.com) wrote: > subsection_found is true implies vmdesc is not NULL. > > This patch remove the additional check on vmdesc and rename > subsection_found to vmdesc_has_subsections to make it more self-explain. > > Signed-off-by: Wei Yang Queued. > --- > v2: >

Re: [Qemu-devel] [PATCH v4 1/3] VirtIO-RNG: Update default entropy source to `/dev/urandom`

2019-05-14 Thread Markus Armbruster
Laurent Vivier writes: > On 14/05/2019 10:08, Kashyap Chamarthy wrote: >> On Tue, May 14, 2019 at 09:56:00AM +0200, Laurent Vivier wrote: >>> From: Kashyap Chamarthy >>> >>> When QEMU exposes a VirtIO-RNG device to the guest, that device needs a >>> source of entropy, and that source needs to be

[Qemu-devel] [PATCH v13 0/1] qcow2: cluster space preallocation

2019-05-14 Thread Anton Nefedov
hi, this used to be a large 10-patches series, but now thanks to Kevin's BDRV_REQ_NO_FALLBACK series (http://lists.nongnu.org/archive/html/qemu-devel/2019-03/msg06389.html) the core block layer functionality is already in place: the existing flag can be reused. A few accompanying patches were als

[Qemu-devel] [PATCH v13 1/1] qcow2: skip writing zero buffers to empty COW areas

2019-05-14 Thread Anton Nefedov
If COW areas of the newly allocated clusters are zeroes on the backing image, efficient bdrv_write_zeroes(flags=BDRV_REQ_NO_FALLBACK) can be used on the whole cluster instead of writing explicit zero buffers later in perform_cow(). iotest 060: write to the discarded cluster does not trigger COW an

Re: [Qemu-devel] [PATCH v7 1/8] vhost-user: add vhost_user_gpu_set_socket()

2019-05-14 Thread Gerd Hoffmann
> > > + typedef struct VhostUserGpuMsg { > > > + uint32_t request; /* VhostUserGpuRequest */ > > > + uint32_t flags; > > > + uint32_t size; /* the following payload size */ > > > > uint32_t padding; > > > > > + union { > > > + VhostUserGpuCursorPos cursor_pos; > > > +

[Qemu-devel] [PATCH] iotest 134: test cluster-misaligned encrypted write

2019-05-14 Thread Anton Nefedov
COW (even empty/zero) areas require encryption too Signed-off-by: Anton Nefedov Reviewed-by: Eric Blake Reviewed-by: Max Reitz Reviewed-by: Alberto Garcia --- used to be a part of 'qcow2: cluster space preallocation' series http://lists.nongnu.org/archive/html/qemu-devel/2019-01/msg02769.html

[Qemu-devel] [PATCH] block: Use BDRV_REQUEST_MAX_BYTES instead of BDRV_REQUEST_MAX_SECTORS

2019-05-14 Thread Alberto Garcia
There are a few places in which we turn a number of bytes into sectors in order to compare the result against BDRV_REQUEST_MAX_SECTORS instead of using BDRV_REQUEST_MAX_BYTES directly. Signed-off-by: Alberto Garcia --- block/io.c | 6 +++--- qemu-io-cmds.c | 7 +++ 2 files changed, 6 ins

Re: [Qemu-devel] [Qemu-block] [PATCH] nvme: add Get/Set Feature Timestamp support

2019-05-14 Thread Klaus Birkelund
On Fri, Apr 05, 2019 at 03:41:17PM -0600, Kenneth Heitke wrote: > Signed-off-by: Kenneth Heitke > --- > hw/block/nvme.c | 120 +- > hw/block/nvme.h | 3 ++ > hw/block/trace-events | 2 + > include/block/nvme.h | 2 + > 4 files changed, 12

Re: [Qemu-devel] [PATCH RESEND] monitor: Fix return type of monitor_fdset_dup_fd_find

2019-05-14 Thread Markus Armbruster
Yury Kotov writes: > monitor_fdset_dup_fd_find_remove() and monitor_fdset_dup_fd_find() > returns mon_fdset->id which is int64_t. Downcast from int64_t to int leads to Grammar nits: s/returns/return/ s/Downcast/Downcasting/ > a bug with removing fd from fdset which id >= 2^32. s/which

Re: [Qemu-devel] [PATCH 1/3] migration/ram.c: start of migration_bitmap_sync_range is always 0

2019-05-14 Thread Dr. David Alan Gilbert
* Wei Yang (richardw.y...@linux.intel.com) wrote: > We can eliminate to pass 0. > > Signed-off-by: Wei Yang Reviewed-by: Dr. David Alan Gilbert > --- > migration/ram.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/migration/ram.c b/migration/ram.c > index 3

Re: [Qemu-devel] [PATCH 0/3] Optimize COLO related codes and description

2019-05-14 Thread Dr. David Alan Gilbert
* Zhang Chen (chen.zh...@intel.com) wrote: > From: Zhang Chen > > In this series we optimize codes and fix some tiny issues. Queued > > Zhang Chen (3): > migration/colo.c: Remove redundant input parameter > migration/colo.h: Remove obsolete codes > qemu-option.hx: Update missed parameter

Re: [Qemu-devel] [PATCH RESEND] monitor: Fix return type of monitor_fdset_dup_fd_find

2019-05-14 Thread Eric Blake
On 5/14/19 8:15 AM, Yury Kotov wrote: > monitor_fdset_dup_fd_find_remove() and monitor_fdset_dup_fd_find() > returns mon_fdset->id which is int64_t. Downcast from int64_t to int leads to > a bug with removing fd from fdset which id >= 2^32. > So, fix return types for these function. fd's cannot ex

Re: [Qemu-devel] [PATCH] migration: savevm: fix error code with migration blockers

2019-05-14 Thread Dr. David Alan Gilbert
* Cole Robinson (crobi...@redhat.com) wrote: > The only caller that checks the error code is looking for != 0, > so returning false is incorrect. > > Fixes: 5aaac467938 "migration: savevm: consult migration blockers" > > Signed-off-by: Cole Robinson Queued > --- > migration/savevm.c | 2 +- >

Re: [Qemu-devel] [PATCH 2/3] migration/ram.c: start of cpu_physical_memory_sync_dirty_bitmap is always 0

2019-05-14 Thread Dr. David Alan Gilbert
* Wei Yang (richardw.y...@linux.intel.com) wrote: > Since start of cpu_physical_memory_sync_dirty_bitmap is always 0, we can > remove this parameter and simplify the calculation a bit. > > Signed-off-by: Wei Yang So I think you're right it's currently unused; however, lets ask Paolo: Do we need

Re: [Qemu-devel] [PATCH 1/3] migration/ram.c: start of migration_bitmap_sync_range is always 0

2019-05-14 Thread Dr. David Alan Gilbert
* Wei Yang (richardw.y...@linux.intel.com) wrote: > We can eliminate to pass 0. > > Signed-off-by: Wei Yang I'm going to queue just 1/3for the current pull. Dave > --- > migration/ram.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/migration/ram.c b/migrati

Re: [Qemu-devel] [PATCH] migration: update comments of migration bitmap

2019-05-14 Thread Dr. David Alan Gilbert
* Yi Wang (wang.y...@zte.com.cn) wrote: > Since the ram bitmap and the unsent bitmap are split by RAMBlock > in commit 6b6712e, it's better to update the comments about them. > > Signed-off-by: Yi Wang Reviewed-by: Dr. David Alan Gilbert > --- > migration/ram.c | 4 +--- > 1 file changed, 1 i

Re: [Qemu-devel] [PATCH] migration: update comments of migration bitmap

2019-05-14 Thread Dr. David Alan Gilbert
* Yi Wang (wang.y...@zte.com.cn) wrote: > Since the ram bitmap and the unsent bitmap are split by RAMBlock > in commit 6b6712e, it's better to update the comments about them. > > Signed-off-by: Yi Wang Queued > --- > migration/ram.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) >

Re: [Qemu-devel] [PATCH v3 3/3] virtio-rng: change default backend to rng-builtin

2019-05-14 Thread Markus Armbruster
Laurent Vivier writes: > On 10/05/2019 18:36, Markus Armbruster wrote: >> Laurent Vivier writes: >> >>> Signed-off-by: Laurent Vivier >>> --- >>> backends/rng-builtin.c | 8 +++- >>> hw/virtio/virtio-rng.c | 2 +- >>> include/hw/virtio/virtio-rng.h | 4 ++-- >>> incl

Re: [Qemu-devel] [Qemu-block] [PATCH] block: Use BDRV_REQUEST_MAX_BYTES instead of BDRV_REQUEST_MAX_SECTORS

2019-05-14 Thread Stefano Garzarella
On Tue, May 14, 2019 at 04:57:35PM +0300, Alberto Garcia wrote: > There are a few places in which we turn a number of bytes into sectors > in order to compare the result against BDRV_REQUEST_MAX_SECTORS > instead of using BDRV_REQUEST_MAX_BYTES directly. > > Signed-off-by: Alberto Garcia > --- >

Re: [Qemu-devel] [PATCH v4 1/3] VirtIO-RNG: Update default entropy source to `/dev/urandom`

2019-05-14 Thread Markus Armbruster
Laurent Vivier writes: > From: Kashyap Chamarthy > > When QEMU exposes a VirtIO-RNG device to the guest, that device needs a > source of entropy, and that source needs to be "non-blocking", like > `/dev/urandom`. However, currently QEMU defaults to the problematic > `/dev/random`, which on linu

Re: [Qemu-devel] [PATCH 1/4] migration/savevm: remove duplicate check of migration_is_blocked

2019-05-14 Thread Dr. David Alan Gilbert
* Wei Yang (richardw.y...@linux.intel.com) wrote: > Current call flow of save_snapshot is: > > save_snapshot > migration_is_blocked > qemu_savevm_state > migration_is_blocked > > Since qemu_savevm_state is only called in save_snapshot, this means > migration_is_blocked has bee

Re: [Qemu-devel] How do we do user input bitmap properties?

2019-05-14 Thread Igor Mammedov
On Tue, 14 May 2019 11:02:25 +0200 Andrew Jones wrote: > On Tue, May 14, 2019 at 06:54:03AM +0200, Markus Armbruster wrote: > > Andrew Jones writes: > > > > > On Thu, Apr 18, 2019 at 07:48:09PM +0200, Markus Armbruster wrote: > > >> Daniel P. Berrangé writes: > > >> > > >> > On Thu, Apr 18, 2

Re: [Qemu-devel] [PATCH v4 2/3] rng-builtin: add an RNG backend that uses qemu_guest_getrandom()

2019-05-14 Thread Markus Armbruster
Laurent Vivier writes: > Add a new RNG backend using QEMU builtin getrandom function. > > It can be created and used with something like: > > ... -object rng-builtin,id=rng0 -device virtio-rng,rng=rng0 ... > > Reviewed-by: Richard Henderson > Signed-off-by: Laurent Vivier > --- > backends/

Re: [Qemu-devel] [PATCH RESEND] monitor: Fix return type of monitor_fdset_dup_fd_find

2019-05-14 Thread Yury Kotov
14.05.2019, 17:05, "Eric Blake" : > On 5/14/19 8:15 AM, Yury Kotov wrote: >>  monitor_fdset_dup_fd_find_remove() and monitor_fdset_dup_fd_find() >>  returns mon_fdset->id which is int64_t. Downcast from int64_t to int leads >> to >>  a bug with removing fd from fdset which id >= 2^32. >>  So, fix

[Qemu-devel] [PATCH v9 0/7] virtio pmem driver

2019-05-14 Thread Pankaj Gupta
Hi Dan, Proposing the patch series to be merged via nvdimm tree as kindly agreed by you. We have ack/review on XFS, EXT4 & VIRTIO patches. Incorporated all the changes suggested in v8. This version added a new patch 4 for dax for device mapper change and some minor style changes in patch

[Qemu-devel] [PATCH v9 1/7] libnvdimm: nd_region flush callback support

2019-05-14 Thread Pankaj Gupta
This patch adds functionality to perform flush from guest to host over VIRTIO. We are registering a callback based on 'nd_region' type. virtio_pmem driver requires this special flush function. For rest of the region types we are registering existing flush function. Report error returned by host fsy

[Qemu-devel] [PATCH v9 2/7] virtio-pmem: Add virtio pmem driver

2019-05-14 Thread Pankaj Gupta
This patch adds virtio-pmem driver for KVM guest. Guest reads the persistent memory range information from Qemu over VIRTIO and registers it on nvdimm_bus. It also creates a nd_region object with the persistent memory range information so that existing 'nvdimm/pmem' driver can reserve this into sy

[Qemu-devel] [PATCH v9 4/7] dm: enable synchronous dax

2019-05-14 Thread Pankaj Gupta
This patch sets dax device 'DAXDEV_SYNC' flag if all the target devices of device mapper support synchrononous DAX. If device mapper consists of both synchronous and asynchronous dax devices, we don't set 'DAXDEV_SYNC' flag. Signed-off-by: Pankaj Gupta --- drivers/md/dm-table.c | 14 +++

[Qemu-devel] [PATCH v9 5/7] dax: check synchronous mapping is supported

2019-05-14 Thread Pankaj Gupta
This patch introduces 'daxdev_mapping_supported' helper which checks if 'MAP_SYNC' is supported with filesystem mapping. It also checks if corresponding dax_device is synchronous. Virtio pmem device is asynchronous and does not not support VM_SYNC. Suggested-by: Jan Kara Signed-off-by: Pankaj Gup

[Qemu-devel] [PATCH v9 3/7] libnvdimm: add dax_dev sync flag

2019-05-14 Thread Pankaj Gupta
This patch adds 'DAXDEV_SYNC' flag which is set for nd_region doing synchronous flush. This later is used to disable MAP_SYNC functionality for ext4 & xfs filesystem for devices don't support synchronous flush. Signed-off-by: Pankaj Gupta --- drivers/dax/bus.c| 2 +- drivers/dax/sup

[Qemu-devel] [PATCH v9 6/7] ext4: disable map_sync for async flush

2019-05-14 Thread Pankaj Gupta
Dont support 'MAP_SYNC' with non-DAX files and DAX files with asynchronous dax_device. Virtio pmem provides asynchronous host page cache flush mechanism. We don't support 'MAP_SYNC' with virtio pmem and ext4. Signed-off-by: Pankaj Gupta Reviewed-by: Jan Kara --- fs/ext4/file.c | 10 ++

Re: [Qemu-devel] [Qemu-trivial] [PATCH RESEND] monitor: Fix return type of monitor_fdset_dup_fd_find

2019-05-14 Thread Yury Kotov
14.05.2019, 17:01, "Markus Armbruster" : > Yury Kotov writes: > >>  monitor_fdset_dup_fd_find_remove() and monitor_fdset_dup_fd_find() >>  returns mon_fdset->id which is int64_t. Downcast from int64_t to int leads >> to > > Grammar nits: > > s/returns/return/ > s/Downcast/Downcasting/ >

[Qemu-devel] [PATCH v9 7/7] xfs: disable map_sync for async flush

2019-05-14 Thread Pankaj Gupta
Dont support 'MAP_SYNC' with non-DAX files and DAX files with asynchronous dax_device. Virtio pmem provides asynchronous host page cache flush mechanism. We don't support 'MAP_SYNC' with virtio pmem and xfs. Signed-off-by: Pankaj Gupta Reviewed-by: Darrick J. Wong --- fs/xfs/xfs_file.c | 9

Re: [Qemu-devel] [PATCH v2 1/2] vfio/mdev: add version attribute for mdev device

2019-05-14 Thread Alex Williamson
On Tue, 14 May 2019 09:43:44 +0200 Erik Skultety wrote: > On Tue, May 14, 2019 at 03:32:19AM -0400, Yan Zhao wrote: > > On Tue, May 14, 2019 at 03:20:40PM +0800, Erik Skultety wrote: > > > On Tue, May 14, 2019 at 02:12:35AM -0400, Yan Zhao wrote: > > > > On Mon, May 13, 2019 at 09:28:04PM +08

[Qemu-devel] Unaligned images with O_DIRECT

2019-05-14 Thread Max Reitz
Hi, Unaligned images don’t work so well with O_DIRECT: $ echo > foo $ qemu-img map --image-opts driver=file,filename=foo,cache.direct=on Offset Length Mapped to File qemu-img: block/io.c:2093: bdrv_co_block_status: Assertion `*pnum && QEMU_IS_ALIGNED(*pnum, align) && align

Re: [Qemu-devel] [PATCH v9 2/7] virtio-pmem: Add virtio pmem driver

2019-05-14 Thread Randy Dunlap
On 5/14/19 7:54 AM, Pankaj Gupta wrote: > diff --git a/drivers/virtio/Kconfig b/drivers/virtio/Kconfig > index 35897649c24f..94bad084ebab 100644 > --- a/drivers/virtio/Kconfig > +++ b/drivers/virtio/Kconfig > @@ -42,6 +42,17 @@ config VIRTIO_PCI_LEGACY > > If unsure, say Y. > > +config

Re: [Qemu-devel] [PATCH v6 00/25] Add qemu_getrandom and ARMv8.5-RNG etc

2019-05-14 Thread Markus Armbruster
"make check-unit" fails for me: TESTcheck-unit: tests/test-crypto-tlscredsx509 Unexpected error in object_new_with_propv() at /work/armbru/qemu/qom/object.c:674: invalid object type: tls-creds-x509 and TESTcheck-unit: tests/test-io-channel-tls Unexpected error in object_new_with_pro

Re: [Qemu-devel] [PATCH 2/4] migration/savevm: use migration_is_blocked to validate

2019-05-14 Thread Dr. David Alan Gilbert
* Wei Yang (richardw.y...@linux.intel.com) wrote: > On Thu, Apr 25, 2019 at 05:55:15PM -0300, Daniel Henrique Barboza wrote: > > > > > >On 4/23/19 9:46 PM, Wei Yang wrote: > >> migration_is_blocked() is used in migrate_prepare() and > >> save_snapshot(), this is more proper to use this instead of >

[Qemu-devel] [PATCH v2] monitor: Fix fdset_id & fd types for corresponding QMP commands

2019-05-14 Thread Yury Kotov
Now, fdset_id is int64, but in some places we work with it as int. It seems that there is no sense to use int64 for fdset_id, so it's better to fix inconsistency by changing fdset_id type to int and by fixing the reference of corresponding QMP commands: add-fd, remove-fd, query-fdsets. Signed-off-

[Qemu-devel] [PATCH 3.5/4] virtio-rng: Keep the default backend out of VirtIORNGConf

2019-05-14 Thread Markus Armbruster
The default backend is only used within virtio_rng_device_realize(). Replace VirtIORNGConf member default_backend by a local variable. Adjust its type to reduce conversions. While there, pass &error_abort instead of NULL when failure would be a programming error. Signed-off-by: Markus Armbruster

Re: [Qemu-devel] [PATCH v6 00/25] Add qemu_getrandom and ARMv8.5-RNG etc

2019-05-14 Thread Daniel P . Berrangé
On Tue, May 14, 2019 at 05:15:31PM +0200, Markus Armbruster wrote: > "make check-unit" fails for me: > > TESTcheck-unit: tests/test-crypto-tlscredsx509 > Unexpected error in object_new_with_propv() at > /work/armbru/qemu/qom/object.c:674: > invalid object type: tls-creds-x509 > > and > >

Re: [Qemu-devel] [PATCH v4 3/3] virtio-rng: change default backend to rng-builtin

2019-05-14 Thread Markus Armbruster
Laurent Vivier writes: > Signed-off-by: Laurent Vivier > --- > backends/rng-builtin.c | 8 +++- > hw/virtio/virtio-rng.c | 2 +- > include/hw/virtio/virtio-rng.h | 4 ++-- > include/sysemu/rng-builtin.h | 17 + > qemu-options.hx| 5 ++---

Re: [Qemu-devel] [PATCH v9 2/7] virtio-pmem: Add virtio pmem driver

2019-05-14 Thread Pankaj Gupta
> On 5/14/19 7:54 AM, Pankaj Gupta wrote: > > diff --git a/drivers/virtio/Kconfig b/drivers/virtio/Kconfig > > index 35897649c24f..94bad084ebab 100644 > > --- a/drivers/virtio/Kconfig > > +++ b/drivers/virtio/Kconfig > > @@ -42,6 +42,17 @@ config VIRTIO_PCI_LEGACY > > > > If unsure, say Y

Re: [Qemu-devel] [PULL v2 12/27] target/mips: Convert to CPUClass::tlb_fill

2019-05-14 Thread Peter Maydell
On Sat, 11 May 2019 at 14:43, Aleksandar Markovic wrote: > This commit message is generally poor, as it explains relatively unimportant > logging issue, while not explaining the core of the change. I think the assumption with this sort of "refactor to change all instances of an API" change is th

Re: [Qemu-devel] [PATCH v4 3/3] virtio-rng: change default backend to rng-builtin

2019-05-14 Thread Laurent Vivier
On 14/05/2019 17:24, Markus Armbruster wrote: Laurent Vivier writes: Signed-off-by: Laurent Vivier --- backends/rng-builtin.c | 8 +++- hw/virtio/virtio-rng.c | 2 +- include/hw/virtio/virtio-rng.h | 4 ++-- include/sysemu/rng-builtin.h | 17 + q

Re: [Qemu-devel] How do we do user input bitmap properties?

2019-05-14 Thread Dave Martin
On Tue, May 14, 2019 at 05:54:03AM +0100, Markus Armbruster wrote: > Andrew Jones writes: > > > On Thu, Apr 18, 2019 at 07:48:09PM +0200, Markus Armbruster wrote: > >> Daniel P. Berrangé writes: > >> > >> > On Thu, Apr 18, 2019 at 11:28:41AM +0200, Andrew Jones wrote: > >> >> Hi all, > >> >> >

Re: [Qemu-devel] [libvirt] [PATCH v2 1/2] vfio/mdev: add version attribute for mdev device

2019-05-14 Thread Alex Williamson
On Wed, 8 May 2019 17:27:47 +0200 Boris Fiuczynski wrote: > On 5/8/19 11:22 PM, Alex Williamson wrote: > >>> I thought there was a request to make this more specific to migration > >>> by renaming it to something like migration_version. Also, as an > >>> > >> so this attribute may not only

Re: [Qemu-devel] [PATCH 3/4] migration/savevm: load_header before load_setup

2019-05-14 Thread Dr. David Alan Gilbert
* Wei Yang (richardw.y...@linux.intel.com) wrote: > In migration_thread() and qemu_savevm_state(), we savevm_state in > following sequence: > > qemu_savevm_state_header(f); > qemu_savevm_state_setup(f); > > Then it would be more proper to loadvm_state in the save sequence. > > Signed-off

Re: [Qemu-devel] Unaligned images with O_DIRECT

2019-05-14 Thread Eric Blake
On 5/14/19 10:06 AM, Max Reitz wrote: > Hi, > > Unaligned images don’t work so well with O_DIRECT: > > $ echo > foo > $ qemu-img map --image-opts driver=file,filename=foo,cache.direct=on > Offset Length Mapped to File > qemu-img: block/io.c:2093: bdrv_co_block_status: Asse

Re: [Qemu-devel] [PULL v2 12/27] target/mips: Convert to CPUClass::tlb_fill

2019-05-14 Thread Alex Bennée
Aleksandar Markovic writes: > On May 10, 2019 8:57 PM, "Richard Henderson" > wrote: >> > > Please change the title to 'target/mips: Switch to using > mips_cpu_tlb_fill()', or something along that line. It does seem a little redundant as "target/mips:" already marks it as a mips specific chang

[Qemu-devel] [RFC PATCH 03/11] semihosting: implement a semihosting console

2019-05-14 Thread Alex Bennée
This provides two functions for handling console output that handle the common backend behaviour for semihosting. Signed-off-by: Alex Bennée --- gdbstub.c| 5 +++ hw/semihosting/Makefile.objs | 1 + hw/semihosting/console.c | 70 +

[Qemu-devel] [RFC PATCH 07/11] target/arm: add LOG_UNIMP messages to arm-semi

2019-05-14 Thread Alex Bennée
Clean-up our unimplemented bits with a proper message. Signed-off-by: Alex Bennée --- target/arm/arm-semi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/arm/arm-semi.c b/target/arm/arm-semi.c index 253c66b172a..a3bbef18ef7 100644 --- a/target/arm/arm-semi.c +++

[Qemu-devel] [RFC PATCH 02/11] semihosting: introduce CONFIG_SEMIHOSTING

2019-05-14 Thread Alex Bennée
There isn't much point building semihosting for platforms that don't support it. Introduce a new symbol and enable it only for the softmmu targets that need it. Signed-off-by: Alex Bennée --- default-configs/arm-softmmu.mak | 1 + default-configs/lm32-softmmu.mak| 2 + default-

[Qemu-devel] [RFC PATCH 05/11] target/arm: fixup some of the commentary for arm-semi

2019-05-14 Thread Alex Bennée
This cleans up a number of the block comments to fit the proper style. While we are at it we also reference the official specification and document what the return register value can be. Signed-off-by: Alex Bennée --- target/arm/arm-semi.c | 40 +++- 1 file ch

[Qemu-devel] [RFC PATCH 04/11] semihosting: enable chardev backed output for console

2019-05-14 Thread Alex Bennée
It will be useful for a number of use-cases to be able to re-direct output to a file like we do with serial output. This does the wiring to allow us to treat then semihosting console like just another character output device. Signed-off-by: Alex Bennée --- hw/semihosting/config.c | 26

[Qemu-devel] [RFC PATCH 06/11] target/arm: use the common interface for WRITE0/WRITEC in arm-semi

2019-05-14 Thread Alex Bennée
Now we have a common semihosting console interface use that for our string output. However ARM is currently unique in also supporting semihosting for linux-user so we need to replicate the API in linux-user. If other architectures gain this support we can move the file later. Signed-off-by: Alex B

[Qemu-devel] [RFC PATCH 01/11] semihosting: move semihosting configuration into its own directory

2019-05-14 Thread Alex Bennée
In preparation for having some more common semihosting code let's excise the current config magic from vl.c into its own file. We shall later add more conditionals to the build configurations so we can avoid building this if we don't need it. Signed-off-by: Alex Bennée --- gdbstub.c

[Qemu-devel] [RFC PATCH 00/11] semihosting cleanup and re-factor

2019-05-14 Thread Alex Bennée
Hi, This collects together some fixes from last weeks RFC clean-up patch as well as a generalised version of the chardev console tweak I made last week for testing/next. As it happens it only really made sense for ARM and MIPs logging semihost calls but there is certainly scope for handling all

[Qemu-devel] [RFC PATCH 10/11] target/mips: convert UHI_plog to use common semihosting code

2019-05-14 Thread Alex Bennée
Rather than printing directly to stdout lets use our common semihosting code. There is one minor difference in that the output currently defaults to stderr instead of stdout however this can be controlled by connecting semihosting to a chardev. Signed-off-by: Alex Bennée --- target/mips/mips-sem

[Qemu-devel] [RFC PATCH 08/11] target/arm: correct return values for WRITE/READ in arm-semi

2019-05-14 Thread Alex Bennée
The documentation says the write should return the number of bytes not written on an error (0 means everything was written). Read provides a buffer length and the return value should be the buffer length - bytes actually read. Remove the incorrect FIXME's and return the correct values. Signed-off-

[Qemu-devel] [RFC PATCH 09/11] target/mips: only build mips-semi for softmmu

2019-05-14 Thread Alex Bennée
The is_uhi gates all semihosting calls and always returns false for CONFIG_USER_ONLY builds. There is no reason to build and link mips-semi for these builds so lets fix that. Signed-off-by: Alex Bennée --- target/mips/Makefile.objs | 3 ++- target/mips/helper.h | 2 ++ target/mips/translate

Re: [Qemu-devel] [PATCH] migration: Fix use-after-free during process exit

2019-05-14 Thread Dr. David Alan Gilbert
* Yury Kotov (yury-ko...@yandex-team.ru) wrote: > It fixes heap-use-after-free which was found by clang's ASAN. Reviewed-by: Dr. David Alan Gilbert and queued. (cc'ing in Stefan since aio crashes often get to him). > Control flow of this use-after-free: > main_thread: > * Got SIGTERM and c

[Qemu-devel] [RFC PATCH 11/11] MAINTAINERS: update for semihostings new home

2019-05-14 Thread Alex Bennée
Seeing as I touched it I should at least keep an eye on it. Signed-off-by: Alex Bennée --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index a73a61a5465..e9050beb222 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2559,6 +2559,13 @@ F: docs/pvr

Re: [Qemu-devel] [PATCH 1/6] qemu-bridge-helper: Fix misuse of isspace()

2019-05-14 Thread Philippe Mathieu-Daudé
On 5/14/19 2:18 PM, Markus Armbruster wrote: > Peter Maydell writes: > >> On Mon, 13 May 2019 at 14:21, Markus Armbruster wrote: >>> Perhaps I should do it just for this file while I touch it anyway. The >>> question to ask: should parse_acl_file() obey the locale for whitespace >>> recognition

Re: [Qemu-devel] [PATCH 1/4] migration/savevm: remove duplicate check of migration_is_blocked

2019-05-14 Thread Dr. David Alan Gilbert
* Wei Yang (richardw.y...@linux.intel.com) wrote: > Current call flow of save_snapshot is: > > save_snapshot > migration_is_blocked > qemu_savevm_state > migration_is_blocked > > Since qemu_savevm_state is only called in save_snapshot, this means > migration_is_blocked has bee

Re: [Qemu-devel] [PULL v2 12/27] target/mips: Convert to CPUClass::tlb_fill

2019-05-14 Thread Aleksandar Markovic
On May 14, 2019 5:26 PM, "Peter Maydell" wrote: > > On Sat, 11 May 2019 at 14:43, Aleksandar Markovic > wrote: > > This commit message is generally poor, as it explains relatively unimportant logging issue, while not explaining the core of the change. > > I think the assumption with this sort of

Re: [Qemu-devel] [PULL v2 12/27] target/mips: Convert to CPUClass::tlb_fill

2019-05-14 Thread Philippe Mathieu-Daudé
On 5/14/19 5:48 PM, Alex Bennée wrote: > > Aleksandar Markovic writes: > >> On May 10, 2019 8:57 PM, "Richard Henderson" >> wrote: >>> >> >> Please change the title to 'target/mips: Switch to using >> mips_cpu_tlb_fill()', or something along that line. > > It does seem a little redundant as "t

Re: [Qemu-devel] [PATCH 00/13] target/arm/kvm: enable SVE in guests

2019-05-14 Thread Andrea Bolognani
On Tue, 2019-05-14 at 14:53 +0200, Andrew Jones wrote: > On Tue, May 14, 2019 at 02:29:51PM +0200, Andrea Bolognani wrote: > > Since we expect management applications to use QMP to discover what > > vector lengths are supported and then provide an explicit map, I > > think it's fair to say that the

Re: [Qemu-devel] [PATCH] migration/ram.c: fix typos in comments

2019-05-14 Thread Dr. David Alan Gilbert
* Wei Yang (richardw.y...@linux.intel.com) wrote: > Signed-off-by: Wei Yang > --- > migration/ram.c | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) Reviewed-by: Dr. David Alan Gilbert and queued. > diff --git a/migration/ram.c b/migration/ram.c > index 1def8122e9..720c2b73

Re: [Qemu-devel] [PATCH v6 00/25] Add qemu_getrandom and ARMv8.5-RNG etc

2019-05-14 Thread Richard Henderson
On 5/14/19 8:23 AM, Daniel P. Berrangé wrote: > On Tue, May 14, 2019 at 05:15:31PM +0200, Markus Armbruster wrote: >> "make check-unit" fails for me: >> >> TESTcheck-unit: tests/test-crypto-tlscredsx509 >> Unexpected error in object_new_with_propv() at >> /work/armbru/qemu/qom/object.c:674:

Re: [Qemu-devel] [RFC PATCH 07/11] target/arm: add LOG_UNIMP messages to arm-semi

2019-05-14 Thread Philippe Mathieu-Daudé
On 5/14/19 5:52 PM, Alex Bennée wrote: > Clean-up our unimplemented bits with a proper message. > > Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé > --- > target/arm/arm-semi.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/target/arm/arm-semi.c

Re: [Qemu-devel] [PATCH v1 1/1] target/arm: Fix vector operation segfault

2019-05-14 Thread Alistair Francis
On Mon, May 13, 2019 at 5:19 PM Richard Henderson wrote: > > On 5/13/19 5:08 PM, Alistair Francis wrote: > > We hit the second switch case as > > NEON_3R_VQADD and NEON_3R_VQSUB don't return from the function in the > > first switch case. > > That's the bug, not here in this second switch. Ah ok,

<    1   2   3   4   >