[Qemu-devel] [PATCH] Changed malloc and free to g_malloc and g_free in util/compatfd.c file

2017-04-11 Thread Prerna Garg
From 9e25fdf1ea3e4f52a72bfefc053a701989b7af24 Mon Sep 17 00:00:00 2001 From: Prerna Garg Date: Wed, 12 Apr 2017 01:29:40 +0530 Subject: [PATCH 2/2] Changed malloc and free to g_malloc and g_free in util/compatfd.c Signed-off-by: Prerna Garg ---

[Qemu-devel] [PATCH v5 09/13] vfio/ccw: get irqs info and set the eventfd fd

2017-04-11 Thread Dong Jia Shi
vfio-ccw resorts to the eventfd mechanism to communicate with userspace. We fetch the irqs info via the ioctl VFIO_DEVICE_GET_IRQ_INFO, register a event notifier to get the eventfd fd which is sent to kernel via the ioctl VFIO_DEVICE_SET_IRQS, then we can implement read operation once kernel sends

[Qemu-devel] [PATCH v5 06/13] s390x/css: device support for s390-ccw passthrough

2017-04-11 Thread Dong Jia Shi
In order to support subchannels pass-through, we introduce a s390 subchannel device called "s390-ccw" to hold the real subchannel info. The s390-ccw devices inherit from the abstract CcwDevice which connect to the existing virtual-css-bus. Signed-off-by: Dong Jia Shi

Re: [Qemu-devel] [PATCH v3 0/8] pnv: improvement of LPC support and IPMI support

2017-04-11 Thread David Gibson
On Tue, Apr 11, 2017 at 05:29:58PM +0200, Cédric Le Goater wrote: > Hello, > > The first patches improve the LPC support for the POWER8NVL (nvlink) > systems and for multichip systems. Next, we add IPMI support to the > machine which is required to power off and reboot a PowerNV system. To > make

[Qemu-devel] [PATCH v5 04/13] s390x/css: realize css_sch_build_schib

2017-04-11 Thread Dong Jia Shi
From: Xiao Feng Ren The S390 virtual css support already has a mechanism to build virtual Sub-Channel Information Block and provide virtual subchannels to the guest. However, to pass-through subchannels to a guest, we need to introduce a new mechanism to build its

[Qemu-devel] [PATCH v5 03/13] s390x/css: add s390-squash-mcss machine option

