hypervisor: enable TSC cpuid leaf synthesis for haxm.

Similar to WHPX, haxm requires an accurate (calibrated) leaf value to
make the guest clocksource work accurately.

BUG=b:213152505
TEST=battle tested downstream

Change-Id: I55a45c00758b2112aced6185970ad43df060d0ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3731287
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Vaibhav Nagarnaik <vnagarnaik@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
This commit is contained in:
Noah Gold 2022-06-27 17:19:47 -07:00 committed by Chromeos LUCI
parent 4ea25d1e33
commit 10574227dc

View file

@ -182,8 +182,13 @@ impl Vm for HaxmVm {
})
}
fn check_capability(&self, _c: VmCap) -> bool {
false
fn check_capability(&self, c: VmCap) -> bool {
match c {
// under haxm, guests rely on this leaf to calibrate their
// clocksource.
VmCap::CalibratedTscLeafRequired => true,
_ => false,
}
}
fn get_memory(&self) -> &GuestMemory {