From: Zachary Amsden <zamsden@redhat.com>
To: Alexander Graf <agraf@suse.de>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [KVM TSC trapping / migration 2/2] Add TSC KHZ MSR
Date: Thu, 06 Jan 2011 10:34:57 -1000 [thread overview]
Message-ID: <4D262771.4080100@redhat.com> (raw)
In-Reply-To: <C35A7DC7-EBFD-464F-975E-F89886D299A8@suse.de>
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 Amsden<zamsden@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 right), but we also allow a one time write
>>>> of the MSR during VM creation. The result is that for the common
>>>> use case, no protocol change is required to communicate TSC rate
>>>> to the receiving host.
>>>>
>>>> This allows administrative tools to configure migration policy
>>>> as they see appropriate. Rather than dictate this policy with the
>>>> KVM implementation, we properly allow migration to hosts which both
>>>> do and do not support setting of the TSC rate on the receiving end.
>>>> If it is wished to not support migration to a host which lacks
>>>> support for the TSC rate feature, that can be coordinated externally.
>>>>
>>>>
>>> Isn't there a real hw equivalent of such a register? It might make more sense to just implement that then.
>>>
>>>
>>>
>> Unfortunately, no.
>>
> Bleks. I couldn't find anything in AMD documentation either. Intel documentation is usually hard to find and incomplete anyways, so maybe something's hiding there - but if it's hidden so well it's no use to implement either.
>
While it makes perfect logical sense to us software people, from a
hardware perspective it is ridiculous. There is no signal input to the
processor which can be counted and returned by a "CPU frequency MSR".
The CPU frequency is simply what the CPU is clocked at. And you can't
burn it onto the die (think of overclocking), unless you have your own
internal reference oscillator.
No, a CPU frequency MSR is impossible to implement sensibly in hardware
because
1) if you have an internal clock, you have cross-CPU drift and can't
easily share a common bus.
2) if you have an external clock, you have no way to measure the
frequency of it without an internal reference, which again will vary,
leading to different measured frequency on each CPU.
The only thing that sort of makes sense is a one-time writable MSR that
is programmed by the BIOS to return the CPU frequency, as retrieved from
the chipset. This is merely a convenience for software people who can't
be bothered to query the chipset directly or measure against a reference
clock.
So as much as we'd like it, it really does make little sense from a
hardware perspective.
Zach
next prev parent reply other threads:[~2011-01-06 20:34 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-06 10:10 KVM TSC trapping Zachary Amsden
2011-01-06 10:10 ` [KVM TSC trapping / migration 1/2] Add TSC trapping for SVM and VMX Zachary Amsden
2011-01-06 10:41 ` Alexander Graf
2011-01-06 11:30 ` Zachary Amsden
2011-01-06 11:38 ` Alexander Graf
2011-01-06 20:24 ` Zachary Amsden
2011-01-06 22:38 ` Alexander Graf
2011-01-07 3:10 ` Zachary Amsden
2011-01-06 11:32 ` Avi Kivity
2011-01-06 20:03 ` Zachary Amsden
2011-01-07 11:23 ` Marcelo Tosatti
2011-01-09 8:05 ` Zachary Amsden
2011-01-10 11:52 ` Joerg Roedel
2011-01-06 10:10 ` Zachary Amsden
2011-01-06 10:10 ` [KVM TSC trapping / migration 2/2] Add TSC KHZ MSR Zachary Amsden
2011-01-06 10:34 ` Alexander Graf
2011-01-06 11:27 ` Zachary Amsden
2011-01-06 11:40 ` Alexander Graf
2011-01-06 20:34 ` Zachary Amsden [this message]
2011-01-07 10:48 ` Marcelo Tosatti
2011-01-07 20:44 ` Zachary Amsden
2011-01-10 13:50 ` Marcelo Tosatti
2011-01-14 11:00 ` Juan Quintela
2011-01-18 15:47 ` Zachary Amsden
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D262771.4080100@redhat.com \
--to=zamsden@redhat.com \
--cc=agraf@suse.de \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox