[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrUAm+-WP8_gVGTtvMdpBw4uhkgVA9rXy6WE2AL3TRgquw@mail.gmail.com>
Date: Wed, 6 Jul 2016 06:01:38 -0700
From: Andy Lutomirski <luto@...capital.net>
To: Paolo Bonzini <pbonzini@...hat.com>
Cc: Eduardo Habkost <ehabkost@...hat.com>,
Radim Krcmar <rkrcmar@...hat.com>,
Peter Hornyack <peterhornyack@...gle.com>,
David Matlack <dmatlack@...gle.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
kvm list <kvm@...r.kernel.org>
Subject: Re: [RFC PATCH] x86, kvm: use kvmclock to compute TSC deadline value
On Jul 5, 2016 1:36 PM, "Paolo Bonzini" <pbonzini@...hat.com> 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 this is only Skylake) or your data center is perfectly
> homogeneous.
>
> The solution in this patch is to skip tsc_khz, and instead derive the
> frequency from kvmclock's (mult, shift) pair. Because kvmclock
> parameters convert from tsc to nanoseconds, this needs a division
> but that's the least of our problems when the TSC_DEADLINE_MSR write
> costs 2000 clock cycles. Luckily tsc_khz is really used by very little
> outside the tsc clocksource (which kvmclock replaces) and the TSC
> deadline timer.
I'm wondering if it would be more straightforward to blacklist the
APIC timer entirely (on KVM guests that have the TSC deadline
capability) and to instead offer a paravirt clockevent that still uses
the deadline timer under the hood. After all, these systems should be
mostly quirk-free, so I imagine that the whole implementation would
only be a few lines of code.
Powered by blists - more mailing lists