linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tianyu Lan <ltykernel@gmail.com>
To: Michael Kelley <mikelley@microsoft.com>,
	KY Srinivasan <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	Wei Liu <liuwe@microsoft.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"bp@alien8.de" <bp@alien8.de>, "hpa@zytor.com" <hpa@zytor.com>,
	"x86@kernel.org" <x86@kernel.org>
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 0/4] x86/Hyper-V: Panic code path fixes
Date: Fri, 20 Mar 2020 10:21:14 +0800	[thread overview]
Message-ID: <66750077-bd3e-d24a-688c-f71c4eda30a3@gmail.com> (raw)
In-Reply-To: <MW2PR2101MB1052A7AFC5222CC9D78FA77ED7F40@MW2PR2101MB1052.namprd21.prod.outlook.com>

On 3/20/2020 12:07 AM, Michael Kelley wrote:
> From: Michael Kelley <mikelley@microsoft.com> Sent: Thursday, March 19, 2020 8:15 AM
>>
>> From: Tianyu Lan <Tianyu.Lan@microsoft.com> Sent: Thursday, March 19, 2020 7:08 AM
>>>>>
>>>>> 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 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.
>>>>
>>>> I still see an issue that isn't addressed by these patches.  The VMbus
>>>> driver registers a "die notifier" and a "panic notifier".   But die() will
>>>> eventually call panic() if panic_on_oops is set (which I think it typically
>>>> is).  If the CRASH_NOTIFY_MSG option is *not* enabled, then
>>>> hyperv_report_panic() could get called by the die notifier, and then
>>>> again by the panic notifier.
>>>>
>>>> Do we even need the "die notifier"?  If it was removed, there would
>>>> not be any notification to Hyper-V via the die() path unless panic_on_oops
>>>> is set, which I think is actually the correct behavior.  I'm not
>>>> completely clear on what is supposed to happen in general to the
>>>> Linux kernel if panic_on_oops is not set. Does it try to continue to run?
>>>> If so, then we should not be notifying Hyper-V if panic_on_oops is not
>>>> set, and removing the die notifier is the right thing to do.
>>>>
>>>
>>> hyperv_report_panic() has re-enter check inside and so kernel only
>>> reports crash register data once during die().
>>
>> Ah, yes, you are right.
>>
>>>  From comment in the
>>> hyperv_report_panic(), register value reported in die chain is more
>>> exact than value in panic chain. The register value in die chain is
>>> passed by die() caller. Register value reported in panic chain
>>> is collected in the hyperv_panic_event().
>>>
>>> If panic_on_oops is not set, the task should be killed and kernel
>>> still runs. In this case, we may not trigger crash enlightenment.
>>
>> I'm not completely clear on your last statement.   It seems like there
>> is still a problem in that die() will call hyperv_report_panic() even if
>> panic_on_oops is not set.  We will have reported a panic to Hyper-V
>> even though the VM did not stop running.
>
Yes, the die callback is still necessary and we should skip report
if panic_on_oops isn't set.

> 
> There's one more issue to consider.  hv_kmsg_dump() skips calling
> hyperv_report_panic_msg() if sysctl_record_panic_msg has been cleared
> by a sysctl command.  (This sysctl option gives a customer the ability to
> increase privacy by not having the VM's dmesg contents sent to Hyper-V.)
> In this case, the earlier hyperv_report_panic() call should be used.  Otherwise,
> there would not be any notification to Hyper-V about the panic.
> 

Nice catch. I will fix this in the next version.

Thanks.



      reply	other threads:[~2020-03-20  2:21 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-17 13:25 [PATCH 0/4] x86/Hyper-V: Panic code path fixes ltykernel
2020-03-17 13:25 ` [PATCH 0/4] x86/Hyper-V: Unload vmbus channel in hv panic callback ltykernel
2020-03-17 17:35   ` Wei Liu
2020-03-19  8:24     ` Tianyu Lan
2020-03-18 15:58   ` Vitaly Kuznetsov
2020-03-19  0:33     ` Michael Kelley
2020-03-19  8:03       ` Vitaly Kuznetsov
2020-03-19 15:06         ` Michael Kelley
2020-03-19  8:03     ` Tianyu Lan
2020-03-17 13:25 ` [PATCH 2/4] x86/Hyper-V: Free hv_panic_page when fail to register kmsg dump ltykernel
2020-03-17 17:36   ` Wei Liu
2020-03-19  8:12     ` Tianyu Lan
2020-03-19  0:38   ` Michael Kelley
2020-03-17 13:25 ` [PATCH 3/4] x86/Hyper-V: Trigger crash enlightenment only once during system crash ltykernel
2020-03-19  0:45   ` Michael Kelley
2020-03-17 13:25 ` [PATCH 4/4] x86/Hyper-V: Report crash register data or ksmg before running crash kernel ltykernel
2020-03-19  0:51   ` Michael Kelley
2020-03-19  0:57 ` [PATCH 0/4] x86/Hyper-V: Panic code path fixes Michael Kelley
2020-03-19 14:08   ` Tianyu Lan
2020-03-19 15:14     ` Michael Kelley
2020-03-19 16:07       ` Michael Kelley
2020-03-20  2:21         ` Tianyu Lan [this message]

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=66750077-bd3e-d24a-688c-f71c4eda30a3@gmail.com \
    --to=ltykernel@gmail.com \
    --cc=Tianyu.Lan@microsoft.com \
    --cc=bp@alien8.de \
    --cc=haiyangz@microsoft.com \
    --cc=hpa@zytor.com \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuwe@microsoft.com \
    --cc=mikelley@microsoft.com \
    --cc=mingo@redhat.com \
    --cc=sthemmin@microsoft.com \
    --cc=tglx@linutronix.de \
    --cc=vkuznets@redhat.com \
    --cc=x86@kernel.org \
    /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).