kvm: add support for reading tsc frequency via cpuid.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20200310102248.28412-3-kraxel@redhat.com
This commit is contained in:
parent
d68335174d
commit
34160e0525
|
@ -67,6 +67,11 @@ static void kvm_detect(void)
|
|||
if (strcmp(signature, "KVMKVMKVM") == 0) {
|
||||
dprintf(1, "Running on KVM\n");
|
||||
PlatformRunningOn |= PF_KVM;
|
||||
if (eax >= KVM_CPUID_SIGNATURE + 0x10) {
|
||||
cpuid(KVM_CPUID_SIGNATURE + 0x10, &eax, &ebx, &ecx, &edx);
|
||||
dprintf(1, "kvm: have invtsc, freq %u kHz\n", eax);
|
||||
tsctimer_setfreq(eax, "invtsc");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue