Skip to contentSkip to conversation

x86/Hyper-V: Panic code path fixes

PATCH Superseded [email protected] 2 participants 11 messages Mar 23, 2020

Subsystems (3)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover x86/Hyper-V: Panic code path fixes

From: Tianyu Lan <[email protected]>

This patchset fixes some issues in the Hyper-V panic code path. Patch 1 resolves issue that panic system still responses network packets.
Patch 2-3,5-6 resolves crash enlightenment issues. Patch 4 is to set crash_kexec_post_notifiers to true for Hyper-V VM in order to report crash data or kmsg to host before running kdump kernel.

Tianyu Lan (6):
x86/Hyper-V: Unload vmbus channel in hv panic callback x86/Hyper-V: Free hv_panic_page when fail to register kmsg dump x86/Hyper-V: Trigger crash enlightenment only once during system
crash.
x86/Hyper-V: Report crash register data or ksmg before running crash
kernel
x86/Hyper-V: Report crash register data when sysctl_record_panic_msg
is not set
x86/Hyper-V: Report crash data in die() when panic_on_oops is set

 arch/x86/kernel/cpu/mshyperv.c | 10 ++++++++
 drivers/hv/channel_mgmt.c      |  3 +++
 drivers/hv/vmbus_drv.c         | 55 ++++++++++++++++++++++++++++--------------
 3 files changed, 50 insertions(+), 18 deletions(-)
Signature · 1 line
2.14.5
#1 lore raw

PATCH v2 1/6 x86/Hyper-V: Unload vmbus channel in hv panic callback

From: Tianyu Lan <[email protected]>

When kdump is not configured, a Hyper-V VM might still respond to network traffic after a kernel panic when kernel parameter panic=0. The panic CPU goes into an infinite loop with interrupts enabled, and the VMbus driver interrupt handler still works because the VMbus connection is unloaded only in the kdump path. The network responses make the other end of the connection think the VM is still functional even though it has panic'ed, which could affect any failover actions that should be taken.

Fix this by unloading the VMbus connection during the panic process. vmbus_initiate_unload() could then be called twice (e.g., by hyperv_panic_event() and hv_crash_handler(), so reset the connection state in vmbus_initiate_unload() to ensure the unload is done only once.

---
Change since v1:
- Update chnage log
- Use xchg() to change vmbus connection status

---
 drivers/hv/channel_mgmt.c |  3 +++
 drivers/hv/vmbus_drv.c    | 17 +++++++++--------
 2 files changed, 12 insertions(+), 8 deletions(-)
drivers/hv/channel_mgmt.c +3 -0
index 0370364169c4..501c43c5851d 100644
@@ -839,6 +839,9 @@ void vmbus_initiate_unload(bool crash)
 {
 	struct vmbus_channel_message_header hdr;
 
+	if (xchg(&vmbus_connection.conn_state, DISCONNECTED) == DISCONNECTED)
+		return;
+
 	/* Pre-Win2012R2 hosts don't support reconnect */
 	if (vmbus_proto_version < VERSION_WIN8_1)
 		return;
drivers/hv/vmbus_drv.c +9 -8
index 029378c27421..b56b9fb9bd90 100644
@@ -53,9 +53,12 @@ static int hyperv_panic_event(struct notifier_block *nb, unsigned long val,
 {
 	struct pt_regs *regs;
 
-	regs = current_pt_regs();
+	vmbus_initiate_unload(true);
 
-	hyperv_report_panic(regs, val);
+	if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) {
+		regs = current_pt_regs();
+		hyperv_report_panic(regs, val);
+	}
 	return NOTIFY_DONE;
 }
 
@@ -1391,10 +1394,12 @@ static int vmbus_bus_init(void)
 		}
 
 		register_die_notifier(&hyperv_die_block);
-		atomic_notifier_chain_register(&panic_notifier_list,
-					       &hyperv_panic_block);
 	}
 
+	/* Vmbus channel is unloaded in panic callback when panic happens.*/
+	atomic_notifier_chain_register(&panic_notifier_list,
+			       &hyperv_panic_block);
+
 	vmbus_request_offers();
 
 	return 0;
