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

2010-05-06 Thread Rusty Russell
On Wed, 5 May 2010 03:33:43 pm Neil Brown wrote: On Wed, 5 May 2010 14:28:41 +0930 Rusty Russell ru...@rustcorp.com.au wrote: On Wed, 5 May 2010 05:47:05 am Jamie Lokier wrote: Jens Axboe wrote: On Tue, May 04 2010, Rusty Russell wrote: ISTR someone mentioning a desire for such

Re: [PATCH RFC] virtio: put last seen used index into ring itself

2010-05-06 Thread Michael S. Tsirkin
On Thu, May 06, 2010 at 12:01:34PM +0930, Rusty Russell wrote: On Thu, 6 May 2010 06:28:14 am Michael S. Tsirkin wrote: Rusty, this is a simplified form of a patch you posted in the past. I have a vhost patch that, using this feature, shows external to host bandwidth grow from 5 to 7

Re: virtio: put last_used and last_avail index into ring itself.

2010-05-06 Thread Michael S. Tsirkin
On Thu, May 06, 2010 at 10:22:12AM +0930, Rusty Russell wrote: On Wed, 5 May 2010 03:52:36 am Michael S. Tsirkin wrote: virtio: put last_used and last_avail index into ring itself. Generally, the other end of the virtio ring doesn't need to see where you're up to in consuming the

Re: [PATCH] kvm mmu: reduce 50% memory usage

2010-05-06 Thread Lai Jiangshan
Marcelo Tosatti wrote: On Thu, Apr 29, 2010 at 09:43:40PM +0300, Avi Kivity wrote: On 04/29/2010 09:09 PM, Marcelo Tosatti wrote: You missed quadrant on 4mb large page emulation with shadow (see updated patch below). Good catch. Also for some reason i can't understand the assumption does

Re: [GIT PULL] amended: first round of vhost-net enhancements for net-next

2010-05-06 Thread David Miller
From: Michael S. Tsirkin m...@redhat.com Date: Tue, 4 May 2010 14:21:01 +0300 This is an amended pull request: I have rebased the tree to the correct patches. This has been through basic tests and seems to work fine here. The following tree includes a couple of enhancements that help

Re: vCPU scalability for linux VMs

2010-05-06 Thread Alec Istomin
On Wednesday, May 5, 2010 at 01:53:55 -0400, Srivatsa Vaddagiri wrote: On Wed, May 05, 2010 at 12:31:11PM -0700, Alec Istomin wrote: On Wednesday, May 5, 2010 at 13:27:39 -0400, Srivatsa Vaddagiri wrote: My preliminary results show that single vCPU Linux VMs perform up to 10 times better

[PATCH RFC] qemu/virtio: use last used index published by guest

2010-05-06 Thread Michael S. Tsirkin
Reduces irq_window in guest by only injecting an interrupt if guest has handled all buffers we used so far. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- This is the qemu part of the story. hw/vhost_net.c |6 ++ hw/virtio.c| 15 +++ hw/virtio.h|4

[PATCH 0/3 v2] KVM: VMX: Support hosted VMM coexsitence.

2010-05-06 Thread Xu, Dongxiao
Main changes from v1: 1) Add an module option vmm_coexistence to decide whether to enable this feature. Currently it is off defaultly. 2) Each time when a KVM vcpu is scheduled in, it will invalidate EPT and VPID TLBs to avoid conflict between different VMMs. VMX: Support for coexistence of KVM

[PATCH v3 1/2] x86: eliminate TS_XSAVE

2010-05-06 Thread Avi Kivity
The fpu code currently uses current-thread_info-status TS_XSAVE as a way to distinguish between XSAVE capable processors and older processors. The decision is not really task specific; instead we use the task status to avoid a global memory reference - the value should be the same across all

[PATCH v3 2/2] x86: Introduce 'struct fpu' and related API

2010-05-06 Thread Avi Kivity
Currently all fpu state access is through tsk-thread.xstate. Since we wish to generalize fpu access to non-task contexts, wrap the state in a new 'struct fpu' and convert existing access to use an fpu API. Signal frame handlers are not converted to the API since they will remain task context

[PATCH v3 0/2] x86 FPU API

2010-05-06 Thread Avi Kivity
Currently all fpu accessors are wedded to task_struct. However kvm also uses the fpu in a different context. Introduce an FPU API, and replace the current uses with the new API. While this patchset is oriented towards deeper changes, as a first step it simlifies xsave for kvm. v3: use

Re: [PATCH 0/5] Important fixes for KVM-AMD

2010-05-06 Thread Avi Kivity
On 05/05/2010 05:04 PM, Joerg Roedel wrote: Hi Avi, Marcelo, here is a set of patches which fix problems in kvm-amd. Patch 1 fixes a stupid problem with the event-reinjection introduced by me in my previous patchset. Patch 2 was a helper to find the bug patch 3 fixes. I kept it in the patchset

