2 #define TRACE_SYSTEM mpx
4 #if !defined(_TRACE_MPX_H) || defined(TRACE_HEADER_MULTI_READ)
7 #include <linux/tracepoint.h>
9 #ifdef CONFIG_X86_INTEL_MPX
11 TRACE_EVENT(mpx_bounds_register_exception
,
13 TP_PROTO(void *addr_referenced
,
14 const struct mpx_bndreg
*bndreg
),
15 TP_ARGS(addr_referenced
, bndreg
),
18 __field(void *, addr_referenced
)
19 __field(u64
, lower_bound
)
20 __field(u64
, upper_bound
)
24 __entry
->addr_referenced
= addr_referenced
;
25 __entry
->lower_bound
= bndreg
->lower_bound
;
26 __entry
->upper_bound
= bndreg
->upper_bound
;
29 * Note that we are printing out the '~' of the upper
30 * bounds register here. It is actually stored in its
31 * one's complement form so that its 'init' state
32 * corresponds to all 0's. But, that looks like
33 * gibberish when printed out, so print out the 1's
34 * complement instead of the actual value here. Note
35 * though that you still need to specify filters for the
36 * actual value, not the displayed one.
38 TP_printk("address referenced: 0x%p bounds: lower: 0x%llx ~upper: 0x%llx",
39 __entry
->addr_referenced
,
45 TRACE_EVENT(bounds_exception_mpx
,
47 TP_PROTO(const struct mpx_bndcsr
*bndcsr
),
52 __field(u64
, bndstatus
)
56 /* need to get rid of the 'const' on bndcsr */
57 __entry
->bndcfgu
= (u64
)bndcsr
->bndcfgu
;
58 __entry
->bndstatus
= (u64
)bndcsr
->bndstatus
;
61 TP_printk("bndcfgu:0x%llx bndstatus:0x%llx",
66 DECLARE_EVENT_CLASS(mpx_range_trace
,
68 TP_PROTO(unsigned long start
,
73 __field(unsigned long, start
)
74 __field(unsigned long, end
)
78 __entry
->start
= start
;
82 TP_printk("[0x%p:0x%p]",
83 (void *)__entry
->start
,
88 DEFINE_EVENT(mpx_range_trace
, mpx_unmap_zap
,
89 TP_PROTO(unsigned long start
, unsigned long end
),
93 DEFINE_EVENT(mpx_range_trace
, mpx_unmap_search
,
94 TP_PROTO(unsigned long start
, unsigned long end
),
98 TRACE_EVENT(mpx_new_bounds_table
,
100 TP_PROTO(unsigned long table_vaddr
),
101 TP_ARGS(table_vaddr
),
104 __field(unsigned long, table_vaddr
)
108 __entry
->table_vaddr
= table_vaddr
;
111 TP_printk("table vaddr:%p", (void *)__entry
->table_vaddr
)
117 * This gets used outside of MPX-specific code, so we need a stub.
120 void trace_bounds_exception_mpx(const struct mpx_bndcsr
*bndcsr
)
124 #endif /* CONFIG_X86_INTEL_MPX */
126 #undef TRACE_INCLUDE_PATH
127 #define TRACE_INCLUDE_PATH asm/trace/
128 #undef TRACE_INCLUDE_FILE
129 #define TRACE_INCLUDE_FILE mpx
130 #endif /* _TRACE_MPX_H */
132 /* This part must be outside protection */
133 #include <trace/define_trace.h>