[Qemu-devel] [PATCH v2 2/6] tests/vhost-user-bridge: Fix misuse of isdigit()

2019-05-14 Thread Markus Armbruster
vubr_set_host() passes char values to isdigit(). Undefined behavior when the value is negative. Fix by using qemu_isdigit() instead. Signed-off-by: Markus Armbruster --- tests/vhost-user-bridge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/vhost-user-bridge.c

Re: [Qemu-devel] [PATCH v5 0/4] rng-builtin: add an RNG backend that uses qemu_guest_getrandom()

2019-05-14 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190514162744.30398-1-lviv...@redhat.com/ Hi, This series failed the asan build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST SCRIPT BEGIN === #!/bin/bash time

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

2019-05-14 Thread Kevin Wolf
Am 14.05.2019 um 15:57 hat Alberto Garcia geschrieben: > 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 Thanks, applied

Re: [Qemu-devel] [PATCH v2 2/6] luks: Create block_crypto_co_create_generic()

2019-05-14 Thread Kevin Wolf
Am 14.05.2019 um 13:13 hat Daniel P. Berrangé geschrieben: > On Mon, Mar 12, 2018 at 04:02:14PM +0100, Kevin Wolf wrote: > > Everything that refers to the protocol layer or QemuOpts is moved out of > > block_crypto_create_generic(), so that the remaining function is > > suitable to be called by a

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 9:50 AM, Daniel P. Berrangé wrote: > On Tue, May 14, 2019 at 09:14:57AM -0700, Richard Henderson wrote: >> Yes, that would do it. We would need something in the test that forces the >> objects into the link. Without having yet looked at the test cases, any >> ideas? > > I don't

Re: [Qemu-devel] Unaligned images with O_DIRECT

2019-05-14 Thread Max Reitz
On 14.05.19 18:15, Max Reitz wrote: > On 14.05.19 17:45, Eric Blake wrote: >> 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

Re: [Qemu-devel] [PATCH] linux-user: Pass through nanosecond timestamp components for stat syscalls

2019-05-14 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190514145346.20758-1-w...@kernel.org/ Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20190514145346.20758-1-w...@kernel.org Subject: [Qemu-devel] [PATCH] linux-user: Pass through

[Qemu-devel] [RFC] hw/core/bus.c: Only the main system bus can have no parent

2019-05-14 Thread Peter Maydell
In commit 80376c3fc2c38fdd453 in 2010 we added a workaround for some qbus buses not being connected to qdev devices -- if the bus has no parent object then we register a reset function which resets the bus on system reset. Nearly a decade later, we have now no buses in the tree which are created

Re: [Qemu-devel] [PATCH] monitor: Call mon_get_cpu() only once at hmp_gva2gpa()

2019-05-14 Thread Dr. David Alan Gilbert
* Eduardo Habkost (ehabk...@redhat.com) wrote: > hmp_gva2gpa() calls mon_get_cpu() twice, which is unnecessary. > Not an actual bug, but this is reported as a defect by Coverity > Scan (CID 1401346). > > Signed-off-by: Eduardo Habkost I'm going to sneak this onto the end of a migration pull I'm

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

2019-05-14 Thread Laurent Vivier
On 14/05/2019 18:27, Laurent Vivier wrote: From: 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 _abort instead of NULL when

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

2019-05-14 Thread Philippe Mathieu-Daudé
On 5/14/19 5:52 PM, Alex Bennée wrote: > 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

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

2019-05-14 Thread Philippe Mathieu-Daudé
On 5/14/19 5:52 PM, Alex Bennée wrote: > 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 Reviewed-by: Philippe

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

2019-05-14 Thread Markus Armbruster
Eric Blake writes: > 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

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

2019-05-14 Thread Philippe Mathieu-Daudé
On 5/14/19 5:53 PM, Alex Bennée wrote: > Seeing as I touched it I should at least keep an eye on it. Thanks for that. > > Signed-off-by: Alex Bennée FWIW: Reviewed-by: Philippe Mathieu-Daudé > --- > MAINTAINERS | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git a/MAINTAINERS

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

2019-05-14 Thread Philippe Mathieu-Daudé
On 5/14/19 5:52 PM, Alex Bennée wrote: > 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 Reviewed-by: Philippe Mathieu-Daudé > ---

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

