aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2010-02-24 12:59:14 -0500
committerAvi Kivity <avi@redhat.com>2010-04-25 06:53:10 -0400
commit2e554e8d67926024b01e97d2fe652810165354e2 (patch)
treea0ace1e673875471425235b482c2fb645c9caa88
parentecf1405df235da3efea213427ac7da7f816e9d06 (diff)
KVM: SVM: Add kvm_nested_intercepts tracepoint
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>
-rw-r--r--arch/x86/kvm/svm.c5
-rw-r--r--arch/x86/kvm/trace.h22
-rw-r--r--arch/x86/kvm/x86.c1
3 files changed, 28 insertions, 0 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 2e4e089646a7..cac761c6d1dc 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -1845,6 +1845,11 @@ static bool nested_svm_vmrun(struct vcpu_svm *svm)
1845 nested_vmcb->control.event_inj, 1845 nested_vmcb->control.event_inj,
1846 nested_vmcb->control.nested_ctl); 1846 nested_vmcb->control.nested_ctl);
1847 1847
1848 trace_kvm_nested_intercepts(nested_vmcb->control.intercept_cr_read,
1849 nested_vmcb->control.intercept_cr_write,
1850 nested_vmcb->control.intercept_exceptions,
1851 nested_vmcb->control.intercept);
1852
1848 /* Clear internal status */ 1853 /* Clear internal status */
1849 kvm_clear_exception_queue(&svm->vcpu); 1854 kvm_clear_exception_queue(&svm->vcpu);
1850 kvm_clear_interrupt_queue(&svm->vcpu); 1855 kvm_clear_interrupt_queue(&svm->vcpu);
diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h
index 12f8d2dee984..17b52ccd9774 100644
--- a/arch/x86/kvm/trace.h
+++ b/arch/x86/kvm/trace.h
@@ -419,6 +419,28 @@ TRACE_EVENT(kvm_nested_vmrun,
419 __entry->npt ? "on" : "off") 419 __entry->npt ? "on" : "off")
420); 420);
421 421
422TRACE_EVENT(kvm_nested_intercepts,
423 TP_PROTO(__u16 cr_read, __u16 cr_write, __u32 exceptions, __u64 intercept),
424 TP_ARGS(cr_read, cr_write, exceptions, intercept),
425
426 TP_STRUCT__entry(
427 __field( __u16, cr_read )
428 __field( __u16, cr_write )
429 __field( __u32, exceptions )
430 __field( __u64, intercept )
431 ),
432
433 TP_fast_assign(
434 __entry->cr_read = cr_read;
435 __entry->cr_write = cr_write;
436 __entry->exceptions = exceptions;
437 __entry->intercept = intercept;
438 ),
439
440 TP_printk("cr_read: %04x cr_write: %04x excp: %08x intercept: %016llx",
441 __entry->cr_read, __entry->cr_write, __entry->exceptions,
442 __entry->intercept)
443);
422/* 444/*
423 * Tracepoint for #VMEXIT while nested 445 * Tracepoint for #VMEXIT while nested
424 */ 446 */
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 3a367f35cebf..1aa4d6e26bad 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5909,3 +5909,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_nested_vmexit_inject);
5909EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_nested_intr_vmexit); 5909EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_nested_intr_vmexit);
5910EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_invlpga); 5910EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_invlpga);
5911EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_skinit); 5911EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_skinit);
5912EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_nested_intercepts);