Re: KVM hook for code integrity checking

2010-05-06 Thread Avi Kivity
On 05/06/2010 07:51 AM, Suen Chun Hui wrote: Hi, Thanks for the reply. On 05/05/2010 11:05 AM, Avi Kivity wrote: On 04/30/2010 05:53 PM, Suen Chun Hui wrote: Dear KVM developers, I'm currently working on an open source security patch to use KVM to implement code verification on a

Re: [PATCH] KVM: make kvm_mmu_zap_page() return the number of pages it actually freed.

2010-05-06 Thread Avi Kivity
On 05/05/2010 04:03 AM, Gui Jianfeng wrote: Currently, kvm_mmu_zap_page() returning the number of freed children sp. This might confuse the caller, because caller don't know the actual freed number. Let's make kvm_mmu_zap_page() return the number of pages it actually freed. if

Re: [PATCH] KVM: mark page dirty when page is actually modified.

2010-05-06 Thread Avi Kivity
On 05/05/2010 04:09 AM, Gui Jianfeng wrote: Sometime cmpxchg_gpte doesn't modify gpte, in such case, don't mark page table page as dirty. Applied, thanks. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm in

Re: [PATCH RFC] KVM: inject #UD if instruction emulation fails while vcpu is in cpl==3

2010-05-06 Thread Avi Kivity
On 04/29/2010 02:58 PM, Gleb Natapov wrote: Do not kill VM If instruction emulation fails while vcpu is in userspace. Inject #UD instead in a hope that guest OS will kill offending process. Emulation failure is still traced by ftrace point to help analyze the problem. Still there's the

Re: High CPU load on target host after migration

2010-05-06 Thread Avi Kivity
On 04/29/2010 12:14 AM, Thomas Beinicke wrote: Hi, I have been toying around with kvm / libvirt / virt-manager and it's migration feature. Both host machines are running a 2.6.33 Kernel. One host is a Dual Quad Core Intel Xeon E5520 @ 2.27GHz and the other is a Dual Quad Core Intel E5420 @

Re: [PATCH 2/3] KVM MMU: fix sp-unsync type error in trace event definition.

2010-05-06 Thread Avi Kivity
On 04/22/2010 12:33 PM, Gui Jianfeng wrote: sp-unsync is bool now, so update trace event declaration. Signed-off-by: Gui Jianfengguijianf...@cn.fujitsu.com --- arch/x86/kvm/mmutrace.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/mmutrace.h

Re: [PATCH] KVM: make kvm_mmu_zap_page() return the number of pages it actually freed.

2010-05-06 Thread Gui Jianfeng
Avi Kivity wrote: On 05/05/2010 04:03 AM, Gui Jianfeng wrote: Currently, kvm_mmu_zap_page() returning the number of freed children sp. This might confuse the caller, because caller don't know the actual freed number. Let's make kvm_mmu_zap_page() return the number of pages it actually freed.

Re: [PATCH] KVM: make kvm_mmu_zap_page() return the number of pages it actually freed.

2010-05-06 Thread Avi Kivity
On 05/06/2010 12:25 PM, Gui Jianfeng wrote: Avi Kivity wrote: On 05/05/2010 04:03 AM, Gui Jianfeng wrote: Currently, kvm_mmu_zap_page() returning the number of freed children sp. This might confuse the caller, because caller don't know the actual freed number. Let's make

[PATCH v4 0/9] KVM MMU: allow more shadow pages become asynchronous

2010-05-06 Thread Xiao Guangrong
Changlog v4: - fix the bug that reported by Marcelo - fix the race in invlpg code Changlog v3: Those changes all form Avi's suggestion, thanks. - use smart way to fix the bug in patch 1 - remove duplicates code in patch 5 - check error code and fix forgot release page in patch 9 - sync shadow

[PATCH v4 1/9] KVM MMU: split kvm_sync_page() function

2010-05-06 Thread Xiao Guangrong
Split kvm_sync_page() into kvm_sync_page() and kvm_sync_page_transient() to clarify the code address Avi's suggestion kvm_sync_page_transient() function only update shadow page but not mark it sync and not write protect sp-gfn. it will be used by later patch Signed-off-by: Xiao Guangrong

[PATCH v4 2/9] KVM MMU: don't write-protect if have new mapping to unsync page

2010-05-06 Thread Xiao Guangrong
Two cases maybe happen in kvm_mmu_get_page() function: - one case is, the goal sp is already in cache, if the sp is unsync, we only need update it to assure this mapping is valid, but not mark it sync and not write-protect sp-gfn since it not broke unsync rule(one shadow page for a gfn) -

[PATCH v4 3/9] KVM MMU: allow more page become unsync at gfn mapping time

