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_unmap_hva
,
73 TP_PROTO(unsigned long hva
),
77 __field( unsigned long, hva
)
84 TP_printk("unmap hva 0x%lx\n", __entry
->hva
)
87 TRACE_EVENT(kvm_booke206_stlb_write
,
88 TP_PROTO(__u32 mas0
, __u32 mas8
, __u32 mas1
, __u64 mas2
, __u64 mas7_3
),
89 TP_ARGS(mas0
, mas8
, mas1
, mas2
, mas7_3
),
92 __field( __u32
, mas0
)
93 __field( __u32
, mas8
)
94 __field( __u32
, mas1
)
95 __field( __u64
, mas2
)
96 __field( __u64
, mas7_3
)
100 __entry
->mas0
= mas0
;
101 __entry
->mas8
= mas8
;
102 __entry
->mas1
= mas1
;
103 __entry
->mas2
= mas2
;
104 __entry
->mas7_3
= mas7_3
;
107 TP_printk("mas0=%x mas8=%x mas1=%x mas2=%llx mas7_3=%llx",
108 __entry
->mas0
, __entry
->mas8
, __entry
->mas1
,
109 __entry
->mas2
, __entry
->mas7_3
)
112 TRACE_EVENT(kvm_booke206_gtlb_write
,
113 TP_PROTO(__u32 mas0
, __u32 mas1
, __u64 mas2
, __u64 mas7_3
),
114 TP_ARGS(mas0
, mas1
, mas2
, mas7_3
),
117 __field( __u32
, mas0
)
118 __field( __u32
, mas1
)
119 __field( __u64
, mas2
)
120 __field( __u64
, mas7_3
)
124 __entry
->mas0
= mas0
;
125 __entry
->mas1
= mas1
;
126 __entry
->mas2
= mas2
;
127 __entry
->mas7_3
= mas7_3
;
130 TP_printk("mas0=%x mas1=%x mas2=%llx mas7_3=%llx",
131 __entry
->mas0
, __entry
->mas1
,
132 __entry
->mas2
, __entry
->mas7_3
)
135 TRACE_EVENT(kvm_booke206_ref_release
,
136 TP_PROTO(__u64 pfn
, __u32 flags
),
140 __field( __u64
, pfn
)
141 __field( __u32
, flags
)
146 __entry
->flags
= flags
;
149 TP_printk("pfn=%llx flags=%x",
150 __entry
->pfn
, __entry
->flags
)
153 #ifdef CONFIG_SPE_POSSIBLE
154 #define kvm_trace_symbol_irqprio_spe \
155 {BOOKE_IRQPRIO_SPE_UNAVAIL, "SPE_UNAVAIL"}, \
156 {BOOKE_IRQPRIO_SPE_FP_DATA, "SPE_FP_DATA"}, \
157 {BOOKE_IRQPRIO_SPE_FP_ROUND, "SPE_FP_ROUND"},
159 #define kvm_trace_symbol_irqprio_spe
162 #ifdef CONFIG_PPC_E500MC
163 #define kvm_trace_symbol_irqprio_e500mc \
164 {BOOKE_IRQPRIO_ALTIVEC_UNAVAIL, "ALTIVEC_UNAVAIL"}, \
165 {BOOKE_IRQPRIO_ALTIVEC_ASSIST, "ALTIVEC_ASSIST"},
167 #define kvm_trace_symbol_irqprio_e500mc
170 #define kvm_trace_symbol_irqprio \
171 kvm_trace_symbol_irqprio_spe \
172 kvm_trace_symbol_irqprio_e500mc \
173 {BOOKE_IRQPRIO_DATA_STORAGE, "DATA_STORAGE"}, \
174 {BOOKE_IRQPRIO_INST_STORAGE, "INST_STORAGE"}, \
175 {BOOKE_IRQPRIO_ALIGNMENT, "ALIGNMENT"}, \
176 {BOOKE_IRQPRIO_PROGRAM, "PROGRAM"}, \
177 {BOOKE_IRQPRIO_FP_UNAVAIL, "FP_UNAVAIL"}, \
178 {BOOKE_IRQPRIO_SYSCALL, "SYSCALL"}, \
179 {BOOKE_IRQPRIO_AP_UNAVAIL, "AP_UNAVAIL"}, \
180 {BOOKE_IRQPRIO_DTLB_MISS, "DTLB_MISS"}, \
181 {BOOKE_IRQPRIO_ITLB_MISS, "ITLB_MISS"}, \
182 {BOOKE_IRQPRIO_MACHINE_CHECK, "MACHINE_CHECK"}, \
183 {BOOKE_IRQPRIO_DEBUG, "DEBUG"}, \
184 {BOOKE_IRQPRIO_CRITICAL, "CRITICAL"}, \
185 {BOOKE_IRQPRIO_WATCHDOG, "WATCHDOG"}, \
186 {BOOKE_IRQPRIO_EXTERNAL, "EXTERNAL"}, \
187 {BOOKE_IRQPRIO_FIT, "FIT"}, \
188 {BOOKE_IRQPRIO_DECREMENTER, "DECREMENTER"}, \
189 {BOOKE_IRQPRIO_PERFORMANCE_MONITOR, "PERFORMANCE_MONITOR"}, \
190 {BOOKE_IRQPRIO_EXTERNAL_LEVEL, "EXTERNAL_LEVEL"}, \
191 {BOOKE_IRQPRIO_DBELL, "DBELL"}, \
192 {BOOKE_IRQPRIO_DBELL_CRIT, "DBELL_CRIT"} \
194 TRACE_EVENT(kvm_booke_queue_irqprio,
195 TP_PROTO(struct kvm_vcpu
*vcpu
, unsigned int priority
),
196 TP_ARGS(vcpu
, priority
),
199 __field( __u32
, cpu_nr
)
200 __field( __u32
, priority
)
201 __field( unsigned long, pending
)
205 __entry
->cpu_nr
= vcpu
->vcpu_id
;
206 __entry
->priority
= priority
;
207 __entry
->pending
= vcpu
->arch
.pending_exceptions
;
210 TP_printk("vcpu=%x prio=%s pending=%lx",
212 __print_symbolic(__entry
->priority
, kvm_trace_symbol_irqprio
),
218 /* This part must be outside protection */
220 #undef TRACE_INCLUDE_PATH
221 #undef TRACE_INCLUDE_FILE
223 #define TRACE_INCLUDE_PATH .
224 #define TRACE_INCLUDE_FILE trace_booke
226 #include <trace/define_trace.h>