diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2011-01-14 10:45:02 -0500 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2011-03-17 12:08:25 -0400 |
commit | 3781c01c1574a2cd58fd5ba2bf58c710edff3da5 (patch) | |
tree | cef40dc24b87e82842845c618daa18136a3aedd1 /arch/x86/kvm/svm.c | |
parent | a9179499350d30446d8983d272a9157963604b0f (diff) |
KVM: SVM: Add support for perf-kvm
This patch adds the necessary code to run perf-kvm on AMD
machines.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/svm.c')
-rw-r--r-- | arch/x86/kvm/svm.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 63fec1531e89..bfb49489566e 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -3647,13 +3647,21 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu) | |||
3647 | 3647 | ||
3648 | local_irq_disable(); | 3648 | local_irq_disable(); |
3649 | 3649 | ||
3650 | stgi(); | ||
3651 | |||
3652 | vcpu->arch.cr2 = svm->vmcb->save.cr2; | 3650 | vcpu->arch.cr2 = svm->vmcb->save.cr2; |
3653 | vcpu->arch.regs[VCPU_REGS_RAX] = svm->vmcb->save.rax; | 3651 | vcpu->arch.regs[VCPU_REGS_RAX] = svm->vmcb->save.rax; |
3654 | vcpu->arch.regs[VCPU_REGS_RSP] = svm->vmcb->save.rsp; | 3652 | vcpu->arch.regs[VCPU_REGS_RSP] = svm->vmcb->save.rsp; |
3655 | vcpu->arch.regs[VCPU_REGS_RIP] = svm->vmcb->save.rip; | 3653 | vcpu->arch.regs[VCPU_REGS_RIP] = svm->vmcb->save.rip; |
3656 | 3654 | ||
3655 | if (unlikely(svm->vmcb->control.exit_code == SVM_EXIT_NMI)) | ||
3656 | kvm_before_handle_nmi(&svm->vcpu); | ||
3657 | |||
3658 | stgi(); | ||
3659 | |||
3660 | /* Any pending NMI will happen here */ | ||
3661 | |||
3662 | if (unlikely(svm->vmcb->control.exit_code == SVM_EXIT_NMI)) | ||
3663 | kvm_after_handle_nmi(&svm->vcpu); | ||
3664 | |||
3657 | sync_cr8_to_lapic(vcpu); | 3665 | sync_cr8_to_lapic(vcpu); |
3658 | 3666 | ||
3659 | svm->next_rip = 0; | 3667 | svm->next_rip = 0; |