[RFC PATCH 4/4] rseq/selftests: Use RSEQ_FLAG_UNREG_CLONE_FLAGS
From: Mathieu Desnoyers
Date: Tue Sep 10 2019 - 20:28:00 EST
Use the new RSEQ_FLAG_UNREG_CLONE_FLAGS rseq flag in the rseq selftests.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>
Cc: Shuah Khan <skhan@xxxxxxxxxxxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
Cc: "Paul E. McKenney" <paulmck@xxxxxxxxxxxxx>
Cc: Boqun Feng <boqun.feng@xxxxxxxxx>
Cc: "H . Peter Anvin" <hpa@xxxxxxxxx>
Cc: Paul Turner <pjt@xxxxxxxxxx>
Cc: Dmitry Vyukov <dvyukov@xxxxxxxxxx>
---
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