From patchwork Thu Oct 8 10:03:15 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 52480 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 n98A6E5v026091 for ; Thu, 8 Oct 2009 10:06:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757470AbZJHKEr (ORCPT ); Thu, 8 Oct 2009 06:04:47 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757464AbZJHKEq (ORCPT ); Thu, 8 Oct 2009 06:04:46 -0400 Received: from tx2ehsobe002.messaging.microsoft.com ([65.55.88.12]:5896 "EHLO TX2EHSOBE003.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757430AbZJHKEo (ORCPT ); Thu, 8 Oct 2009 06:04:44 -0400 Received: from mail182-tx2-R.bigfish.com (10.9.14.242) by TX2EHSOBE003.bigfish.com (10.9.40.23) with Microsoft SMTP Server id 8.1.340.0; Thu, 8 Oct 2009 10:04:07 +0000 Received: from mail182-tx2 (localhost.localdomain [127.0.0.1]) by mail182-tx2-R.bigfish.com (Postfix) with ESMTP id 2E89312D0224; Thu, 8 Oct 2009 10:04:06 +0000 (UTC) X-SpamScore: 3 X-BigFish: VPS3(zzzz1202hzzz32i6bh43j65h) X-Spam-TCS-SCL: 4:0 X-FB-SS: 5, Received: by mail182-tx2 (MessageSwitch) id 1254996231337410_12583; Thu, 8 Oct 2009 10:03:51 +0000 (UCT) Received: from TX2EHSMHS049.bigfish.com (unknown [10.9.14.253]) by mail182-tx2.bigfish.com (Postfix) with ESMTP id D3E4A15E8058; Thu, 8 Oct 2009 10:03:50 +0000 (UTC) Received: from svlb1extmailp02.amd.com (139.95.251.11) by TX2EHSMHS049.bigfish.com (10.9.99.149) with Microsoft SMTP Server (TLS) id 14.0.482.32; Thu, 8 Oct 2009 10:03:49 +0000 Received: from svlb1twp01.amd.com ([139.95.250.34]) by svlb1extmailp02.amd.com (Switch-3.2.7/Switch-3.2.7) with ESMTP id n98A3dDe014771; Thu, 8 Oct 2009 03:03:42 -0700 X-WSS-ID: 0KR6XA4-03-4RX-02 X-M-MSG: Received: from SSVLEXBH1.amd.com (ssvlexbh1.amd.com [139.95.53.182]) by svlb1twp01.amd.com (Tumbleweed MailGate 3.7.0) with ESMTP id 2AA8519A014C; Thu, 8 Oct 2009 03:03:39 -0700 (PDT) Received: from ssvlexmb2.amd.com ([139.95.53.7]) by SSVLEXBH1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 8 Oct 2009 03:03:42 -0700 Received: from SF36EXMB1.amd.com ([172.19.4.24]) by ssvlexmb2.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 8 Oct 2009 03:03:42 -0700 Received: from seurexmb1.amd.com ([165.204.9.130]) by SF36EXMB1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 8 Oct 2009 12:03:25 +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 78B0CC9BD2; 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 5/9] KVM: SVM: Add tracepoint for injected #vmexit Date: Thu, 8 Oct 2009 12:03:15 +0200 Message-ID: <1254996199-17667-6-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.0728 (UTC) FILETIME=[926BBD00:01CA47FE] MIME-Version: 1.0 X-Reverse-DNS: unknown 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 edf6e8b..369eeb8 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -1592,6 +1592,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 00c8b60..4f90d45 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -4982,3 +4982,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);