Re: [Qemu-devel] [RFC PATCH] vring: calculate descriptor address directly

2014-11-28 Thread Peter Lieven
Am 27.11.2014 um 17:49 schrieb Paolo Bonzini: On 27/11/2014 11:15, Peter Lieven wrote: vring_map causes a huge overhead by calling memory_region_find everytime. the vring_map is executed already on vring_setup and there is also the memory region referenced. Signed-off-by: Peter Lieven

Re: [Qemu-devel] [RFC PATCH 2/3] raw-posix: Convert Linux AIO submission to coroutines

2014-11-28 Thread Ming Lei
On 11/28/14, Markus Armbruster arm...@redhat.com wrote: Ming Lei ming@canonical.com writes: Hi Kevin, On Wed, Nov 26, 2014 at 10:46 PM, Kevin Wolf kw...@redhat.com wrote: This improves the performance of requests because an ACB doesn't need to be allocated on the heap any more. It also

Re: [Qemu-devel] [RFC PATCH 3/3] qemu-coroutine: use a ring per thread for the pool

2014-11-28 Thread Peter Lieven
Am 27.11.2014 um 17:40 schrieb Paolo Bonzini: On 27/11/2014 11:27, Peter Lieven wrote: +static __thread struct CoRoutinePool { +Coroutine *ptrs[POOL_MAX_SIZE]; +unsigned int size; +unsigned int nextfree; +} CoPool; The per-thread ring unfortunately didn't work well last time

Re: [Qemu-devel] [PATCH v2 1/6] geometry: add bdrv functions for geometry and blocksize

2014-11-28 Thread Markus Armbruster
Ekaterina Tumanova tuman...@linux.vnet.ibm.com writes: On 11/27/2014 05:55 PM, Markus Armbruster wrote: I'm sorry for the delay. I got the flu and have difficulties thinking straight for longer than a few minutes. Ekaterina Tumanova tuman...@linux.vnet.ibm.com writes: Add driver functions

Re: [Qemu-devel] [PATCH 0/2] virtfs-proxy-helper: Fix Coverity warning

2014-11-28 Thread Paolo Bonzini
On 27/11/2014 11:29, Gonglei wrote: On 2014/11/13 20:17, Gonglei (Arei) wrote: From: Gonglei arei.gong...@huawei.com Gonglei (2): virtfs-proxy-helper: Fix possible socket leak. virtfs-proxy-helper: Fix handle leak to make Coverity happy fsdev/virtfs-proxy-helper.c | 16

Re: [Qemu-devel] [PATCH 0/2] virtfs-proxy-helper: Fix Coverity warning

2014-11-28 Thread Gonglei
On 2014/11/28 16:31, Paolo Bonzini wrote: On 27/11/2014 11:29, Gonglei wrote: On 2014/11/13 20:17, Gonglei (Arei) wrote: From: Gonglei arei.gong...@huawei.com Gonglei (2): virtfs-proxy-helper: Fix possible socket leak. virtfs-proxy-helper: Fix handle leak to make Coverity happy

Re: [Qemu-devel] MinGW build

2014-11-28 Thread Peter Maydell
On 28 November 2014 at 07:14, Stefan Weil s...@weilnetz.de wrote: The libvixl code is correct, but the C++ compiler would need to be fixed. Here are some examples: disas/libvixl/a64/disasm-a64.cc:1340:57: warning: unknown conversion type character ‘l’ in format [-Wformat]

Re: [Qemu-devel] [PATCH v2 3/6] geometry: Add driver methods to probe blocksizes and geometry

2014-11-28 Thread Markus Armbruster
Ekaterina Tumanova tuman...@linux.vnet.ibm.com writes: This patch introduces driver methods of defining disk blocksizes (physical and logical) and hard drive geometry. The method is only implemented for host_device. For raw devices driver calls child's method. The detection will only work

Re: [Qemu-devel] [RFC PATCH 2/3] raw-posix: Convert Linux AIO submission to coroutines

2014-11-28 Thread Markus Armbruster
Ming Lei ming@canonical.com writes: On 11/28/14, Markus Armbruster arm...@redhat.com wrote: Ming Lei ming@canonical.com writes: Hi Kevin, On Wed, Nov 26, 2014 at 10:46 PM, Kevin Wolf kw...@redhat.com wrote: This improves the performance of requests because an ACB doesn't need to

Re: [Qemu-devel] [PATCH] Fix for crash after migration in virtio-rng on bi-endian targets

2014-11-28 Thread Peter Maydell
On 27 November 2014 at 09:26, Markus Armbruster arm...@redhat.com wrote: David Gibson da...@gibson.dropbear.id.au writes: VirtIO devices now remember which endianness they're operating in in order to support targets which may have guests of either endianness, such as powerpc. This endianness

Re: [Qemu-devel] [RFC PATCH 2/3] raw-posix: Convert Linux AIO submission to coroutines

2014-11-28 Thread Ming Lei
On 11/28/14, Markus Armbruster arm...@redhat.com wrote: Ming Lei ming@canonical.com writes: On 11/28/14, Markus Armbruster arm...@redhat.com wrote: Ming Lei ming@canonical.com writes: Hi Kevin, On Wed, Nov 26, 2014 at 10:46 PM, Kevin Wolf kw...@redhat.com wrote: This improves the

[Qemu-devel] [PATCH] vhost: Fix vhostfd leak in error branch

2014-11-28 Thread arei.gonglei
From: Gonglei arei.gong...@huawei.com Signed-off-by: Gonglei arei.gong...@huawei.com --- hw/scsi/vhost-scsi.c | 1 + hw/virtio/vhost.c| 2 ++ 2 files changed, 3 insertions(+) diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c index 308b393..dcb2bc5 100644 --- a/hw/scsi/vhost-scsi.c

Re: [Qemu-devel] [RFC PATCH v5 00/31] Deterministic replay and reverse execution

