Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mshyperv: fix recognition of Hyper-V guest crash MSR's

Hypervisor Top Level Functional Specification v3.1/4.0 notes that cpuid
(0x40000003) EDX's 10th bit should be used to check that Hyper-V guest
crash MSR's functionality available.

This patch should fix this recognition. Currently the code checks EAX
register instead of EDX.

Signed-off-by: Andrey Smetanin <asmetanin@virtuozzo.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Denis V. Lunev and committed by
Greg Kroah-Hartman
cc2dd402 4a54243f

+4 -2
+1
arch/x86/include/asm/mshyperv.h
··· 7 7 8 8 struct ms_hyperv_info { 9 9 u32 features; 10 + u32 misc_features; 10 11 u32 hints; 11 12 }; 12 13
+1
arch/x86/kernel/cpu/mshyperv.c
··· 158 158 * Extract the features and hints 159 159 */ 160 160 ms_hyperv.features = cpuid_eax(HYPERV_CPUID_FEATURES); 161 + ms_hyperv.misc_features = cpuid_edx(HYPERV_CPUID_FEATURES); 161 162 ms_hyperv.hints = cpuid_eax(HYPERV_CPUID_ENLIGHTMENT_INFO); 162 163 163 164 printk(KERN_INFO "HyperV: features 0x%x, hints 0x%x\n",
+2 -2
drivers/hv/vmbus_drv.c
··· 871 871 /* 872 872 * Only register if the crash MSRs are available 873 873 */ 874 - if (ms_hyperv.features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) { 874 + if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) { 875 875 register_die_notifier(&hyperv_die_block); 876 876 atomic_notifier_chain_register(&panic_notifier_list, 877 877 &hyperv_panic_block); ··· 1169 1169 hv_remove_vmbus_irq(); 1170 1170 tasklet_kill(&msg_dpc); 1171 1171 vmbus_free_channels(); 1172 - if (ms_hyperv.features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) { 1172 + if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) { 1173 1173 unregister_die_notifier(&hyperv_die_block); 1174 1174 atomic_notifier_chain_unregister(&panic_notifier_list, 1175 1175 &hyperv_panic_block);