Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: KVM: extend WFI tracepoint to differentiate between wfi and wfe

Currently the trace printk talks about "wfi" only, though the trace
point triggers both on wfi and wfe traps.
Add a parameter to differentiate between the two.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Wei Huang <wei@redhat.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>

authored by

Andre Przywara and committed by
Christoffer Dall
924de80d 0d97f884

+12 -7
+5 -3
arch/arm/kvm/handle_exit.c
··· 87 87 */ 88 88 static int kvm_handle_wfx(struct kvm_vcpu *vcpu, struct kvm_run *run) 89 89 { 90 - trace_kvm_wfi(*vcpu_pc(vcpu)); 91 - if (kvm_vcpu_get_hsr(vcpu) & HSR_WFI_IS_WFE) 90 + if (kvm_vcpu_get_hsr(vcpu) & HSR_WFI_IS_WFE) { 91 + trace_kvm_wfx(*vcpu_pc(vcpu), true); 92 92 kvm_vcpu_on_spin(vcpu); 93 - else 93 + } else { 94 + trace_kvm_wfx(*vcpu_pc(vcpu), false); 94 95 kvm_vcpu_block(vcpu); 96 + } 95 97 96 98 kvm_skip_instr(vcpu, kvm_vcpu_trap_il_is32bit(vcpu)); 97 99
+7 -4
arch/arm/kvm/trace.h
··· 140 140 __entry->CRm, __entry->Op2) 141 141 ); 142 142 143 - TRACE_EVENT(kvm_wfi, 144 - TP_PROTO(unsigned long vcpu_pc), 145 - TP_ARGS(vcpu_pc), 143 + TRACE_EVENT(kvm_wfx, 144 + TP_PROTO(unsigned long vcpu_pc, bool is_wfe), 145 + TP_ARGS(vcpu_pc, is_wfe), 146 146 147 147 TP_STRUCT__entry( 148 148 __field( unsigned long, vcpu_pc ) 149 + __field( bool, is_wfe ) 149 150 ), 150 151 151 152 TP_fast_assign( 152 153 __entry->vcpu_pc = vcpu_pc; 154 + __entry->is_wfe = is_wfe; 153 155 ), 154 156 155 - TP_printk("guest executed wfi at: 0x%08lx", __entry->vcpu_pc) 157 + TP_printk("guest executed wf%c at: 0x%08lx", 158 + __entry->is_wfe ? 'e' : 'i', __entry->vcpu_pc) 156 159 ); 157 160 158 161 TRACE_EVENT(kvm_unmap_hva,