2014-11-28 Thread Artyom Tarasenko
On Thu, Nov 27, 2014 at 6:45 PM, Paolo Bonzini pbonz...@redhat.com wrote: On 27/11/2014 10:53, Artyom Tarasenko wrote: Deterministic replay has the following features: * Deterministically replays whole system execution and all contents of the memory, state of the hadrware

Re: [Qemu-devel] [RFC PATCH 2/3] raw-posix: Convert Linux AIO submission to coroutines

2014-11-28 Thread Paolo Bonzini
On 28/11/2014 03:59, Ming Lei wrote: Hi Kevin, On Wed, Nov 26, 2014 at 10:46 PM, Kevin Wolf kw...@redhat.com wrote: This improves the performance of requests because an ACB doesn't need to be allocated on the heap any more. It also makes the code nicer and smaller. I am not sure it is

Re: [Qemu-devel] [PATCH RFC v4 00/16] qemu: towards virtio-1 host support

2014-11-28 Thread Cornelia Huck
On Thu, 27 Nov 2014 18:35:40 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Thu, Nov 27, 2014 at 05:28:42PM +0100, Cornelia Huck wrote: On Thu, 27 Nov 2014 18:18:25 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Thu, Nov 27, 2014 at 05:06:51PM +0100, Cornelia Huck wrote:

Re: [Qemu-devel] [PATCH RFC v4 00/16] qemu: towards virtio-1 host support

2014-11-28 Thread Cornelia Huck
On Thu, 27 Nov 2014 18:38:59 +0200 Michael S. Tsirkin m...@redhat.com wrote: Also, let's focus on one device, e.g. -net for now. Yes, I'm currently looking at net. Then probably virtio scsi. That's because blk needs to be reworked to support ANY_LAYOUT. I had focused on blk because that's

Re: [Qemu-devel] [RFC PATCH 2/3] raw-posix: Convert Linux AIO submission to coroutines

2014-11-28 Thread Kevin Wolf
Am 28.11.2014 um 03:59 hat Ming Lei geschrieben: Hi Kevin, On Wed, Nov 26, 2014 at 10:46 PM, Kevin Wolf kw...@redhat.com wrote: This improves the performance of requests because an ACB doesn't need to be allocated on the heap any more. It also makes the code nicer and smaller. I am

Re: [Qemu-devel] [PATCH v2 5/6] geometry: Call backend function to detect geometry and blocksize

2014-11-28 Thread Markus Armbruster
Ekaterina Tumanova tuman...@linux.vnet.ibm.com writes: hd_geometry_guess function autodetects the drive geometry. This patch adds a block backend call, that probes the backing device geometry. If the inner driver method is implemented and succeeds (currently only DASDs), the blkconf_geometry

Re: [Qemu-devel] [PATCH v2 5/6] geometry: Call backend function to detect geometry and blocksize

2014-11-28 Thread Markus Armbruster
Ekaterina Tumanova tuman...@linux.vnet.ibm.com writes: hd_geometry_guess function autodetects the drive geometry. This patch adds a block backend call, that probes the backing device geometry. If the inner driver method is implemented and succeeds (currently only DASDs), the blkconf_geometry

Re: [Qemu-devel] [PATCH v6] qcow2: Buffer L1 table in snapshot refcount update

2014-11-28 Thread Stefan Hajnoczi
On Tue, Nov 11, 2014 at 04:27:51PM +0100, Max Reitz wrote: From: Zhang Haoyu zhan...@sangfor.com Buffer the active L1 table in qcow2_update_snapshot_refcount() in order to prevent in-place conversion of the L1 table buffer in the BDRVQcowState to big endian and back, which would lead to data

Re: [Qemu-devel] [PATCH v2 0/6] Geometry and blocksize support for backing devices

2014-11-28 Thread Stefan Hajnoczi
On Wed, Nov 26, 2014 at 01:16:48PM +0300, Ekaterina Tumanova wrote: On 11/25/2014 04:01 PM, Stefan Hajnoczi wrote: On Wed, Nov 19, 2014 at 11:17:50AM +0100, Ekaterina Tumanova wrote: 3. Why does s390 need to customize hd_geometry_guess()? Since hd_geometry_guess contains semantics of

Re: [Qemu-devel] [RFC PATCH 3/3] qemu-coroutine: use a ring per thread for the pool

2014-11-28 Thread Peter Lieven
Am 28.11.2014 um 11:28 schrieb Paolo Bonzini: On 28/11/2014 09:13, Peter Lieven wrote: Am 27.11.2014 um 17:40 schrieb Paolo Bonzini: On 27/11/2014 11:27, Peter Lieven wrote: +static __thread struct CoRoutinePool { +Coroutine *ptrs[POOL_MAX_SIZE]; +unsigned int size; +unsigned

Re: [Qemu-devel] [qemu PATCH 2/2] arm: add fw_cfg to virt board

2014-11-28 Thread Andrew Jones
On Fri, Nov 28, 2014 at 12:18:27AM +0100, Laszlo Ersek wrote: fw_cfg already supports exposure over MMIO (used in ppc/mac_newworld.c, ppc/mac_oldworld.c, sparc/sun4m.c); we can easily add it to the virt board. The mmio register block of fw_cfg is advertized in the device tree. As base

Re: [Qemu-devel] [qemu PATCH 2/2] arm: add fw_cfg to virt board

2014-11-28 Thread Laszlo Ersek
On 11/28/14 11:38, Andrew Jones wrote: On Fri, Nov 28, 2014 at 12:18:27AM +0100, Laszlo Ersek wrote: fw_cfg already supports exposure over MMIO (used in ppc/mac_newworld.c, ppc/mac_oldworld.c, sparc/sun4m.c); we can easily add it to the virt board. The mmio register block of fw_cfg is

Re: [Qemu-devel] [PATCH v2 0/6] Geometry and blocksize support for backing devices

2014-11-28 Thread Stefan Hajnoczi
On Wed, Nov 26, 2014 at 01:16:48PM +0300, Ekaterina Tumanova wrote: On 11/25/2014 04:01 PM, Stefan Hajnoczi wrote: On Wed, Nov 19, 2014 at 11:17:50AM +0100, Ekaterina Tumanova wrote: 4. Please use scripts/checkpatch.pl to check coding style. I did :) You are right, checkpatch.pl doesn't

