x86, mpx: fix compile errors when tracing off
From: Dave Hansen <dave.hansen@linux.intel.com>
We DEFINE_TRACEPOINTS in arch/x86/mm/mpx.c, which is of course
only compiled when MPX is compiled in.
trace_bounds_exception_mpx() is used in bounds.c which is
outside the core MPX code and not under the MPX config option.
This can potentially end up being an undefined symbol.
So, we create a stub version of the function for when MPX is
off. But, I screwed up where I placed the stub and its #else.
This puts them back in the right place.
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
diff --git a/arch/x86/include/asm/trace/mpx.h b/arch/x86/include/asm/trace/mpx.h
index 9443a5d..f06ad6b 100644
--- a/arch/x86/include/asm/trace/mpx.h
+++ b/arch/x86/include/asm/trace/mpx.h
@@ -53,15 +53,6 @@
__entry->bndstatus)
);
-#else
-
-/*
- * This gets used outside of MPX-specific code, so we need a stub.
- */
-static inline void trace_bounds_exception_mpx(struct bndcsr *bndcsr)
-{
-}
-
TRACE_EVENT(mpx_unmap_zap,
TP_PROTO(unsigned long start,
@@ -122,6 +113,15 @@
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