Use the new RSEQ_FLAG_UNREG_CLONE_FLAGS rseq flag in the rseq selftests.
Signed-off-by: Mathieu Desnoyers <[email protected]>
Cc: Shuah Khan <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Peter Zijlstra (Intel) <[email protected]>
Cc: "Paul E. McKenney" <[email protected]>
Cc: Boqun Feng <[email protected]>
Cc: "H . Peter Anvin" <[email protected]>
Cc: Paul Turner <[email protected]>
Cc: Dmitry Vyukov <[email protected]>
---
tools/testing/selftests/rseq/rseq.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/rseq/rseq.c
b/tools/testing/selftests/rseq/rseq.c
index 7159eb777fd3..d5268570014c 100644
--- a/tools/testing/selftests/rseq/rseq.c
+++ b/tools/testing/selftests/rseq/rseq.c
@@ -68,9 +68,10 @@ static void signal_restore(sigset_t oldset)
}
static int sys_rseq(volatile struct rseq *rseq_abi, uint32_t rseq_len,
- int flags, uint32_t sig)
+ int flags, uint32_t sig, int unreg_clone_flags)
{
- return syscall(__NR_rseq, rseq_abi, rseq_len, flags, sig);
+ return syscall(__NR_rseq, rseq_abi, rseq_len, flags, sig,
+ unreg_clone_flags);
}
int rseq_register_current_thread(void)
@@ -87,7 +88,9 @@ int rseq_register_current_thread(void)
}
if (__rseq_refcount++)
goto end;
- rc = sys_rseq(&__rseq_abi, sizeof(struct rseq), 0, RSEQ_SIG);
+ rc = sys_rseq(&__rseq_abi, sizeof(struct rseq),
+ RSEQ_FLAG_UNREG_CLONE_FLAGS, RSEQ_SIG,
+ CLONE_SETTLS);
if (!rc) {
assert(rseq_current_cpu_raw() >= 0);
goto end;
@@ -116,7 +119,7 @@ int rseq_unregister_current_thread(void)
if (--__rseq_refcount)
goto end;
rc = sys_rseq(&__rseq_abi, sizeof(struct rseq),
- RSEQ_FLAG_UNREGISTER, RSEQ_SIG);
+ RSEQ_FLAG_UNREGISTER, RSEQ_SIG, 0);
if (!rc)
goto end;
__rseq_refcount = 1;
--
2.17.1