From patchwork Wed Oct 7 14:31:26 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 52281 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 n97EnQTf022521 for ; Wed, 7 Oct 2009 14:49:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759366AbZJGOco (ORCPT ); Wed, 7 Oct 2009 10:32:44 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759360AbZJGOcn (ORCPT ); Wed, 7 Oct 2009 10:32:43 -0400 Received: from va3ehsobe001.messaging.microsoft.com ([216.32.180.11]:45640 "EHLO VA3EHSOBE001.bigfish.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1759357AbZJGOcl (ORCPT ); Wed, 7 Oct 2009 10:32:41 -0400 Received: from mail75-va3-R.bigfish.com (10.7.14.253) by VA3EHSOBE001.bigfish.com (10.7.40.21) with Microsoft SMTP Server id 8.1.340.0; Wed, 7 Oct 2009 14:32:03 +0000 Received: from mail75-va3 (localhost.localdomain [127.0.0.1]) by mail75-va3-R.bigfish.com (Postfix) with ESMTP id EBAAA200E1; Wed, 7 Oct 2009 14:32:03 +0000 (UTC) X-SpamScore: 5 X-BigFish: VPS5(zba6lzzz1202hzzz32i6bh62h) X-Spam-TCS-SCL: 1:0 X-FB-SS: 5, Received: by mail75-va3 (MessageSwitch) id 1254925921513430_18785; Wed, 7 Oct 2009 14:32:01 +0000 (UCT) Received: from VA3EHSMHS024.bigfish.com (unknown [10.7.14.250]) by mail75-va3.bigfish.com (Postfix) with ESMTP id 6531319A8058; Wed, 7 Oct 2009 14:32:00 +0000 (UTC) Received: from ausb3extmailp02.amd.com (163.181.251.22) by VA3EHSMHS024.bigfish.com (10.7.99.34) 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 n97EVrc5011394; Wed, 7 Oct 2009 09:31:56 -0500 X-WSS-ID: 0KR5F11-01-FER-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 2CE2F10284BF; Wed, 7 Oct 2009 09:31:48 -0500 (CDT) Received: from SAUSEXMB3.amd.com ([163.181.22.202]) by sausexbh1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 7 Oct 2009 09:31:51 -0500 Received: from SDRSEXMB1.amd.com ([172.20.3.116]) by SAUSEXMB3.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 7 Oct 2009 09:31:51 -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 4BF98C9B77; 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 08/10] KVM: SVM: Add tracepoint for invlpga instruction Date: Wed, 7 Oct 2009 16:31:26 +0200 Message-ID: <1254925888-13743-9-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 a03dba1..563ddd3 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -1973,6 +1973,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 e0a8517..18284e1 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -5001,3 +5001,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);