1 /* SPDX-License-Identifier: GPL-2.0 */
2 #if !defined(_TRACE_KVM_BOOKE_H) || defined(TRACE_HEADER_MULTI_READ)
3 #define _TRACE_KVM_BOOKE_H
5 #include <linux/tracepoint.h>
8 #define TRACE_SYSTEM kvm_booke
10 #define kvm_trace_symbol_exit \
12 {1, "MACHINE_CHECK"}, \
13 {2, "DATA_STORAGE"}, \
14 {3, "INST_STORAGE"}, \
21 {10, "DECREMENTER"}, \
27 {32, "SPE_UNAVAIL"}, \
28 {33, "SPE_FP_DATA"}, \
29 {34, "SPE_FP_ROUND"}, \
30 {35, "PERFORMANCE_MONITOR"}, \
32 {37, "DOORBELL_CRITICAL"}, \
33 {38, "GUEST_DBELL"}, \
34 {39, "GUEST_DBELL_CRIT"}, \
39 TP_PROTO(unsigned int exit_nr, struct kvm_vcpu *vcpu),
40 TP_ARGS(exit_nr, vcpu),
43 __field( unsigned int, exit_nr )
44 __field( unsigned long, pc )
45 __field( unsigned long, msr )
46 __field( unsigned long, dar )
47 __field( unsigned long, last_inst )
51 __entry->exit_nr = exit_nr;
52 __entry->pc = kvmppc_get_pc(vcpu);
53 __entry->dar = kvmppc_get_fault_dar(vcpu);
54 __entry->msr = vcpu->arch.shared->msr;
55 __entry->last_inst = vcpu->arch.last_inst;
64 __print_symbolic(__entry->exit_nr, kvm_trace_symbol_exit),
72 TRACE_EVENT(kvm_booke206_stlb_write,
73 TP_PROTO(__u32 mas0, __u32 mas8, __u32 mas1, __u64 mas2, __u64 mas7_3),
74 TP_ARGS(mas0, mas8, mas1, mas2, mas7_3),
77 __field( __u32, mas0 )
78 __field( __u32, mas8 )
79 __field( __u32, mas1 )
80 __field( __u64, mas2 )
81 __field( __u64, mas7_3 )
89 __entry->mas7_3 = mas7_3;
92 TP_printk("mas0=%x mas8=%x mas1=%x mas2=%llx mas7_3=%llx",
93 __entry->mas0, __entry->mas8, __entry->mas1,
94 __entry->mas2, __entry->mas7_3)
97 TRACE_EVENT(kvm_booke206_gtlb_write,
98 TP_PROTO(__u32 mas0, __u32 mas1, __u64 mas2, __u64 mas7_3),
99 TP_ARGS(mas0, mas1, mas2, mas7_3),
102 __field( __u32, mas0 )
103 __field( __u32, mas1 )
104 __field( __u64, mas2 )
105 __field( __u64, mas7_3 )
109 __entry->mas0 = mas0;
110 __entry->mas1 = mas1;
111 __entry->mas2 = mas2;
112 __entry->mas7_3 = mas7_3;
115 TP_printk("mas0=%x mas1=%x mas2=%llx mas7_3=%llx",
116 __entry->mas0, __entry->mas1,
117 __entry->mas2, __entry->mas7_3)
120 TRACE_EVENT(kvm_booke206_ref_release,
121 TP_PROTO(__u64 pfn, __u32 flags),
125 __field( __u64, pfn )
126 __field( __u32, flags )
131 __entry->flags = flags;
134 TP_printk("pfn=%llx flags=%x",
135 __entry->pfn, __entry->flags)
138 #ifdef CONFIG_SPE_POSSIBLE
139 #define kvm_trace_symbol_irqprio_spe \
140 {BOOKE_IRQPRIO_SPE_UNAVAIL, "SPE_UNAVAIL"}, \
141 {BOOKE_IRQPRIO_SPE_FP_DATA, "SPE_FP_DATA"}, \
142 {BOOKE_IRQPRIO_SPE_FP_ROUND, "SPE_FP_ROUND"},
144 #define kvm_trace_symbol_irqprio_spe
147 #ifdef CONFIG_PPC_E500MC
148 #define kvm_trace_symbol_irqprio_e500mc \
149 {BOOKE_IRQPRIO_ALTIVEC_UNAVAIL, "ALTIVEC_UNAVAIL"}, \
150 {BOOKE_IRQPRIO_ALTIVEC_ASSIST, "ALTIVEC_ASSIST"},
152 #define kvm_trace_symbol_irqprio_e500mc
155 #define kvm_trace_symbol_irqprio \
156 kvm_trace_symbol_irqprio_spe \
157 kvm_trace_symbol_irqprio_e500mc \
158 {BOOKE_IRQPRIO_DATA_STORAGE, "DATA_STORAGE"}, \
159 {BOOKE_IRQPRIO_INST_STORAGE, "INST_STORAGE"}, \
160 {BOOKE_IRQPRIO_ALIGNMENT, "ALIGNMENT"}, \
161 {BOOKE_IRQPRIO_PROGRAM, "PROGRAM"}, \
162 {BOOKE_IRQPRIO_FP_UNAVAIL, "FP_UNAVAIL"}, \
163 {BOOKE_IRQPRIO_SYSCALL, "SYSCALL"}, \
164 {BOOKE_IRQPRIO_AP_UNAVAIL, "AP_UNAVAIL"}, \
165 {BOOKE_IRQPRIO_DTLB_MISS, "DTLB_MISS"}, \
166 {BOOKE_IRQPRIO_ITLB_MISS, "ITLB_MISS"}, \
167 {BOOKE_IRQPRIO_MACHINE_CHECK, "MACHINE_CHECK"}, \
168 {BOOKE_IRQPRIO_DEBUG, "DEBUG"}, \
169 {BOOKE_IRQPRIO_CRITICAL, "CRITICAL"}, \
170 {BOOKE_IRQPRIO_WATCHDOG, "WATCHDOG"}, \
171 {BOOKE_IRQPRIO_EXTERNAL, "EXTERNAL"}, \
172 {BOOKE_IRQPRIO_FIT, "FIT"}, \
173 {BOOKE_IRQPRIO_DECREMENTER, "DECREMENTER"}, \
174 {BOOKE_IRQPRIO_PERFORMANCE_MONITOR, "PERFORMANCE_MONITOR"}, \
175 {BOOKE_IRQPRIO_EXTERNAL_LEVEL, "EXTERNAL_LEVEL"}, \
176 {BOOKE_IRQPRIO_DBELL, "DBELL"}, \
177 {BOOKE_IRQPRIO_DBELL_CRIT, "DBELL_CRIT"} \
179 TRACE_EVENT(kvm_booke_queue_irqprio,
180 TP_PROTO(struct kvm_vcpu *vcpu, unsigned int priority),
181 TP_ARGS(vcpu, priority),
184 __field( __u32, cpu_nr )
185 __field( __u32, priority )
186 __field( unsigned long, pending )
190 __entry->cpu_nr = vcpu->vcpu_id;
191 __entry->priority = priority;
192 __entry->pending = vcpu->arch.pending_exceptions;
195 TP_printk("vcpu=%x prio=%s pending=%lx",
197 __print_symbolic(__entry->priority, kvm_trace_symbol_irqprio),
203 /* This part must be outside protection */
205 #undef TRACE_INCLUDE_PATH
206 #undef TRACE_INCLUDE_FILE
208 #define TRACE_INCLUDE_PATH .
209 #define TRACE_INCLUDE_FILE trace_booke
211 #include <trace/define_trace.h>