RE: [PATCH v2] KVM: x86: Prevent exposing TSC deadline timer feature in the absence of in-kernel APIC

2011-12-26 Thread Liu, Jinsong
Avi Kivity wrote: > On 12/22/2011 05:41 PM, Liu, Jinsong wrote: >> Avi Kivity wrote: >>> On 12/21/2011 12:25 PM, Jan Kiszka wrote: We must not report the TSC deadline timer feature on our own when user space provides the APIC as we have no clue about its features. >>> >>> We must not rep

RE: [PATCH] KVM: Don't automatically expose the TSC deadline timer in cpuid

2011-12-26 Thread Liu, Jinsong
Avi Kivity wrote: > From: Jan Kiszka > > Unlike all of the other cpuid bits, the TSC deadline timer bit is set > unconditionally, regardless of what userspace wants. > > This is broken in several ways: > - if userspace doesn't use KVM_CREATE_IRQCHIP, and doesn't emulate >the TSC deadline ti

RE: [PATCH] KVM: Don't automatically expose the TSC deadline timer in cpuid

2011-12-26 Thread Liu, Jinsong
Sasha Levin wrote: > On Sun, 2011-12-25 at 21:00 +0200, Sasha Levin wrote: >> On Sun, 2011-12-25 at 15:03 +0200, Avi Kivity wrote: >>> + if (apic) { >>> + if (best->ecx & bit(X86_FEATURE_TSC_DEADLINE_TIMER)) >>> + apic->lapic_timer.timer_mode_mask = 3 << 17; >>> +

[PATCH] kvm tool: Exit init only when /bin/sh itself stops

2011-12-26 Thread Sasha Levin
Right now we wait for any of the children to stop, which means we might exit before /bin/sh stopped. Instead, wait only for the /bin/sh (or the sandboxed) process. Signed-off-by: Sasha Levin --- tools/kvm/guest/init_stage2.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --gi

Re: [PATCH] KVM: Don't automatically expose the TSC deadline timer in cpuid

2011-12-26 Thread Avi Kivity
On 12/26/2011 10:42 AM, Liu, Jinsong wrote: > > } > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > > index df23dff..1171def 100644 > > --- a/arch/x86/kvm/x86.c > > +++ b/arch/x86/kvm/x86.c > > @@ -2089,6 +2089,9 @@ int kvm_dev_ioctl_check_extension(long ext) > > case KVM_CAP_TSC_CONT

Re: [PATCH] KVM: Don't automatically expose the TSC deadline timer in cpuid

2011-12-26 Thread Alexey Zaytsev
On Mon, Dec 26, 2011 at 12:35, Avi Kivity wrote: > On 12/26/2011 10:42 AM, Liu, Jinsong wrote: >> >  } >> > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c >> > index df23dff..1171def 100644 >> > --- a/arch/x86/kvm/x86.c >> > +++ b/arch/x86/kvm/x86.c >> > @@ -2089,6 +2089,9 @@ int kvm_dev_ioc

Re: [PATCH] KVM: Don't automatically expose the TSC deadline timer in cpuid

2011-12-26 Thread Avi Kivity
On 12/26/2011 12:43 PM, Alexey Zaytsev wrote: > On Mon, Dec 26, 2011 at 12:35, Avi Kivity wrote: > > On 12/26/2011 10:42 AM, Liu, Jinsong wrote: > >> > } > >> > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > >> > index df23dff..1171def 100644 > >> > --- a/arch/x86/kvm/x86.c > >> > +++ b/a

Re: [PATCH v5] kvm: make vcpu life cycle separated from kvm instance

2011-12-26 Thread Gleb Natapov
On Sat, Dec 17, 2011 at 11:19:35AM +0800, Liu Ping Fan wrote: > From: Liu Ping Fan > > Currently, vcpu can be destructed only when kvm instance destroyed. > Change this to vcpu's destruction before kvm instance, so vcpu MUST > and CAN be destroyed before kvm's destroy. > > Signed-off-by: Liu Pin

Re: [PATCH] KVM: Don't automatically expose the TSC deadline timer in cpuid

2011-12-26 Thread Avi Kivity
On 12/25/2011 08:39 PM, Jan Kiszka wrote: > On 2011-12-25 14:03, Avi Kivity wrote: > > From: Jan Kiszka > > > > Unlike all of the other cpuid bits, the TSC deadline timer bit is set > > unconditionally, regardless of what userspace wants. > > > > This is broken in several ways: > > - if userspa

Re: [PATCH v5] kvm: make vcpu life cycle separated from kvm instance