2019-05-14 Thread Markus Armbruster
Laurent Vivier writes: > Signed-off-by: Laurent Vivier Reviewed-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 09:14:57AM -0700, Richard Henderson wrote: > 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 > >>

[Qemu-devel] [PATCH] linux-user: Pass through nanosecond timestamp components for stat syscalls

2019-05-14 Thread Chen-Yu Tsai
From: Chen-Yu Tsai Since Linux 2.6 the stat syscalls have mostly supported nanosecond components for each of the file-related timestamps. QEMU user mode emulation currently does not pass through the nanosecond portion of the timestamp, even when the host system fills in the value. This results

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

2019-05-14 Thread Alex Bennée
Philippe Mathieu-Daudé writes: > 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

[Qemu-devel] [PATCH v5 1/4] VirtIO-RNG: Update default entropy source to `/dev/urandom`

2019-05-14 Thread Laurent Vivier
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 Linux is "blocking" (as in, it waits

[Qemu-devel] [PATCH v5 0/4] rng-builtin: add an RNG backend that uses qemu_guest_getrandom()

2019-05-14 Thread Laurent Vivier
Add a new RNG backend using QEMU builtin getrandom function. This patch applies on top of "[PATCH v6 00/24] Add qemu_getrandom and ARMv8.5-RNG etc" Based-on: 20190510173049.28171-1-richard.hender...@linaro.org v5: PATCH 1 s/linux/Linux/ remove superfluous includes from rng-builtin.c

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

2019-05-14 Thread Laurent Vivier
From: 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 _abort instead of NULL when failure would be a programming error.

[Qemu-devel] [PATCH v5 4/4] virtio-rng: change default backend to rng-builtin

2019-05-14 Thread Laurent Vivier
Signed-off-by: Laurent Vivier --- backends/rng-builtin.c | 1 - hw/virtio/virtio-rng.c | 2 +- include/sysemu/rng.h | 2 ++ qemu-options.hx| 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/backends/rng-builtin.c b/backends/rng-builtin.c index

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

2019-05-14 Thread Laurent Vivier
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 Reviewed-by: Markus Armbruster Signed-off-by: Laurent Vivier ---

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

2019-05-14 Thread Philippe Mathieu-Daudé
On 5/14/19 5:52 PM, Alex Bennée wrote: > 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 Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe

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

2019-05-14 Thread Philippe Mathieu-Daudé
On 5/14/19 5:52 PM, Alex Bennée wrote: > 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. > >

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

2019-05-14 Thread Peter Maydell
On Tue, 14 May 2019 at 17:05, Aleksandar Markovic wrote: > I am not complaining about myself looking at another commit message, but have > future maintainers and future developers in mind. Their effort needed for > deciphering commit messages like this one is multiple times larger than >

Re: [Qemu-devel] Unaligned images with O_DIRECT

2019-05-14 Thread Max Reitz
On 14.05.19 17:45, Eric Blake wrote: > 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 >>

Re: [Qemu-devel] [PATCH 0/2] fix qmp-cont vs migration-finish race-crash

2019-05-14 Thread Dr. David Alan Gilbert
* Thomas Huth (th...@redhat.com) wrote: > On 24/01/2019 13.25, Vladimir Sementsov-Ogievskiy wrote: > > Hi. > > > > It's a simple fix for problems reported in "Aborts in iotest 169" > > by Max: > > https://lists.gnu.org/archive/html/qemu-devel/2019-01/msg05907.html > > > > In thread Kevin

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

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

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] [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

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

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

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] [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

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 >>>

[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:

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

[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 ++

[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.

[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 ---

[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 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 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

[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

[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 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 +

[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 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

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

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:

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. > >

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] 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] [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 +

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

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

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 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 > >

[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 _abort instead of NULL when failure would be a programming error. Signed-off-by: Markus Armbruster ---

[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.

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

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

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

[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) &&

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

[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] [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 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 ++

[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 +-

[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

[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 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

[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

[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

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

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 > --- >

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,

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

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

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 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 ++-- >>>

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] 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

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

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] 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 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

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

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

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.

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,

[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

[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

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 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

[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

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

<    1   2   3   4   >