HV: refine reset_vcpu api

The patch abstract a vcpu_reset_internal() api for internal usage, the
function would not touch any vcpu state transition and just do vcpu reset
processing. It will be called by create_vcpu() and reset_vcpu().

The reset_vcpu() will act as a public api and should be called
only when vcpu receive INIT or vm reset/resume from S3. It should not be
called when do shutdown_vm() or hcall_sos_offline_cpu(), so the patch remove
reset_vcpu() in shutdown_vm() and hcall_sos_offline_cpu().

The patch also introduced reset_mode enum so that vcpu and vlapic could do
different context operation according to different reset mode;

Tracked-On: #4267

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Victor Sun
2019-12-18 13:21:29 +08:00
committed by wenlingz
parent d1a46b8289
commit a5158e2c16
6 changed files with 47 additions and 47 deletions

View File

@@ -64,7 +64,6 @@ int32_t hcall_sos_offline_cpu(struct acrn_vm *vm, uint64_t lapicid)
break;
}
pause_vcpu(vcpu, VCPU_ZOMBIE);
reset_vcpu(vcpu);
offline_vcpu(vcpu);
}
}