[COMMIT master] KVM: Add missing srcu_read_lock() for kvm_mmu_notifier_release()

2010-04-21 Thread Avi Kivity
From: Lai Jiangshan la...@cn.fujitsu.com I got this dmesg due to srcu_read_lock() is missing in kvm_mmu_notifier_release(). === [ INFO: suspicious rcu_dereference_check() usage. ] ---

[COMMIT master] KVM: MMU: Move sync_page() first pte address calculation out of loop

2010-04-21 Thread Avi Kivity
From: Gui Jianfeng guijianf...@cn.fujitsu.com Move first pte address calculation out of loop to save some cycles. Signed-off-by: Gui Jianfeng guijianf...@cn.fujitsu.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h index

[COMMIT master] KVM: do not call hardware_disable() on CPU_UP_CANCELED

2010-04-21 Thread Avi Kivity
From: Lai Jiangshan la...@cn.fujitsu.com When CPU_UP_CANCELED, hardware_enable() has not been called at the CPU which is going up because raw_notifier_call_chain(CPU_ONLINE) has not been called for this cpu. Drop the handling for CPU_UP_CANCELED. Signed-off-by: Lai Jiangshan

[COMMIT master] PPC: Split context init/destroy functions

2010-04-21 Thread Avi Kivity
From: Alexander Graf ag...@suse.de We need to reserve a context from KVM to make sure we have our own segment space. While we did that split for Book3S_64 already, 32 bit is still outstanding. So let's split it now. Signed-off-by: Alexander Graf ag...@suse.de Acked-by: Benjamin Herrenschmidt

[COMMIT master] KVM: PPC: Add generic segment switching code

2010-04-21 Thread Avi Kivity
From: Alexander Graf ag...@suse.de This is the code that will later be used instead of book3s_64_slb.S. It does the last step of guest entry and the first generic steps of guest exiting, once we have determined the interrupt is a KVM interrupt. It also reads the last used instruction from the

[COMMIT master] KVM: Get rid of dead function gva_to_page()

2010-04-21 Thread Avi Kivity
From: Gui Jianfeng guijianf...@cn.fujitsu.com Nobody use gva_to_page() anymore, get rid of it. Signed-off-by: Gui Jianfeng guijianf...@cn.fujitsu.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 7eff794..d2a110e 100644 ---

[COMMIT master] KVM: PPC: Name generic 64-bit code generic

2010-04-21 Thread Avi Kivity
From: Alexander Graf ag...@suse.de We have quite some code that can be used by Book3S_32 and Book3S_64 alike, so let's call it Book3S instead of Book3S_64, so we can later on use it from the 32 bit port too. Signed-off-by: Alexander Graf ag...@suse.de Signed-off-by: Avi Kivity a...@redhat.com

[COMMIT master] KVM: PPC: Add kvm_book3s_64.h

2010-04-21 Thread Avi Kivity
From: Alexander Graf ag...@suse.de In the process of generalizing as much code as possible, I also moved the shadow vcpu code together to a generic book3s file. Unfortunately the location of the shadow vcpu is different on 32 and 64 bit, so we need a wrapper function to tell us where it is. That

[COMMIT master] KVM: PPC: Add SR swapping code

2010-04-21 Thread Avi Kivity
From: Alexander Graf ag...@suse.de Later in this series we will move the current segment switch code to generic code and make that call hooks for the specific sub-archs (32 vs. 64 bit). This is the hook for 32 bits. It enabled the entry and exit code to swap segment registers with values from

[COMMIT master] KVM: PPC: Emulate segment fault

2010-04-21 Thread Avi Kivity
From: Alexander Graf ag...@suse.de Book3S_32 doesn't know about segment faults. It only knows about page faults. So in order to know that we didn't map a segment, we need to fake segment faults. We do this by setting invalid segment registers to an invalid VSID and then check for that VSID on

[COMMIT master] PPC: Add STLU

2010-04-21 Thread Avi Kivity
From: Alexander Graf ag...@suse.de For assembly code there are several long load and store defines already. The one that's missing is the typical stack store, stdu/stwu. So let's add that define as well, making my KVM code happy. CC: Benjamin Herrenschmidt b...@kernel.crashing.org

[COMMIT master] KVM: PPC: Add kvm_book3s_32.h

2010-04-21 Thread Avi Kivity
From: Alexander Graf ag...@suse.de In analogy to the 64 bit specific header file, this is the 32 bit pendant. With this in place we can just always call to_svcpu and be assured we get the right pointer anywhere. Signed-off-by: Alexander Graf ag...@suse.de Signed-off-by: Avi Kivity

[COMMIT master] KVM: PPC: Add fields to shadow vcpu

2010-04-21 Thread Avi Kivity
From: Alexander Graf ag...@suse.de After a lot of thought on how to make the entry / exit code easier, I figured it'd be clever to put even more register state into the shadow vcpu. That way we have more registers available to use, making the code easier to read. So this patch adds a few new

