Re: [Qemu-devel] Re: virtio-serial: An interface for host-guest communication

2009-08-07 Thread Amit Shah
On (Thu) Aug 06 2009 [18:37:40], Jamie Lokier wrote: Amit Shah wrote: On (Thu) Aug 06 2009 [08:58:01], Anthony Liguori wrote: Amit Shah wrote: On (Thu) Aug 06 2009 [08:29:40], Anthony Liguori wrote: Amit Shah wrote: Sure; but there's been no resistance from anyone from

[PATCH 1/1] net: fix vnet_hdr bustage with slirp

2009-08-07 Thread Mark McLoughlin
slirp has started using VLANClientState::opaque and this has caused the kvm specific tap_has_vnet_hdr() hack to break because we blindly use this opaque pointer even if it is not a tap client. Add yet another hack to check that we're actually getting called with a tap client. [Needed on

[PATCH 0/21] Nested SVM cleanups v2

2009-08-07 Thread Joerg Roedel
Hi, this is the second and extended version of my patchset to clean up the code for SVM virtualization in KVM. The patchset was tested with KVM on KVM and showed no regressions. It was tested with Nested Paging and with Shadow Paging on the first-level guest. As a major change this patchset

[PATCH 14/21] kvm/svm: clean up nested vmrun path

2009-08-07 Thread Joerg Roedel
This patch removes the usage of nested_svm_do from the vmrun emulation path. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- arch/x86/kvm/svm.c | 34 ++ 1 files changed, 22 insertions(+), 12 deletions(-) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c

[PATCH 11/21] kvm/svm: get rid of nested_svm_vmexit_real

2009-08-07 Thread Joerg Roedel
This patch is the starting point of removing nested_svm_do from the nested svm code. The nested_svm_do function basically maps two guest physical pages to host virtual addresses and calls a passed function on it. This function pointer code flow is hard to read and not the best technical solution

[PATCH 03/21] kvm/svm: optimize nested vmrun

2009-08-07 Thread Joerg Roedel
Only copy the necessary parts of the vmcb save area on vmrun and save precious time. Signed-off-by: Joerg Roedel joerg.roe...@amd.com Acked-by: Alexander Graf ag...@suse.de --- arch/x86/kvm/svm.c | 28 +--- 1 files changed, 21 insertions(+), 7 deletions(-) diff --git

[PATCH 12/21] kvm/svm: clean up nested_svm_exit_handled_msr

2009-08-07 Thread Joerg Roedel
This patch changes nested svm to call nested_svm_exit_handled_msr directly and not through nested_svm_do. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- arch/x86/kvm/svm.c | 37 ++--- 1 files changed, 22 insertions(+), 15 deletions(-) diff --git

[PATCH 16/21] kvm/svm: handle errors in vmrun emulation path appropriatly

2009-08-07 Thread Joerg Roedel
If nested svm fails to load the msrpm the vmrun succeeds with the old msrpm which is not correct. This patch changes the logic to roll back to host mode in case the msrpm cannot be loaded. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- arch/x86/kvm/svm.c | 14 +- 1 files

[PATCH 20/21] kvm/svm: check for nested VINTR flag in svm_interrupt_allowed

2009-08-07 Thread Joerg Roedel
Not checking for this flag breaks any nested hypervisor that does not set VINTR. So fix it with this patch. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- arch/x86/kvm/svm.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c

[PATCH 15/21] kvm/svm: remove nested_svm_do and helper functions

2009-08-07 Thread Joerg Roedel
This function is not longer required. So remove it. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- arch/x86/kvm/svm.c | 60 1 files changed, 0 insertions(+), 60 deletions(-) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index

[PATCH 01/21] kvm/svm: add helper functions for global interrupt flag

2009-08-07 Thread Joerg Roedel
This patch makes the code easier to read when it comes to setting, clearing and checking the status of the virtualized global interrupt flag for the VCPU. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- arch/x86/kvm/svm.c | 33 + 1 files changed, 25

[PATCH 06/21] kvm/svm: move nested svm state into seperate struct

2009-08-07 Thread Joerg Roedel
This makes it more clear for which purpose these members in the vcpu_svm exist. Signed-off-by: Joerg Roedel joerg.roe...@amd.com Acked-by: Alexander Graf ag...@suse.de --- arch/x86/kvm/svm.c | 62 +++ 1 files changed, 33 insertions(+), 29

[PATCH 04/21] kvm/svm: copy only necessary parts of the control area on vmrun/vmexit

2009-08-07 Thread Joerg Roedel
The vmcb control area contains more then 800 bytes of reserved fields which are unnecessarily copied. Fix this by introducing a copy function which only copies the relevant part and saves time. Signed-off-by: Joerg Roedel joerg.roe...@amd.com Acked-by: Alexander Graf ag...@suse.de ---

