mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
arch, hypervisor: Populate CPUID leaf 0x4000_0010 (TSC frequency)
This hypervisor leaf includes details of the TSC frequency if that is available from KVM. This can be used to efficiently calculate time passed when there is an invariant TSC. TEST=Run `cpuid` in the guest and observe the frequency populated. Fixes: #5178 Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
@@ -339,6 +339,7 @@ fn create_vmm_ioctl_seccomp_rule_kvm() -> Result<Vec<SeccompRule>, BackendError>
|
||||
const KVM_GET_MSR_INDEX_LIST: u64 = 0xc004_ae02;
|
||||
const KVM_GET_MSRS: u64 = 0xc008_ae88;
|
||||
const KVM_GET_SREGS: u64 = 0x8138_ae83;
|
||||
const KVM_GET_TSC_KHZ: u64 = 0xaea3;
|
||||
const KVM_GET_XCRS: u64 = 0x8188_aea6;
|
||||
const KVM_GET_XSAVE: u64 = 0x9000_aea4;
|
||||
const KVM_KVMCLOCK_CTRL: u64 = 0xaead;
|
||||
@@ -365,6 +366,7 @@ fn create_vmm_ioctl_seccomp_rule_kvm() -> Result<Vec<SeccompRule>, BackendError>
|
||||
and![Cond::new(1, ArgLen::Dword, Eq, KVM_GET_MSR_INDEX_LIST)?],
|
||||
and![Cond::new(1, ArgLen::Dword, Eq, KVM_GET_MSRS)?],
|
||||
and![Cond::new(1, ArgLen::Dword, Eq, KVM_GET_SREGS)?],
|
||||
and![Cond::new(1, ArgLen::Dword, Eq, KVM_GET_TSC_KHZ)?],
|
||||
and![Cond::new(1, ArgLen::Dword, Eq, KVM_GET_XCRS,)?],
|
||||
and![Cond::new(1, ArgLen::Dword, Eq, KVM_GET_XSAVE,)?],
|
||||
and![Cond::new(1, ArgLen::Dword, Eq, KVM_KVMCLOCK_CTRL)?],
|
||||
|
||||
Reference in New Issue
Block a user