[COMMIT master] KVM: PPC: Add SVCPU to Book3S_32

2010-04-21 Thread Avi Kivity
From: Alexander Graf ag...@suse.de We need to keep the pointer to the shadow vcpu somewhere accessible from within really early interrupt code. The best fit I found was the thread struct, as that resides in an SPRG. So let's put a pointer to the shadow vcpu in the thread struct and add an

[COMMIT master] KVM: PPC: Use CONFIG_PPC_BOOK3S define

2010-04-21 Thread Avi Kivity
From: Alexander Graf ag...@suse.de Upstream recently added a new name for PPC64: Book3S_64. So instead of using CONFIG_PPC64 we should use CONFIG_PPC_BOOK3S consotently. That makes understanding the code easier (I hope). Signed-off-by: Alexander Graf ag...@suse.de Signed-off-by: Avi Kivity

[COMMIT master] KVM: PPC: Make highmem code generic

2010-04-21 Thread Avi Kivity
From: Alexander Graf ag...@suse.de Since we now have several fields in the shadow VCPU, we also change the internal calling convention between the different entry/exit code layers. Let's reflect that in the IR=1 code and make sure we use long defines for long field access. Signed-off-by:

[COMMIT master] KVM: PPC: Remove fetch fail code

2010-04-21 Thread Avi Kivity
From: Alexander Graf ag...@suse.de When instruction fetch failed, the inline function hook automatically detects that and starts the internal guest memory load function. So whenever we access kvmppc_get_last_inst(), we're sure the result is sane. Signed-off-by: Alexander Graf ag...@suse.de

[COMMIT master] KVM: PPC: Enable Book3S_32 KVM building

2010-04-21 Thread Avi Kivity
From: Alexander Graf ag...@suse.de Now that we have all the bits and pieces in place, let's enable building of the Book3S_32 target. Signed-off-by: Alexander Graf ag...@suse.de Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/powerpc/kvm/Kconfig b/arch/powerpc/kvm/Kconfig index

[COMMIT master] KVM: PPC: Check max IRQ prio

2010-04-21 Thread Avi Kivity
From: Alexander Graf ag...@suse.de We have a define on what the highest bit of IRQ priorities is. So we can just as well use it in the bit checking code and avoid invalid IRQ values to be triggered. Signed-off-by: Alexander Graf ag...@suse.de Signed-off-by: Avi Kivity a...@redhat.com diff --git

[COMMIT master] KVM: PPC: Extract MMU init

2010-04-21 Thread Avi Kivity
From: Alexander Graf ag...@suse.de The host shadow mmu code needs to get initialized. It needs to fetch a segment it can use to put shadow PTEs into. That initialization code was in generic code, which is icky. Let's move it over to the respective MMU file. Signed-off-by: Alexander Graf

[COMMIT master] KVM: PPC: Make real mode handler generic

2010-04-21 Thread Avi Kivity
From: Alexander Graf ag...@suse.de The real mode handler code was originally writen for 64 bit Book3S only. But since we not add 32 bit functionality too, we need to make some tweaks to it. This patch basically combines using the long access defines and using fields from the shadow VCPU we just

[COMMIT master] KVM: PPC: Improve indirect svcpu accessors

2010-04-21 Thread Avi Kivity
From: Alexander Graf ag...@suse.de We already have some inline fuctions we use to access vcpu or svcpu structs, depending on whether we're on booke or book3s. Since we just put a few more registers into the svcpu, we also need to make sure the respective callbacks are available and get used. So

[COMMIT master] KVM: PPC: Set VSID_PR also for Book3S_64

2010-04-21 Thread Avi Kivity
From: Alexander Graf ag...@suse.de Book3S_64 didn't set VSID_PR when we're in PR=1. This lead to pretty bad behavior when searching for the shadow segment, as part of the code relied on VSID_PR being set. This patch fixes booting Book3S_64 guests. Signed-off-by: Alexander Graf ag...@suse.de

[COMMIT master] KVM: PPC: Improve split mode

2010-04-21 Thread Avi Kivity
From: Alexander Graf ag...@suse.de When in split mode, instruction relocation and data relocation are not equal. So far we implemented this mode by reserving a special pseudo-VSID for the two cases and flushing all PTEs when going into split mode, which is slow. Unfortunately 32bit Linux and

[COMMIT master] Merge branch 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6

2010-04-21 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com -- To unsubscribe from this list: send the line unsubscribe kvm-commits in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[COMMIT master] KVM: PPC: Convert u64 - ulong

2010-04-21 Thread Avi Kivity
From: Alexander Graf ag...@suse.de There are some pieces in the code that I overlooked that still use u64s instead of longs. This slows down 32 bit hosts unnecessarily, so let's just move them to ulong. Signed-off-by: Alexander Graf ag...@suse.de Signed-off-by: Avi Kivity a...@redhat.com diff

