[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DM5PR21MB06334938686C9A202BE4FEA2C05A0@DM5PR21MB0633.namprd21.prod.outlook.com>
Date: Wed, 11 Jul 2018 16:59:01 +0000
From: Sunil Muthuswamy <sunilmut@...rosoft.com>
To: "Michael Kelley (EOSG)" <Michael.H.Kelley@...rosoft.com>,
KY Srinivasan <kys@...rosoft.com>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"devel@...uxdriverproject.org" <devel@...uxdriverproject.org>,
"olaf@...fle.de" <olaf@...fle.de>,
"apw@...onical.com" <apw@...onical.com>,
"jasowang@...hat.com" <jasowang@...hat.com>,
Stephen Hemminger <sthemmin@...rosoft.com>,
"vkuznets@...hat.com" <vkuznets@...hat.com>
Subject: RE: [PATCH 1/1] Drivers: HV: Send one page worth of kmsg dump over
Hyper-V during panic
Thanks, Michael. In which branch should I fix these now that the changes have been
merged with the char-misc-next branch?
Comments inline.
> -----Original Message-----
> From: Michael Kelley (EOSG)
> Sent: Tuesday, July 10, 2018 6:05 PM
> To: KY Srinivasan <kys@...rosoft.com>; gregkh@...uxfoundation.org; linux-
> kernel@...r.kernel.org; devel@...uxdriverproject.org; olaf@...fle.de;
> apw@...onical.com; jasowang@...hat.com; Stephen Hemminger
> <sthemmin@...rosoft.com>; vkuznets@...hat.com
> Cc: Sunil Muthuswamy <sunilmut@...rosoft.com>
> Subject: RE: [PATCH 1/1] Drivers: HV: Send one page worth of kmsg dump
> over Hyper-V during panic
>
> From kys@...uxonhyperv.com <kys@...uxonhyperv.com> Sent: Saturday,
> July 7, 2018 7:57 PM
> >
> > From: Sunil Muthuswamy <sunilmut@...rosoft.com>
> >
> > In the VM mode on Hyper-V, currently, when the kernel panics, an error
> > code and few register values are populated in an MSR and the Hypervisor
> > notified. This information is collected on the host. The amount of
> > information currently collected is found to be limited and not very
> > actionable. To gather more actionable data, such as stack trace, the
> > proposal is to write one page worth of kmsg data on an allocated page
> > and the Hypervisor notified of the page address through the MSR.
> >
> > - Sysctl option to control the behavior, with ON by default.
> >
> > Cc: K. Y. Srinivasan <kys@...rosoft.com>
> > Cc: Stephen Hemminger <sthemmin@...rosoft.com>
> > Signed-off-by: Sunil Muthuswamy <sunilmut@...rosoft.com>
> > Signed-off-by: K. Y. Srinivasan <kys@...rosoft.com>
> > ---
>
> > + /*
> > + * Write dump contents to the page. No need to synchronize; panic
> should
> > + * be single-threaded.
> > + */
> > + if (!kmsg_dump_get_buffer(dumper, true, hv_panic_page,
> > + PAGE_SIZE, &bytes_written)) {
> > + pr_err("Hyper-V: Unable to get kmsg data for panic\n");
> > + return;
>
> From what I can see, the return value from kmsg_dump_get_buffer()
> is not an indication of success or failure -- it's an indication of whether
> there is more data available. There's no reason to output an error
> message.
>
That seems correct. Will address this.
> > @@ -1065,6 +1136,32 @@ static int vmbus_bus_init(void)
> > * Only register if the crash MSRs are available
> > */
> > if (ms_hyperv.misc_features &
> HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) {
> > + u64 hyperv_crash_ctl;
> > + /*
> > + * Sysctl registration is not fatal, since by default
> > + * reporting is enabled.
> > + */
> > + hv_ctl_table_hdr = register_sysctl_table(hv_root_table);
> > + if (!hv_ctl_table_hdr)
> > + pr_err("Hyper-V: sysctl table register error");
> > +
> > + /*
> > + * Register for panic kmsg callback only if the right
> > + * capability is supported by the hypervisor.
> > + */
> > + rdmsrl(HV_X64_MSR_CRASH_CTL, hyperv_crash_ctl);
> > + if (hyperv_crash_ctl &
> HV_CRASH_CTL_CRASH_NOTIFY_MSG) {
>
> vmbus_drv.c is architecture independent code, and should not be
> referencing
> x86/x64 MSRs. Reading the MSR (and maybe the test as well?) should go
> in a separate function in an x86-specific source file.
>
I will move the code.
> And just to confirm, is this the right way to test for the feature? Usually,
> feature determination is based on one of the feature registers. The
> NOTIFY_MSG flag seems to have a dual meaning -- on read it indicates
> the feature is present. On write in hyperv_report_panic_msg(), it evidently
> means that the guest is sending a full page of data to Hyper-V.
>
As per my conversation with John, this seems to be correct and something
also he suggested. The host sets these bits depending on whether it supports
these features or not.
> > @@ -1081,6 +1178,11 @@ static int vmbus_bus_init(void)
> > bus_unregister(&hv_bus);
> > + free_page((unsigned long)hv_panic_page);
> > + if (!hv_ctl_table_hdr) {
>
> The above test is backwards. Remove the bang.
Good call, will do.
>
> > @@ -1785,10 +1887,18 @@ static void __exit vmbus_exit(void)
> > + free_page((unsigned long)hv_panic_page);
> > + if (!hv_ctl_table_hdr) {
>
> Same here. Test is backwards.
>
Will fix.
> Michael
Powered by blists - more mailing lists