1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _RUNTIME_INSTR_H
3 #define _RUNTIME_INSTR_H
5 #define S390_RUNTIME_INSTR_START 0x1
6 #define S390_RUNTIME_INSTR_STOP 0x2
8 struct runtime_instr_cb
{
15 __u32 pstate_set_buf
: 1;
19 __u32 pstate_sample
: 1;
20 __u32 sstate_sample
: 1;
21 __u32 pstate_collect
: 1;
22 __u32 sstate_collect
: 1;
25 __u32 int_requested
: 1;
26 __u32 buffer_full_int
: 1;
35 __u32 call_type_br
: 1;
36 __u32 return_type_br
: 1;
37 __u32 other_type_br
: 1;
38 __u32 bc_other_type
: 1;
49 __u32 dc_miss_extra
: 1;
50 __u32 lat_lev_ignore
: 1;
58 } __packed
__aligned(8);
60 extern struct runtime_instr_cb runtime_instr_empty_cb
;
62 static inline void load_runtime_instr_cb(struct runtime_instr_cb
*cb
)
64 asm volatile(".insn rsy,0xeb0000000060,0,0,%0" /* LRIC */
68 static inline void store_runtime_instr_cb(struct runtime_instr_cb
*cb
)
70 asm volatile(".insn rsy,0xeb0000000061,0,0,%0" /* STRIC */
71 : "=Q" (*cb
) : : "cc");
74 static inline void save_ri_cb(struct runtime_instr_cb
*cb_prev
)
77 store_runtime_instr_cb(cb_prev
);
80 static inline void restore_ri_cb(struct runtime_instr_cb
*cb_next
,
81 struct runtime_instr_cb
*cb_prev
)
84 load_runtime_instr_cb(cb_next
);
86 load_runtime_instr_cb(&runtime_instr_empty_cb
);
91 void runtime_instr_release(struct task_struct
*tsk
);
93 #endif /* _RUNTIME_INSTR_H */