[COMMIT master] KVM: PPC: Make Alignment interrupts work again

2010-04-21 Thread Avi Kivity
From: Alexander Graf ag...@suse.de In the process of merging Book3S_32 and 64 I somehow ended up having the alignment interrupt handler take last_inst, but the fetching code not fetching it. So we ended up with stale last_inst values. Let's just enable last_inst fetching for alignment interrupts

[COMMIT master] KVM: PPC: Make Performance Counters work

2010-04-21 Thread Avi Kivity
From: Alexander Graf ag...@suse.de When we get a performance counter interrupt we need to route it on to the Linux handler after we got out of the guest context. We also need to tell our handling code that this particular interrupt doesn't need treatment. So let's add those two bits in, making

[COMMIT master] KVM: PPC: Use now shadowed vcpu fields

2010-04-21 Thread Avi Kivity
From: Alexander Graf ag...@suse.de The shadow vcpu now contains some fields we don't use from the vcpu anymore. Access to them happens using inline functions that happily use the shadow vcpu fields. So let's now ifdef them out to booke only and add asm-offsets. Signed-off-by: Alexander Graf

[RFC PATCH 07/20] Introduce qemu_put_vector() and qemu_put_vector_prepare() to use put_vector() in QEMUFile.

2010-04-21 Thread Yoshiaki Tamura
For fool proof purpose, qemu_put_vector_parepare should be called before qemu_put_vector. Then, if qemu_put_* functions except this is called after qemu_put_vector_prepare, program will abort(). Signed-off-by: Yoshiaki Tamura tamura.yoshi...@lab.ntt.co.jp --- hw/hw.h |2 ++ savevm.c | 53

[RFC PATCH 16/20] Introduce event_tap fucntions and ft_tranx_ready().

2010-04-21 Thread Yoshiaki Tamura
event_tap controls when to start ft transaction. do_event_tap() should be instered to the device emulators. ft_tranx_ready() kicks the transaction. Signed-off-by: Yoshiaki Tamura tamura.yoshi...@lab.ntt.co.jp --- migration.c | 77 +

[RFC PATCH 10/20] Introduce skip_header parameter to qemu_loadvm_state() so that it can be called iteratively without reading the header.

2010-04-21 Thread Yoshiaki Tamura
Signed-off-by: Yoshiaki Tamura tamura.yoshi...@lab.ntt.co.jp --- migration-exec.c |2 +- migration-fd.c |2 +- migration-tcp.c |2 +- migration-unix.c |2 +- savevm.c | 25 ++--- sysemu.h |2 +- 6 files changed, 19 insertions(+), 16

[RFC PATCH 11/20] Introduce some socket util functions.

2010-04-21 Thread Yoshiaki Tamura
Signed-off-by: Yoshiaki Tamura tamura.yoshi...@lab.ntt.co.jp --- osdep.c | 13 + qemu-char.c | 25 - qemu_socket.h |4 3 files changed, 41 insertions(+), 1 deletions(-) diff --git a/osdep.c b/osdep.c index 3bab79a..63444e7 100644 ---

[RFC PATCH 06/20] Introduce iovec util functions, qemu_iovec_to_vector() and qemu_iovec_to_size().

2010-04-21 Thread Yoshiaki Tamura
Signed-off-by: Yoshiaki Tamura tamura.yoshi...@lab.ntt.co.jp --- cutils.c | 12 qemu-common.h |2 ++ 2 files changed, 14 insertions(+), 0 deletions(-) diff --git a/cutils.c b/cutils.c index be99b21..1d35590 100644 --- a/cutils.c +++ b/cutils.c @@ -238,3 +238,15 @@ void

[RFC PATCH 13/20] Introduce util functions to control ft_transaction from savevm layer.

2010-04-21 Thread Yoshiaki Tamura
To utilize ft_transaction function, savevm needs interfaces to be exported. Signed-off-by: Yoshiaki Tamura tamura.yoshi...@lab.ntt.co.jp --- hw/hw.h |5 + savevm.c | 41 + 2 files changed, 46 insertions(+), 0 deletions(-) diff --git a/hw/hw.h

[RFC PATCH 12/20] Introduce fault tolerant VM transaction QEMUFile and ft_mode.

2010-04-21 Thread Yoshiaki Tamura
This code implements VM transaction protocol. Like buffered_file, it sits between savevm and migration layer. With this architecture, VM transaction protocol is implemented mostly independent from other existing code. Signed-off-by: Yoshiaki Tamura tamura.yoshi...@lab.ntt.co.jp Signed-off-by:

[RFC PATCH 05/20] Introduce put_vector() and get_vector to QEMUFile and qemu_fopen_ops().

2010-04-21 Thread Yoshiaki Tamura
QEMUFile currently doesn't support writev(). For sending multiple data, such as pages, using writev() should be more efficient. Signed-off-by: Yoshiaki Tamura tamura.yoshi...@lab.ntt.co.jp --- buffered_file.c |2 +- hw/hw.h | 16 savevm.c| 43

