]> git.karo-electronics.de Git - linux-beck.git/commitdiff
KVM: SVM: Add kvm_nested_intercepts tracepoint
authorJoerg Roedel <joerg.roedel@amd.com>
Wed, 24 Feb 2010 17:59:14 +0000 (18:59 +0100)
committerAvi Kivity <avi@redhat.com>
Sun, 25 Apr 2010 10:53:10 +0000 (13:53 +0300)
This patch adds a tracepoint to get information about the
most important intercept bitmasks from the nested vmcb.

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

index 2e4e089646a7ba889314d2a054ccd8c77716a65e..cac761c6d1dcccdebce65ea53e1a9c36ec63320b 100644 (file)
@@ -1845,6 +1845,11 @@ static bool nested_svm_vmrun(struct vcpu_svm *svm)
                               nested_vmcb->control.event_inj,
                               nested_vmcb->control.nested_ctl);
 
+       trace_kvm_nested_intercepts(nested_vmcb->control.intercept_cr_read,
+                                   nested_vmcb->control.intercept_cr_write,
+                                   nested_vmcb->control.intercept_exceptions,
+                                   nested_vmcb->control.intercept);
+
        /* Clear internal status */
        kvm_clear_exception_queue(&svm->vcpu);
        kvm_clear_interrupt_queue(&svm->vcpu);
index 12f8d2dee984ee32d3295e2e696b002c3230e9ef..17b52ccd977411fc04e102a836775c5a504dc2f9 100644 (file)
@@ -419,6 +419,28 @@ TRACE_EVENT(kvm_nested_vmrun,
                __entry->npt ? "on" : "off")
 );
 
+TRACE_EVENT(kvm_nested_intercepts,
+           TP_PROTO(__u16 cr_read, __u16 cr_write, __u32 exceptions, __u64 intercept),
+           TP_ARGS(cr_read, cr_write, exceptions, intercept),
+
+       TP_STRUCT__entry(
+               __field(        __u16,          cr_read         )
+               __field(        __u16,          cr_write        )
+               __field(        __u32,          exceptions      )
+               __field(        __u64,          intercept       )
+       ),
+
+       TP_fast_assign(
+               __entry->cr_read        = cr_read;
+               __entry->cr_write       = cr_write;
+               __entry->exceptions     = exceptions;
+               __entry->intercept      = intercept;
+       ),
+
+       TP_printk("cr_read: %04x cr_write: %04x excp: %08x intercept: %016llx",
+               __entry->cr_read, __entry->cr_write, __entry->exceptions,
+               __entry->intercept)
+);
 /*
  * Tracepoint for #VMEXIT while nested
  */
index 3a367f35cebfec59a0230133dfa72e99b0f3449a..1aa4d6e26badfe1134b88d7b73c9f59ec967dead 100644 (file)
@@ -5909,3 +5909,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_nested_vmexit_inject);
 EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_nested_intr_vmexit);
 EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_invlpga);
 EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_skinit);
+EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_nested_intercepts);