Re: [Qemu-devel] invtsc + migration + TSC scaling

2016-10-19 Thread Eduardo Habkost
On Wed, Oct 19, 2016 at 05:42:16PM +0200, Radim Krčmář wrote: > 2016-10-19 11:55-0200, Eduardo Habkost: > > On Wed, Oct 19, 2016 at 03:27:52PM +0200, Radim Krčmář wrote: > >> 2016-10-18 19:05-0200, Eduardo Habkost: > >> > On Tue, Oct 18, 2016 at 10:52:14PM +0200, Radim Krčmář wrote: > >> > [...] >

Re: [Qemu-devel] invtsc + migration + TSC scaling

2016-10-19 Thread Radim Krčmář
2016-10-19 11:55-0200, Eduardo Habkost: > On Wed, Oct 19, 2016 at 03:27:52PM +0200, Radim Krčmář wrote: >> 2016-10-18 19:05-0200, Eduardo Habkost: >> > On Tue, Oct 18, 2016 at 10:52:14PM +0200, Radim Krčmář wrote: >> > [...] >> >> The main problem is that QEMU changes virtual_tsc_khz when migrating

Re: [Qemu-devel] invtsc + migration + TSC scaling

2016-10-19 Thread Eduardo Habkost
On Wed, Oct 19, 2016 at 03:27:52PM +0200, Radim Krčmář wrote: > 2016-10-18 19:05-0200, Eduardo Habkost: > > On Tue, Oct 18, 2016 at 10:52:14PM +0200, Radim Krčmář wrote: > > [...] > >> The main problem is that QEMU changes virtual_tsc_khz when migrating > >> without hardware scaling, so KVM is forc

Re: [Qemu-devel] invtsc + migration + TSC scaling

2016-10-19 Thread Radim Krčmář
2016-10-18 19:05-0200, Eduardo Habkost: > On Tue, Oct 18, 2016 at 10:52:14PM +0200, Radim Krčmář wrote: > [...] >> The main problem is that QEMU changes virtual_tsc_khz when migrating >> without hardware scaling, so KVM is forced to get nanoseconds wrong ... >> >> If QEMU doesn't want to keep the

Re: [Qemu-devel] invtsc + migration + TSC scaling

2016-10-18 Thread Eduardo Habkost
On Tue, Oct 18, 2016 at 10:52:14PM +0200, Radim Krčmář wrote: [...] > The main problem is that QEMU changes virtual_tsc_khz when migrating > without hardware scaling, so KVM is forced to get nanoseconds wrong ... > > If QEMU doesn't want to keep the TSC frequency constant, then it would > be bette

Re: [Qemu-devel] invtsc + migration + TSC scaling

2016-10-18 Thread Radim Krčmář
2016-10-18 15:09-0200, Marcelo Tosatti: > On Tue, Oct 18, 2016 at 03:41:03PM +0200, Paolo Bonzini wrote: >> On 18/10/2016 01:58, Marcelo Tosatti wrote: >> > > We should also blacklist the TSC deadline timer when invtsc is not >> > > available. >> > >> > Actually, a nicer fix would be to check the d

Re: [Qemu-devel] invtsc + migration + TSC scaling

2016-10-18 Thread Marcelo Tosatti
On Tue, Oct 18, 2016 at 03:41:03PM +0200, Paolo Bonzini wrote: > > > On 18/10/2016 01:58, Marcelo Tosatti wrote: > > > We should also blacklist the TSC deadline timer when invtsc is not > > > available. > > > > Actually, a nicer fix would be to check the different > > frequencies and scale the d

Re: [Qemu-devel] invtsc + migration + TSC scaling

2016-10-18 Thread Radim Krčmář
2016-10-17 21:58-0200, Marcelo Tosatti: > On Mon, Oct 17, 2016 at 07:11:01PM -0200, Eduardo Habkost wrote: >> On Mon, Oct 17, 2016 at 06:24:38PM +0200, Paolo Bonzini wrote: >> > On 17/10/2016 16:50, Radim Krčmář wrote: >> > > 2016-10-17 07:47-0200, Marcelo Tosatti: >> [...] >> > >> since Linux gues

Re: [Qemu-devel] invtsc + migration + TSC scaling

2016-10-18 Thread Paolo Bonzini
On 18/10/2016 01:58, Marcelo Tosatti wrote: > > We should also blacklist the TSC deadline timer when invtsc is not > > available. > > Actually, a nicer fix would be to check the different > frequencies and scale the deadline relative to the difference. You cannot know what exactly the guest wa

Re: [Qemu-devel] invtsc + migration + TSC scaling

2016-10-18 Thread Radim Krčmář
2016-10-17 18:24+0200, Paolo Bonzini: > On 17/10/2016 16:50, Radim Krčmář wrote: >> 2016-10-17 07:47-0200, Marcelo Tosatti: >>> On Fri, Oct 14, 2016 at 06:20:31PM -0300, Eduardo Habkost wrote: I have been wondering: should we allow live migration with the invtsc flag enabled, if TSC scali

