aboutsummaryrefslogtreecommitdiff
path: root/src/fw
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2020-03-10 11:22:47 +0100
committerGerd Hoffmann <kraxel@redhat.com>2020-03-16 14:29:41 +0100
commit34160e05257328a3e18200cccfe394e7aeb10be3 (patch)
tree8d0ca9ad48e29dc8da184930c904572d02f9601f /src/fw
parentd68335174dc22d1201899607693a9b7ca0509f18 (diff)
downloadseabios-hppa-34160e05257328a3e18200cccfe394e7aeb10be3.zip
seabios-hppa-34160e05257328a3e18200cccfe394e7aeb10be3.tar.gz
seabios-hppa-34160e05257328a3e18200cccfe394e7aeb10be3.tar.bz2
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
Diffstat (limited to 'src/fw')
-rw-r--r--src/fw/paravirt.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/fw/paravirt.c b/src/fw/paravirt.c
index ef42093..1e3d601 100644
--- a/src/fw/paravirt.c
+++ b/src/fw/paravirt.c
@@ -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");
+ }
}
}