linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Kelley <mikelley@microsoft.com>
To: "ltykernel@gmail.com" <ltykernel@gmail.com>,
	KY Srinivasan <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	Wei Liu <liuwe@microsoft.com>
Cc: Tianyu Lan <Tianyu.Lan@microsoft.com>,
	"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	vkuznets <vkuznets@redhat.com>
Subject: RE: [PATCH V2 5/6] x86/Hyper-V: Report crash register data when sysctl_record_panic_msg is not set
Date: Mon, 23 Mar 2020 17:20:11 +0000	[thread overview]
Message-ID: <MW2PR2101MB105226EC2D8216C68069BA62D7F00@MW2PR2101MB1052.namprd21.prod.outlook.com> (raw)
In-Reply-To: <20200323130924.2968-6-Tianyu.Lan@microsoft.com>

From: Tianyu Lan <Tianyu.Lan@microsoft.com> Sent: Monday, March 23, 2020 6:09 AM
> 
> 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().

> 
> Signed-off-by: Tianyu Lan <Tianyu.Lan@microsoft.com>
> ---
>  drivers/hv/vmbus_drv.c | 23 ++++++++++++++---------
>  1 file changed, 14 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
> index d73fa8aa00a3..00447175c040 100644
> --- a/drivers/hv/vmbus_drv.c
> +++ b/drivers/hv/vmbus_drv.c
> @@ -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.
> --
> 2.14.5


  reply	other threads:[~2020-03-23 17:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-23 13:09 [PATCH V2 0/6] x86/Hyper-V: Panic code path fixes ltykernel
2020-03-23 13:09 ` [PATCH V2 1/6] x86/Hyper-V: Unload vmbus channel in hv panic callback ltykernel
2020-03-23 17:11   ` Michael Kelley
2020-03-23 13:09 ` [PATCH V2 2/6] x86/Hyper-V: Free hv_panic_page when fail to register kmsg dump ltykernel
2020-03-23 13:09 ` [PATCH V2 3/6] x86/Hyper-V: Trigger crash enlightenment only once during system crash ltykernel
2020-03-23 17:15   ` Michael Kelley
2020-03-23 13:09 ` [PATCH V2 4/6] x86/Hyper-V: Report crash register data or ksmg before running crash kernel ltykernel
2020-03-23 17:16   ` Michael Kelley
2020-03-23 13:09 ` [PATCH V2 5/6] x86/Hyper-V: Report crash register data when sysctl_record_panic_msg is not set ltykernel
2020-03-23 17:20   ` Michael Kelley [this message]
2020-03-23 13:09 ` [PATCH V2 6/6] x86/Hyper-V: Report crash data in die() when panic_on_oops is set ltykernel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MW2PR2101MB105226EC2D8216C68069BA62D7F00@MW2PR2101MB1052.namprd21.prod.outlook.com \
    --to=mikelley@microsoft.com \
    --cc=Tianyu.Lan@microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuwe@microsoft.com \
    --cc=ltykernel@gmail.com \
    --cc=sthemmin@microsoft.com \
    --cc=vkuznets@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).