[PATCH 21/21] kvm/svm: enable nested svm by default

2009-08-07 Thread Joerg Roedel
Nested SVM is (in my experience) stable enough to be enabled by default. So omit the requirement to pass a module parameter. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- arch/x86/kvm/svm.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/svm.c

[PATCH 05/21] kvm/svm: complete interrupts after handling nested exits

2009-08-07 Thread Joerg Roedel
The interrupt completion code must run after nested exits are handled because not injected interrupts or exceptions may be handled by the l1 guest first. Signed-off-by: Joerg Roedel joerg.roe...@amd.com Acked-by: Alexander Graf ag...@suse.de --- arch/x86/kvm/svm.c |5 +++-- 1 files changed,

[PATCH 02/21] kvm/svm: optimize nested #vmexit

2009-08-07 Thread Joerg Roedel
It is more efficient to copy only the relevant parts of the vmcb back to the nested vmcb when we emulate an vmexit. Signed-off-by: Joerg Roedel joerg.roe...@amd.com Acked-by: Alexander Graf ag...@suse.de --- arch/x86/kvm/svm.c | 68 +-- 1 files

[PATCH 17/21] kvm/svm: move special nested exit handling to separate function

2009-08-07 Thread Joerg Roedel
This patch moves the handling for special nested vmexits like #pf to a separate function. This makes the kvm_override parameter obsolete and makes the code more readable. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- arch/x86/kvm/svm.c | 80

[PATCH 19/21] kvm/svm: move nested_svm_intr main logic out of if-clause

2009-08-07 Thread Joerg Roedel
This patch removes one indentation level from nested_svm_intr and makes the logic more readable. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- arch/x86/kvm/svm.c | 21 +++-- 1 files changed, 11 insertions(+), 10 deletions(-) diff --git a/arch/x86/kvm/svm.c

[PATCH 09/21] kvm/svm: do nested vmexit in nested_svm_exit_handled

2009-08-07 Thread Joerg Roedel
If this function returns true a nested vmexit is required. Move that vmexit into the nested_svm_exit_handled function. This also simplifies the handling of nested #pf intercepts in this function. Signed-off-by: Joerg Roedel joerg.roe...@amd.com Acked-by: Alexander Graf ag...@suse.de ---

[PATCH 07/21] kvm/svm: cache nested intercepts

2009-08-07 Thread Joerg Roedel
When the nested intercepts are cached we don't need to call get_user_pages and/or map the nested vmcb on every nested #vmexit to check who will handle the intercept. Further this patch aligns the emulated svm behavior better to real hardware. Signed-off-by: Joerg Roedel joerg.roe...@amd.com ---

[PATCH 18/21] kvm/svm: remove unnecessary is_nested check from svm_cpu_run

2009-08-07 Thread Joerg Roedel
This check is not necessary. We have to sync the vcpu-arch.cr2 always back to the VMCB. This patch remove the is_nested check. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- arch/x86/kvm/svm.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/svm.c

[PATCH 10/21] kvm/svm: simplify nested_svm_check_exception

2009-08-07 Thread Joerg Roedel
Makes the code of this function more readable by removing on indentation level for the core logic. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- arch/x86/kvm/svm.c | 19 --- 1 files changed, 8 insertions(+), 11 deletions(-) diff --git a/arch/x86/kvm/svm.c

[PATCH 13/21] kvm/svm: clean up nestec vmload/vmsave paths

2009-08-07 Thread Joerg Roedel
This patch removes the usage of nested_svm_do from the vmload and vmsave emulation code paths. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- arch/x86/kvm/svm.c | 36 +--- 1 files changed, 17 insertions(+), 19 deletions(-) diff --git a/arch/x86/kvm/svm.c

[PATCH 08/21] kvm/svm: consolidate nested_svm_exit_handled

2009-08-07 Thread Joerg Roedel
When caching guest intercepts there is no need anymore for the nested_svm_exit_handled_real function. So move its code into nested_svm_exit_handled. Signed-off-by: Joerg Roedel joerg.roe...@amd.com Acked-by: Alexander Graf ag...@suse.de --- arch/x86/kvm/svm.c | 109

Re: [PATCH 1/1] net: fix vnet_hdr bustage with slirp

2009-08-07 Thread Arnd Bergmann
On Friday 07 August 2009, Mark McLoughlin wrote: slirp has started using VLANClientState::opaque and this has caused the kvm specific tap_has_vnet_hdr() hack to break because we blindly use this opaque pointer even if it is not a tap client. Add yet another hack to check that we're actually

Re: [PATCH 0/7] AlacrityVM guest drivers Reply-To:

