]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mshyperv: fix recognition of Hyper-V guest crash MSR's
authorDenis V. Lunev <den@openvz.org>
Sat, 1 Aug 2015 23:08:20 +0000 (16:08 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Fri, 26 Feb 2016 02:29:02 +0000 (18:29 -0800)
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>
(cherry picked from commit cc2dd4027a43bb36c846f195a764edabc0828602)

Orabug: 21886720
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
arch/x86/include/asm/mshyperv.h
arch/x86/kernel/cpu/mshyperv.c
drivers/hv/vmbus_drv.c

index d3db9108346bed4d8fb316c50aa415556366c24c..050ef9601f117ab0b6481e3a6bcacfc279e998d6 100644 (file)
@@ -7,6 +7,7 @@
 
 struct ms_hyperv_info {
        u32 features;
+       u32 misc_features;
        u32 hints;
 };
 
index 09911aa8a647b5e691d1fa40267f3bb11cb5a809..c3c6dbd5109e211ebe6d189a56001ed20c709d66 100644 (file)
@@ -139,6 +139,7 @@ static void __init ms_hyperv_init_platform(void)
         * Extract the features and hints
         */
        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);
 
        printk(KERN_INFO "HyperV: features 0x%x, hints 0x%x\n",
index 871381c1bfc3f5a812244d3402db8e9dd2dd239e..7703debf6e5f97483609dd2848d10197dcaf88e4 100644 (file)
@@ -871,7 +871,7 @@ static int vmbus_bus_init(int irq)
        /*
         * 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);
                atomic_notifier_chain_register(&panic_notifier_list,
                                               &hyperv_panic_block);
@@ -1145,7 +1145,7 @@ static void __exit vmbus_exit(void)
        hv_remove_vmbus_irq();
        tasklet_kill(&msg_dpc);
        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);
                atomic_notifier_chain_unregister(&panic_notifier_list,
                                                 &hyperv_panic_block);