aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2009-10-09 10:08:27 -0400
committerAvi Kivity <avi@redhat.com>2009-12-03 02:32:15 -0500
commit0ac406de8f3780c8e0801d5719e1ec531d4a6ec4 (patch)
treeb489495da026d557b65f579c13f7b23b7b18d99b /arch
parentcd3ff653ae0b45bac7a19208e9c75034fcacc85f (diff)
KVM: SVM: Add tracepoint for nested vmrun
This patch adds a dedicated kvm tracepoint for a nested vmrun. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/svm.c6
-rw-r--r--arch/x86/kvm/trace.h33
-rw-r--r--arch/x86/kvm/x86.c1
3 files changed, 40 insertions, 0 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 884bffc70c7f..907af3f3a7af 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -1726,6 +1726,12 @@ static bool nested_svm_vmrun(struct vcpu_svm *svm)
1726 /* nested_vmcb is our indicator if nested SVM is activated */ 1726 /* nested_vmcb is our indicator if nested SVM is activated */
1727 svm->nested.vmcb = svm->vmcb->save.rax; 1727 svm->nested.vmcb = svm->vmcb->save.rax;
1728 1728
1729 trace_kvm_nested_vmrun(svm->vmcb->save.rip - 3, svm->nested.vmcb,
1730 nested_vmcb->save.rip,
1731 nested_vmcb->control.int_ctl,
1732 nested_vmcb->control.event_inj,
1733 nested_vmcb->control.nested_ctl);
1734
1729 /* Clear internal status */ 1735 /* Clear internal status */
1730 kvm_clear_exception_queue(&svm->vcpu); 1736 kvm_clear_exception_queue(&svm->vcpu);
1731 kvm_clear_interrupt_queue(&svm->vcpu); 1737 kvm_clear_interrupt_queue(&svm->vcpu);
diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h
index 0d480e77eacf..b5798e12182a 100644
--- a/arch/x86/kvm/trace.h
+++ b/arch/x86/kvm/trace.h
@@ -349,6 +349,39 @@ TRACE_EVENT(kvm_apic_accept_irq,
349 __entry->coalesced ? " (coalesced)" : "") 349 __entry->coalesced ? " (coalesced)" : "")
350); 350);
351 351
352/*
353 * Tracepoint for nested VMRUN
354 */
355TRACE_EVENT(kvm_nested_vmrun,
356 TP_PROTO(__u64 rip, __u64 vmcb, __u64 nested_rip, __u32 int_ctl,
357 __u32 event_inj, bool npt),
358 TP_ARGS(rip, vmcb, nested_rip, int_ctl, event_inj, npt),
359
360 TP_STRUCT__entry(
361 __field( __u64, rip )
362 __field( __u64, vmcb )
363 __field( __u64, nested_rip )
364 __field( __u32, int_ctl )
365 __field( __u32, event_inj )
366 __field( bool, npt )
367 ),
368
369 TP_fast_assign(
370 __entry->rip = rip;
371 __entry->vmcb = vmcb;
372 __entry->nested_rip = nested_rip;
373 __entry->int_ctl = int_ctl;
374 __entry->event_inj = event_inj;
375 __entry->npt = npt;
376 ),
377
378 TP_printk("rip: 0x%016llx vmcb: 0x%016llx nrip: 0x%016llx int_ctl: 0x%08x "
379 "event_inj: 0x%08x npt: %s\n",
380 __entry->rip, __entry->vmcb, __entry->nested_rip,
381 __entry->int_ctl, __entry->event_inj,
382 __entry->npt ? "on" : "off")
383);
384
352#endif /* _TRACE_KVM_H */ 385#endif /* _TRACE_KVM_H */
353 386
354/* This part must be outside protection */ 387/* This part must be outside protection */
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 4de5bc0a8e86..3ab2f9042dd0 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4984,3 +4984,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_inj_virq);
4984EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_page_fault); 4984EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_page_fault);
4985EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_msr); 4985EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_msr);
4986EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_cr); 4986EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_cr);
4987EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_nested_vmrun);