File tree Expand file tree Collapse file tree 5 files changed +11
-57
lines changed Expand file tree Collapse file tree 5 files changed +11
-57
lines changed Original file line number Diff line number Diff line change @@ -546,10 +546,11 @@ static void bsp_boot_post(void)
546
546
547
547
console_setup_timer ();
548
548
549
- /* Start initializing the VM for this CPU */
550
- if (hv_main (BOOT_CPU_ID ) != 0 ) {
551
- panic ("failed to start VM for bsp\n" );
552
- }
549
+ exec_vmxon_instr (BOOT_CPU_ID );
550
+
551
+ prepare_vm0 ();
552
+
553
+ default_idle ();
553
554
554
555
/* Control should not come here */
555
556
cpu_dead (BOOT_CPU_ID );
@@ -621,13 +622,12 @@ static void cpu_secondary_post(void)
621
622
/* Wait for boot processor to signal all secondary cores to continue */
622
623
pcpu_sync_sleep (& pcpu_sync , 0UL );
623
624
624
- ret = hv_main (get_cpu_id ());
625
- if (ret != 0 ) {
626
- panic ("hv_main ret = %d\n" , ret );
627
- }
625
+ exec_vmxon_instr (get_cpu_id ());
626
+
627
+ default_idle ();
628
628
629
- /* Control will only come here for secondary CPUs not configured for
630
- * use or if an error occurs in hv_main
629
+ /* Control will only come here for secondary
630
+ * CPUs not configured for use.
631
631
*/
632
632
cpu_dead (get_cpu_id ());
633
633
}
Original file line number Diff line number Diff line change @@ -393,7 +393,7 @@ external_interrupt_save_frame:
393
393
394
394
/*
395
395
* We disable softirq path from interrupt IRET, since right now all IRQ
396
- * are for Guest, and we can execute softirq in hv_main() loop
396
+ * are for Guest.
397
397
*/
398
398
399
399
popq %rax
Original file line number Diff line number Diff line change @@ -107,48 +107,6 @@ void vcpu_thread(struct vcpu *vcpu)
107
107
} while (1 );
108
108
}
109
109
110
- static bool is_vm0_bsp (uint16_t pcpu_id )
111
- {
112
- #ifdef CONFIG_VM0_DESC
113
- return pcpu_id == vm0_desc .vm_pcpu_ids [0 ];
114
- #else
115
- return pcpu_id == BOOT_CPU_ID ;
116
- #endif
117
- }
118
-
119
- int32_t hv_main (uint16_t pcpu_id )
120
- {
121
- int32_t ret ;
122
-
123
- pr_info ("%s, Starting common entry point for CPU %hu" ,
124
- __func__ , pcpu_id );
125
-
126
- if (pcpu_id != get_cpu_id ()) {
127
- pr_err ("%s, cpu_id %hu mismatch\n" , __func__ , pcpu_id );
128
- return - EINVAL ;
129
- }
130
-
131
- /* Enable virtualization extensions */
132
- ret = exec_vmxon_instr (pcpu_id );
133
- if (ret != 0 ) {
134
- return ret ;
135
- }
136
-
137
- /* X2APIC mode is disabled by default. */
138
- x2apic_enabled = false;
139
-
140
- if (is_vm0_bsp (pcpu_id )) {
141
- ret = prepare_vm0 ();
142
- if (ret != 0 ) {
143
- return ret ;
144
- }
145
- }
146
-
147
- default_idle ();
148
-
149
- return 0 ;
150
- }
151
-
152
110
#ifdef HV_DEBUG
153
111
void get_vmexit_profile (char * str_arg , int str_max )
154
112
{
Original file line number Diff line number Diff line change @@ -161,9 +161,6 @@ int32_t hcall_create_vm(struct vm *vm, uint64_t param)
161
161
{
162
162
int32_t ret = 0 ;
163
163
struct vm * target_vm = NULL ;
164
- /* VM are created from hv_main() directly
165
- * Here we just return the vmid for DM
166
- */
167
164
struct acrn_create_vm cv ;
168
165
struct vm_description vm_desc ;
169
166
Original file line number Diff line number Diff line change @@ -261,7 +261,6 @@ extern struct cpuinfo_x86 boot_cpu_data;
261
261
/* Function prototypes */
262
262
void cpu_dead (uint16_t pcpu_id );
263
263
void trampoline_start16 (void );
264
- int32_t hv_main (uint16_t cpu_id );
265
264
bool is_vapic_supported (void );
266
265
bool is_vapic_intr_delivery_supported (void );
267
266
bool is_vapic_virt_reg_supported (void );
You can’t perform that action at this time.
0 commit comments