summaryrefslogtreecommitdiff
path: root/target/i386/trace-events
diff options
context:
space:
mode:
authorPhil Dennis-Jordan <phil@philjordan.eu>2017-01-20 15:11:34 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2017-01-27 18:07:57 +0100
commit9954a1582e18b03ddb66f6c892dccf2c3508f4b2 (patch)
tree2df459a4a6da4995d624ec004a691d1d2db13c1b /target/i386/trace-events
parentc4c41a0a65d650b241dec9efedf4ee3f00a16a30 (diff)
downloadqemu-9954a1582e18b03ddb66f6c892dccf2c3508f4b2.tar.gz
x86-KVM: Supply TSC and APIC clock rates to guest like VMWare
This fixes timekeeping of x86-64 Darwin/OS X/macOS guests when using KVM. Darwin/OS X/macOS for x86-64 uses the TSC for timekeeping; it normally calibrates this by querying various clock frequency scaling MSRs. Details depend on the exact CPU model detected. The local APIC timer frequency is extracted from (EFI) firmware. This is problematic in the presence of virtualisation, as the MSRs in question are typically not handled by the hypervisor. VMWare (Fusion) advertises TSC and APIC frequency via a custom 0x40000010 CPUID leaf, in the eax and ebx registers respectively. This is documented at https://lwn.net/Articles/301888/ among other places. Darwin/OS X/macOS looks for the generic 0x40000000 hypervisor leaf, and if this indicates via eax that leaf 0x40000010 might be available, that is in turn queried for the two frequencies. This adds a CPU option "vmware-cpuid-freq" to enable the same behaviour when running Qemu with KVM acceleration, if the KVM TSC frequency can be determined, and it is stable. (invtsc or user-specified) The virtualised APIC bus cycle is hardcoded to 1GHz in KVM, so ebx of the CPUID leaf is also hardcoded to this value. Signed-off-by: Phil Dennis-Jordan <phil@philjordan.eu> Message-Id: <1484921496-11257-2-git-send-email-phil@philjordan.eu> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'target/i386/trace-events')
0 files changed, 0 insertions, 0 deletions