From patchwork Thu Oct 8 10:03:13 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 52482 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n98A6E5x026091 for ; Thu, 8 Oct 2009 10:06:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932253AbZJHKFS (ORCPT ); Thu, 8 Oct 2009 06:05:18 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932220AbZJHKFQ (ORCPT ); Thu, 8 Oct 2009 06:05:16 -0400 Received: from va3ehsobe002.messaging.microsoft.com ([216.32.180.12]:50353 "EHLO VA3EHSOBE002.bigfish.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932218AbZJHKFL (ORCPT ); Thu, 8 Oct 2009 06:05:11 -0400 Received: from mail6-va3-R.bigfish.com (10.7.14.246) by VA3EHSOBE002.bigfish.com (10.7.40.22) with Microsoft SMTP Server id 8.1.340.0; Thu, 8 Oct 2009 10:04:34 +0000 Received: from mail6-va3 (localhost.localdomain [127.0.0.1]) by mail6-va3-R.bigfish.com (Postfix) with ESMTP id 45072122832F; Thu, 8 Oct 2009 10:04:34 +0000 (UTC) X-SpamScore: 1 X-BigFish: VPS1(zzzz1202hzzz32i6bh62h) X-Spam-TCS-SCL: 1:0 X-FB-SS: 5, Received: by mail6-va3 (MessageSwitch) id 1254996266772628_10154; Thu, 8 Oct 2009 10:04:26 +0000 (UCT) Received: from VA3EHSMHS033.bigfish.com (unknown [10.7.14.248]) by mail6-va3.bigfish.com (Postfix) with ESMTP id D6FE12005A; Thu, 8 Oct 2009 10:04:24 +0000 (UTC) Received: from ausb3extmailp02.amd.com (163.181.251.22) by VA3EHSMHS033.bigfish.com (10.7.99.43) with Microsoft SMTP Server (TLS) id 14.0.482.32; Thu, 8 Oct 2009 10:04:23 +0000 Received: from ausb3twp01.amd.com (ausb3twp01.amd.com [163.181.250.37]) by ausb3extmailp02.amd.com (Switch-3.2.7/Switch-3.2.7) with ESMTP id n98A4Icn012188; Thu, 8 Oct 2009 05:04:21 -0500 X-WSS-ID: 0KR6XB3-01-3B9-02 X-M-MSG: Received: from sausexbh1.amd.com (sausexbh1.amd.com [163.181.22.101]) by ausb3twp01.amd.com (Tumbleweed MailGate 3.7.0) with ESMTP id 28F4610284C6; Thu, 8 Oct 2009 05:04:15 -0500 (CDT) Received: from sausexmb1.amd.com ([163.181.3.156]) by sausexbh1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 8 Oct 2009 05:04:17 -0500 Received: from SDRSEXMB1.amd.com ([172.20.3.116]) by sausexmb1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 8 Oct 2009 05:04:17 -0500 Received: from seurexmb1.amd.com ([165.204.9.130]) by SDRSEXMB1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 8 Oct 2009 12:03:24 +0200 Received: from lemmy.amd.com ([165.204.15.93]) by seurexmb1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 8 Oct 2009 12:03:23 +0200 Received: by lemmy.amd.com (Postfix, from userid 41430) id 6F347C9BC4; Thu, 8 Oct 2009 12:03:23 +0200 (CEST) From: Joerg Roedel To: Avi Kivity , Marcelo Tosatti CC: Alexander Graf , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Joerg Roedel Subject: [PATCH 3/9] KVM: SVM: Add tracepoint for nested vmrun Date: Thu, 8 Oct 2009 12:03:13 +0200 Message-ID: <1254996199-17667-4-git-send-email-joerg.roedel@amd.com> X-Mailer: git-send-email 1.6.4.3 In-Reply-To: <1254996199-17667-1-git-send-email-joerg.roedel@amd.com> References: <1254996199-17667-1-git-send-email-joerg.roedel@amd.com> X-OriginalArrivalTime: 08 Oct 2009 10:03:23.0588 (UTC) FILETIME=[92566040:01CA47FE] MIME-Version: 1.0 X-Reverse-DNS: ausb3extmailp02.amd.com Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 884bffc..907af3f 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -1726,6 +1726,12 @@ static bool nested_svm_vmrun(struct vcpu_svm *svm) /* nested_vmcb is our indicator if nested SVM is activated */ svm->nested.vmcb = svm->vmcb->save.rax; + trace_kvm_nested_vmrun(svm->vmcb->save.rip - 3, svm->nested.vmcb, + nested_vmcb->save.rip, + nested_vmcb->control.int_ctl, + nested_vmcb->control.event_inj, + nested_vmcb->control.nested_ctl); + /* Clear internal status */ kvm_clear_exception_queue(&svm->vcpu); kvm_clear_interrupt_queue(&svm->vcpu); diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h index 0d480e7..d63272c 100644 --- a/arch/x86/kvm/trace.h +++ b/arch/x86/kvm/trace.h @@ -349,6 +349,39 @@ TRACE_EVENT(kvm_apic_accept_irq, __entry->coalesced ? " (coalesced)" : "") ); +/* + * Tracepoint for nested VMRUN + */ +TRACE_EVENT(kvm_nested_vmrun, + TP_PROTO(__u64 rip, __u64 vmcb, __u64 nested_rip, __u32 int_ctl, + __u32 event_inj, bool npt), + TP_ARGS(rip, vmcb, nested_rip, int_ctl, event_inj, npt), + + TP_STRUCT__entry( + __field( __u64, rip ) + __field( __u64, vmcb ) + __field( __u64, nested_rip ) + __field( __u32, int_ctl ) + __field( __u32, event_inj ) + __field( bool, npt ) + ), + + TP_fast_assign( + __entry->rip = rip; + __entry->vmcb = vmcb; + __entry->nested_rip = nested_rip; + __entry->int_ctl = int_ctl; + __entry->event_inj = event_inj; + __entry->npt = npt; + ), + + TP_printk("rip=0x%016llx vmcb=0x%016llx nrip=0x%016llx int_ctl=0x%08x " + "event_inj=0x%08x npt=%s\n", + __entry->rip, __entry->vmcb, __entry->nested_rip, + __entry->int_ctl, __entry->event_inj, + __entry->npt ? "on" : "off") +); + #endif /* _TRACE_KVM_H */ /* This part must be outside protection */ diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 11a6f2f..f1e44e9 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -4980,3 +4980,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_inj_virq); EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_page_fault); EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_msr); EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_cr); +EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_nested_vmrun);