2009-08-07 Thread Gregory Haskins
[not sure if it was intentional, but you dropped the CC list. Therefore, I didn't see this until I caught up on my k...@vger reading] Pantelis Koukousoulas wrote: How hard would it be to implement virtio over vbus and perhaps the virtio-net backend? It should be relatively trivial. I have

Re: [PATCH 1/1] net: fix vnet_hdr bustage with slirp

2009-08-07 Thread Mark McLoughlin
On Fri, 2009-08-07 at 13:51 +0200, Arnd Bergmann wrote: On Friday 07 August 2009, Mark McLoughlin wrote: slirp has started using VLANClientState::opaque and this has caused the kvm specific tap_has_vnet_hdr() hack to break because we blindly use this opaque pointer even if it is not a tap

[PATCH]: Always use KVM_VERSION to build version number

2009-08-07 Thread Chris Lalancette
Avi, Trying to use libvirt with development snapshots of qemu-kvm is a bit problematic. The trouble is that for all development snapshots, the value that gets placed into this string: QEMU PC emulator version 0.10.0 (kvm-devel), Copyright (c) 2003-2008 Is always kvm-devel. That means we

Re: [PATCH 1/1] net: fix vnet_hdr bustage with slirp

2009-08-07 Thread Arnd Bergmann
On Friday 07 August 2009, Mark McLoughlin wrote: The vnet_hdr code in qemu-kvm.git is a hack which we plan to (eventually) replace by allowing a nic to be paired directly with a backend. Your patch is fine, but I'd suggest since both are a hack we stick with mine since it'll reduce merge

Re: [PATCH 0/7] AlacrityVM guest drivers Reply-To:

2009-08-07 Thread Anthony Liguori
Michael S. Tsirkin wrote: This series includes the basic plumbing, as well as the driver for accelerated 802.x (ethernet) networking. The graphs comparing virtio with vbus look interesting. 1gbit throughput on a 10gbit link? I have a hard time believing that. I've seen much

Re: [PATCH 0/7] AlacrityVM guest drivers

2009-08-07 Thread Anthony Liguori
Gregory Haskins wrote: That said, note that the graphs were from earlier kernel runs (2.6.28, 29-rc8). The most recent data I can find that I published is for 2.6.29, announced with the vbus-v3 release back in April: http://lkml.org/lkml/2009/4/21/408 In it, the virtio-net throughput numbers

Re: [PATCH 0/7] AlacrityVM guest drivers

2009-08-07 Thread Gregory Haskins
Anthony Liguori wrote: Gregory Haskins wrote: That said, note that the graphs were from earlier kernel runs (2.6.28, 29-rc8). The most recent data I can find that I published is for 2.6.29, announced with the vbus-v3 release back in April: http://lkml.org/lkml/2009/4/21/408 In it, the

Re: [KVM-AUTOTEST PATCH 1/1] KVM test: kvm_subprocess: don't immediately check /proc/$PID/cmdline

2009-08-07 Thread Lucas Meneghel Rodrigues
On Wed, Aug 5, 2009 at 11:57 AM, Michael Goldishmgold...@redhat.com wrote: kvm_spawn.is_alive() incorrectly assumes that /proc/$PID/cmdline immediately reflects the new command line of the forked process.  This makes it report false negatives occasionally.  To prevent that, perform the command

Re: [Autotest] [KVM-AUTOTEST PATCH 1/2] KVM test: timedrift: Use helper functions to make the code more readable

2009-08-07 Thread Lucas Meneghel Rodrigues
I'd have one sugestion to make on this patch: On Wed, Aug 5, 2009 at 9:32 AM, Michael Goldishmgold...@redhat.com wrote: 1. As suggested by Yolkfull Chow, use a get_time() helper function that returns   the current host and guest times. 2. Use helper functions that set and restore the CPU

Re: [Autotest] [KVM-AUTOTEST PATCH 2/2] KVM test: timedrift test: close shell session before failing the test

2009-08-07 Thread Lucas Meneghel Rodrigues
On Wed, Aug 5, 2009 at 9:32 AM, Michael Goldishmgold...@redhat.com wrote: Currently the shell session is sometimes not closed because the error.TestFail exception is raised before the session has a chance to close. Ok, bugfix applied! http://autotest.kernel.org/changeset/3515 Signed-off-by:

[KVM-AUTOTEST PATCH CORRECTION] KVM test: timedrift: Use helper functions to make the code more readable

2009-08-07 Thread Michael Goldish
1. As suggested by Yolkfull Chow, use a get_time() helper function that returns the current host and guest times. 2. Use helper functions that set and restore the CPU affinity of a process. 3. In these helper functions, set the affinity of all threads of the process, not just the main

Re: [Autotest] [KVM-AUTOTEST PATCH 1/2] KVM test: timedrift: Use helper functions to make the code more readable

2009-08-07 Thread Michael Goldish
- Lucas Meneghel Rodrigues l...@redhat.com wrote: I'd have one sugestion to make on this patch: On Wed, Aug 5, 2009 at 9:32 AM, Michael Goldishmgold...@redhat.com wrote: 1. As suggested by Yolkfull Chow, use a get_time() helper function that returns   the current host and guest

Re: [Autotest] [KVM-AUTOTEST PATCH 06/12] KVM test: minor style changes to kvm_config.py

2009-08-07 Thread Lucas Meneghel Rodrigues
On Sun, Aug 2, 2009 at 8:58 PM, Michael Goldishmgold...@redhat.com wrote: - Fix indentation of a few lines. - Limit lines to 80 characters. - Use list comprehension in config.filter(). - Replace '== None' with 'is None'. Good, applied! Signed-off-by: Michael Goldish mgold...@redhat.com ---

Re: [Autotest] [KVM-AUTOTEST PATCH 07/12] KVM test: kvm_config.py: do not fail when including a nonexistent file

2009-08-07 Thread Lucas Meneghel Rodrigues
On Sun, Aug 2, 2009 at 8:58 PM, Michael Goldishmgold...@redhat.com wrote: Instead of failing, just print a warning.  Included files may not always be crucial for tests to run (kvm_cdkeys.cfg for example). Signed-off-by: Michael Goldish mgold...@redhat.com ---  client/tests/kvm/kvm_config.py

Re: [Autotest] [KVM-AUTOTEST PATCH 1/2] KVM test: timedrift: Use helper functions to make the code more readable

2009-08-07 Thread Lucas Meneghel Rodrigues
Ok Michael, please send me the diff between the patches so I can apply it! On Fri, Aug 7, 2009 at 6:45 PM, Michael Goldishmgold...@redhat.com wrote: - Lucas Meneghel Rodrigues l...@redhat.com wrote: I'd have one sugestion to make on this patch: On Wed, Aug 5, 2009 at 9:32 AM, Michael

Re: [Autotest] [KVM-AUTOTEST PATCH 07/12] KVM test: kvm_config.py: do not fail when including a nonexistent file

2009-08-07 Thread Michael Goldish
- Lucas Meneghel Rodrigues l...@redhat.com wrote: On Sun, Aug 2, 2009 at 8:58 PM, Michael Goldishmgold...@redhat.com wrote: Instead of failing, just print a warning.  Included files may not always be crucial for tests to run (kvm_cdkeys.cfg for example). Signed-off-by: Michael

[KVM-AUTOTEST PATCH] KVM test: timedrift: pass parameters to the get_time() helper function

2009-08-07 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_tests.py | 17 + 1 files changed, 13 insertions(+), 4 deletions(-) diff --git a/client/tests/kvm/kvm_tests.py b/client/tests/kvm/kvm_tests.py index 8cc89f1..e678039 100644 ---

Re: [Autotest] [KVM-AUTOTEST PATCH 07/12] KVM test: kvm_config.py: do not fail when including a nonexistent file

2009-08-07 Thread Lucas Meneghel Rodrigues
On Fri, Aug 7, 2009 at 7:24 PM, Michael Goldishmgold...@redhat.com wrote: - Lucas Meneghel Rodrigues l...@redhat.com wrote: I quite didn't like the above, because to issue messages like that we should be using the logging infrastructure to avoid to write WARNING, DEBUG and similar

[KVM-AUTOTEST PATCH CORRECTION] KVM test: kvm_subprocess: send user specified parameters to kvm_tail callbacks

2009-08-07 Thread Michael Goldish
(A mistake was made in the first version of this patch -- this is a corrected version.) Allow the user to specify parameters to send to output_func and termination_func in addition to the regular output string and exit status. The user specified parameters will be pre-pended to the other

Re: Very high memory usage with KVM

2009-08-07 Thread Daniel Bareiro
Hi Avi. On Sunday, 26 July 2009 19:19:39 +0300, Avi Kivity wrote: kvm memory management with pre 2.6.27 host kernels is pretty weak. Using a newer host kernel (and newer kvm) may solve this problem. Initially I am going to see how it improves the situation upgrading to KVM-84 of backports

segfault with windows XP guest

2009-08-07 Thread Gene Horodecki
Hi there, I currently have about five guests set up with KVM, one of them being windows XP. I am having trouble with the windows XP one. It will works for a bit and then the process dies with the following in the kern.log: kvm[5593]: segfault at 29c ip 004316d8 sp 7fff0766bed0

segfault with windows XP guest (oops)

2009-08-07 Thread Gene Horodecki
Sorry.. I already posted the below but I forgot to mention that my host machine is running ubuntu 8.10. I have qemu-kvm-0.10.5 and kvm-kmod-2.6.30.1 installed. Thanks! Hi there, I currently have about five guests set up with KVM, one of them being windows XP. I am having trouble with the