• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2022 The ChromiumOS Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 /// Constants from Hyper-V Top Level Functional Specification.
6 /// This comes from the document published here:
7 /// <https://github.com/MicrosoftDocs/Virtualization-Documentation/raw/live/tlfs/Hypervisor%20Top%20Level%20Functional%20Specification%20v6.0b.pdf>
8 
9 /// CPUID Leaf Range Register.
10 pub const HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS: u32 = 0x40000000;
11 /// Start of CPUID information for Hyper-V.
12 pub const HYPERV_CPUID_MIN: u32 = 0x40000005;
13 /// Hypervisor Feature Identification Register.
14 pub const HYPERV_CPUID_FEATURES: u32 = 0x40000003;
15 
16 /// Feature for Frequency MSR availability.
17 pub const HV_FEATURE_FREQUENCY_MSRS_AVAILABLE: u32 = 1 << 8;
18 
19 /// Group A features.
20 
21 /// Privilege bit for partition reference TSC register.
22 pub const HV_MSR_REFERENCE_TSC_AVAILABLE: u32 = 1 << 9;
23 /// Privilege bit showing Partition Local APIC and TSC frequency registers availability.
24 pub const HV_ACCESS_FREQUENCY_MSRS: u32 = 1 << 11;
25 /// Privilege bit for AccessTscInvariantControls.
26 pub const HV_ACCESS_TSC_INVARIANT: u32 = 1 << 15;
27 
28 /// MSR definitions.
29 pub const HV_X64_MSR_TSC_INVARIANT_CONTROL: u32 = 0x40000118;
30 pub const HV_X64_MSR_APIC_FREQUENCY: u32 = 0x40000023;
31 pub const HV_X64_MSR_TSC_FREQUENCY: u32 = 0x40000022;
32