From 5b0c308a0565a94d2e1070cbf287197b676faaaf Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Mon, 29 Apr 2019 11:27:55 -0400 Subject: rseq/selftests: Use __rseq_handled symbol to coexist with glibc In order to integrate rseq into user-space applications, expose a __rseq_handled symbol so many rseq users can be linked into the same application (e.g. librseq and glibc). The __rseq_refcount TLS variable is static to the librseq library. It ensures that rseq syscall registration/unregistration happens only for the most early/late caller to rseq_{,un}register_current_thread for each thread, thus ensuring that rseq is registered across the lifetime of all rseq users for a given thread. Signed-off-by: Mathieu Desnoyers CC: Shuah Khan CC: Carlos O'Donell CC: Florian Weimer CC: Joseph Myers CC: Szabolcs Nagy CC: Thomas Gleixner CC: Ben Maurer CC: Peter Zijlstra CC: "Paul E. McKenney" CC: Boqun Feng CC: Will Deacon CC: Dave Watson CC: Paul Turner CC: linux-api@vger.kernel.org Signed-off-by: Shuah Khan --- tools/testing/selftests/rseq/rseq.h | 1 + 1 file changed, 1 insertion(+) (limited to 'tools/testing/selftests/rseq/rseq.h') diff --git a/tools/testing/selftests/rseq/rseq.h b/tools/testing/selftests/rseq/rseq.h index 6c1126e7f685..d40d60e7499e 100644 --- a/tools/testing/selftests/rseq/rseq.h +++ b/tools/testing/selftests/rseq/rseq.h @@ -44,6 +44,7 @@ #endif extern __thread volatile struct rseq __rseq_abi; +extern int __rseq_handled; #define rseq_likely(x) __builtin_expect(!!(x), 1) #define rseq_unlikely(x) __builtin_expect(!!(x), 0) -- cgit v1.2.3-59-g8ed1b