Re: [Qemu-devel] [PATCH v2 3/8] target/sparc: Define an enumeration for accessing env->regwptr

2019-05-14 Thread Philippe Mathieu-Daudé
Hi Richard, On 5/10/19 5:27 AM, Richard Henderson wrote: > Signed-off-by: Richard Henderson > --- > target/sparc/cpu.h | 33 + > 1 file changed, 33 insertions(+) > > diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h > index 85b9665ccc..08f7d1a3c6 100644 > ---

Re: [Qemu-devel] [PATCH v4 6/6] acpi: pci: use build_append_foo() API to construct MCFG

2019-05-14 Thread Philippe Mathieu-Daudé
On 5/15/19 3:10 AM, Michael S. Tsirkin wrote: > On Fri, Apr 19, 2019 at 08:30:53AM +0800, Wei Yang wrote: >> build_append_foo() API doesn't need explicit endianness conversions >> which eliminates a source of errors and it makes build_mcfg() look like >> declarative definition of MCFG table in

[Qemu-devel] [PATCH v2 2/2] iotests: Test unaligned raw images with O_DIRECT

2019-05-14 Thread Max Reitz
We already have 221 for accesses through the page cache, but it is better to create a new file for O_DIRECT instead of integrating those test cases into 221. This way, we can make use of _supported_cache_modes (and _default_cache_mode) so the test is automatically skipped on filesystems that do

Re: [Qemu-devel] [PATCH v2] iotests: Filter 175's allocation information

2019-05-14 Thread Max Reitz
On 13.05.19 17:52, Max Reitz wrote: > It is possible for an empty file to take up blocks on a filesystem. > Make iotest 175 take this into account. > > Reported-by: Thomas Huth > Signed-off-by: Max Reitz > --- > v2: [Nir] > - Use a function for filtering > - s/empty_blocks/extra_blocks/ > --- >

[Qemu-devel] [PATCH v2 0/2] block/file-posix: Fix unaligned O_DIRECT block status

2019-05-14 Thread Max Reitz
The user-visible problem: $ 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 > offset - aligned_offset'

[Qemu-devel] [PATCH v2 1/2] block/file-posix: Unaligned O_DIRECT block-status

2019-05-14 Thread Max Reitz
Currently, qemu crashes whenever someone queries the block status of an unaligned image tail of an O_DIRECT image: $ 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 1/2] block/file-posix: Unaligned O_DIRECT block-status

2019-05-14 Thread Max Reitz
On 14.05.19 23:50, Eric Blake wrote: > On 5/14/19 4:42 PM, Max Reitz wrote: >> Currently, qemu crashes whenever someone queries the block status of an >> unaligned image tail of an O_DIRECT image: >> $ echo > foo >> $ qemu-img map --image-opts driver=file,filename=foo,cache.direct=on >> Offset

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

2019-05-14 Thread Jason Wang
On 2019/5/14 下午8:18, 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? I vote

Re: [Qemu-devel] [PATCH] configure: Change capstone's default state to disabled

2019-05-14 Thread Programmingkid
> On May 12, 2019, at 9:47 AM, Thomas Huth wrote: > > On 11/05/2019 20.28, Programmingkid wrote: >> >>> On May 11, 2019, at 2:05 PM, Thomas Huth wrote: >>> >>> On 11/05/2019 19.21, Programmingkid wrote: > On Apr 20, 2019, at 6:40 AM, Thomas Huth wrote: > > On 19/04/2019

Re: [Qemu-devel] [PATCH v4 6/6] acpi: pci: use build_append_foo() API to construct MCFG

2019-05-14 Thread Michael S. Tsirkin
On Fri, Apr 19, 2019 at 08:30:53AM +0800, Wei Yang wrote: > build_append_foo() API doesn't need explicit endianness conversions > which eliminates a source of errors and it makes build_mcfg() look like > declarative definition of MCFG table in ACPI spec, which makes it easy > to review. > >

