hv: make init_vmcs as a event of VCPU

After changing init_vmcs to smp call approach and do it before
launch_vcpu, it could work with noop scheduler. On real sharing
scheudler, it has problem.

   pcpu0                  pcpu1            pcpu1
 vmBvcpu0                vmAvcpu1         vmBvcpu1
                         vmentry
init_vmcs(vmBvcpu1) vmexit->do_init_vmcs
                    corrupt current vmcs
                        vmentry fail
launch_vcpu(vmBvcpu1)

This patch mark a event flag when request vmcs init for specific vcpu. When
it is running and checking pending events, will do init_vmcs firstly.

Tracked-On: #4178
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Shuo A Liu
2019-10-28 12:03:21 +08:00
committed by wenlingz
parent 15da33d8af
commit 3cb32bb6e3
6 changed files with 19 additions and 20 deletions

View File

@@ -86,6 +86,11 @@
*/
#define ACRN_REQUEST_VPID_FLUSH 7U
/**
* @brief Request for initilizing VMCS
*/
#define ACRN_REQUEST_INIT_VMCS 8U
/**
* @}
*/