[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

From: Marcelo Tosatti
Subject: Re: [Qemu-devel] invtsc + migration + TSC scaling
Date: Tue, 18 Oct 2016 15:09:26 -0200
User-agent: Mutt/1.5.21 (2010-09-15)

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 deadline relative to the difference. 
> You cannot know what exactly the guest was thinking when it set the TSC
> deadline.  Perhaps it wanted an interrupt when the TSC was exactly
> 9876543210.

You can't expect the correlation between TSC value and timer interrupt
execution to be precise, because of the delay between HW timer
expiration and interrupt execution.

So you have to live with the fact that the TSC deadline timer can be
late (which is the same thing as with your paravirt solution, in case 
of migration to host with faster TSC freq) (which to me renders the
argument above invalid).

Solution for old guests and new guests:
Just save how far ahead in the future the TSC deadline timer is supposed
to expire on the source (in ns), in the destination save all registers 
(but disable TSC deadline timer injection), arm a timer in QEMU 
for expiration time, reenable TSC deadline timer reinjection.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]