@@ -2944,6 +2944,8 @@ void kvm_hv_vcpu_suspend_tlb_flush(struct kvm_vcpu *vcpu, int vcpu_id)
/* waiting_on's store should happen before suspended's */
WRITE_ONCE(vcpu->arch.hyperv->waiting_on, vcpu_id);
WRITE_ONCE(vcpu->arch.hyperv->suspended, true);
+
+ trace_kvm_hv_vcpu_suspend_tlb_flush(vcpu->vcpu_id, vcpu_id);
}
void kvm_hv_vcpu_unsuspend_tlb_flush(struct kvm_vcpu *vcpu)
@@ -2962,6 +2964,8 @@ void kvm_hv_vcpu_unsuspend_tlb_flush(struct kvm_vcpu *vcpu)
WRITE_ONCE(v->arch.hyperv->waiting_on, -1);
WRITE_ONCE(v->arch.hyperv->suspended, false);
__set_bit(i, vcpu_mask);
+
+ trace_kvm_hv_vcpu_unsuspend_tlb_flush(v->vcpu_id);
}
}
@@ -1871,6 +1871,45 @@ TRACE_EVENT(kvm_rmp_fault,
__entry->error_code, __entry->rmp_level, __entry->psmash_ret)
);
+/*
+ * Tracepoint for Hyper-V TlbFlushInhibit suspension
+ */
+TRACE_EVENT(kvm_hv_vcpu_suspend_tlb_flush,
+ TP_PROTO(int vcpu_id, int waiting_on),
+ TP_ARGS(vcpu_id, waiting_on),
+
+ TP_STRUCT__entry(
+ __field(int, vcpu_id)
+ __field(int, waiting_on)
+ ),
+
+ TP_fast_assign(
+ __entry->vcpu_id = vcpu_id;
+ __entry->waiting_on = waiting_on;
+ ),
+
+ TP_printk("suspending vcpu %u waiting on %u",
+ __entry->vcpu_id, __entry->waiting_on)
+);
+
+/*
+ * Tracepoint for Hyper-V TlbFlushInhibit unsuspension
+ */
+TRACE_EVENT(kvm_hv_vcpu_unsuspend_tlb_flush,
+ TP_PROTO(int vcpu_id),
+ TP_ARGS(vcpu_id),
+ TP_STRUCT__entry(
+ __field(int, vcpu_id)
+ ),
+
+ TP_fast_assign(
+ __entry->vcpu_id = vcpu_id;
+ ),
+
+ TP_printk("unsuspending vcpu %u",
+ __entry->vcpu_id)
+);
+
#endif /* _TRACE_KVM_H */
#undef TRACE_INCLUDE_PATH
Add trace events to track suspensions and unsuspensions vCPUs, because of Hyper-V mechanisms. Signed-off-by: Nikolas Wipper <nikwip@amazon.de> --- arch/x86/kvm/hyperv.c | 4 ++++ arch/x86/kvm/trace.h | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+)