@@ -2204,8 +2209,6 @@ static int vmbus_bus_suspend(struct device *dev)
 
 	vmbus_initiate_unload(false);
 
-	vmbus_connection.conn_state = DISCONNECTED;
-
 	/* Reset the event for the next resume. */
 	reinit_completion(&vmbus_connection.ready_for_resume_event);
 
@@ -2289,7 +2292,6 @@ static void hv_kexec_handler(void)
 {
 	hv_stimer_global_cleanup();
 	vmbus_initiate_unload(false);
-	vmbus_connection.conn_state = DISCONNECTED;
 	/* Make sure conn_state is set as hv_synic_cleanup checks for it */
 	mb();
 	cpuhp_remove_state(hyperv_cpuhp_online);
@@ -2306,7 +2308,6 @@ static void hv_crash_handler(struct pt_regs *regs)
 	 * doing the cleanup for current CPU only. This should be sufficient
 	 * for kdump.
 	 */
-	vmbus_connection.conn_state = DISCONNECTED;
 	cpu = smp_processor_id();
 	hv_stimer_cleanup(cpu);
 	hv_synic_disable_regs(cpu);
Signature · 1 line
2.14.5
#2 lore raw

RE: [PATCH V2 1/6] x86/Hyper-V: Unload vmbus channel in hv panic callback

From: Tianyu Lan <[email protected]> Sent: Monday, March 23, 2020 6:09 AM

Quoted 61 lines

When kdump is not configured, a Hyper-V VM might still respond to network traffic after a kernel panic when kernel parameter panic=0. The panic CPU goes into an infinite loop with interrupts enabled, and the VMbus driver interrupt handler still works because the VMbus connection is unloaded only in the kdump path. The network responses make the other end of the connection think the VM is still functional even though it has panic'ed, which could affect any failover actions that should be taken.

Fix this by unloading the VMbus connection during the panic process. vmbus_initiate_unload() could then be called twice (e.g., by hyperv_panic_event() and hv_crash_handler(), so reset the connection state in vmbus_initiate_unload() to ensure the unload is done only once.

---
Change since v1:
- Update chnage log
- Use xchg() to change vmbus connection status

---
 drivers/hv/channel_mgmt.c |  3 +++
 drivers/hv/vmbus_drv.c    | 17 +++++++++--------
 2 files changed, 12 insertions(+), 8 deletions(-)
drivers/hv/channel_mgmt.c +3 -0
index 0370364169c4..501c43c5851d 100644
@@ -839,6 +839,9 @@ void vmbus_initiate_unload(bool crash)
 {
 	struct vmbus_channel_message_header hdr;
 
+	if (xchg(&vmbus_connection.conn_state, DISCONNECTED) == DISCONNECTED)
+		return;
+
 	/* Pre-Win2012R2 hosts don't support reconnect */
 	if (vmbus_proto_version < VERSION_WIN8_1)
 		return;
drivers/hv/vmbus_drv.c +5 -2
index 029378c27421..b56b9fb9bd90 100644
@@ -53,9 +53,12 @@ static int hyperv_panic_event(struct notifier_block *nb, unsigned
 long val,
 {
 	struct pt_regs *regs;
 
-	regs = current_pt_regs();
+	vmbus_initiate_unload(true);
 
-	hyperv_report_panic(regs, val);
+	if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) {
+		regs = current_pt_regs();
+		hyperv_report_panic(regs, val);
+	}
 	return NOTIFY_DONE;
 }

drivers/hv/vmbus_drv.c static int vmbus_bus_init(void) · line 1399

Quoted 8 lines
drivers/hv/vmbus_drv.c +1 -2
@@ -1391,10 +1394,12 @@ static int vmbus_bus_init(void)
 		}
 
 		register_die_notifier(&hyperv_die_block);
-		atomic_notifier_chain_register(&panic_notifier_list,
-					       &hyperv_panic_block);
 	}
 
+	/* Vmbus channel is unloaded in panic callback when panic happens.*/

Let me suggest a tweak to the above comment so it is super clear:

/*
* Always register the panic notifier because we need to unload
* the VMbus channel connection to prevent any VMbus
* activity after the VM panics.
*/

Quoted 6 lines
drivers/hv/vmbus_drv.c +3 -0
+	atomic_notifier_chain_register(&panic_notifier_list,
+			       &hyperv_panic_block);
+
 	vmbus_request_offers();
 
 	return 0;
#3 lore raw

PATCH v2 2/6 x86/Hyper-V: Free hv_panic_page when fail to register kmsg dump

In reply to [email protected]

From: Tianyu Lan <[email protected]>

If kmsg_dump_register() fails, hv_panic_page will not be used anywhere. So free and reset it.

---
Change since v1:
- Update commit log
- Remove hv_free_hyperv_page() in the error path

---
 drivers/hv/vmbus_drv.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/hv/vmbus_drv.c +5 -2
index b56b9fb9bd90..3a0472c8b7ae 100644
@@ -1385,9 +1385,13 @@ static int vmbus_bus_init(void)
 			hv_panic_page = (void *)hv_alloc_hyperv_zeroed_page();
 			if (hv_panic_page) {
 				ret = kmsg_dump_register(&hv_kmsg_dumper);
-				if (ret)
+				if (ret) {
 					pr_err("Hyper-V: kmsg dump register "
 						"error 0x%x\n", ret);
+					hv_free_hyperv_page(
+					    (unsigned long)hv_panic_page);
+					hv_panic_page = NULL;
+				}
 			} else
 				pr_err("Hyper-V: panic message page memory "
 					"allocation failed");
@@ -1412,7 +1416,6 @@ static int vmbus_bus_init(void)
 	hv_remove_vmbus_irq();
 
 	bus_unregister(&hv_bus);
-	hv_free_hyperv_page((unsigned long)hv_panic_page);
 	unregister_sysctl_table(hv_ctl_table_hdr);
 	hv_ctl_table_hdr = NULL;
 	return ret;
Signature · 1 line
2.14.5
#4 lore raw

PATCH v2 3/6 x86/Hyper-V: Trigger crash enlightenment only once during system crash.

In reply to [email protected]

From: Tianyu Lan <[email protected]>

When a guest VM panics, Hyper-V should be notified only once via the crash synthetic MSRs. Current Linux code might write these crash MSRs twice during a system panic:
1) hyperv_panic/die_event() calling hyperv_report_panic()
2) hv_kmsg_dump() calling hyperv_report_panic_msg()