2011-12-26 Thread Avi Kivity
On 12/26/2011 01:09 PM, Gleb Natapov wrote: > > + > > + idx = srcu_read_lock(&kvm->srcu_vcpus); > > + kvm_for_each_vcpu(vcpu, kvm) { > > + if (!pass && !firststart && > > + vcpu != kvm->last_boosted_vcpu && > > + kvm-

Re: [PATCH v5] kvm: make vcpu life cycle separated from kvm instance

2011-12-26 Thread Gleb Natapov
On Mon, Dec 26, 2011 at 01:17:39PM +0200, Avi Kivity wrote: > On 12/26/2011 01:09 PM, Gleb Natapov wrote: > > > + > > > + idx = srcu_read_lock(&kvm->srcu_vcpus); > > > + kvm_for_each_vcpu(vcpu, kvm) { > > > + if (!pass && !firststart && > > > + vc

Re: [PATCH] KVM: Don't automatically expose the TSC deadline timer in cpuid

2011-12-26 Thread Alexey Zaytsev
On Mon, Dec 26, 2011 at 12:45, Avi Kivity wrote: > On 12/26/2011 12:43 PM, Alexey Zaytsev wrote: >> On Mon, Dec 26, 2011 at 12:35, Avi Kivity wrote: >> > On 12/26/2011 10:42 AM, Liu, Jinsong wrote: >> >> >  } >> >> > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c >> >> > index df23dff..1171

Re: [PATCH] KVM: Don't automatically expose the TSC deadline timer in cpuid

2011-12-26 Thread Avi Kivity
On 12/26/2011 01:25 PM, Alexey Zaytsev wrote: > > > > If you can, please test it: > > > > git://git.kernel.org/pub/scm/virt/kvm/kvm.git kvm-updates/3.2 > > > > Works for me, thank you. Thanks, added your Tested-by:. -- error compiling committee.c: too many arguments to function -- To unsubscr

Re: [PATCH v2] KVM: x86: Prevent exposing TSC deadline timer feature in the absence of in-kernel APIC

2011-12-26 Thread Avi Kivity
On 12/26/2011 10:11 AM, Liu, Jinsong wrote: > > > > It breaks live migration: if you start a guest on a TSC-deadline > > capable host kernel, and migrate it to a TSC-deadline incapable host > > kernel, you end up with a broken guest. > > > > More broadly, kvm never exposes features transparently

Re: [PATCH] KVM: x86: Fix build breakage due to anonymous field initialization

2011-12-26 Thread Avi Kivity
On 12/15/2011 02:04 PM, Jan Kiszka wrote: > Not all compilers accept anonymous field initialization, e.g. gcc > 4.5.1. > Thanks, applied. -- 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

Re: [PATCH 2/3] KVM: MMU: Add missing large page accounting to drop_large_spte()

2011-12-26 Thread Avi Kivity
On 12/20/2011 06:37 AM, Takuya Yoshikawa wrote: > ping > > (2011/11/29 14:03), Takuya Yoshikawa wrote: >> Signed-off-by: Takuya Yoshikawa >> --- >> arch/x86/kvm/mmu.c |1 + >> 1 files changed, 1 insertions(+), 0 deletions(-) >> >> diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c >> index

Re: [PATCH 3/3] KVM: MMU: Make drop_large_spte() more generic

2011-12-26 Thread Avi Kivity
On 11/29/2011 07:04 AM, Takuya Yoshikawa wrote: > There are many places where we drop large spte and we are always doing > much the same as drop_large_spte(). > > To avoid these duplications, this patch makes drop_large_spte() more > generically usable: it now takes an argument to know if it must f

Re: [PATCH 0/3] KVM: MMU: Trivial fix and cleanups

2011-12-26 Thread Avi Kivity
On 11/29/2011 07:01 AM, Takuya Yoshikawa wrote: > Made when I was reading mmu code. > > Takuya > > BTW, is threre any good way to test large page functionality? > Just booting a guest with transparent hugepages enabled is a good test. The guest kernel will use hugepages itself even if appli

Re: [PATCH] KVM: Move gfn_to_memslot() to kvm_host.h

2011-12-26 Thread Avi Kivity
On 12/20/2011 11:21 AM, Paul Mackerras wrote: > This moves gfn_to_memslot(), and the functions it calls, that is, > search_memslots() and __gfn_to_memslot(), from kvm_main.c to kvm_host.h > so that gfn_to_memslot() can be called from non-modular code even > when KVM is a module. On powerpc, the Bo

Re: [PATCH] KVM: SVM: Add support for AMD's OSVW feature in guests

2011-12-26 Thread Avi Kivity
On 12/19/2011 07:46 PM, Boris Ostrovsky wrote: > From: Boris Ostrovsky > > In some cases guests should not provide workarounds for errata even when the > physical processor is affected. For example, because of erratum 400 on family > 10h processors a Linux guest will read an MSR (resulting in VMEX

[GIT PULL] KVM fixes for 3.2-rc7

2011-12-26 Thread Avi Kivity
Linus, please pull from: git://git.kernel.org/pub/scm/virt/kvm/kvm.git kvm-updates/3.2 to receive an unfortunately large bunch of fixes for Linux 3.2 KVM, some fairly critical: - two DoS issues in the device assignment code - an oops in the emulated PIT code - the regression caused by incor

Re: [PATCH 3/3] QEMU kvm/i386 : Adding KICK_VCPU capability support in i386 target.

2011-12-26 Thread Avi Kivity
On 12/19/2011 04:11 PM, Jan Kiszka wrote: > >> > >> Backwards compatibility > > > > If we want backwards compatibility, we need more than just a simple feature > > check, no? Oh, you feed that into CPUID? That's nifty. Ok, so you behave > > like VMX/SVM do on real hardware - you always expose th

Re: Current kernel fails to compile with KVM on PowerPC

2011-12-26 Thread Alexander Graf
On 25.12.2011, at 12:01, Jörg Sommer wrote: > Alexander Graf hat am Sat 24. Dec, 18:05 (+0100) geschrieben: >> On 24.12.2011, at 12:13, Jörg Sommer wrote: >>> Jörg Sommer hat am Sat 24. Dec, 11:31 (+0100) geschrieben: Alexander Graf hat am Fri 23. Dec, 14:50 (+0100) geschrieben: > On 20.

RE: [PATCH v2] KVM: x86: Prevent exposing TSC deadline timer feature in the absence of in-kernel APIC

2011-12-26 Thread Liu, Jinsong
Avi Kivity wrote: > On 12/26/2011 10:11 AM, Liu, Jinsong wrote: >>> >>> It breaks live migration: if you start a guest on a TSC-deadline >>> capable host kernel, and migrate it to a TSC-deadline incapable host >>> kernel, you end up with a broken guest. >>> >>> More broadly, kvm never exposes fea

Re: [Qemu-devel] [PATCH 3/3] QEMU kvm/i386 : Adding KICK_VCPU capability support in i386 target.

2011-12-26 Thread Raghavendra K T
On 12/26/2011 07:37 PM, Avi Kivity wrote: On 12/19/2011 04:11 PM, Jan Kiszka wrote: Backwards compatibility If we want backwards compatibility, we need more than just a simple feature check, no? Oh, you feed that into CPUID? That's nifty. Ok, so you behave like VMX/SVM do on real hardware -

[PATCH] Expose tsc deadline timer cpuid to guest

2011-12-26 Thread Liu, Jinsong
>From 19caf1db1f93e6f6b736e1dfd5e91a0c7669adec Mon Sep 17 00:00:00 2001 From: Liu Jinsong Date: Tue, 27 Dec 2011 04:08:27 +0800 Subject: [PATCH] Expose tsc deadline timer cpuid to guest Depend on several factors: 1. Considering live migration, user enable/disable tsc deadline timer; 2. If guest u

kvm-kmod broken on Linux 2.6.32.y stable series [patch included]

2011-12-26 Thread Richard Yao
Commit 64c8f7b9a24b1de710ad8413da503d61ede6ae45 to Linux 2.6.32.y broke kvm-kmod. There are preprocessor directives in kvm-kmod that appear to be intended to remedy this, but there is a logical error in them. I have attached a patch that corrects that. I am not on the list, so please CC any replie

Re: kvm-kmod broken on Linux 2.6.32.y stable series [patch included]

2011-12-26 Thread Richard Yao
I forgot to include the patch. Sorry about that. On Mon, Dec 26, 2011 at 11:08 PM, Richard Yao wrote: > Commit 64c8f7b9a24b1de710ad8413da503d61ede6ae45 to Linux 2.6.32.y > broke kvm-kmod. There are preprocessor directives in kvm-kmod that > appear to be intended to remedy this, but there is a log

Re: [PATCH] KVM: SVM: Add support for AMD's OSVW feature in guests

2011-12-26 Thread Boris Ostrovsky
On 12/26/11 08:53, Avi Kivity wrote: On 12/19/2011 07:46 PM, Boris Ostrovsky wrote: From: Boris Ostrovsky In some cases guests should not provide workarounds for errata even when the physical processor is affected. For example, because of erratum 400 on family 10h processors a Linux guest will

Re: [PATCH v5] kvm: make vcpu life cycle separated from kvm instance

2011-12-26 Thread Liu ping fan
On Mon, Dec 26, 2011 at 7:09 PM, Gleb Natapov wrote: > On Sat, Dec 17, 2011 at 11:19:35AM +0800, Liu Ping Fan wrote: >> From: Liu Ping Fan >> >> Currently, vcpu can be destructed only when kvm instance destroyed. >> Change this to vcpu's destruction before kvm instance, so vcpu MUST >> and CAN be