Re: [PATCH 2/2] x86, kvm: use kvmclock to compute TSC deadline value

2016-10-10 Thread Wanpeng Li
2016-09-10 0:38 GMT+08:00 Paolo Bonzini : > > > On 09/09/2016 00:13, David Matlack wrote: >> Hi Paolo, >> >> On Tue, Sep 6, 2016 at 3:29 PM, Paolo Bonzini wrote: >>> Bad things happen if a guest using the TSC deadline timer is migrated. >>> The guest

Re: [PATCH 2/2] x86, kvm: use kvmclock to compute TSC deadline value

2016-10-10 Thread Wanpeng Li
2016-09-10 0:38 GMT+08:00 Paolo Bonzini : > > > On 09/09/2016 00:13, David Matlack wrote: >> Hi Paolo, >> >> On Tue, Sep 6, 2016 at 3:29 PM, Paolo Bonzini wrote: >>> Bad things happen if a guest using the TSC deadline timer is migrated. >>> The guest doesn't re-calibrate the TSC after migration,

Re: [PATCH 2/2] x86, kvm: use kvmclock to compute TSC deadline value

2016-09-16 Thread Radim Krčmář
2016-09-16 17:06+0200, Paolo Bonzini: > On 16/09/2016 16:59, Radim Krčmář wrote: >> KVM_MSR_DEADLINE would be interface in kvmclock nanosecond values and >> MSR_IA32_TSCDEADLINE in TSC values. KVM_MSR_DEADLINE would follow >> similar rules as MSR_IA32_TSCDEADLINE -- the interrupt fires when >>

Re: [PATCH 2/2] x86, kvm: use kvmclock to compute TSC deadline value

2016-09-16 Thread Radim Krčmář
2016-09-16 17:06+0200, Paolo Bonzini: > On 16/09/2016 16:59, Radim Krčmář wrote: >> KVM_MSR_DEADLINE would be interface in kvmclock nanosecond values and >> MSR_IA32_TSCDEADLINE in TSC values. KVM_MSR_DEADLINE would follow >> similar rules as MSR_IA32_TSCDEADLINE -- the interrupt fires when >>

Re: [PATCH 2/2] x86, kvm: use kvmclock to compute TSC deadline value

2016-09-16 Thread Paolo Bonzini
On 16/09/2016 16:59, Radim Krčmář wrote: > KVM_MSR_DEADLINE would be interface in kvmclock nanosecond values and > MSR_IA32_TSCDEADLINE in TSC values. KVM_MSR_DEADLINE would follow > similar rules as MSR_IA32_TSCDEADLINE -- the interrupt fires when > kvmclock reaches the value, you read what

Re: [PATCH 2/2] x86, kvm: use kvmclock to compute TSC deadline value

2016-09-16 Thread Paolo Bonzini
On 16/09/2016 16:59, Radim Krčmář wrote: > KVM_MSR_DEADLINE would be interface in kvmclock nanosecond values and > MSR_IA32_TSCDEADLINE in TSC values. KVM_MSR_DEADLINE would follow > similar rules as MSR_IA32_TSCDEADLINE -- the interrupt fires when > kvmclock reaches the value, you read what

Re: [PATCH 2/2] x86, kvm: use kvmclock to compute TSC deadline value

2016-09-16 Thread Radim Krčmář
2016-09-15 23:02+0200, Paolo Bonzini: > On 15/09/2016 21:59, Radim Krčmář wrote: >> 2016-09-15 18:00+0200, Paolo Bonzini: When we are already going the paravirtual route, we could add an interface that accepts the deadline in kvmclock nanoseconds. It would be much more maintanable

Re: [PATCH 2/2] x86, kvm: use kvmclock to compute TSC deadline value

2016-09-16 Thread Radim Krčmář
2016-09-15 23:02+0200, Paolo Bonzini: > On 15/09/2016 21:59, Radim Krčmář wrote: >> 2016-09-15 18:00+0200, Paolo Bonzini: When we are already going the paravirtual route, we could add an interface that accepts the deadline in kvmclock nanoseconds. It would be much more maintanable

Re: [PATCH 2/2] x86, kvm: use kvmclock to compute TSC deadline value

2016-09-15 Thread Paolo Bonzini
On 15/09/2016 21:59, Radim Krčmář wrote: > 2016-09-15 18:00+0200, Paolo Bonzini: >> So virtual_tsc_khz does change on migration, at least if your host >> doesn't have TSC scaling (which is pretty much all Intel hosts in >> existence). > > Ugh, I'd consider exposing constant TSC to the guest

Re: [PATCH 2/2] x86, kvm: use kvmclock to compute TSC deadline value

2016-09-15 Thread Paolo Bonzini
On 15/09/2016 21:59, Radim Krčmář wrote: > 2016-09-15 18:00+0200, Paolo Bonzini: >> So virtual_tsc_khz does change on migration, at least if your host >> doesn't have TSC scaling (which is pretty much all Intel hosts in >> existence). > > Ugh, I'd consider exposing constant TSC to the guest

Re: [PATCH 2/2] x86, kvm: use kvmclock to compute TSC deadline value

2016-09-15 Thread Radim Krčmář
2016-09-15 18:00+0200, Paolo Bonzini: > On 15/09/2016 17:09, Radim Krčmář wrote: >> 2016-09-07 00:29+0200, Paolo Bonzini: >>> Bad things happen if a guest using the TSC deadline timer is migrated. >>> The guest doesn't re-calibrate the TSC after migration, and the >>> TSC frequency can and will

Re: [PATCH 2/2] x86, kvm: use kvmclock to compute TSC deadline value

