summaryrefslogtreecommitdiff
path: root/arch/x86/kvm/trace.h
diff options
context:
space:
mode:
authorSean Christopherson <sean.j.christopherson@intel.com>2020-09-23 13:13:46 -0700
committerPaolo Bonzini <pbonzini@redhat.com>2020-09-28 07:57:51 -0400
commit235ba74f008d2e0936b29f77f68d4e2f73ffd24a (patch)
tree04e9a17a4e1278a27eaf47b480160c9b681c38ea /arch/x86/kvm/trace.h
parentf315f2b140156f456a091393fd0392acf9e6fb31 (diff)
KVM: x86: Add intr/vectoring info and error code to kvm_exit tracepoint
Extend the kvm_exit tracepoint to align it with kvm_nested_vmexit in terms of what information is captured. On SVM, add interrupt info and error code, while on VMX it add IDT vectoring and error code. This sets the stage for macrofying the kvm_exit tracepoint definition so that it can be reused for kvm_nested_vmexit without loss of information. Opportunistically stuff a zero for VM_EXIT_INTR_INFO if the VM-Enter failed, as the field is guaranteed to be invalid. Note, it'd be possible to further filter the interrupt/exception fields based on the VM-Exit reason, but the helper is intended only for tracepoints, i.e. an extra VMREAD or two is a non-issue, the failed VM-Enter case is just low hanging fruit. Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> Message-Id: <20200923201349.16097-5-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/trace.h')
-rw-r--r--arch/x86/kvm/trace.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h
index bb5e44f83262..7e3ad6419f90 100644
--- a/arch/x86/kvm/trace.h
+++ b/arch/x86/kvm/trace.h
@@ -248,6 +248,8 @@ TRACE_EVENT(kvm_exit,
__field( u32, isa )
__field( u64, info1 )
__field( u64, info2 )
+ __field( u32, intr_info )
+ __field( u32, error_code )
__field( unsigned int, vcpu_id )
),
@@ -257,13 +259,17 @@ TRACE_EVENT(kvm_exit,
__entry->isa = isa;
__entry->vcpu_id = vcpu->vcpu_id;
kvm_x86_ops.get_exit_info(vcpu, &__entry->info1,
- &__entry->info2);
+ &__entry->info2,
+ &__entry->intr_info,
+ &__entry->error_code);
),
- TP_printk("vcpu %u reason %s%s%s rip 0x%lx info %llx %llx",
+ TP_printk("vcpu %u reason %s%s%s rip 0x%lx info1 0x%016llx "
+ "info2 0x%016llx intr_info 0x%08x error_code 0x%08x",
__entry->vcpu_id,
kvm_print_exit_reason(__entry->exit_reason, __entry->isa),
- __entry->guest_rip, __entry->info1, __entry->info2)
+ __entry->guest_rip, __entry->info1, __entry->info2,
+ __entry->intr_info, __entry->error_code)
);
/*