Fix this by not calling hyperv_report_panic() if a kmsg dump has been successfully registered. The notification will happen later via hyperv_report_panic_msg().

---
Change since v1:
- Update commit log

---
 drivers/hv/vmbus_drv.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/hv/vmbus_drv.c +12 -2
index 3a0472c8b7ae..d73fa8aa00a3 100644
@@ -55,7 +55,12 @@ static int hyperv_panic_event(struct notifier_block *nb, unsigned long val,
 
 	vmbus_initiate_unload(true);
 
-	if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) {
+	/*
+	 * Crash notify only can be triggered once. If crash notify
+	 * message is available, just report kmsg to crash buffer.
+	 */
+	if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE
+	    && !hv_panic_page) {
 		regs = current_pt_regs();
 		hyperv_report_panic(regs, val);
 	}
@@ -68,7 +73,12 @@ static int hyperv_die_event(struct notifier_block *nb, unsigned long val,
 	struct die_args *die = (struct die_args *)args;
 	struct pt_regs *regs = die->regs;
 
-	hyperv_report_panic(regs, val);
+	/*
+	 * Crash notify only can be triggered once. If crash notify
+	 * message is available, just report kmsg to crash buffer.
+	 */
+	if (!hv_panic_page)
+		hyperv_report_panic(regs, val);
 	return NOTIFY_DONE;
 }
 
Signature · 1 line
2.14.5
#5 lore raw

RE: [PATCH V2 3/6] x86/Hyper-V: Trigger crash enlightenment only once during system crash.

From: Tianyu Lan <[email protected]> Sent: Monday, March 23, 2020 6:09 AM

Quoted 24 lines

