HV: rename split-lock emulation APIs

Because the emulation code is for both split-lock and uc-lock, Changed
these API names:
vcpu_kick_splitlock_emulation() -> vcpu_kick_lock_instr_emulation()
vcpu_complete_splitlock_emulation() -> vcpu_complete_lock_instr_emulation()
emulate_splitlock() -> emulate_lock_instr()

Tracked-On: #6299
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Tao Yuhong 2021-07-12 09:36:39 -04:00 committed by wenlingz
parent bbd7b7091b
commit 7926504011
4 changed files with 11 additions and 11 deletions

View File

@ -36,7 +36,7 @@ static bool is_guest_gp_enabled(struct acrn_vcpu *vcpu)
return ret;
}
void vcpu_kick_splitlock_emulation(struct acrn_vcpu *cur_vcpu)
void vcpu_kick_lock_instr_emulation(struct acrn_vcpu *cur_vcpu)
{
struct acrn_vcpu *other;
uint16_t i;
@ -52,7 +52,7 @@ void vcpu_kick_splitlock_emulation(struct acrn_vcpu *cur_vcpu)
}
}
void vcpu_complete_splitlock_emulation(struct acrn_vcpu *cur_vcpu)
void vcpu_complete_lock_instr_emulation(struct acrn_vcpu *cur_vcpu)
{
struct acrn_vcpu *other;
uint16_t i;
@ -68,7 +68,7 @@ void vcpu_complete_splitlock_emulation(struct acrn_vcpu *cur_vcpu)
}
}
int32_t emulate_splitlock(struct acrn_vcpu *vcpu, uint32_t exception_vector, bool *queue_exception)
int32_t emulate_lock_instr(struct acrn_vcpu *vcpu, uint32_t exception_vector, bool *queue_exception)
{
int32_t status = 0;
uint8_t inst[1];
@ -107,7 +107,7 @@ int32_t emulate_splitlock(struct acrn_vcpu *vcpu, uint32_t exception_vector, boo
* Kick other vcpus of the guest to stop execution
* until the split-lock/uc-lock emulation being completed.
*/
vcpu_kick_splitlock_emulation(vcpu);
vcpu_kick_lock_instr_emulation(vcpu);
/*
* Skip the LOCK prefix and re-execute the instruction.
@ -134,7 +134,7 @@ int32_t emulate_splitlock(struct acrn_vcpu *vcpu, uint32_t exception_vector, boo
* Kick other vcpus of the guest to stop execution
* until the split-lock/uc-lock emulation being completed.
*/
vcpu_kick_splitlock_emulation(vcpu);
vcpu_kick_lock_instr_emulation(vcpu);
/*
* Using emulating_lock to make sure xchg emulation
@ -153,7 +153,7 @@ int32_t emulate_splitlock(struct acrn_vcpu *vcpu, uint32_t exception_vector, boo
/*
* Notify other vcpus of the guest to restart execution.
*/
vcpu_complete_splitlock_emulation(vcpu);
vcpu_complete_lock_instr_emulation(vcpu);
/* Do not inject #AC/#GP, we have emulated it */
*queue_exception = false;

View File

@ -536,7 +536,7 @@ int32_t exception_vmexit_handler(struct acrn_vcpu *vcpu)
}
}
status = emulate_splitlock(vcpu, exception_vector, &queue_exception);
status = emulate_lock_instr(vcpu, exception_vector, &queue_exception);
if ((status == 0) && queue_exception) {
vcpu_retain_rip(vcpu);
status = vcpu_queue_exception(vcpu, exception_vector, int_err_code);

View File

@ -320,7 +320,7 @@ static int32_t mtf_vmexit_handler(struct acrn_vcpu *vcpu)
if (vcpu->arch.emulating_lock) {
vcpu->arch.emulating_lock = false;
vcpu_complete_splitlock_emulation(vcpu);
vcpu_complete_lock_instr_emulation(vcpu);
}
return 0;

View File

@ -7,8 +7,8 @@
#ifndef SPLITLOCK_H_
#define SPLITLOCK_H_
void vcpu_kick_splitlock_emulation(struct acrn_vcpu *cur_vcpu);
void vcpu_complete_splitlock_emulation(struct acrn_vcpu *cur_vcpu);
int32_t emulate_splitlock(struct acrn_vcpu *vcpu, uint32_t exception_vector, bool *queue_exception);
void vcpu_kick_lock_instr_emulation(struct acrn_vcpu *cur_vcpu);
void vcpu_complete_lock_instr_emulation(struct acrn_vcpu *cur_vcpu);
int32_t emulate_lock_instr(struct acrn_vcpu *vcpu, uint32_t exception_vector, bool *queue_exception);
#endif /* SPLITLOCK_H_ */