2010-05-06 Thread Xiao Guangrong
In current code, shadow page can become asynchronous only if one shadow page for a gfn, this rule is too strict, in fact, we can let all last mapping page(i.e, it's the pte page) become unsync, and sync them at invlpg or flush tlb time. This patch allow more page become asynchronous at gfn

[PATCH v4 4/9] KVM MMU: allow more page become unsync at getting sp time

2010-05-06 Thread Xiao Guangrong
Allow more page become asynchronous at getting sp time, if need create new shadow page for gfn but it not allow unsync(level 1), we should unsync all gfn's unsync page Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c | 47

[PATCH v4 5/9] KVM MMU: rename 'root_count' to 'active_count'

2010-05-06 Thread Xiao Guangrong
Rename 'root_count' to 'active_count' in kvm_mmu_page, since the unsync pages also will use it in later patch Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/include/asm/kvm_host.h |7 ++- arch/x86/kvm/mmu.c | 14 +++---

[PATCH v4 6/9] KVM MMU: support keeping sp live while it's out of protection

2010-05-06 Thread Xiao Guangrong
If we want to keep sp live while it it's out of kvm-mmu_lock protection, we can increase sp-active_count. Then, the invalid page is not only for active root but also unsync sp, we should filter those out when we make a page to unsync. And move 'hlist_del(sp-hash_link)' into kvm_mmu_free_page()

[PATCH v4 7/9] KVM MMU: separate invlpg code form kvm_mmu_pte_write()

2010-05-06 Thread Xiao Guangrong
Let invlpg not depends on kvm_mmu_pte_write path, later patch will need this feature Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c | 22 +- arch/x86/kvm/paging_tmpl.h | 44 +++- 2 files

[PATCH v4 8/9] KVM MMU: no need atomic operation for 'invlpg_counter'

2010-05-06 Thread Xiao Guangrong
'invlpg_counter' is protected by 'kvm-mmu_lock', no need atomic operation anymore Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/include/asm/kvm_host.h |2 +- arch/x86/kvm/paging_tmpl.h |7 --- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git

[PATCH v4 9/9] KVM MMU: optimize sync/update unsync-page

2010-05-06 Thread Xiao Guangrong
invlpg only need update unsync page, sp-unsync and sp-unsync_children can help us to find it Now, a gfn may have many shadow pages, when one sp need be synced, we write protect sp-gfn and sync this sp but we keep other shadow pages asynchronous So, while gfn happen page fault, let it not touch

Re: [PATCH 4/5] KVM: SVM: Allow EFER.LMSLE to be set with nested svm

2010-05-06 Thread Roedel, Joerg
On Wed, May 05, 2010 at 04:57:00PM -0400, Przywara, Andre wrote: If I understood this correctly, there is a bug somewhere, maybe even in KVM's nested SVM implementation. Xen is fine with this bit-set provoking a #GP. I haven't had time yet to further investigate this, though. Ok, I looked

Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself

2010-05-06 Thread Avi Kivity
On 05/05/2010 11:58 PM, Michael S. Tsirkin wrote: + /* We publish the last-seen used index at the end of the available ring. +* It is at the end for backwards compatibility. */ + vr-last_used_idx =(vr)-avail-ring[num]; + /* Verify that last used index does not spill

Re: [PATCH RFC] KVM: inject #UD if instruction emulation fails while vcpu is in cpl==3

2010-05-06 Thread Gleb Natapov
On Thu, May 06, 2010 at 12:15:58PM +0300, Avi Kivity wrote: On 04/29/2010 02:58 PM, Gleb Natapov wrote: Do not kill VM If instruction emulation fails while vcpu is in userspace. Inject #UD instead in a hope that guest OS will kill offending process. Emulation failure is still traced by ftrace

Re: [PATCH RFC] KVM: inject #UD if instruction emulation fails while vcpu is in cpl==3

2010-05-06 Thread Avi Kivity
On 05/06/2010 01:06 PM, Gleb Natapov wrote: On Thu, May 06, 2010 at 12:15:58PM +0300, Avi Kivity wrote: On 04/29/2010 02:58 PM, Gleb Natapov wrote: Do not kill VM If instruction emulation fails while vcpu is in userspace. Inject #UD instead in a hope that guest OS will kill offending

Re: [patch uq/master 5/9] kvm: synchronize state from cpu context

2010-05-06 Thread Avi Kivity
On 05/04/2010 03:45 PM, Marcelo Tosatti wrote: From: Jan Kiszkajan.kis...@siemens.com It is not safe to retrieve the KVM internal state of a given cpu while its potentially modifying it. Queue the request to run on cpu context, similarly to qemu-kvm. Even better is to query the state in

Re: [patch uq/master 0/9] enable smp 1 and related fixes

2010-05-06 Thread Avi Kivity
On 05/05/2010 09:24 PM, Anthony Liguori wrote: On 05/04/2010 07:45 AM, Marcelo Tosatti wrote: -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html How does this

Re: [patch uq/master 0/9] enable smp 1 and related fixes

2010-05-06 Thread Avi Kivity
On 05/04/2010 03:45 PM, Marcelo Tosatti wrote: Applied all, 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 message to majord...@vger.kernel.org More majordomo info at

Re: [PATCH RFC] KVM: inject #UD if instruction emulation fails while vcpu is in cpl==3

2010-05-06 Thread Gleb Natapov
On Thu, May 06, 2010 at 01:13:30PM +0300, Avi Kivity wrote: On 05/06/2010 01:06 PM, Gleb Natapov wrote: On Thu, May 06, 2010 at 12:15:58PM +0300, Avi Kivity wrote: On 04/29/2010 02:58 PM, Gleb Natapov wrote: Do not kill VM If instruction emulation fails while vcpu is in userspace. Inject #UD

virtio-win problem

2010-05-06 Thread Riccardo Veraldi
Hello, if I install virtio-win drivers on windows 2008 Server R2, I have the problem of signed device drivers. I Can install the drivers but Windows 2008 server refuses to use them unless I start the machine pressing F8 every time at each reboot bypassing the checking of signed certified

Re: [PATCH RFC] KVM: inject #UD if instruction emulation fails while vcpu is in cpl==3

2010-05-06 Thread Avi Kivity
On 05/06/2010 03:25 PM, Gleb Natapov wrote: We can expect that from a developer or a user subscribed to k...@. But what about some random user running virt-manager? What virt-manager would do about such error? Call up abrt. True. But the same problem exists with cpl0 #UD. It

Re: [PATCH RFC] KVM: inject #UD if instruction emulation fails while vcpu is in cpl==3

2010-05-06 Thread Avi Kivity
On 05/06/2010 03:41 PM, Gleb Natapov wrote: On Thu, May 06, 2010 at 03:33:12PM +0300, Avi Kivity wrote: On 05/06/2010 03:25 PM, Gleb Natapov wrote: We can expect that from a developer or a user subscribed to k...@. But what about some random user running virt-manager?

Re: [PATCH 1/3 v2] KVM: VMX code cleanup and preparation.

2010-05-06 Thread Avi Kivity
On 05/06/2010 11:45 AM, Xu, Dongxiao wrote: From: Dongxiao Xudongxiao...@intel.com Changelog needs to describe what's being done and why. Splitting the changes will help. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line

[PATCH] IOzone preprocessing: Fix wrong column mapping on graph generation

2010-05-06 Thread Lucas Meneghel Rodrigues
Fix a silly bug on graph generation: it was mapping the wrong columns when plotting the 2D throughput graphs. Sorry for the mistake. Signed-off-by: Lucas Meneghel Rodrigues l...@redhat.com --- client/tests/iozone/postprocessing.py |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff

Re: [Autotest] [PATCH] IOzone preprocessing: Fix wrong column mapping on graph generation

2010-05-06 Thread Martin Bligh
LGTM On Thu, May 6, 2010 at 6:24 AM, Lucas Meneghel Rodrigues l...@redhat.com wrote: Fix a silly bug on graph generation: it was mapping the wrong columns when plotting the 2D throughput graphs. Sorry for the mistake. Signed-off-by: Lucas Meneghel Rodrigues l...@redhat.com ---  

RE: [PATCH 1/1] KVM: X86: add the support of XSAVE/XRSTOR to guest

2010-05-06 Thread Cui, Dexuan
Avi Kivity wrote: On 05/06/2010 07:23 AM, Cui, Dexuan wrote: + goto err; + vcpu-arch.guest_xstate_mask = new_bv; + xsetbv(XCR_XFEATURE_ENABLED_MASK, vcpu-arch.guest_xstate_mask); Can't we run with the host xcr0? isn't it guaranteed to be a superset of the guest xcr0? I

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

2010-05-06 Thread Jamie Lokier
Rusty Russell wrote: Seems over-zealous. If the recovery_header held a strong checksum of the recovery_data you would not need the first fsync, and as long as you have two places to write recovery data, you don't need the 3rd and 4th syncs. Just:

RE: virtio-win problem

2010-05-06 Thread Martin Maurer
-Original Message- From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On Behalf Of Riccardo Veraldi Sent: Donnerstag, 06. Mai 2010 14:10 To: kvm@vger.kernel.org Subject: virtio-win problem Hello, if I install virtio-win drivers on windows 2008 Server R2, I have

Re: [Autotest] [PATCH 6/9] KVM test: Raise error when met unknown type in kvm_vm.remote_login().

2010-05-06 Thread Lucas Meneghel Rodrigues
On Mon, Apr 26, 2010 at 7:04 AM, Jason Wang jasow...@redhat.com wrote: Need to raise the error when met the unknown type of shell_client in kvm_vm.remote_login() in order to avoid the traceback. In order to keep consistency, please make the function return None instead of throwing an exception.

Re: [PATCH 1/9] KVM test: Introduce the prompt assist

2010-05-06 Thread Lucas Meneghel Rodrigues
On Thu, 2010-05-06 at 10:55 +0800, Jason Wang wrote: Michael Goldish wrote: On 04/26/2010 01:03 PM, Jason Wang wrote: Sometimes we need to send an assist string to a session in order to get the prompt especially when re-connecting to an already logged serial session. This patch send

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

2010-05-06 Thread Jamie Lokier
Rusty Russell wrote: On Wed, 5 May 2010 05:47:05 am Jamie Lokier wrote: Jens Axboe wrote: On Tue, May 04 2010, Rusty Russell wrote: ISTR someone mentioning a desire for such an API years ago, so CC'ing the usual I/O suspects... It would be nice to have a more fuller API

Re: [Qemu-devel] question on virtio

2010-05-06 Thread Jamie Lokier
Michael S. Tsirkin wrote: Hi! I see this in virtio_ring.c: /* Put entry in available array (but don't update avail-idx * until they do sync). */ Why is it done this way? It seems that updating the index straight away would be simpler, while this might allow the host to

Re: [Qemu-devel] Re: How to map PCI memory into the VM without trapping

2010-05-06 Thread Cam Macdonell
On Wed, May 5, 2010 at 5:20 PM, Frank Berreth frank...@google.com wrote: Hi there, this is just an update if you are interested in the outcome. I turns out that my initial assumption that there would be page faults/trapping on the memory pages was false. The reason the throughput is so low is

Re: [Autotest] [PATCH 3/3] KVM test: Remove the duplicated KERNEL paramters in the pxe configuration file

2010-05-06 Thread Lucas Meneghel Rodrigues
On Mon, Apr 26, 2010 at 7:07 AM, Jason Wang jasow...@redhat.com wrote: Remove the duplicated KERNEL vmlinuz in unattended.py Good catch, applied, thanks! Signed-off-by: Jason Wang jasow...@redhat.com ---  client/tests/kvm/scripts/unattended.py |    1 -  1 files changed, 0 insertions(+), 1

Re: [Autotest] [PATCH 1/3] KVM test: Use customized command to get the version of kvm and its

2010-05-06 Thread Lucas Meneghel Rodrigues
On Mon, Apr 26, 2010 at 7:07 AM, Jason Wang jasow...@redhat.com wrote: userspace Current method may or may not work for various kinds of distribution. So this patch enable the ability to use customized commands to get the version of kvm and its userspace. kvm_ver_cmd is used for kvm verison

Re: [PATCH v5 4/5] Inter-VM shared memory PCI device

2010-05-06 Thread Anthony Liguori
On 04/21/2010 12:53 PM, Cam Macdonell wrote: Support an inter-vm shared memory device that maps a shared-memory object as a PCI device in the guest. This patch also supports interrupts between guest by communicating over a unix domain socket. This patch applies to the qemu-kvm repository.

Re: [PATCH v5 4/5] Inter-VM shared memory PCI device

2010-05-06 Thread Cam Macdonell
On Thu, May 6, 2010 at 11:32 AM, Anthony Liguori anth...@codemonkey.ws wrote: On 04/21/2010 12:53 PM, Cam Macdonell wrote: Support an inter-vm shared memory device that maps a shared-memory object as a PCI device in the guest.  This patch also supports interrupts between guest by

Re: [Autotest] [KVM_AUTOTEST][PATCH] KSM_overcommit: dynamic reserve calculation

2010-05-06 Thread Lucas Meneghel Rodrigues
On Wed, 2010-05-05 at 21:52 +0100, Lukáš Doktor wrote: Hi, we are back with new features of KSM_overcommit test: * NEW: guest_reserve and host_reserve are now calculated based on used memory * NEW: tmpfs reserve is also evaluated to fit the overhead * NEW: VM alive check during

[PATCH] Fix segfault after device assignment hot remove

2010-05-06 Thread Alex Williamson
We keep a qlist of assigned devices for irq updates, but we forgot to remove entries from it if they're hot unplugged. This makes assigned_dev_update_irqs() a timebomb that goes off when the guest is rebooted. Signed-off-by: Alex Williamson alex.william...@redhat.com --- diff --git

Re: [PATCH 1/1] KVM: X86: add the support of XSAVE/XRSTOR to guest

2010-05-06 Thread Avi Kivity
On 05/06/2010 05:20 PM, Cui, Dexuan wrote: However, switching xcr0 may be slow. That's our experience with msrs. Can you measure its latency? We can measure that. However, I think the changing xcr0 to guest xcr0 in handle_xsetbv() is necessary -- or else, inside guest xgetbv() would

Re: [PATCH 1/1] KVM: X86: add the support of XSAVE/XRSTOR to guest

2010-05-06 Thread Avi Kivity
On 05/06/2010 10:45 PM, Avi Kivity wrote: All those control registers are annoying, we have cr1 and cr5-cr7 free, cr9-cr15 on x86_64, infinite msr space, and now we have XCRs. Great. Looking forward to YCR0. I think I see the reason - xgetbv is unprivileged, so applications can see

Re: virtio-win problem

2010-05-06 Thread Brian Jackson
On Thursday, May 06, 2010 07:10:07 am Riccardo Veraldi wrote: Hello, if I install virtio-win drivers on windows 2008 Server R2, I have the problem of signed device drivers. I Can install the drivers but Windows 2008 server refuses to use them unless I start the machine pressing F8 every time

Another SIGFPE in display code, now in cirrus

2010-05-06 Thread Michael Tokarev
There was a bug recently fixed in vnc code. Apparently there's something similar in the cirrus emulation as well. Here it triggers _always_ (including old versions of kvm) when running windows NT and hitting test button in its display resolution dialog. Here's what gdb is to say: Program

Re: [PATCH] KVM: Get rid of KVM_REQ_KICK

2010-05-06 Thread Marcelo Tosatti
On Mon, May 03, 2010 at 05:19:08PM +0300, Avi Kivity wrote: KVM_REQ_KICK poisons vcpu-requests by having a bit set during normal operation. This causes the fast path check for a clear vcpu-requests to fail all the time, triggering tons of atomic operations. Fix by replacing KVM_REQ_KICK

Re: [PATCH v2 0/5] Fix EFER.NX=0 with EPT

2010-05-06 Thread Marcelo Tosatti
On Sun, May 02, 2010 at 12:48:49PM +0300, Avi Kivity wrote: Currently we run with EFER.NX=1 on the guest even if the guest value is 0. This is fine with shadow, since we check bit 63 when instantiating a page table, and fault if bit 63 is set while EFER.NX is clear. This doesn't work with

Re: virtio-win problem

2010-05-06 Thread Jernej Simončič
On Thursday, May 6, 2010, 21:59:21, Brian Jackson wrote: http://theiggy.com/tmp/virtio-20100228.zip These are not guaranteed to work and they will probably kill kittens. That said, I've had luck with them and had only a few reports of things not working (mostly with the balloon drivers).

Re: virtio-win problem

2010-05-06 Thread Brian Jackson
On Thursday, May 06, 2010 03:11:00 pm Jernej Simončič wrote: On Thursday, May 6, 2010, 21:59:21, Brian Jackson wrote: http://theiggy.com/tmp/virtio-20100228.zip These are not guaranteed to work and they will probably kill kittens. That said, I've had luck with them and had only a few

OPCODE Emulation

2010-05-06 Thread Matteo Signorini
Dear Yaniv, Dear Avi, I would like to add the sidt emulation feature in kvm, but in order to implement it I need to know the details on how the OPCODE works and how exactly opcodes are emulated within kvm. For example let's take the SIDT instruction. I know the LIDT opcode is 0F 01 /1 but what

Re: virtio-win problem

2010-05-06 Thread Jernej Simončič
On Thursday, May 6, 2010, 22:36:02, Brian Jackson wrote: What about the XP32 drivers from: http://theiggy.com/tmp/virtio-20091208.zip This is what I currently use on XP, and it works fine (I think I mentioned this on IRC - my nickname's ender` there). -- Jernej Simončič

Re: virtio-win problem

2010-05-06 Thread Brian Jackson
On Thursday, May 06, 2010 04:05:17 pm Jernej Simončič wrote: On Thursday, May 6, 2010, 22:36:02, Brian Jackson wrote: What about the XP32 drivers from: http://theiggy.com/tmp/virtio-20091208.zip This is what I currently use on XP, and it works fine (I think I mentioned this on IRC - my

[PATCH] KVM test: Add a subtest iofuzz

2010-05-06 Thread Lucas Meneghel Rodrigues
From: Jason Wang jasow...@redhat.com The design of iofuzz is simple: it just generate random I/O port activity inside the virtual machine. The correctness of the device emulation may be verified through this test. As the instrcutions are randomly generated, guest may enter the wrong state. The

Re: [Autotest] [PATCH] KVM test: Add a subtest iofuzz

2010-05-06 Thread Lucas Meneghel Rodrigues
On Wed, Apr 7, 2010 at 8:55 AM, Jason Wang jasow...@redhat.com wrote: The design of iofuzz is simple: it just generate random I/O port activity inside the virtual machine. The correctness of the device emulation may be verified through this test. As the instrcutions are randomly generated,

Re: OPCODE Emulation

2010-05-06 Thread Mohammed Gamal
On Thu, May 6, 2010 at 11:37 PM, Matteo Signorini signorinimat...@gmail.com wrote: Dear Yaniv, Dear Avi, I would like to add the sidt emulation feature in kvm, but in order to implement it I need to know the details on how the OPCODE works and how exactly opcodes are emulated within kvm.

Re: [Autotest] [PATCH 3/3] KVM Test: Add ioquit test case

2010-05-06 Thread Lucas Meneghel Rodrigues
On Wed, Apr 7, 2010 at 5:49 AM, Feng Yang fy...@redhat.com wrote: Signed-off-by: Feng Yang fy...@redhat.com ---  client/tests/kvm/tests/ioquit.py       |   54  client/tests/kvm/tests_base.cfg.sample |    4 ++  2 files changed, 58 insertions(+), 0

Re: [Autotest] [PATCH 3/3] KVM Test: Add ioquit test case

2010-05-06 Thread Lucas Meneghel Rodrigues
On Wed, Apr 7, 2010 at 5:49 AM, Feng Yang fy...@redhat.com wrote: Signed-off-by: Feng Yang fy...@redhat.com ---  client/tests/kvm/tests/ioquit.py       |   54  client/tests/kvm/tests_base.cfg.sample |    4 ++  2 files changed, 58 insertions(+), 0

Re: Endless loop in qcow2_alloc_cluster_offset

2010-05-06 Thread Marcelo Tosatti
On Thu, Nov 19, 2009 at 01:19:55PM +0100, Jan Kiszka wrote: Hi, I just managed to push a qemu-kvm process (git rev. b496fe3431) into an endless loop in qcow2_alloc_cluster_offset, namely over QLIST_FOREACH(old_alloc, s-cluster_allocs, next_in_flight): (gdb) bt #0 0x0048614b in

Re: [Autotest] [PATCH 3/3] KVM Test: Add ioquit test case

2010-05-06 Thread Feng Yang
Hi, Lucas Thanks for your comment. I am sorry for no response so long time. I will update it according to your comment. Also thanks Michael for his comment. - Lucas Meneghel Rodrigues l...@redhat.com wrote: From: Lucas Meneghel Rodrigues l...@redhat.com To: Feng Yang

RE: [PATCH 2/3 v2] KVM: VMX: VMCLEAR/VMPTRLD usage changes.

2010-05-06 Thread Xu, Dongxiao
Avi Kivity wrote: On 05/06/2010 11:45 AM, Xu, Dongxiao wrote: From: Dongxiao Xudongxiao...@intel.com Originally VMCLEAR/VMPTRLD is called on vcpu migration. To support hosted VMM coexistance, VMCLEAR is executed on vcpu schedule out, and VMPTRLD is executed on vcpu schedule in. This could

[PATCH 1/4 v3] KVM: VMX: Define new functions to wrapper direct call of asm code.

2010-05-06 Thread Xu, Dongxiao
From: Dongxiao Xu dongxiao...@intel.com Define vmcs_load() and kvm_cpu_vmxon() to avoid direct call of asm code. Also move VMXE bit operation out of kvm_cpu_vmxoff(). Signed-off-by: Dongxiao Xu dongxiao...@intel.com --- arch/x86/kvm/vmx.c | 36 +++- 1 files

[PATCH 2/4 v3] KVM: VMX: Some minor changes to code structure.

2010-05-06 Thread Xu, Dongxiao
From: Dongxiao Xu dongxiao...@intel.com Do some preparations for vmm coexistence support. Signed-off-by: Dongxiao Xu dongxiao...@intel.com --- arch/x86/kvm/vmx.c | 16 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index

[PATCH 0/4 v3] KVM: VMX: Support hosted VMM coexsitence.

2010-05-06 Thread Xu, Dongxiao
Hi all, This is hosted VMM coexistence support v3. Main changes from v2: 1) Change vmm_coexistence to vmm_exclusive. 2) Some code structure changes. Split the original 3 patches to 4. 3) Address some comments from Avi. Main changes from v1: 1) Add an module option vmm_coexistence to decide