Re: [Qemu-devel] [PATCH v2 1/8] linux-user: Disallow setting newsp for fork

2019-05-14 Thread Richard Henderson
On 5/9/19 8:27 PM, Richard Henderson wrote: > Or really, just clone devolving into fork. This should not ever happen > in practice. We do want to reserve calling cpu_clone_regs for the case > in which we are actually performing a clone. > > Reviewed-by: Alex Bennée > Signed-off-by: Richard

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

2019-05-14 Thread Richard Henderson
On 5/14/19 5:21 PM, Alistair Francis wrote: > diff --git a/target/arm/translate.c b/target/arm/translate.c > index dd053c80d6..298c262825 100644 > --- a/target/arm/translate.c > +++ b/target/arm/translate.c > @@ -6598,13 +6598,13 @@ static int disas_neon_data_insn(DisasContext *s, > uint32_t

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

2019-05-14 Thread Alistair Francis
Commit 89e68b575 "target/arm: Use vector operations for saturation" causes this abort() when booting QEMU ARM with a Cortex-A15: 0 0x74c2382f in raise () at /usr/lib/libc.so.6 1 0x74c0e672 in abort () at /usr/lib/libc.so.6 2 0x559c1839 in disas_neon_data_insn (insn=,

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 2:43 PM, Eric Blake wrote: >> It didn't occur to me that there was nothing in the object files for the >> reference. I'll have to drop the crypto-obj-y patch and come up with a >> different solution. > > Isn't there a gcc annotation for marking a simple as mandatorily > included

[Qemu-devel] [Bug 1829079] [NEW] Can't build static on ARM (Raspbian)

2019-05-14 Thread Dariusz Zyzański
Public bug reported: I am trying to build static QEMU on Raspbian, chrooted into using systemd-nspawn with QEMU 4.0.0. This is how my compiling looks: https://pastebin.com/PYZYeRCN Just the problematic part: https://pastebin.com/7LxWPMxA How I do the compiling: https://pastebin.com/pYM17A6R (I

Re: [Qemu-devel] [PATCH 2/2] iotests: Test unaligned raw images with O_DIRECT

2019-05-14 Thread Eric Blake
On 5/14/19 4:42 PM, Max Reitz wrote: > We already have 221 for accesses through the page cache, but it is > better to create a new file for O_DIRECT instead of integrating those > test cases into 221. This way, we can make use of > _supported_cache_modes (and _default_cache_mode) so the test is >

Re: [Qemu-devel] [PATCH 1/2] block/file-posix: Unaligned O_DIRECT block-status

2019-05-14 Thread Eric Blake
On 5/14/19 4:42 PM, Max Reitz wrote: > Currently, qemu crashes whenever someone queries the block status of an > unaligned image tail of an O_DIRECT image: > $ echo > foo > $ qemu-img map --image-opts driver=file,filename=foo,cache.direct=on > Offset Length Mapped to File >

[Qemu-devel] [Bug 1746394] Re: No provider of glEGLImageTargetTexture2DOES found with NVIDIA proprietary driver

2019-05-14 Thread Chris Sharp
I'm hitting this issue on Fedora 30 after an in-place upgrade. Using gnome-boxes, I click on a virtual machine to open the console viewer and it crashes after a hang. Terminal output looks like this: [chris@gereon ~]$ gnome-boxes (gnome-boxes:15640): Gtk-WARNING **: 17:21:17.105: GtkFlowBox

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

2019-05-14 Thread Eric Blake
On 5/14/19 12:46 PM, Richard Henderson wrote: > 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

[Qemu-devel] [PATCH 2/2] iotests: Test unaligned raw images with O_DIRECT

2019-05-14 Thread Max Reitz
We already have 221 for accesses through the page cache, but it is better to create a new file for O_DIRECT instead of integrating those test cases into 221. This way, we can make use of _supported_cache_modes (and _default_cache_mode) so the test is automatically skipped on filesystems that do

[Qemu-devel] [PATCH 0/2] block/file-posix: Fix unaligned O_DIRECT block status

2019-05-14 Thread Max Reitz
The user-visible problem: $ 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 > offset - aligned_offset'

[Qemu-devel] [PATCH 1/2] block/file-posix: Unaligned O_DIRECT block-status

2019-05-14 Thread Max Reitz
Currently, qemu crashes whenever someone queries the block status of an unaligned image tail of an O_DIRECT image: $ 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] Unaligned images with O_DIRECT

2019-05-14 Thread Eric Blake
On 5/14/19 12:28 PM, Max Reitz wrote: >>> >>> The tail of an unaligned file is generally inaccessible to O_DIRECT, >> >> Especially with this. >> >>> where it is easier to use ftruncate() up to an aligned boundary if you >>> really must play with that region of the file, and then ftruncate() back

Re: [Qemu-devel] [PATCH RFC v3] s390/css: handle CCW_FLAG_SKIP

2019-05-14 Thread Eric Farman
On 5/8/19 5:12 AM, Cornelia Huck wrote: If a ccw has CCW_FLAG_SKIP set, and the command is of type read, read backwards, or sense, no data should be written to the guest for that command. Signed-off-by: Cornelia Huck --- v2 -> v3: fixed checks even more [Pierre] v1 -> v2: fixed checks for

[Qemu-devel] [PATCH 0/9] target/xtensa: implement options for modern cores

2019-05-14 Thread Max Filippov
Hello, this series implements options used by the modern xtensa cores: memory protection unit, block prefetch and exclusive access and adds special register definitions and IRQ types for a few other options not fully implemented: ECC/parity, scatter/gather and IDMA. Max Filippov (9):

[Qemu-devel] [PATCH 2/9] target/xtensa: make internal MMU functions static

2019-05-14 Thread Max Filippov
Remove declarations of the internal mmu_helper functions from the cpu.h, make these functions static and shuffle them. Signed-off-by: Max Filippov --- target/xtensa/cpu.h| 19 -- target/xtensa/mmu_helper.c | 163 - 2 files changed, 87

[Qemu-devel] [PATCH 7/9] target/xtensa: implement block prefetch option opcodes

2019-05-14 Thread Max Filippov
Block prefetch option adds a bunch of non-privileged opcodes that may be implemented as nops since QEMU doesn't model caches. Signed-off-by: Max Filippov --- target/xtensa/translate.c | 42 ++ 1 file changed, 42 insertions(+) diff --git

[Qemu-devel] [PATCH 3/9] target/xtensa: define IDMA and gather/scatter IRQ types

2019-05-14 Thread Max Filippov
IDMA and scatter/gather features introduced new IRQ types that overlay_tool.h need to initialize Xtensa configuration. Signed-off-by: Max Filippov --- target/xtensa/cpu.h | 3 +++ target/xtensa/overlay_tool.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/target/xtensa/cpu.h

[Qemu-devel] [PATCH 6/9] target/xtensa: implement DIWBUI.P opcode

2019-05-14 Thread Max Filippov
This is a recent addition to the set of data cache opcodes. Signed-off-by: Max Filippov --- target/xtensa/cpu.h | 1 + target/xtensa/overlay_tool.h | 1 + target/xtensa/translate.c| 10 ++ 3 files changed, 12 insertions(+) diff --git a/target/xtensa/cpu.h

[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

[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

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

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

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

[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

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?

[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

[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

[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

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

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

[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

[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

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

[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

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

[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

[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

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

[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

[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

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

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

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

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

[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

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

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

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 >

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

[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

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

[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

[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

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

[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

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.

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

[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

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

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

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

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

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

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

[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

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

[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

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

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

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

[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

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

[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

[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

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

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

[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

  1   2   3   4   >