All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joerg Roedel <joerg.roedel@amd.com>
To: Avi Kivity <avi@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com>
Cc: Alexander Graf <agraf@suse.de>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Joerg Roedel <joerg.roedel@amd.com>
Subject: [PATCH 7/9] KVM: SVM: Add tracepoint for invlpga instruction
Date: Fri, 9 Oct 2009 16:08:31 +0200	[thread overview]
Message-ID: <1255097313-23267-8-git-send-email-joerg.roedel@amd.com> (raw)
In-Reply-To: <1255097313-23267-1-git-send-email-joerg.roedel@amd.com>

This patch adds a tracepoint for the event that the guest
executed the INVLPGA instruction.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
---
 arch/x86/kvm/svm.c   |    3 +++
 arch/x86/kvm/trace.h |   23 +++++++++++++++++++++++
 arch/x86/kvm/x86.c   |    1 +
 3 files changed, 27 insertions(+), 0 deletions(-)

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);
-- 
1.6.4.3



  parent reply	other threads:[~2009-10-09 14:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-09 14:08 [PATCH 0/9 v3] KVM: Nested SVM fixes and tracepoint conversion Joerg Roedel
2009-10-09 14:08 ` [PATCH 1/9] KVM: SVM: Notify nested hypervisor of lost event injections Joerg Roedel
2009-10-09 14:08 ` [PATCH 2/9] KVM: SVM: Move INTR vmexit out of atomic code Joerg Roedel
2009-10-09 14:08 ` [PATCH 3/9] KVM: SVM: Add tracepoint for nested vmrun Joerg Roedel
2009-10-09 14:08 ` [PATCH 4/9] KVM: SVM: Add tracepoint for nested #vmexit Joerg Roedel
2009-10-09 14:08 ` [PATCH 5/9] KVM: SVM: Add tracepoint for injected #vmexit Joerg Roedel
2009-10-09 14:08 ` [PATCH 6/9] KVM: SVM: Add tracepoint for #vmexit because intr pending Joerg Roedel
2009-10-09 14:08 ` Joerg Roedel [this message]
2009-10-09 14:08 ` [PATCH 8/9] KVM: SVM: Add tracepoint for skinit instruction Joerg Roedel
2009-10-09 14:08 ` [PATCH 9/9] KVM: SVM: Remove nsvm_printk debugging code Joerg Roedel
2009-10-12  9:26 ` [PATCH 0/9 v3] KVM: Nested SVM fixes and tracepoint conversion Avi Kivity
2009-10-12 18:37 ` Marcelo Tosatti
  -- strict thread matches above, loose matches on Subject: below --
2009-10-08 10:03 [PATCH 0/9 v2] " Joerg Roedel
2009-10-08 10:03 ` [PATCH 7/9] KVM: SVM: Add tracepoint for invlpga instruction Joerg Roedel
2009-10-08 16:01   ` Avi Kivity
2009-10-08 16:18     ` Joerg Roedel
2009-10-08 16:21       ` Avi Kivity
2009-10-08 16:23         ` Joerg Roedel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1255097313-23267-8-git-send-email-joerg.roedel@amd.com \
    --to=joerg.roedel@amd.com \
    --cc=agraf@suse.de \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.