From patchwork Wed Oct 7 14:31:24 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 52287 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 n97EnQTm022521 for ; Wed, 7 Oct 2009 14:49:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932691AbZJGOdY (ORCPT ); Wed, 7 Oct 2009 10:33:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932621AbZJGOdX (ORCPT ); Wed, 7 Oct 2009 10:33:23 -0400 Received: from va3ehsobe003.messaging.microsoft.com ([216.32.180.13]:14824 "EHLO VA3EHSOBE003.bigfish.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932483AbZJGOdS (ORCPT ); Wed, 7 Oct 2009 10:33:18 -0400 Received: from mail36-va3-R.bigfish.com (10.7.14.251) by VA3EHSOBE003.bigfish.com (10.7.40.23) with Microsoft SMTP Server id 8.1.340.0; Wed, 7 Oct 2009 14:32:26 +0000 Received: from mail36-va3 (localhost.localdomain [127.0.0.1]) by mail36-va3-R.bigfish.com (Postfix) with ESMTP id 061C4C203E5; Wed, 7 Oct 2009 14:32:26 +0000 (UTC) X-SpamScore: 1 X-BigFish: VPS1(zzzz1202hzzz32i6bh63h) X-Spam-TCS-SCL: 2:0 X-FB-SS: 5, Received: by mail36-va3 (MessageSwitch) id 1254925921693147_9240; Wed, 7 Oct 2009 14:32:01 +0000 (UCT) Received: from VA3EHSMHS015.bigfish.com (unknown [10.7.14.239]) by mail36-va3.bigfish.com (Postfix) with ESMTP id 6020D12C8060; Wed, 7 Oct 2009 14:32:00 +0000 (UTC) Received: from ausb3extmailp02.amd.com (163.181.251.22) by VA3EHSMHS015.bigfish.com (10.7.99.25) with Microsoft SMTP Server (TLS) id 14.0.482.32; Wed, 7 Oct 2009 14:31:57 +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 n97EVrHX011393; Wed, 7 Oct 2009 09:31:56 -0500 X-WSS-ID: 0KR5F11-01-FES-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 2EF7010284BD; Wed, 7 Oct 2009 09:31:49 -0500 (CDT) Received: from sausexmb2.amd.com ([163.181.3.157]) by sausexbh1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 7 Oct 2009 09:31:52 -0500 Received: from SDRSEXMB1.amd.com ([172.20.3.116]) by sausexmb2.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 7 Oct 2009 09:31:52 -0500 Received: from seurexmb1.amd.com ([165.204.9.130]) by SDRSEXMB1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 7 Oct 2009 16:31:38 +0200 Received: from lemmy.amd.com ([165.204.15.93]) by seurexmb1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 7 Oct 2009 16:31:35 +0200 Received: by lemmy.amd.com (Postfix, from userid 41430) id 3C3AFC9BC4; Wed, 7 Oct 2009 16:31:35 +0200 (CEST) From: Joerg Roedel To: Avi Kivity , Marcelo Tosatti CC: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Joerg Roedel Subject: [PATCH 06/10] KVM: SVM: Add tracepoint for injected #vmexit Date: Wed, 7 Oct 2009 16:31:24 +0200 Message-ID: <1254925888-13743-7-git-send-email-joerg.roedel@amd.com> X-Mailer: git-send-email 1.6.4.3 In-Reply-To: <1254925888-13743-1-git-send-email-joerg.roedel@amd.com> References: <1254925888-13743-1-git-send-email-joerg.roedel@amd.com> X-OriginalArrivalTime: 07 Oct 2009 14:31:35.0358 (UTC) FILETIME=[DF5DDDE0:01CA475A] 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 e759732..4de75e3 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -1588,6 +1588,12 @@ static int nested_svm_vmexit(struct vcpu_svm *svm) struct vmcb *hsave = svm->nested.hsave; struct vmcb *vmcb = svm->vmcb; + trace_kvm_nested_vmexit_inject(vmcb->control.exit_code, + vmcb->control.exit_info_1, + vmcb->control.exit_info_2, + vmcb->control.exit_int_info, + vmcb->control.exit_int_info_err); + nested_vmcb = nested_svm_map(svm, svm->nested.vmcb, KM_USER0); if (!nested_vmcb) return 1; diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h index a0b89c3..a00b235 100644 --- a/arch/x86/kvm/trace.h +++ b/arch/x86/kvm/trace.h @@ -418,6 +418,39 @@ TRACE_EVENT(kvm_nested_vmexit, __entry->exit_int_info, __entry->exit_int_info_err) ); +/* + * Tracepoint for #VMEXIT reinjected to the guest + */ +TRACE_EVENT(kvm_nested_vmexit_inject, + TP_PROTO(__u32 exit_code, + __u64 exit_info1, __u64 exit_info2, + __u32 exit_int_info, __u32 exit_int_info_err), + TP_ARGS(exit_code, exit_info1, exit_info2, + exit_int_info, exit_int_info_err), + + TP_STRUCT__entry( + __field( __u32, exit_code ) + __field( __u64, exit_info1 ) + __field( __u64, exit_info2 ) + __field( __u32, exit_int_info ) + __field( __u32, exit_int_info_err ) + ), + + TP_fast_assign( + __entry->exit_code = exit_code; + __entry->exit_info1 = exit_info1; + __entry->exit_info2 = exit_info2; + __entry->exit_int_info = exit_int_info; + __entry->exit_int_info_err = exit_int_info_err; + ), + + TP_printk("reason=%s ext_inf1=0x%016llx " + "ext_inf2=0x%016llx ext_int=0x%08x ext_int_err=0x%08x\n", + ftrace_print_symbols_seq(p, __entry->exit_code, + kvm_x86_ops->exit_reasons_str), + __entry->exit_info1, __entry->exit_info2, + __entry->exit_int_info, __entry->exit_int_info_err) +); #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 416282e..c7ea2d8 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -4999,3 +4999,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_msr); EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_cr); EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_nested_vmrun); EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_nested_vmexit); +EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_nested_vmexit_inject);