[RFC PATCH 19/20] Insert do_event_tap() to virtio-{blk,net}, comment out assert() on cpu_single_env temporally.

2010-04-21 Thread Yoshiaki Tamura
do_event_tap() is inserted to functions which actually fire outputs. By synchronizing VMs before outputs are fired, we can failover to the receiver upon failure. To save VM continuously, comment out assert() on cpu_single_env temporally. Signed-off-by: Yoshiaki Tamura

[RFC PATCH 20/20] Introduce -k option to enable FT migration mode (Kemari).

2010-04-21 Thread Yoshiaki Tamura
When -k option is set to migrate command, it will turn on ft_mode to start FT migration mode (Kemari). Signed-off-by: Yoshiaki Tamura tamura.yoshi...@lab.ntt.co.jp --- migration.c |3 +++ qemu-monitor.hx |7 --- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git

[RFC PATCH 01/20] Modify DIRTY_FLAG value and introduce DIRTY_IDX to use as indexes of bit-based phys_ram_dirty.

2010-04-21 Thread Yoshiaki Tamura
Replaces byte-based phys_ram_dirty bitmap with four (MASTER, VGA, CODE, MIGRATION) bit-based phys_ram_dirty bitmap. On allocation, it sets all bits in the bitmap. It uses ffs() to convert DIRTY_FLAG to DIRTY_IDX. Modifies wrapper functions for byte-based phys_ram_dirty bitmap to bit-based

[RFC PATCH 03/20] Use cpu_physical_memory_set_dirty_range() to update phys_ram_dirty.

2010-04-21 Thread Yoshiaki Tamura
Modifies kvm_get_dirty_pages_log_range to use cpu_physical_memory_set_dirty_range() to update the row of the bit-based phys_ram_dirty bitmap at once. Signed-off-by: Yoshiaki Tamura tamura.yoshi...@lab.ntt.co.jp Signed-off-by: OHMURA Kei ohmura@lab.ntt.co.jp --- qemu-kvm.c | 19

[RFC PATCH 00/20] Kemari for KVM v0.1

2010-04-21 Thread Yoshiaki Tamura
Hi all, We have been implementing the prototype of Kemari for KVM, and we're sending this message to share what we have now and TODO lists. Hopefully, we would like to get early feedback to keep us in the right direction. Although advanced approaches in the TODO lists are fascinating, we would

[RFC PATCH 02/20] Introduce cpu_physical_memory_get_dirty_range().

2010-04-21 Thread Yoshiaki Tamura
It checks the first row and puts dirty addr in the array. If the first row is empty, it skips to the first non-dirty row or the end addr, and put the length in the first entry of the array. Signed-off-by: Yoshiaki Tamura tamura.yoshi...@lab.ntt.co.jp Signed-off-by: OHMURA Kei

[RFC PATCH 17/20] Modify migrate_fd_put_ready() when ft_mode is on.

2010-04-21 Thread Yoshiaki Tamura
When ft_mode is on, migrate_fd_put_ready() would open ft_transaction file and turn on event_tap. To end or cancel ft_transaction, ft_mode and event_tap is turned off. Signed-off-by: Yoshiaki Tamura tamura.yoshi...@lab.ntt.co.jp --- migration.c | 36 +--- 1

[RFC PATCH 04/20] Make QEMUFile buf expandable, and introduce qemu_realloc_buffer() and qemu_clear_buffer().

2010-04-21 Thread Yoshiaki Tamura
Currently buf size is fixed at 32KB. It would be useful if it could be flexible. Signed-off-by: Yoshiaki Tamura tamura.yoshi...@lab.ntt.co.jp --- hw/hw.h |2 ++ savevm.c | 26 +- 2 files changed, 27 insertions(+), 1 deletions(-) diff --git a/hw/hw.h b/hw/hw.h

[RFC PATCH 09/20] Introduce writev and read to FdMigrationState.

2010-04-21 Thread Yoshiaki Tamura
Currently FdMigrationState doesn't support writev() and read(). writev() is introduced to send data efficiently, and read() is necessary to get response from the other side. Signed-off-by: Yoshiaki Tamura tamura.yoshi...@lab.ntt.co.jp --- migration-tcp.c | 20 migration.c

[RFC PATCH 15/20] Introduce FT mode support to configure.

2010-04-21 Thread Yoshiaki Tamura
Signed-off-by: Yoshiaki Tamura tamura.yoshi...@lab.ntt.co.jp --- configure |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/configure b/configure index 046c591..f0682d4 100755 --- a/configure +++ b/configure @@ -298,6 +298,7 @@ bsd_user=no guest_base=

[RFC PATCH 08/20] Introduce RAMSaveIO and use cpu_physical_memory_get_dirty_range() to check multiple dirty pages.