Re: [Qemu-devel] [PATCH v2 6/6] geometry: Target specific hook for s390x in geometry guessing

2014-11-28 Thread Markus Armbruster
Ekaterina Tumanova tuman...@linux.vnet.ibm.com writes: For target-s390x, the behaviour is chosen as follows: If no geo could be guessed from backing device, guess_disk_lchs (partition table guessing) is called. If this is not successful (e.g. image files) geometry is derived from the size of

Re: [Qemu-devel] [PATCH] geometry: fix i386 compilation

2014-11-28 Thread Markus Armbruster
Ekaterina Tumanova tuman...@linux.vnet.ibm.com writes: Signed-off-by: Ekaterina Tumanova tuman...@linux.vnet.ibm.com --- hw/block/hd-geometry.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/block/hd-geometry.c b/hw/block/hd-geometry.c index b462225..905d2c6

Re: [Qemu-devel] [qemu PATCH 2/2] arm: add fw_cfg to virt board

2014-11-28 Thread Laszlo Ersek
On 11/28/14 11:43, Laszlo Ersek wrote: On 11/28/14 11:38, Andrew Jones wrote: On Fri, Nov 28, 2014 at 12:18:27AM +0100, Laszlo Ersek wrote: fw_cfg already supports exposure over MMIO (used in ppc/mac_newworld.c, ppc/mac_oldworld.c, sparc/sun4m.c); we can easily add it to the virt board. The

Re: [Qemu-devel] [qemu PATCH 2/2] arm: add fw_cfg to virt board

2014-11-28 Thread Andrew Jones
On Fri, Nov 28, 2014 at 11:43:32AM +0100, Laszlo Ersek wrote: On 11/28/14 11:38, Andrew Jones wrote: On Fri, Nov 28, 2014 at 12:18:27AM +0100, Laszlo Ersek wrote: fw_cfg already supports exposure over MMIO (used in ppc/mac_newworld.c, ppc/mac_oldworld.c, sparc/sun4m.c); we can easily add it

Re: [Qemu-devel] [PATCH v2 5/6] geometry: Call backend function to detect geometry and blocksize

2014-11-28 Thread Ekaterina Tumanova
On 11/28/2014 01:10 PM, Markus Armbruster wrote: Ekaterina Tumanova tuman...@linux.vnet.ibm.com writes: hd_geometry_guess function autodetects the drive geometry. This patch adds a block backend call, that probes the backing device geometry. If the inner driver method is implemented and

Re: [Qemu-devel] [PATCH v2 0/6] Geometry and blocksize support for backing devices

2014-11-28 Thread Markus Armbruster
Ekaterina Tumanova tuman...@linux.vnet.ibm.com writes: On 11/25/2014 04:01 PM, Stefan Hajnoczi wrote: [...] 3. Why does s390 need to customize hd_geometry_guess()? Since hd_geometry_guess contains semantics of x86-specific LBA translation, we have to modify it not to get in the way of z

Re: [Qemu-devel] [PATCH v2 2/6] geometry: Detect blocksize via ioctls in separate static functions