When a guest VM panics, Hyper-V should be notified only once via the crash synthetic MSRs. Current Linux code might write these crash MSRs twice during a system panic:
1) hyperv_panic/die_event() calling hyperv_report_panic()
2) hv_kmsg_dump() calling hyperv_report_panic_msg()

Fix this by not calling hyperv_report_panic() if a kmsg dump has been successfully registered. The notification will happen later via hyperv_report_panic_msg().

---
Change since v1:
- Update commit log

---
 drivers/hv/vmbus_drv.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/hv/vmbus_drv.c +0 -0
index 3a0472c8b7ae..d73fa8aa00a3 100644

drivers/hv/vmbus_drv.c static int hyperv_panic_event(struct notifier_block *nb, unsigned · line 62

Quoted 9 lines
drivers/hv/vmbus_drv.c +4 -1
@@ -55,7 +55,12 @@ static int hyperv_panic_event(struct notifier_block *nb, unsigned
 long val,
 
 	vmbus_initiate_unload(true);
 
-	if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) {
+	/*
+	 * Crash notify only can be triggered once. If crash notify
+	 * message is available, just report kmsg to crash buffer.
+	 */

Just to clarify the above comment, let me suggest:

/*
* Hyper-V should be notified only once about a panic. If we will be
* doing hyperv_report_panic_msg() later with kmsg data, don't do
* the notification here.
*/

Quoted 6 lines
drivers/hv/vmbus_drv.c +2 -0
+	if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE
+	    && !hv_panic_page) {
 		regs = current_pt_regs();
 		hyperv_report_panic(regs, val);
drivers/hv/vmbus_drv.c +0 -0
 	}

drivers/hv/vmbus_drv.c static int hyperv_die_event(struct notifier_block *nb, unsigned long · line 80

Quoted 9 lines
drivers/hv/vmbus_drv.c +4 -1
@@ -68,7 +73,12 @@ static int hyperv_die_event(struct notifier_block *nb, unsigned long
 val,
 	struct die_args *die = (struct die_args *)args;
 	struct pt_regs *regs = die->regs;
 
-	hyperv_report_panic(regs, val);
+	/*
+	 * Crash notify only can be triggered once. If crash notify
+	 * message is available, just report kmsg to crash buffer.
+	 */

Same suggested clarification to the comment applies here.

Quoted 7 lines
drivers/hv/vmbus_drv.c +2 -1
+	if (!hv_panic_page)
+		hyperv_report_panic(regs, val);
 	return NOTIFY_DONE;
 }
 
--

2.14.5

#6 lore raw

PATCH v2 4/6 x86/Hyper-V: Report crash register data or ksmg before running crash kernel

In reply to [email protected]

From: Tianyu Lan <[email protected]>

When a guest VM panics, Hyper-V should be notified only once via the crash synthetic MSRs. Current Linux code might write these crash MSRs twice during a system panic:
1) hyperv_panic/die_event() calling hyperv_report_panic()
2) hv_kmsg_dump() calling hyperv_report_panic_msg()

Fix this by not calling hyperv_report_panic() if a kmsg dump has been successfully registered. The notification will happen later via hyperv_report_panic_msg().

---
Change since v1:
Update commit log

---
 arch/x86/kernel/cpu/mshyperv.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/x86/kernel/cpu/mshyperv.c +10 -0
index caa032ce3fe3..5e296a7e6036 100644
@@ -263,6 +263,16 @@ static void __init ms_hyperv_init_platform(void)
 			cpuid_eax(HYPERV_CPUID_NESTED_FEATURES);
 	}
 
