I/O Performance Tips

2010-12-09 Thread Sebastian Nickel - Hetzner Online AG
Hello, we have got some issues with I/O in our kvm environment. We are using kernel version 2.6.32 (Ubuntu 10.04 LTS) to virtualise our hosts and we are using ksm, too. Recently we noticed that sometimes the guest systems (mainly OpenSuse guest systems) suddenly have a read only filesystem. After

Re: I/O Performance Tips

2010-12-09 Thread RW
We've don't use Ubuntu (we use Gentoo/KVM 0.12.5) but we've had a similar problem with kernels 2.6.32-r11 (this is Gentoo specific and means update -r11 and not release candidate 11) and with the first three releases of 2.6.34 especially when NFS was involved. We're currently running

Re: [PATCH] KVM: Fix OSXSAVE after migration

2010-12-09 Thread Avi Kivity
On 12/09/2010 03:17 AM, Sheng Yang wrote: if (!is_long_mode(vcpu) is_pae(vcpu)) { load_pdptrs(vcpu, vcpu-arch.walk_mmu, vcpu-arch.cr3); mmu_reset_needed = 1; We really should use kvm_set_crX() here. Yeah, I suppose we use ops-set_cr4() here

Re: [RFC PATCH 3/3] kvm: use yield_to instead of sleep in kvm_vcpu_on_spin

2010-12-09 Thread Avi Kivity
On 12/09/2010 12:38 AM, Rik van Riel wrote: - /* Sleep for 100 us, and hope lock-holder got scheduled */ - expires = ktime_add_ns(ktime_get(), 10UL); - schedule_hrtimeout(expires, HRTIMER_MODE_ABS); + if (first_round last_boosted_vcpu == kvm-last_boosted_vcpu) { + /* We have not found

Re: [PATCH 06/28] nVMX: Implement reading and writing of VMX MSRs

2010-12-09 Thread Avi Kivity
On 12/08/2010 07:03 PM, Nadav Har'El wrote: When the guest can use VMX instructions (when the nested module option is on), it should also be able to read and write VMX MSRs, e.g., to query about VMX capabilities. This patch adds this support. + +static int vmx_set_vmx_msr(struct kvm_vcpu *vcpu,

Re: [PATCH 07/28] nVMX: Decoding memory operands of VMX instructions

2010-12-09 Thread Avi Kivity
On 12/08/2010 07:03 PM, Nadav Har'El wrote: This patch includes a utility function for decoding pointer operands of VMX instructions issued by L1 (a guest hypervisor) Signed-off-by: Nadav Har'Eln...@il.ibm.com --- arch/x86/kvm/vmx.c | 59 +++

[PATCH] kvm: x86: Save/restore error_code

2010-12-09 Thread Jason Wang
The saving and restoring of error_code seems lost and convert the error_code to uint32_t. Signed-off-by: Jason Wang jasow...@redhat.com --- target-i386/cpu.h |4 ++-- target-i386/machine.c |2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/target-i386/cpu.h

Re: [PATCH] kvm: x86: Save/restore error_code

2010-12-09 Thread Juan Quintela
Jason Wang jasow...@redhat.com wrote: The saving and restoring of error_code seems lost and convert the error_code to uint32_t. Signed-off-by: Jason Wang jasow...@redhat.com --- target-i386/cpu.h |4 ++-- target-i386/machine.c |2 ++ 2 files changed, 4 insertions(+), 2

Re: [PATCH 02/28] nVMX: Add VMX and SVM to list of supported cpuid features

2010-12-09 Thread Joerg Roedel
On Wed, Dec 08, 2010 at 07:00:59PM +0200, Nadav Har'El wrote: If the nested module option is enabled, add the VMX CPU feature to the list of CPU features KVM advertises with the KVM_GET_SUPPORTED_CPUID ioctl. Qemu uses this ioctl, and intersects KVM's list with its own list of desired cpu

Re: [PATCH 08/28] nVMX: Hold a vmcs02 for each vmcs12

2010-12-09 Thread Avi Kivity
On 12/08/2010 07:04 PM, Nadav Har'El wrote: In this patch we add a list of L0 (hardware) VMCSs, which we'll use to hold a hardware VMCS for each active vmcs12 (i.e., for each L2 guest). We call each of these L0 VMCSs a vmcs02, as it is the VMCS that L0 uses to run its nested guest L2.

Re: [PATCH 09/28] nVMX: Add VMCS fields to the vmcs12

2010-12-09 Thread Avi Kivity
On 12/08/2010 07:04 PM, Nadav Har'El wrote: In this patch we add to vmcs12 (the VMCS that L1 keeps for L2) all the standard VMCS fields. These fields are encapsulated in a struct vmcs_fields. Later patches will enable L1 to read and write these fields using VMREAD/ VMWRITE, and they will be

Re: [PATCH 0/28] nVMX: Nested VMX, v7

2010-12-09 Thread Avi Kivity
On 12/08/2010 06:59 PM, Nadav Har'El wrote: Hi, This is the seventh iteration of the nested VMX patch set. It fixes a bunch of bugs in the previous iteration, and in particular it now works correctly with EPT in the L0 hypervisor, so ept=0 no longer needs to be specified. This new set of

Re: I/O Performance Tips

2010-12-09 Thread Sebastian Nickel - Hetzner Online AG
Hello, I agree with Robert, the QEMU command-line used to launch these guests would be useful (on host: ps aux | grep kvm). Have you explicitly set a -drive cache= mode (like none, writeback, or writethrough)? here is the qemu command line we are using (or which libvirt generates):

Re: [PATCH 19/28] nVMX: Exiting from L2 to L1

2010-12-09 Thread Avi Kivity
On 12/08/2010 07:09 PM, Nadav Har'El wrote: This patch implements nested_vmx_vmexit(), called when the nested L2 guest exits and we want to run its L1 parent and let it handle this exit. Note that this will not necessarily be called on every L2 exit. L0 may decide to handle a particular exit on

Re: [PATCH 25/28] nVMX: Further fixes for lazy FPU loading

2010-12-09 Thread Avi Kivity
On 12/08/2010 07:12 PM, Nadav Har'El wrote: KVM's Lazy FPU loading means that sometimes L0 needs to set CR0.TS, even if a guest didn't set it. Moreover, L0 must also trap CR0.TS changes and NM exceptions, even if we have a guest hypervisor (L1) who didn't want these traps. And of course,

Re: [PATCH 24/28] nVMX: Handling of CR0 and CR4 modifying instructions

2010-12-09 Thread Avi Kivity
On 12/08/2010 07:12 PM, Nadav Har'El wrote: When L2 tries to modify CR0 or CR4 (with mov or clts), and modifies a bit which L1 asked to shadow (via CR[04]_GUEST_HOST_MASK), we already do the right thing: we let L1 handle the trap (see nested_vmx_exit_handled_cr() in a previous patch). When L2

Re: virtio_net sometimes didn't work

2010-12-09 Thread Michael S. Tsirkin
On Fri, Nov 26, 2010 at 10:38:33AM +0800, lidong chen wrote: Does this message appear on boot, or after some stress? on boot, and only appear when boot from network. Which qemu-kvm version? [r...@kvm-4slot ~]# /usr/libexec/qemu-kvm --version QEMU PC emulator version 0.12.1

Re: Performance test result between per-vhost kthread disable and enable

2010-12-09 Thread Michael S. Tsirkin
On Tue, Nov 23, 2010 at 10:13:43AM +0800, lidong chen wrote: I test the performance between per-vhost kthread disable and enable. Test method: Send the same traffic load between per-vhost kthread disable and enable, and compare the cpu rate of host os. I run five vm on kvm, each of them

Re: Performance test result between per-vhost kthread disable and enable

2010-12-09 Thread Michael S. Tsirkin
On Thu, Dec 09, 2010 at 03:31:08PM +0200, Michael S. Tsirkin wrote: On Tue, Nov 23, 2010 at 10:13:43AM +0800, lidong chen wrote: I test the performance between per-vhost kthread disable and enable. Test method: Send the same traffic load between per-vhost kthread disable and enable,

Re: [PATCH] [qemu-kvm-next-tree] fix compile error of hw/device-assignment.c

2010-12-09 Thread Alex Williamson
On Thu, 2010-12-09 at 14:43 +0800, Wei Yongjun wrote: Fix the following compile error in next tree: CCx86_64-softmmu/device-assignment.o hw/device-assignment.c: In function ‘assigned_device_pci_cap_init’: hw/device-assignment.c:1463: error: ‘PCI_PM_CTRL_NO_SOFT_RST’ undeclared (first

Re: I/O Performance Tips

2010-12-09 Thread Stefan Hajnoczi
On Thu, Dec 9, 2010 at 12:52 PM, Sebastian Nickel - Hetzner Online AG sebastian.nic...@hetzner.de wrote: here is the qemu command line we are using (or which libvirt generates): /usr/bin/kvm -S -M pc-0.12 -enable-kvm -m 512 -smp 1,sockets=1,cores=1,threads=1 -name vm-933 -uuid

Re: [PATCH v2 0/5] Extra capabilities for device assignment

2010-12-09 Thread Avi Kivity
On 12/09/2010 05:13 PM, Markus Armbruster wrote: Avi Kivitya...@redhat.com writes: On 12/06/2010 06:43 PM, Alex Williamson wrote: On Mon, 2010-12-06 at 18:34 +0200, Avi Kivity wrote: On 12/06/2010 06:21 PM, Alex Williamson wrote: v2: - Reimplement 2/5 to remove more

Re: [PATCH v2 0/5] Extra capabilities for device assignment

2010-12-09 Thread Markus Armbruster
Avi Kivity a...@redhat.com writes: On 12/06/2010 06:43 PM, Alex Williamson wrote: On Mon, 2010-12-06 at 18:34 +0200, Avi Kivity wrote: On 12/06/2010 06:21 PM, Alex Williamson wrote: v2: - Reimplement 2/5 to remove more cruft v1: Now that we've got PCI

[PATCH] pci: Fix PCI capabilities collision error value

2010-12-09 Thread Alex Williamson
Signed-off-by: Alex Williamson alex.william...@redhat.com --- hw/pci.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 288d6fd..0962416 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -1856,7 +1856,7 @@ int pci_add_capability(PCIDevice *pdev, uint8_t

Re: [PATCH v2 0/5] Extra capabilities for device assignment

2010-12-09 Thread Alex Williamson
On Thu, 2010-12-09 at 17:32 +0200, Avi Kivity wrote: On 12/09/2010 05:13 PM, Markus Armbruster wrote: Avi Kivitya...@redhat.com writes: On 12/06/2010 06:43 PM, Alex Williamson wrote: On Mon, 2010-12-06 at 18:34 +0200, Avi Kivity wrote: On 12/06/2010 06:21 PM, Alex Williamson

Re: [RFC PATCH 3/3] kvm: use yield_to instead of sleep in kvm_vcpu_on_spin

2010-12-09 Thread Rik van Riel
On 12/09/2010 05:28 AM, Avi Kivity wrote: On 12/09/2010 12:38 AM, Rik van Riel wrote: - /* Sleep for 100 us, and hope lock-holder got scheduled */ - expires = ktime_add_ns(ktime_get(), 10UL); - schedule_hrtimeout(expires, HRTIMER_MODE_ABS); + if (first_round last_boosted_vcpu ==

Re: [PATCH] pci: Fix PCI capabilities collision error value

2010-12-09 Thread Markus Armbruster
Alex Williamson alex.william...@redhat.com writes: Signed-off-by: Alex Williamson alex.william...@redhat.com --- hw/pci.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 288d6fd..0962416 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -1856,7

make snapshot and restoring it

2010-12-09 Thread hadi golestani
Hello, I've a windows guest that I like to make snapshot of it and revert to that snapshot many times in a day. Does qcow2 have any solution for making this happen really fast with no files to be copied? Regards -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a

Re: [RFC PATCH] KVM: Fix missing lock for kvm_io_bus_unregister_dev()

2010-12-09 Thread Takuya Yoshikawa
Marcelo Tosatti mtosa...@redhat.com wrote: --- a/arch/x86/kvm/i8254.c +++ b/arch/x86/kvm/i8254.c @@ -744,9 +744,11 @@ void kvm_free_pit(struct kvm *kvm) struct hrtimer *timer; if (kvm-arch.vpit) { + mutex_lock(kvm-slots_lock);

Re: [PATCH 2/6] qemu,qmp: convert do_inject_nmi() to QObject

2010-12-09 Thread Luiz Capitulino
On Thu, 09 Dec 2010 14:59:00 +0800 Lai Jiangshan la...@cn.fujitsu.com wrote: Convert do_inject_nmi() to QObject, we need to use it(via libvirt). Patches 0/6 and 1/6 are missing. Also, I see that you're converting two unrelated commands in the same series. Please, split into two series. It

Re: [PATCH 6/6] qemu,qmp: Convert do_sendkey() to QObject,QError

2010-12-09 Thread Luiz Capitulino
On Thu, 09 Dec 2010 14:59:40 +0800 Lai Jiangshan la...@cn.fujitsu.com wrote: Convert do_sendkey() to QObject,QError, we need to use it.(via libvirt) It is a trivial conversion, carefully converted the error reports. Trivial conversion doesn't seem to lead to a good interface for qmp,

[PATCH] Fix preempt imbalance in kvm_timer_init()

2010-12-09 Thread Thomas Meyer
Signed-off-by: Thomas Meyer tho...@m3y3r.de --- arch/x86/kvm/x86.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index cdac9e5..2609c3d 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -4561,7 +4561,7 @@ static

Re: [PATCH 1/6] qemu,kvm: Enable NMI support for user space irqchip

2010-12-09 Thread Lai Jiangshan
On 12/09/2010 03:25 PM, Jan Kiszka wrote: Am 09.12.2010 07:58, Lai Jiangshan wrote: Make use of the new KVM_NMI IOCTL to send NMIs into the KVM guest if the user space APIC emulation or some other source raised them. In that light, the subject is not absolutely correct. [...]

Re: [PATCH] kvm: x86: Save/restore error_code

2010-12-09 Thread Jason Wang
Juan Quintela writes: Jason Wang jasow...@redhat.com wrote: The saving and restoring of error_code seems lost and convert the error_code to uint32_t. Signed-off-by: Jason Wang jasow...@redhat.com --- target-i386/cpu.h |4 ++-- target-i386/machine.c |2 ++ 2

Re: [PATCH] kvm: x86: Save/restore error_code

2010-12-09 Thread Juan Quintela
Jason Wang jasow...@redhat.com wrote: Juan Quintela writes: Jason Wang jasow...@redhat.com wrote: The saving and restoring of error_code seems lost and convert the error_code to uint32_t. Signed-off-by: Jason Wang jasow...@redhat.com --- target-i386/cpu.h |4

Re: [RFC PATCH 2/3] sched: add yield_to function

2010-12-09 Thread Rik van Riel
On 12/03/2010 09:06 AM, Srivatsa Vaddagiri wrote: On Fri, Dec 03, 2010 at 03:03:30PM +0100, Peter Zijlstra wrote: No, because they do receive service (they spend some time spinning before being interrupted), so the respective vruntimes will increase, at some point they'll pass B0 and it'll get

Re: [RFC PATCH 0/3] directed yield for Pause Loop Exiting

2010-12-09 Thread Balbir Singh
* Rik van Riel r...@redhat.com [2010-12-02 14:41:29]: When running SMP virtual machines, it is possible for one VCPU to be spinning on a spinlock, while the VCPU that holds the spinlock is not currently running, because the host scheduler preempted it to run something else. Both Intel and

[PATCH v2 1/2] QError: new QERR_INVALID_CPU_INDEX

2010-12-09 Thread Lai Jiangshan
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- diff --git a/qerror.c b/qerror.c index ac2cdaf..f59fb58 100644 --- a/qerror.c +++ b/qerror.c @@ -117,6 +117,10 @@ static const QErrorStringTable qerror_table[] = { .desc = Invalid block format '%(name)', }, { +

[PATCH v2 2/2] qemu,qmp: convert do_inject_nmi() to QObject, QError

2010-12-09 Thread Lai Jiangshan
Convert do_inject_nmi() to QObject, QError, we need to use it(via libvirt). changed from v1 Add document. Add error handling when the cpu index is invalid. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- diff --git a/hmp-commands.hx b/hmp-commands.hx index 23024ba..f86d9fe 100644 ---

[PATCH V2] qemu,kvm: Enable user space NMI injection for kvm guest

2010-12-09 Thread Lai Jiangshan
Make use of the new KVM_NMI IOCTL to send NMIs into the KVM guest if the user space raised them. (example: qemu monitor's nmi command) Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- diff --git a/configure b/configure index 2917874..f6f9362 100755 --- a/configure +++ b/configure @@ -1646,6

RE: Does KVM use one EPT table per Guest CR3?

2010-12-09 Thread Lok Kwong Yan
Thanks again. I understand that the table can change over time, but it doesn't explain why the top-most table gets zapped and seemingly recreated with a different page frame (and thus the different EPTP values) so frequently. Why isn't the table being updated instead of being destroyed and

[PATCH] qemu-kvm,cleanup: convert kvm_ioctl(KVM_CHECK_EXTENSION) to kvm_check_extension()

2010-12-09 Thread Lai Jiangshan
simple cleanup and use existed helper: kvm_check_extension(). Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- diff --git a/kvm-all.c b/kvm-all.c index cae24bb..35fc73c 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -678,7 +678,7 @@ int kvm_init(int smp_cpus) s-broken_set_mem_region = 1;