diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2009-10-09 10:08:29 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-12-03 02:32:15 -0500 |
commit | 17897f366847a9ef8a13e3671a0eb1c15422abed (patch) | |
tree | c43e10807f6ff17a5d6f0b65bee7b319437fc00c /arch/x86 | |
parent | d8cabddf7e8fbdced2dd668c98d7762c7ef75245 (diff) |
KVM: SVM: Add tracepoint for injected #vmexit
This patch adds a tracepoint for a nested #vmexit that gets
re-injected to the guest.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kvm/svm.c | 6 | ||||
-rw-r--r-- | arch/x86/kvm/trace.h | 33 | ||||
-rw-r--r-- | arch/x86/kvm/x86.c | 1 |
3 files changed, 40 insertions, 0 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index edf6e8b2b84e..369eeb86e87c 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -1592,6 +1592,12 @@ static int nested_svm_vmexit(struct vcpu_svm *svm) | |||
1592 | struct vmcb *hsave = svm->nested.hsave; | 1592 | struct vmcb *hsave = svm->nested.hsave; |
1593 | struct vmcb *vmcb = svm->vmcb; | 1593 | struct vmcb *vmcb = svm->vmcb; |
1594 | 1594 | ||
1595 | trace_kvm_nested_vmexit_inject(vmcb->control.exit_code, | ||
1596 | vmcb->control.exit_info_1, | ||
1597 | vmcb->control.exit_info_2, | ||
1598 | vmcb->control.exit_int_info, | ||
1599 | vmcb->control.exit_int_info_err); | ||
1600 | |||
1595 | nested_vmcb = nested_svm_map(svm, svm->nested.vmcb, KM_USER0); | 1601 | nested_vmcb = nested_svm_map(svm, svm->nested.vmcb, KM_USER0); |
1596 | if (!nested_vmcb) | 1602 | if (!nested_vmcb) |
1597 | return 1; | 1603 | return 1; |
diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h index a7eb6299a261..4d6bb5ee39b5 100644 --- a/arch/x86/kvm/trace.h +++ b/arch/x86/kvm/trace.h | |||
@@ -418,6 +418,39 @@ TRACE_EVENT(kvm_nested_vmexit, | |||
418 | __entry->exit_int_info, __entry->exit_int_info_err) | 418 | __entry->exit_int_info, __entry->exit_int_info_err) |
419 | ); | 419 | ); |
420 | 420 | ||
421 | /* | ||
422 | * Tracepoint for #VMEXIT reinjected to the guest | ||
423 | */ | ||
424 | TRACE_EVENT(kvm_nested_vmexit_inject, | ||
425 | TP_PROTO(__u32 exit_code, | ||
426 | __u64 exit_info1, __u64 exit_info2, | ||
427 | __u32 exit_int_info, __u32 exit_int_info_err), | ||
428 | TP_ARGS(exit_code, exit_info1, exit_info2, | ||
429 | exit_int_info, exit_int_info_err), | ||
430 | |||
431 | TP_STRUCT__entry( | ||
432 | __field( __u32, exit_code ) | ||
433 | __field( __u64, exit_info1 ) | ||
434 | __field( __u64, exit_info2 ) | ||
435 | __field( __u32, exit_int_info ) | ||
436 | __field( __u32, exit_int_info_err ) | ||
437 | ), | ||
438 | |||
439 | TP_fast_assign( | ||
440 | __entry->exit_code = exit_code; | ||
441 | __entry->exit_info1 = exit_info1; | ||
442 | __entry->exit_info2 = exit_info2; | ||
443 | __entry->exit_int_info = exit_int_info; | ||
444 | __entry->exit_int_info_err = exit_int_info_err; | ||
445 | ), | ||
446 | |||
447 | TP_printk("reason: %s ext_inf1: 0x%016llx " | ||
448 | "ext_inf2: 0x%016llx ext_int: 0x%08x ext_int_err: 0x%08x\n", | ||
449 | ftrace_print_symbols_seq(p, __entry->exit_code, | ||
450 | kvm_x86_ops->exit_reasons_str), | ||
451 | __entry->exit_info1, __entry->exit_info2, | ||
452 | __entry->exit_int_info, __entry->exit_int_info_err) | ||
453 | ); | ||
421 | #endif /* _TRACE_KVM_H */ | 454 | #endif /* _TRACE_KVM_H */ |
422 | 455 | ||
423 | /* This part must be outside protection */ | 456 | /* This part must be outside protection */ |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 192d58efc6dc..a522d9ba81b3 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -4986,3 +4986,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_msr); | |||
4986 | EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_cr); | 4986 | EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_cr); |
4987 | EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_nested_vmrun); | 4987 | EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_nested_vmrun); |
4988 | EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_nested_vmexit); | 4988 | EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_nested_vmexit); |
4989 | EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_nested_vmexit_inject); | ||