Re: [Qemu-devel] [PATCH 1/7] virtio: allow byte swapping for vring and config access

2013-08-09 Thread Rusty Russell
Andreas Färber writes: > Am 08.08.2013 15:31, schrieb Anthony Liguori: >> Rusty Russell writes: >> We have a mechanism to do weak functions via stubs/. I think it would >> be better to do cpu_get_byteswap() as a stub function and then overload >> it in the ppc64 code. > > If this as your name in

Re: [Qemu-devel] [PATCH V3 for-1.6 3/5] block: Add support for throttling burst threshold in QMP and the command line.

2013-08-09 Thread Kevin Wolf
Am 08.08.2013 um 15:37 hat Benoît Canet geschrieben: > > Kevin's series renamed these to have a dash in the name, and also moved > > all the throttling parameters into a sub-struct. Does it make more > > sense to have just '*throttling' with that sub-struct containing 12 > > parameters, 6 for limi

Re: [Qemu-devel] [PATCH v1 1/5] util: introduce gsource event abstraction

2013-08-09 Thread liu ping fan
On Fri, Aug 9, 2013 at 12:29 AM, Michael Roth wrote: > Quoting Liu Ping Fan (2013-08-08 01:26:07) >> Introduce struct EventsGSource. It will ease the usage of GSource >> associated with a group of files, which are dynamically allocated >> and release, ex, slirp. >> >> Signed-off-by: Liu Ping Fan

Re: [Qemu-devel] [PATCH v6 00/18] aio: drop io_flush()

