Re: [Qemu-devel] [RFC PATCH] pci: Use PCI aliases when determining device IOMMU address space

2019-07-24 Thread Peter Xu
On Wed, Jul 24, 2019 at 08:43:55AM -0600, Alex Williamson wrote: > On Wed, 24 Jul 2019 18:03:31 +0800 > Peter Xu wrote: > > > On Wed, Jul 24, 2019 at 05:39:22AM -0400, Michael S. Tsirkin wrote: > > > On Wed, Jul 24, 2019 at 03:14:39PM +0800, Peter Xu wrote: > > > > On Tue, Jul 23, 2019 at 11:26

Re: [Qemu-devel] [PATCH for-4.2 14/14] icount: clean up cpu_can_io before jumping to the next block

2019-07-24 Thread Paolo Bonzini
On 25/07/19 07:55, Pavel Dovgalyuk wrote: >> >> I think you do not need this patch if you remove the assignment in >> cpu_tb_exec, and compile a "move 0 to cpu->can_do_io" in gen_tb_start >> instead. > "move 0 to cpu->can_do_io" only for icount mode? Yes, using CF_ICOUNT. > And we'll also need to

[Qemu-devel] [PATCH v2] x86: Intel AVX512_BF16 feature enabling

2019-07-24 Thread Jing Liu
Intel CooperLake cpu adds AVX512_BF16 instruction, defining as CPUID.(EAX=7,ECX=1):EAX[bit 05]. The patch adds a property for setting the subleaf of CPUID leaf 7 in case that people would like to specify it. The release spec link as follows, https://software.intel.com/sites/default/files/managed/

Re: [Qemu-devel] [PATCH v3] qapi: add dirty-bitmaps to query-named-block-nodes result

2019-07-24 Thread Markus Armbruster
John Snow writes: > On 7/24/19 12:47 AM, Markus Armbruster wrote: >> John Snow writes: >> >>> From: Vladimir Sementsov-Ogievskiy >>> >>> Let's add a possibility to query dirty-bitmaps not only on root nodes. >>> It is useful when dealing both with snapshots and incremental backups. >>> >>> Sig

Re: [Qemu-devel] [PATCH for-4.2 10/14] util/qemu-timer: refactor deadline calculation for external timers