2017-04-11 Thread Dong Jia Shi
From: Xiao Feng Ren We want to support real (i.e. not virtual) channel devices even for guests that do not support MCSS-E (where guests may see devices from any channel subsystem image at once). As all virtio-ccw devices are in css 0xfe (and show up in the default

[Qemu-devel] [PATCH v5 13/13] MAINTAINERS: Add vfio-ccw maintainer

2017-04-11 Thread Dong Jia Shi
Add Cornelia Huck as the vfio-ccw maintainer. Signed-off-by: Dong Jia Shi --- MAINTAINERS | 5 + 1 file changed, 5 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index c60235e..5bac5f1 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -999,6 +999,11 @@ S:

[Qemu-devel] [PATCH v5 12/13] vfio/ccw: update sense data if a unit check is pending

2017-04-11 Thread Dong Jia Shi
Concurrent-sense data is currently not delivered. This patch stores the concurrent-sense data to the subchannel if a unit check is pending and the concurrent-sense bit is enabled. Then a TSCH can retreive the right IRB data back to the guest. Signed-off-by: Dong Jia Shi

[Qemu-devel] [PATCH v5 02/13] vfio: linux-headers update for vfio-ccw

2017-04-11 Thread Dong Jia Shi
This is a placeholder for a linux-headers update. Signed-off-by: Dong Jia Shi --- linux-headers/linux/vfio.h | 17 + linux-headers/linux/vfio_ccw.h | 28 2 files changed, 45 insertions(+) create mode 100644

[Qemu-devel] [PATCH v5 11/13] s390x/css: ccw translation infrastructure

2017-04-11 Thread Dong Jia Shi
From: Xiao Feng Ren Implement a basic infrastructure of handling channel I/O instruction interception for passed through subchannels: 1. Branch the code path of instruction interception handling by SubChannel type. 2. For a passed-through subchannel, issue the ORB

[Qemu-devel] [PATCH v5 08/13] vfio/ccw: get io region info

2017-04-11 Thread Dong Jia Shi
vfio-ccw provides an MMIO region for I/O operations. We fetch its information via ioctls here, then we can use it performing I/O instructions and retrieving I/O results later on. Signed-off-by: Dong Jia Shi --- hw/vfio/ccw.c | 52

[Qemu-devel] [PATCH v5 00/13] basic channel IO passthrough infrastructure based on vfio

2017-04-11 Thread Dong Jia Shi
The patch series introduce a basic channel I/O passthrough infrastructure based on vfio. - Focus on supporting dasd-eckd(cu_type/dev_type = 0x3990/0x3390) as the target device. - Support new qemu parameters in the style of: -machine s390-ccw-virtio(,s390-squash-mcss=on|off) \ -device

[Qemu-devel] [PATCH v5 07/13] vfio/ccw: vfio based subchannel passthrough driver

2017-04-11 Thread Dong Jia Shi
From: Xiao Feng Ren We use the IOMMU_TYPE1 of VFIO to realize the subchannels passthrough, implement a vfio based subchannels passthrough driver called "vfio-ccw". Support qemu parameters in the style of: "-device vfio-ccw,sysfsdev=$mdev_file_path,devno=xx.x.'

[Qemu-devel] [PATCH v5 10/13] s390x/css: introduce and realize ccw-request callback

2017-04-11 Thread Dong Jia Shi
From: Xiao Feng Ren Introduce a new callback on subchannel to handle ccw-request. Realize the callback in vfio-ccw device. Besides, resort to the event notifier handler to handling the ccw-request results. 1. Pread the I/O results via MMIO region. 2. Update the scsw

[Qemu-devel] [PATCH v5 01/13] update-linux-headers: update for vfio-ccw

2017-04-11 Thread Dong Jia Shi
Add vfio_ccw.h. Signed-off-by: Dong Jia Shi --- scripts/update-linux-headers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh index 6a370a8..2f906c4 100755 ---

[Qemu-devel] [PATCH v5 05/13] s390x/css: realize css_create_sch

2017-04-11 Thread Dong Jia Shi
The S390 virtual css support already has a mechanism to create a virtual subchannel and provide it to the guest. However, to pass-through subchannels to a guest, we need to introduce a new mechanism to create the subchannel according to the real device information. Thus we reconstruct

Re: [Qemu-devel] [PATCH 10/10] tb-hash: improve tb_jmp_cache hash function in user mode

2017-04-11 Thread Emilio G. Cota
On Wed, Apr 12, 2017 at 11:46:47 +0800, Paolo Bonzini wrote: > > > On 12/04/2017 09:17, Emilio G. Cota wrote: > > + > > +/* In user-mode we can get better hashing because we do not have a TLB */ > > +static inline unsigned int tb_jmp_cache_hash_func(target_ulong pc) > > +{ > > +return (pc ^

Re: [Qemu-devel] [PATCH v4 09/13] qobject: Use simpler QDict/QList scalar insertion macros

2017-04-11 Thread Philippe Mathieu-Daudé
On 04/11/2017 03:50 PM, Eric Blake wrote: We now have macros in place to make it less verbose to add a scalar to QDict and QList, so use them. To make this patch smaller to review, a couple of subdirectories were done in earlier patches. Patch created mechanically via: spatch --sp-file

Re: [Qemu-devel] [PATCH 10/10] tb-hash: improve tb_jmp_cache hash function in user mode

2017-04-11 Thread Paolo Bonzini
On 12/04/2017 09:17, Emilio G. Cota wrote: > + > +/* In user-mode we can get better hashing because we do not have a TLB */ > +static inline unsigned int tb_jmp_cache_hash_func(target_ulong pc) > +{ > +return (pc ^ (pc >> TB_JMP_CACHE_BITS)) & (TB_JMP_CACHE_SIZE - 1); > +} What about

Re: [Qemu-devel] [PATCH 09/10] target/i386: optimize indirect branches with TCG's jr op

2017-04-11 Thread Paolo Bonzini
On 12/04/2017 09:17, Emilio G. Cota wrote: > > The fact that NBench is not very sensitive to changes here is a > little surprising, especially given the significant improvements for > ARM shown in the previous commit. I wonder whether the compiler is doing > a better job compiling the x86_64

Re: [Qemu-devel] [PATCH] Main loop: Register a specific IO port to monitor guest linux os crash event

2017-04-11 Thread Paolo Bonzini
On 12/04/2017 10:59, Huang Yong wrote: > When guest os crash, there is no way to notify qemu on the host quickly > (within 1s), and it is > not convenient for libvirt management. We suggest to register a IO port (with > specific addr) when > qemu process be launched, on the other hand, a linux

Re: [Qemu-devel] [PATCH v4 11/13] QemuOpts: Simplify qemu_opts_to_qdict()

2017-04-11 Thread Philippe Mathieu-Daudé
On 04/11/2017 03:50 PM, Eric Blake wrote: Noticed while investigating Coccinelle cleanups. There is no need for a temporary variable when we can use the new macro to do the same thing with less typing. Signed-off-by: Eric Blake Reviewed-by: Philippe Mathieu-Daudé

Re: [Qemu-devel] [PATCH v4 08/13] tests: Use simpler QDict/QList scalar insertion macros

2017-04-11 Thread Philippe Mathieu-Daudé
On 04/11/2017 03:50 PM, Eric Blake wrote: We now have macros in place to make it less verbose to add a scalar to QDict and QList, so use them. Patch created mechanically via: spatch --sp-file scripts/coccinelle/qobject.cocci \ --macro-file scripts/cocci-macro-file.h --dir tests --in-place

[Qemu-devel] [PATCH] Main loop: Register a specific IO port to monitor guest linux os crash event

2017-04-11 Thread Huang Yong
When guest os crash, there is no way to notify qemu on the host quickly (within 1s), and it is not convenient for libvirt management. We suggest to register a IO port (with specific addr) when qemu process be launched, on the other hand, a linux module which is comprised of kprobe hooks will be

Re: [Qemu-devel] [PATCH v4] migration/block: use blk_pwrite_zeroes for each zero cluster

2017-04-11 Thread 858585 jemmy
On Wed, Apr 12, 2017 at 9:27 AM, 858585 jemmy wrote: > On Tue, Apr 11, 2017 at 11:59 PM, Stefan Hajnoczi wrote: >> On Tue, Apr 11, 2017 at 08:05:12PM +0800, jemmy858...@gmail.com wrote: >>> From: Lidong Chen >>> >>> BLOCK_SIZE

Re: [Qemu-devel] [PATCH v4] migration/block: use blk_pwrite_zeroes for each zero cluster

2017-04-11 Thread 858585 jemmy
On Tue, Apr 11, 2017 at 11:59 PM, Stefan Hajnoczi wrote: > On Tue, Apr 11, 2017 at 08:05:12PM +0800, jemmy858...@gmail.com wrote: >> From: Lidong Chen >> >> BLOCK_SIZE is (1 << 20), qcow2 cluster size is 65536 by default, >> this maybe cause the qcow2

[Qemu-devel] [PATCH 10/10] tb-hash: improve tb_jmp_cache hash function in user mode

2017-04-11 Thread Emilio G. Cota
Optimizations to cross-page chaining and indirect jumps make performance more sensitive to the hit rate of tb_jmp_cache. The constraint of reserving some bits for the page number lowers the achievable quality of the hashing function. However, user-mode does not have this requirement. Thus, with

[Qemu-devel] [PATCH 00/10] TCG optimizations for 2.10

2017-04-11 Thread Emilio G. Cota
Hi all, This series is aimed at 2.10 or beyond. Its goal is to improve TCG performance by optimizing: 1- Cross-page direct jumps (softmmu only, obviously). Patches 1-4. 2- Indirect branches (softmmu and user-mode). Patches 5-9. 3- tb_jmp_cache hashing in user-mode. Patch 10. I decided to work

[Qemu-devel] [PATCH 09/10] target/i386: optimize indirect branches with TCG's jr op

2017-04-11 Thread Emilio G. Cota
Speed up indirect branches by adding a helper to look for the TB in tb_jmp_cache. The helper returns either the corresponding host address or NULL. Measurements: - NBench, x86_64-linux-user. Host: Intel i7-4790K @ 4.00GHz Y axis: Speedup over 95b31d70

[Qemu-devel] [PATCH 06/10] tcg: add brcondi_ptr

2017-04-11 Thread Emilio G. Cota
This will be used by TCG targets to implement a fast path for indirect branches. Signed-off-by: Emilio G. Cota --- tcg/tcg-op.h | 4 1 file changed, 4 insertions(+) diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h index 1924633..abf784b 100644 --- a/tcg/tcg-op.h +++ b/tcg/tcg-op.h

[Qemu-devel] [PATCH 04/10] target/i386: optimize cross-page block chaining in softmmu

2017-04-11 Thread Emilio G. Cota
Instead of unconditionally exiting to the exec loop, add a helper to check whether the target TB is valid. As long as the hit rate in tb_jmp_cache remains high, this improves performance. Measurements: - specINT 2006 (test set), x86_64-softmmu. Host: Intel i7-4790K @ 4.00GHz

[Qemu-devel] [PATCH 02/10] exec-all: inline tb_from_jmp_cache

2017-04-11 Thread Emilio G. Cota
The inline improves performance, as shown in subsequent commits' logs. This commit is kept separate to ease review, since the inclusion of tb-hash.h might be controversial. The problem here, which was introduced before this commit, is that tb_hash_func() depends on page_addr_t: this defeats the

[Qemu-devel] [PATCH 05/10] tcg: add jr opcode

2017-04-11 Thread Emilio G. Cota
This will be used by TCG targets to implement a fast path for indirect branches. I only have implemented and tested this on an i386 host, so make this opcode optional and mark it as not implemented by other TCG backends. Signed-off-by: Emilio G. Cota ---

[Qemu-devel] [PATCH 03/10] target/arm: optimize cross-page block chaining in softmmu

2017-04-11 Thread Emilio G. Cota
Instead of unconditionally exiting to the exec loop, add a helper to check whether the target TB is valid. As long as the hit rate in tb_jmp_cache remains high, this improves performance. Measurements: - Boot time of ARM debian jessie on Intel host: | setup | ARM debian

[Qemu-devel] [PATCH 07/10] tcg: add tcg_temp_local_new_ptr

2017-04-11 Thread Emilio G. Cota
This will be used by TCG targets to implement a fast path for indirect branches. Signed-off-by: Emilio G. Cota --- tcg/tcg.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tcg/tcg.h b/tcg/tcg.h index 6c216bb..37a7c8e 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -912,6 +912,7

[Qemu-devel] [PATCH 01/10] exec-all: add tb_from_jmp_cache

2017-04-11 Thread Emilio G. Cota
This paves the way for upcoming changes. Signed-off-by: Emilio G. Cota --- cpu-exec.c | 19 +++ include/exec/exec-all.h | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/cpu-exec.c b/cpu-exec.c index 748cb66..ce9750a 100644 ---

[Qemu-devel] [PATCH 08/10] target/arm: optimize indirect branches with TCG's jr op

2017-04-11 Thread Emilio G. Cota
Speed up indirect branches by adding a helper to look for the TB in tb_jmp_cache. The helper returns either the corresponding host address or NULL. Measurements: - Impact on Boot time | setup | ARM debian boot+shutdown time | stddev | |-+---+| |

[Qemu-devel] [PATCH v3 1/5] cadence_gem: Read the correct queue descriptor

2017-04-11 Thread Alistair Francis
Read the correct descriptor instead of hardcoding the first (q=0). Signed-off-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell --- hw/net/cadence_gem.c | 4 ++-- 1 file changed, 2

[Qemu-devel] [PATCH v3 3/5] cadence_gem: Correct the interupt logic

2017-04-11 Thread Alistair Francis
This patch fixes two mistakes in the interrupt logic. First we only trigger single-queue or multi-queue interrupts if the status register is set. This logic was already used for non multi-queue interrupts but it also applies to multi-queue interrupts. Secondly we need to lower the interrupts if

[Qemu-devel] [PATCH 16/17] block: Make bdrv_is_allocated() byte-based

2017-04-11 Thread Eric Blake
We are gradually moving away from sector-based interfaces, towards byte-based. In the common case, allocation is unlikely to ever use values that are not naturally sector-aligned, but it is possible that byte-based values will let us be more precise about allocation at the end of an unaligned

[Qemu-devel] [PATCH 13/17] backup: Switch block_backup.h to byte-based

2017-04-11 Thread Eric Blake
We are gradually converting to byte-based interfaces, as they are easier to reason about than sector-based. Continue by converting the public interface to backup jobs (no semantic change), including a change to CowRequest to track by bytes instead of cluster indices. Signed-off-by: Eric Blake

[Qemu-devel] [PATCH 14/17] backup: Switch backup_do_cow() to byte-based

2017-04-11 Thread Eric Blake
We are gradually converting to byte-based interfaces, as they are easier to reason about than sector-based. Convert another internal function (no semantic change). Signed-off-by: Eric Blake --- block/backup.c | 62 -- 1

[Qemu-devel] [PATCH v3 5/5] xlnx-zynqmp: Set the Cadence GEM revision

2017-04-11 Thread Alistair Francis
Signed-off-by: Alistair Francis Reviewed-by: Peter Maydell --- hw/arm/xlnx-zynqmp.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c index bc4e66b..e41b6fe 100644 ---

[Qemu-devel] [PATCH 15/17] backup: Switch backup_run() to byte-based

2017-04-11 Thread Eric Blake
We are gradually converting to byte-based interfaces, as they are easier to reason about than sector-based. Change the internal loop iteration of backups to track by bytes instead of sectors (although we are still guaranteed that we iterate by steps that are cluster-aligned). Signed-off-by: Eric

[Qemu-devel] [PATCH v3 4/5] cadence_gem: Make the revision a property

2017-04-11 Thread Alistair Francis
Expose the Cadence GEM revision as a property. Signed-off-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell --- hw/net/cadence_gem.c | 6 +- include/hw/net/cadence_gem.h | 1

[Qemu-devel] [PATCH v3 2/5] cadence_gem: Correct the multi-queue can rx logic

2017-04-11 Thread Alistair Francis
Correct the buffer descriptor busy logic to work correctly when using multiple queues. Signed-off-by: Alistair Francis --- hw/net/cadence_gem.c | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/hw/net/cadence_gem.c

[Qemu-devel] [PATCH v3 0/5] Improve the Cadence GEM multi-queue support

2017-04-11 Thread Alistair Francis
Improve the Cadence GEM multi-queue support. This fixes a few bugs which were hanging around from the initial implementation. V3: - Remove unessecary call of gem_update_int_status() V2: - Fix up the interrupt updating logic and consolidate all the updates to a single function. - Improve the

[Qemu-devel] [PATCH 12/17] backup: Switch BackupBlockJob to byte-based

2017-04-11 Thread Eric Blake
We are gradually converting to byte-based interfaces, as they are easier to reason about than sector-based. Continue by converting an internal structure (no semantic change), and all references to tracking progress. Drop a redundant local variable bytes_per_cluster. Signed-off-by: Eric Blake

Re: [Qemu-devel] [RFC/BUG] xen-mapcache: buggy invalidate map cache?

2017-04-11 Thread Stefano Stabellini
On Tue, 11 Apr 2017, hrg wrote: > On Tue, Apr 11, 2017 at 3:50 AM, Stefano Stabellini > wrote: > > On Mon, 10 Apr 2017, Stefano Stabellini wrote: > >> On Mon, 10 Apr 2017, hrg wrote: > >> > On Sun, Apr 9, 2017 at 11:55 PM, hrg wrote: > >> > > On Sun,

[Qemu-devel] [PATCH 07/17] mirror: Switch MirrorBlockJob to byte-based

2017-04-11 Thread Eric Blake
We are gradually converting to byte-based interfaces, as they are easier to reason about than sector-based. Continue by converting an internal structure (no semantic change), and all references to the buffer size. [checkpatch has a false positive on use of MIN() in this patch] Signed-off-by:

[Qemu-devel] [PATCH 06/17] commit: Switch commit_run() to byte-based

2017-04-11 Thread Eric Blake
We are gradually converting to byte-based interfaces, as they are easier to reason about than sector-based. Change the internal loop iteration of committing to track by bytes instead of sectors (although we are still guaranteed that we iterate by steps that are sector-aligned). Signed-off-by:

[Qemu-devel] [PATCH 11/17] mirror: Switch mirror_iteration() to byte-based

2017-04-11 Thread Eric Blake
We are gradually converting to byte-based interfaces, as they are easier to reason about than sector-based. Change the internal loop iteration of mirroring to track by bytes instead of sectors (although we are still guaranteed that we iterate by steps that are both sector-aligned and multiples of

[Qemu-devel] [PATCH 08/17] mirror: Switch mirror_do_zero_or_discard() to byte-based

2017-04-11 Thread Eric Blake
We are gradually converting to byte-based interfaces, as they are easier to reason about than sector-based. Convert another internal function (no semantic change). Signed-off-by: Eric Blake --- block/mirror.c | 20 +++- 1 file changed, 11 insertions(+), 9

[Qemu-devel] [PATCH 02/17] trace: Show blockjob actions via bytes, not sectors

2017-04-11 Thread Eric Blake
Upcoming patches are going to switch to byte-based interfaces instead of sector-based. Even worse, trace_backup_do_cow_enter() had a weird mix of cluster and sector indices. Make the tracing uniformly use bytes. Signed-off-by: Eric Blake --- block/backup.c | 16

[Qemu-devel] [PATCH 09/17] mirror: Switch mirror_cow_align() to byte-based

2017-04-11 Thread Eric Blake
We are gradually converting to byte-based interfaces, as they are easier to reason about than sector-based. Convert another internal function (no semantic change), and add mirror_clip_bytes() as a counterpart to mirror_clip_sectors(). Some of the conversion is a bit tricky, requiring temporaries

[Qemu-devel] [PATCH 17/17] block: Make bdrv_is_allocated_above() byte-based

2017-04-11 Thread Eric Blake
We are gradually moving away from sector-based interfaces, towards byte-based. In the common case, allocation is unlikely to ever use values that are not naturally sector-aligned, but it is possible that byte-based values will let us be more precise about allocation at the end of an unaligned

[Qemu-devel] [PATCH 04/17] stream: Switch stream_run() to byte-based

2017-04-11 Thread Eric Blake
We are gradually converting to byte-based interfaces, as they are easier to reason about than sector-based. Change the internal loop iteration of streaming to track by bytes instead of sectors (although we are still guaranteed that we iterate by steps that are sector-aligned). Signed-off-by:

[Qemu-devel] [PATCH 00/17] make bdrv_is_allocated[_above] byte-based

2017-04-11 Thread Eric Blake
There are patches floating around to add NBD_CMD_BLOCK_STATUS, but NBD wants to report status on byte granularity (even if the reporting will probably be naturally aligned to sectors or even much higher levels). I've therefore started the task of converting our block status code to report at a

[Qemu-devel] [PATCH 05/17] commit: Switch commit_populate() to byte-based

2017-04-11 Thread Eric Blake
We are gradually converting to byte-based interfaces, as they are easier to reason about than sector-based. Start by converting an internal function (no semantic change). Signed-off-by: Eric Blake --- block/commit.c | 15 --- 1 file changed, 8 insertions(+), 7

[Qemu-devel] [PATCH 10/17] mirror: Switch mirror_do_read() to byte-based

2017-04-11 Thread Eric Blake
We are gradually converting to byte-based interfaces, as they are easier to reason about than sector-based. Convert another internal function (no semantic change). Signed-off-by: Eric Blake --- block/mirror.c | 75 ++ 1

[Qemu-devel] [PATCH 01/17] blockjob: Track job ratelimits via bytes, not sectors

2017-04-11 Thread Eric Blake
The user interface specifies job rate limits in bytes/second. It's pointless to have our internal representation track things in sectors/second, particularly since we want to move away from sector-based interfaces. Fix up a doc typo found while verifying that the ratelimit code handles the

[Qemu-devel] [PATCH 03/17] stream: Switch stream_populate() to byte-based

2017-04-11 Thread Eric Blake
We are gradually converting to byte-based interfaces, as they are easier to reason about than sector-based. Start by converting an internal function (no semantic change). Signed-off-by: Eric Blake --- block/stream.c | 11 ++- 1 file changed, 6 insertions(+), 5

Re: [Qemu-devel] [Bug 1681439] Re: qemu-system-x86_64: hw/ide/core.c:685: ide_cancel_dma_sync: Assertion `s->bus->dma->aiocb == NULL' failed.

2017-04-11 Thread John Snow
On 04/11/2017 03:45 AM, Michał Kępień wrote: >> I don't think the assert you are talking about in the subject is added >> by 9972354856. That assertion was added by 86698a12f and has been >> present since QEMU 2.6. I don't see the relation immediately to >> AioContext patches. > > You are right,

[Qemu-devel] [PATCH v9.5 07/13] fixup! qcow2: Discard/zero clusters by byte count

2017-04-11 Thread Eric Blake
Squash this to keep iotest 154 happy. Signed-off-by: Eric Blake --- v9.5: fixup v9: rebase to earlier changes, drop R-b v7, v8: only earlier half of series submitted for 2.9 v6: rebase due to context v5: s/count/byte/ to make the units obvious, and rework the math to ensure

Re: [Qemu-devel] [PATCH v9 07/13] qcow2: Discard/zero clusters by byte count

2017-04-11 Thread Eric Blake
On 04/10/2017 08:17 PM, Eric Blake wrote: > Passing a byte offset, but sector count, when we ultimately > want to operate on cluster granularity, is madness. Clean up > the external interfaces to take both offset and count as bytes, > while still keeping the assertion added previously that the >

Re: [Qemu-devel] [PATCH] Changed malloc and free to g_malloc and g_free in util/envlist.c

2017-04-11 Thread Eric Blake
On 04/11/2017 04:30 PM, Eric Blake wrote: > You're also missing a category, and patches should generally favor > imperative tense (think "[apply this patch to] do this") rather than > past tense ("[this patch] did this"). Also, you want the subject line > to be a short how; the commit body can

Re: [Qemu-devel] [PATCH] Changed malloc and free to g_malloc and g_free in util/envlist.c

2017-04-11 Thread Eric Blake
On 04/11/2017 03:41 PM, Prerna Garg wrote: > [Nothing - it was all in the attachment] > 0003-Changed-malloc-and-free-to-g_malloc-and-g_free-respe.patch > While attachments are probably okay for a one-shot contribution, if your intent is to become an active contributor for Outreachy, you'll

[Qemu-devel] [PATCH] Changed malloc and free to g_malloc and g_free in util/envlist.c

2017-04-11 Thread Prerna Garg
From f3ee3cf9b69aca86c78ec26468a0b4533744cdad Mon Sep 17 00:00:00 2001 From: Prerna Garg Date: Wed, 12 Apr 2017 02:04:36 +0530 Subject: [PATCH 3/3] Changed malloc and free to g_malloc and g_free respectively in util/envlist.c file Signed-off-by: Prerna Garg

[Qemu-devel] vmbus bridge: machine property or device?

2017-04-11 Thread Roman Kagan
While hammering out the VMBus / storage series, we've been struggling to figure out the best practices solution to the following problem: VMBus is provided by a vmbus bridge; it appears the most natural to have it subclassed from SysBusDevice. There can only be one VMBus in the VM. Now the

Re: [Qemu-devel] [PATCH v4 12/13] fdc-test: Avoid deprecated 'change' command

2017-04-11 Thread John Snow
On 04/11/2017 02:50 PM, Eric Blake wrote: > Use the preferred blockdev-change-medium command instead. > > Also, use of 'device' is deprecated; adding an explicit id on > the command line lets us use 'id' for both blockdev-change-medium > and eject. > > Signed-off-by: Eric Blake

Re: [Qemu-devel] [PATCH v11 1/2] block/vxhs.c: Add support for a new block device type called "vxhs"

2017-04-11 Thread Jeff Cody
On Mon, Apr 03, 2017 at 08:48:08PM -0700, Ashish Mittal wrote: > Source code for the qnio library that this code loads can be downloaded from: > https://github.com/VeritasHyperScale/libqnio.git > > Sample command line using JSON syntax: > ./x86_64-softmmu/qemu-system-x86_64 -name

[Qemu-devel] [ANNOUNCE] QEMU 2.9.0-rc4 is now available

2017-04-11 Thread Michael Roth
Hello, On behalf of the QEMU Team, I'd like to announce the availability of the fifth release candidate for the QEMU 2.9 release. This release is meant for testing purposes and should not be used in a production environment. http://download.qemu-project.org/qemu-2.9.0-rc4.tar.xz

[Qemu-devel] [PATCH v4 10/13] block: Simplify bdrv_append_temp_snapshot() logic

2017-04-11 Thread Eric Blake
Noticed while checking Coccinelle results. Naming a label 'out:' when it is only used on error paths is weird. Also, we had some dead stores to 'ret'. Meanwhile we know that snapshot_options is NULL on success and that QDECREF(NULL) is safe. So merge the two exit paths into one by careful

[Qemu-devel] [PATCH v4 11/13] QemuOpts: Simplify qemu_opts_to_qdict()

2017-04-11 Thread Eric Blake
Noticed while investigating Coccinelle cleanups. There is no need for a temporary variable when we can use the new macro to do the same thing with less typing. Signed-off-by: Eric Blake --- util/qemu-option.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff

[Qemu-devel] [PATCH v4 08/13] tests: Use simpler QDict/QList scalar insertion macros

2017-04-11 Thread Eric Blake
We now have macros in place to make it less verbose to add a scalar to QDict and QList, so use them. Patch created mechanically via: spatch --sp-file scripts/coccinelle/qobject.cocci \ --macro-file scripts/cocci-macro-file.h --dir tests --in-place then manually checked that no touch-ups

[Qemu-devel] [PATCH v4 12/13] fdc-test: Avoid deprecated 'change' command

2017-04-11 Thread Eric Blake
Use the preferred blockdev-change-medium command instead. Also, use of 'device' is deprecated; adding an explicit id on the command line lets us use 'id' for both blockdev-change-medium and eject. Signed-off-by: Eric Blake --- v4: use 'id' rather than 'device' [thanks to

[Qemu-devel] [PATCH v4 13/13] test-qga: Actually test 0xff sync bytes

2017-04-11 Thread Eric Blake
Commit 62c39b3 introduced test-qga, and at face value, appears to be testing the 'guest-sync' behavior that is recommended for guests in sending 0xff to QGA to force the parser to reset. But this aspect of the test has never actually done anything: the qmp_fd() call chain converts its string

[Qemu-devel] [PATCH v4 05/13] qobject: Drop useless QObject casts

2017-04-11 Thread Eric Blake
We have macros in place to make it less verbose to add a subtype of QObject to both QDict and QList. While we have made cleanups like this in the past (see commit fcfcd8ffc, for example), having it be automated by Coccinelle makes it easier to maintain. Patch created mechanically via: spatch

[Qemu-devel] [PATCH v4 07/13] block: Use simpler QDict/QList scalar insertion macros

2017-04-11 Thread Eric Blake
We now have macros in place to make it less verbose to add a scalar to QDict and QList, so use them. Patch created mechanically via: spatch --sp-file scripts/coccinelle/qobject.cocci \ --macro-file scripts/cocci-macro-file.h --dir block --in-place then touched up manually to fix a couple of

[Qemu-devel] [PATCH v4 09/13] qobject: Use simpler QDict/QList scalar insertion macros

2017-04-11 Thread Eric Blake
We now have macros in place to make it less verbose to add a scalar to QDict and QList, so use them. To make this patch smaller to review, a couple of subdirectories were done in earlier patches. Patch created mechanically via: spatch --sp-file scripts/coccinelle/qobject.cocci \

[Qemu-devel] [PATCH v4 06/13] qobject: Add helper macros for common scalar insertions

2017-04-11 Thread Eric Blake
Rather than making lots of callers wrap a scalar in a QInt, QString, or QBool, provide helper macros that do the wrapping automatically. Update the Coccinelle script to make mass conversions easy, although the conversion itself will be done as a separate patches to ease review and backport

[Qemu-devel] [PATCH v4 04/13] coccinelle: Add script to remove useless QObject casts

2017-04-11 Thread Eric Blake
We have macros in place to make it less verbose to add a subtype of QObject to both QDict and QList. While we have made cleanups like this in the past (see commit fcfcd8ffc, for example), having it be automated by Coccinelle makes it easier to maintain. The script is separate from the cleanups,

[Qemu-devel] [PATCH v4 03/13] s390x: Drop useless casts

2017-04-11 Thread Eric Blake
An upcoming Coccinelle cleanup script wanted to reformat the casts present in this file - but on closer look, we don't need the casts at all because C automatically converts void* to any other pointer. Signed-off-by: Eric Blake Acked-by: Cornelia Huck

[Qemu-devel] [PATCH v4 02/13] pci: Reduce scope of error injection

2017-04-11 Thread Eric Blake
No one outside of pcie_aer.h was using error injection; mark them static for internal use. Signed-off-by: Eric Blake Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Michael S. Tsirkin Reviewed-by: Marcel Apfelbaum ---

[Qemu-devel] [PATCH v4 01/13] pci: Use struct instead of QDict to pass back parameters

2017-04-11 Thread Eric Blake
It's simpler to just use a C struct than it is to bundle things into a QDict in one function just to pull them back out in the caller. Plus, doing this gets rid of one more user of dynamic JSON through qobject_from_jsonf(), as well as a memory leak of the QDict. While cleaning the code, fix

[Qemu-devel] [PATCH v4 00/13] qapi-related cleanups

2017-04-11 Thread Eric Blake
This is a subset of my earlier post "Rip out dynamic JSON parsing"[1], and then a rebase of that work onto master. It is available here: git fetch git://repo.or.cz/qemu/ericb.git qapi-dynamic-json-v4 the tag name is a bit of a misnomer for the current series, but is historically accurate.

Re: [Qemu-devel] [PATCH v6] kvm: better MWAIT emulation for guests

2017-04-11 Thread Alexander Graf
> Am 11.04.2017 um 19:10 schrieb Jim Mattson : > > This might be more useful if it could be dynamically toggled on and > off, depending on system load. What would trapping mwait (currently) buy you? As it stands today, before this patch, mwait is simply implemented as a

Re: [Qemu-devel] [PATCH v3 09/13] qobject: Use simpler QDict/QList scalar insertion macros

2017-04-11 Thread Eric Blake
On 04/11/2017 12:12 PM, Markus Armbruster wrote: > Eric Blake writes: > >> We now have macros in place to make it less verbose to add a scalar >> to QDict and QList, so use them. To make this patch smaller to >> review, a couple of subdirectories were done in earlier patches.

Re: [Qemu-devel] [PATCH v3 06/13] qobject: Add helper macros for common scalar insertions

2017-04-11 Thread Eric Blake
On 04/11/2017 12:06 PM, Markus Armbruster wrote: > Eric Blake writes: > >> Rather than making lots of callers wrap a scalar in a QInt, QString, >> or QBool, provide helper macros that do the wrapping automatically. >> >> Update the Coccinelle script to make mass conversions

Re: [Qemu-devel] [PATCH 2/2] virtio-rng: stop virtqueue while the CPU is stopped

2017-04-11 Thread Laurent Vivier
On 11/04/2017 19:02, Stefan Hajnoczi wrote: > On Tue, Apr 11, 2017 at 03:17:33PM +0200, Laurent Vivier wrote: >> diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c >> index 9639f4e..d270d56 100644 >> --- a/hw/virtio/virtio-rng.c >> +++ b/hw/virtio/virtio-rng.c >> @@ -53,6 +53,15 @@

Re: [Qemu-devel] [PATCH for-2.9?] qga-win: Enable 'can-offline' field in 'guest-get-vcpus' reply

2017-04-11 Thread Michael Roth
Quoting Eric Blake (2017-04-11 08:25:06) > On 04/11/2017 07:52 AM, Sameeh Jubran wrote: > > The QGA schema states: > > > > @can-offline: Whether offlining the VCPU is possible. This member > >is always filled in by the guest agent when the structure > >is returned,

Re: [Qemu-devel] [PATCH v3 00/13] qapi-related cleanups

2017-04-11 Thread Markus Armbruster
Eric Blake writes: > This is a subset of my earlier post "Rip out dynamic JSON parsing"[1], > and then a rebase of that work onto master. It is available here: > > git fetch git://repo.or.cz/qemu/ericb.git qapi-dynamic-json-v3 > > the tag name is a bit of a misnomer for the

Re: [Qemu-devel] [PATCH v6] kvm: better MWAIT emulation for guests

2017-04-11 Thread Jim Mattson via Qemu-devel
This might be more useful if it could be dynamically toggled on and off, depending on system load. On Tue, Apr 11, 2017 at 4:45 AM, Alexander Graf wrote: > From: "Michael S. Tsirkin" > > Guests that are heavy on futexes end up IPI'ing each other a lot. That > can

Re: [Qemu-devel] [PATCH v3 09/13] qobject: Use simpler QDict/QList scalar insertion macros

2017-04-11 Thread Markus Armbruster
Eric Blake writes: > We now have macros in place to make it less verbose to add a scalar > to QDict and QList, so use them. To make this patch smaller to > review, a couple of subdirectories were done in earlier patches. > > Patch created mechanically via: > spatch

Re: [Qemu-devel] [PATCH v3 06/13] qobject: Add helper macros for common scalar insertions

2017-04-11 Thread Markus Armbruster
Eric Blake writes: > Rather than making lots of callers wrap a scalar in a QInt, QString, > or QBool, provide helper macros that do the wrapping automatically. > > Update the Coccinelle script to make mass conversions easy, although > the conversion itself will be done as a

Re: [Qemu-devel] [PATCH 2/2] virtio-rng: stop virtqueue while the CPU is stopped

2017-04-11 Thread Stefan Hajnoczi
On Tue, Apr 11, 2017 at 03:17:33PM +0200, Laurent Vivier wrote: > diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c > index 9639f4e..d270d56 100644 > --- a/hw/virtio/virtio-rng.c > +++ b/hw/virtio/virtio-rng.c > @@ -53,6 +53,15 @@ static void chr_read(void *opaque, const void *buf,

Re: [Qemu-devel] [Qemu-ppc] [PATCH 21/21] ppc/pnv: Create a default PCI layout

2017-04-11 Thread Cédric Le Goater
On 04/11/2017 01:10 PM, Andrea Bolognani wrote: > On Wed, 2017-04-05 at 14:41 +0200, Cédric Le Goater wrote: >> From: Benjamin Herrenschmidt >> >> This creates a legacy PCIe->PCI bridge under the PHB by default to which >> a bunch of standard devices are attached.

[Qemu-devel] Fw: First contribution - Interested in Outreachy

2017-04-11 Thread Prerna Garg
From: Prerna Garg Sent: Tuesday, April 11, 2017 9:57 PM To: Kevin Wolf Subject: Re: First contribution - Interested in Outreachy Hello, I am having difficulties sending the email through command line. So as a last resort I am sending the patch as an

Re: [Qemu-devel] First contribution - Interested in Outreachy

2017-04-11 Thread Prerna Garg
Hello, The previous patch was incorrect. Sorry for the inconvenience. Please consider this as my first contribution. diff --git a/block/iscsi.c b/block/iscsi.c index 716e74a..b926ed4 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -1034,7 +1034,7 @@ static BlockAIOCB

Re: [Qemu-devel] [PATCH 20/21] ppc/pnv: Add model for Power8 PHB3 PCIe Host bridge

2017-04-11 Thread Cédric Le Goater
On 04/10/2017 10:14 AM, David Gibson wrote: > +/* Copyright (c) 2013-2017, IBM Corporation. > + * > + * Licensed under the Apache License, Version 2.0 (the "License"); > + * you may not use this file except in compliance with the License. > + * You may obtain a copy of the License at > + * > + *

  1   2   3   >