[PATCH 4/4 v3] KVM: VMX: VMXON/VMXOFF usage changes.

2010-05-06 Thread Xu, Dongxiao
From: Dongxiao Xu dongxiao...@intel.com SDM suggests VMXON should be called before VMPTRLD, and VMXOFF should be called after doing VMCLEAR. Therefore in vmm coexistence case, we should firstly call VMXON before any VMCS operation, and then call VMXOFF after the operation is done.

[PATCH 3/4 v3] KVM: VMX: VMCLEAR/VMPTRLD usage changes.

2010-05-06 Thread Xu, Dongxiao
From: Dongxiao Xu dongxiao...@intel.com Originally VMCLEAR/VMPTRLD is called on vcpu migration. To support hosted VMM coexistance, VMCLEAR is executed on vcpu schedule out, and VMPTRLD is executed on vcpu schedule in. This could also eliminate the IPI when doing VMCLEAR. vmm_exclusive is

Re: virtio: put last_used and last_avail index into ring itself.

2010-05-06 Thread Rusty Russell
On Thu, 6 May 2010 03:57:55 pm Michael S. Tsirkin wrote: On Thu, May 06, 2010 at 10:22:12AM +0930, Rusty Russell wrote: On Wed, 5 May 2010 03:52:36 am Michael S. Tsirkin wrote: What do you think? I think everyone is settled on 128 byte cache lines for the forseeable future, so it's

Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself

2010-05-06 Thread Rusty Russell
On Thu, 6 May 2010 07:30:00 pm Avi Kivity wrote: On 05/05/2010 11:58 PM, Michael S. Tsirkin wrote: + /* We publish the last-seen used index at the end of the available ring. +* It is at the end for backwards compatibility. */ + vr-last_used_idx =(vr)-avail-ring[num]; + /* Verify

Re: [PATCH RFC] virtio: put last seen used index into ring itself

2010-05-06 Thread Rusty Russell
On Thu, 6 May 2010 03:49:46 pm Michael S. Tsirkin wrote: Now, I also added an mb() in guest between read and write so that last used index write can not get ahead of used index read. It does feel good to have it there, but I can not say why it's helpful. Works fine without it, but then these

Re: [PATCH v4 0/9] KVM MMU: allow more shadow pages become asynchronous

2010-05-06 Thread Xiao Guangrong
Hi Avi, Marcelo, patch 5 and patch 6 are can't apply to current kvm tree, i'll rebase those two patches. Marcelo, does this patchset fix your issue? I have tested it with Fedora12/Ubuntu/CentOS 32/64 guests, it works well. Thanks, Xiao -- To unsubscribe from this list: send the line unsubscribe

[PATCH v5 5/9] KVM MMU: rename 'root_count' to 'active_count'

2010-05-06 Thread Xiao Guangrong
Rename 'root_count' to 'active_count' in kvm_mmu_page, since the unsync pages also will use it in later patch Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/include/asm/kvm_host.h |8 +++- arch/x86/kvm/mmu.c | 14 +++---

[PATCH v5 6/9] KVM MMU: support keeping sp live while it's out of protection

2010-05-06 Thread Xiao Guangrong
If we want to keep sp live while it it's out of kvm-mmu_lock protection, we can increase sp-active_count. Then, the invalid page is not only for active root but also unsync sp, we should filter those out when we make a page to unsync. And move 'hlist_del(sp-hash_link)' into kvm_mmu_free_page()

[COMMIT master] KVM: x86: Fix exception reinjection forced to true

2010-05-06 Thread Avi Kivity
From: Joerg Roedel joerg.roe...@amd.com The patch merged recently which allowed to mark an exception as reinjected has a bug as it always marks the exception as reinjected. This breaks nested-svm shadow-on-shadow implementation. Signed-off-by: Joerg Roedel joerg.roe...@amd.com Signed-off-by: Avi

[COMMIT master] KVM: SVM: Don't allow nested guest to VMMCALL into host

2010-05-06 Thread Avi Kivity
From: Joerg Roedel joerg.roe...@amd.com This patch disables the possibility for a l2-guest to do a VMMCALL directly into the host. This would happen if the l1-hypervisor doesn't intercept VMMCALL and the l2-guest executes this instruction. Signed-off-by: Joerg Roedel joerg.roe...@amd.com

[COMMIT master] KVM: MMU: make kvm_mmu_zap_page() return the number of pages it actually freed

2010-05-06 Thread Avi Kivity
From: Gui Jianfeng guijianf...@cn.fujitsu.com Currently, kvm_mmu_zap_page() returning the number of freed children sp. This might confuse the caller, because caller don't know the actual freed number. Let's make kvm_mmu_zap_page() return the number of pages it actually freed. Signed-off-by: Gui

[COMMIT master] KVM: MMU: mark page table dirty when a pte is actually modified

2010-05-06 Thread Avi Kivity
From: Gui Jianfeng guijianf...@cn.fujitsu.com Sometime cmpxchg_gpte doesn't modify gpte, in such case, don't mark page table page as dirty. 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

[COMMIT master] KVM: MMU: Fix debug output error in walk_addr()

2010-05-06 Thread Avi Kivity
From: Gui Jianfeng guijianf...@cn.fujitsu.com Fix a debug output error in walk_addr 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 1ad9843..11d8a16 100644 ---

[COMMIT master] KVM: SVM: Allow EFER.LMSLE to be set with nested svm

2010-05-06 Thread Avi Kivity
From: Joerg Roedel joerg.roe...@amd.com This patch enables setting of efer bit 13 which is allowed in all SVM capable processors. This is necessary for the SLES11 version of Xen 4.0 to boot with nested svm. Signed-off-by: Joerg Roedel joerg.roe...@amd.com Signed-off-by: Avi Kivity