+	/*
+	 * Hyper-V expects to get crash register data or kmsg when
+	 * crash enlightment is available and system crashes. Set
+	 * crash_kexec_post_notifiers to be true to make sure that
+	 * calling crash enlightment interface before running kdump
+	 * kernel.
+	 */
+	if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE)
+		crash_kexec_post_notifiers = true;
+
 #ifdef CONFIG_X86_LOCAL_APIC
 	if (ms_hyperv.features & HV_X64_ACCESS_FREQUENCY_MSRS &&
 	    ms_hyperv.misc_features & HV_FEATURE_FREQUENCY_MSRS_AVAILABLE) {
Signature · 1 line
2.14.5
#7 lore raw

RE: [PATCH V2 4/6] x86/Hyper-V: Report crash register data or ksmg before running crash kernel

From: Tianyu Lan <[email protected]> Sent: Monday, March 23, 2020 6:09 AM

Quoted 10 lines

When a guest VM panics, Hyper-V should be notified only once via the crash synthetic MSRs. Current Linux code might write these crash MSRs twice during a system panic:
1) hyperv_panic/die_event() calling hyperv_report_panic()
2) hv_kmsg_dump() calling hyperv_report_panic_msg()

Fix this by not calling hyperv_report_panic() if a kmsg dump has been successfully registered. The notification will happen later via hyperv_report_panic_msg().

I think this patch got the wrong commit message. This message is the same as in patch 3 of the series.

Quoted 32 lines

---
Change since v1:
Update commit log

---
 arch/x86/kernel/cpu/mshyperv.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/x86/kernel/cpu/mshyperv.c +10 -1
index caa032ce3fe3..5e296a7e6036 100644
@@ -263,6 +263,16 @@ static void __init ms_hyperv_init_platform(void)
 			cpuid_eax(HYPERV_CPUID_NESTED_FEATURES);
 	}
 
+	/*
+	 * Hyper-V expects to get crash register data or kmsg when
+	 * crash enlightment is available and system crashes. Set
+	 * crash_kexec_post_notifiers to be true to make sure that
+	 * calling crash enlightment interface before running kdump
+	 * kernel.
+	 */
+	if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE)
+		crash_kexec_post_notifiers = true;
+
 #ifdef CONFIG_X86_LOCAL_APIC
 	if (ms_hyperv.features & HV_X64_ACCESS_FREQUENCY_MSRS &&
 	    ms_hyperv.misc_features & HV_FEATURE_FREQUENCY_MSRS_AVAILABLE) {
--

2.14.5

#8 lore raw

PATCH v2 5/6 x86/Hyper-V: Report crash register data when sysctl_record_panic_msg is not set

In reply to [email protected]

From: Tianyu Lan <[email protected]>

When sysctl_record_panic_msg is not set, kmsg will not be reported to Hyper-V. Crash register data should be reported via hyperv_report_panic() in such case.

---
 drivers/hv/vmbus_drv.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)
drivers/hv/vmbus_drv.c +14 -9
index d73fa8aa00a3..00447175c040 100644
@@ -48,6 +48,18 @@ static int hyperv_cpuhp_online;
 
 static void *hv_panic_page;
 
+/*
+ * Boolean to control whether to report panic messages over Hyper-V.
+ *
+ * It can be set via /proc/sys/kernel/hyperv/record_panic_msg
+ */
+static int sysctl_record_panic_msg = 1;
+
+static int hyperv_report_reg(void)
+{
+	return !sysctl_record_panic_msg || !hv_panic_page;
+}
+
 static int hyperv_panic_event(struct notifier_block *nb, unsigned long val,
 			      void *args)
 {
@@ -60,7 +72,7 @@ static int hyperv_panic_event(struct notifier_block *nb, unsigned long val,
 	 * message is available, just report kmsg to crash buffer.
 	 */
 	if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE
-	    && !hv_panic_page) {
+	    && hyperv_report_reg()) {
 		regs = current_pt_regs();
 		hyperv_report_panic(regs, val);
 	}
@@ -77,7 +89,7 @@ static int hyperv_die_event(struct notifier_block *nb, unsigned long val,
 	 * Crash notify only can be triggered once. If crash notify
 	 * message is available, just report kmsg to crash buffer.
 	 */
-	if (!hv_panic_page)
+	if (hyperv_report_reg())
 		hyperv_report_panic(regs, val);
 	return NOTIFY_DONE;
 }
@@ -1265,13 +1277,6 @@ static void vmbus_isr(void)
 	add_interrupt_randomness(HYPERVISOR_CALLBACK_VECTOR, 0);
 }
 