Re: [Qemu-devel] invtsc + migration + TSC scaling

2016-10-18 Thread Radim Krčmář
2016-10-18 15:36+0200, Radim Krčmář: > 2016-10-17 18:24+0200, Paolo Bonzini: >> We should also blacklist the TSC deadline timer when invtsc is not >> available. > > True. > > I was thinking that with Wanpeng's VMX preemption patches, we might not > need the TSC nor paravirtual deadline timer, the

Re: [Qemu-devel] invtsc + migration + TSC scaling

2016-10-18 Thread Radim Krčmář
2016-10-17 15:20-0200, Marcelo Tosatti: > On Mon, Oct 17, 2016 at 04:50:09PM +0200, Radim Krčmář wrote: >> 2016-10-17 07:47-0200, Marcelo Tosatti: >> > On Fri, Oct 14, 2016 at 06:20:31PM -0300, Eduardo Habkost wrote: >> >> I have been wondering: should we allow live migration with the >> >> invtsc

Re: [Qemu-devel] invtsc + migration + TSC scaling

2016-10-18 Thread Dr. David Alan Gilbert
* Radim Krčmář (rkrc...@redhat.com) wrote: > 2016-10-17 07:47-0200, Marcelo Tosatti: > > On Fri, Oct 14, 2016 at 06:20:31PM -0300, Eduardo Habkost wrote: > >> I have been wondering: should we allow live migration with the > >> invtsc flag enabled, if TSC scaling is available on the > >> destination

Re: [Qemu-devel] invtsc + migration + TSC scaling

2016-10-17 Thread Marcelo Tosatti
On Mon, Oct 17, 2016 at 07:11:01PM -0200, Eduardo Habkost wrote: > On Mon, Oct 17, 2016 at 06:24:38PM +0200, Paolo Bonzini wrote: > > On 17/10/2016 16:50, Radim Krčmář wrote: > > > 2016-10-17 07:47-0200, Marcelo Tosatti: > [...] > > >> since Linux guests use kvmclock and Windows guests use Hyper-V

Re: [Qemu-devel] invtsc + migration + TSC scaling

2016-10-17 Thread Eduardo Habkost
On Mon, Oct 17, 2016 at 06:24:38PM +0200, Paolo Bonzini wrote: > On 17/10/2016 16:50, Radim Krčmář wrote: > > 2016-10-17 07:47-0200, Marcelo Tosatti: [...] > >> since Linux guests use kvmclock and Windows guests use Hyper-V > >> enlightenment, it should be fine to disable 2). > > ... and 1 too. >

Re: [Qemu-devel] invtsc + migration + TSC scaling

2016-10-17 Thread Marcelo Tosatti
On Mon, Oct 17, 2016 at 04:50:09PM +0200, Radim Krčmář wrote: > 2016-10-17 07:47-0200, Marcelo Tosatti: > > On Fri, Oct 14, 2016 at 06:20:31PM -0300, Eduardo Habkost wrote: > >> I have been wondering: should we allow live migration with the > >> invtsc flag enabled, if TSC scaling is available on t

Re: [Qemu-devel] invtsc + migration + TSC scaling

2016-10-17 Thread Paolo Bonzini
On 17/10/2016 16:50, Radim Krčmář wrote: > 2016-10-17 07:47-0200, Marcelo Tosatti: >> On Fri, Oct 14, 2016 at 06:20:31PM -0300, Eduardo Habkost wrote: >>> I have been wondering: should we allow live migration with the >>> invtsc flag enabled, if TSC scaling is available on the >>> destination? >>

Re: [Qemu-devel] invtsc + migration + TSC scaling

2016-10-17 Thread Radim Krčmář
2016-10-17 07:47-0200, Marcelo Tosatti: > On Fri, Oct 14, 2016 at 06:20:31PM -0300, Eduardo Habkost wrote: >> I have been wondering: should we allow live migration with the >> invtsc flag enabled, if TSC scaling is available on the >> destination? > > TSC scaling and invtsc flag, yes. Yes, if we

Re: [Qemu-devel] invtsc + migration + TSC scaling

2016-10-17 Thread Marcelo Tosatti
On Fri, Oct 14, 2016 at 06:20:31PM -0300, Eduardo Habkost wrote: > I have been wondering: should we allow live migration with the > invtsc flag enabled, if TSC scaling is available on the > destination? TSC scaling and invtsc flag, yes. > > For reference, this is what the Intel SDM says about in

[Qemu-devel] invtsc + migration + TSC scaling

2016-10-14 Thread Eduardo Habkost
I have been wondering: should we allow live migration with the invtsc flag enabled, if TSC scaling is available on the destination? For reference, this is what the Intel SDM says about invtsc: The time stamp counter in newer processors may support an enhancement, referred to as invariant TSC.