File tree Expand file tree Collapse file tree 2 files changed +24
-8
lines changed Expand file tree Collapse file tree 2 files changed +24
-8
lines changed Original file line number Diff line number Diff line change @@ -367,6 +367,7 @@ static void get_cpu_name(void)
367
367
368
368
void bsp_boot_init (void )
369
369
{
370
+ int ret ;
370
371
uint64_t start_tsc = rdtsc ();
371
372
372
373
/* Clear BSS */
@@ -541,14 +542,17 @@ void bsp_boot_init(void)
541
542
console_setup_timer ();
542
543
543
544
/* Start initializing the VM for this CPU */
544
- hv_main (CPU_BOOT_ID );
545
+ ret = hv_main (CPU_BOOT_ID );
546
+ if (ret != 0 )
547
+ panic ("failed to start VM for bsp\n" );
545
548
546
549
/* Control should not come here */
547
550
cpu_dead (CPU_BOOT_ID );
548
551
}
549
552
550
553
void cpu_secondary_init (void )
551
554
{
555
+ int ret ;
552
556
/* NOTE: Use of local / stack variables in this function is problematic
553
557
* since the stack is switched in the middle of the function. For this
554
558
* reason, the logical id is only temporarily stored in a static
@@ -605,7 +609,9 @@ void cpu_secondary_init(void)
605
609
/* Wait for boot processor to signal all secondary cores to continue */
606
610
pcpu_sync_sleep (& pcpu_sync , 0 );
607
611
608
- hv_main (get_cpu_id ());
612
+ ret = hv_main (get_cpu_id ());
613
+ if (ret != 0 )
614
+ panic ("hv_main ret = %d\n" , ret );
609
615
610
616
/* Control will only come here for secondary CPUs not configured for
611
617
* use or if an error occurs in hv_main
Original file line number Diff line number Diff line change @@ -138,18 +138,28 @@ static bool is_vm0_bsp(int pcpu_id)
138
138
139
139
int hv_main (int cpu_id )
140
140
{
141
- int ret = 0 ;
141
+ int ret ;
142
142
143
143
pr_info ("%s, Starting common entry point for CPU %d" ,
144
144
__func__ , cpu_id );
145
- ASSERT (cpu_id < phy_cpu_num , "cpu_id out of range" );
146
145
147
- ASSERT ((uint64_t ) cpu_id == get_cpu_id (),
148
- "cpu_id/tsc_aux mismatch" );
146
+ if (cpu_id >= phy_cpu_num ) {
147
+ pr_err ("%s, cpu_id %d out of range %d\n" ,
148
+ __func__ , cpu_id , phy_cpu_num );
149
+ return - EINVAL ;
150
+ }
151
+
152
+ if ((uint32_t ) cpu_id != get_cpu_id ()) {
153
+ pr_err ("%s, cpu_id %d mismatch\n" , __func__ , cpu_id );
154
+ return - EINVAL ;
155
+ }
149
156
150
157
/* Enable virtualization extensions */
151
158
ret = exec_vmxon_instr ();
152
- ASSERT (ret == 0 , "Unable to enable VMX!" );
159
+ if (ret != 0 ) {
160
+ pr_err ("%s, Unable to enable VMX!\n" , __func__ );
161
+ return ret ;
162
+ }
153
163
154
164
/* X2APIC mode is disabled by default. */
155
165
x2apic_enabled = false;
@@ -159,7 +169,7 @@ int hv_main(int cpu_id)
159
169
160
170
default_idle ();
161
171
162
- return ret ;
172
+ return 0 ;
163
173
}
164
174
165
175
int get_vmexit_profile (char * str , int str_max )
You can’t perform that action at this time.
0 commit comments