mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 08:14:15 +08:00
KVM: Use the generic skip_emulated_instruction() in hypercall code
Instead of twiddling the rip registers directly, use the skip_emulated_instruction() function to do that for us. Signed-off-by: Dor Laor <dor.laor@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
This commit is contained in:
parent
9b22bf5783
commit
510043da85
@ -1078,7 +1078,8 @@ static int halt_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
|
||||
|
||||
static int vmmcall_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
|
||||
{
|
||||
vcpu->svm->vmcb->save.rip += 3;
|
||||
vcpu->svm->next_rip = vcpu->svm->vmcb->save.rip + 3;
|
||||
skip_emulated_instruction(vcpu);
|
||||
return kvm_hypercall(vcpu, kvm_run);
|
||||
}
|
||||
|
||||
|
@ -1658,7 +1658,7 @@ static int handle_halt(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
|
||||
|
||||
static int handle_vmcall(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
|
||||
{
|
||||
vmcs_writel(GUEST_RIP, vmcs_readl(GUEST_RIP)+3);
|
||||
skip_emulated_instruction(vcpu);
|
||||
return kvm_hypercall(vcpu, kvm_run);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user