-/*
- * Boolean to control whether to report panic messages over Hyper-V.
- *
- * It can be set via /proc/sys/kernel/hyperv/record_panic_msg
- */
-static int sysctl_record_panic_msg = 1;
-
 /*
  * Callback from kmsg_dump. Grab as much as possible from the end of the kmsg
  * buffer and call into Hyper-V to transfer the data.
Signature · 1 line
2.14.5
#9 lore raw

RE: [PATCH V2 5/6] x86/Hyper-V: Report crash register data when sysctl_record_panic_msg is not set

From: Tianyu Lan <[email protected]> Sent: Monday, March 23, 2020 6:09 AM

Quoted 4 lines

When sysctl_record_panic_msg is not set, kmsg will not be reported to Hyper-V. Crash register data should be reported via hyperv_report_panic() in such case.

Tweaking the wording:

When sysctl_record_panic_msg is not set, the panic will not be reported to Hyper-V via hyperv_report_panic_msg(). So the crash should be reported via hyperv_report_panic().

Quoted 65 lines
---
 drivers/hv/vmbus_drv.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)
drivers/hv/vmbus_drv.c +13 -1
index d73fa8aa00a3..00447175c040 100644
@@ -48,6 +48,18 @@ static int hyperv_cpuhp_online;
 
 static void *hv_panic_page;
 
+/*
+ * Boolean to control whether to report panic messages over Hyper-V.
+ *
+ * It can be set via /proc/sys/kernel/hyperv/record_panic_msg
+ */
+static int sysctl_record_panic_msg = 1;
+
+static int hyperv_report_reg(void)
+{
+	return !sysctl_record_panic_msg || !hv_panic_page;
+}
+
 static int hyperv_panic_event(struct notifier_block *nb, unsigned long val,
 			      void *args)
 {
@@ -60,7 +72,7 @@ static int hyperv_panic_event(struct notifier_block *nb, unsigned long
 val,
 	 * message is available, just report kmsg to crash buffer.
 	 */
 	if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE
-	    && !hv_panic_page) {
+	    && hyperv_report_reg()) {
 		regs = current_pt_regs();
 		hyperv_report_panic(regs, val);
drivers/hv/vmbus_drv.c +1 -1
 	}
@@ -77,7 +89,7 @@ static int hyperv_die_event(struct notifier_block *nb, unsigned long
 val,
 	 * Crash notify only can be triggered once. If crash notify
 	 * message is available, just report kmsg to crash buffer.
 	 */
-	if (!hv_panic_page)
+	if (hyperv_report_reg())
 		hyperv_report_panic(regs, val);
 	return NOTIFY_DONE;

}

drivers/hv/vmbus_drv.c +0 -8
@@ -1265,13 +1277,6 @@ static void vmbus_isr(void)
 	add_interrupt_randomness(HYPERVISOR_CALLBACK_VECTOR, 0);
 }
 
-/*
- * Boolean to control whether to report panic messages over Hyper-V.
- *
- * It can be set via /proc/sys/kernel/hyperv/record_panic_msg
- */
-static int sysctl_record_panic_msg = 1;
-
 /*
  * Callback from kmsg_dump. Grab as much as possible from the end of the kmsg
  * buffer and call into Hyper-V to transfer the data.
--

2.14.5

#10 lore raw

PATCH v2 6/6 x86/Hyper-V: Report crash data in die() when panic_on_oops is set

In reply to [email protected]

From: Tianyu Lan <[email protected]>

When oops happens with panic_on_oops unset, the oops thread is killed by die() and system continues to run. In such case, guest should not report crash register data to host since system still runs. Fix it.

---
 drivers/hv/vmbus_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hv/vmbus_drv.c +1 -1
index 00447175c040..ecdb64db0e4a 100644
@@ -89,7 +89,7 @@ static int hyperv_die_event(struct notifier_block *nb, unsigned long val,
 	 * Crash notify only can be triggered once. If crash notify
 	 * message is available, just report kmsg to crash buffer.
 	 */
-	if (hyperv_report_reg())
+	if (hyperv_report_reg() && panic_on_oops)
 		hyperv_report_panic(regs, val);
 	return NOTIFY_DONE;
 }
Signature · 1 line
2.14.5