mshyperv: fix recognition of Hyper-V guest crash MSR's
Subsystems (3)
RFC PATCH 1/1 mshyperv: fix recognition of Hyper-V guest crash MSR's
From: Andrey Smetanin <[email protected]>
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.
--- arch/x86/include/asm/mshyperv.h | 1 + arch/x86/kernel/cpu/mshyperv.c | 1 + drivers/hv/vmbus_drv.c | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-)
arch/x86/include/asm/mshyperv.h +1 -0
@@ -7,6 +7,7 @@struct ms_hyperv_info {u32 features; +u32 misc_features;u32 hints; };
arch/x86/kernel/cpu/mshyperv.c +1 -0
@@ -114,6 +114,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",
drivers/hv/vmbus_drv.c +2 -2
@@ -841,7 +841,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 ) {atomic_notifier_chain_register (&panic_notifier_list, &hyperv_panic_block); }
@@ -1110,7 +1110,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 ) {atomic_notifier_chain_unregister (&panic_notifier_list, &hyperv_panic_block); }
Signature · 1 line
2.1.4
Quoted 6 lines · Denis V. Lunev
From: Andrey Smetanin <[email protected]>
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.
Quoted 8 lines
This patch should fix this recognition. Currently the code checks EAX register instead of EDX.
Signed-off-by Andrey Smetanin <[email protected]>Signed-off-by Denis V. Lunev <[email protected]>CC Nick Meier <[email protected]>CC K. Y. Srinivasan <[email protected]>CC Haiyang Zhang <[email protected]>
Something went wrong and I don't see K.Y. on the CC: list of your email. Fixed now.
Quoted 52 lines
--- arch/x86/include/asm/mshyperv.h | 1 + arch/x86/kernel/cpu/mshyperv.c | 1 + drivers/hv/vmbus_drv.c | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-)arch/x86/include/asm/mshyperv.h +1
-0@@ -7,6 +7,7 @@struct ms_hyperv_info {u32 features; +u32 misc_features;u32 hints; };arch/x86/kernel/cpu/mshyperv.c +1
-0@@ -114,6 +114,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",drivers/hv/vmbus_drv.c +2
-2@@ -841,7 +841,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 ) {atomic_notifier_chain_register (&panic_notifier_list, &hyperv_panic_block); }@@ -1110,7 +1110,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 ) {atomic_notifier_chain_unregister (&panic_notifier_list, &hyperv_panic_block); }
Signature · 1 line
Vitaly
Quoted 6 lines · Denis V. Lunev
From: Andrey Smetanin <[email protected]>
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.
Quoted 8 lines
This patch should fix this recognition. Currently the code checks EAX register instead of EDX.
Signed-off-by Andrey Smetanin <[email protected]>Signed-off-by Denis V. Lunev <[email protected]>CC Nick Meier <[email protected]>CC K. Y. Srinivasan <[email protected]>CC Haiyang Zhang <[email protected]>
Something went wrong and I don't see K.Y. on the CC: list of your email. Fixed now.
Quoted 52 lines
--- arch/x86/include/asm/mshyperv.h | 1 + arch/x86/kernel/cpu/mshyperv.c | 1 + drivers/hv/vmbus_drv.c | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-)arch/x86/include/asm/mshyperv.h +1
-0@@ -7,6 +7,7 @@struct ms_hyperv_info {u32 features; +u32 misc_features;u32 hints; };arch/x86/kernel/cpu/mshyperv.c +1
-0@@ -114,6 +114,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",drivers/hv/vmbus_drv.c +2
-2@@ -841,7 +841,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 ) {atomic_notifier_chain_register (&panic_notifier_list, &hyperv_panic_block); }@@ -1110,7 +1110,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 ) {atomic_notifier_chain_unregister (&panic_notifier_list, &hyperv_panic_block); }
Signature · 1 line
Vitaly