From patchwork Thu Oct 8 10:03:17 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 52491 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 n98AILxv027537 for ; Thu, 8 Oct 2009 10:18:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932171AbZJHKFF (ORCPT ); Thu, 8 Oct 2009 06:05:05 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932166AbZJHKFD (ORCPT ); Thu, 8 Oct 2009 06:05:03 -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 S932160AbZJHKE7 (ORCPT ); Thu, 8 Oct 2009 06:04:59 -0400 Received: from mail20-tx2-R.bigfish.com (10.9.14.249) by TX2EHSOBE003.bigfish.com (10.9.40.23) with Microsoft SMTP Server id 8.1.340.0; Thu, 8 Oct 2009 10:04:31 +0000 Received: from mail20-tx2 (localhost.localdomain [127.0.0.1]) by mail20-tx2-R.bigfish.com (Postfix) with ESMTP id 688DDFD8371; Thu, 8 Oct 2009 10:04:31 +0000 (UTC) X-SpamScore: 5 X-BigFish: VPS5(zba6lzzz1202hzzz32i6bh62h) X-Spam-TCS-SCL: 1:0 X-FB-SS: 5, Received: by mail20-tx2 (MessageSwitch) id 1254996268914066_7407; Thu, 8 Oct 2009 10:04:28 +0000 (UCT) Received: from TX2EHSMHS033.bigfish.com (unknown [10.9.14.236]) by mail20-tx2.bigfish.com (Postfix) with ESMTP id 11EE86A8055; Thu, 8 Oct 2009 10:04:28 +0000 (UTC) Received: from ausb3extmailp02.amd.com (163.181.251.22) by TX2EHSMHS033.bigfish.com (10.9.99.133) with Microsoft SMTP Server (TLS) id 14.0.482.32; Thu, 8 Oct 2009 10:04:26 +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 n98A4LNj012201; Thu, 8 Oct 2009 05:04:24 -0500 X-WSS-ID: 0KR6XB6-01-3BE-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 29C4010284C4; Thu, 8 Oct 2009 05:04:18 -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:20 -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:20 -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: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 812AEC9BDE; 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 7/9] KVM: SVM: Add tracepoint for invlpga instruction Date: Thu, 8 Oct 2009 12:03:17 +0200 Message-ID: <1254996199-17667-8-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.0744 (UTC) FILETIME=[926E2E00: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 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 20248a1..a6dcd2d 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 adress=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);