Re: [PATCH] KVM test: Silence screendump thread by default

2010-04-20 Thread Michael Goldish
On 04/16/2010 09:12 PM, Lucas Meneghel Rodrigues wrote: The VM screendump thread recently introduced generates a lot of output on debug logs. Such output is not needed most of the time (we are interested to see if a screenshot production attempt failed though) and distracts the user from

Re: [PATCH V5 1/3] perf kvm: Enhance perf to collect KVM guest os statistics from host side

2010-04-20 Thread Ingo Molnar
* Zhang, Yanmin yanmin_zh...@linux.intel.com wrote: unsigned long perf_misc_flags(struct pt_regs *regs) { int misc = 0; + if (perf_guest_cbs perf_guest_cbs-is_in_guest()) { + if (perf_guest_cbs-is_user_mode()) + misc |=

Re: [PATCH V5 1/3] perf kvm: Enhance perf to collect KVM guest os statistics from host side

2010-04-20 Thread Ingo Molnar
* Ingo Molnar mi...@elte.hu wrote: * Zhang, Yanmin yanmin_zh...@linux.intel.com wrote: unsigned long perf_misc_flags(struct pt_regs *regs) { int misc = 0; + if (perf_guest_cbs perf_guest_cbs-is_in_guest()) { + if (perf_guest_cbs-is_user_mode()) +

Re: [PATCH V5 1/3] perf kvm: Enhance perf to collect KVM guest os statistics from host side

2010-04-20 Thread Zhang, Yanmin
On Tue, 2010-04-20 at 08:09 +0200, Ingo Molnar wrote: * Ingo Molnar mi...@elte.hu wrote: * Zhang, Yanmin yanmin_zh...@linux.intel.com wrote: unsigned long perf_misc_flags(struct pt_regs *regs) { int misc = 0; + if (perf_guest_cbs perf_guest_cbs-is_in_guest()) {

Re: [BUG] kvm: dereference srcu-protected pointer without srcu_read_lock() held

2010-04-20 Thread Lai Jiangshan
Marcelo Tosatti wrote: On Mon, Apr 19, 2010 at 01:08:29PM +0300, Avi Kivity wrote: On 04/19/2010 12:58 PM, Lai Jiangshan wrote: Applied the patch I just sent and let CONFIG_PROVE_RCU=y, we can got the following dmesg. And we found that it is because some codes in KVM dereferences

Re: [PATCH 4/5] export new cpuid KVM_CAP

2010-04-20 Thread Avi Kivity
On 04/19/2010 05:50 PM, Glauber Costa wrote: On Sat, Apr 17, 2010 at 09:58:26PM +0300, Avi Kivity wrote: On 04/15/2010 09:37 PM, Glauber Costa wrote: Since we're changing the msrs kvmclock uses, we have to communicate that to the guest, through cpuid. We can add a new KVM_CAP to the

Re: [PATCH 1/5] Add a global synchronization point for pvclock

2010-04-20 Thread Avi Kivity
On 04/19/2010 07:18 PM, Jeremy Fitzhardinge wrote: On 04/19/2010 07:46 AM, Peter Zijlstra wrote: What avi says! :-) On a 32bit machine a 64bit read are two 32bit reads, so last = last_value; becomes: last.high = last_value.high; last.low = last_vlue.low; (or the reverse of

Re: [PATCH 1/5] Add a global synchronization point for pvclock

2010-04-20 Thread Avi Kivity
On 04/20/2010 04:57 AM, Marcelo Tosatti wrote: Marcelo can probably confirm it, but he has a nehalem with an appearently very good tsc source. Even this machine warps. It stops warping if we only write pvclock data structure once and forget it, (which only updated tsc_timestamp once),

Re: [PATCH V3] perf kvm: Enhance perf to collect KVM guest os statistics from host side

2010-04-20 Thread Avi Kivity
On 04/20/2010 06:32 AM, Sheng Yang wrote: On Monday 19 April 2010 16:25:17 Avi Kivity wrote: On 04/17/2010 09:12 PM, Avi Kivity wrote: I think you were right the first time around. Re-reading again (esp. the part about treatment of indirect NMI vmexits), I think this was

Re: [PATCH 1/5] Add a global synchronization point for pvclock

2010-04-20 Thread Avi Kivity
On 04/19/2010 09:35 PM, Zachary Amsden wrote: Sockets and boards too? (IOW, how reliable is TSC_RELIABLE)? Not sure, IIRC we clear that when the TSC sync test fails, eg when we mark the tsc clocksource unusable. Worrying. By the time we detect this the guest may already have gotten

[PATCH RFC v2 0/6] KVM: moving dirty gitmaps to user space!

2010-04-20 Thread Takuya Yoshikawa
Hi, this is the v2 of the moving dirty gitmaps to user space! By this patch, I think everything we need becomes clear. So we want to step forward to be ready for the final version in the near future: of course, this is dependent on x86 and ppc asm issues. BTW, by whom I can get ACK for ppc and

[PATCH RFC v2 1/6] KVM: introduce slot level dirty state management

2010-04-20 Thread Takuya Yoshikawa
This patch introduces is_dirty member for each memory slot. Using this member, we remove the dirty bitmap scan which is done in the get_dirty_log function. This also helps us when we move the dirty bitmaps to user space: we don't have any good way to check the bitmaps in user space with low cost,

[PATCH RFC v2 2/6] KVM: introduce wrapper functions to create and destroy dirty bitmaps

2010-04-20 Thread Takuya Yoshikawa
We will change the vmalloc() and vfree() to do_mmap() and do_munmap() later. This patch makes it easy and cleanup the code. Signed-off-by: Takuya Yoshikawa yoshikawa.tak...@oss.ntt.co.jp Signed-off-by: Fernando Luis Vazquez Cao ferna...@oss.ntt.co.jp --- virt/kvm/kvm_main.c | 27

Re: [PATCH RFC v2 0/6] KVM: moving dirty gitmaps to user space!

2010-04-20 Thread Alexander Graf
On 20.04.2010, at 12:53, Takuya Yoshikawa wrote: Hi, this is the v2 of the moving dirty gitmaps to user space! By this patch, I think everything we need becomes clear. So we want to step forward to be ready for the final version in the near future: of course, this is dependent on x86 and

[PATCH RFC v2 3/6] KVM: introduce a wrapper function to copy dirty bitmaps to user space

2010-04-20 Thread Takuya Yoshikawa
We will replace copy_to_user() to copy_in_user() when we move the dirty bitmaps to user space. But sadly, we have copy_in_user() only for 64 bits architectures. So this function should work as a wrapper to hide ifdefs from outside. Once we get copy_in_user() for 32 bits architectures, we can

[PATCH RFC v2 4/6] KVM: change mark_page_dirty() to handle endian issues explicitly

2010-04-20 Thread Takuya Yoshikawa
We are now using generic___set_le_bit() to make dirty bitmaps le. Though this works well, we have to replace __set_bit() to appropriate uaccess function to move dirty bitmaps to user space. So this patch splits generic___set_le_bit() and prepares for that. Signed-off-by: Takuya Yoshikawa

[PATCH RFC v2 5/6] KVM: moving dirty bitmaps to user space

2010-04-20 Thread Takuya Yoshikawa
We move dirty bitmaps to user space. - Allocation and destruction: we use do_mmap() and do_munmap(). The new bitmap space is twice longer than the original one and we use the additional space for double buffering: this makes it possible to update the active bitmap while letting the user

[PATCH RFC v2 6/6] KVM: introduce a new API for getting dirty bitmaps

2010-04-20 Thread Takuya Yoshikawa
We can now export the addree of the bitmap created by do_mmap() to user space. For the sake of this, we introduce a new API: KVM_SWITCH_DIRTY_LOG: application can use this to trigger the switch of the bitmaps and get the address of the bitmap which has been used until now. This reduces the

Re: [PATCH RFC v2 4/6] KVM: change mark_page_dirty() to handle endian issues explicitly

2010-04-20 Thread Alexander Graf
On 20.04.2010, at 13:00, Takuya Yoshikawa wrote: We are now using generic___set_le_bit() to make dirty bitmaps le. Though this works well, we have to replace __set_bit() to appropriate uaccess function to move dirty bitmaps to user space. So this patch splits generic___set_le_bit() and

Re: [PATCH RFC v2 0/6] KVM: moving dirty gitmaps to user space!

2010-04-20 Thread Takuya Yoshikawa
(2010/04/20 19:54), Alexander Graf wrote: On 20.04.2010, at 12:53, Takuya Yoshikawa wrote: Hi, this is the v2 of the moving dirty gitmaps to user space! By this patch, I think everything we need becomes clear. So we want to step forward to be ready for the final version in the near future:

Re: [PATCH RFC v2 5/6] KVM: moving dirty bitmaps to user space

2010-04-20 Thread Alexander Graf
On 20.04.2010, at 13:02, Takuya Yoshikawa wrote: We move dirty bitmaps to user space. - Allocation and destruction: we use do_mmap() and do_munmap(). The new bitmap space is twice longer than the original one and we use the additional space for double buffering: this makes it

Re: [PATCH RFC v2 6/6] KVM: introduce a new API for getting dirty bitmaps

2010-04-20 Thread Alexander Graf
On 20.04.2010, at 13:03, Takuya Yoshikawa wrote: We can now export the addree of the bitmap created by do_mmap() to user space. For the sake of this, we introduce a new API: KVM_SWITCH_DIRTY_LOG: application can use this to trigger the switch of the bitmaps and get the address of the

Re: [PATCH RFC v2 5/6] KVM: moving dirty bitmaps to user space

2010-04-20 Thread Takuya Yoshikawa
(2010/04/20 20:10), Alexander Graf wrote: On 20.04.2010, at 13:02, Takuya Yoshikawa wrote: We move dirty bitmaps to user space. - Allocation and destruction: we use do_mmap() and do_munmap(). The new bitmap space is twice longer than the original one and we use the additional space for

Re: [PATCH RFC v2 6/6] KVM: introduce a new API for getting dirty bitmaps

2010-04-20 Thread Takuya Yoshikawa
(2010/04/20 20:15), Alexander Graf wrote: On 20.04.2010, at 13:03, Takuya Yoshikawa wrote: We can now export the addree of the bitmap created by do_mmap() to user space. For the sake of this, we introduce a new API: KVM_SWITCH_DIRTY_LOG: application can use this to trigger the switch of

Re: [PATCH RFC v2 6/6] KVM: introduce a new API for getting dirty bitmaps

2010-04-20 Thread Alexander Graf
On 20.04.2010, at 13:33, Takuya Yoshikawa wrote: (2010/04/20 20:15), Alexander Graf wrote: On 20.04.2010, at 13:03, Takuya Yoshikawa wrote: We can now export the addree of the bitmap created by do_mmap() to user space. For the sake of this, we introduce a new API:

Re: [PATCH RFC v2 6/6] KVM: introduce a new API for getting dirty bitmaps

2010-04-20 Thread Takuya Yoshikawa
(2010/04/20 20:33), Alexander Graf wrote: -#define KVM_API_VERSION 12 +#define KVM_API_VERSION 13 Is there a way to keep both interfaces around for some time at least? I'd prefer the API version not to change if not _really_ necessary. To enable the new dirty mapping you could for example

Re: [PATCH RFC v2 0/6] KVM: moving dirty gitmaps to user space!

2010-04-20 Thread Takuya Yoshikawa
Fernando, sorry I have changed some part of this series and forgot to change your Signed-off-by to Cc for some parts. So please give me any comments(objections) as replies to this mail thread. Thanks, Takuya (2010/04/20 19:53), Takuya Yoshikawa wrote: Hi, this is the v2 of the moving

Re: [PATCH 1/5] Add a global synchronization point for pvclock

2010-04-20 Thread Glauber Costa
On Tue, Apr 20, 2010 at 12:35:19PM +0300, Avi Kivity wrote: On 04/20/2010 04:57 AM, Marcelo Tosatti wrote: Marcelo can probably confirm it, but he has a nehalem with an appearently very good tsc source. Even this machine warps. It stops warping if we only write pvclock data structure once

Re: [Qemu-devel] [PATCH] virtio-spec: document block CMD and FLUSH

2010-04-20 Thread Paul Brook
Does this mean that virtio-blk supports all three combinations? 1. FLUSH that isn't a barrier 2. FLUSH that is also a barrier 3. Barrier that is not a flush 1 is good for fsync-like operations; 2 is good for journalling-like ordered operations. 3 sounds like it doesn't mean a

KVM call minutes for Apr 20

2010-04-20 Thread Chris Wright
call agenda - send out a bit earlier - cancel call if no agenda 0.12.4 - expect when Anthony is back online KVM Forum 2010 - call for papers is out...send in your proposals! -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More

Re: [PATCH 1/5] Add a global synchronization point for pvclock

2010-04-20 Thread Avi Kivity
On 04/20/2010 03:59 PM, Glauber Costa wrote: Might be due to NMIs or SMIs interrupting the rdtsc(); ktime_get() operation which establishes the timeline. We could limit it by having a loop doing rdtsc(); ktime_get(); rdtsc(); and checking for some bound, but it isn't worthwhile (and will

[UNTESTED] KVM: do not call kvm_set_irq from irq disabled section

2010-04-20 Thread Marcelo Tosatti
The assigned device interrupt work handler calls kvm_set_irq, which can sleep, for example, waiting for the ioapic mutex, from irq disabled section. https://bugzilla.kernel.org/show_bug.cgi?id=15725 Fix by dropping assigned_dev_lock (and re-enabling interrupts) before invoking kvm_set_irq for

Re: [PATCH 1/5] Add a global synchronization point for pvclock

2010-04-20 Thread Jeremy Fitzhardinge
On 04/20/2010 02:31 AM, Avi Kivity wrote: btw, do you want this code in pvclock.c, or shall we keep it kvmclock specific? I think its a pvclock-level fix. I'd been hoping to avoid having something like this, but I think its ultimately necessary. J -- To unsubscribe from this list: send

Re: [Qemu-devel] [GSoC 2010] Pass-through filesystem support.

2010-04-20 Thread jvrao
Mohammed Gamal wrote: On Tue, Apr 20, 2010 at 12:54 AM, jvrao jv...@linux.vnet.ibm.com wrote: Mohammed Gamal wrote: On Tue, Apr 13, 2010 at 9:08 PM, jvrao jv...@linux.vnet.ibm.com wrote: jvrao wrote: Alexander Graf wrote: On 12.04.2010, at 13:58, Jamie Lokier wrote: Mohammed Gamal wrote:

Re: [PATCH] kvm: use the correct RCU API

2010-04-20 Thread Paul E. McKenney
On Tue, Apr 20, 2010 at 10:09:57AM +0800, Lai Jiangshan wrote: Paul E. McKenney wrote: On Mon, Apr 19, 2010 at 12:49:04PM +0300, Avi Kivity wrote: On 04/19/2010 12:41 PM, Lai Jiangshan wrote: The RCU/SRCU API have already changed for proving RCU usage. I got the following dmesg when

Re: [PATCH 1/5] Add a global synchronization point for pvclock

2010-04-20 Thread Avi Kivity
On 04/20/2010 09:23 PM, Jeremy Fitzhardinge wrote: On 04/20/2010 02:31 AM, Avi Kivity wrote: btw, do you want this code in pvclock.c, or shall we keep it kvmclock specific? I think its a pvclock-level fix. I'd been hoping to avoid having something like this, but I think its

Re: [PATCH 1/5] Add a global synchronization point for pvclock

2010-04-20 Thread Jeremy Fitzhardinge
On 04/20/2010 11:54 AM, Avi Kivity wrote: On 04/20/2010 09:23 PM, Jeremy Fitzhardinge wrote: On 04/20/2010 02:31 AM, Avi Kivity wrote: btw, do you want this code in pvclock.c, or shall we keep it kvmclock specific? I think its a pvclock-level fix. I'd been hoping to avoid having

Re: [PATCH] kvm: use the correct RCU API

2010-04-20 Thread Paul E. McKenney
On Mon, Apr 19, 2010 at 05:41:23PM +0800, Lai Jiangshan wrote: The RCU/SRCU API have already changed for proving RCU usage. I got the following dmesg when PROVE_RCU=y because we used incorrect API. This patch coverts rcu_deference() to srcu_dereference() or family API.

Re: [UNTESTED] KVM: do not call kvm_set_irq from irq disabled section

2010-04-20 Thread Bonenkamp, Ralf
Hi Marcelo, Thanks for the patch. I put it into my kernel source tree and tested the freshly build kernel in my testing environment. The problem is now - almost - gone. The only suspicious message (ONE occurrence immediate after starting the Server 2008 R2 VM) in syslog is now: BUG:

Re: [BUG] kvm: dereference srcu-protected pointer without srcu_read_lock() held

2010-04-20 Thread Paul E. McKenney
On Tue, Apr 20, 2010 at 02:29:29PM +0800, Lai Jiangshan wrote: Marcelo Tosatti wrote: On Mon, Apr 19, 2010 at 01:08:29PM +0300, Avi Kivity wrote: On 04/19/2010 12:58 PM, Lai Jiangshan wrote: Applied the patch I just sent and let CONFIG_PROVE_RCU=y, we can got the following dmesg. And we

Huge memory leak in virtio, see kvm-Bugs-2989366

2010-04-20 Thread Leszek Urbanski
Hi, this is a follow-up to bug 2989366: https://sourceforge.net/tracker/?func=detailatid=893831aid=2989366group_id=180599 after extensive debugging with the guys on #kvm it turns out that the leak is in the qemu-kvm userland process, in virtio-blk. A summary of my setup is described in the bug

Re: Huge memory leak in virtio, see kvm-Bugs-2989366

2010-04-20 Thread Alexander Graf
On 21.04.2010, at 00:29, Leszek Urbanski wrote: Hi, this is a follow-up to bug 2989366: https://sourceforge.net/tracker/?func=detailatid=893831aid=2989366group_id=180599 after extensive debugging with the guys on #kvm it turns out that the leak is in the qemu-kvm userland process, in

Re: [PATCH 1/5] Add a global synchronization point for pvclock

2010-04-20 Thread Zachary Amsden
On 04/19/2010 11:35 PM, Avi Kivity wrote: On 04/20/2010 04:57 AM, Marcelo Tosatti wrote: Marcelo can probably confirm it, but he has a nehalem with an appearently very good tsc source. Even this machine warps. It stops warping if we only write pvclock data structure once and forget it,

Re: [PATCH 1/5] Add a global synchronization point for pvclock

2010-04-20 Thread Zachary Amsden
On 04/20/2010 09:42 AM, Jeremy Fitzhardinge wrote: On 04/20/2010 11:54 AM, Avi Kivity wrote: On 04/20/2010 09:23 PM, Jeremy Fitzhardinge wrote: On 04/20/2010 02:31 AM, Avi Kivity wrote: btw, do you want this code in pvclock.c, or shall we keep it kvmclock specific?

Re: Huge memory leak in virtio, see kvm-Bugs-2989366

2010-04-20 Thread Ryan Harper
* Leszek Urbanski tyg...@moo.pl [2010-04-20 17:37]: Hi, this is a follow-up to bug 2989366: https://sourceforge.net/tracker/?func=detailatid=893831aid=2989366group_id=180599 after extensive debugging with the guys on #kvm it turns out that the leak is in the qemu-kvm userland process,

Re: [Qemu-devel] [GSoC 2010] Pass-through filesystem support.

2010-04-20 Thread Mohammed Gamal
On Tue, Apr 20, 2010 at 8:36 PM, jvrao jv...@linux.vnet.ibm.com wrote: ... snip ... This'd be something interesting to do. I wonder if that would fit in the GSoC timeframe, or whether it'd be a little too short. So how long you'd estimate something like that would take? I think it would