context_tracking: Fix noinstr vs KASAN
authorPeter Zijlstra <peterz@infradead.org>
Thu, 12 Jan 2023 19:44:05 +0000 (20:44 +0100)
committerIngo Molnar <mingo@kernel.org>
Fri, 13 Jan 2023 10:48:18 +0000 (11:48 +0100)
commit0e26e1de0032779e43929174339429c16307a299
tree2bf1ffaa14449f86b7a876aeca7b40d882109eb0
parent0e985e9d22864e29d5d2b3d909ad15134d7f6d46
context_tracking: Fix noinstr vs KASAN

Low level noinstr context-tracking code is calling out to instrumented
code on KASAN:

  vmlinux.o: warning: objtool: __ct_user_enter+0x72: call to __kasan_check_write() leaves .noinstr.text section
  vmlinux.o: warning: objtool: __ct_user_exit+0x47: call to __kasan_check_write() leaves .noinstr.text section

Use even lower level atomic methods to avoid the instrumentation.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20230112195542.458034262@infradead.org
kernel/context_tracking.c