Skip to contentSkip to conversation

Drivers: hv: Change flag to write log level in panic msg to false

PATCH Applied Joseph Salisbury 4 participants 6 messages Jun 26, 2020 – Jul 6, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Drivers: hv: Change flag to write log level in panic msg to false

When the kernel panics, one page of kmsg data may be collected and sent to Hyper-V to aid in diagnosing the failure. The collected kmsg data typically
contains 50 to 100 lines, each of which has a log level prefix that isn't
very useful from a diagnostic standpoint. So tell kmsg_dump_get_buffer() to not include the log level, enabling more information that *is* useful to fit in the page.

Requesting in stable kernels, since many kernels running in production are stable releases.

---
 drivers/hv/vmbus_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hv/vmbus_drv.c +1 -1
index 9147ee9d5f7d..d69f4efa3719 100644
@@ -1368,7 +1368,7 @@ static void hv_kmsg_dump(struct kmsg_dumper *dumper,
 	 * Write dump contents to the page. No need to synchronize; panic should
 	 * be single-threaded.
 	 */
-	kmsg_dump_get_buffer(dumper, true, hv_panic_page, HV_HYP_PAGE_SIZE,
+	kmsg_dump_get_buffer(dumper, false, hv_panic_page, HV_HYP_PAGE_SIZE,
 			     &bytes_written);
 	if (bytes_written)
 		hyperv_report_panic_msg(panic_pa, bytes_written);
Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw
Quoted 7 lines · Joseph Salisbury

When the kernel panics, one page of kmsg data may be collected and sent to Hyper-V to aid in diagnosing the failure. The collected kmsg data typically
contains 50 to 100 lines, each of which has a log level prefix that isn't
very useful from a diagnostic standpoint. So tell kmsg_dump_get_buffer() to not include the log level, enabling more information that *is* useful to fit in the page.

Quoted 5 lines

Requesting in stable kernels, since many kernels running in production are stable releases.

Applied to hyperv-fixes with Michael's review from v1. Thanks.

Quoted 20 lines
---
 drivers/hv/vmbus_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hv/vmbus_drv.c +1 -1
index 9147ee9d5f7d..d69f4efa3719 100644
@@ -1368,7 +1368,7 @@ static void hv_kmsg_dump(struct kmsg_dumper *dumper,
 	 * Write dump contents to the page. No need to synchronize; panic should
 	 * be single-threaded.
 	 */
-	kmsg_dump_get_buffer(dumper, true, hv_panic_page, HV_HYP_PAGE_SIZE,
+	kmsg_dump_get_buffer(dumper, false, hv_panic_page, HV_HYP_PAGE_SIZE,
 			     &bytes_written);
 	if (bytes_written)
 		hyperv_report_panic_msg(panic_pa, bytes_written);
Signature · 1 line
2.17.1
maintainer
#2 lore raw
In reply to Joseph Salisbury

Hi

[This is an automated email]

This commit has been processed because it contains a -stable tag. The stable tag indicates that it's relevant for the following trees: all

The bot has tested the following trees: v5.7.6, v5.4.49, v4.19.130, v4.14.186, v4.9.228, v4.4.228.

v5.7.6: Build OK!
v5.4.49: Failed to apply! Possible dependencies:
53edce00ceb74 ("Drivers: hv: vmbus: Remove dependencies on guest page size")

v4.19.130: Failed to apply! Possible dependencies:
53edce00ceb74 ("Drivers: hv: vmbus: Remove dependencies on guest page size")

v4.14.186: Failed to apply! Possible dependencies:
4a5f3cde4d51c ("Drivers: hv: vmbus: Remove x86-isms from arch independent drivers") 53edce00ceb74 ("Drivers: hv: vmbus: Remove dependencies on guest page size") 7ed4325a44ea5 ("Drivers: hv: vmbus: Make panic reporting to be more useful") 81b18bce48af3 ("Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic") 8afc06dd75c06 ("Drivers: hv: vmbus: Fix the issue with freeing up hv_ctl_table_hdr") ddcaf3ca4c3c8 ("Drivers: hv: vmus: Fix the check for return value from kmsg get dump buffer")

v4.9.228: Failed to apply! Possible dependencies:
4a5f3cde4d51c ("Drivers: hv: vmbus: Remove x86-isms from arch independent drivers") 6ab42a66d2cc1 ("Drivers: hv: vmbus: Move Hypercall invocation code out of common code") 73638cddaad86 ("Drivers: hv: vmbus: Move the check for hypercall page setup") 76d36ab798204 ("hv: switch to cpuhp state machine for synic init/cleanup") 81b18bce48af3 ("Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic") 8730046c1498e ("Drivers: hv vmbus: Move Hypercall page setup out of common code") d058fa7e98ff0 ("Drivers: hv: vmbus: Move the crash notification function")

v4.4.228: Failed to apply! Possible dependencies:
4a5f3cde4d51c ("Drivers: hv: vmbus: Remove x86-isms from arch independent drivers") 619848bd07434 ("drivers:hv: Export a function that maps Linux CPU num onto Hyper-V proc num") 6ab42a66d2cc1 ("Drivers: hv: vmbus: Move Hypercall invocation code out of common code") 73638cddaad86 ("Drivers: hv: vmbus: Move the check for hypercall page setup") 75ff3a8a9168d ("Drivers: hv: vmbus: avoid wait_for_completion() on crash") 76d36ab798204 ("hv: switch to cpuhp state machine for synic init/cleanup") 81b18bce48af3 ("Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic") 8730046c1498e ("Drivers: hv vmbus: Move Hypercall page setup out of common code") a108393dbf764 ("drivers:hv: Export the API to invoke a hypercall on Hyper-V") d058fa7e98ff0 ("Drivers: hv: vmbus: Move the crash notification function")

NOTE: The patch will not be queued to stable trees until it is upstream.

How should we proceed with this patch?

Signature · 2 lines
Thanks
Sasha
maintainer
#3 lore raw
Quoted 4 lines · Sasha Levin

Hi

[This is an automated email]

Quoted 8 lines

This commit has been processed because it contains a -stable tag. The stable tag indicates that it's relevant for the following trees: all

The bot has tested the following trees: v5.7.6, v5.4.49, v4.19.130, v4.14.186, v4.9.228, v4.4.228.

v5.7.6: Build OK!
v5.4.49: Failed to apply! Possible dependencies:
53edce00ceb74 ("Drivers: hv: vmbus: Remove dependencies on guest page size")

Unrelated, shouldn't be backported.

Quoted 4 lines

v4.19.130: Failed to apply! Possible dependencies:
53edce00ceb74 ("Drivers: hv: vmbus: Remove dependencies on guest page size")

Unrelated, shouldn't be backported.

Quoted 17 lines

v4.14.186: Failed to apply! Possible dependencies:
4a5f3cde4d51c ("Drivers: hv: vmbus: Remove x86-isms from arch independent drivers") 53edce00ceb74 ("Drivers: hv: vmbus: Remove dependencies on guest page size") 7ed4325a44ea5 ("Drivers: hv: vmbus: Make panic reporting to be more useful") 81b18bce48af3 ("Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic") 8afc06dd75c06 ("Drivers: hv: vmbus: Fix the issue with freeing up hv_ctl_table_hdr") ddcaf3ca4c3c8 ("Drivers: hv: vmus: Fix the check for return value from kmsg get dump buffer")

v4.9.228: Failed to apply! Possible dependencies:
4a5f3cde4d51c ("Drivers: hv: vmbus: Remove x86-isms from arch independent drivers") 6ab42a66d2cc1 ("Drivers: hv: vmbus: Move Hypercall invocation code out of common code") 73638cddaad86 ("Drivers: hv: vmbus: Move the check for hypercall page setup") 76d36ab798204 ("hv: switch to cpuhp state machine for synic init/cleanup") 81b18bce48af3 ("Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic") 8730046c1498e ("Drivers: hv vmbus: Move Hypercall page setup out of common code") d058fa7e98ff0 ("Drivers: hv: vmbus: Move the crash notification function")

Quoted 11 lines

v4.4.228: Failed to apply! Possible dependencies:
4a5f3cde4d51c ("Drivers: hv: vmbus: Remove x86-isms from arch independent drivers") 619848bd07434 ("drivers:hv: Export a function that maps Linux CPU num onto Hyper-V proc num") 6ab42a66d2cc1 ("Drivers: hv: vmbus: Move Hypercall invocation code out of common code") 73638cddaad86 ("Drivers: hv: vmbus: Move the check for hypercall page setup") 75ff3a8a9168d ("Drivers: hv: vmbus: avoid wait_for_completion() on crash") 76d36ab798204 ("hv: switch to cpuhp state machine for synic init/cleanup") 81b18bce48af3 ("Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic") 8730046c1498e ("Drivers: hv vmbus: Move Hypercall page setup out of common code") a108393dbf764 ("drivers:hv: Export the API to invoke a hypercall on Hyper-V") d058fa7e98ff0 ("Drivers: hv: vmbus: Move the crash notification function")

Just from reading the subject lines it seems to me a lot of the possible dependencies aren't really related to this patch functionally. It could be that they are touching the same area of code which create some contextual dependencies. Some of the listed dependencies should definitively _not_ be backported.

Michael and Joseph, how far do you want this to be backported? It may be easier for us to provide bespoke versions of this patch to the stable trees we care about?

Wei.

Quoted 8 lines

NOTE: The patch will not be queued to stable trees until it is upstream.

How should we proceed with this patch?

Signature · 2 lines
Thanks
Sasha
maintainer
#4 lore raw

Forgot to CC Michael.

Quoted 72 lines · Wei Liu
Quoted 4 lines · Sasha Levin

Hi

[This is an automated email]

Quoted 8 lines

This commit has been processed because it contains a -stable tag. The stable tag indicates that it's relevant for the following trees: all

The bot has tested the following trees: v5.7.6, v5.4.49, v4.19.130, v4.14.186, v4.9.228, v4.4.228.

v5.7.6: Build OK!
v5.4.49: Failed to apply! Possible dependencies:
53edce00ceb74 ("Drivers: hv: vmbus: Remove dependencies on guest page size")

Unrelated, shouldn't be backported.

Quoted 4 lines

v4.19.130: Failed to apply! Possible dependencies:
53edce00ceb74 ("Drivers: hv: vmbus: Remove dependencies on guest page size")

Unrelated, shouldn't be backported.

Quoted 17 lines

v4.14.186: Failed to apply! Possible dependencies:
4a5f3cde4d51c ("Drivers: hv: vmbus: Remove x86-isms from arch independent drivers") 53edce00ceb74 ("Drivers: hv: vmbus: Remove dependencies on guest page size") 7ed4325a44ea5 ("Drivers: hv: vmbus: Make panic reporting to be more useful") 81b18bce48af3 ("Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic") 8afc06dd75c06 ("Drivers: hv: vmbus: Fix the issue with freeing up hv_ctl_table_hdr") ddcaf3ca4c3c8 ("Drivers: hv: vmus: Fix the check for return value from kmsg get dump buffer")

v4.9.228: Failed to apply! Possible dependencies:
4a5f3cde4d51c ("Drivers: hv: vmbus: Remove x86-isms from arch independent drivers") 6ab42a66d2cc1 ("Drivers: hv: vmbus: Move Hypercall invocation code out of common code") 73638cddaad86 ("Drivers: hv: vmbus: Move the check for hypercall page setup") 76d36ab798204 ("hv: switch to cpuhp state machine for synic init/cleanup") 81b18bce48af3 ("Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic") 8730046c1498e ("Drivers: hv vmbus: Move Hypercall page setup out of common code") d058fa7e98ff0 ("Drivers: hv: vmbus: Move the crash notification function")

Quoted 11 lines

v4.4.228: Failed to apply! Possible dependencies:
4a5f3cde4d51c ("Drivers: hv: vmbus: Remove x86-isms from arch independent drivers") 619848bd07434 ("drivers:hv: Export a function that maps Linux CPU num onto Hyper-V proc num") 6ab42a66d2cc1 ("Drivers: hv: vmbus: Move Hypercall invocation code out of common code") 73638cddaad86 ("Drivers: hv: vmbus: Move the check for hypercall page setup") 75ff3a8a9168d ("Drivers: hv: vmbus: avoid wait_for_completion() on crash") 76d36ab798204 ("hv: switch to cpuhp state machine for synic init/cleanup") 81b18bce48af3 ("Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic") 8730046c1498e ("Drivers: hv vmbus: Move Hypercall page setup out of common code") a108393dbf764 ("drivers:hv: Export the API to invoke a hypercall on Hyper-V") d058fa7e98ff0 ("Drivers: hv: vmbus: Move the crash notification function")

Just from reading the subject lines it seems to me a lot of the possible dependencies aren't really related to this patch functionally. It could be that they are touching the same area of code which create some contextual dependencies. Some of the listed dependencies should definitively _not_ be backported.

Michael and Joseph, how far do you want this to be backported? It may be easier for us to provide bespoke versions of this patch to the stable trees we care about?

Wei.

Quoted 8 lines

NOTE: The patch will not be queued to stable trees until it is upstream.

How should we proceed with this patch?

Signature · 2 lines
Thanks
Sasha
#5 lore raw
In reply to Wei Liu

From: Wei Liu <[email protected]> Sent: Monday, July 6, 2020 3:56 AM

Quoted 67 lines · Sasha Levin
Quoted 8 lines

Hi

[This is an automated email]

This commit has been processed because it contains a -stable tag. The stable tag indicates that it's relevant for the following trees: all

The bot has tested the following trees: v5.7.6, v5.4.49, v4.19.130, v4.14.186, v4.9.228,

v4.4.228.

Quoted 4 lines

v5.7.6: Build OK!
v5.4.49: Failed to apply! Possible dependencies:
53edce00ceb74 ("Drivers: hv: vmbus: Remove dependencies on guest page size")

Unrelated, shouldn't be backported.

Quoted 4 lines

v4.19.130: Failed to apply! Possible dependencies:
53edce00ceb74 ("Drivers: hv: vmbus: Remove dependencies on guest page size")

Unrelated, shouldn't be backported.

Quoted 5 lines

v4.14.186: Failed to apply! Possible dependencies:
4a5f3cde4d51c ("Drivers: hv: vmbus: Remove x86-isms from arch independent drivers") 53edce00ceb74 ("Drivers: hv: vmbus: Remove dependencies on guest page size") 7ed4325a44ea5 ("Drivers: hv: vmbus: Make panic reporting to be more useful") 81b18bce48af3 ("Drivers: HV: Send one page worth of kmsg dump over Hyper-V during

panic")

Quoted 2 lines

8afc06dd75c06 ("Drivers: hv: vmbus: Fix the issue with freeing up hv_ctl_table_hdr") ddcaf3ca4c3c8 ("Drivers: hv: vmus: Fix the check for return value from kmsg get dump

buffer")

Quoted 4 lines

v4.9.228: Failed to apply! Possible dependencies:
4a5f3cde4d51c ("Drivers: hv: vmbus: Remove x86-isms from arch independent drivers") 6ab42a66d2cc1 ("Drivers: hv: vmbus: Move Hypercall invocation code out of common

code")

Quoted 3 lines

73638cddaad86 ("Drivers: hv: vmbus: Move the check for hypercall page setup") 76d36ab798204 ("hv: switch to cpuhp state machine for synic init/cleanup") 81b18bce48af3 ("Drivers: HV: Send one page worth of kmsg dump over Hyper-V during

panic")

Quoted 6 lines

8730046c1498e ("Drivers: hv vmbus: Move Hypercall page setup out of common code") d058fa7e98ff0 ("Drivers: hv: vmbus: Move the crash notification function")

v4.4.228: Failed to apply! Possible dependencies:
4a5f3cde4d51c ("Drivers: hv: vmbus: Remove x86-isms from arch independent drivers") 619848bd07434 ("drivers:hv: Export a function that maps Linux CPU num onto Hyper-V

proc num")

Quoted 1 line

6ab42a66d2cc1 ("Drivers: hv: vmbus: Move Hypercall invocation code out of common

code")

Quoted 4 lines

73638cddaad86 ("Drivers: hv: vmbus: Move the check for hypercall page setup") 75ff3a8a9168d ("Drivers: hv: vmbus: avoid wait_for_completion() on crash") 76d36ab798204 ("hv: switch to cpuhp state machine for synic init/cleanup") 81b18bce48af3 ("Drivers: HV: Send one page worth of kmsg dump over Hyper-V during

panic")

Quoted 3 lines

8730046c1498e ("Drivers: hv vmbus: Move Hypercall page setup out of common code") a108393dbf764 ("drivers:hv: Export the API to invoke a hypercall on Hyper-V") d058fa7e98ff0 ("Drivers: hv: vmbus: Move the crash notification function")

Just from reading the subject lines it seems to me a lot of the possible dependencies aren't really related to this patch functionally. It could be that they are touching the same area of code which create some contextual dependencies. Some of the listed dependencies should definitively _not_ be backported.

Quoted 4 lines

Michael and Joseph, how far do you want this to be backported? It may be easier for us to provide bespoke versions of this patch to the stable trees we care about?

The code being changed was added in 4.19, so that's the earliest kernel version to which it makes sense to backport. 53edce00ceb74 is an unrelated change to the same line of code (changes PAGE_SIZE to HV_HYP_PAGE_SIZE), so a bespoke version of this patch is needed for the stable trees. All-in-all, this patch is a modest optimization, so backporting is nice but not required.

Michael