mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-07-06 12:06:25 +00:00
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:
parent
bbd7b7091b
commit
7926504011
@ -36,7 +36,7 @@ static bool is_guest_gp_enabled(struct acrn_vcpu *vcpu)
|
|||||||
return ret;
|
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;
|
struct acrn_vcpu *other;
|
||||||
uint16_t i;
|
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;
|
struct acrn_vcpu *other;
|
||||||
uint16_t i;
|
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;
|
int32_t status = 0;
|
||||||
uint8_t inst[1];
|
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
|
* Kick other vcpus of the guest to stop execution
|
||||||
* until the split-lock/uc-lock emulation being completed.
|
* 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.
|
* 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
|
* Kick other vcpus of the guest to stop execution
|
||||||
* until the split-lock/uc-lock emulation being completed.
|
* 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
|
* 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.
|
* 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 */
|
/* Do not inject #AC/#GP, we have emulated it */
|
||||||
*queue_exception = false;
|
*queue_exception = false;
|
||||||
|
@ -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) {
|
if ((status == 0) && queue_exception) {
|
||||||
vcpu_retain_rip(vcpu);
|
vcpu_retain_rip(vcpu);
|
||||||
status = vcpu_queue_exception(vcpu, exception_vector, int_err_code);
|
status = vcpu_queue_exception(vcpu, exception_vector, int_err_code);
|
||||||
|
@ -320,7 +320,7 @@ static int32_t mtf_vmexit_handler(struct acrn_vcpu *vcpu)
|
|||||||
|
|
||||||
if (vcpu->arch.emulating_lock) {
|
if (vcpu->arch.emulating_lock) {
|
||||||
vcpu->arch.emulating_lock = false;
|
vcpu->arch.emulating_lock = false;
|
||||||
vcpu_complete_splitlock_emulation(vcpu);
|
vcpu_complete_lock_instr_emulation(vcpu);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
#ifndef SPLITLOCK_H_
|
#ifndef SPLITLOCK_H_
|
||||||
#define SPLITLOCK_H_
|
#define SPLITLOCK_H_
|
||||||
|
|
||||||
void vcpu_kick_splitlock_emulation(struct acrn_vcpu *cur_vcpu);
|
void vcpu_kick_lock_instr_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);
|
||||||
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);
|
||||||
|
|
||||||
#endif /* SPLITLOCK_H_ */
|
#endif /* SPLITLOCK_H_ */
|
||||||
|
Loading…
Reference in New Issue
Block a user