Revert "hv: add function to return to VM0"

This reverts commit caa4f2a3b0.
This commit is contained in:
lijinxia 2018-06-27 14:20:24 +08:00
parent 9b9f5c4612
commit 86f6ccd065
3 changed files with 0 additions and 36 deletions

View File

@ -285,28 +285,6 @@ void resume_vm(struct vm *vm)
vm->state = VM_STARTED;
}
/* Resume vm from S3 state
*
* To resume vm after guest enter S3 state:
* - reset BSP
* - BSP will be put to real mode with entry set as wakeup_vec
* - init_vmcs BSP. We could call init_vmcs here because we know current
* pcpu is mapped to BSP of vm.
*/
void resume_vm_from_s3(struct vm *vm, uint32_t wakeup_vec)
{
struct vcpu *bsp = vcpu_from_vid(vm, 0);
vm->state = VM_STARTED;
reset_vcpu(bsp);
bsp->entry_addr = (void *)(uint64_t)wakeup_vec;
bsp->arch_vcpu.cpu_mode = CPU_MODE_REAL;
init_vmcs(bsp);
schedule_vcpu(bsp);
}
/* Create vm/vcpu for vm0 */
int prepare_vm0(void)
{

View File

@ -72,7 +72,6 @@ int enter_s3(struct vm *vm, uint32_t pm1a_cnt_val,
{
uint32_t pcpu_id;
uint64_t pmain_entry_saved;
uint32_t guest_wakeup_vec32;
uint64_t *pmain_entry;
if (vm->pm.sx_state_data == NULL) {
@ -84,15 +83,6 @@ int enter_s3(struct vm *vm, uint32_t pm1a_cnt_val,
pcpu_id = get_cpu_id();
/* Save the wakeup vec set by guest. Will return to guest
* with this wakeup vec as entry.
*/
guest_wakeup_vec32 = *vm->pm.sx_state_data->wake_vector_32;
/* set ACRN wakeup vec instead */
*vm->pm.sx_state_data->wake_vector_32 =
(uint32_t) trampoline_start16_paddr;
/* offline all APs */
stop_cpus();
@ -138,8 +128,5 @@ int enter_s3(struct vm *vm, uint32_t pm1a_cnt_val,
/* online all APs again */
start_cpus();
/* jump back to vm */
resume_vm_from_s3(vm, guest_wakeup_vec32);
return 0;
}

View File

@ -172,7 +172,6 @@ struct vm_description {
int shutdown_vm(struct vm *vm);
void pause_vm(struct vm *vm);
void resume_vm(struct vm *vm);
void resume_vm_from_s3(struct vm *vm, uint32_t wakeup_vec);
int start_vm(struct vm *vm);
int create_vm(struct vm_description *vm_desc, struct vm **vm);
int prepare_vm0(void);