Skip to content

Commit 48de7ef

Browse files
JasonChenCJlijinxia
authored andcommitted
instr_emul: remove vm_restart_instruction and use VCPU_RETAIN_RIP
there is no need to use wrap function vm_restart_instruction, we can use VCPU_RETAIN_RIP directly Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
1 parent 0d6218f commit 48de7ef

File tree

3 files changed

+2
-12
lines changed

3 files changed

+2
-12
lines changed

hypervisor/arch/x86/guest/instr_emul.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ emulate_movs(struct vcpu *vcpu, __unused uint64_t gpa, struct vie *vie,
759759
* Repeat the instruction if the count register is not zero.
760760
*/
761761
if ((rcx & vie_size2mask(vie->addrsize)) != 0)
762-
vm_restart_instruction(vcpu);
762+
VCPU_RETAIN_RIP(vcpu);
763763
}
764764
done:
765765
ASSERT(error == 0, "%s: unexpected error %d", __func__, error);
@@ -823,7 +823,7 @@ emulate_stos(struct vcpu *vcpu, uint64_t gpa, struct vie *vie,
823823
* Repeat the instruction if the count register is not zero.
824824
*/
825825
if ((rcx & vie_size2mask(vie->addrsize)) != 0)
826-
vm_restart_instruction(vcpu);
826+
VCPU_RETAIN_RIP(vcpu);
827827
}
828828

829829
return 0;

hypervisor/arch/x86/guest/instr_emul_wrapper.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,6 @@ int vm_get_seg_desc(struct vcpu *vcpu, int seg, struct seg_desc *desc)
115115
return 0;
116116
}
117117

118-
int vm_restart_instruction(struct vcpu *vcpu)
119-
{
120-
if (!vcpu)
121-
return -EINVAL;
122-
123-
VCPU_RETAIN_RIP(vcpu);
124-
return 0;
125-
}
126-
127118
static bool is_descriptor_table(int reg)
128119
{
129120
switch (reg) {

hypervisor/arch/x86/guest/instr_emul_wrapper.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,5 +193,4 @@ int vm_get_seg_desc(struct vcpu *vcpu, int reg,
193193
struct seg_desc *ret_desc);
194194
int vm_set_seg_desc(struct vcpu *vcpu, int reg,
195195
struct seg_desc *desc);
196-
int vm_restart_instruction(struct vcpu *vcpu);
197196
#endif

0 commit comments

Comments
 (0)