x86: KVM guest: Try using new kvm clock msrs
authorGlauber Costa <glommer@redhat.com>
Tue, 11 May 2010 16:17:44 +0000 (12:17 -0400)
committerAvi Kivity <avi@redhat.com>
Wed, 19 May 2010 08:41:04 +0000 (11:41 +0300)
commit838815a78785022f6611e5c48386567aea7b818b
treee69a1f53a8941713ce3fc58bbb6f051bc5b33142
parent84478c829d0f474a1d6749207c53daacc305d4e1
x86: KVM guest: Try using new kvm clock msrs

We now added a new set of clock-related msrs in replacement of the old
ones. In theory, we could just try to use them and get a return value
indicating they do not exist, due to our use of kvm_write_msr_save.

However, kvm clock registration happens very early, and if we ever
try to write to a non-existant MSR, we raise a lethal #GP, since our
idt handlers are not in place yet.

So this patch tests for a cpuid feature exported by the host to
decide which set of msrs are supported.

Signed-off-by: Glauber Costa <glommer@redhat.com>
Acked-by: Zachary Amsden <zamsden@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/kernel/kvmclock.c