[PATCH V1 3/6] HV: re-enable #AC for splitlock at every VM-Exit #ac


Tao, Yuhong
 

Once Splitlock Access happens in HV, alignment check exception handler
will disable splitlock detection, that allows HV go on running. We can
re-enabled it at every VM-Exit, to make sure #AC for splitlock is always
enabled under VMX root mode.

Because Splitlock Access would barely happen at HV, and TEST_CTL is for
per core(Detect simultaneously on logical thread is not guaranteed).Just
report the 1st splitlock during each VM-EXIT, waiting it to be fixed, and
repeat this iteration.

Tracked-On: #4496
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
---
hypervisor/arch/x86/guest/vcpu.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/hypervisor/arch/x86/guest/vcpu.c b/hypervisor/arch/x86/guest/vcpu.c
index aee87f1..7c93ea5 100644
--- a/hypervisor/arch/x86/guest/vcpu.c
+++ b/hypervisor/arch/x86/guest/vcpu.c
@@ -571,6 +571,10 @@ int32_t run_vcpu(struct acrn_vcpu *vcpu)
/* Launch the VM */
status = vmx_vmrun(ctx, VM_LAUNCH, ibrs_type);

+ if (has_ac_for_splitlock() == true) {
+ enable_ac_for_splitlock();
+ }
+
/* See if VM launched successfully */
if (status == 0) {
if (is_vcpu_bsp(vcpu)) {
@@ -595,6 +599,10 @@ int32_t run_vcpu(struct acrn_vcpu *vcpu)

/* Resume the VM */
status = vmx_vmrun(ctx, VM_RESUME, ibrs_type);
+
+ if (has_ac_for_splitlock() == true) {
+ enable_ac_for_splitlock();
+ }
}

vcpu->reg_cached = 0UL;
--
2.7.4