[PATCH v1] x86/hyperv: Move hv crash init after hypercall pg setup

Mukesh R posted 1 patch 3 days, 13 hours ago
arch/x86/hyperv/hv_init.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
[PATCH v1] x86/hyperv: Move hv crash init after hypercall pg setup
Posted by Mukesh R 3 days, 13 hours ago
hv_root_crash_init() is not setting up the hypervisor crash collection
for baremetal cases because when it's called, hypervisor page is not
setup. This got missed due to internal mirror falling behind.

Fix is simple, just move the crash init call after the hypercall
page setup.

Signed-off-by: Mukesh Rathor <mrathor@linux.microsoft.com>
---
 arch/x86/hyperv/hv_init.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
index 14de43f4bc6c..7f3301bd081e 100644
--- a/arch/x86/hyperv/hv_init.c
+++ b/arch/x86/hyperv/hv_init.c
@@ -558,7 +558,6 @@ void __init hyperv_init(void)
 		memunmap(src);
 
 		hv_remap_tsc_clocksource();
-		hv_root_crash_init();
 		hv_sleep_notifiers_register();
 	} else {
 		hypercall_msr.guest_physical_address = vmalloc_to_pfn(hv_hypercall_pg);
@@ -567,6 +566,9 @@ void __init hyperv_init(void)
 
 	hv_set_hypercall_pg(hv_hypercall_pg);
 
+	if (hv_root_partition())        /* after set hypercall pg */
+		hv_root_crash_init();
+
 skip_hypercall_pg_init:
 	/*
 	 * hyperv_init() is called before LAPIC is initialized: see
-- 
2.51.2.vfs.0.1
Re: [PATCH v1] x86/hyperv: Move hv crash init after hypercall pg setup
Posted by Wei Liu 3 days, 8 hours ago
On Tue, Feb 03, 2026 at 05:58:00PM -0800, Mukesh R wrote:
> hv_root_crash_init() is not setting up the hypervisor crash collection
> for baremetal cases because when it's called, hypervisor page is not
> setup.

> This got missed due to internal mirror falling behind.

This doesn't provide useful information for our future selves.

> 
> Fix is simple, just move the crash init call after the hypercall
> page setup.
> 
> Signed-off-by: Mukesh Rathor <mrathor@linux.microsoft.com>

Applied.

Wei

> ---
>  arch/x86/hyperv/hv_init.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
> index 14de43f4bc6c..7f3301bd081e 100644
> --- a/arch/x86/hyperv/hv_init.c
> +++ b/arch/x86/hyperv/hv_init.c
> @@ -558,7 +558,6 @@ void __init hyperv_init(void)
>  		memunmap(src);
>  
>  		hv_remap_tsc_clocksource();
> -		hv_root_crash_init();
>  		hv_sleep_notifiers_register();
>  	} else {
>  		hypercall_msr.guest_physical_address = vmalloc_to_pfn(hv_hypercall_pg);
> @@ -567,6 +566,9 @@ void __init hyperv_init(void)
>  
>  	hv_set_hypercall_pg(hv_hypercall_pg);
>  
> +	if (hv_root_partition())        /* after set hypercall pg */
> +		hv_root_crash_init();
> +
>  skip_hypercall_pg_init:
>  	/*
>  	 * hyperv_init() is called before LAPIC is initialized: see
> -- 
> 2.51.2.vfs.0.1
>