2019-07-24 Thread Pavel Dovgalyuk
> From: Paolo Bonzini [mailto:pbonz...@redhat.com] > On 24/07/19 10:44, Pavel Dovgalyuk wrote: > > -int64_t qemu_clock_deadline_ns_all(QEMUClockType type) > > +int64_t virtual_clock_deadline_ns(void) > > { > > int64_t deadline = -1; > > +int64_t delta; > > +int64_t expire_time; > > +

Re: [Qemu-devel] [PATCH for-4.2 14/14] icount: clean up cpu_can_io before jumping to the next block

2019-07-24 Thread Pavel Dovgalyuk
> From: Paolo Bonzini [mailto:pbonz...@redhat.com] > On 24/07/19 10:44, Pavel Dovgalyuk wrote: > > From: Pavel Dovgalyuk > > > > Most of IO instructions can be executed only at the end of the block in > > icount mode. Therefore translator can set cpu_can_io flag when translating > > the last instr

Re: [Qemu-devel] [PATCH] docs/nvdimm: add example on persistent backend setup

2019-07-24 Thread Pankaj Gupta
> > Persistent backend setup requires some knowledge about nvdimm and ndctl > tool. Some users report they may struggle to gather these knowledge and > have difficulty to setup it properly. > > Here we provide two examples for persistent backend and gives the link > to ndctl. By doing so, user

Re: [Qemu-devel] [PATCH] docs/nvdimm: add example on persistent backend setup

2019-07-24 Thread Pankaj Gupta
> > > >> > >> Persistent backend setup requires some knowledge about nvdimm and ndctl > >> tool. Some users report they may struggle to gather these knowledge and > >> have difficulty to setup it properly. > >> > >> Here we provide two examples for persistent backend and gives the link > >> to

Re: [Qemu-devel] [PATCH v4 0/3] restrict bridge interface name to IFNAMSIZ

2019-07-24 Thread Jason Wang
On 2019/7/24 上午1:44, no-re...@patchew.org wrote: Patchew URL:https://patchew.org/QEMU/20190723104754.29324-1-ppan...@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 l

Re: [Qemu-devel] [RFC 00/19] Add virtual device fuzzing support

2019-07-24 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190725032321.12721-1-alx...@bu.edu/ Hi, This series seems to have some coding style problems. See output below for more information: Type: series Subject: [Qemu-devel] [RFC 00/19] Add virtual device fuzzing support Message-id: 20190725032321.12721-1-alx.

[Qemu-devel] [RFC 19/19] fuzz: Add documentation about the fuzzer to docs/

2019-07-24 Thread Oleinik, Alexander
Signed-off-by: Alexander Oleinik --- docs/devel/fuzzing.txt | 145 + 1 file changed, 145 insertions(+) create mode 100644 docs/devel/fuzzing.txt diff --git a/docs/devel/fuzzing.txt b/docs/devel/fuzzing.txt new file mode 100644 index 00..321e005e8c

[Qemu-devel] [RFC PATCH] migration/postcopy: skip compression when postcopy is active

2019-07-24 Thread Wei Yang
Now postcopy is not compatible with compression. And we disable setting these two capability at the same time. While we can still leverage compress before postcopy is active, for example at the bulk stage. This patch skips compression when postcopy is active instead of forbidding setting these cap

[Qemu-devel] [RFC 17/19] fuzz: add general qtest fuzz target

2019-07-24 Thread Oleinik, Alexander
These fuzz targets perform a range of qtest operations over mmio and port i/o addresses mapped to devices. Signed-off-by: Alexander Oleinik --- tests/fuzz/qtest_fuzz.c | 261 tests/fuzz/qtest_fuzz.h | 38 ++ 2 files changed, 299 insertions(+) create

[Qemu-devel] [RFC 16/19] fuzz: add general fuzzer entrypoints

2019-07-24 Thread Oleinik, Alexander
Defines LLVMFuzzerInitialize and LLVMFuzzerTestOneInput Signed-off-by: Alexander Oleinik --- tests/fuzz/fuzz.c | 262 ++ tests/fuzz/fuzz.h | 96 + 2 files changed, 358 insertions(+) create mode 100644 tests/fuzz/fuzz.c create mode 10

[Qemu-devel] [RFC 14/19] fuzz: hard-code a main-loop timeout

2019-07-24 Thread Oleinik, Alexander
Signed-off-by: Alexander Oleinik --- util/main-loop.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/main-loop.c b/util/main-loop.c index e3eaa55866..708e6be5eb 100644 --- a/util/main-loop.c +++ b/util/main-loop.c @@ -513,6 +513,9 @@ void main_loop_wait(int nonblocking) timeout_

[Qemu-devel] [RFC 13/19] fuzz: add ctrl vq support to virtio-net in libqos

2019-07-24 Thread Oleinik, Alexander
Signed-off-by: Alexander Oleinik --- tests/libqos/virtio-net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/libqos/virtio-net.c b/tests/libqos/virtio-net.c index 66405b646e..247a0a17a8 100644 --- a/tests/libqos/virtio-net.c +++ b/tests/libqos/virtio-net.c @@ -51,7 +51

[Qemu-devel] [RFC 18/19] fuzz: Add virtio-net tx and ctrl fuzz targets

2019-07-24 Thread Oleinik, Alexander
These virtio-net fuzz targets use libqos abstractions to virtio-net virtqueues. Signed-off-by: Alexander Oleinik --- tests/fuzz/virtio-net-fuzz.c | 226 +++ 1 file changed, 226 insertions(+) create mode 100644 tests/fuzz/virtio-net-fuzz.c diff --git a/tests/fuzz

[Qemu-devel] [RFC 15/19] fuzz: add fuzz accelerator type

2019-07-24 Thread Oleinik, Alexander
Signed-off-by: Alexander Oleinik --- accel/fuzz.c | 47 +++ include/sysemu/fuzz.h | 15 ++ 2 files changed, 62 insertions(+) create mode 100644 accel/fuzz.c create mode 100644 include/sysemu/fuzz.h diff --git a/accel/fuzz.c b/accel/f

[Qemu-devel] [RFC 08/19] fuzz: add shims to intercept libfuzzer init

2019-07-24 Thread Oleinik, Alexander
Intercept coverage buffer registration calls and use this information to copy them to shared memory, if using fork() to avoid resetting device state. Signed-off-by: Alexander Oleinik --- tests/fuzz/fuzzer_hooks.c | 106 ++ tests/fuzz/fuzzer_hooks.h | 9

[Qemu-devel] [RFC 11/19] fuzz: add direct send/receive in qtest client

2019-07-24 Thread Oleinik, Alexander
Directly interact with tests/libqtest.c functions Signed-off-by: Alexander Oleinik --- qtest.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/qtest.c b/qtest.c index 15e27e911f..a6134d3ed0 100644 --- a/qtest.c +++ b/qtest.c @@ -31,6 +31,9 @@ #ifdef TARGE

[Qemu-devel] [RFC 12/19] fuzz: hard-code all of the needed files for build

2019-07-24 Thread Oleinik, Alexander
Once the fuzzer is better-integrated into the build-system, this should go away Signed-off-by: Alexander Oleinik --- target/i386/Makefile.objs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/Makefile.objs b/target/i386/Makefile.objs index 3d646848ef..c8834f6ad1 10

[Qemu-devel] [RFC 10/19] fuzz: expose real_main (aka regular vl.c:main)

2019-07-24 Thread Oleinik, Alexander
Export normal qemu-system main so it can be called from tests/fuzz/fuzz.c Signed-off-by: Alexander Oleinik --- include/sysemu/sysemu.h | 4 vl.c| 21 - 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/include/sysemu/sysemu.h b/include/s

[Qemu-devel] [RFC 09/19] fuzz: use mtree_info to find mapped addresses

2019-07-24 Thread Oleinik, Alexander
Locate mmio and port i/o addresses that are mapped to devices so we can limit the fuzzer to only these addresses. This should be replaced with a sane way of enumaring these memory regions. Signed-off-by: Alexander Oleinik --- memory.c | 34 ++ 1 file changed, 34 i

[Qemu-devel] [RFC 03/19] fuzz: add fuzz accelerator

2019-07-24 Thread Oleinik, Alexander
Much like the qtest accelerator, the fuzz accelerator skips the CPU emulation Signed-off-by: Alexander Oleinik --- include/sysemu/qtest.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/sysemu/qtest.h b/include/sysemu/qtest.h index cd114b8d80..adfbd10d20 100644

[Qemu-devel] [RFC 07/19] fuzz: Modify libqtest to directly invoke qtest.c

2019-07-24 Thread Oleinik, Alexander
libqtest directly invokes the qtest client and exposes a function to accept responses. Signed-off-by: Alexander Oleinik --- tests/libqtest.c | 53 +++- tests/libqtest.h | 6 ++ 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/tests/l

[Qemu-devel] [RFC 02/19] fuzz: add FUZZ_TARGET type to qemu module system

2019-07-24 Thread Oleinik, Alexander
Signed-off-by: Alexander Oleinik --- include/qemu/module.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/qemu/module.h b/include/qemu/module.h index db3065381d..531fe7ae29 100644 --- a/include/qemu/module.h +++ b/include/qemu/module.h @@ -46,6 +46,9 @@ typedef

[Qemu-devel] [RFC 04/19] fuzz: Add qos support to fuzz targets

2019-07-24 Thread Oleinik, Alexander
qos_helpers.c is largely a copy of tests/qos-test.c Signed-off-by: Alexander Oleinik --- tests/fuzz/qos_fuzz.c| 63 + tests/fuzz/qos_fuzz.h| 29 tests/fuzz/qos_helpers.c | 295 +++ tests/fuzz/qos_helpers.h | 17 +++ 4 files changed, 404

[Qemu-devel] [RFC 01/19] fuzz: add configure option and linker objects

2019-07-24 Thread Oleinik, Alexander
Add -Wl,--wraps for the libfuzzer callees that we need to intercept Signed-off-by: Alexander Oleinik --- configure | 11 +++ target/i386/Makefile.objs | 19 +++ 2 files changed, 30 insertions(+) diff --git a/configure b/configure index 714e7fb6a1..0a40e77

[Qemu-devel] [RFC 00/19] Add virtual device fuzzing support

2019-07-24 Thread Oleinik, Alexander
As part of Google Summer of Code 2019, I'm working on integrating fuzzing of virtual devices into QEMU [1]. This is a highly WIP patchset adding this functionality. Fuzzers provide random data to a program and monitor its execution for errors. Coverage-guided fuzzers also observe the parts of the

[Qemu-devel] [RFC 06/19] fuzz: Add ramfile for fast vmstate/vmload

2019-07-24 Thread Oleinik, Alexander
The ramfile allows vmstate to be saved and restored directly onto the heap. Signed-off-by: Alexander Oleinik --- tests/fuzz/ramfile.c | 127 +++ tests/fuzz/ramfile.h | 20 +++ 2 files changed, 147 insertions(+) create mode 100644 tests/fuzz/ramfile.c

[Qemu-devel] [RFC 05/19] fuzz: expose qemu_savevm_state & skip state header

2019-07-24 Thread Oleinik, Alexander
Signed-off-by: Alexander Oleinik --- migration/savevm.c | 8 ++-- migration/savevm.h | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index 79ed44d475..80c00ea560 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1404,8

[Qemu-devel] CC wangxiongfeng. : RE: [PATCH] pcie: fix device hotplug failure at the meantime of VM boot

2019-07-24 Thread Zhangbo (Oscar)
>> If the PCI_EXP_LNKSTA_DLLLA capability is set by default, linux kernel will >> send >> PDC event to detect whether there is a device in pcie slot. If a device is >> pluged >> in the pcie-root-port at the same time, hot-plug device will send ABP + PDC >> events to the kernel. The VM kernel will

[Qemu-devel] [PATCH v3 1/1] configure: Define target access alignment in configure

2019-07-24 Thread tony.nguyen
Rename ALIGNED_ONLY to TARGET_ALIGNED_ONLY for clarity and move defines out of target/foo/cpu.h into configure, as we do with TARGET_WORDS_BIGENDIAN, so that it is always defined early. Also, poison the symbol in include/exec/poison.h to prevent use in common code. Reviewed-by: Philippe Mathieu-D

[Qemu-devel] [PATCH v3 0/1] configure: Define target access alignment in configure

2019-07-24 Thread tony.nguyen
Move the define of target access alignment earlier from target/foo/cpu.h to configure. Suggested in Richard Henderson's reply to "[PATCH 1/4] tcg: TCGMemOp is now accelerator independent MemOp" Analysed target/foo/cpu.h for more candidates to define earlier but did not spot any other

Re: [Qemu-devel] [Qemu-block] [QEMU] [PATCH v5 0/8] Add Qemu to SeaBIOS LCHS interface

2019-07-24 Thread John Snow
On 7/24/19 8:47 PM, John Snow wrote: > > > On 7/19/19 6:10 AM, Sam Eiderman wrote: >> Well, this patch introduces 3 command line parameters (“lcyls”, “lheads”, >> “lsecs”) >> to “scsi-hd” “ide-hd” and “virtio-pci-blk” so this somehow has something to >> do with >> block. >> >> This patch als

Re: [Qemu-devel] [Qemu-block] [QEMU] [PATCH v5 0/8] Add Qemu to SeaBIOS LCHS interface

2019-07-24 Thread John Snow
On 7/19/19 6:10 AM, Sam Eiderman wrote: > Well, this patch introduces 3 command line parameters (“lcyls”, “lheads”, > “lsecs”) > to “scsi-hd” “ide-hd” and “virtio-pci-blk” so this somehow has something to > do with > block. > > This patch also adds fw_cfg interface to send these parameters to

Re: [Qemu-devel] [Qemu-block] [PATCH-for-4.1? 6/7] vl: Rewrite a fall through comment

2019-07-24 Thread John Snow
On 7/19/19 9:14 AM, Philippe Mathieu-Daudé wrote: > GCC9 is confused by this comment when building with CFLAG > -Wimplicit-fallthrough=2: > > vl.c: In function ‘qemu_ref_timedate’: > vl.c:773:15: error: this statement may fall through > [-Werror=implicit-fallthrough=] > 773 | v

Re: [Qemu-devel] [Qemu-block] [PATCH-for-4.1 3/7] hw/block/pflash_cfi02: Rewrite a fall through comment

2019-07-24 Thread John Snow
On 7/22/19 7:43 AM, Philippe Mathieu-Daudé wrote: > On 7/19/19 3:14 PM, Philippe Mathieu-Daudé wrote: >> GCC9 is confused by this comment when building with CFLAG >> -Wimplicit-fallthrough=2: >> >> hw/block/pflash_cfi02.c: In function ‘pflash_write’: >> hw/block/pflash_cfi02.c:574:16: error:

[Qemu-devel] [PATCH v2] migration/postcopy: use mis->bh instead of allocating a QEMUBH

2019-07-24 Thread Wei Yang
For migration incoming side, it either quit in precopy or postcopy. It is safe to use the mis->bh for both instead of allocating a dedicated QEMUBH for postcopy. Signed-off-by: Wei Yang Reviewed-by: Dr. David Alan Gilbert --- v2: fix a typo in change log --- migration/savevm.c | 17 ---

Re: [Qemu-devel] [Qemu-block] [PATCH] Fixes: a6862418fec4072 iotests change in 051.out

2019-07-24 Thread John Snow
On 7/24/19 4:47 AM, Christian Borntraeger wrote: > > > On 24.07.19 10:25, Andrey Shinkevich wrote: >> The patch "iotests: Set read-zeroes on in null block driver for Valgrind" >> needs the change in 051.out when compared against on the s390 system. >> >> Reported-by: Christian Borntraeger > T

[Qemu-devel] [PATCH v2 0/2] migration: cleanup ram_load

2019-07-24 Thread Wei Yang
Two cleanup for ram_load: * return -EINVAL for version_id mismatch * extract ram_load_precopy for better readability v2: fix a comment Wei Yang (2): migration: return -EINVAL directly when version_id mismatch migration: extract ram_load_precopy migration/ram.c | 73

[Qemu-devel] [PATCH v2 1/2] migration: return -EINVAL directly when version_id mismatch

2019-07-24 Thread Wei Yang
It is not reasonable to continue when version_id mismatch. Signed-off-by: Wei Yang Reviewed-by: Dr. David Alan Gilbert --- migration/ram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/ram.c b/migration/ram.c index 66792568e2..69c8a6bb0f 100644 --- a/migration/ra

[Qemu-devel] [PATCH v2 2/2] migration: extract ram_load_precopy

2019-07-24 Thread Wei Yang
After cleanup, it would be clear to audience there are two cases ram_load: * precopy * postcopy And it is not necessary to check postcopy_running on each iteration for precopy. Signed-off-by: Wei Yang Reviewed-by: Dr. David Alan Gilbert --- v2: fix a comment --- migration/ram.c | 73

Re: [Qemu-devel] [PATCH v3] tests/boot_linux_console: add a test for riscv64 + virt

2019-07-24 Thread Alistair Francis
On Tue, Jul 23, 2019 at 11:46 PM Chih-Min Chao wrote: > > Similar to the mips + malta test, it boots a Linux kernel on a virt > board and verify the serial is working. Also, it relies on the serial > device set by the machine itself. > > If riscv64 is a target being built, "make check-acceptance"

[Qemu-devel] Sphinx and docs/index.rst: dead code?

2019-07-24 Thread John Snow
Does anything actually use this file? It doesn't appear to be used for generating the HTML manuals. It looks like we might use it for latex, man and texinfo output from sphinx judging by docs/conf.py, but I don't think we actually use sphinx to generate such output, so I think this is all dead cod

Re: [Qemu-devel] [PATCH v2 06/13] doc: update AMD SEV to include Live migration flow

2019-07-24 Thread Venu Busireddy
On 2019-07-10 20:23:03 +, Singh, Brijesh wrote: > Signed-off-by: Brijesh Singh > --- > docs/amd-memory-encryption.txt | 42 +- > 1 file changed, 41 insertions(+), 1 deletion(-) > > diff --git a/docs/amd-memory-encryption.txt b/docs/amd-memory-encryption.txt >

Re: [Qemu-devel] [PATCH 2/2] migration: extract ram_load_precopy

2019-07-24 Thread Wei Yang
On Wed, Jul 24, 2019 at 01:10:24PM +0100, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> On Tue, Jul 23, 2019 at 05:47:03PM +0100, Dr. David Alan Gilbert wrote: >> >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> >> After cleanup, it would be clear to audie

Re: [Qemu-devel] [PATCH v3] qapi: add dirty-bitmaps to query-named-block-nodes result

2019-07-24 Thread John Snow
On 7/24/19 12:47 AM, Markus Armbruster wrote: > John Snow writes: > >> From: Vladimir Sementsov-Ogievskiy >> >> Let's add a possibility to query dirty-bitmaps not only on root nodes. >> It is useful when dealing both with snapshots and incremental backups. >> >> Signed-off-by: Vladimir Sement

[Qemu-devel] [PATCH] ati-vga: Fix GPIO_MONID register write

2019-07-24 Thread BALATON Zoltan
Also update bitbang_i2c state when output bits are changed while enable bits are set. This fixes EDID access by the ATI FCode ROM. Signed-off-by: BALATON Zoltan --- hw/display/ati.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/display/ati.c b/hw/display/ati.

[Qemu-devel] Exploring Sphinx, autodoc, apidoc, and coverage tools for python/qemu

2019-07-24 Thread John Snow
Has anyone on this list experimented with these tools? I was hoping to use them to document things like the python/machine.py and python/qmp.py modules to help demonstrate some of our internal tooling API (for test writers, GSoC/Outreachy interns, folks who want to script QEMU at a level between w

Re: [Qemu-devel] [PATCH for-4.2 11/24] target/arm: Add the hypervisor virtual counter

2019-07-24 Thread Alex Bennée
Richard Henderson writes: > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée > --- > target/arm/cpu-qom.h | 1 + > target/arm/cpu.h | 11 + > target/arm/cpu.c | 2 ++ > target/arm/helper.c | 57 > 4 files changed, 66

Re: [Qemu-devel] [RFC PATCH] pci: Use PCI aliases when determining device IOMMU address space

2019-07-24 Thread Alex Williamson
On Wed, 24 Jul 2019 08:43:55 -0600 Alex Williamson wrote: > On Wed, 24 Jul 2019 18:03:31 +0800 > Peter Xu wrote: > > > On Wed, Jul 24, 2019 at 05:39:22AM -0400, Michael S. Tsirkin wrote: > > > On Wed, Jul 24, 2019 at 03:14:39PM +0800, Peter Xu wrote: > > > > On Tue, Jul 23, 2019 at 11:26:

Re: [Qemu-devel] [PATCH v7 02/11] numa: move numa global variable nb_numa_nodes into MachineState

2019-07-24 Thread Eduardo Habkost
On Wed, Jul 24, 2019 at 05:48:11PM +0200, Igor Mammedov wrote: > On Wed, 24 Jul 2019 12:02:41 -0300 > Eduardo Habkost wrote: > > > On Wed, Jul 24, 2019 at 04:27:21PM +0200, Igor Mammedov wrote: > > > On Tue, 23 Jul 2019 12:23:57 -0300 > > > Eduardo Habkost wrote: > > > > > > > On Tue, Jul 23, 2

Re: [Qemu-devel] [PATCH v3] block/rbd: add preallocation support

2019-07-24 Thread Jason Dillaman
On Tue, Jul 23, 2019 at 3:13 AM Stefano Garzarella wrote: > > This patch adds the support of preallocation (off/full) for the RBD > block driver. > If rbd_writesame() is available and supports zeroed buffers, we use > it to quickly fill the image when full preallocation is required. > > Signed-off

Re: [Qemu-devel] [PATCH for-4.1 2/2] xics/kvm: Fix fallback to emulated XICS

2019-07-24 Thread Cédric Le Goater
On 24/07/2019 18:57, Greg Kurz wrote: > Commit 4812f2615288 tried to fix rollback path of xics_kvm_connect() but > it isn't enough. If we fail to create the KVM device, the guest fails > to boot later on with: > > [0.010817] pci :00:00.0: Adding to iommu group 0 > [0.010863] irq: unkno

[Qemu-devel] [PATCH v2 07/11] vdi: Fix .bdrv_has_zero_init()

2019-07-24 Thread Max Reitz
Static VDI images cannot guarantee to be zero-initialized. If the image has been statically allocated, forward the call to the underlying storage node. Reported-by: Stefano Garzarella Signed-off-by: Max Reitz Reviewed-by: Stefan Weil Acked-by: Stefano Garzarella Tested-by: Stefano Garzarella

[Qemu-devel] [PATCH v2 11/11] iotests: Full mirror to existing non-zero image

2019-07-24 Thread Max Reitz
The result of a sync=full mirror should always be the equal to the input. Therefore, existing images should be treated as potentially non-zero and thus should be explicitly initialized to be zero beforehand. Signed-off-by: Max Reitz --- tests/qemu-iotests/041 | 62 ++

Re: [Qemu-devel] [PATCH v6 14/14] qemu-iotest: enable testing with qemu-io aio options

2019-07-24 Thread Julia Suvorova
On 7/19/19 3:35 PM, Aarushi Mehta wrote: @@ -225,6 +227,10 @@ s/ .*//p CACHEMODE_IS_DEFAULT=false cachemode=false continue +elif $aiomode +then +AIOMODE="$r" +aiomode=false 'continue' is missed here. Best regards, Julia Suvorova.

[Qemu-devel] [PATCH v2 05/11] block: Use bdrv_has_zero_init_truncate()

2019-07-24 Thread Max Reitz
Signed-off-by: Max Reitz --- block/parallels.c | 2 +- block/vhdx.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index 00fae125d1..7cd2714b69 100644 --- a/block/parallels.c +++ b/block/parallels.c @@ -835,7 +835,7 @@ static int

[Qemu-devel] [PATCH v2 10/11] iotests: Test convert -n to pre-filled image

2019-07-24 Thread Max Reitz
Signed-off-by: Max Reitz --- tests/qemu-iotests/122 | 17 + tests/qemu-iotests/122.out | 8 2 files changed, 25 insertions(+) diff --git a/tests/qemu-iotests/122 b/tests/qemu-iotests/122 index 85c3a8d047..059011ebb1 100755 --- a/tests/qemu-iotests/122 +++ b/tests/qe

[Qemu-devel] [PATCH v2 08/11] vhdx: Fix .bdrv_has_zero_init()

2019-07-24 Thread Max Reitz
Fixed VHDX images cannot guarantee to be zero-initialized. If the image has the "fixed" subformat, forward the call to the underlying storage node. Reported-by: Stefano Garzarella Signed-off-by: Max Reitz --- block/vhdx.c | 26 +- 1 file changed, 25 insertions(+), 1 del

[Qemu-devel] [PATCH v2 09/11] iotests: Convert to preallocated encrypted qcow2

2019-07-24 Thread Max Reitz
Add a test case for converting an empty image (which only returns zeroes when read) to a preallocated encrypted qcow2 image. qcow2_has_zero_init() should return 0 then, thus forcing qemu-img convert to create zero clusters. Signed-off-by: Max Reitz Acked-by: Stefano Garzarella Tested-by: Stefano

[Qemu-devel] [PATCH v2 06/11] qcow2: Fix .bdrv_has_zero_init()

2019-07-24 Thread Max Reitz
If a qcow2 file is preallocated, it can no longer guarantee that it initially appears as filled with zeroes. So implement .bdrv_has_zero_init() by checking whether the file is preallocated; if so, forward the call to the underlying storage node, except for when it is encrypted: Encrypted prealloca

[Qemu-devel] [PATCH v2 04/11] block: Implement .bdrv_has_zero_init_truncate()

2019-07-24 Thread Max Reitz
We need to implement .bdrv_has_zero_init_truncate() for every block driver that supports truncation and has a .bdrv_has_zero_init() implementation. Implement it the same way each driver implements .bdrv_has_zero_init(). This is at least not any more unsafe than what we had before. Signed-off-by:

[Qemu-devel] [PATCH v2 02/11] mirror: Fix bdrv_has_zero_init() use

2019-07-24 Thread Max Reitz
bdrv_has_zero_init() only has meaning for newly created images or image areas. If the mirror job itself did not create the image, it cannot rely on bdrv_has_zero_init()'s result to carry any meaning. This is the case for drive-mirror with mode=existing and always for blockdev-mirror. Note that w

Re: [Qemu-devel] [PATCH v6 11/14] qemu-io: adds option to use aio engine

2019-07-24 Thread Julia Suvorova
On 7/19/19 3:35 PM, Aarushi Mehta wrote: @@ -489,7 +493,7 @@ static QemuOptsList file_opts = { int main(int argc, char **argv) { int readonly = 0; -const char *sopt = "hVc:d:f:rsnCmkt:T:U"; +const char *sopt = "hVc:d:f:rsnCmit:T:U"; Add ':' after 'i' to pass an argument after

[Qemu-devel] [PATCH v2 01/11] qemu-img: Fix bdrv_has_zero_init() use in convert

2019-07-24 Thread Max Reitz
bdrv_has_zero_init() only has meaning for newly created images or image areas. If qemu-img convert did not create the image itself, it cannot rely on bdrv_has_zero_init()'s result to carry any meaning. Signed-off-by: Max Reitz --- qemu-img.c | 11 --- 1 file changed, 8 insertions(+), 3

[Qemu-devel] [PATCH v2 00/11] block: Fix some things about bdrv_has_zero_init()

2019-07-24 Thread Max Reitz
Hi, See the previous cover letter for the reason for patches 6 through 9: https://lists.nongnu.org/archive/html/qemu-block/2019-07/msg00563.html But no only some bdrv_has_zero_init() implementations are wrong, some callers also use it the wrong way. First, qemu-img and mirror use it for pre-exis

[Qemu-devel] [PATCH v2 03/11] block: Add bdrv_has_zero_init_truncate()

2019-07-24 Thread Max Reitz
No .bdrv_has_zero_init() implementation returns 1 if growing the file would add non-zero areas (at least with PREALLOC_MODE_OFF), so using it in lieu of this new function was always safe. But on the other hand, it is possible that growing an image that is not zero-initialized would still add a zer

Re: [Qemu-devel] [PATCH for-4.1 1/2] spapr/irq: Inform the user when falling back to emulated IC

2019-07-24 Thread Cédric Le Goater
On 24/07/2019 18:57, Greg Kurz wrote: > Just to give an indication to the user that the error condition is > handled and how. > > Reported-by: Satheesh Rajendran > Signed-off-by: Greg Kurz Reviewed-by: Cédric Le Goater Thanks, C. > --- > hw/ppc/spapr_irq.c |1 + > 1 file changed, 1 i

Re: [Qemu-devel] [Qemu-stable] [PATCH 00/36] Patch Round-up for stable 3.1.1, freeze on 2019-07-29

2019-07-24 Thread Cole Robinson
On 7/23/19 1:00 PM, Michael Roth wrote: > Hi everyone, > > > The following new patches are queued for QEMU stable v3.1.1: > > https://github.com/mdroth/qemu/commits/stable-3.1-staging > > The release

[Qemu-devel] [PATCH for-4.1 1/2] spapr/irq: Inform the user when falling back to emulated IC

2019-07-24 Thread Greg Kurz
Just to give an indication to the user that the error condition is handled and how. Reported-by: Satheesh Rajendran Signed-off-by: Greg Kurz --- hw/ppc/spapr_irq.c |1 + 1 file changed, 1 insertion(+) diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c index ff3df0bbd8cf..d07aed8ca9f9 100

[Qemu-devel] [PATCH for-4.1 2/2] xics/kvm: Fix fallback to emulated XICS

2019-07-24 Thread Greg Kurz
Commit 4812f2615288 tried to fix rollback path of xics_kvm_connect() but it isn't enough. If we fail to create the KVM device, the guest fails to boot later on with: [0.010817] pci :00:00.0: Adding to iommu group 0 [0.010863] irq: unknown-1 didn't like hwirq-0x1200 to VIRQ17 mapping (

[Qemu-devel] [PATCH for-4.1 0/2] spapr/xics: Last minute fixes

2019-07-24 Thread Greg Kurz
KVM on POWER9 doesn't use the XIVE VP space optimally. This currently limits the number of VMs we can start to 127. Starting with the 128th one, KVM fails to create the XIVE or the XICS-on-XIVE device and we go through the fallback paths in QEMU. The XICS error path still has an issue that prevent

Re: [Qemu-devel] [PATCH for 4.1?] pl330: fix vmstate description

2019-07-24 Thread Dr. David Alan Gilbert
* Philippe Mathieu-Daudé (phi...@redhat.com) wrote: > On 7/24/19 4:35 PM, Damien Hedde wrote: > > Fix the pl330 main and queue vmstate description. > > There were missing POINTER flags causing crashes during > > incoming migration because: > > + PL330State chan field is a pointer to an array > > +

Re: [Qemu-devel] [PATCH v4 0/3] pc: mmap kernel (ELF image) and initrd

2019-07-24 Thread Montes, Julio
Hi Stefano Here the results https://pasteboard.co/Ipu3DO4.png https://pasteboard.co/Ipu3L69.png boot time with initrd is a little bit better Thanks - Julio On Wed, 2019-07-24 at 16:31 +0200, Stefano Garzarella wrote: > In order to reduce the memory footprint when PVH kernel and initrd > are

Re: [Qemu-devel] [PATCH for 4.1?] pl330: fix vmstate description

2019-07-24 Thread Philippe Mathieu-Daudé
On 7/24/19 4:35 PM, Damien Hedde wrote: > Fix the pl330 main and queue vmstate description. > There were missing POINTER flags causing crashes during > incoming migration because: > + PL330State chan field is a pointer to an array > + PL330Queue queue field is a pointer to an array > > Also bump c

Re: [Qemu-devel] qemu-iotests 069 and 111 are failing on NetBSD

2019-07-24 Thread Paolo Bonzini
On 24/07/19 11:34, Thomas Huth wrote: > In case somebody is interested, two of the "auto" iotests are failing > on NetBSD due to non-matching output: > > TESTiotest-qcow2: 069 [fail] > --- /var/tmp/qemu-test.1BMupF/tests/qemu-iotests/069.out2019-07-24 > 09:19:22.0 + > ++

Re: [Qemu-devel] [PATCH v3 2/3] qapi: implement block-dirty-bitmap-remove transaction action

2019-07-24 Thread John Snow
On 7/24/19 9:58 AM, Vladimir Sementsov-Ogievskiy wrote: > 09.07.2019 1:05, John Snow wrote: >> It is used to do transactional movement of the bitmap (which is >> possible in conjunction with merge command). Transactional bitmap >> movement is needed in scenarios with external snapshot, when we d

Re: [Qemu-devel] [PATCH v7 02/11] numa: move numa global variable nb_numa_nodes into MachineState

2019-07-24 Thread Igor Mammedov
On Wed, 24 Jul 2019 12:02:41 -0300 Eduardo Habkost wrote: > On Wed, Jul 24, 2019 at 04:27:21PM +0200, Igor Mammedov wrote: > > On Tue, 23 Jul 2019 12:23:57 -0300 > > Eduardo Habkost wrote: > > > > > On Tue, Jul 23, 2019 at 04:56:41PM +0200, Igor Mammedov wrote: > > > > On Tue, 16 Jul 2019 22:51

Re: [Qemu-devel] [PATCH v3 0/4] Introduce the microvm machine type

2019-07-24 Thread Stefano Garzarella
On Tue, Jul 23, 2019 at 1:30 PM Stefano Garzarella wrote: > > On Tue, Jul 23, 2019 at 10:47:39AM +0100, Stefan Hajnoczi wrote: > > On Tue, Jul 23, 2019 at 9:43 AM Sergio Lopez wrote: > > > Montes, Julio writes: > > > > > > > On Fri, 2019-07-19 at 16:09 +0100, Stefan Hajnoczi wrote: > > > >> O

Re: [Qemu-devel] [PATCH v7 02/11] numa: move numa global variable nb_numa_nodes into MachineState

2019-07-24 Thread Eduardo Habkost
On Wed, Jul 24, 2019 at 04:27:21PM +0200, Igor Mammedov wrote: > On Tue, 23 Jul 2019 12:23:57 -0300 > Eduardo Habkost wrote: > > > On Tue, Jul 23, 2019 at 04:56:41PM +0200, Igor Mammedov wrote: > > > On Tue, 16 Jul 2019 22:51:12 +0800 > > > Tao Xu wrote: > > > > > > > Add struct NumaState in Ma

Re: [Qemu-devel] [Qemu-ppc] [PATCH] ppc/pnv: Generate phandle for the "interrupt-parent" property

2019-07-24 Thread Amol Surati
On Wed, Jul 24, 2019 at 06:57:30PM +1000, David Gibson wrote: > On Wed, Jul 24, 2019 at 09:11:54AM +0200, Cédric Le Goater wrote: > > On 24/07/2019 05:23, David Gibson wrote: > > > On Tue, Jul 23, 2019 at 11:01:38AM +0200, Cédric Le Goater wrote: > > >> Devices such as the BT or serial devices requ

Re: [Qemu-devel] [PATCH] docs/nvdimm: add example on persistent backend setup

2019-07-24 Thread Wei Yang
On Wed, Jul 24, 2019 at 06:17:31AM -0400, Pankaj Gupta wrote: > >> >> Persistent backend setup requires some knowledge about nvdimm and ndctl >> tool. Some users report they may struggle to gather these knowledge and >> have difficulty to setup it properly. >> >> Here we provide two examples for

Re: [Qemu-devel] [PATCH for-4.2 10/24] target/arm: Update CNTVCT_EL0 for VHE

2019-07-24 Thread Alex Bennée
Richard Henderson writes: > The virtual offset may be 0 depending on EL, E2H and TGE. > > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée > --- > target/arm/helper.c | 40 +--- > 1 file changed, 37 insertions(+), 3 deletions(-) > > diff --git a

Re: [Qemu-devel] [PATCH v7 04/11] numa: move numa global variable numa_info into MachineState

2019-07-24 Thread Igor Mammedov
On Tue, 16 Jul 2019 22:51:14 +0800 Tao Xu wrote: > Move existing numa global numa_info (renamed as "nodes") into NumaState. > > Suggested-by: Igor Mammedov > Suggested-by: Eduardo Habkost > Signed-off-by: Tao Xu Reviewed-by: Igor Mammedov > --- > > No changes in v7. > > Changes in v6: >

Re: [Qemu-devel] [PATCH v2 03/14] target/arm/monitor: Introduce qmp_query_cpu_model_expansion

2019-07-24 Thread Andrew Jones
On Wed, Jul 24, 2019 at 04:25:32PM +0200, Auger Eric wrote: > > diff --git a/target/arm/monitor.c b/target/arm/monitor.c > > index 41b32b94b258..19e3120eef95 100644 > > --- a/target/arm/monitor.c > > +++ b/target/arm/monitor.c > > @@ -23,7 +23,13 @@ > > #include "qemu/osdep

Re: [Qemu-devel] [RFC PATCH] pci: Use PCI aliases when determining device IOMMU address space

2019-07-24 Thread Alex Williamson
On Wed, 24 Jul 2019 18:03:31 +0800 Peter Xu wrote: > On Wed, Jul 24, 2019 at 05:39:22AM -0400, Michael S. Tsirkin wrote: > > On Wed, Jul 24, 2019 at 03:14:39PM +0800, Peter Xu wrote: > > > On Tue, Jul 23, 2019 at 11:26:18AM -0600, Alex Williamson wrote: > > > > > On 3/29/19 11:49 AM, Alex Wil

Re: [Qemu-devel] [PATCH v4 0/3] pc: mmap kernel (ELF image) and initrd

2019-07-24 Thread Dr. David Alan Gilbert
* Stefano Garzarella (sgarz...@redhat.com) wrote: > In order to reduce the memory footprint when PVH kernel and initrd > are used, we map them into memory instead of reading them. > In this way we can share them between multiple instances of QEMU. > > v4: > - Patch 1: fix the rom_add_elf_program

Re: [Qemu-devel] [PATCH v4 0/3] pc: mmap kernel (ELF image) and initrd

2019-07-24 Thread Paolo Bonzini
On 24/07/19 16:31, Stefano Garzarella wrote: > In order to reduce the memory footprint when PVH kernel and initrd > are used, we map them into memory instead of reading them. > In this way we can share them between multiple instances of QEMU. > > v4: > - Patch 1: fix the rom_add_elf_program() co

[Qemu-devel] [PATCH for 4.1?] pl330: fix vmstate description

2019-07-24 Thread Damien Hedde
Fix the pl330 main and queue vmstate description. There were missing POINTER flags causing crashes during incoming migration because: + PL330State chan field is a pointer to an array + PL330Queue queue field is a pointer to an array Also bump corresponding vmsd version numbers. Signed-off-by: Dam

Re: [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes

2019-07-24 Thread Paolo Bonzini
On 24/07/19 10:43, Pavel Dovgalyuk wrote: > The set of patches include the latest fixes for record/replay icount function: > - fix for icount for the case when translation blocks are chained > - block operation fixes for rr mode > - development documentation update > - some refactoring > > The

[Qemu-devel] [PATCH for 4.2 0/2] target/mips: Misc patches for 4.2

2019-07-24 Thread Aleksandar Markovic
From: Aleksandar Markovic This series includes misc MIPS patches intended to be integrated after 4.1 release. Aleksandar Markovic (2): tests/tcg: target/mips: Fix target configurations for MSA tests tests/tcg: target/mips: Add optional printing of more detailed failure info tests/tcg/m

[Qemu-devel] [PATCH for 4.2 2/2] tests/tcg: target/mips: Add optional printing of more detailed failure info

2019-07-24 Thread Aleksandar Markovic
From: Aleksandar Markovic There is a need for printing input and output data for failure cases, for debugging purpose. This is achieved by this patch, and only if a preprocessor constant is manually set to 1. (Assumption is that the need for such priontout is relatively rare.) Signed-off-by: Ale

[Qemu-devel] [PATCH v4 3/3] hw/i386/pc: Map into memory the initrd

2019-07-24 Thread Stefano Garzarella
In order to reduce the memory footprint we map into memory the initrd using g_mapped_file_new() instead of reading it. In this way we can share the initrd pages between multiple instances of QEMU. Suggested-by: Paolo Bonzini Signed-off-by: Stefano Garzarella --- v3: - renamed 'GMappedFile *gmf

[Qemu-devel] [PATCH v4 1/3] loader: Handle memory-mapped ELFs

2019-07-24 Thread Stefano Garzarella
This patch allows handling an ELF memory-mapped, taking care the reference count of the GMappedFile* passed through rom_add_elf_program(). In this case, the 'data' pointer is not heap-allocated, so we cannot free it. Suggested-by: Paolo Bonzini Signed-off-by: Stefano Garzarella --- v4: - fix t

[Qemu-devel] [PATCH v4 0/3] pc: mmap kernel (ELF image) and initrd

2019-07-24 Thread Stefano Garzarella
In order to reduce the memory footprint when PVH kernel and initrd are used, we map them into memory instead of reading them. In this way we can share them between multiple instances of QEMU. v4: - Patch 1: fix the rom_add_elf_program() comment [Paolo] - Patch 2: ~ fix the missing of g_map

[Qemu-devel] [PATCH v4 2/3] elf-ops.h: Map into memory the ELF to load

2019-07-24 Thread Stefano Garzarella
In order to reduce the memory footprint we map into memory the ELF to load using g_mapped_file_new_from_fd() instead of reading each sections. In this way we can share the ELF pages between multiple instances of QEMU. Suggested-by: Dr. David Alan Gilbert Suggested-by: Paolo Bonzini Signed-off-by

Re: [Qemu-devel] [PATCH for-4.2 10/14] util/qemu-timer: refactor deadline calculation for external timers

2019-07-24 Thread Paolo Bonzini
On 24/07/19 10:44, Pavel Dovgalyuk wrote: > -int64_t qemu_clock_deadline_ns_all(QEMUClockType type) > +int64_t virtual_clock_deadline_ns(void) > { > int64_t deadline = -1; > +int64_t delta; > +int64_t expire_time; > +QEMUTimer *ts; > QEMUTimerList *timer_list; > -QEMUCloc

Re: [Qemu-devel] [PATCH v7 02/11] numa: move numa global variable nb_numa_nodes into MachineState

2019-07-24 Thread Igor Mammedov
On Tue, 23 Jul 2019 12:23:57 -0300 Eduardo Habkost wrote: > On Tue, Jul 23, 2019 at 04:56:41PM +0200, Igor Mammedov wrote: > > On Tue, 16 Jul 2019 22:51:12 +0800 > > Tao Xu wrote: > > > > > Add struct NumaState in MachineState and move existing numa global > > > nb_numa_nodes(renamed as "num_no

  1   2   3   >