Re: Questions about KVM TSC trapping

2015-09-25 Thread David Matlack
..@hotmail.com> >> wrote: >> > Hi Guys, >> > >> > I found below patch for KVM TSC trapping / migration support, >> > >> > https://lkml.org/lkml/2011/1/6/90 >> > >> > It seemed the patch were not merged in Linux mainline. &

Re: Questions about KVM TSC trapping

2015-09-23 Thread yangoliver
David, Sorry for late reply. See my inline comments. On Tue, 15 Sep 2015, David Matlack wrote: > On Tue, Sep 15, 2015 at 12:04 AM, Oliver Yang <yang_oli...@hotmail.com> wrote: > > Hi Guys, > > > > I found below patch for KVM TSC trapping / migration support, > &g

Re: Questions about KVM TSC trapping

2015-09-15 Thread Wanpeng Li
On 9/16/15 6:00 AM, David Matlack wrote: On Tue, Sep 15, 2015 at 12:04 AM, Oliver Yang <yang_oli...@hotmail.com> wrote: Hi Guys, I found below patch for KVM TSC trapping / migration support, https://lkml.org/lkml/2011/1/6/90 It seemed the patch were not merged in Linux mainline. So I

Re: Questions about KVM TSC trapping

2015-09-15 Thread David Matlack
On Tue, Sep 15, 2015 at 12:04 AM, Oliver Yang <yang_oli...@hotmail.com> wrote: > Hi Guys, > > I found below patch for KVM TSC trapping / migration support, > > https://lkml.org/lkml/2011/1/6/90 > > It seemed the patch were not merged in Linux mainline. > > So I h

Questions about KVM TSC trapping

2015-09-15 Thread Oliver Yang
Hi Guys, I found below patch for KVM TSC trapping / migration support,  https://lkml.org/lkml/2011/1/6/90 It seemed the patch were not merged in Linux mainline. So I have 3 questions here,  1.  Can KVM support TSC trapping today? If not, what is the plan? 2. What is the solution if my SMP

Re: [KVM TSC trapping / migration 2/2] Add TSC KHZ MSR

2011-01-18 Thread Zachary Amsden
On 01/14/2011 06:00 AM, Juan Quintela wrote: Marcelo Tosattimtosa...@redhat.com wrote: On Fri, Jan 07, 2011 at 10:44:20AM -1000, Zachary Amsden wrote: On 01/07/2011 12:48 AM, Marcelo Tosatti wrote: On Thu, Jan 06, 2011 at 12:10:45AM -1000, Zachary Amsden wrote:

Re: [KVM TSC trapping / migration 2/2] Add TSC KHZ MSR

2011-01-14 Thread Juan Quintela
Marcelo Tosatti mtosa...@redhat.com wrote: On Fri, Jan 07, 2011 at 10:44:20AM -1000, Zachary Amsden wrote: On 01/07/2011 12:48 AM, Marcelo Tosatti wrote: On Thu, Jan 06, 2011 at 12:10:45AM -1000, Zachary Amsden wrote: Use an MSR to allow soft migration to hosts which do not support TSC

Re: [KVM TSC trapping / migration 1/2] Add TSC trapping for SVM and VMX

