summaryrefslogtreecommitdiff
path: root/drivers/hv
diff options
context:
space:
mode:
authorTianyu Lan <Tianyu.Lan@microsoft.com>2020-04-06 08:53:31 -0700
committerWei Liu <wei.liu@kernel.org>2020-04-11 17:19:07 +0100
commitf3a99e761efa616028b255b4de58e9b5b87c5545 (patch)
tree0a9c42a1b17d9e538b97afdac98e3a6344e873ee /drivers/hv
parent040026df7088c56ccbad28f7042308f67bde63df (diff)
x86/Hyper-V: Report crash data in die() when panic_on_oops is set
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. Check panic_on_oops and return directly in hyperv_report_panic() when the function is called in the die() and panic_on_oops is unset. Fix it. Fixes: 7ed4325a44ea ("Drivers: hv: vmbus: Make panic reporting to be more useful") Signed-off-by: Tianyu Lan <Tianyu.Lan@microsoft.com> Reviewed-by: Michael Kelley <mikelley@microsoft.com> Link: https://lore.kernel.org/r/20200406155331.2105-7-Tianyu.Lan@microsoft.com Signed-off-by: Wei Liu <wei.liu@kernel.org>
Diffstat (limited to 'drivers/hv')
-rw-r--r--drivers/hv/vmbus_drv.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 172ceae69abb..a68bce4d0ddb 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -31,6 +31,7 @@
#include <linux/kdebug.h>
#include <linux/efi.h>
#include <linux/random.h>
+#include <linux/kernel.h>
#include <linux/syscore_ops.h>
#include <clocksource/hyperv_timer.h>
#include "hyperv_vmbus.h"
@@ -75,7 +76,7 @@ static int hyperv_panic_event(struct notifier_block *nb, unsigned long val,
if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE
&& hyperv_report_reg()) {
regs = current_pt_regs();
- hyperv_report_panic(regs, val);
+ hyperv_report_panic(regs, val, false);
}
return NOTIFY_DONE;
}
@@ -92,7 +93,7 @@ static int hyperv_die_event(struct notifier_block *nb, unsigned long val,
* the notification here.
*/
if (hyperv_report_reg())
- hyperv_report_panic(regs, val);
+ hyperv_report_panic(regs, val, true);
return NOTIFY_DONE;
}