2010-04-21 Thread Yoshiaki Tamura
Introduce RAMSaveIO to use writev for saving ram blocks, and modifies ram_save_block() and ram_save_remaining() to use cpu_physical_memory_get_dirty_range() to check multiple dirty and non-dirty pages at once. Signed-off-by: Yoshiaki Tamura tamura.yoshi...@lab.ntt.co.jp Signed-off-by: OHMURA Kei

[RFC please check] KVM: question about the commit Use Little Endian for Dirty Bitmap

2010-04-21 Thread Takuya Yoshikawa
Hi, Alex, Avi, Marcelo I would like to ask you about the commit: c8240bd6f0b4b1b21ffd36dd44114d05c7afe0c0 Use Little Endian for Dirty Bitmap I pasted a snipet below! I am now confused by the Alex's comment to my recent patch: change mark_page_dirty() to handle endian issues explicitly in

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

2010-04-21 Thread Michael Tokarev
21.04.2010 05:58, Ryan Harper wrote: * Leszek Urbanskityg...@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

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

2010-04-21 Thread jvrao
Mohammed Gamal wrote: 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

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

2010-04-21 Thread Yang, Sheng
On Tuesday 20 April 2010 23:54:01 Marcelo Tosatti wrote: 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

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

2010-04-21 Thread Yang, Sheng
On Wednesday 21 April 2010 05:49:11 Bonenkamp, Ralf wrote: 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

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

2010-04-21 Thread Leszek Urbanski
08761dca-b8fa-41c8-a839-52e09bc06...@suse.de; from Alexander Graf on Wed, Apr 21, 2010 at 00:51:21 +0200 -039b9000-5ccd rw-p 00:00 0 +039b9000-65803000 rw-p 00:00 0 (a heap leak?) I'm willing to debug further. The problem is 100% reproducible. Certainly

Re: [RFC PATCH 04/20] Make QEMUFile buf expandable, and introduce qemu_realloc_buffer() and qemu_clear_buffer().

2010-04-21 Thread Stefan Hajnoczi
On Wed, Apr 21, 2010 at 6:57 AM, Yoshiaki Tamura tamura.yoshi...@lab.ntt.co.jp wrote: @@ -454,6 +458,25 @@ void qemu_fflush(QEMUFile *f)     }  } +void *qemu_realloc_buffer(QEMUFile *f, int size) +{ +    f-buf_max_size = size; + +    f-buf = qemu_realloc(f-buf, f-buf_max_size); +    if

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

2010-04-21 Thread Avi Kivity
On 04/21/2010 03:01 AM, Zachary Amsden wrote: on this machine Glauber mentioned, or even on a multi-core Core 2 Duo), but the delta calculation is very hard (if not impossible) to get right. The timewarps i've seen were in the 0-200ns range, and very rare (once every 10 minutes or so).

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

2010-04-21 Thread Avi Kivity
On 04/21/2010 03:05 AM, Zachary Amsden wrote: On 04/19/2010 11:39 PM, Avi Kivity wrote: 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

Re: [PATCH RFC 1/5] KVM: introduce a set_bit function for bitmaps in user space

2010-04-21 Thread Avi Kivity
On 04/21/2010 07:56 AM, Fernando Luis Vázquez Cao wrote: On 04/12/2010 02:08 AM, Avi Kivity wrote: +#define __set_bit_user_asm(nr, addr, err, errret)\ +asm volatile(1:bts %1,%2\n\ + 2:\n\ + .section

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

2010-04-21 Thread Avi Kivity
On 04/21/2010 01:21 AM, Paul E. McKenney wrote: Subject: [PATCH] kvm: add missing srcu_read_lock() I got this dmesg due to srcu_read_lock() is missing in kvm_mmu_notifier_release(). === [ INFO: suspicious rcu_dereference_check() usage. ]

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

2010-04-21 Thread Avi Kivity
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 PROVE_RCU=y because we used incorrect API. This patch coverts rcu_deference() to srcu_dereference() or family API. Applied, thanks. -- error compiling

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

2010-04-21 Thread Avi Kivity
On 04/21/2010 12:55 AM, Paul E. McKenney wrote: 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

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

2010-04-21 Thread Avi Kivity
On 04/21/2010 10:53 AM, Leszek Urbanski wrote: 08761dca-b8fa-41c8-a839-52e09bc06...@suse.de; from Alexander Graf on Wed, Apr 21, 2010 at 00:51:21 +0200 -039b9000-5ccd rw-p 00:00 0 +039b9000-65803000 rw-p 00:00 0 (a heap leak?) I'm willing to debug further. The

Re: [RFC PATCH 04/20] Make QEMUFile buf expandable, and introduce qemu_realloc_buffer() and qemu_clear_buffer().

