From: Zenghui Yu yuzenghui@huawei.com
euleros inclusion category: feature bugzilla: 46842 CVE: NA
--------------------------------
Add trace to print LR values
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 | 43 +++++++++++++++++++++++++++++++++++++ virt/kvm/arm/vgic/vgic-v3.c | 4 ++++ 2 files changed, 47 insertions(+)
diff --git a/virt/kvm/arm/vgic/trace.h b/virt/kvm/arm/vgic/trace.h index a7b23721b94f..d9abaac6b4d5 100644 --- a/virt/kvm/arm/vgic/trace.h +++ b/virt/kvm/arm/vgic/trace.h @@ -104,6 +104,49 @@ TRACE_EVENT(vgic_flush_lr_state, __entry->vcpu_id, __entry->used_lrs, __entry->multi_sgi) );
+TRACE_EVENT(vgic_v3_populate_lr, + TP_PROTO(unsigned long vcpu_id, __u32 irq, __u64 val, int lr), + TP_ARGS(vcpu_id, irq, val, lr), + + TP_STRUCT__entry( + __field(unsigned long, vcpu_id) + __field(__u32, irq) + __field(__u64, val) + __field(int, lr) + ), + + TP_fast_assign( + __entry->vcpu_id = vcpu_id; + __entry->irq = irq; + __entry->val = val; + __entry->lr = lr; + ), + + TP_printk("VCPU: %ld, IRQ: %d, LR: 0x%llx, Index: %d", + __entry->vcpu_id, __entry->irq, __entry->val, __entry->lr) +); + +TRACE_EVENT(vgic_v3_fold_lr_state, + TP_PROTO(unsigned long vcpu_id, __u32 irq, __u64 val, int lr), + TP_ARGS(vcpu_id, irq, val, lr), + + TP_STRUCT__entry( + __field(unsigned long, vcpu_id) + __field(__u32, irq) + __field(__u64, val) + __field(int, lr) + ), + + TP_fast_assign( + __entry->vcpu_id = vcpu_id; + __entry->irq = irq; + __entry->val = val; + __entry->lr = lr; + ), + + TP_printk("VCPU: %ld, IRQ: %d, LR: 0x%llx, Index: %d", + __entry->vcpu_id, __entry->irq, __entry->val, __entry->lr) +);
#endif /* _TRACE_VGIC_H */
diff --git a/virt/kvm/arm/vgic/vgic-v3.c b/virt/kvm/arm/vgic/vgic-v3.c index 30b3b8284db9..a9c6afec8480 100644 --- a/virt/kvm/arm/vgic/vgic-v3.c +++ b/virt/kvm/arm/vgic/vgic-v3.c @@ -21,6 +21,7 @@ #include <asm/kvm_asm.h>
#include "vgic.h" +#include "trace.h"
static bool group0_trap; static bool group1_trap; @@ -67,6 +68,8 @@ void vgic_v3_fold_lr_state(struct kvm_vcpu *vcpu) is_v2_sgi = vgic_irq_is_sgi(intid); }
+ trace_vgic_v3_fold_lr_state(vcpu->vcpu_id, intid, val, lr); + /* Notify fds when the guest EOI'ed a level-triggered IRQ */ if (lr_signals_eoi_mi(val) && vgic_valid_spi(vcpu->kvm, intid)) kvm_notify_acked_irq(vcpu->kvm, 0, @@ -207,6 +210,7 @@ void vgic_v3_populate_lr(struct kvm_vcpu *vcpu, struct vgic_irq *irq, int lr) val |= (u64)irq->priority << ICH_LR_PRIORITY_SHIFT;
vcpu->arch.vgic_cpu.vgic_v3.vgic_lr[lr] = val; + trace_vgic_v3_populate_lr(vcpu->vcpu_id, irq->intid, val, lr); }
void vgic_v3_clear_lr(struct kvm_vcpu *vcpu, int lr)