Skip to content

Commit

Permalink
KVM: SVM: Add support for perf-kvm
Browse files Browse the repository at this point in the history
This patch adds the necessary code to run perf-kvm on AMD
machines.

Signed-off-by: Joerg Roedel <[email protected]>
Signed-off-by: Avi Kivity <[email protected]>
  • Loading branch information
Joerg Roedel authored and matosatti committed Mar 17, 2011
1 parent a917949 commit 3781c01
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions arch/x86/kvm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -3647,13 +3647,21 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)

local_irq_disable();

stgi();

vcpu->arch.cr2 = svm->vmcb->save.cr2;
vcpu->arch.regs[VCPU_REGS_RAX] = svm->vmcb->save.rax;
vcpu->arch.regs[VCPU_REGS_RSP] = svm->vmcb->save.rsp;
vcpu->arch.regs[VCPU_REGS_RIP] = svm->vmcb->save.rip;

if (unlikely(svm->vmcb->control.exit_code == SVM_EXIT_NMI))
kvm_before_handle_nmi(&svm->vcpu);

stgi();

/* Any pending NMI will happen here */

if (unlikely(svm->vmcb->control.exit_code == SVM_EXIT_NMI))
kvm_after_handle_nmi(&svm->vcpu);

sync_cr8_to_lapic(vcpu);

svm->next_rip = 0;
Expand Down

0 comments on commit 3781c01

Please sign in to comment.