2016-09-15 Thread Radim Krčmář
2016-09-15 18:00+0200, Paolo Bonzini: > On 15/09/2016 17:09, Radim Krčmář wrote: >> 2016-09-07 00:29+0200, Paolo Bonzini: >>> Bad things happen if a guest using the TSC deadline timer is migrated. >>> The guest doesn't re-calibrate the TSC after migration, and the >>> TSC frequency can and will

Re: [PATCH 2/2] x86, kvm: use kvmclock to compute TSC deadline value

2016-09-15 Thread Paolo Bonzini
On 15/09/2016 17:09, Radim Krčmář wrote: > 2016-09-07 00:29+0200, Paolo Bonzini: >> Bad things happen if a guest using the TSC deadline timer is migrated. >> The guest doesn't re-calibrate the TSC after migration, and the >> TSC frequency can and will change unless your processor supports TSC >>

Re: [PATCH 2/2] x86, kvm: use kvmclock to compute TSC deadline value

2016-09-15 Thread Paolo Bonzini
On 15/09/2016 17:09, Radim Krčmář wrote: > 2016-09-07 00:29+0200, Paolo Bonzini: >> Bad things happen if a guest using the TSC deadline timer is migrated. >> The guest doesn't re-calibrate the TSC after migration, and the >> TSC frequency can and will change unless your processor supports TSC >>

Re: [PATCH 2/2] x86, kvm: use kvmclock to compute TSC deadline value

2016-09-15 Thread Radim Krčmář
2016-09-07 00:29+0200, Paolo Bonzini: > Bad things happen if a guest using the TSC deadline timer is migrated. > The guest doesn't re-calibrate the TSC after migration, and the > TSC frequency can and will change unless your processor supports TSC > scaling (on Intel this is only Skylake) or your

Re: [PATCH 2/2] x86, kvm: use kvmclock to compute TSC deadline value

2016-09-15 Thread Radim Krčmář
2016-09-07 00:29+0200, Paolo Bonzini: > Bad things happen if a guest using the TSC deadline timer is migrated. > The guest doesn't re-calibrate the TSC after migration, and the > TSC frequency can and will change unless your processor supports TSC > scaling (on Intel this is only Skylake) or your

Re: [PATCH 2/2] x86, kvm: use kvmclock to compute TSC deadline value

2016-09-09 Thread David Matlack
On Fri, Sep 9, 2016 at 9:38 AM, Paolo Bonzini wrote: > > On 09/09/2016 00:13, David Matlack wrote: >> Hi Paolo, >> >> On Tue, Sep 6, 2016 at 3:29 PM, Paolo Bonzini wrote: >>> Bad things happen if a guest using the TSC deadline timer is migrated. >>> The

Re: [PATCH 2/2] x86, kvm: use kvmclock to compute TSC deadline value

2016-09-09 Thread David Matlack
On Fri, Sep 9, 2016 at 9:38 AM, Paolo Bonzini wrote: > > On 09/09/2016 00:13, David Matlack wrote: >> Hi Paolo, >> >> On Tue, Sep 6, 2016 at 3:29 PM, Paolo Bonzini wrote: >>> Bad things happen if a guest using the TSC deadline timer is migrated. >>> The guest doesn't re-calibrate the TSC after

Re: [PATCH 2/2] x86, kvm: use kvmclock to compute TSC deadline value

2016-09-09 Thread Paolo Bonzini
On 09/09/2016 00:13, David Matlack wrote: > Hi Paolo, > > On Tue, Sep 6, 2016 at 3:29 PM, Paolo Bonzini wrote: >> Bad things happen if a guest using the TSC deadline timer is migrated. >> The guest doesn't re-calibrate the TSC after migration, and the >> TSC frequency can

Re: [PATCH 2/2] x86, kvm: use kvmclock to compute TSC deadline value

2016-09-09 Thread Paolo Bonzini
On 09/09/2016 00:13, David Matlack wrote: > Hi Paolo, > > On Tue, Sep 6, 2016 at 3:29 PM, Paolo Bonzini wrote: >> Bad things happen if a guest using the TSC deadline timer is migrated. >> The guest doesn't re-calibrate the TSC after migration, and the >> TSC frequency can and will change

Re: [PATCH 2/2] x86, kvm: use kvmclock to compute TSC deadline value

2016-09-08 Thread David Matlack
Hi Paolo, On Tue, Sep 6, 2016 at 3:29 PM, Paolo Bonzini wrote: > Bad things happen if a guest using the TSC deadline timer is migrated. > The guest doesn't re-calibrate the TSC after migration, and the > TSC frequency can and will change unless your processor supports TSC >

Re: [PATCH 2/2] x86, kvm: use kvmclock to compute TSC deadline value

2016-09-08 Thread David Matlack
Hi Paolo, On Tue, Sep 6, 2016 at 3:29 PM, Paolo Bonzini wrote: > Bad things happen if a guest using the TSC deadline timer is migrated. > The guest doesn't re-calibrate the TSC after migration, and the > TSC frequency can and will change unless your processor supports TSC > scaling (on Intel

[PATCH 2/2] x86, kvm: use kvmclock to compute TSC deadline value

2016-09-06 Thread Paolo Bonzini
Bad things happen if a guest using the TSC deadline timer is migrated. The guest doesn't re-calibrate the TSC after migration, and the TSC frequency can and will change unless your processor supports TSC scaling (on Intel this is only Skylake) or your data center is perfectly homogeneous. The

[PATCH 2/2] x86, kvm: use kvmclock to compute TSC deadline value

2016-09-06 Thread Paolo Bonzini
Bad things happen if a guest using the TSC deadline timer is migrated. The guest doesn't re-calibrate the TSC after migration, and the TSC frequency can and will change unless your processor supports TSC scaling (on Intel this is only Skylake) or your data center is perfectly homogeneous. The