| #undef TRACE_SYSTEM |
| #define TRACE_SYSTEM mpx |
| |
| #if !defined(_TRACE_MPX_H) || defined(TRACE_HEADER_MULTI_READ) |
| #define _TRACE_MPX_H |
| |
| #include <linux/tracepoint.h> |
| |
| #ifdef CONFIG_X86_INTEL_MPX |
| |
| TRACE_EVENT(mpx_bounds_register_exception, |
| |
| TP_PROTO(void *addr_referenced, |
| struct bndreg *bndreg), |
| TP_ARGS(addr_referenced, bndreg), |
| |
| TP_STRUCT__entry( |
| __field(void *, addr_referenced) |
| __field(u64, lower_bound) |
| __field(u64, upper_bound) |
| ), |
| |
| TP_fast_assign( |
| __entry->addr_referenced = addr_referenced; |
| __entry->lower_bound = bndreg->lower_bound; |
| __entry->upper_bound = bndreg->upper_bound; |
| ), |
| |
| TP_printk("address referenced: 0x%p bounds: lower: 0x%llx ~upper: 0x%llx", |
| __entry->addr_referenced, |
| __entry->lower_bound, |
| ~__entry->upper_bound |
| ) |
| ); |
| |
| TRACE_EVENT(bounds_exception_mpx, |
| |
| TP_PROTO(struct bndcsr *bndcsr), |
| TP_ARGS(bndcsr), |
| |
| TP_STRUCT__entry( |
| __field(u64, bndcfgu) |
| __field(u64, bndstatus) |
| ), |
| |
| TP_fast_assign( |
| __entry->bndcfgu = bndcsr->bndcfgu; |
| __entry->bndstatus = bndcsr->bndstatus; |
| ), |
| |
| TP_printk("bndcfgu:0x%llx bndstatus:0x%llx", |
| __entry->bndcfgu, |
| __entry->bndstatus) |
| ); |
| |
| TRACE_EVENT(mpx_unmap_zap, |
| |
| TP_PROTO(unsigned long start, |
| unsigned long end), |
| TP_ARGS(start, end), |
| |
| TP_STRUCT__entry( |
| __field(unsigned long, start) |
| __field(unsigned long, end) |
| ), |
| |
| TP_fast_assign( |
| __entry->start = start; |
| __entry->end = end; |
| ), |
| |
| TP_printk("0x%llx -> 0x%llx", |
| (u64)__entry->start, |
| (u64)__entry->end |
| ) |
| ); |
| |
| TRACE_EVENT(mpx_unmap_search, |
| |
| TP_PROTO(unsigned long start, |
| unsigned long end), |
| TP_ARGS(start, end), |
| |
| TP_STRUCT__entry( |
| __field(unsigned long, start) |
| __field(unsigned long, end) |
| ), |
| |
| TP_fast_assign( |
| __entry->start = start; |
| __entry->end = end; |
| ), |
| |
| TP_printk("0x%llx -> 0x%llx", |
| (u64)__entry->start, |
| (u64)__entry->end |
| ) |
| ); |
| |
| TRACE_EVENT(mpx_new_bounds_table, |
| |
| TP_PROTO(unsigned long table_vaddr), |
| TP_ARGS(table_vaddr), |
| |
| TP_STRUCT__entry( |
| __field(unsigned long, table_vaddr) |
| ), |
| |
| TP_fast_assign( |
| __entry->table_vaddr = table_vaddr; |
| ), |
| |
| TP_printk("table vaddr:%p", (void *)__entry->table_vaddr) |
| ); |
| |
| #else |
| |
| /* |
| * This gets used outside of MPX-specific code, so we need a stub. |
| */ |
| static inline void trace_bounds_exception_mpx(struct bndcsr *bndcsr) |
| { |
| } |
| |
| #endif /* CONFIG_X86_INTEL_MPX */ |
| |
| #undef TRACE_INCLUDE_PATH |
| #define TRACE_INCLUDE_PATH asm/trace/ |
| #define TRACE_INCLUDE_FILE mpx |
| #endif /* _TRACE_MPX_H */ |
| |
| /* This part must be outside protection */ |
| #include <trace/define_trace.h> |