History

kcsan: Move kcsan_{disable,enable}_current() to kcsan-checks.h

Both affect access checks, and should therefore be in kcsan-checks.h. This is in preparation to use these in compiler.h.

Marco Elver committed 6 years ago

Commit 01b4ff51 parent d8949ef2 files · +16 −16Browse files

Showing the changes to include/linux (2 of 2 files). Show all

Unified · Split

2 files
  1. include/linux/kcsan-checks.h +16 −0
  2. include/linux/kcsan.h +0 −16
include/linux/kcsan-checks.h+16−0
@@ -36,6 +36,20 @@ · 35 unmodified lines
3636 */
3737 void __kcsan_check_access(const volatile void *ptr, size_t size, int type);
3838
39+/**
40+ * kcsan_disable_current - disable KCSAN for the current context
41+ *
42+ * Supports nesting.
43+ */
44+void kcsan_disable_current(void);
45+
46+/**
47+ * kcsan_enable_current - re-enable KCSAN for the current context
48+ *
49+ * Supports nesting.
50+ */
51+void kcsan_enable_current(void);
52+
3953 /**
4054 * kcsan_nestable_atomic_begin - begin nestable atomic region
4155 *
@@ -133,6 +147,8 @@ void kcsan_end_scoped_access(struct kcsan_scoped_access *sa); · 91 unmodified lines
133147 static inline void __kcsan_check_access(const volatile void *ptr, size_t size,
134148 int type) { }
135149
150+static inline void kcsan_disable_current(void) { }
151+static inline void kcsan_enable_current(void) { }
136152 static inline void kcsan_nestable_atomic_begin(void) { }
137153 static inline void kcsan_nestable_atomic_end(void) { }
138154 static inline void kcsan_flat_atomic_begin(void) { }
include/linux/kcsan.h+0−16
@@ -50,25 +50,9 @@ struct kcsan_ctx { · 49 unmodified lines
5050 */
5151 void kcsan_init(void);
5252
53−/**
54− * kcsan_disable_current - disable KCSAN for the current context
55− *
56− * Supports nesting.
57− */
58−void kcsan_disable_current(void);
59−
60−/**
61− * kcsan_enable_current - re-enable KCSAN for the current context
62− *
63− * Supports nesting.
64− */
65−void kcsan_enable_current(void);
66−
6753 #else /* CONFIG_KCSAN */
6854
6955 static inline void kcsan_init(void) { }
70−static inline void kcsan_disable_current(void) { }
71−static inline void kcsan_enable_current(void) { }
7256
7357 #endif /* CONFIG_KCSAN */
7458