xtensa: enable context tracking
authorMax Filippov <jcmvbkbc@gmail.com>
Thu, 14 Apr 2022 03:41:12 +0000 (20:41 -0700)
committerMax Filippov <jcmvbkbc@gmail.com>
Mon, 2 May 2022 02:51:21 +0000 (19:51 -0700)
Put user exit context tracking call on the common kernel entry/exit path
(function calls are impossible at earlier kernel entry stages because
PS.EXCM is not cleared yet). Put user entry context tracking call on the
user exit path. Syscalls go through this common code too, so nothing
specific needs to be done for them.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Documentation/features/time/context-tracking/arch-support.txt
arch/xtensa/Kconfig
arch/xtensa/kernel/entry.S

index bb1c1801553e0f22913ff442aab03f9151b42985..72e7aadeda7ef9389e269f34018184a2e8d30f0d 100644 (file)
@@ -27,5 +27,5 @@
     |       sparc: |  ok  |
     |          um: | TODO |
     |         x86: |  ok  |
-    |      xtensa: | TODO |
+    |      xtensa: |  ok  |
     -----------------------
index bca2763495a1246073696c95a2ae9151a6e260b4..553144ae1d4d311a7369212feb44450d3042c62d 100644 (file)
@@ -31,6 +31,7 @@ config XTENSA
        select HAVE_ARCH_KASAN if MMU && !XIP_KERNEL
        select HAVE_ARCH_SECCOMP_FILTER
        select HAVE_ARCH_TRACEHOOK
+       select HAVE_CONTEXT_TRACKING
        select HAVE_DEBUG_KMEMLEAK
        select HAVE_DMA_CONTIGUOUS
        select HAVE_EXIT_THREAD
index d09f2c38ba84bd9e98cdc11899e2aef67af3eb27..f2c789a5a92a7fe8fe8e964d2b98d0d891e17cdd 100644 (file)
@@ -456,6 +456,12 @@ KABI_W     or      a3, a3, a2
        beqz            abi_tmp0, 1f
        abi_call        trace_hardirqs_off
 1:
+#endif
+#ifdef CONFIG_CONTEXT_TRACKING
+       l32i            abi_tmp0, a1, PT_PS
+       bbci.l          abi_tmp0, PS_UM_BIT, 1f
+       abi_call        context_tracking_user_exit
+1:
 #endif
 
        /* Go to second-level dispatcher. Set up parameters to pass to the
@@ -540,6 +546,9 @@ common_exception_return:
        j               .Lrestore_state
 
 .Lexit_tif_loop_user:
+#ifdef CONFIG_CONTEXT_TRACKING
+       abi_call        context_tracking_user_enter
+#endif
 #ifdef CONFIG_HAVE_HW_BREAKPOINT
        _bbci.l         abi_saved0, TIF_DB_DISABLED, 1f
        abi_call        restore_dbreak