diff --git a/hypervisor/arch/x86/guest/instr_emul.c b/hypervisor/arch/x86/guest/instr_emul.c index d289dda36..f4eed0e01 100644 --- a/hypervisor/arch/x86/guest/instr_emul.c +++ b/hypervisor/arch/x86/guest/instr_emul.c @@ -759,7 +759,7 @@ emulate_movs(struct vcpu *vcpu, __unused uint64_t gpa, struct vie *vie, * Repeat the instruction if the count register is not zero. */ if ((rcx & vie_size2mask(vie->addrsize)) != 0) - vm_restart_instruction(vcpu); + VCPU_RETAIN_RIP(vcpu); } done: ASSERT(error == 0, "%s: unexpected error %d", __func__, error); @@ -823,7 +823,7 @@ emulate_stos(struct vcpu *vcpu, uint64_t gpa, struct vie *vie, * Repeat the instruction if the count register is not zero. */ if ((rcx & vie_size2mask(vie->addrsize)) != 0) - vm_restart_instruction(vcpu); + VCPU_RETAIN_RIP(vcpu); } return 0; diff --git a/hypervisor/arch/x86/guest/instr_emul_wrapper.c b/hypervisor/arch/x86/guest/instr_emul_wrapper.c index 1061017a2..d7d114cca 100644 --- a/hypervisor/arch/x86/guest/instr_emul_wrapper.c +++ b/hypervisor/arch/x86/guest/instr_emul_wrapper.c @@ -115,15 +115,6 @@ int vm_get_seg_desc(struct vcpu *vcpu, int seg, struct seg_desc *desc) return 0; } -int vm_restart_instruction(struct vcpu *vcpu) -{ - if (!vcpu) - return -EINVAL; - - VCPU_RETAIN_RIP(vcpu); - return 0; -} - static bool is_descriptor_table(int reg) { switch (reg) { diff --git a/hypervisor/arch/x86/guest/instr_emul_wrapper.h b/hypervisor/arch/x86/guest/instr_emul_wrapper.h index 371d29822..647a8d8c6 100644 --- a/hypervisor/arch/x86/guest/instr_emul_wrapper.h +++ b/hypervisor/arch/x86/guest/instr_emul_wrapper.h @@ -193,5 +193,4 @@ int vm_get_seg_desc(struct vcpu *vcpu, int reg, struct seg_desc *ret_desc); int vm_set_seg_desc(struct vcpu *vcpu, int reg, struct seg_desc *desc); -int vm_restart_instruction(struct vcpu *vcpu); #endif