2013-08-09 Thread Wenchao Xia
于 2013-8-6 23:07, Stefan Hajnoczi 写道: On Thu, Jul 25, 2013 at 05:18:07PM +0200, Stefan Hajnoczi wrote: v6: * Fix block/stream.c:close_unused_images() dangling pointer in Patch 2 * Rebase onto qemu.git/master v5: * Split out bdrv_delete() drain fix [bonzini] * Fix commit message [bonzin

Re: [Qemu-devel] [PATCH 1/7] virtio: allow byte swapping for vring and config access

2013-08-09 Thread Rusty Russell
Andreas Färber writes: > Am 08.08.2013 17:40, schrieb Anthony Liguori: >> Andreas Färber writes: >>> Am 08.08.2013 15:31, schrieb Anthony Liguori: We have a mechanism to do weak functions via stubs/. I think it would be better to do cpu_get_byteswap() as a stub function and then overlo

Re: [Qemu-devel] [PATCH 1/2] memory: Provide separate handling of unassigned io ports accesses

2013-08-09 Thread Paolo Bonzini
Il 08/08/2013 17:43, Jan Kiszka ha scritto: > On 2013-08-08 17:33, Peter Maydell wrote: >> On 3 August 2013 09:31, Jan Kiszka wrote: >>> --- a/ioport.c >>> +++ b/ioport.c >>> @@ -44,6 +44,22 @@ typedef struct MemoryRegionPortioList { >>> MemoryRegionPortio ports[]; >>> } MemoryRegionPortioLi

Re: [Qemu-devel] [PATCH 1/7] virtio: allow byte swapping for vring and config access

2013-08-09 Thread Peter Maydell
On 9 August 2013 08:35, Rusty Russell wrote: > That's a lot of replumbing and indirect function calls for a fairly > obscure case. We certainly don't have a nice CPUState lying around in > virtio at the moment, for example. Actually if you're in an IO routine you do: it will be in the global var

Re: [Qemu-devel] [PATCH 1/7] virtio: allow byte swapping for vring and config access

2013-08-09 Thread Benjamin Herrenschmidt
On Fri, 2013-08-09 at 17:05 +0930, Rusty Russell wrote: > > Exactly, just read it as "is in ... Endian mode". On the CPUs I am more > > familiar with (e.g., 970), this used to be controlled via an MSR bit, 970 didn't have an LE mode :-) > > which as CPUPPCState::msr exists per CPUState. I did no

Re: [Qemu-devel] [PATCH 1/7] virtio: allow byte swapping for vring and config access

2013-08-09 Thread Peter Maydell
On 9 August 2013 03:58, Rusty Russell wrote: > Anthony Liguori writes: >> The distinction is important in QEMU. ppc64 is still >> TARGET_WORDS_BIGENDIAN. We still want most stl_phys to treat integers >> as big endian. There's just this extra concept that CPU loads/stores >> are sometimes byte

Re: [Qemu-devel] [PATCH v1 2/5] slirp: make timeout local

2013-08-09 Thread Paolo Bonzini
Il 08/08/2013 08:26, Liu Ping Fan ha scritto: > Each slirp has its own time to caculate timeout. > > Signed-off-by: Liu Ping Fan > --- > slirp/slirp.c | 22 ++ > slirp/slirp.h | 3 +++ > 2 files changed, 13 insertions(+), 12 deletions(-) > > diff --git a/slirp/slirp.c b/sli

Re: [Qemu-devel] [RFC] [PATCHv8 00/30] aio / timers: Add AioContext timers and use ppoll

2013-08-09 Thread Jan Kiszka
On 2013-08-08 23:41, Alex Bligh wrote: > This patch series adds support for timers attached to an AioContext clock > which get called within aio_poll. > > In doing so it removes alarm timers and moves to use ppoll where possible. > > This patch set 'sort of' passes make check (see below for cavea

[Qemu-devel] [PATCH v7 00/18] aio: drop io_flush()

2013-08-09 Thread Stefan Hajnoczi
v7: * Rebase onto Kevin's block-next branch to resolve conflicts [Wenchao] v6: * Fix block/stream.c:close_unused_images() dangling pointer in Patch 2 * Rebase onto qemu.git/master v5: * Split out bdrv_delete() drain fix [bonzini] * Fix commit message [bonzini] v4: * Ensure pending BHs are

[Qemu-devel] [PATCH v7 02/18] block: stop relying on io_flush() in bdrv_drain_all()

2013-08-09 Thread Stefan Hajnoczi
If a block driver has no file descriptors to monitor but there are still active requests, it can return 1 from .io_flush(). This is used to spin during synchronous I/O. Stop relying on .io_flush() and instead check QLIST_EMPTY(&bs->tracked_requests) to decide whether there are active requests. T

[Qemu-devel] [PATCH v7 01/18] block: ensure bdrv_drain_all() works during bdrv_delete()

2013-08-09 Thread Stefan Hajnoczi
In bdrv_delete() make sure to call bdrv_make_anon() *after* bdrv_close() so that the device is still seen by bdrv_drain_all() when iterating bdrv_states. Cc: qemu-sta...@nongnu.org Signed-off-by: Stefan Hajnoczi --- block.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/

[Qemu-devel] [PATCH v7 03/18] dataplane/virtio-blk: check exit conditions before aio_poll()

2013-08-09 Thread Stefan Hajnoczi
Check exit conditions before entering blocking aio_poll(). This is mainly for consistency since it's unlikely that we are stopping in the first event loop iteration. Signed-off-by: Stefan Hajnoczi --- hw/block/dataplane/virtio-blk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) dif

[Qemu-devel] [PATCH v7 04/18] tests: adjust test-aio to new aio_poll() semantics

2013-08-09 Thread Stefan Hajnoczi
aio_poll(ctx, true) will soon block if any fd handlers have been set. Previously it would only block when .io_flush() returned true. This means that callers must check their wait condition *before* aio_poll() to avoid deadlock. Reviewed-by: Paolo Bonzini Signed-off-by: Stefan Hajnoczi --- test

[Qemu-devel] [PATCH v7 05/18] tests: adjust test-thread-pool to new aio_poll() semantics

2013-08-09 Thread Stefan Hajnoczi
aio_poll(ctx, true) will soon block when fd handlers have been set. Previously aio_poll() would return early if all .io_flush() returned false. This means we need to check the equivalent of the .io_flush() condition *before* calling aio_poll(ctx, true) to avoid deadlock. Reviewed-by: Paolo Bonzin

[Qemu-devel] [PATCH v7 08/18] block/gluster: drop qemu_gluster_aio_flush_cb()

2013-08-09 Thread Stefan Hajnoczi
Since .io_flush() is no longer called we do not need qemu_gluster_aio_flush_cb() anymore. It turns out that qemu_aio_count is unused now and can be dropped. Signed-off-by: Stefan Hajnoczi --- block/gluster.c | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/bl

[Qemu-devel] [PATCH v7 06/18] aio: stop using .io_flush()

2013-08-09 Thread Stefan Hajnoczi
Now that aio_poll() users check their termination condition themselves, it is no longer necessary to call .io_flush() handlers. The behavior of aio_poll() changes as follows: 1. .io_flush() is no longer invoked and file descriptors are *always* monitored. Previously returning 0 from .io_flush()

[Qemu-devel] [PATCH v7 13/18] block/sheepdog: drop have_co_req() and aio_flush_request()

2013-08-09 Thread Stefan Hajnoczi
.io_flush() is no longer called so drop have_co_req() and aio_flush_request(). Signed-off-by: Stefan Hajnoczi --- block/sheepdog.c | 25 + 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index 7699aad..9252b1d 100644 ---

[Qemu-devel] [PATCH v7 15/18] dataplane/virtio-blk: drop flush_true() and flush_io()

2013-08-09 Thread Stefan Hajnoczi
.io_flush() is no longer called so drop flush_true() and flush_io(). Signed-off-by: Stefan Hajnoczi --- hw/block/dataplane/virtio-blk.c | 17 ++--- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c index 5

[Qemu-devel] [PATCH v7 10/18] block/linux-aio: drop qemu_laio_completion_cb()

2013-08-09 Thread Stefan Hajnoczi
.io_flush() is no longer called so drop qemu_laio_completion_cb(). It turns out that count is now unused so drop that too. Signed-off-by: Stefan Hajnoczi --- block/linux-aio.c | 17 ++--- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/block/linux-aio.c b/block/linux-

[Qemu-devel] [PATCH v7 09/18] block/iscsi: drop iscsi_process_flush()

2013-08-09 Thread Stefan Hajnoczi
.io_flush() is no longer called so drop iscsi_process_flush(). Signed-off-by: Stefan Hajnoczi --- block/iscsi.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/block/iscsi.c b/block/iscsi.c index e7c1c2b..180b827 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -146,

[Qemu-devel] [PATCH v7 14/18] block/ssh: drop return_true()

2013-08-09 Thread Stefan Hajnoczi
.io_flush() is no longer called so drop return_true(). Signed-off-by: Stefan Hajnoczi --- block/ssh.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/block/ssh.c b/block/ssh.c index d7e7bf8..e149da9 100644 --- a/block/ssh.c +++ b/block/ssh.c @@ -740,14 +740,6 @@ sta

[Qemu-devel] [PATCH v7 17/18] tests: drop event_active_cb()

2013-08-09 Thread Stefan Hajnoczi
Drop the io_flush argument to aio_set_event_notifier(). Reviewed-by: Paolo Bonzini Signed-off-by: Stefan Hajnoczi --- tests/test-aio.c | 22 -- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/tests/test-aio.c b/tests/test-aio.c index 1251952..7b2892a 100644 --

[Qemu-devel] [PATCH v7 16/18] thread-pool: drop thread_pool_active()

2013-08-09 Thread Stefan Hajnoczi
.io_flush() is no longer called so drop thread_pool_active(). The block layer is the only thread-pool.c user and it already tracks in-flight requests, therefore we do not need thread_pool_active(). Signed-off-by: Stefan Hajnoczi --- thread-pool.c | 8 +--- 1 file changed, 1 insertion(+), 7

[Qemu-devel] [PATCH v7 12/18] block/rbd: drop qemu_rbd_aio_flush_cb()

2013-08-09 Thread Stefan Hajnoczi
.io_flush() is no longer called so drop qemu_rbd_aio_flush_cb(). qemu_aio_count is unused now so drop it too. Signed-off-by: Stefan Hajnoczi --- block/rbd.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/block/rbd.c b/block/rbd.c index cb71751..71b4a0c 100644

[Qemu-devel] [PATCH v7 11/18] block/nbd: drop nbd_have_request()

2013-08-09 Thread Stefan Hajnoczi
.io_flush() is no longer called so drop nbd_have_request(). We cannot drop in_flight since it is still used by other block/nbd.c code. Signed-off-by: Stefan Hajnoczi --- block/nbd.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/block/nbd.c b/block/nbd.c inde

[Qemu-devel] [PATCH v7 18/18] aio: drop io_flush argument

2013-08-09 Thread Stefan Hajnoczi
The .io_flush() handler no longer exists and has no users. Drop the io_flush argument to aio_set_fd_handler() and related functions. The AioFlushEventNotifierHandler and AioFlushHandler typedefs are no longer used and are dropped too. Reviewed-by: Paolo Bonzini Signed-off-by: Stefan Hajnoczi -

Re: [Qemu-devel] [PATCH v6 00/18] aio: drop io_flush()

2013-08-09 Thread Stefan Hajnoczi
On Fri, Aug 09, 2013 at 03:14:11PM +0800, Wenchao Xia wrote: > 于 2013-8-6 23:07, Stefan Hajnoczi 写道: > >On Thu, Jul 25, 2013 at 05:18:07PM +0200, Stefan Hajnoczi wrote: > >Ping? > > > I tried to apply this series to do more work above it, but seems > code conflict with upstream. I sent a new rev

Re: [Qemu-devel] [RFC] [PATCHv8 00/30] aio / timers: Add AioContext timers and use ppoll

2013-08-09 Thread liu ping fan
On Fri, Aug 9, 2013 at 4:12 PM, Jan Kiszka wrote: > On 2013-08-08 23:41, Alex Bligh wrote: >> This patch series adds support for timers attached to an AioContext clock >> which get called within aio_poll. >> >> In doing so it removes alarm timers and moves to use ppoll where possible. >> >> This p

Re: [Qemu-devel] [RFC] [PATCHv8 00/30] aio / timers: Add AioContext timers and use ppoll

2013-08-09 Thread Jan Kiszka
On 2013-08-09 10:24, liu ping fan wrote: > Hi Jan, do you work on pushing hpet onto dedicated thread? If you do, > I will cease my current work. No, the HPET is not needed for our current use case, just the MC146818. Jan -- Siemens AG, Corporate Technology, CT RTC ITP SES-DE Corporate Competenc

[Qemu-devel] [PATCH v7 07/18] block/curl: drop curl_aio_flush()

2013-08-09 Thread Stefan Hajnoczi
.io_flush() is no longer called so drop curl_aio_flush(). The acb[] array that the function checks is still used in other parts of block/curl.c. Therefore we cannot remove acb[], it is needed. Signed-off-by: Stefan Hajnoczi --- block/curl.c | 22 +++--- 1 file changed, 3 insert

Re: [Qemu-devel] [PATCH v1 2/5] slirp: make timeout local

2013-08-09 Thread liu ping fan
On Fri, Aug 9, 2013 at 4:06 PM, Paolo Bonzini wrote: > Il 08/08/2013 08:26, Liu Ping Fan ha scritto: >> Each slirp has its own time to caculate timeout. >> >> Signed-off-by: Liu Ping Fan >> --- >> slirp/slirp.c | 22 ++ >> slirp/slirp.h | 3 +++ >> 2 files changed, 13 insert

[Qemu-devel] [PATCH v2] pci: Introduce helper to retrieve a PCI device's DMA address space

2013-08-09 Thread Alexey Kardashevskiy
A PCI device's DMA address space (possibly an IOMMU) is returned by a method on the PCIBus. At the moment that only has one caller, so the method is simply open coded. We'll need another caller for VFIO, so this patch introduces a helper/wrapper function. Signed-off-by: David Gibson [aik: added

[Qemu-devel] [PATCH] spapr-pci: fix config space access to support bridges

2013-08-09 Thread Alexey Kardashevskiy
spapr-pci config space accessors use find_dev() to find a PCI device. However find_dev() only searched on a primary bus and did not do recursive search through secondary buses so config space access was not possible for devices other that on a primary bus. This fixed find_dev() by using the PCI AP

Re: [Qemu-devel] [RFC] [PATCHv8 05/30] aio / timers: Add prctl(PR_SET_TIMERSLACK, 1, ...) to reduce timer slack

2013-08-09 Thread Stefan Hajnoczi
On Thu, Aug 08, 2013 at 10:42:02PM +0100, Alex Bligh wrote: > Where supported, called prctl(PR_SET_TIMERSLACK, 1, ...) to > set one nanosecond timer slack to increase precision of timer > calls. > > Signed-off-by: Alex Bligh > --- > qemu-timer.c |7 +++ > 1 file changed, 7 insertions(+)

Re: [Qemu-devel] [RFC] [PATCHv8 11/30] aio / timers: Add a notify callback to QEMUTimerList

2013-08-09 Thread Stefan Hajnoczi
On Thu, Aug 08, 2013 at 10:42:08PM +0100, Alex Bligh wrote: > @@ -213,13 +214,41 @@ QEMUClock *timerlist_get_clock(QEMUTimerList > *timer_list); > bool timerlist_run_timers(QEMUTimerList *timer_list); > > /** > + * timerlist_set_notify_cb: > + * @timer_list: the timer list to use > + * @cb: th

Re: [Qemu-devel] [ceph-users] qemu-1.4.0 and onwards, linux kernel 3.2.x, ceph-RBD, heavy I/O leads to kernel_hung_tasks_timout_secs message and unresponsive qemu-process, [Bug 1207686]

2013-08-09 Thread Oliver Francke
Hi Josh, just opened http://tracker.ceph.com/issues/5919 with all collected information incl. debug-log. Hope it helps, Oliver. On 08/08/2013 07:01 PM, Josh Durgin wrote: On 08/08/2013 05:40 AM, Oliver Francke wrote: Hi Josh, I have a session logged with: debug_ms=1:debug_rbd=20:deb

Re: [Qemu-devel] [RFC] [PATCHv8 23/30] aio / timers: Rearrange timer.h & make legacy functions call non-legacy

2013-08-09 Thread Stefan Hajnoczi
On Thu, Aug 08, 2013 at 10:42:20PM +0100, Alex Bligh wrote: > @@ -269,17 +299,17 @@ bool timerlist_expired(QEMUTimerList *timer_list); > int64_t timerlist_deadline_ns(QEMUTimerList *timer_list); > > /** > - * timerlist_getclock: > + * timerlist_get_clock: > * @timer_list: the timer list to op

Re: [Qemu-devel] [PATCH v1 2/5] slirp: make timeout local

2013-08-09 Thread Paolo Bonzini
Il 09/08/2013 10:48, liu ping fan ha scritto: > After patch 3,4, the timeout will be an param for GSource's prepare. > So I think I will set the right timeout value in patch4? No, please do it before (in fact you can extract this patch and the timeout change to a seprate series). Then patch 4 can

Re: [Qemu-devel] [PATCH v2] pci: Introduce helper to retrieve a PCI device's DMA address space

2013-08-09 Thread Paolo Bonzini
Il 09/08/2013 10:49, Alexey Kardashevskiy ha scritto: > A PCI device's DMA address space (possibly an IOMMU) is returned by a > method on the PCIBus. At the moment that only has one caller, so the > method is simply open coded. We'll need another caller for VFIO, so > this patch introduces a help

Re: [Qemu-devel] [RFC] [PATCHv8 00/30] aio / timers: Add AioContext timers and use ppoll

2013-08-09 Thread Stefan Hajnoczi
On Thu, Aug 08, 2013 at 10:41:57PM +0100, Alex Bligh wrote: > This patch series adds support for timers attached to an AioContext clock > which get called within aio_poll. Patch 29/30 didn't make it to my inbox. It may have been bounced due to size. Using your git repo instead. Stefan

Re: [Qemu-devel] [SeaBIOS] [PATCH] acpi: hide 64-bit PCI hole for Windows XP

2013-08-09 Thread Gerd Hoffmann
Hi, > Converting src/smm.c to use a runtime value isn't hard - just change > the assembler from: "mov $" __stringify(PORT_ACPI_PM_BASE) " + 0x04, > %dx\n" to: "mov 4(my_acpi_base), %dx\n" and make sure to define the > global variable my_acpi_base as VARFSEG. The apm fix brought a ctl register v

Re: [Qemu-devel] [PATCH v2] pci: Introduce helper to retrieve a PCI device's DMA address space

2013-08-09 Thread Alexey Kardashevskiy
On 08/09/2013 07:40 PM, Paolo Bonzini wrote: > Il 09/08/2013 10:49, Alexey Kardashevskiy ha scritto: >> A PCI device's DMA address space (possibly an IOMMU) is returned by a >> method on the PCIBus. At the moment that only has one caller, so the >> method is simply open coded. We'll need another

[Qemu-devel] mac -vnc has bug

2013-08-09 Thread Peter Cheung
Hi Allqemu 1.6.1 has bug when starting it with -vnc, when i connect it using vncviewer, the vncviewer will close automatically. $uname -aDarwin Peters-MacBook-Air.local 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64 compile by:./

Re: [Qemu-devel] [PATCH v2] pci: Introduce helper to retrieve a PCI device's DMA address space

2013-08-09 Thread Paolo Bonzini
Il 09/08/2013 11:48, Alexey Kardashevskiy ha scritto: > On 08/09/2013 07:40 PM, Paolo Bonzini wrote: >> Il 09/08/2013 10:49, Alexey Kardashevskiy ha scritto: >>> A PCI device's DMA address space (possibly an IOMMU) is returned by a >>> method on the PCIBus. At the moment that only has one caller,

[Qemu-devel] [PATCH v5 1/8] vvfat: use bdrv_new() to allocate BlockDriverState

2013-08-09 Thread Fam Zheng
we need bdrv_new() to properly initialize BDS, don't allocate memory manually. Signed-off-by: Fam Zheng --- block/vvfat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/vvfat.c b/block/vvfat.c index cd3b8ed..a827d91 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -29

[Qemu-devel] [PATCH v5 0/8] Implement reference count for BlockDriverState [resend]

2013-08-09 Thread Fam Zheng
[resend to the correct list] BlockDriverState lifecycle management is needed by future features such as image fleecing and blockdev-add. This series adds reference count to BlockDriverState. The first two patches clean up two odd BlockDriverState use cases, so all code uses bdrv_new() to create B

[Qemu-devel] [PATCH v5 3/8] block: implement reference count for BlockDriverState

2013-08-09 Thread Fam Zheng
Introduce bdrv_ref/bdrv_unref to manage the lifecycle of BlockDriverState. They are unused for now but will used to replace bdrv_delete() later. Signed-off-by: Fam Zheng --- block.c | 21 + include/block/block.h | 2 ++ include/block/block_int.h | 1 +

[Qemu-devel] [PATCH v5 6/8] xen_disk: simplify blk_disconnect with refcnt

2013-08-09 Thread Fam Zheng
We call bdrv_attach_dev when initializing whether or not bs is created locally, so call bdrv_detach_dev and let the refcnt handle the lifecycle. Signed-off-by: Fam Zheng --- hw/block/xen_disk.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/block/xen_disk.c b/

[Qemu-devel] [PATCH v5 2/8] iscsi: use bdrv_new() instead of stack structure

2013-08-09 Thread Fam Zheng
BlockDriverState structure needs bdrv_new() to initialize refcnt, don't allocate a local structure variable and memset to 0, becasue with coming refcnt implementation, bdrv_unref will crash if bs->refcnt not initialized to 1. Signed-off-by: Fam Zheng --- block/iscsi.c | 16 +--- 1 fi

Re: [Qemu-devel] [RFC] [PATCHv8 09/30] aio / timers: Add QEMUTimerListGroup and helper functions

2013-08-09 Thread Paolo Bonzini
Il 08/08/2013 23:42, Alex Bligh ha scritto: > Add QEMUTimerListGroup and helper functions, to represent > a QEMUTimerList associated with each clock. Add a default > QEMUTimerListGroup representing the default timer lists > which are not associated with any other object (e.g. > an AioContext as add

[Qemu-devel] [PATCH v5 4/8] block: make bdrv_delete() static

2013-08-09 Thread Fam Zheng
Manage BlockDriverState lifecycle with refcnt, so bdrv_delete() is no longer public and should be called by bdrv_unref() if refcnt is decreased to 0. This is an identical change because effectively, there's no multiple reference of BDS now: no caller of bdrv_ref() yet, only bdrv_new() sets bs->ref

Re: [Qemu-devel] [RFC] [PATCHv8 07/30] aio / timers: Split QEMUClock into QEMUClock and QEMUTimerList

2013-08-09 Thread Paolo Bonzini
Il 08/08/2013 23:42, Alex Bligh ha scritto: > Split QEMUClock into QEMUClock and QEMUTimerList so that we can > have more than one QEMUTimerList associated with the same clock. > > Introduce a main_loop_timerlist concept and make existing > qemu_clock_* calls that actually should operate on a QEMU

[Qemu-devel] [PATCH v5 7/8] nbd: use BlockDriverState refcnt

2013-08-09 Thread Fam Zheng
Previously, nbd calls drive_get_ref() on the drive of bs. A BDS doesn't always have associated dinfo, which nbd doesn't care either. We already have BDS ref count, so use it to make it safe for a BDS w/o blockdev. Signed-off-by: Fam Zheng --- blockdev-nbd.c | 10 +- nbd.c | 5 +

Re: [Qemu-devel] [RFC] [PATCHv8 15/30] aio / timers: Convert mainloop to use timeout

2013-08-09 Thread Paolo Bonzini
Il 08/08/2013 23:42, Alex Bligh ha scritto: > Convert mainloop to use timeout from default timerlist group > (i.e. the current 3 static timers) And with two AioContexts in the main loop this patch disappears completely, since the deadline is computed by the second AioContext. Paolo > Signed-off-

[Qemu-devel] [PATCH v5 8/8] block: use BDS ref for block jobs

2013-08-09 Thread Fam Zheng
Block jobs used drive_get_ref(drive_get_by_blockdev(bs)) to avoid BDS being deleted. Now we have BDS reference count, and block jobs don't care about dinfo, so replace them to get cleaner code. It is also the safe way when BDS has no drive info. Signed-off-by: Fam Zheng --- blockdev.c | 53 -

Re: [Qemu-devel] [RFC] [PATCHv8 11/30] aio / timers: Add a notify callback to QEMUTimerList

2013-08-09 Thread Paolo Bonzini
Il 08/08/2013 23:42, Alex Bligh ha scritto: > Add a notify pointer to QEMUTimerList so it knows what to notify > on a timer change. If we do the "two AioContexts" trick, this can simply be a back-pointer to the AioContext. Paolo > Signed-off-by: Alex Bligh > --- > async.c |7 +

Re: [Qemu-devel] [RFC] [PATCHv8 16/30] aio / timers: On timer modification, qemu_notify or aio_notify

2013-08-09 Thread Paolo Bonzini
Il 08/08/2013 23:42, Alex Bligh ha scritto: > On qemu_mod_timer_ns, ensure qemu_notify or aio_notify is called to > end the appropriate poll(), irrespective of use_icount value. > > On qemu_clock_enable, ensure qemu_notify or aio_notify is called for > all QEMUTimerLists attached to the QEMUClock.

Re: [Qemu-devel] [RFC] [PATCHv8 12/30] aio / timers: aio_ctx_prepare sets timeout from AioContext timers

2013-08-09 Thread Paolo Bonzini
Il 08/08/2013 23:42, Alex Bligh ha scritto: > Calculate the timeout in aio_ctx_prepare taking into account > the timers attached to the AioContext. > > Alter aio_ctx_check similarly. > > Signed-off-by: Alex Bligh > --- > async.c | 13 +++-- > 1 file changed, 11 insertions(+), 2 deleti

Re: [Qemu-devel] [RFC] [PATCHv8 13/30] aio / timers: Add aio_timer_new wrapper

2013-08-09 Thread Paolo Bonzini
Il 08/08/2013 23:42, Alex Bligh ha scritto: > Add aio_timer_new wrapper function. > > Signed-off-by: Alex Bligh > --- > include/block/aio.h | 19 +++ > 1 file changed, 19 insertions(+) > > diff --git a/include/block/aio.h b/include/block/aio.h > index a13f6e8..bd6f17c 100644 >

Re: [Qemu-devel] [PATCH v2] pci: Introduce helper to retrieve a PCI device's DMA address space

2013-08-09 Thread Alexey Kardashevskiy
On 08/09/2013 07:53 PM, Paolo Bonzini wrote: > Il 09/08/2013 11:48, Alexey Kardashevskiy ha scritto: >> On 08/09/2013 07:40 PM, Paolo Bonzini wrote: >>> Il 09/08/2013 10:49, Alexey Kardashevskiy ha scritto: A PCI device's DMA address space (possibly an IOMMU) is returned by a method on th

Re: [Qemu-devel] [PATCH v2] pci: Introduce helper to retrieve a PCI device's DMA address space

2013-08-09 Thread Paolo Bonzini
Il 09/08/2013 12:13, Alexey Kardashevskiy ha scritto: > On 08/09/2013 07:53 PM, Paolo Bonzini wrote: >> Il 09/08/2013 11:48, Alexey Kardashevskiy ha scritto: >>> On 08/09/2013 07:40 PM, Paolo Bonzini wrote: Il 09/08/2013 10:49, Alexey Kardashevskiy ha scritto: > A PCI device's DMA address

Re: [Qemu-devel] [PATCH v2] pci: Introduce helper to retrieve a PCI device's DMA address space

2013-08-09 Thread Benjamin Herrenschmidt
On Fri, 2013-08-09 at 11:40 +0200, Paolo Bonzini wrote: > (BTW, do you need to enable bus-master DMA on PCI bridges, to do DMA > for devices sitting on the secondary bus?) In theory yes though I have seen bridges who ignore it... Cheers, Ben.

Re: [Qemu-devel] [RFC] [PATCHv8 28/30] aio / timers: Add scripts/switch-timer-api

2013-08-09 Thread Paolo Bonzini
Il 08/08/2013 23:42, Alex Bligh ha scritto: > Add scripts/switch-timer-api to programatically rewrite source > files to use the new timer system. > > Signed-off-by: Alex Bligh > --- > scripts/switch-timer-api | 178 > ++ > 1 file changed, 178 inserti

Re: [Qemu-devel] [RFC] [PATCHv8 28/30] aio / timers: Add scripts/switch-timer-api

2013-08-09 Thread Paolo Bonzini
Il 08/08/2013 23:42, Alex Bligh ha scritto: > + # these have just changed name > + $line =~ s/\bqemu_mod_timer\b/qemu_timer_mod/g; > + $line =~ s/\bqemu_mod_timer_(ns|us|ms)\b/qemu_timer_mod_$1/g; > + $line =~ s/\bqemu_free_timer\b/qemu_timer_free/g; > + $lin

[Qemu-devel] [PATCH v5 5/8] migration: omit drive ref as we have bdrv_ref now

2013-08-09 Thread Fam Zheng
block-migration.c does not actually use DriveInfo anywhere. Hence it's safe to drive ref code, we really only care about referencing BDS. Signed-off-by: Fam Zheng --- block-migration.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block-migration.c b/block-migration.c

Re: [Qemu-devel] [RFC] [PATCHv8 00/30] aio / timers: Add AioContext timers and use ppoll

2013-08-09 Thread Paolo Bonzini
Il 08/08/2013 23:41, Alex Bligh ha scritto: > This patch series adds support for timers attached to an AioContext clock > which get called within aio_poll. > > In doing so it removes alarm timers and moves to use ppoll where possible. > > This patch set 'sort of' passes make check (see below for

Re: [Qemu-devel] [PATCH v2] pci: Introduce helper to retrieve a PCI device's DMA address space

2013-08-09 Thread Paolo Bonzini
Il 09/08/2013 12:20, Benjamin Herrenschmidt ha scritto: > On Fri, 2013-08-09 at 11:40 +0200, Paolo Bonzini wrote: >> (BTW, do you need to enable bus-master DMA on PCI bridges, to do DMA >> for devices sitting on the secondary bus?) > > In theory yes though I have seen bridges who ignore it... And

Re: [Qemu-devel] [RFC] [PATCHv8 00/30] aio / timers: Add AioContext timers and use ppoll

2013-08-09 Thread Alex Bligh
Jan, --On 9 August 2013 10:12:45 +0200 Jan Kiszka wrote: Do you have this in git somewhere? I'd like to port my (almost) BQL-free threaded RTC device model on top to check how well the new API works. But it looks promising. Per my subsequent message: For ease of review, the finished result

Re: [Qemu-devel] [PATCH v2] pci: Introduce helper to retrieve a PCI device's DMA address space

2013-08-09 Thread David Gibson
On Fri, Aug 09, 2013 at 07:48:16PM +1000, Alexey Kardashevskiy wrote: > On 08/09/2013 07:40 PM, Paolo Bonzini wrote: > > Il 09/08/2013 10:49, Alexey Kardashevskiy ha scritto: > >> A PCI device's DMA address space (possibly an IOMMU) is returned by a > >> method on the PCIBus. At the moment that on

Re: [Qemu-devel] [PATCH v2] pci: Introduce helper to retrieve a PCI device's DMA address space

2013-08-09 Thread Alexey Kardashevskiy
On 08/09/2013 08:19 PM, Paolo Bonzini wrote: > Il 09/08/2013 12:13, Alexey Kardashevskiy ha scritto: >> On 08/09/2013 07:53 PM, Paolo Bonzini wrote: >>> Il 09/08/2013 11:48, Alexey Kardashevskiy ha scritto: On 08/09/2013 07:40 PM, Paolo Bonzini wrote: > Il 09/08/2013 10:49, Alexey Kardashe

Re: [Qemu-devel] [PATCH v2] pci: Introduce helper to retrieve a PCI device's DMA address space

2013-08-09 Thread Paolo Bonzini
Il 09/08/2013 12:58, Alexey Kardashevskiy ha scritto: > On 08/09/2013 08:19 PM, Paolo Bonzini wrote: >> Il 09/08/2013 12:13, Alexey Kardashevskiy ha scritto: >>> On 08/09/2013 07:53 PM, Paolo Bonzini wrote: Il 09/08/2013 11:48, Alexey Kardashevskiy ha scritto: > On 08/09/2013 07:40 PM, Pao

Re: [Qemu-devel] [RFC] [PATCHv8 00/30] aio / timers: Add AioContext timers and use ppoll

2013-08-09 Thread Stefan Hajnoczi
On Thu, Aug 08, 2013 at 10:41:57PM +0100, Alex Bligh wrote: > This patch series adds support for timers attached to an AioContext clock > which get called within aio_poll. > > In doing so it removes alarm timers and moves to use ppoll where possible. > > This patch set 'sort of' passes make check

Re: [Qemu-devel] [PATCH v2] pci: Introduce helper to retrieve a PCI device's DMA address space

2013-08-09 Thread Alexey Kardashevskiy
On 08/09/2013 09:07 PM, Paolo Bonzini wrote: > Il 09/08/2013 12:58, Alexey Kardashevskiy ha scritto: >> On 08/09/2013 08:19 PM, Paolo Bonzini wrote: >>> Il 09/08/2013 12:13, Alexey Kardashevskiy ha scritto: On 08/09/2013 07:53 PM, Paolo Bonzini wrote: > Il 09/08/2013 11:48, Alexey Kardashe

Re: [Qemu-devel] [PATCH v2] pci: Introduce helper to retrieve a PCI device's DMA address space

2013-08-09 Thread Paolo Bonzini
Il 09/08/2013 13:21, Alexey Kardashevskiy ha scritto: > On 08/09/2013 09:07 PM, Paolo Bonzini wrote: >> Il 09/08/2013 12:58, Alexey Kardashevskiy ha scritto: >>> On 08/09/2013 08:19 PM, Paolo Bonzini wrote: Il 09/08/2013 12:13, Alexey Kardashevskiy ha scritto: > On 08/09/2013 07:53 PM, Pao

Re: [Qemu-devel] [PATCH for-next] spapr: Avoid "HOST@0" CPU node name in SLOF device tree for -cpu host

2013-08-09 Thread Andreas Färber
Am 08.08.2013 07:15, schrieb Prerna Saxena: > On 08/01/2013 06:32 AM, Andreas Färber wrote: >> By default on KVM or when user asks for it via -cpu host, cpu_model will >> be "host" and sPAPR merely upper-cases it for the SLOF device tree. >> >> Change it so that we get the underlying CPU type, e.g.

[Qemu-devel] [PATCH for 1.6 0/2] Fix unassigned memory and I/O access handling

2013-08-09 Thread Jan Kiszka
This just binds both patches properly together and fixes up the return value size of unassigned_io_read as suggested. Please merge before the 1.6 release. Jan Kiszka (2): memory: Provide separate handling of unassigned io ports accesses Revert "memory: Return -1 again on reads from unsigned re

[Qemu-devel] [PATCH for 1.6 1/2] memory: Provide separate handling of unassigned io ports accesses

2013-08-09 Thread Jan Kiszka
Accesses to unassigned io ports shall return -1 on read and be ignored on write. Ensure these properties via dedicated ops, decoupling us from the memory core's handling of unassigned accesses. Signed-off-by: Jan Kiszka --- exec.c|3 ++- include/exec/ioport.h |2 ++ iopor

[Qemu-devel] [PATCH for 1.6 2/2] Revert "memory: Return -1 again on reads from unsigned regions"

2013-08-09 Thread Jan Kiszka
This reverts commit 9b8c69243585a32d14b9bb9fcd52c37b0b5a1b71. The commit was wrong: We only return -1 on invalid accesses, not on valid but unbacked ones. This broke various corner cases. Signed-off-by: Jan Kiszka --- memory.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --

Re: [Qemu-devel] [PATCH V4 0/5] Continuous Leaky Bucket Throttling*

2013-08-09 Thread Benoît Canet
> It fail with the following error message at exit and I don't know why yet. > qemu-system-x86_64: block.c:1489: bdrv_drain_all: Assertion > `((&bs->tracked_requests)->lh_first == ((void *)0))' failed. I solved this issue: bdrv_drain_all was bogus. Best regards Benoît > > block.c

Re: [Qemu-devel] [PATCH] pc: drop external DSDT loading

2013-08-09 Thread Anthony Liguori
Gerd Hoffmann writes: > On 08/08/13 18:38, Anthony Liguori wrote: >> This breaks migration and is unneeded with modern SeaBIOS. > > No. Dropping for piix is fine. It will break q35 though. Can you elaborate? When Michael and I discussed this I was under the impression that latest SeaBIOS had

Re: [Qemu-devel] -cpu host (was Re: KVM call minutes for 2013-08-06)

2013-08-09 Thread Peter Maydell
On 8 August 2013 13:51, Peter Maydell wrote: > For ARM you can't get at feature info of the host from userspace > (unless you want to get into parsing /proc/cpuinfo), so my current > idea is to have KVM_ARM_VCPU_INIT support a target-cpu-type > which means "whatever host CPU is". To expand on thi

Re: [Qemu-devel] [PATCH v2 3/7] AARCH64: Add aarch64 CPU initialization, get and put registers support

2013-08-09 Thread Peter Maydell
On 23 July 2013 10:33, Mian M. Hamayun wrote: > From: "Mian M. Hamayun" > > The cpu init function tries to initialize with all possible cpu types, as > KVM does not provide a means to detect the real cpu type and simply refuses > to initialize on cpu type mis-match. By using the loop based init f

Re: [Qemu-devel] [PATCH] pc: drop external DSDT loading

2013-08-09 Thread Gerd Hoffmann
On 08/09/13 14:38, Anthony Liguori wrote: > Gerd Hoffmann writes: > >> On 08/08/13 18:38, Anthony Liguori wrote: >>> This breaks migration and is unneeded with modern SeaBIOS. >> >> No. Dropping for piix is fine. It will break q35 though. > > Can you elaborate? When Michael and I discussed th

Re: [Qemu-devel] [libvirt] [PATCH] qemu: Drop qemuDomainMemoryLimit

2013-08-09 Thread Michal Privoznik
[CC'ing qemu-devel list] On 09.08.2013 15:17, Daniel P. Berrange wrote: > On Fri, Aug 09, 2013 at 07:13:58AM -0600, Eric Blake wrote: >> On 08/09/2013 06:56 AM, Michal Privoznik wrote: >>> This function is to guess the correct limit for maximal memory >>> usage by qemu for given domain. This can ne

[Qemu-devel] Are there plans to achieve ram live Snapshot feature?

2013-08-09 Thread Chijianchun
Now in KVM, when RAM snapshot, vcpus needs stopped, it is Unfriendly restrictions to users. Are there plans to achieve ram live Snapshot feature? in my mind, Snapshots can not occupy additional too much memory, So when the memory needs to be changed, the old memory page is needed to flush to th

[Qemu-devel] [PATCH] default-configs: Fix A9MP and A15MP config names

2013-08-09 Thread Peter Maydell
When individual CONFIG_ switches for the A9MPcore and A15MPcore devices were created, they were inadvertently given incorrect names (CONFIG_ARM9MPCORE and CONFIG_ARM15MPCORE). These CPUs are "Cortex-A9MP" and "Cortex-A15MP", and in particular the ARM9 is a different (rather older) CPU than the Cort

Re: [Qemu-devel] [RFC] [PATCHv8 05/30] aio / timers: Add prctl(PR_SET_TIMERSLACK, 1, ...) to reduce timer slack

2013-08-09 Thread Alex Bligh
On 9 Aug 2013, at 09:53, Stefan Hajnoczi wrote: > The ./configure change should also be in this patch. I think it crept > into another patch by mistake. Oops - I will fix. -- Alex Bligh

Re: [Qemu-devel] [PATCH 1/7] virtio: allow byte swapping for vring and config access

2013-08-09 Thread Anthony Liguori
Rusty Russell writes: > Anthony Liguori writes: >> I suspect this is a premature optimization. With a weak function called >> directly in the accessors below, I suspect you would see no measurable >> performance overhead compared to this approach. >> >> It's all very predictable so the CPU shou

[Qemu-devel] [PATCH] pc: compat: remove PCLMULQDQ from Westmere on pc-*-1.4 and older

2013-08-09 Thread Eduardo Habkost
commit 41cb383f42d0cb51d8e3e25e3ecebc954dd4196f made a guest-visible change by adding the PCLMULQDQ bit to Westmere without adding compatibility code to keep the ABI older machine-types. This patch fixes it by adding the missing compat code. Signed-off-by: Eduardo Habkost --- Bug detected by the

Re: [Qemu-devel] [PATCH 1/7] virtio: allow byte swapping for vring and config access

2013-08-09 Thread Anthony Liguori
Rusty Russell writes: > Anthony Liguori writes: >> "Daniel P. Berrange" writes: >> >> The distinction is important in QEMU. ppc64 is still >> TARGET_WORDS_BIGENDIAN. We still want most stl_phys to treat integers >> as big endian. There's just this extra concept that CPU loads/stores >> are s

Re: [Qemu-devel] [RFC] [PATCHv8 11/30] aio / timers: Add a notify callback to QEMUTimerList

2013-08-09 Thread Alex Bligh
On 9 Aug 2013, at 10:02, Stefan Hajnoczi wrote: > When looking at thread-safety I had to think about set_notify_cb() for a > while. The issue is that we add the timerlist to the clock source's > ->timerlists *before* notify_cb has been assigned. > > This could be a problem is another thread re-

Re: [Qemu-devel] [RFC] [PATCHv8 23/30] aio / timers: Rearrange timer.h & make legacy functions call non-legacy

2013-08-09 Thread Alex Bligh
On 9 Aug 2013, at 10:23, Stefan Hajnoczi wrote: > On Thu, Aug 08, 2013 at 10:42:20PM +0100, Alex Bligh wrote: >> @@ -269,17 +299,17 @@ bool timerlist_expired(QEMUTimerList *timer_list); >> int64_t timerlist_deadline_ns(QEMUTimerList *timer_list); >> >> /** >> - * timerlist_getclock: >> + * timer

Re: [Qemu-devel] [RFC] [PATCHv8 00/30] aio / timers: Add AioContext timers and use ppoll

2013-08-09 Thread Alex Bligh
Stefan, On 9 Aug 2013, at 10:41, Stefan Hajnoczi wrote: > Patch 29/30 didn't make it to my inbox. It may have been bounced due to > size. Using your git repo instead. I can break this up into 1 patch per file if you prefer, which is what I was originally going to do. The automated program does

Re: [Qemu-devel] [RFC] [PATCHv8 07/30] aio / timers: Split QEMUClock into QEMUClock and QEMUTimerList

2013-08-09 Thread Alex Bligh
On 9 Aug 2013, at 11:03, Paolo Bonzini wrote: >> >> +/* New format calling conventions for timers */ >> + >> +/** >> + * timer_free: >> + * @ts: the timer >> + * >> + * Free a timer (it must not be on the active list) >> + */ >> +static inline void timer_free(QEMUTimer *ts) >> +{ >> +qemu_fr

Re: [Qemu-devel] [PATCH 1/7] virtio: allow byte swapping for vring and config access

2013-08-09 Thread Andreas Färber
Am 09.08.2013 09:00, schrieb Rusty Russell: > Andreas Färber writes: >> Am 08.08.2013 15:31, schrieb Anthony Liguori: >>> Rusty Russell writes: >>> We have a mechanism to do weak functions via stubs/. I think it would >>> be better to do cpu_get_byteswap() as a stub function and then overload >>

Re: [Qemu-devel] [RFC] [PATCHv8 23/30] aio / timers: Rearrange timer.h & make legacy functions call non-legacy

2013-08-09 Thread Paolo Bonzini
Il 09/08/2013 16:18, Alex Bligh ha scritto: > > On 9 Aug 2013, at 10:23, Stefan Hajnoczi wrote: > >> On Thu, Aug 08, 2013 at 10:42:20PM +0100, Alex Bligh wrote: >>> @@ -269,17 +299,17 @@ bool timerlist_expired(QEMUTimerList *timer_list); >>> int64_t timerlist_deadline_ns(QEMUTimerList *timer_list

Re: [Qemu-devel] [RFC] [PATCHv8 00/30] aio / timers: Add AioContext timers and use ppoll

2013-08-09 Thread Paolo Bonzini
Il 09/08/2013 16:19, Alex Bligh ha scritto: > Stefan, > > On 9 Aug 2013, at 10:41, Stefan Hajnoczi wrote: > >> Patch 29/30 didn't make it to my inbox. It may have been bounced due to >> size. Using your git repo instead. > > I can break this up into 1 patch per file if you prefer, which is > w

  1   2   3   >