[PATCH] kvm x86 mmu: simplify kvm_mmu_unlink_parents()

2010-04-17 Thread Lai Jiangshan
mmu_page_remove_parent_pte() does much maintenance works, but kvm_mmu_unlink_parents() unlink all parents, so such maintenance works are not need. This patch simplifies the works of kvm_mmu_unlink_parents() by unlinking parents without so many maintenance works. Signed-off-by: Lai Jiangshan

[PATCH] kvm: do not need hardware_disable when CPU_UP_CANCELED

2010-04-17 Thread Lai Jiangshan
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. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index

[PATCH] kvm: don not fail when cache is sufficient

2010-04-17 Thread Lai Jiangshan
cleanup: don not fail when cache is sufficient Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index c8c074c..90f666e 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -304,7 +304,7 @@ static int mmu_topup_memory_cache(struct

[PATCH] kvm: reduce couple for ACC_EXEC_MASK

2010-04-17 Thread Lai Jiangshan
The statement access = ~(gpte PT64_NX_SHIFT); tries to clear bit ACC_EXEC_MASK actually. This statement relies PT64_NX_SHIFT==63ACC_EXEC_MASK=1 This patch reduces this couple. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- diff --git a/arch/x86/kvm/paging_tmpl.h

[PATCH 1/2] kvm: simplify kvm_vm_ioctl_set_memory_alias

2010-04-17 Thread Lai Jiangshan
It's just time waste if we free a object and allocate it immediately. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 24cd0ee..db8d7fe 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -2479,15 +2479,8 @@ static int

[PATCH 2/2] kvm: set new alias directly when old one is not valid

2010-04-17 Thread Lai Jiangshan
When old one is not valid, we don't need set the flags KVM_ALIAS_INVALID. Because no one {will use}/{be using} it. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index db8d7fe..6120e33 100644 --- a/arch/x86/kvm/x86.c +++

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

2010-04-17 Thread Joerg Roedel
Hi Yanmin, On Fri, Apr 16, 2010 at 03:34:35PM +0800, Zhang, Yanmin wrote: Below is the kernel patch to enable perf to collect guest os statistics. Joerg, Would you like to add support on svm? I don't know the exact point to trigger NMI to host with svm. Yes I will do that, thanks for all

Re: [PATCH V2] drivers/uio/uio.c: DMA mapping, interrupt extensions, etc.

2010-04-17 Thread Tom Lyon
The current uio and uio_pci_generic allow multiple opens; I was just preserving that behavior. On Saturday 17 April 2010 03:43:09 am Joerg Roedel wrote: On Thu, Apr 15, 2010 at 01:55:29PM -0700, Tom Lyon wrote: + down(idev-gate); + if (idev-listeners == 0) { /* first open

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

2010-04-17 Thread Avi Kivity
On 04/15/2010 05:08 PM, Sheng Yang wrote: On Thursday 15 April 2010 18:44:15 Avi Kivity wrote: On 04/15/2010 01:40 PM, Joerg Roedel wrote: That means an NMI that happens outside guest code (for example, in the mmu, or during the exit itself) would be counted as if in guest code.

Re: KVM autotest: add boot_savevm test

2010-04-17 Thread Lucas Meneghel Rodrigues
On Thu, 2010-04-15 at 16:09 -0300, Marcelo Tosatti wrote: This test boots a guest while periodically running savevm/loadvm. Ok Marcelo, test looks good, applied. Thanks! Adjust savevm_delay/guest memory size to reduce run time, if excessive. Signed-off-by: Marcelo Tosatti

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

2010-04-17 Thread Avi Kivity
On 04/16/2010 10:34 AM, Zhang, Yanmin wrote: Below is the kernel patch to enable perf to collect guest os statistics. Joerg, Would you like to add support on svm? I don't know the exact point to trigger NMI to host with svm. See below code with vmx: +

Re: [PATCH V2] drivers/uio/uio.c: DMA mapping, interrupt extensions, etc.

2010-04-17 Thread Avi Kivity
On 04/15/2010 11:55 PM, Tom Lyon wrote: This is the second of 2 related, but independent, patches. This is for uio.c, the previous is for uio_pci_generic.c. The 2 patches were previously one large patch. Changes for this version: - uio_pci_generic.c just gets extensions so that a single fd can

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

2010-04-17 Thread Avi Kivity
On 04/17/2010 09:48 PM, Avi Kivity wrote: +static u64 last_value = 0; Needs to be atomic64_t. + cycle_t pvclock_clocksource_read(struct pvclock_vcpu_time_info *src) { struct pvclock_shadow_time shadow; unsigned version; cycle_t ret, offset; +u64 last; +do {

Re: [PATCH 2/5] change msr numbers for kvmclock

2010-04-17 Thread Avi Kivity
On 04/15/2010 09:37 PM, Glauber Costa wrote: Avi pointed out a while ago that those MSRs falls into the pentium PMU range. So the idea here is to add new ones, and after a while, deprecate the old ones. Signed-off-by: Glauber Costaglom...@redhat.com --- arch/x86/include/asm/kvm_para.h |8

Re: [PATCH 3/5] Try using new kvm clock msrs

2010-04-17 Thread Avi Kivity
On 04/15/2010 09:37 PM, Glauber Costa wrote: We now added a new set of clock-related msrs in replacement of the old ones. In theory, we could just try to use them and get a return value indicating they do not exist, due to our use of kvm_write_msr_save. However, kvm clock registration happens

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

2010-04-17 Thread Avi Kivity
On 04/15/2010 09:37 PM, Glauber Costa wrote: Since we're changing the msrs kvmclock uses, we have to communicate that to the guest, through cpuid. We can add a new KVM_CAP to the hypervisor, and then patch userspace to recognize it. And if we ever add a new cpuid bit in the future, we have to

Re: VM performance issue in KVM guests.

2010-04-17 Thread Avi Kivity
On 04/16/2010 05:27 AM, Zhang, Xiantao wrote: When vcpus are pinned to pcpus, there is a 50% chance that a guest's vcpus will be co-scheduled and spinlocks will perform will. When vcpus are not pinned, but affine wakeups are disabled, there is a 33% chance that vcpus will be co-scheduled.

Re: VM performance issue in KVM guests.

2010-04-17 Thread Avi Kivity
On 04/15/2010 04:33 PM, Peter Zijlstra wrote: On Thu, 2010-04-15 at 11:18 +0300, Avi Kivity wrote: Certainly that has even greater potential for Linux guests. Note that we spin on mutexes now, so we need to prevent preemption while the lock owner is running. either that, or disable

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

2010-04-17 Thread Ingo Molnar
* Avi Kivity a...@redhat.com wrote: On 04/17/2010 10:13 PM, Ingo Molnar wrote: * Avi Kivitya...@redhat.com wrote: On 04/16/2010 10:34 AM, Zhang, Yanmin wrote: Below is the kernel patch to enable perf to collect guest os statistics. Joerg, Would you like to add support on svm? I

Re: Timedrift in KVM guests after livemigration.

2010-04-17 Thread Espen Berg
Den 15.04.2010 09:35, skrev Espen Berg: We have three KVM hosts that supports live-migration between them, but one of our problems is time drifting. The three frontends has different CPU frequency and the KVM guests adopt the frequency from the host machine where it was first started. Host1:

Re: Timedrift in KVM guests after livemigration.

2010-04-17 Thread Michael Tokarev
17.04.2010 23:52, Espen Berg wrote: Den 15.04.2010 09:35, skrev Espen Berg: We have three KVM hosts that supports live-migration between them, but one of our problems is time drifting. The three frontends has different CPU frequency and the KVM guests adopt the frequency from the host machine

Re: [PATCH] VGA Bios allow 1920x1080

2010-04-17 Thread Avi Kivity
On 04/13/2010 07:07 AM, Øyvind Sæther wrote: The patch lets me run 1920x1080 resolution, some displays are only that and not 1920x1200 these days. Gentoos ebuild doesn't seem to make the vgabios and only uses /pc-bios/vgabios.bin, making kvm/vgabios and replace vgabios.bin with the

Re: [PATCH] VGA Bios allow 1920x1080

2010-04-17 Thread Øyvind Sæther
The patch lets me run 1920x1080 resolution, some displays are only that and not 1920x1200 these days. Gentoos ebuild doesn't seem to make the vgabios and only uses /pc-bios/vgabios.bin, making kvm/vgabios and replace vgabios.bin with the VGABIOS-lgpl-latest.bin it makes works (for me).

Re: Timedrift in KVM guests after livemigration.

2010-04-17 Thread Espen Berg
Den 17.04.2010 22:17, skrev Michael Tokarev: We have three KVM hosts that supports live-migration between them, but one of our problems is time drifting. The three frontends has different CPU frequency and the KVM guests adopt the frequency from the host machine where it was first started. What

[PATCH] KVM test: Introducing Opensuse and SLES unattended installs

2010-04-17 Thread Lucas Meneghel Rodrigues
From: yogi anant...@linux.vnet.ibm.com Adds support to do unattended install of Opensuse11, patch adds new autoyast files (OpenSUSE.xml and SLES-11.xml) and creates entries for unattended install in tests_base.cfg. The patch also introduces an optional parameter, post_install_delay in the config

Re: [PATCH] [Autotest] [KVM-AUTOTEST]Opensuse unattended install

2010-04-17 Thread Lucas Meneghel Rodrigues
On Tue, 2010-03-23 at 20:19 +0530, Yogananth Subramanian wrote: Adds support to do unattended install of Opensuse11, patch adds a new autoyast file (OpenSUSE.xml) and creates entries for unattended install in tests_base.cfg. The patch also introduces a small delay(about 10s) in

Re: [PATCH] VGA Bios allow 1920x1080

2010-04-17 Thread Amos Kong
2010/4/18 Øyvind Sæther oyvi...@everdot.org: The patch lets me run 1920x1080 resolution, some displays are only that and not 1920x1200 these days. Gentoos ebuild doesn't seem to make the vgabios and only uses /pc-bios/vgabios.bin, making kvm/vgabios and replace vgabios.bin with the

Re: [Autotest] Autotest: Unattended_install testcase always fail with rhel3.9-32 guest

2010-04-17 Thread David S. Ahern
On 04/17/2010 10:09 PM, Amos Kong wrote: %post --interpreter /usr/bin/python import socket, os os.system('dhclient') os.system('chkconfig sshd on') os.system('iptables -F') os.system('echo 0 /selinux/enforce') server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.bind(('',