KVM: SVM: Add tracepoint for invlpga instruction
authorJoerg Roedel <joerg.roedel@amd.com>
Fri, 9 Oct 2009 14:08:31 +0000 (16:08 +0200)
committerAvi Kivity <avi@redhat.com>
Thu, 3 Dec 2009 07:32:16 +0000 (09:32 +0200)
This patch adds a tracepoint for the event that the guest
executed the INVLPGA instruction.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/kvm/svm.c
arch/x86/kvm/trace.h
arch/x86/kvm/x86.c

index 78a391c60a752dcb34c65af8b75c513ad2035a6d..ba18fb7d3657b86d43ecf95b71fcc5c6469b137f 100644 (file)
@@ -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]);
 
index 3cc8f444be14393743379594e2047c7aedc7b692..7e1f08e959bc624279a655e8586ae14e72c00f0e 100644 (file)
@@ -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 */
index 2cf4146b425a8f63e9152b98461c814e642448fa..86596fc7941cc5e32ac0229c025f1f12e440c468 100644 (file)
@@ -4988,3 +4988,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);