From: Zenghui Yu yuzenghui@huawei.com
euleros inclusion category: feature bugzilla: 46842 CVE: NA
--------------------------------
Add trace to print the used_lrs, multi_sgi, vcpu_id
Signed-off-by: Zenghui Yu yuzenghui@huawei.com Signed-off-by: Xiangyou Xie xiexiangyou@huawei.com Reviewed-by: Ying Fang fangying1@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- virt/kvm/arm/vgic/trace.h | 35 +++++++++++++++++++++++++++++++++++ virt/kvm/arm/vgic/vgic.c | 4 ++++ 2 files changed, 39 insertions(+)
diff --git a/virt/kvm/arm/vgic/trace.h b/virt/kvm/arm/vgic/trace.h index f959ffa54156..a7b23721b94f 100644 --- a/virt/kvm/arm/vgic/trace.h +++ b/virt/kvm/arm/vgic/trace.h @@ -69,6 +69,41 @@ TRACE_EVENT(compute_ap_list_depth, __entry->enabled, __entry->hw, __entry->config) );
+TRACE_EVENT(vgic_set_underflow, + TP_PROTO(unsigned long vcpu_id), + TP_ARGS(vcpu_id), + + TP_STRUCT__entry( + __field(unsigned long, vcpu_id) + ), + + TP_fast_assign( + __entry->vcpu_id = vcpu_id; + ), + + TP_printk("VCPU: %ld", __entry->vcpu_id) +); + +TRACE_EVENT(vgic_flush_lr_state, + TP_PROTO(unsigned long vcpu_id, unsigned int used_lrs, bool multi_sgi), + TP_ARGS(vcpu_id, used_lrs, multi_sgi), + + TP_STRUCT__entry( + __field(unsigned long, vcpu_id) + __field(unsigned int, used_lrs) + __field(bool, multi_sgi) + ), + + TP_fast_assign( + __entry->vcpu_id = vcpu_id; + __entry->used_lrs = used_lrs; + __entry->multi_sgi = multi_sgi; + ), + + TP_printk("VCPU: %ld, used_lrs: %d, multi_sgi: %d", + __entry->vcpu_id, __entry->used_lrs, __entry->multi_sgi) +); +
#endif /* _TRACE_VGIC_H */
diff --git a/virt/kvm/arm/vgic/vgic.c b/virt/kvm/arm/vgic/vgic.c index 38868b09ba94..11e471222e21 100644 --- a/virt/kvm/arm/vgic/vgic.c +++ b/virt/kvm/arm/vgic/vgic.c @@ -757,6 +757,8 @@ static inline void vgic_clear_lr(struct kvm_vcpu *vcpu, int lr)
static inline void vgic_set_underflow(struct kvm_vcpu *vcpu) { + trace_vgic_set_underflow(vcpu->vcpu_id); + if (kvm_vgic_global_state.type == VGIC_V2) vgic_v2_set_underflow(vcpu); else @@ -844,6 +846,8 @@ static void vgic_flush_lr_state(struct kvm_vcpu *vcpu)
vcpu->arch.vgic_cpu.used_lrs = count;
+ trace_vgic_flush_lr_state(vcpu->vcpu_id, vcpu->arch.vgic_cpu.used_lrs, + multi_sgi); /* Nuke remaining LRs */ for ( ; count < kvm_vgic_global_state.nr_lr; count++) vgic_clear_lr(vcpu, count);