Skip to content

Commit a115895

Browse files
Tianyu Lanliuw
authored andcommitted
x86/Hyper-V: Report crash register data or kmsg before running crash kernel
We want to notify Hyper-V when a Linux guest VM crash occurs, so there is a record of the crash even when kdump is enabled. But crash_kexec_post_notifiers defaults to "false", so the kdump kernel runs before the notifiers and Hyper-V never gets notified. Fix this by always setting crash_kexec_post_notifiers to be true for Hyper-V VMs. Fixes: 81b18bc ("Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic") Reviewed-by: Michael Kelley <[email protected]> Signed-off-by: Tianyu Lan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Wei Liu <[email protected]>
1 parent 73f26e5 commit a115895

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

arch/x86/kernel/cpu/mshyperv.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,16 @@ static void __init ms_hyperv_init_platform(void)
263263
cpuid_eax(HYPERV_CPUID_NESTED_FEATURES);
264264
}
265265

266+
/*
267+
* Hyper-V expects to get crash register data or kmsg when
268+
* crash enlightment is available and system crashes. Set
269+
* crash_kexec_post_notifiers to be true to make sure that
270+
* calling crash enlightment interface before running kdump
271+
* kernel.
272+
*/
273+
if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE)
274+
crash_kexec_post_notifiers = true;
275+
266276
#ifdef CONFIG_X86_LOCAL_APIC
267277
if (ms_hyperv.features & HV_X64_ACCESS_FREQUENCY_MSRS &&
268278
ms_hyperv.misc_features & HV_FEATURE_FREQUENCY_MSRS_AVAILABLE) {

0 commit comments

Comments
 (0)