2011-01-10 Thread Joerg Roedel
On Thu, Jan 06, 2011 at 12:10:44AM -1000, Zachary Amsden wrote: +static void svm_set_tsc_trapping(struct kvm_vcpu *vcpu, bool trap) +{ + struct vcpu_svm *svm = to_svm(vcpu); + if (trap) + svm-vmcb-control.intercept |= 1ULL INTERCEPT_RDTSC; + else +

Re: [KVM TSC trapping / migration 2/2] Add TSC KHZ MSR

2011-01-10 Thread Marcelo Tosatti
On Fri, Jan 07, 2011 at 10:44:20AM -1000, Zachary Amsden wrote: On 01/07/2011 12:48 AM, Marcelo Tosatti wrote: On Thu, Jan 06, 2011 at 12:10:45AM -1000, Zachary Amsden wrote: Use an MSR to allow soft migration to hosts which do not support TSC trapping. Rather than make this a required

Re: [KVM TSC trapping / migration 1/2] Add TSC trapping for SVM and VMX

2011-01-09 Thread Zachary Amsden
On 01/07/2011 01:23 AM, Marcelo Tosatti wrote: On Thu, Jan 06, 2011 at 12:10:44AM -1000, Zachary Amsden wrote: Reasons to trap the TSC are numerous, but we want to avoid it as much as possible for performance reasons. We provide two conservative modes via modules parameters and userspace

Re: [KVM TSC trapping / migration 2/2] Add TSC KHZ MSR

2011-01-07 Thread Marcelo Tosatti
On Thu, Jan 06, 2011 at 12:10:45AM -1000, Zachary Amsden wrote: Use an MSR to allow soft migration to hosts which do not support TSC trapping. Rather than make this a required element of any migration protocol, we allow the TSC rate to be exported as a data field (useful in its own right),

Re: [KVM TSC trapping / migration 1/2] Add TSC trapping for SVM and VMX

2011-01-07 Thread Marcelo Tosatti
On Thu, Jan 06, 2011 at 12:10:44AM -1000, Zachary Amsden wrote: Reasons to trap the TSC are numerous, but we want to avoid it as much as possible for performance reasons. We provide two conservative modes via modules parameters and userspace hinting. First, the module can be loaded with

Re: [KVM TSC trapping / migration 2/2] Add TSC KHZ MSR

2011-01-07 Thread Zachary Amsden
On 01/07/2011 12:48 AM, Marcelo Tosatti wrote: On Thu, Jan 06, 2011 at 12:10:45AM -1000, Zachary Amsden wrote: Use an MSR to allow soft migration to hosts which do not support TSC trapping. Rather than make this a required element of any migration protocol, we allow the TSC rate to be

KVM TSC trapping

2011-01-06 Thread Zachary Amsden
On top of my last patchset, I now implement TSC trapping and a flexible migration scheme for maintaining stable TSC across migration. Since it is administratively configured, it can be selectively enabled only for VMs which require it. In particular, VMs which use KVM clock probably do not want

Re: [KVM TSC trapping / migration 2/2] Add TSC KHZ MSR

2011-01-06 Thread Alexander Graf
Am 06.01.2011 um 11:10 schrieb Zachary Amsden zams...@redhat.com: Use an MSR to allow soft migration to hosts which do not support TSC trapping. Rather than make this a required element of any migration protocol, we allow the TSC rate to be exported as a data field (useful in its own

Re: [KVM TSC trapping / migration 1/2] Add TSC trapping for SVM and VMX

2011-01-06 Thread Alexander Graf
Am 06.01.2011 um 11:10 schrieb Zachary Amsden zams...@redhat.com: Reasons to trap the TSC are numerous, but we want to avoid it as much as possible for performance reasons. We provide two conservative modes via modules parameters and userspace hinting. First, the module can be loaded with

Re: [KVM TSC trapping / migration 2/2] Add TSC KHZ MSR

2011-01-06 Thread Zachary Amsden
On 01/06/2011 12:34 AM, Alexander Graf wrote: Am 06.01.2011 um 11:10 schrieb Zachary Amsdenzams...@redhat.com: Use an MSR to allow soft migration to hosts which do not support TSC trapping. Rather than make this a required element of any migration protocol, we allow the TSC rate to be

Re: [KVM TSC trapping / migration 1/2] Add TSC trapping for SVM and VMX

2011-01-06 Thread Zachary Amsden
On 01/06/2011 12:41 AM, Alexander Graf wrote: Am 06.01.2011 um 11:10 schrieb Zachary Amsdenzams...@redhat.com: Reasons to trap the TSC are numerous, but we want to avoid it as much as possible for performance reasons. We provide two conservative modes via modules parameters and userspace

Re: [KVM TSC trapping / migration 1/2] Add TSC trapping for SVM and VMX

2011-01-06 Thread Avi Kivity
On 01/06/2011 12:10 PM, Zachary Amsden wrote: Reasons to trap the TSC are numerous, but we want to avoid it as much as possible for performance reasons. We provide two conservative modes via modules parameters and userspace hinting. First, the module can be loaded with tsc_auto=1 as a module

Re: [KVM TSC trapping / migration 1/2] Add TSC trapping for SVM and VMX

2011-01-06 Thread Alexander Graf
On 06.01.2011, at 12:30, Zachary Amsden wrote: On 01/06/2011 12:41 AM, Alexander Graf wrote: Am 06.01.2011 um 11:10 schrieb Zachary Amsdenzams...@redhat.com: Reasons to trap the TSC are numerous, but we want to avoid it as much as possible for performance reasons. We provide two

Re: [KVM TSC trapping / migration 2/2] Add TSC KHZ MSR

2011-01-06 Thread Alexander Graf
On 06.01.2011, at 12:27, Zachary Amsden wrote: On 01/06/2011 12:34 AM, Alexander Graf wrote: Am 06.01.2011 um 11:10 schrieb Zachary Amsdenzams...@redhat.com: Use an MSR to allow soft migration to hosts which do not support TSC trapping. Rather than make this a required element of any

Re: [KVM TSC trapping / migration 1/2] Add TSC trapping for SVM and VMX

2011-01-06 Thread Zachary Amsden
On 01/06/2011 01:32 AM, Avi Kivity wrote: On 01/06/2011 12:10 PM, Zachary Amsden wrote: Reasons to trap the TSC are numerous, but we want to avoid it as much as possible for performance reasons. We provide two conservative modes via modules parameters and userspace hinting. First, the module

Re: [KVM TSC trapping / migration 1/2] Add TSC trapping for SVM and VMX

2011-01-06 Thread Zachary Amsden
On 01/06/2011 01:38 AM, Alexander Graf wrote: On 06.01.2011, at 12:30, Zachary Amsden wrote: On 01/06/2011 12:41 AM, Alexander Graf wrote: Am 06.01.2011 um 11:10 schrieb Zachary Amsdenzams...@redhat.com: Reasons to trap the TSC are numerous, but we want to avoid it as

Re: [KVM TSC trapping / migration 2/2] Add TSC KHZ MSR

2011-01-06 Thread Zachary Amsden
On 01/06/2011 01:40 AM, Alexander Graf wrote: On 06.01.2011, at 12:27, Zachary Amsden wrote: On 01/06/2011 12:34 AM, Alexander Graf wrote: Am 06.01.2011 um 11:10 schrieb Zachary Amsdenzams...@redhat.com: Use an MSR to allow soft migration to hosts which do not support TSC

Re: [KVM TSC trapping / migration 1/2] Add TSC trapping for SVM and VMX

2011-01-06 Thread Alexander Graf
On 06.01.2011, at 21:24, Zachary Amsden wrote: On 01/06/2011 01:38 AM, Alexander Graf wrote: On 06.01.2011, at 12:30, Zachary Amsden wrote: On 01/06/2011 12:41 AM, Alexander Graf wrote: Am 06.01.2011 um 11:10 schrieb Zachary Amsdenzams...@redhat.com: Reasons to trap

Re: [KVM TSC trapping / migration 1/2] Add TSC trapping for SVM and VMX

2011-01-06 Thread Zachary Amsden
On 01/06/2011 12:38 PM, Alexander Graf wrote: snip Sure, I'm not saying your patch is bad or goes in the wrong direction. I'd just think it'd be awesome to have an easy way for the guest OS to know that something as crucial as TSC reading speed got changed, hopefully even TSC frequency.