From patchwork Fri Oct 9 14:08:31 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 52722 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 n99EGmvI017028 for ; Fri, 9 Oct 2009 14:16:49 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760944AbZJIOJg (ORCPT ); Fri, 9 Oct 2009 10:09:36 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760943AbZJIOJg (ORCPT ); Fri, 9 Oct 2009 10:09:36 -0400 Received: from tx2ehsobe002.messaging.microsoft.com ([65.55.88.12]:2757 "EHLO TX2EHSOBE004.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756715AbZJIOJd (ORCPT ); Fri, 9 Oct 2009 10:09:33 -0400 Received: from mail59-tx2-R.bigfish.com (10.9.14.237) by TX2EHSOBE004.bigfish.com (10.9.40.24) with Microsoft SMTP Server id 8.1.340.0; Fri, 9 Oct 2009 14:08:57 +0000 Received: from mail59-tx2 (localhost.localdomain [127.0.0.1]) by mail59-tx2-R.bigfish.com (Postfix) with ESMTP id DC3C97C858B; Fri, 9 Oct 2009 14:08:55 +0000 (UTC) X-SpamScore: 5 X-BigFish: VPS5(zba6lzzz1202hzzz32i6bh2a8h62h) X-Spam-TCS-SCL: 1:0 X-FB-SS: 5, Received: by mail59-tx2 (MessageSwitch) id 1255097330477297_27839; Fri, 9 Oct 2009 14:08:50 +0000 (UCT) Received: from TX2EHSMHS037.bigfish.com (unknown [10.9.14.244]) by mail59-tx2.bigfish.com (Postfix) with ESMTP id DFEED147805A; Fri, 9 Oct 2009 14:08:48 +0000 (UTC) Received: from ausb3extmailp02.amd.com (163.181.251.22) by TX2EHSMHS037.bigfish.com (10.9.99.137) with Microsoft SMTP Server (TLS) id 14.0.482.32; Fri, 9 Oct 2009 14:08:46 +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 n99E8gTm027724; Fri, 9 Oct 2009 09:08:45 -0500 X-WSS-ID: 0KR93AE-01-0U5-02 X-M-MSG: Received: from sausexbh2.amd.com (SAUSEXBH2.amd.com [163.181.22.102]) by ausb3twp01.amd.com (Tumbleweed MailGate 3.7.0) with ESMTP id 2E11410284C5; Fri, 9 Oct 2009 09:08:38 -0500 (CDT) Received: from sausexmb4.amd.com ([163.181.3.15]) by sausexbh2.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 9 Oct 2009 09:08:42 -0500 Received: from SDRSEXMB1.amd.com ([172.20.3.116]) by sausexmb4.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 9 Oct 2009 09:08:41 -0500 Received: from seurexmb1.amd.com ([165.204.9.130]) by SDRSEXMB1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 9 Oct 2009 16:08:38 +0200 Received: from lemmy.amd.com ([165.204.15.93]) by seurexmb1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 9 Oct 2009 16:08:36 +0200 Received: by lemmy.amd.com (Postfix, from userid 41430) id 1F3C0C9FD2; Fri, 9 Oct 2009 16:08:36 +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 7/9] KVM: SVM: Add tracepoint for invlpga instruction Date: Fri, 9 Oct 2009 16:08:31 +0200 Message-ID: <1255097313-23267-8-git-send-email-joerg.roedel@amd.com> X-Mailer: git-send-email 1.6.4.3 In-Reply-To: <1255097313-23267-1-git-send-email-joerg.roedel@amd.com> References: <1255097313-23267-1-git-send-email-joerg.roedel@amd.com> X-OriginalArrivalTime: 09 Oct 2009 14:08:36.0637 (UTC) FILETIME=[FE693CD0:01CA48E9] 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 78a391c..ba18fb7 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -1976,6 +1976,9 @@ static int invlpga_interception(struct vcpu_svm *svm) struct kvm_vcpu *vcpu = &svm->vcpu; nsvm_printk("INVLPGA\n"); + trace_kvm_invlpga(svm->vmcb->save.rip, vcpu->arch.regs[VCPU_REGS_RCX], + vcpu->arch.regs[VCPU_REGS_RAX]); + /* Let's treat INVLPGA the same as INVLPG (can be optimized!) */ kvm_mmu_invlpg(vcpu, vcpu->arch.regs[VCPU_REGS_RAX]); diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h index 3cc8f44..7e1f08e 100644 --- a/arch/x86/kvm/trace.h +++ b/arch/x86/kvm/trace.h @@ -469,6 +469,29 @@ TRACE_EVENT(kvm_nested_intr_vmexit, TP_printk("rip: 0x%016llx\n", __entry->rip) ); + +/* + * Tracepoint for nested #vmexit because of interrupt pending + */ +TRACE_EVENT(kvm_invlpga, + TP_PROTO(__u64 rip, int asid, u64 address), + TP_ARGS(rip, asid, address), + + TP_STRUCT__entry( + __field( __u64, rip ) + __field( int, asid ) + __field( __u64, address ) + ), + + TP_fast_assign( + __entry->rip = rip; + __entry->asid = asid; + __entry->address = address; + ), + + TP_printk("rip: 0x%016llx asid: %d address: 0x%016llx\n", + __entry->rip, __entry->asid, __entry->address) +); #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 877f910..1153d92 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -4984,3 +4984,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_nested_vmrun); EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_nested_vmexit); EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_nested_vmexit_inject); EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_nested_intr_vmexit); +EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_invlpga);