Commit cc2dd402 authored by Denis V. Lunev's avatar Denis V. Lunev Committed by Greg Kroah-Hartman

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: default avatarAndrey Smetanin <asmetanin@virtuozzo.com>
Signed-off-by: default avatarDenis V. Lunev <den@openvz.org>
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4a54243f
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
struct ms_hyperv_info { struct ms_hyperv_info {
u32 features; u32 features;
u32 misc_features;
u32 hints; u32 hints;
}; };
......
...@@ -158,6 +158,7 @@ static void __init ms_hyperv_init_platform(void) ...@@ -158,6 +158,7 @@ static void __init ms_hyperv_init_platform(void)
* Extract the features and hints * Extract the features and hints
*/ */
ms_hyperv.features = cpuid_eax(HYPERV_CPUID_FEATURES); ms_hyperv.features = cpuid_eax(HYPERV_CPUID_FEATURES);
ms_hyperv.misc_features = cpuid_edx(HYPERV_CPUID_FEATURES);
ms_hyperv.hints = cpuid_eax(HYPERV_CPUID_ENLIGHTMENT_INFO); ms_hyperv.hints = cpuid_eax(HYPERV_CPUID_ENLIGHTMENT_INFO);
printk(KERN_INFO "HyperV: features 0x%x, hints 0x%x\n", printk(KERN_INFO "HyperV: features 0x%x, hints 0x%x\n",
......
...@@ -871,7 +871,7 @@ static int vmbus_bus_init(int irq) ...@@ -871,7 +871,7 @@ static int vmbus_bus_init(int irq)
/* /*
* Only register if the crash MSRs are available * Only register if the crash MSRs are available
*/ */
if (ms_hyperv.features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) { if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) {
register_die_notifier(&hyperv_die_block); register_die_notifier(&hyperv_die_block);
atomic_notifier_chain_register(&panic_notifier_list, atomic_notifier_chain_register(&panic_notifier_list,
&hyperv_panic_block); &hyperv_panic_block);
...@@ -1169,7 +1169,7 @@ static void __exit vmbus_exit(void) ...@@ -1169,7 +1169,7 @@ static void __exit vmbus_exit(void)
hv_remove_vmbus_irq(); hv_remove_vmbus_irq();
tasklet_kill(&msg_dpc); tasklet_kill(&msg_dpc);
vmbus_free_channels(); vmbus_free_channels();
if (ms_hyperv.features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) { if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) {
unregister_die_notifier(&hyperv_die_block); unregister_die_notifier(&hyperv_die_block);
atomic_notifier_chain_unregister(&panic_notifier_list, atomic_notifier_chain_unregister(&panic_notifier_list,
&hyperv_panic_block); &hyperv_panic_block);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment