diff options
-rw-r--r-- | arch/x86/include/asm/hyperv-tlfs.h | 4 | ||||
-rw-r--r-- | arch/x86/include/asm/mshyperv.h | 1 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mshyperv.c | 5 |
3 files changed, 10 insertions, 0 deletions
diff --git a/arch/x86/include/asm/hyperv-tlfs.h b/arch/x86/include/asm/hyperv-tlfs.h index bab6a1ad806e..1c602ad4bda8 100644 --- a/arch/x86/include/asm/hyperv-tlfs.h +++ b/arch/x86/include/asm/hyperv-tlfs.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #define HYPERV_CPUID_FEATURES 0x40000003 | 21 | #define HYPERV_CPUID_FEATURES 0x40000003 |
22 | #define HYPERV_CPUID_ENLIGHTMENT_INFO 0x40000004 | 22 | #define HYPERV_CPUID_ENLIGHTMENT_INFO 0x40000004 |
23 | #define HYPERV_CPUID_IMPLEMENT_LIMITS 0x40000005 | 23 | #define HYPERV_CPUID_IMPLEMENT_LIMITS 0x40000005 |
24 | #define HYPERV_CPUID_NESTED_FEATURES 0x4000000A | ||
24 | 25 | ||
25 | #define HYPERV_HYPERVISOR_PRESENT_BIT 0x80000000 | 26 | #define HYPERV_HYPERVISOR_PRESENT_BIT 0x80000000 |
26 | #define HYPERV_CPUID_MIN 0x40000005 | 27 | #define HYPERV_CPUID_MIN 0x40000005 |
@@ -339,6 +340,9 @@ struct hv_tsc_emulation_status { | |||
339 | #define HV_X64_MSR_VP_ASSIST_PAGE_ADDRESS_MASK \ | 340 | #define HV_X64_MSR_VP_ASSIST_PAGE_ADDRESS_MASK \ |
340 | (~((1ull << HV_X64_MSR_VP_ASSIST_PAGE_ADDRESS_SHIFT) - 1)) | 341 | (~((1ull << HV_X64_MSR_VP_ASSIST_PAGE_ADDRESS_SHIFT) - 1)) |
341 | 342 | ||
343 | /* Hyper-V Enlightened VMCS version mask in nested features CPUID */ | ||
344 | #define HV_X64_ENLIGHTENED_VMCS_VERSION 0xff | ||
345 | |||
342 | #define HV_X64_MSR_TSC_REFERENCE_ENABLE 0x00000001 | 346 | #define HV_X64_MSR_TSC_REFERENCE_ENABLE 0x00000001 |
343 | #define HV_X64_MSR_TSC_REFERENCE_ADDRESS_SHIFT 12 | 347 | #define HV_X64_MSR_TSC_REFERENCE_ADDRESS_SHIFT 12 |
344 | 348 | ||
diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h index 3f162353f180..57c65315b60b 100644 --- a/arch/x86/include/asm/mshyperv.h +++ b/arch/x86/include/asm/mshyperv.h | |||
@@ -13,6 +13,7 @@ struct ms_hyperv_info { | |||
13 | u32 features; | 13 | u32 features; |
14 | u32 misc_features; | 14 | u32 misc_features; |
15 | u32 hints; | 15 | u32 hints; |
16 | u32 nested_features; | ||
16 | u32 max_vp_index; | 17 | u32 max_vp_index; |
17 | u32 max_lp_index; | 18 | u32 max_lp_index; |
18 | }; | 19 | }; |
diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c index 0dfc568c110c..1afc0a453bba 100644 --- a/arch/x86/kernel/cpu/mshyperv.c +++ b/arch/x86/kernel/cpu/mshyperv.c | |||
@@ -208,6 +208,11 @@ static void __init ms_hyperv_init_platform(void) | |||
208 | x86_platform.calibrate_cpu = hv_get_tsc_khz; | 208 | x86_platform.calibrate_cpu = hv_get_tsc_khz; |
209 | } | 209 | } |
210 | 210 | ||
211 | if (ms_hyperv.hints & HV_X64_ENLIGHTENED_VMCS_RECOMMENDED) { | ||
212 | ms_hyperv.nested_features = | ||
213 | cpuid_eax(HYPERV_CPUID_NESTED_FEATURES); | ||
214 | } | ||
215 | |||
211 | #ifdef CONFIG_X86_LOCAL_APIC | 216 | #ifdef CONFIG_X86_LOCAL_APIC |
212 | if (ms_hyperv.features & HV_X64_ACCESS_FREQUENCY_MSRS && | 217 | if (ms_hyperv.features & HV_X64_ACCESS_FREQUENCY_MSRS && |
213 | ms_hyperv.misc_features & HV_FEATURE_FREQUENCY_MSRS_AVAILABLE) { | 218 | ms_hyperv.misc_features & HV_FEATURE_FREQUENCY_MSRS_AVAILABLE) { |