Skip to content

Commit afa4d09

Browse files
author
Vineeth Remanan Pillai
committed
arm64: hyperv: Do not call hyperv_init if not on Hyper-V
Kernel doesn't boot on baremetal as we try to initialize Hyper-V related fields. So, call hyperv_init only if we are running as a Hyper-V guest Signed-off-by: Vineeth Remanan Pillai <[email protected]> Reported-by: Praveen Paladugu <[email protected]> Tested-by: Praveen Paladugu <[email protected]>
1 parent dbcb218 commit afa4d09

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

arch/arm64/hyperv/mshyperv.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ static int __init hyperv_init(void)
8989
{
9090
int i;
9191

92+
/*
93+
* Return if not running as a Hyper-V guest.
94+
*/
95+
if (!hyperv_initialized)
96+
return 0;
97+
9298
/* Allocate and initialize percpu VP index array */
9399
hv_max_vp_index = num_possible_cpus();
94100
hv_vp_index = kmalloc_array(hv_max_vp_index, sizeof(*hv_vp_index),

0 commit comments

Comments
 (0)