diff options
author | Long Li <longli@microsoft.com> | 2023-04-21 00:49:06 +0200 |
---|---|---|
committer | Wei Liu <wei.liu@kernel.org> | 2023-04-21 01:00:37 +0200 |
commit | 9c318a1d9b5000c77527011f158a75c5483510f5 (patch) | |
tree | 705d70234bb6d01703088275df461b0c742de133 /drivers/hv/hv.c | |
parent | x86/hyperv: VTL support for Hyper-V (diff) | |
download | linux-9c318a1d9b5000c77527011f158a75c5483510f5.tar.xz linux-9c318a1d9b5000c77527011f158a75c5483510f5.zip |
Drivers: hv: move panic report code from vmbus to hv early init code
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().
Signed-off-by: Long Li <longli@microsoft.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/1682030946-6372-1-git-send-email-longli@linuxonhyperv.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Diffstat (limited to 'drivers/hv/hv.c')
-rw-r--r-- | drivers/hv/hv.c | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c index 4e1407d59ba0..de6708dbe0df 100644 --- a/drivers/hv/hv.c +++ b/drivers/hv/hv.c @@ -39,42 +39,6 @@ int hv_init(void) } /* - * 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. * * This involves a hypercall. |