2014-11-28 Thread Ekaterina Tumanova
Suggest function comment /** * Return logical block size, or zero if we can't figure it out */ { -BDRVRawState *s = bs-opaque; -char *buf; -unsigned int sector_size; - -/* For /dev/sg devices the alignment is not really used. - With buffered I/O, we

Re: [Qemu-devel] [PATCH v3 07/22] qcow2: Helper function for refcount modification

2014-11-28 Thread Stefan Hajnoczi
On Thu, Nov 20, 2014 at 06:06:23PM +0100, Max Reitz wrote: @@ -1711,7 +1746,7 @@ static int calculate_refcounts(BlockDriverState *bs, BdrvCheckResult *res, static void compare_refcounts(BlockDriverState *bs, BdrvCheckResult *res, BdrvCheckMode fix, bool

Re: [Qemu-devel] [PATCH v3 06/22] qcow2: Helper for refcount array reallocation

2014-11-28 Thread Stefan Hajnoczi
On Thu, Nov 27, 2014 at 04:11:12PM +0100, Max Reitz wrote: On 2014-11-27 at 16:09, Stefan Hajnoczi wrote: On Thu, Nov 20, 2014 at 06:06:22PM +0100, Max Reitz wrote: +/** + * Reallocates *array so that it can hold new_size entries. *size must contain + * the current number of entries in

Re: [Qemu-devel] [RFC PATCH 3/3] qemu-coroutine: use a ring per thread for the pool

2014-11-28 Thread Paolo Bonzini
master: Run operation 4000 iterations 12.851414 s, 3112K operations/s, 321ns per coroutine paolo: Run operation 4000 iterations 11.951720 s, 3346K operations/s, 298ns per coroutine Nice. :) Can you please try coroutine: Use __thread … together, too? I still see 11% time

Re: [Qemu-devel] [PATCH v2 0/6] Geometry and blocksize support for backing devices

2014-11-28 Thread Ekaterina Tumanova
On 11/28/2014 01:35 PM, Stefan Hajnoczi wrote: On Wed, Nov 26, 2014 at 01:16:48PM +0300, Ekaterina Tumanova wrote: On 11/25/2014 04:01 PM, Stefan Hajnoczi wrote: On Wed, Nov 19, 2014 at 11:17:50AM +0100, Ekaterina Tumanova wrote: 3. Why does s390 need to customize hd_geometry_guess()? Since

Re: [Qemu-devel] [qemu PATCH 2/2] arm: add fw_cfg to virt board

2014-11-28 Thread Andrew Jones
On Fri, Nov 28, 2014 at 11:49:48AM +0100, Laszlo Ersek wrote: On 11/28/14 11:43, Laszlo Ersek wrote: On 11/28/14 11:38, Andrew Jones wrote: On Fri, Nov 28, 2014 at 12:18:27AM +0100, Laszlo Ersek wrote: fw_cfg already supports exposure over MMIO (used in ppc/mac_newworld.c,

Re: [Qemu-devel] [RFC PATCH 3/3] qemu-coroutine: use a ring per thread for the pool

2014-11-28 Thread Peter Lieven
Am 28.11.2014 um 12:14 schrieb Paolo Bonzini: master: Run operation 4000 iterations 12.851414 s, 3112K operations/s, 321ns per coroutine paolo: Run operation 4000 iterations 11.951720 s, 3346K operations/s, 298ns per coroutine Nice. :) Can you please try coroutine: Use __thread

Re: [Qemu-devel] [RFC PATCH 3/3] qemu-coroutine: use a ring per thread for the pool

2014-11-28 Thread Paolo Bonzini
On 28/11/2014 12:21, Peter Lieven wrote: Am 28.11.2014 um 12:14 schrieb Paolo Bonzini: master: Run operation 4000 iterations 12.851414 s, 3112K operations/s, 321ns per coroutine paolo: Run operation 4000 iterations 11.951720 s, 3346K operations/s, 298ns per coroutine Nice. :)

Re: [Qemu-devel] [PATCH v6 2/3] linux-aio: handling -EAGAIN for !s-io_q.plugged case

2014-11-28 Thread Kevin Wolf
Am 28.11.2014 um 03:27 hat Ming Lei geschrieben: Hi Kevin, On Wed, Nov 26, 2014 at 7:27 PM, Kevin Wolf kw...@redhat.com wrote: Am 25.11.2014 um 08:23 hat Ming Lei geschrieben: Previously -EAGAIN is simply ignored for !s-io_q.plugged case, and sometimes it is easy to cause -EIO to VM,

Re: [Qemu-devel] [PATCH v3 07/22] qcow2: Helper function for refcount modification

2014-11-28 Thread Stefan Hajnoczi
On Thu, Nov 27, 2014 at 04:32:52PM +0100, Max Reitz wrote: On 2014-11-27 at 16:21, Stefan Hajnoczi wrote: On Thu, Nov 20, 2014 at 06:06:23PM +0100, Max Reitz wrote: @@ -583,7 +608,12 @@ static int QEMU_WARN_UNUSED_RESULT update_refcount(BlockDriverState *bs, /* we can update the

Re: [Qemu-devel] [RFC PATCH 3/3] qemu-coroutine: use a ring per thread for the pool

2014-11-28 Thread Peter Lieven
Am 28.11.2014 um 12:23 schrieb Paolo Bonzini: On 28/11/2014 12:21, Peter Lieven wrote: Am 28.11.2014 um 12:14 schrieb Paolo Bonzini: master: Run operation 4000 iterations 12.851414 s, 3112K operations/s, 321ns per coroutine paolo: Run operation 4000 iterations 11.951720 s, 3346K

Re: [Qemu-devel] [RFC PATCH v5 22/31] timer: introduce new QEMU_CLOCK_VIRTUAL_RT clock

2014-11-28 Thread Pavel Dovgaluk
From: Paolo Bonzini [mailto:pbonz...@redhat.com] On 26/11/2014 11:40, Pavel Dovgalyuk wrote: This patch introduces new QEMU_CLOCK_VIRTUAL_RT clock, which should be used for icount warping. Separate timer is needed for replaying the execution, because warping callbacks should be

Re: [Qemu-devel] [RFC PATCH 3/3] qemu-coroutine: use a ring per thread for the pool

2014-11-28 Thread Peter Lieven
Am 28.11.2014 um 12:23 schrieb Paolo Bonzini: On 28/11/2014 12:21, Peter Lieven wrote: Am 28.11.2014 um 12:14 schrieb Paolo Bonzini: master: Run operation 4000 iterations 12.851414 s, 3112K operations/s, 321ns per coroutine paolo: Run operation 4000 iterations 11.951720 s, 3346K

Re: [Qemu-devel] [PATCH v2 0/3] block: Don't probe for unknown backing file format

2014-11-28 Thread Stefan Hajnoczi
On Tue, Nov 25, 2014 at 06:12:39PM +0100, Kevin Wolf wrote: v2: - Added two patches to make the test case actually work properly and not just by accident on my laptop. [Max] - Fixed comment in test case [Max] Kevin Wolf (3): qcow2: Fix header extension size check qcow2.py: Add

Re: [Qemu-devel] [PATCH] block: do not use get_clock()

2014-11-28 Thread Stefan Hajnoczi
On Wed, Nov 26, 2014 at 03:01:02PM +0100, Paolo Bonzini wrote: Use the external qemu-timer API instead. Cc: kw...@redhat.com Cc: stefa...@redhat.com Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block/accounting.c | 6 -- block/raw-posix.c | 8 2 files changed, 8

Re: [Qemu-devel] [PATCH RFC for-2.2] virtio-blk: force 1st s/g to match header

2014-11-28 Thread Stefan Hajnoczi
On Fri, Nov 28, 2014 at 7:05 AM, Jason Wang jasow...@redhat.com wrote: On Fri, Nov 28, 2014 at 9:16 AM, Fam Zheng f...@redhat.com wrote: On Thu, 11/27 23:13, Michael S. Tsirkin wrote: On Thu, Nov 27, 2014 at 07:21:35PM +, Stefan Hajnoczi wrote: On Thu, Nov 27, 2014 at 4:33 PM,

Re: [Qemu-devel] [PATCH] Fix for crash after migration in virtio-rng on bi-endian targets

2014-11-28 Thread David Gibson
On Fri, Nov 28, 2014 at 09:14:46AM +, Peter Maydell wrote: On 27 November 2014 at 09:26, Markus Armbruster arm...@redhat.com wrote: David Gibson da...@gibson.dropbear.id.au writes: VirtIO devices now remember which endianness they're operating in in order to support targets which may

Re: [Qemu-devel] [RFC PATCH 3/3] qemu-coroutine: use a ring per thread for the pool

2014-11-28 Thread Peter Lieven
Am 28.11.2014 um 12:32 schrieb Peter Lieven: Am 28.11.2014 um 12:23 schrieb Paolo Bonzini: On 28/11/2014 12:21, Peter Lieven wrote: Am 28.11.2014 um 12:14 schrieb Paolo Bonzini: master: Run operation 4000 iterations 12.851414 s, 3112K operations/s, 321ns per coroutine paolo: Run

Re: [Qemu-devel] [PATCH] Fix for crash after migration in virtio-rng on bi-endian targets

2014-11-28 Thread Greg Kurz
On Fri, 28 Nov 2014 09:14:46 + Peter Maydell peter.mayd...@linaro.org wrote: On 27 November 2014 at 09:26, Markus Armbruster arm...@redhat.com wrote: David Gibson da...@gibson.dropbear.id.au writes: VirtIO devices now remember which endianness they're operating in in order to support

Re: [Qemu-devel] [RFC PATCH 1/3] qemu-img bench

2014-11-28 Thread Stefan Hajnoczi
On Wed, Nov 26, 2014 at 03:46:42PM +0100, Kevin Wolf wrote: +while (data.n 0) { +main_loop_wait(false); +} Why is this false (non-blocking)? This is why you get the main loop spun warning message. Using true (blocking) seems like the right thing. data.n changes as part of

Re: [Qemu-devel] [RFC PATCH 1/3] qemu-img bench

2014-11-28 Thread Kevin Wolf
Am 28.11.2014 um 12:49 hat Stefan Hajnoczi geschrieben: On Wed, Nov 26, 2014 at 03:46:42PM +0100, Kevin Wolf wrote: +while (data.n 0) { +main_loop_wait(false); +} Why is this false (non-blocking)? This is why you get the main loop spun warning message. Using true

Re: [Qemu-devel] [RFC PATCH 3/3] qemu-coroutine: use a ring per thread for the pool

2014-11-28 Thread Paolo Bonzini
On 28/11/2014 12:32, Peter Lieven wrote: Am 28.11.2014 um 12:23 schrieb Paolo Bonzini: On 28/11/2014 12:21, Peter Lieven wrote: Am 28.11.2014 um 12:14 schrieb Paolo Bonzini: master: Run operation 4000 iterations 12.851414 s, 3112K operations/s, 321ns per coroutine paolo: Run

Re: [Qemu-devel] [RFC PATCH 3/3] qemu-coroutine: use a ring per thread for the pool

2014-11-28 Thread Peter Lieven
Am 28.11.2014 um 13:21 schrieb Paolo Bonzini: On 28/11/2014 12:32, Peter Lieven wrote: Am 28.11.2014 um 12:23 schrieb Paolo Bonzini: On 28/11/2014 12:21, Peter Lieven wrote: Am 28.11.2014 um 12:14 schrieb Paolo Bonzini: master: Run operation 4000 iterations 12.851414 s, 3112K

Re: [Qemu-devel] [RFC PATCH 3/3] qemu-coroutine: use a ring per thread for the pool

2014-11-28 Thread Paolo Bonzini
On 28/11/2014 12:46, Peter Lieven wrote: I get: Run operation 4000 iterations 9.883958 s, 4046K operations/s, 247ns per coroutine Ok, understood, it steals the whole pool, right? Isn't that bad if we have more than one thread in need of a lot of coroutines? Overall the algorithm

[Qemu-devel] [kernel PATCH] devicetree: document ARM bindings for QEMU's Firmware Config interface

2014-11-28 Thread Laszlo Ersek
Peter Maydell suggested that we describe new devices / DTB nodes in the kernel Documentation tree that we expose to arm virt guests in QEMU. Although the kernel is not required to access the fw_cfg interface, Documentation/devicetree/bindings/arm is probably the best central spot to keep the

[Qemu-devel] [PATCHv3] block: add event when disk usage exceeds threshold

2014-11-28 Thread Francesco Romani
Managing applications, like oVirt (http://www.ovirt.org), make extensive use of thin-provisioned disk images. To let the guest run smoothly and be not unnecessarily paused, oVirt sets a disk usage threshold (so called 'high water mark') based on the occupation of the device, and automatically

[Qemu-devel] [PATCH v3] add write threshold reporting for block devices

2014-11-28 Thread Francesco Romani
v2 was: with RFC. Since last review round I dropped the tag because I think now all the open points are addressed. v1 was: add watermark reporting for block devices, but watermark is incorrectly unused. Hence the change in subject. Changes since v2: - addressed reviewers

Re: [Qemu-devel] [RFC PATCH 3/3] qemu-coroutine: use a ring per thread for the pool

2014-11-28 Thread Peter Lieven
Am 28.11.2014 um 13:26 schrieb Paolo Bonzini: On 28/11/2014 12:46, Peter Lieven wrote: I get: Run operation 4000 iterations 9.883958 s, 4046K operations/s, 247ns per coroutine Ok, understood, it steals the whole pool, right? Isn't that bad if we have more than one thread in need of a

Re: [Qemu-devel] [RFC PATCH v5 22/31] timer: introduce new QEMU_CLOCK_VIRTUAL_RT clock

2014-11-28 Thread Paolo Bonzini
On 28/11/2014 12:28, Pavel Dovgaluk wrote: Not so easy :) cpu_get_clock() checks vm_clock_seqlock which is locked in icount_warp_rt(). And after locking it requests the value of QEMU_CLOCK_VIRTUAL_RT: seqlock_write_lock(timers_state.vm_clock_seqlock); if (runstate_is_running()) {

Re: [Qemu-devel] [RFC PATCH 3/3] qemu-coroutine: use a ring per thread for the pool

2014-11-28 Thread Stefan Hajnoczi
On Thu, Nov 27, 2014 at 11:27:06AM +0100, Peter Lieven wrote: diff --git a/iothread.c b/iothread.c index 342a23f..b53529b 100644 --- a/iothread.c +++ b/iothread.c @@ -15,6 +15,7 @@ #include qom/object_interfaces.h #include qemu/module.h #include block/aio.h +#include block/coroutine.h

Re: [Qemu-devel] [RFC PATCH 1/3] Revert coroutine: make pool size dynamic

2014-11-28 Thread Stefan Hajnoczi
On Thu, Nov 27, 2014 at 11:27:04AM +0100, Peter Lieven wrote: This reverts commit ac2662a913ee5854b1269256adbdc14e57ba480a. Justification? Won't we hit the same problem as the global pool: either pool size is too large or too small. If you exceed the pool size performance drops dramatically.

Re: [Qemu-devel] [RFC 0/6] memory: make dirty_memory[] accesses atomic

2014-11-28 Thread Stefan Hajnoczi
On Thu, Nov 27, 2014 at 01:21:54PM +, Peter Maydell wrote: On 27 November 2014 at 12:29, Stefan Hajnoczi stefa...@redhat.com wrote: 1. Convert all cpu_physical_memory_*_dirty() callers to use the API atomically. There are TCG callers who things along the lines of: if

Re: [Qemu-devel] [RFC PATCH 3/3] qemu-coroutine: use a ring per thread for the pool

2014-11-28 Thread Paolo Bonzini
On 28/11/2014 13:39, Peter Lieven wrote: Am 28.11.2014 um 13:26 schrieb Paolo Bonzini: On 28/11/2014 12:46, Peter Lieven wrote: I get: Run operation 4000 iterations 9.883958 s, 4046K operations/s, 247ns per coroutine Ok, understood, it steals the whole pool, right? Isn't that bad if

Re: [Qemu-devel] [RFC PATCH 1/3] Revert coroutine: make pool size dynamic

2014-11-28 Thread Peter Lieven
Am 28.11.2014 um 13:42 schrieb Stefan Hajnoczi: On Thu, Nov 27, 2014 at 11:27:04AM +0100, Peter Lieven wrote: This reverts commit ac2662a913ee5854b1269256adbdc14e57ba480a. Justification? Won't we hit the same problem as the global pool: either pool size is too large or too small. If you

Re: [Qemu-devel] Qemu coroutine behaviour on blocking send(3)

2014-11-28 Thread Stefan Hajnoczi
On Fri, Nov 28, 2014 at 01:55:00PM +0700, Iwan Budi Kusnanto wrote: I meant, does the coroutine will do yield internally when it get blocked on send(3)? No. In general, QEMU will use non-blocking file descriptors so the blocking case does not apply. (You can't use blocking file descriptors in

Re: [Qemu-devel] [RFC PATCH 3/3] qemu-coroutine: use a ring per thread for the pool

2014-11-28 Thread Peter Lieven
Am 28.11.2014 um 13:45 schrieb Paolo Bonzini: On 28/11/2014 13:39, Peter Lieven wrote: Am 28.11.2014 um 13:26 schrieb Paolo Bonzini: On 28/11/2014 12:46, Peter Lieven wrote: I get: Run operation 4000 iterations 9.883958 s, 4046K operations/s, 247ns per coroutine Ok, understood, it

Re: [Qemu-devel] [PATCH v2 2/6] geometry: Detect blocksize via ioctls in separate static functions

2014-11-28 Thread Markus Armbruster
Ekaterina Tumanova tuman...@linux.vnet.ibm.com writes: Suggest function comment /** * Return logical block size, or zero if we can't figure it out */ { -BDRVRawState *s = bs-opaque; -char *buf; -unsigned int sector_size; - -/* For /dev/sg devices

Re: [Qemu-devel] [RFC PATCH 3/3] qemu-coroutine: use a ring per thread for the pool

2014-11-28 Thread Paolo Bonzini
On 28/11/2014 13:49, Peter Lieven wrote: Idea: If the release_pool is full why not put the coroutine in the thread alloc_pool instead of throwing it away? :-) Because you can only waste 64 coroutines per thread. But numbers cannot s/only// be sneezed at, so it's worth doing it as a

Re: [Qemu-devel] [RFC PATCH 2/3] raw-posix: Convert Linux AIO submission to coroutines

2014-11-28 Thread Kevin Wolf
Am 27.11.2014 um 10:50 hat Peter Lieven geschrieben: On 26.11.2014 15:46, Kevin Wolf wrote: This improves the performance of requests because an ACB doesn't need to be allocated on the heap any more. It also makes the code nicer and smaller. As a side effect, the codepath taken by

Re: [Qemu-devel] [kernel PATCH] devicetree: document ARM bindings for QEMU's Firmware Config interface

2014-11-28 Thread Arnd Bergmann
On Friday 28 November 2014 13:26:44 Laszlo Ersek wrote: +Example: + +/ { + #size-cells = 0x2; + #address-cells = 0x2; + + fw-cfg@902 { + reg = 0x0 0x902 0x0 0x2 0x0 0x9020002 0x0 0x1; + compatible = fw-cfg,mmio; + }; +};

Re: [Qemu-devel] [PATCH v3 11/22] iotests: Prepare for refcount_width option

2014-11-28 Thread Stefan Hajnoczi
On Thu, Nov 20, 2014 at 06:06:27PM +0100, Max Reitz wrote: Some tests do not work well with certain refcount widths (i.e. you cannot create internal snapshots with refcount_width=1), so make those widths unsupported. Furthermore, add another filter to _filter_img_create in common.filter

[Qemu-devel] [PATCH] target-arm: ARM64: Adding EL1 AARCH32 guest support for KVM.

2014-11-28 Thread Pranavkumar Sawargaonkar
In KVM ARM64 one can choose to run guest in 32bit mode i.e EL1 in AARCH32 mode. This patch adds qemu support for running guest EL1 in AARCH32 mode with virt as a machine model. This patch also adds a support to run Image (along with zImage) for arm32. One can specify about 32bit kernel Image by

Re: [Qemu-devel] [RFC PATCH 3/3] qemu-coroutine: use a ring per thread for the pool

2014-11-28 Thread Peter Lieven
Am 28.11.2014 um 13:39 schrieb Peter Lieven: Am 28.11.2014 um 13:26 schrieb Paolo Bonzini: On 28/11/2014 12:46, Peter Lieven wrote: I get: Run operation 4000 iterations 9.883958 s, 4046K operations/s, 247ns per coroutine Ok, understood, it steals the whole pool, right? Isn't that bad if

Re: [Qemu-devel] [PATCH v3 12/22] qcow2: Allow creation with refcount order != 4

2014-11-28 Thread Stefan Hajnoczi
On Thu, Nov 20, 2014 at 06:06:28PM +0100, Max Reitz wrote: Add a creation option to qcow2 for setting the refcount order of images to be created, and respect that option's value. This breaks some test outputs, fix them. Signed-off-by: Max Reitz mre...@redhat.com Reviewed-by: Eric Blake

Re: [Qemu-devel] [RFC PATCH 3/3] qemu-coroutine: use a ring per thread for the pool

2014-11-28 Thread Peter Lieven
Am 28.11.2014 um 13:45 schrieb Paolo Bonzini: On 28/11/2014 13:39, Peter Lieven wrote: Am 28.11.2014 um 13:26 schrieb Paolo Bonzini: On 28/11/2014 12:46, Peter Lieven wrote: I get: Run operation 4000 iterations 9.883958 s, 4046K operations/s, 247ns per coroutine Ok, understood, it

Re: [Qemu-devel] [kernel PATCH] devicetree: document ARM bindings for QEMU's Firmware Config interface

2014-11-28 Thread Mark Rutland
Hi, On Fri, Nov 28, 2014 at 12:26:44PM +, Laszlo Ersek wrote: Peter Maydell suggested that we describe new devices / DTB nodes in the kernel Documentation tree that we expose to arm virt guests in QEMU. Although the kernel is not required to access the fw_cfg interface,

Re: [Qemu-devel] [PATCH v3 15/22] qcow2: Use error_report() in qcow2_amend_options()

2014-11-28 Thread Stefan Hajnoczi
On Thu, Nov 20, 2014 at 06:06:31PM +0100, Max Reitz wrote: Signed-off-by: Max Reitz mre...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com --- block/qcow2.c | 14 ++ tests/qemu-iotests/061.out | 14 +++--- 2 files changed, 13 insertions(+), 15

Re: [Qemu-devel] [PATCH v3 16/22] qcow2: Use abort() instead of assert(false)

2014-11-28 Thread Stefan Hajnoczi
On Thu, Nov 20, 2014 at 06:06:32PM +0100, Max Reitz wrote: Signed-off-by: Max Reitz mre...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com --- block/qcow2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Stefan Hajnoczi stefa...@redhat.com pgpwibsjgMgJ0.pgp

Re: [Qemu-devel] [kernel PATCH] devicetree: document ARM bindings for QEMU's Firmware Config interface

2014-11-28 Thread Laszlo Ersek
On 11/28/14 13:59, Arnd Bergmann wrote: On Friday 28 November 2014 13:26:44 Laszlo Ersek wrote: +Example: + +/ { + #size-cells = 0x2; + #address-cells = 0x2; + + fw-cfg@902 { + reg = 0x0 0x902 0x0 0x2 0x0 0x9020002 0x0 0x1; +

Re: [Qemu-devel] [PATCH v3 17/22] qcow2: Split upgrade/downgrade paths for amend

2014-11-28 Thread Stefan Hajnoczi
On Thu, Nov 20, 2014 at 06:06:33PM +0100, Max Reitz wrote: If the image version should be upgraded, that is the first we should do; if it should be downgraded, that is the last we should do. So split the version change block into an upgrade part at the start and a downgrade part at the end.

Re: [Qemu-devel] [PATCH v2 2/6] geometry: Detect blocksize via ioctls in separate static functions

2014-11-28 Thread Ekaterina Tumanova
On 11/28/2014 03:52 PM, Markus Armbruster wrote: Ekaterina Tumanova tuman...@linux.vnet.ibm.com writes: Suggest function comment /** * Return logical block size, or zero if we can't figure it out */ { -BDRVRawState *s = bs-opaque; -char *buf; -unsigned

Re: [Qemu-devel] [PATCH v2] persistent dirty bitmap: add QDB file spec.

2014-11-28 Thread Vladimir Sementsov-Ogievskiy
On 21.11.2014 19:55, Stefan Hajnoczi wrote: Active dirty bitmaps should migrate too. I'm thinking now that the appropriate thing is to add live migration of dirty bitmaps to QEMU (regardless of whether they are active or not). I think, we should migrate named dirty bitmaps, which are not used

Re: [Qemu-devel] [PATCH v3 13/22] progress: Allow regressing progress

2014-11-28 Thread Stefan Hajnoczi
On Thu, Nov 20, 2014 at 06:06:29PM +0100, Max Reitz wrote: Progress may regress; this should be displayed correctly by qemu_progress_print(). Signed-off-by: Max Reitz mre...@redhat.com --- util/qemu-progress.c | 1 + 1 file changed, 1 insertion(+) Reviewed-by: Stefan Hajnoczi

Re: [Qemu-devel] [kernel PATCH] devicetree: document ARM bindings for QEMU's Firmware Config interface

2014-11-28 Thread Mark Rutland
On Fri, Nov 28, 2014 at 01:22:29PM +, Laszlo Ersek wrote: On 11/28/14 13:59, Arnd Bergmann wrote: On Friday 28 November 2014 13:26:44 Laszlo Ersek wrote: +Example: + +/ { + #size-cells = 0x2; + #address-cells = 0x2; + + fw-cfg@902 { + reg

Re: [Qemu-devel] master: intermittent acpi-test failures

2014-11-28 Thread Peter Maydell
On 27 May 2014 at 22:38, Peter Maydell peter.mayd...@linaro.org wrote: I'm seeing this test failure intermittently on 'make check': ERROR:/root/qemu/tests/acpi-test.c:618:test_acpi_one: assertion failed (signature == SIGNATURE): (0x == 0xdead) GTester: last random seed:

Re: [Qemu-devel] [PATCH v2 0/6] Geometry and blocksize support for backing devices

2014-11-28 Thread Markus Armbruster
Ekaterina Tumanova tuman...@linux.vnet.ibm.com writes: On 11/28/2014 01:35 PM, Stefan Hajnoczi wrote: On Wed, Nov 26, 2014 at 01:16:48PM +0300, Ekaterina Tumanova wrote: On 11/25/2014 04:01 PM, Stefan Hajnoczi wrote: On Wed, Nov 19, 2014 at 11:17:50AM +0100, Ekaterina Tumanova wrote: 3. Why

Re: [Qemu-devel] [PATCH] block: do not use get_clock()

2014-11-28 Thread Markus Armbruster
Stefan Hajnoczi stefa...@gmail.com writes: On Wed, Nov 26, 2014 at 03:01:02PM +0100, Paolo Bonzini wrote: Use the external qemu-timer API instead. Cc: kw...@redhat.com Cc: stefa...@redhat.com Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block/accounting.c | 6 --

Re: [Qemu-devel] [RFC PATCH 2/3] raw-posix: Convert Linux AIO submission to coroutines

2014-11-28 Thread Kevin Wolf
Am 28.11.2014 um 13:57 hat Kevin Wolf geschrieben: Am 27.11.2014 um 10:50 hat Peter Lieven geschrieben: On 26.11.2014 15:46, Kevin Wolf wrote: This improves the performance of requests because an ACB doesn't need to be allocated on the heap any more. It also makes the code nicer and

Re: [Qemu-devel] Qemu coroutine behaviour on blocking send(3)

2014-11-28 Thread Iwan Budi Kusnanto
On Fri, Nov 28, 2014 at 7:47 PM, Stefan Hajnoczi stefa...@gmail.com wrote: On Fri, Nov 28, 2014 at 01:55:00PM +0700, Iwan Budi Kusnanto wrote: I meant, does the coroutine will do yield internally when it get blocked on send(3)? No. In general, QEMU will use non-blocking file descriptors so

Re: [Qemu-devel] [kernel PATCH] devicetree: document ARM bindings for QEMU's Firmware Config interface

2014-11-28 Thread Laszlo Ersek
On 11/28/14 14:17, Mark Rutland wrote: Hi, On Fri, Nov 28, 2014 at 12:26:44PM +, Laszlo Ersek wrote: Peter Maydell suggested that we describe new devices / DTB nodes in the kernel Documentation tree that we expose to arm virt guests in QEMU. Although the kernel is not required to

Re: [Qemu-devel] [kernel PATCH] devicetree: document ARM bindings for QEMU's Firmware Config interface

2014-11-28 Thread Laszlo Ersek
On 11/28/14 14:33, Mark Rutland wrote: On Fri, Nov 28, 2014 at 01:22:29PM +, Laszlo Ersek wrote: On 11/28/14 13:59, Arnd Bergmann wrote: We don't normally list contiguous registers separately. Maybe just round up to one page and make the register property reg = 0x0 0x902 0x0

[Qemu-devel] async block driver questions

2014-11-28 Thread Iwan Budi Kusnanto
Hi all, I have some questions regarding developing async network protocol based block driver for qemu. The network file server has async client library, and i think it will be good if i can use it. 1. Is it OK to use libevent inside block driver. What make me worried is that qemu itself said to

Re: [Qemu-devel] [PATCH RFC for-2.2] virtio-blk: force 1st s/g to match header

2014-11-28 Thread Marc Marí
El Fri, 28 Nov 2014 11:43:59 + Stefan Hajnoczi stefa...@gmail.com escribió: On Fri, Nov 28, 2014 at 7:05 AM, Jason Wang jasow...@redhat.com wrote: On Fri, Nov 28, 2014 at 9:16 AM, Fam Zheng f...@redhat.com wrote: On Thu, 11/27 23:13, Michael S. Tsirkin wrote: On Thu, Nov 27,

[Qemu-devel] [PATCH 0/7] coroutine: optimizations

2014-11-28 Thread Paolo Bonzini
As discussed in the other thread, this brings speedups from dropping the coroutine mutex (which serializes multiple iothreads, too) and using ELF thread-local storage. The speedup in perf/cost is about 30% (190-145). Windows port tested with tests/test-coroutine.exe under Wine. Paolo Paolo

[Qemu-devel] [PATCH 3/7] test-coroutine: avoid overflow on 32-bit systems

2014-11-28 Thread Paolo Bonzini
unsigned long is not large enough to represent 10 * duration there. Just use floating point. Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- tests/test-coroutine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test-coroutine.c b/tests/test-coroutine.c

[Qemu-devel] [PATCH 2/7] qemu-thread: add per-thread atexit functions

2014-11-28 Thread Paolo Bonzini
Destructors are the main additional feature of pthread TLS compared to __thread. If we were using C++ (hint, hint!) we could have used thread-local objects with a destructor. Since we are not, instead, we add a simple Notifier-based API. Note that the notifier must be per-thread as well. We

[Qemu-devel] [PATCH 4/7] QSLIST: add lock-free operations

2014-11-28 Thread Paolo Bonzini
These operations are trivial to implement and do not have ABA problems. They are enough to implement simple multiple-producer, single consumer lock-free lists or, as in the next patch, the multiple consumers can steal a whole batch of elements and process them at their leisure. Signed-off-by:

[Qemu-devel] [PATCH 5/7] coroutine: rewrite pool to avoid mutex

2014-11-28 Thread Paolo Bonzini
This patch removes the mutex by using fancy lock-free manipulation of the pool. Lock-free stacks and queues are not hard, but they can suffer from the ABA problem so they are better avoided unless you have some deferred reclamation scheme like RCU. Otherwise you have to stick with adding to a

[Qemu-devel] [PATCH 6/7] coroutine: drop qemu_coroutine_adjust_pool_size

2014-11-28 Thread Paolo Bonzini
This is not needed anymore. The new TLS-based algorithm is adaptive. Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block/block-backend.c | 4 include/block/coroutine.h | 10 -- qemu-coroutine.c | 4 3 files changed, 18 deletions(-) diff --git

  1   2   >