2 #if !defined(_TRACE_HANDLE_EXIT_ARM64_KVM_H) || defined(TRACE_HEADER_MULTI_READ)
3 #define _TRACE_HANDLE_EXIT_ARM64_KVM_H
5 #include <linux/tracepoint.h>
9 #define TRACE_SYSTEM kvm
12 TP_PROTO(
unsigned long vcpu_pc,
bool is_wfe),
13 TP_ARGS(vcpu_pc, is_wfe),
16 __field(
unsigned long, vcpu_pc)
21 __entry->vcpu_pc = vcpu_pc;
22 __entry->is_wfe = is_wfe;
25 TP_printk(
"guest executed wf%c at: 0x%016lx",
26 __entry->is_wfe ?
'e' :
'i', __entry->vcpu_pc)
30 TP_PROTO(
unsigned long vcpu_pc,
unsigned long r0,
unsigned long imm),
31 TP_ARGS(vcpu_pc, r0, imm),
34 __field(
unsigned long, vcpu_pc)
35 __field(
unsigned long, r0)
36 __field(
unsigned long, imm)
40 __entry->vcpu_pc = vcpu_pc;
45 TP_printk(
"HVC at 0x%016lx (r0: 0x%016lx, imm: 0x%lx)",
46 __entry->vcpu_pc, __entry->r0, __entry->imm)
50 TP_PROTO(
struct kvm_vcpu *vcpu, __u32 guest_debug),
51 TP_ARGS(vcpu, guest_debug),
54 __field(
struct kvm_vcpu *, vcpu)
55 __field(__u32, guest_debug)
60 __entry->guest_debug = guest_debug;
63 TP_printk(
"vcpu: %p, flags: 0x%08x", __entry->vcpu, __entry->guest_debug)
67 TP_PROTO(__u32 guest_debug),
71 __field(__u32, guest_debug)
75 __entry->guest_debug = guest_debug;
78 TP_printk(
"flags: 0x%08x", __entry->guest_debug)
86 TP_PROTO(
const char *name, __u64 value),
90 __field(
const char *, name)
96 __entry->value = value;
99 TP_printk(
"%s: 0x%llx", __entry->name, __entry->value)
105 TP_PROTO(
const char *type,
int len, __u64 *control, __u64 *value),
106 TP_ARGS(type, len, control, value),
108 __field(
const char *, name)
110 __array(u64, ctrls, 16)
111 __array(u64, values, 16)
114 __entry->name = type;
116 memcpy(__entry->ctrls, control, len << 3);
117 memcpy(__entry->values, value, len << 3);
119 TP_printk(
"%d %s CTRL:%s VALUE:%s", __entry->len, __entry->name,
120 __print_array(__entry->ctrls, __entry->len,
sizeof(__u64)),
121 __print_array(__entry->values, __entry->len,
sizeof(__u64)))
125 TP_PROTO(
const char *fn,
int reg,
bool is_write, u64 write_value),
126 TP_ARGS(fn, reg, is_write, write_value),
129 __field(
const char *, fn)
131 __field(
bool, is_write)
132 __field(u64, write_value)
138 __entry->is_write = is_write;
139 __entry->write_value = write_value;
142 TP_printk(
"%s %s reg %d (0x%016llx)", __entry->fn, __entry->is_write?
"write to":
"read from", __entry->reg, __entry->write_value)
146 TP_PROTO(
unsigned long hsr),
150 __field(
unsigned long, hsr)
157 TP_printk(
"HSR 0x%08lx", __entry->hsr)
162 TP_ARGS(vcpu_pc, params, reg),
165 __field(
unsigned long, vcpu_pc)
166 __field(
bool, is_write)
167 __field(
const char *, name)
176 __entry->vcpu_pc = vcpu_pc;
177 __entry->is_write = params->
is_write;
178 __entry->name = reg->
name;
179 __entry->Op0 = reg->
Op0;
180 __entry->Op0 = reg->
Op0;
181 __entry->Op1 = reg->
Op1;
182 __entry->CRn = reg->
CRn;
183 __entry->CRm = reg->
CRm;
184 __entry->Op2 = reg->
Op2;
187 TP_printk(
"PC: %lx %s (%d,%d,%d,%d,%d) %s",
188 __entry->vcpu_pc, __entry->name ?:
"UNKN",
189 __entry->Op0, __entry->Op1, __entry->CRn,
190 __entry->CRm, __entry->Op2,
191 __entry->is_write ?
"write" :
"read")
195 TP_PROTO(
struct kvm_vcpu *vcpu, __u32 guest_debug),
196 TP_ARGS(vcpu, guest_debug),
199 __field(
struct kvm_vcpu *, vcpu)
200 __field(__u32, guest_debug)
204 __entry->vcpu = vcpu;
205 __entry->guest_debug = guest_debug;
208 TP_printk(
"vcpu: %p, flags: 0x%08x", __entry->vcpu, __entry->guest_debug)
213 #undef TRACE_INCLUDE_PATH
214 #define TRACE_INCLUDE_PATH .
215 #undef TRACE_INCLUDE_FILE
216 #define TRACE_INCLUDE_FILE trace_handle_exit
219 #include <trace/define_trace.h>
void kvm_arm_clear_debug(struct kvm_vcpu *vcpu)
void kvm_arm_setup_debug(struct kvm_vcpu *vcpu)
int kvm_handle_sys_reg(struct kvm_vcpu *vcpu)
TRACE_EVENT(kvm_wfx_arm64, TP_PROTO(unsigned long vcpu_pc, bool is_wfe), TP_ARGS(vcpu_pc, is_wfe), TP_STRUCT__entry(__field(unsigned long, vcpu_pc) __field(bool, is_wfe)), TP_fast_assign(__entry->vcpu_pc=vcpu_pc;__entry->is_wfe=is_wfe;), TP_printk("guest executed wf%c at: 0x%016lx", __entry->is_wfe ? 'e' :'i', __entry->vcpu_pc))
TRACE_DEFINE_SIZEOF(__u64)