From 7926504011dc69643af06391edb637bdd25d2edd Mon Sep 17 00:00:00 2001 From: Tao Yuhong Date: Mon, 12 Jul 2021 09:36:39 -0400 Subject: [PATCH] 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 Acked-by: Eddie Dong --- hypervisor/arch/x86/guest/splitlock.c | 12 ++++++------ hypervisor/arch/x86/guest/virq.c | 2 +- hypervisor/arch/x86/guest/vmexit.c | 2 +- hypervisor/include/arch/x86/asm/guest/splitlock.h | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/hypervisor/arch/x86/guest/splitlock.c b/hypervisor/arch/x86/guest/splitlock.c index 24c7184ca..61488eb04 100644 --- a/hypervisor/arch/x86/guest/splitlock.c +++ b/hypervisor/arch/x86/guest/splitlock.c @@ -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; diff --git a/hypervisor/arch/x86/guest/virq.c b/hypervisor/arch/x86/guest/virq.c index e83ef1bcd..076553434 100644 --- a/hypervisor/arch/x86/guest/virq.c +++ b/hypervisor/arch/x86/guest/virq.c @@ -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); diff --git a/hypervisor/arch/x86/guest/vmexit.c b/hypervisor/arch/x86/guest/vmexit.c index 4eaf4b8e9..9f8a05a0b 100644 --- a/hypervisor/arch/x86/guest/vmexit.c +++ b/hypervisor/arch/x86/guest/vmexit.c @@ -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; diff --git a/hypervisor/include/arch/x86/asm/guest/splitlock.h b/hypervisor/include/arch/x86/asm/guest/splitlock.h index 7d38076fb..f3ec6a9dd 100644 --- a/hypervisor/include/arch/x86/asm/guest/splitlock.h +++ b/hypervisor/include/arch/x86/asm/guest/splitlock.h @@ -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_ */