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 describe

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

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

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

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 Ma

[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 --- backends/Makefile.o

[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 6b9543a7de87..868055cbc

[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 &error_abort instead of NULL when failure would be a programming error. Signed-

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

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 line

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

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

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

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] [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] [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 b/M

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 thes

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

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 FIXM

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 &error_abort instead of NULL when f

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

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

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

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 Le

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 think

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

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

2019-05-14 Thread Markus Armbruster
parse_acl_file() passes char values to isspace(). Undefined behavior when the value is negative. Not a security issue, because the characters come from trusted $prefix/etc/qemu/bridge.conf and the files it includes. Furthermore, isspace()'s locale-dependence means qemu-bridge-helper uses the use

[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 b/te

[Qemu-devel] [PATCH v2 0/6] Fix misuse of ctype.h functions

2019-05-14 Thread Markus Armbruster
v2: * PATCH 1: Use g_ascii_isspace(), adapt commit message [Philippe] * PATCH 3: Add comment pointing to the GDB manual [Philippe] * PATCH 5: Improve commit message [Thomas] Markus Armbruster (6): qemu-bridge-helper: Fix misuse of isspace() tests/vhost-user-bridge: Fix misuse of isdigit() gd

Re: [Qemu-devel] [PATCH v2 5/6] pc-bios/s390-ccw: Clean up harmless misuse of isdigit()

2019-05-14 Thread Christian Borntraeger
On 14.05.19 20:03, Markus Armbruster wrote: > atoui() and get_index() pass char values to isdigit(). With a > standard isdigit(), we'd get undefined behavior when the value is > negative. Can't happen as char is unsigned on s390x. Even if it > could, we're actually using isdigit() from pc-bio

[Qemu-devel] [PATCH v2 3/6] gdbstub: Reject invalid RLE repeat counts

2019-05-14 Thread Markus Armbruster
"Debugging with GDB / Appendix E GDB Remote Serial Protocol / Overview" specifies "The printable characters '#' and '$' or with a numeric value greater than 126 must not be used." gdb_read_byte() only rejects values < 32. This is wrong. Impact depends on the caller: * gdb_handlesig() passes a c

[Qemu-devel] [PATCH v2 4/6] gdbstub: Fix misuse of isxdigit()

2019-05-14 Thread Markus Armbruster
gdb_read_byte() passes its @ch argument to isxdigit(). Undefined behavior when the value is negative. Two callers: * gdb_chr_receive() passes an uint8_t value. Safe. * gdb_handlesig() a char value. Unsafe. Not a security issue, because the characters come from the gdb client, which is trus

Re: [Qemu-devel] [PATCH v2 6/6] cutils: Simplify how parse_uint() checks for whitespace

2019-05-14 Thread Philippe Mathieu-Daudé
On 5/14/19 8:03 PM, Markus Armbruster wrote: > Use qemu_isspace() so we don't have to cast to unsigned char. > > Signed-off-by: Markus Armbruster > --- > util/cutils.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/util/cutils.c b/util/cutils.c > index d682c90901..9aac

[Qemu-devel] [PATCH v2 5/6] pc-bios/s390-ccw: Clean up harmless misuse of isdigit()

2019-05-14 Thread Markus Armbruster
atoui() and get_index() pass char values to isdigit(). With a standard isdigit(), we'd get undefined behavior when the value is negative. Can't happen as char is unsigned on s390x. Even if it could, we're actually using isdigit() from pc-bios/s390-ccw/libc.h here, which works fine for negative v

[Qemu-devel] [PATCH v2 6/6] cutils: Simplify how parse_uint() checks for whitespace

2019-05-14 Thread Markus Armbruster
Use qemu_isspace() so we don't have to cast to unsigned char. Signed-off-by: Markus Armbruster --- util/cutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/cutils.c b/util/cutils.c index d682c90901..9aacc422ca 100644 --- a/util/cutils.c +++ b/util/cutils.c @@ -683,7

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

2019-05-14 Thread Philippe Mathieu-Daudé
On 5/14/19 8:03 PM, Markus Armbruster wrote: > vubr_set_host() passes char values to isdigit(). Undefined behavior "happens"? > 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

Re: [Qemu-devel] [PATCH v9 01/27] gdbstub: Add infrastructure to parse cmd packets

2019-05-14 Thread Alex Bennée
Jon Doron writes: > Signed-off-by: Jon Doron > --- > + > +/* > + * cmd_startswith -> cmd is compared using startswith > + * > + * > + * schema definitions: > + * Each schema parameter entry consists of 2 chars, > + * the first char represents the parameter type handling > + * the second char

[Qemu-devel] [PULL 01/16] migration: comment VMSTATE_UNUSED*() properly

2019-05-14 Thread Dr. David Alan Gilbert (git)
From: Peter Xu It is error prone to use VMSTATE_UNUSED*() sometimes especially when the size of the migration stream of the field is not the same as the size of the structure (boolean is one example). Comment it well so people will be aware of this when people want to use it. Signed-off-by: Pet

[Qemu-devel] [PULL 00/16] migration queue

2019-05-14 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The following changes since commit e329ad2ab72c43b56df88b34954c2c7d839bb373: Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20190513' into staging (2019-05-14 10:08:47 +0100) are available in the Git repository at: git://github.com/dagrh/qemu.git ta

[Qemu-devel] [PULL 02/16] migration: not necessary to check ops again

2019-05-14 Thread Dr. David Alan Gilbert (git)
From: Wei Yang 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 Message-Id: <20190327013130.26259-1-richardw.y...@linux.intel.com> Reviewed-by: Dr. David Alan Gilbert Signed-o

[Qemu-devel] [PULL 03/16] migration: remove not used field xfer_limit

2019-05-14 Thread Dr. David Alan Gilbert (git)
From: Wei Yang MigrationState->xfer_limit is only set to 0 in migrate_init(). Remove this unnecessary field. Signed-off-by: Wei Yang Message-Id: <20190326055726.10539-1-richardw.y...@linux.intel.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- migration/mig

[Qemu-devel] [PULL 04/16] vmstate: check subsection_found is enough

2019-05-14 Thread Dr. David Alan Gilbert (git)
From: Wei Yang 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 Message-Id: <20190403011016.12549-1-richardw.y...@linux.intel.com> A

[Qemu-devel] [PULL 07/16] migration/colo.h: Remove obsolete codes

2019-05-14 Thread Dr. David Alan Gilbert (git)
From: Zhang Chen Signed-off-by: Zhang Chen Message-Id: <20190426090730.2691-3-chen.zh...@intel.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- include/migration/colo.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/migration/colo.h b/include/mi

[Qemu-devel] [PULL 08/16] qemu-option.hx: Update missed parameter for colo-compare

2019-05-14 Thread Dr. David Alan Gilbert (git)
From: Zhang Chen We missed the iothread related args in this file. This patch is used to fix this issue. Signed-off-by: Zhang Chen Message-Id: <20190426090730.2691-4-chen.zh...@intel.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- qemu-options.hx | 9 ++

[Qemu-devel] [PULL 12/16] migration/savevm: load_header before load_setup

2019-05-14 Thread Dr. David Alan Gilbert (git)
From: Wei Yang 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-by: Wei Yang Message-Id: <20190424004700.12766-4-

[Qemu-devel] [PULL 09/16] migration/ram.c: start of migration_bitmap_sync_range is always 0

2019-05-14 Thread Dr. David Alan Gilbert (git)
From: Wei Yang We can eliminate to pass 0. Signed-off-by: Wei Yang Message-Id: <20190430034412.12935-2-richardw.y...@linux.intel.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- migration/ram.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) d

[Qemu-devel] [PULL 05/16] migration: savevm: fix error code with migration blockers

2019-05-14 Thread Dr. David Alan Gilbert (git)
From: Cole Robinson 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 Message-Id: Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela Si

[Qemu-devel] [PULL 10/16] migration: update comments of migration bitmap

2019-05-14 Thread Dr. David Alan Gilbert (git)
From: Yi Wang 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 Message-Id: <1555311089-18610-1-git-send-email-wang.y...@zte.com.cn> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. Da

[Qemu-devel] [PULL 15/16] migration/ram.c: fix typos in comments

2019-05-14 Thread Dr. David Alan Gilbert (git)
From: Wei Yang Signed-off-by: Wei Yang Message-Id: <20190510233729.15554-1-richardw.y...@linux.intel.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- migration/ram.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/migration/ram.

[Qemu-devel] [PULL 06/16] migration/colo.c: Remove redundant input parameter

2019-05-14 Thread Dr. David Alan Gilbert (git)
From: Zhang Chen The colo_do_failover no need the input parameter. Signed-off-by: Zhang Chen Message-Id: <20190426090730.2691-2-chen.zh...@intel.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- include/migration/colo.h | 2 +- migration/colo-failover.c | 2

[Qemu-devel] [PULL 13/16] migration/savevm: wrap into qemu_loadvm_state_header()

2019-05-14 Thread Dr. David Alan Gilbert (git)
From: Wei Yang On source side, we have qemu_savevm_state_header() to send related data, while on the receiving side those steps are scattered in qemu_loadvm_state(). This patch wrap those related steps into qemu_loadvm_state_header() to make it friendly to read. Signed-off-by: Wei Yang Message

Re: [Qemu-devel] [PATCH v2 5/6] pc-bios/s390-ccw: Clean up harmless misuse of isdigit()

2019-05-14 Thread Thomas Huth
On 14/05/2019 20.04, Christian Borntraeger wrote: > > > On 14.05.19 20:03, Markus Armbruster wrote: >> atoui() and get_index() pass char values to isdigit(). With a >> standard isdigit(), we'd get undefined behavior when the value is >> negative. Can't happen as char is unsigned on s390x. Even

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

2019-05-14 Thread Thomas Huth
On 14/05/2019 20.03, Markus Armbruster wrote: > 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 insertio

[Qemu-devel] [PULL 11/16] migration/savevm: remove duplicate check of migration_is_blocked

2019-05-14 Thread Dr. David Alan Gilbert (git)
From: Wei Yang 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 been already checked. Signed-off-by: Wei Yang Messag

[Qemu-devel] [PULL 16/16] monitor: Call mon_get_cpu() only once at hmp_gva2gpa()

2019-05-14 Thread Dr. David Alan Gilbert (git)
From: Eduardo Habkost 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 Message-Id: <20190510185620.15757-1-ehabk...@redhat.com> Reviewed-by: Richard Henderson Review

[Qemu-devel] [PULL 14/16] migration: Fix use-after-free during process exit

2019-05-14 Thread Dr. David Alan Gilbert (git)
From: Yury Kotov It fixes heap-use-after-free which was found by clang's ASAN. Control flow of this use-after-free: main_thread: * Got SIGTERM and completes main loop * Calls migration_shutdown - migrate_fd_cancel (so, migration_thread begins to complete) - object_unref(OBJEC

[Qemu-devel] [PATCH for-4.1] q35: Revert to kernel irqchip

2019-05-14 Thread Alex Williamson
Commit b2fc91db8447 ("q35: set split kernel irqchip as default") changed the default for the pc-q35-4.0 machine type to use split irqchip, which turned out to have disasterous effects on vfio-pci INTx support. KVM resampling irqfds are registered for handling these interrupts, but these are non-fu

Re: [Qemu-devel] [Qemu-ppc] [PATCH] spapr: Allow machine to dump dtb after SLOF update

2019-05-14 Thread Daniel Henrique Barboza
On 5/6/19 5:09 AM, Greg Kurz wrote: Now that SLOF can update QEMU's device tree at runtime, it makes sense to be able to dump the resulting dtb, pretty much like it is already possible to dump the initial dtb with the dumpdtb machine option. Add a new dumpdtb-slof property to the pseries mach

Re: [Qemu-devel] [PATCH v9 02/27] gdbstub: Implement deatch (D pkt) with new infra

2019-05-14 Thread Alex Bennée
Jon Doron writes: > Signed-off-by: Jon Doron > --- > gdbstub.c | 90 ++- > 1 file changed, 50 insertions(+), 40 deletions(-) > > diff --git a/gdbstub.c b/gdbstub.c > index d5e0f3878a..621d689868 100644 > --- a/gdbstub.c > +++ b/gdbstub.c > @

[Qemu-devel] [PATCH for-4.0.1] q35: Revert to kernel irqchip

2019-05-14 Thread Alex Williamson
Commit b2fc91db8447 ("q35: set split kernel irqchip as default") changed the default for the pc-q35-4.0 machine type to use split irqchip, which turned out to have disasterous effects on vfio-pci INTx support. KVM resampling irqfds are registered for handling these interrupts, but these are non-fu

Re: [Qemu-devel] [PATCH] configure: Disable slirp if --disable-system

2019-05-14 Thread Aleksandar Markovic
On May 13, 2019 11:14 PM, "Richard Henderson" wrote: > > On 5/11/19 5:47 AM, Aleksandar Markovic wrote: > > > > On May 10, 2019 10:36 PM, "Richard Henderson" < richard.hender...@linaro.org > > > wrote: > >> > >> For linux-user, there is no need to add slirp to

[Qemu-devel] [PATCH v7 00/24] Add qemu_getrandom and ARMv8.5-RNG etc

2019-05-14 Thread Richard Henderson
Changes since v6: * Drop the crypto-obj-y, crypto-aes-obj-y, and configure changes. This fixes the regression visible in make check-unit, due to objects not being pulled in from libqemuutil.a. * Add a crypto-rng-obj-y, and force it to be random-platform.o. This avoids attempting to

[Qemu-devel] [PATCH v7 03/24] crypto: Do not fail for EINTR during qcrypto_random_bytes

2019-05-14 Thread Richard Henderson
We can always get EINTR for read; /dev/urandom is no exception. Rearrange the order of tests for likelihood; allow degenerate buflen==0 case to perform a no-op zero-length read. This means that the normal success path is a straight line with a single test for success. Reviewed-by: Laurent Vivier

[Qemu-devel] [PATCH v7 08/24] ui/vnc: Use gcrypto_random_bytes for start_auth_vnc

2019-05-14 Thread Richard Henderson
Use a better interface for random numbers than rand(). Fail gracefully if for some reason we cannot use the crypto system. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Gerd Hoffmann Reviewed-by: Daniel P. Berrangé Signed-off-by: Richard Henderson --- ui/vnc.c | 22 +++---

[Qemu-devel] [PATCH v7 01/24] build: Link user-only with crypto-rng-obj-y

2019-05-14 Thread Richard Henderson
For user-only, we require only the random number bits of the crypto subsystem. We need to preserve --static linking, which for many recent Linux distributions precludes using GnuTLS or GCrypt. Instead, use our random-platform module unconditionally. Signed-off-by: Richard Henderson --- Makefil

[Qemu-devel] [PATCH v7 05/24] crypto: Use getrandom for qcrypto_random_bytes

2019-05-14 Thread Richard Henderson
Prefer it to direct use of /dev/urandom. Reviewed-by: Laurent Vivier Reviewed-by: Daniel P. Berrangé Signed-off-by: Richard Henderson --- crypto/random-platform.c | 37 - configure| 18 +- 2 files changed, 49 insertions(+), 6

[Qemu-devel] [PATCH v7 11/24] linux-user: Initialize pseudo-random seeds for all guest cpus

2019-05-14 Thread Richard Henderson
When the -seed option is given, call qemu_guest_random_seed_main, putting the subsystem into deterministic mode. Pass derived seeds to each cpu created during clone; which is a no-op unless the subsystem is in deterministic mode. Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé S

[Qemu-devel] [PATCH v7 06/24] crypto: Change the qcrypto_random_bytes buffer type to void*

2019-05-14 Thread Richard Henderson
Using uint8_t* merely requires useless casts for use with other types to be filled with randomness. Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé Signed-off-by: Richard Henderson --- include/crypto/random.h | 2 +- crypto/random-gcrypt.c |

[Qemu-devel] [PATCH v7 02/24] crypto: Reverse code blocks in random-platform.c

2019-05-14 Thread Richard Henderson
Use #ifdef _WIN32 instead of #ifndef _WIN32. This will make other tests easier to sequence. Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé Signed-off-by: Richard Henderson --- crypto/random-platform.c | 35 +-- 1

[Qemu-devel] [PATCH v7 12/24] linux-user: Call qcrypto_random_init if not using -seed

2019-05-14 Thread Richard Henderson
When not using -seed, we will use the random part of the crypto subsystem. For softmmu, we initialize the full qcrypto_init, because we use crypto for reasons other than random numbers. Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-

[Qemu-devel] [PATCH v7 07/24] ui/vnc: Split out authentication_failed

2019-05-14 Thread Richard Henderson
There were 3 copies of this code, one of which used the wrong data size for the failure indicator. Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Gerd Hoffmann Reviewed-by: Daniel P. Berrangé Signed-off-by: Richard Henderson --- ui/vnc.c | 37 +++

[Qemu-devel] [PATCH v7 23/24] target/ppc: Use gen_io_start/end around DARN

2019-05-14 Thread Richard Henderson
Generating a random number counts as I/O, as it cannot be replayed and produce the same results. Acked-by: David Gibson Reviewed-by: Laurent Vivier Suggested-by: Peter Maydell Signed-off-by: Richard Henderson --- target/ppc/translate.c | 21 +++-- 1 file changed, 15 insertions

[Qemu-devel] [PATCH v7 04/24] crypto: Use O_CLOEXEC in qcrypto_random_init

2019-05-14 Thread Richard Henderson
Avoids leaking the /dev/urandom fd into any child processes. Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé Signed-off-by: Richard Henderson --- crypto/random-platform.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cr

[Qemu-devel] [PATCH v7 10/24] cpus: Initialize pseudo-random seeds for all guest cpus

2019-05-14 Thread Richard Henderson
When the -seed option is given, call qemu_guest_random_seed_main, putting the subsystem into deterministic mode. Pass derived seeds to each cpu created; which is a no-op unless the subsystem is in deterministic mode. Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: D

[Qemu-devel] [PATCH v7 09/24] util: Add qemu_guest_getrandom and associated routines

2019-05-14 Thread Richard Henderson
This routine is intended to produce high-quality random numbers to the guest. Normally, such numbers are crypto quality from the host, but a command-line option can force the use of a fully deterministic sequence for use while debugging. Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-

Re: [Qemu-devel] [PATCH for-4.0.1] q35: Revert to kernel irqchip

2019-05-14 Thread Daniel P . Berrangé
On Tue, May 14, 2019 at 01:03:31PM -0600, Alex Williamson wrote: > Commit b2fc91db8447 ("q35: set split kernel irqchip as default") changed > the default for the pc-q35-4.0 machine type to use split irqchip, which > turned out to have disasterous effects on vfio-pci INTx support. KVM > resampling

[Qemu-devel] [PATCH v7 13/24] linux-user: Use qemu_guest_getrandom_nofail for AT_RANDOM

2019-05-14 Thread Richard Henderson
Use a better interface for random numbers than rand * 16. Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/elfload.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfl

[Qemu-devel] [PATCH v7 14/24] linux-user/aarch64: Use qemu_guest_getrandom for PAUTH keys

2019-05-14 Thread Richard Henderson
Use a better interface for random numbers than rand() * 3. Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/aarch64/target_syscall.h | 2 -- linux-user/aarch64/cpu_loop.c | 29 ++- linux-user/syscall.

[Qemu-devel] [PATCH v7 17/24] hw/misc/nrf51_rng: Use qemu_guest_getrandom_nofail

2019-05-14 Thread Richard Henderson
The random number is intended for use by the guest. As such, we should honor the -seed argument for reproducibility. Use the *_nofail routine instead of error_abort directly. Reviewed-by: Laurent Vivier Reviewed-by: Joel Stanley Signed-off-by: Richard Henderson --- hw/misc/nrf51_rng.c | 4 ++

[Qemu-devel] [PATCH v7 15/24] linux-user: Remove srand call

2019-05-14 Thread Richard Henderson
We no longer use rand() within linux-user. Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/main.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index 4c72f07555..5792c40ace 1

[Qemu-devel] [PATCH v7 16/24] aspeed/scu: Use qemu_guest_getrandom_nofail

2019-05-14 Thread Richard Henderson
The random number is intended for use by the guest. As such, we should honor the -seed argument for reproducibility. Use the *_nofail routine instead of rolling our own error handling locally. Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Review

[Qemu-devel] [PATCH v7 21/24] target/arm: Implement ARMv8.5-RNG

2019-05-14 Thread Richard Henderson
Use the newly introduced infrastructure for guest random numbers. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/cpu.h| 5 + target/arm/cpu64.c | 1 + target/arm/helper.c | 44 3 files changed, 50 insertions(+)

[Qemu-devel] [PATCH v7 18/24] hw/misc/bcm2835_rng: Use qemu_guest_getrandom_nofail

2019-05-14 Thread Richard Henderson
The random number is intended for use by the guest. As such, we should honor the -seed argument for reproducibility. Use the *_nofail routine instead of rolling our own error handling locally. Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson ---

[Qemu-devel] [PATCH v7 24/24] target/i386: Implement CPUID_EXT_RDRAND

2019-05-14 Thread Richard Henderson
We now have an interface for guest visible random numbers. Reviewed-by: Eduardo Habkost Signed-off-by: Richard Henderson --- target/i386/helper.h | 2 ++ target/i386/cpu.c| 5 ++-- target/i386/int_helper.c | 21 ++ target/i386/translate.c | 62

Re: [Qemu-devel] [PATCH for-4.1] q35: Revert to kernel irqchip

2019-05-14 Thread Alex Williamson
On Tue, 14 May 2019 12:46:47 -0600 Alex Williamson wrote: > Commit b2fc91db8447 ("q35: set split kernel irqchip as default") changed > the default for the pc-q35-4.0 machine type to use split irqchip, which > turned out to have disasterous effects on vfio-pci INTx support. KVM > resampling irqfd

[Qemu-devel] [PATCH v7 19/24] hw/misc/exynos4210_rng: Use qemu_guest_getrandom

2019-05-14 Thread Richard Henderson
The random number is intended for use by the guest. As such, we should honor the -seed argument for reproducibility. Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- hw/misc/exynos4210_rng.c | 11 --- 1 file changed, 4 insertions(+),

Re: [Qemu-devel] [PATCH for-4.0.1] q35: Revert to kernel irqchip

2019-05-14 Thread Alex Williamson
On Tue, 14 May 2019 20:22:32 +0100 Daniel P. Berrangé wrote: > On Tue, May 14, 2019 at 01:03:31PM -0600, Alex Williamson wrote: > > Commit b2fc91db8447 ("q35: set split kernel irqchip as default") changed > > the default for the pc-q35-4.0 machine type to use split irqchip, which > > turned out t

[Qemu-devel] [PATCH v7 20/24] target/arm: Put all PAC keys into a structure

2019-05-14 Thread Richard Henderson
This allows us to use a single syscall to initialize them all. Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/arm/cpu.h | 12 +++- linux-user/aarch64/cpu_loop.c | 6 +- linux-user/syscall.c | 10 +++

[Qemu-devel] [PATCH v7 22/24] target/ppc: Use qemu_guest_getrandom for DARN

2019-05-14 Thread Richard Henderson
We now have an interface for guest visible random numbers. Acked-by: David Gibson Reviewed-by: Laurent Vivier Signed-off-by: Richard Henderson --- target/ppc/int_helper.c | 39 +++ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/target/ppc/in

[Qemu-devel] [PATCH for-4.1 v2] q35: Revert to kernel irqchip

2019-05-14 Thread Alex Williamson
Commit b2fc91db8447 ("q35: set split kernel irqchip as default") changed the default for the pc-q35-4.0 machine type to use split irqchip, which turned out to have disasterous effects on vfio-pci INTx support. KVM resampling irqfds are registered for handling these interrupts, but these are non-fu

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

2019-05-14 Thread Richard Henderson
On 5/14/19 9:03 AM, Andrea Bolognani wrote: > On Tue, 2019-05-14 at 14:53 +0200, Andrew Jones wrote: >> We already have sve-max-vq, so I'm not sure we want to rename it. > > Oh, I didn't realize that was the case. And of course it already > takes a number of quadwords as argument, I suppose? That'

[Qemu-devel] [PATCH v2] migration/dirty-bitmaps: change bitmap enumeration method

2019-05-14 Thread John Snow
Shift from looking at every root BDS to *every* BDS. This will migrate bitmaps that are attached to blockdev created nodes instead of just ones attached to emulated storage devices. Note that this will not migrate anonymous or internal-use bitmaps, as those are defined as having no name. This wil

Re: [Qemu-devel] [PATCH for-4.0.1] q35: Revert to kernel irqchip

2019-05-14 Thread Alex Williamson
On Tue, 14 May 2019 13:03:31 -0600 Alex Williamson wrote: > Commit b2fc91db8447 ("q35: set split kernel irqchip as default") changed > the default for the pc-q35-4.0 machine type to use split irqchip, which > turned out to have disasterous effects on vfio-pci INTx support. KVM > resampling irqfd

[Qemu-devel] [PATCH 8/9] target/xtensa: update list of exception causes

2019-05-14 Thread Max Filippov
Add XEA2 exception cause codes defined in recent Xtensa ISA releases. Signed-off-by: Max Filippov --- target/xtensa/cpu.h | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h index ba4ef2b6a729..8301923e4c4a 100644 --- a/target/xt

[Qemu-devel] [PATCH 1/9] target/xtensa: get rid of centralized SR properties

2019-05-14 Thread Max Filippov
SR numbers are not unique: different Xtensa options may reuse SR number for different purposes. Introduce generic rsr/wsr functions and xsr template and use them instead of centralized SR access functions. Change prototypes of specific rsr/wsr functions to match XtensaOpcodeOp and use them instead

[Qemu-devel] [PATCH 5/9] target/xtensa: implement MPU option

2019-05-14 Thread Max Filippov
The Memory Protection Unit Option (MPU) is a combined instruction and data memory protection unit with more protection flexibility than the Region Protection Option or the Region Translation Option but without any translation capability. It does no demand paging and does not reference a memory-base

[Qemu-devel] [PATCH 9/9] target/xtensa: implement exclusive access option

2019-05-14 Thread Max Filippov
The Exclusive Instructions provide a general-purpose mechanism for atomic updates of memory-based synchronization variables that can be used for exclusion algorithms. Use cmpxchg-based implementation that is sufficient for the typical use of exclusive access in atomic operations. Signed-off-by: M

[Qemu-devel] [PATCH 4/9] target/xtensa: add parity/ECC option SRs

2019-05-14 Thread Max Filippov
Add SRs and rsr/wsr/xsr opcodes defined by the parity/ECC xtensa option. The implementation is trivial since we don't emulate parity/ECC yet. Signed-off-by: Max Filippov --- target/xtensa/cpu.h | 6 ++ target/xtensa/overlay_tool.h | 2 + target/xtensa/translate.c| 162 ++

<    1   2   3   4   >