Drivers: hv: move panic report code from vmbus to hv early init code
Subsystems (3)
PATCH v2 1/1 Drivers: hv: move panic report code from vmbus to hv early init code
From: Long Li <[email protected]>
The panic reporting code was added in commit 81b18bce48af ("Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic")
It was added to the vmbus driver. The panic reporting has no dependence on vmbus, and can be enabled at an earlier boot time when Hyper-V is initialized.
This patch moves the panic reporting code out of vmbus. There is no functionality changes. During moving, also refactored some cleanup functions into hv_kmsg_dump_unregister(), and removed unused function hv_alloc_hyperv_page().
---
Change log v2:
1. Check on hv_is_isolation_supported() before reporting crash dump
2. Remove hyperv_report_reg(), inline the check condition instead
3. Remove the test NULL on hv_panic_page when freeing it
drivers/hv/hv.c | 36 ------ drivers/hv/hv_common.c | 229 +++++++++++++++++++++++++++++++++ drivers/hv/vmbus_drv.c | 199 ---------------------------- include/asm-generic/mshyperv.h | 1 - 4 files changed, 229 insertions(+), 236 deletions(-)
drivers/hv/hv.c +0 -36
@@ -38,42 +38,6 @@ int hv_init(void)return 0 ; } -/* -* Functions for allocating and freeing memory with size and -* alignment HV_HYP_PAGE_SIZE. These functions are needed because -* the guest page size may not be the same as the Hyper-V page -* size. We depend upon kmalloc() aligning power-of-two size -* allocations to the allocation size boundary, so that the -* allocated memory appears to Hyper-V as a page of the size -* it expects. -*/ - -void *hv_alloc_hyperv_page (void ) -{ -BUILD_BUG_ON (PAGE_SIZE <HV_HYP_PAGE_SIZE ); - -if (PAGE_SIZE ==HV_HYP_PAGE_SIZE ) -return (void *)__get_free_page (GFP_KERNEL ); -else -return kmalloc (HV_HYP_PAGE_SIZE ,GFP_KERNEL ); -} - -void *hv_alloc_hyperv_zeroed_page (void ) -{ -if (PAGE_SIZE ==HV_HYP_PAGE_SIZE ) -return (void *)__get_free_page (GFP_KERNEL | __GFP_ZERO); -else -return kzalloc (HV_HYP_PAGE_SIZE ,GFP_KERNEL ); -} - -void hv_free_hyperv_page (unsigned long addr) -{ -if (PAGE_SIZE ==HV_HYP_PAGE_SIZE ) -free_page (addr); -else -kfree ((void *)addr); -} -/* * hv_post_message - Post a message using the hypervisor message IPC. *
drivers/hv/hv_common.c +229 -0
267 lines not on this page · raw message
drivers/hv/vmbus_drv.c +0 -199
253 lines not on this page · raw message
include/asm-generic/mshyperv.h +0 -1
@@ -186,7 +186,6 @@ void __init hv_common_free(void);int hv_common_cpu_init (unsigned int cpu);int hv_common_cpu_die (unsigned int cpu); -void *hv_alloc_hyperv_page (void );void *hv_alloc_hyperv_zeroed_page (void );void hv_free_hyperv_page (unsigned long addr);
Signature · 1 line
2.32.0
From: [email protected] <[email protected]> Sent: Thursday, April 13, 2023 6:27 PM
Quoted 21 lines
The panic reporting code was added in commit
81b18bce48af("Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic")It was added to the vmbus driver. The panic reporting has no dependence on vmbus, and can be enabled at an earlier boot time when Hyper-V is initialized.
This patch moves the panic reporting code out of vmbus. There is no functionality changes. During moving, also refactored some cleanup functions into
hv_kmsg_dump_unregister(), and removed unused functionhv_alloc_hyperv_page().Signed-off-by Long Li <[email protected]>---
Change log v2:
1. Check onhv_is_isolation_supported()before reporting crash dump
2. Removehyperv_report_reg(), inline the check condition instead
3. Remove the test NULL onhv_panic_pagewhen freeing it
Quoted 5 lines
drivers/hv/hv.c | 36 ------ drivers/hv/hv_common.c | 229 +++++++++++++++++++++++++++++++++ drivers/hv/vmbus_drv.c | 199 ---------------------------- include/asm-generic/mshyperv.h | 1 - 4 files changed, 229 insertions(+), 236 deletions(-)
Quoted 22 lines · Michael Kelley (LINUX)
From: [email protected] <[email protected]> Sent: Thursday, April 13, 2023 6:27 PM
Quoted 21 lines
The panic reporting code was added in commit
81b18bce48af("Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic")It was added to the vmbus driver. The panic reporting has no dependence on vmbus, and can be enabled at an earlier boot time when Hyper-V is initialized.
This patch moves the panic reporting code out of vmbus. There is no functionality changes. During moving, also refactored some cleanup functions into
hv_kmsg_dump_unregister(), and removed unused functionhv_alloc_hyperv_page().Signed-off-by Long Li <[email protected]>---
Change log v2:
1. Check onhv_is_isolation_supported()before reporting crash dump
2. Removehyperv_report_reg(), inline the check condition instead
3. Remove the test NULL onhv_panic_pagewhen freeing it
Quoted 7 lines
Quoted 5 lines
drivers/hv/hv.c | 36 ------ drivers/hv/hv_common.c | 229 +++++++++++++++++++++++++++++++++ drivers/hv/vmbus_drv.c | 199 ---------------------------- include/asm-generic/mshyperv.h | 1 - 4 files changed, 229 insertions(+), 236 deletions(-)Reviewed-by Michael Kelley <[email protected]>
Applied to hyperv-next. Thanks.
Wei Liu
maintainerQuoted 29 lines · Wei Liu
Quoted 28 lines · Michael Kelley (LINUX)
From: [email protected] <[email protected]> Sent: Thursday, April 13, 2023 6:27 PM
Quoted 26 lines
The panic reporting code was added in commit
81b18bce48af("Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic")It was added to the vmbus driver. The panic reporting has no dependence on vmbus, and can be enabled at an earlier boot time when Hyper-V is initialized.
This patch moves the panic reporting code out of vmbus. There is no functionality changes. During moving, also refactored some cleanup functions into
hv_kmsg_dump_unregister(), and removed unused functionhv_alloc_hyperv_page().Signed-off-by Long Li <[email protected]>---
Change log v2:
1. Check onhv_is_isolation_supported()before reporting crash dump
2. Removehyperv_report_reg(), inline the check condition instead
3. Remove the test NULL onhv_panic_pagewhen freeing itdrivers/hv/hv.c | 36 ------ drivers/hv/hv_common.c | 229 +++++++++++++++++++++++++++++++++ drivers/hv/vmbus_drv.c | 199 ---------------------------- include/asm-generic/mshyperv.h | 1 - 4 files changed, 229 insertions(+), 236 deletions(-)
Quoted 3 lines
Quoted 1 line
Reviewed-by Michael Kelley <[email protected]>Applied to hyperv-next. Thanks.
This broke allmodconfig. I've removed it from the tree. Please fix and resend.
Thanks,
Wei.
Quoted 36 lines
Subject: Re: [PATCH v2] Drivers: hv: move panic report code from vmbus to hv early init code
Quoted 20 lines · Wei Liu
Quoted 19 lines · Michael Kelley (LINUX)
From: [email protected] <[email protected]> Sent:
Thursday, April 13, 2023 6:27 PMQuoted 17 lines
The panic reporting code was added in commit
81b18bce48af("Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic")It was added to the vmbus driver. The panic reporting has no dependence on vmbus, and can be enabled at an earlier boot time when Hyper-V is initialized.
This patch moves the panic reporting code out of vmbus. There is no functionality changes. During moving, also refactored some cleanup functions into
hv_kmsg_dump_unregister(), and removed unused functionhv_alloc_hyperv_page().Signed-off-by Long Li <[email protected]>---
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Change log v2:
1. Check onhv_is_isolation_supported()before reporting crash dump 2. Removehyperv_report_reg(), inline the check condition instead 3. Remove the test NULL onhv_panic_pagewhen freeing itdrivers/hv/hv.c | 36 ------ drivers/hv/hv_common.c | 229+++++++++++++++++++++++++++++++++
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
drivers/hv/vmbus_drv.c | 199 ---------------------------- include/asm-generic/mshyperv.h | 1 - 4 files changed, 229 insertions(+), 236 deletions(-)
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Reviewed-by Michael Kelley <[email protected]>Applied to hyperv-next. Thanks.
This broke allmodconfig. I've removed it from the tree. Please fix and resend.
Thanks,
Wei.
I'm rebasing the patch to latest hyper-v branch, and send v3.
Thanks,
Long