2010-04-21 Thread Yoshiaki Tamura
2010/4/21 Stefan Hajnoczi stefa...@gmail.com: On Wed, Apr 21, 2010 at 6:57 AM, Yoshiaki Tamura tamura.yoshi...@lab.ntt.co.jp wrote: @@ -454,6 +458,25 @@ void qemu_fflush(QEMUFile *f)     }  } +void *qemu_realloc_buffer(QEMUFile *f, int size) +{ +    f-buf_max_size = size; + +    f-buf =

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

2010-04-21 Thread Fernando Luis Vázquez Cao
On 04/20/2010 08:03 PM, Takuya Yoshikawa wrote: @@ -318,7 +318,7 @@ struct kvm_dirty_log { __u32 padding1; union { void __user *dirty_bitmap; /* one bit per page */ - __u64 padding2; + __u64 addr; This can break on x86_32 and x86_64-compat.

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

2010-04-21 Thread Avi Kivity
On 04/20/2010 06:54 PM, Marcelo Tosatti wrote: 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: [RFC][PATCH v2 0/3] Provide a zero-copy method on KVM virtio-net.

2010-04-21 Thread Michael S. Tsirkin
On Tue, Apr 20, 2010 at 10:21:55AM +0800, Xin, Xiaohui wrote: Michael, What we have not done yet: packet split support What does this mean, exactly? We can support 1500MTU, but for jumbo frame, since vhost driver before don't support mergeable buffer, we cannot try it for

Re: [PATCH] kvm: do not need hardware_disable when CPU_UP_CANCELED

2010-04-21 Thread Avi Kivity
On 04/17/2010 12:00 PM, Lai Jiangshan wrote: When CPU_UP_CANCELED, hardware_enable() has not been called at the CPU which is going up because raw_notifier_call_chain(CPU_ONLINE) has not been called for this cpu. Applied, thanks. -- error compiling committee.c: too many arguments to

Re: [RFC please check] KVM: question about the commit Use Little Endian for Dirty Bitmap

2010-04-21 Thread Takuya Yoshikawa
(2010/04/21 15:07), Takuya Yoshikawa wrote: === not tested === [PATCH sample] KVM: avoid to include an asm-generic bitops header file directly Including asm-generic bitops headers is kind of violation: there is no guarantee that no one will change those functions we are using. Signed-off-by:

Re: [PATCH 1/2] kvm: simplify kvm_vm_ioctl_set_memory_alias

2010-04-21 Thread Avi Kivity
On 04/17/2010 12:20 PM, Lai Jiangshan wrote: It's just time waste if we free a object and allocate it immediately. The alias code is scheduled to be killed off soon, (see Documentation/feature-removal-schedule.txt), so there's not much point in optimizing it. -- error compiling

Re: QEMU-KVM and video performance

2010-04-21 Thread Avi Kivity
On 04/19/2010 10:14 PM, Gerhard Wiesinger wrote: Hello, Finally I got QEMU-KVM to work but video performance under DOS is very low (QEMU 0.12.3 stable and QEMU GIT master branch is fast, QEMU KVM is slow) I'm measuring 2 performance critical video performance parameters: 1.) INT 10h,

Re: [PATCH 1/4] KVM: Move first pte address calculation out of loop to save some cycles

2010-04-21 Thread Avi Kivity
On 04/16/2010 12:16 PM, Gui Jianfeng wrote: Move first pte address calculation out of loop to save some cycles Applied all four patches, thanks. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a

Re: [PATCH] KVM: MMU: cleanup for function unaccount_shadowed()

2010-04-21 Thread Avi Kivity
On 04/16/2010 11:21 AM, Wei Yongjun wrote: Since gfn is not changed in the for loop, we do not need to call gfn_to_memslot_unaliased() under the loop, and it is safe to move it out. Applied, thanks. -- error compiling committee.c: too many arguments to function -- To unsubscribe from

Re: [PATCH][STABLE] KVM: x86: Fix TSS size check for 16-bit tasks

2010-04-21 Thread Avi Kivity
On 04/14/2010 05:57 PM, Jan Kiszka wrote: A 16-bit TSS is only 44 bytes long. So make sure to test for the correct size on task switch. Signed-off-by: Jan Kiszkajan.kis...@siemens.com --- This is a backport of 8f2d524 from master. It applies at least down to 2.6.32 and should be considered for

Re: [RFC please check] KVM: question about the commit Use Little Endian for Dirty Bitmap

2010-04-21 Thread Avi Kivity
On 04/21/2010 09:07 AM, Takuya Yoshikawa wrote: Hi, Alex, Avi, Marcelo I would like to ask you about the commit: c8240bd6f0b4b1b21ffd36dd44114d05c7afe0c0 Use Little Endian for Dirty Bitmap I pasted a snipet below! I am now confused by the Alex's comment to my recent patch: change

Re: [PATCH 01/27] KVM: PPC: Name generic 64-bit code generic

2010-04-21 Thread Avi Kivity
On 04/16/2010 01:11 AM, Alexander Graf wrote: We have quite some code that can be used by Book3S_32 and Book3S_64 alike, so let's call it Book3S instead of Book3S_64, so we can later on use it from the 32 bit port too. Signed-off-by: Alexander Grafag...@suse.de ---

Re: [PATCH] [RFC] KVM test: Create a remote session cleaning thread

2010-04-21 Thread Michael Goldish
On 04/17/2010 01:23 AM, Lucas Meneghel Rodrigues wrote: In some occasions even though a VM has terminated, some remote shell sessions will take a long time before giving up on the host. This situation is happening frequently on subtests such as autotest: The VM shuts down, but the session

Re: [RFC please check] KVM: question about the commit Use Little Endian for Dirty Bitmap

2010-04-21 Thread Alexander Graf
On 21.04.2010, at 11:26, Avi Kivity wrote: On 04/21/2010 09:07 AM, Takuya Yoshikawa wrote: Hi, Alex, Avi, Marcelo I would like to ask you about the commit: c8240bd6f0b4b1b21ffd36dd44114d05c7afe0c0 Use Little Endian for Dirty Bitmap I pasted a snipet below! I am now confused by the

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

2010-04-21 Thread Alexander Graf
On 21.04.2010, at 10:29, Fernando Luis Vázquez Cao wrote: On 04/20/2010 08:03 PM, Takuya Yoshikawa wrote: @@ -318,7 +318,7 @@ struct kvm_dirty_log { __u32 padding1; union { void __user *dirty_bitmap; /* one bit per page */ -__u64 padding2; +

Re: [PATCH 00/27] Book3S_32 (PPC32) KVM support

2010-04-21 Thread Avi Kivity
On 04/16/2010 01:11 AM, Alexander Graf wrote: Since we do have support for Book3S_64 KVM now, the next obvious step is to support the generation before that: Book3S_32. This patch set adds support for Book3S_32 hosts, making your old G4 this much more useful. It should also work on fancy exotic

Re: [PATCH V3] drivers/uio/uio_pci_generic.c: allow access for non-privileged processes

2010-04-21 Thread Michael S. Tsirkin
On Mon, Apr 19, 2010 at 03:05:35PM -0700, Tom Lyon wrote: These are changes to uio_pci_generic.c to allow better use of the driver by non-privileged processes. 1. Add back old code which allowed interrupt re-enablement through uio fd. 2. Translate PCI bards to uio mmap regions, to allow mmap

Re: [PATCH 0/9] Post-PPC32 series v2

2010-04-21 Thread Avi Kivity
On 04/20/2010 03:49 AM, Alexander Graf wrote: While working with the PPC32 host target we finally have I stumbled over several things. Thanks to the now possible performance measurements I also tracked down split mode as one of the major slowdowns to KVM. What's left now that slows us down is

Re: [Qemu-devel] Re: QEMU-KVM and video performance

2010-04-21 Thread Jamie Lokier
Avi Kivity wrote: On 04/19/2010 10:14 PM, Gerhard Wiesinger wrote: Hello, Finally I got QEMU-KVM to work but video performance under DOS is very low (QEMU 0.12.3 stable and QEMU GIT master branch is fast, QEMU KVM is slow) I'm measuring 2 performance critical video performance

Re: [PATCH][STABLE] KVM: x86: Fix TSS size check for 16-bit tasks

2010-04-21 Thread Jan Kiszka
Avi Kivity wrote: On 04/14/2010 05:57 PM, Jan Kiszka wrote: A 16-bit TSS is only 44 bytes long. So make sure to test for the correct size on task switch. Signed-off-by: Jan Kiszkajan.kis...@siemens.com --- This is a backport of 8f2d524 from master. It applies at least down to 2.6.32 and

Re: [PATCH V3] drivers/uio/uio_pci_generic.c: allow access for non-privileged processes

2010-04-21 Thread Hans J. Koch
On Wed, Apr 21, 2010 at 12:38:49PM +0300, Michael S. Tsirkin wrote: + j++; + } + } + for (i = 0, j = 0; i PCI_STD_RESOURCE_END + j MAX_UIO_PORT_REGIONS; i++) { + if (pci_resource_flags(pdev, i) IORESOURCE_IO) { +

Re: [PATCH V3] drivers/uio/uio_pci_generic.c: allow access for non-privileged processes

2010-04-21 Thread Michael S. Tsirkin
On Wed, Apr 21, 2010 at 12:31:50PM +0200, Hans J. Koch wrote: On Wed, Apr 21, 2010 at 12:38:49PM +0300, Michael S. Tsirkin wrote: + j++; + } + } + for (i = 0, j = 0; i PCI_STD_RESOURCE_END +j MAX_UIO_PORT_REGIONS; i++) { +

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

2010-04-21 Thread Michael S. Tsirkin
On Tue, Apr 20, 2010 at 02:22:58PM +0100, Paul Brook wrote: 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

Re: [PATCH][STABLE] KVM: x86: Fix TSS size check for 16-bit tasks

2010-04-21 Thread Avi Kivity
On 04/21/2010 01:25 PM, Jan Kiszka wrote: This (and the exception thing) does not qualify under the usual stable rules (regression or host security: in, otherwise out). I prefer to delay brining up a new guest for one release rather than risk a regression. If you have a special requirement

Re: [Qemu-devel] Re: QEMU-KVM and video performance

2010-04-21 Thread Avi Kivity
On 04/21/2010 01:08 PM, Jamie Lokier wrote: Avi Kivity wrote: On 04/19/2010 10:14 PM, Gerhard Wiesinger wrote: Hello, Finally I got QEMU-KVM to work but video performance under DOS is very low (QEMU 0.12.3 stable and QEMU GIT master branch is fast, QEMU KVM is slow) I'm measuring 2

[GIT PULL] KVM fixes for 2.6.34-rc5

2010-04-21 Thread Avi Kivity
Linus, please pull a bunch of kvm fixes from git://git.kernel.org/pub/scm/virt/kvm/kvm.git kvm-updates/2.6.34 Shortlog/diffstat follow. Andre Przywara (1): KVM: allow bit 10 to be cleared in MSR_IA32_MC4_CTL Avi Kivity (2): KVM: Don't spam kernel log when injecting exceptions

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

2010-04-21 Thread Avi Kivity
On 04/20/2010 01:59 PM, Takuya Yoshikawa wrote: 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

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

2010-04-21 Thread Avi Kivity
On 04/20/2010 02:00 PM, 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 prepares

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

2010-04-21 Thread Avi Kivity
On 04/20/2010 02:02 PM, 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

Kvm network freeze

2010-04-21 Thread Arthur CLEMENT
Hi, I'm experiencing issues with libvirt/kvm on Debian lenny. I have two servers (32 and amd64) with kvm and openvz and each time I start or destroy a kvm domain the network freeze during 20 or 30 seconds (even my openvz vms lost their network). I think it might come from the bridge config, but

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

2010-04-21 Thread Avi Kivity
On 04/20/2010 02:03 PM, 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: Kvm network freeze

2010-04-21 Thread Thomas Løcke
On Wed, Apr 21, 2010 at 1:32 PM, Arthur CLEMENT aclem...@linagora.com wrote: I'm experiencing issues with libvirt/kvm on Debian lenny. I have two servers (32 and amd64) with kvm and openvz and each time I start or destroy a kvm domain the network freeze during 20 or 30 seconds (even my openvz

Re: Kvm network freeze

2010-04-21 Thread Michael Tokarev
Arthur CLEMENT wrote: Hi, I'm experiencing issues with libvirt/kvm on Debian lenny. I have two servers (32 and amd64) with kvm and openvz and each time I start or destroy a kvm domain the network freeze during 20 or 30 seconds (even my openvz vms lost their network). I think it might come

[PATCH] KVM: Document mmu

2010-04-21 Thread Avi Kivity
Signed-off-by: Avi Kivity a...@redhat.com --- Documentation/kvm/mmu.txt | 296 + 1 files changed, 296 insertions(+), 0 deletions(-) create mode 100644 Documentation/kvm/mmu.txt diff --git a/Documentation/kvm/mmu.txt b/Documentation/kvm/mmu.txt new

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

2010-04-21 Thread Leszek Urbanski
4bce9654.2030...@msgid.tls.msk.ru; from Michael Tokarev on Wed, Apr 21, 2010 at 10:08:20 +0400 There are only a few guests which are affected. So far it is not really clear what differs them from others: a reinstall of a new guest with the same components and doing same functions will not

Re: [PATCH] KVM: VMX: Translate interrupt shadow when waiting on NMI window

2010-04-21 Thread Jan Kiszka
Gleb Natapov wrote: On Tue, Feb 16, 2010 at 11:37:15AM +0100, Jan Kiszka wrote: Gleb Natapov wrote: On Tue, Feb 16, 2010 at 11:27:07AM +0100, Jan Kiszka wrote: Gleb Natapov wrote: On Tue, Feb 16, 2010 at 11:14:45AM +0100, Jan Kiszka wrote: Gleb Natapov wrote: On Tue, Feb 16, 2010 at

Re: [PATCH] KVM: VMX: Translate interrupt shadow when waiting on NMI window

2010-04-21 Thread Gleb Natapov
On Wed, Apr 21, 2010 at 04:17:03PM +0200, Jan Kiszka wrote: Gleb Natapov wrote: On Tue, Feb 16, 2010 at 11:37:15AM +0100, Jan Kiszka wrote: Gleb Natapov wrote: On Tue, Feb 16, 2010 at 11:27:07AM +0100, Jan Kiszka wrote: Gleb Natapov wrote: On Tue, Feb 16, 2010 at 11:14:45AM +0100, Jan

  1   2   >