Skip to content

Commit

Permalink
KVM: Use the generic skip_emulated_instruction() in hypercall code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dor Laor authored and Avi Kivity committed May 3, 2007
1 parent 9b22bf5 commit 510043d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion drivers/kvm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 510043d

Please sign in to comment.