1 /* SPDX-License-Identifier: GPL-2.0 */
2 #if !defined(_TRACE_ARM64_KVM_H) || defined(TRACE_HEADER_MULTI_READ)
3 #define _TRACE_ARM64_KVM_H
5 #include <linux/tracepoint.h>
8 #define TRACE_SYSTEM kvm
10 TRACE_EVENT(kvm_wfx_arm64
,
11 TP_PROTO(unsigned long vcpu_pc
, bool is_wfe
),
12 TP_ARGS(vcpu_pc
, is_wfe
),
15 __field(unsigned long, vcpu_pc
)
20 __entry
->vcpu_pc
= vcpu_pc
;
21 __entry
->is_wfe
= is_wfe
;
24 TP_printk("guest executed wf%c at: 0x%08lx",
25 __entry
->is_wfe
? 'e' : 'i', __entry
->vcpu_pc
)
28 TRACE_EVENT(kvm_hvc_arm64
,
29 TP_PROTO(unsigned long vcpu_pc
, unsigned long r0
, unsigned long imm
),
30 TP_ARGS(vcpu_pc
, r0
, imm
),
33 __field(unsigned long, vcpu_pc
)
34 __field(unsigned long, r0
)
35 __field(unsigned long, imm
)
39 __entry
->vcpu_pc
= vcpu_pc
;
44 TP_printk("HVC at 0x%08lx (r0: 0x%08lx, imm: 0x%lx)",
45 __entry
->vcpu_pc
, __entry
->r0
, __entry
->imm
)
48 TRACE_EVENT(kvm_arm_setup_debug
,
49 TP_PROTO(struct kvm_vcpu
*vcpu
, __u32 guest_debug
),
50 TP_ARGS(vcpu
, guest_debug
),
53 __field(struct kvm_vcpu
*, vcpu
)
54 __field(__u32
, guest_debug
)
59 __entry
->guest_debug
= guest_debug
;
62 TP_printk("vcpu: %p, flags: 0x%08x", __entry
->vcpu
, __entry
->guest_debug
)
65 TRACE_EVENT(kvm_arm_clear_debug
,
66 TP_PROTO(__u32 guest_debug
),
70 __field(__u32
, guest_debug
)
74 __entry
->guest_debug
= guest_debug
;
77 TP_printk("flags: 0x%08x", __entry
->guest_debug
)
80 TRACE_EVENT(kvm_arm_set_dreg32
,
81 TP_PROTO(const char *name
, __u32 value
),
85 __field(const char *, name
)
91 __entry
->value
= value
;
94 TP_printk("%s: 0x%08x", __entry
->name
, __entry
->value
)
97 TRACE_DEFINE_SIZEOF(__u64
);
99 TRACE_EVENT(kvm_arm_set_regset
,
100 TP_PROTO(const char *type
, int len
, __u64
*control
, __u64
*value
),
101 TP_ARGS(type
, len
, control
, value
),
103 __field(const char *, name
)
105 __array(u64
, ctrls
, 16)
106 __array(u64
, values
, 16)
109 __entry
->name
= type
;
111 memcpy(__entry
->ctrls
, control
, len
<< 3);
112 memcpy(__entry
->values
, value
, len
<< 3);
114 TP_printk("%d %s CTRL:%s VALUE:%s", __entry
->len
, __entry
->name
,
115 __print_array(__entry
->ctrls
, __entry
->len
, sizeof(__u64
)),
116 __print_array(__entry
->values
, __entry
->len
, sizeof(__u64
)))
119 TRACE_EVENT(trap_reg
,
120 TP_PROTO(const char *fn
, int reg
, bool is_write
, u64 write_value
),
121 TP_ARGS(fn
, reg
, is_write
, write_value
),
124 __field(const char *, fn
)
126 __field(bool, is_write
)
127 __field(u64
, write_value
)
133 __entry
->is_write
= is_write
;
134 __entry
->write_value
= write_value
;
137 TP_printk("%s %s reg %d (0x%08llx)", __entry
->fn
, __entry
->is_write
?"write to":"read from", __entry
->reg
, __entry
->write_value
)
140 TRACE_EVENT(kvm_handle_sys_reg
,
141 TP_PROTO(unsigned long hsr
),
145 __field(unsigned long, hsr
)
152 TP_printk("HSR 0x%08lx", __entry
->hsr
)
155 TRACE_EVENT(kvm_set_guest_debug
,
156 TP_PROTO(struct kvm_vcpu
*vcpu
, __u32 guest_debug
),
157 TP_ARGS(vcpu
, guest_debug
),
160 __field(struct kvm_vcpu
*, vcpu
)
161 __field(__u32
, guest_debug
)
165 __entry
->vcpu
= vcpu
;
166 __entry
->guest_debug
= guest_debug
;
169 TP_printk("vcpu: %p, flags: 0x%08x", __entry
->vcpu
, __entry
->guest_debug
)
173 #endif /* _TRACE_ARM64_KVM_H */
175 #undef TRACE_INCLUDE_PATH
176 #define TRACE_INCLUDE_PATH .
177 #undef TRACE_INCLUDE_FILE
178 #define TRACE_INCLUDE_FILE trace
180 /* This part must be outside protection */
181 #include <trace/define_trace.h>