* [PATCH 0/3] selftests/rseq: fixes for RISC-V and Glibc 2.35
@ 2022-06-14 15:48 Michael Jeanson
2022-06-14 15:48 ` [PATCH 1/3] selftests/rseq: riscv: use rseq_get_abi() helper Michael Jeanson
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Michael Jeanson @ 2022-06-14 15:48 UTC (permalink / raw)
To: Mathieu Desnoyers
Cc: Peter Zijlstra, Paul E . McKenney, Boqun Feng, linux-kernel,
linux-riscv, Michael Jeanson
The patch series allows running the rseq selftests on a Glibc 2.35
system which has rseq support but no RSEQ_SIG defined for the RISC-V
architecture.
The patches were tested on both Glibc 2.33 and 2.35.
Michael Jeanson (3):
selftests/rseq: riscv: use rseq_get_abi() helper
selftests/rseq: riscv: fix 'literal-suffix' warning
selftests/rseq: check if libc rseq support is registered
tools/testing/selftests/rseq/rseq-riscv.h | 50 +++++++++++------------
tools/testing/selftests/rseq/rseq.c | 3 +-
2 files changed, 27 insertions(+), 26 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH 1/3] selftests/rseq: riscv: use rseq_get_abi() helper 2022-06-14 15:48 [PATCH 0/3] selftests/rseq: fixes for RISC-V and Glibc 2.35 Michael Jeanson @ 2022-06-14 15:48 ` Michael Jeanson 2022-06-28 7:16 ` [tip: sched/core] " tip-bot2 for Michael Jeanson 2022-06-14 15:48 ` [PATCH 2/3] selftests/rseq: riscv: fix 'literal-suffix' warning Michael Jeanson ` (2 subsequent siblings) 3 siblings, 1 reply; 9+ messages in thread From: Michael Jeanson @ 2022-06-14 15:48 UTC (permalink / raw) To: Mathieu Desnoyers Cc: Peter Zijlstra, Paul E . McKenney, Boqun Feng, linux-kernel, linux-riscv, Michael Jeanson Make the RISC-V rseq selftests compatible with glibc-2.35 by using the rseq_get_abi() helper. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> --- tools/testing/selftests/rseq/rseq-riscv.h | 36 +++++++++++------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/tools/testing/selftests/rseq/rseq-riscv.h b/tools/testing/selftests/rseq/rseq-riscv.h index b86642f90d7f..6f8a605b75c0 100644 --- a/tools/testing/selftests/rseq/rseq-riscv.h +++ b/tools/testing/selftests/rseq/rseq-riscv.h @@ -194,8 +194,8 @@ int rseq_cmpeqv_storev(intptr_t *v, intptr_t expect, intptr_t newv, int cpu) RSEQ_ASM_DEFINE_ABORT(4, abort) : /* gcc asm goto does not allow outputs */ : [cpu_id] "r" (cpu), - [current_cpu_id] "m" (__rseq_abi.cpu_id), - [rseq_cs] "m" (__rseq_abi.rseq_cs), + [current_cpu_id] "m" (rseq_get_abi()->cpu_id), + [rseq_cs] "m" (rseq_get_abi()->rseq_cs.arch.ptr), [v] "m" (*v), [expect] "r" (expect), [newv] "r" (newv) @@ -251,8 +251,8 @@ int rseq_cmpnev_storeoffp_load(intptr_t *v, intptr_t expectnot, RSEQ_ASM_DEFINE_ABORT(4, abort) : /* gcc asm goto does not allow outputs */ : [cpu_id] "r" (cpu), - [current_cpu_id] "m" (__rseq_abi.cpu_id), - [rseq_cs] "m" (__rseq_abi.rseq_cs), + [current_cpu_id] "m" (rseq_get_abi()->cpu_id), + [rseq_cs] "m" (rseq_get_abi()->rseq_cs.arch.ptr), [v] "m" (*v), [expectnot] "r" (expectnot), [load] "m" (*load), @@ -301,8 +301,8 @@ int rseq_addv(intptr_t *v, intptr_t count, int cpu) RSEQ_ASM_DEFINE_ABORT(4, abort) : /* gcc asm goto does not allow outputs */ : [cpu_id] "r" (cpu), - [current_cpu_id] "m" (__rseq_abi.cpu_id), - [rseq_cs] "m" (__rseq_abi.rseq_cs), + [current_cpu_id] "m" (rseq_get_abi()->cpu_id), + [rseq_cs] "m" (rseq_get_abi()->rseq_cs.arch.ptr), [v] "m" (*v), [count] "r" (count) RSEQ_INJECT_INPUT @@ -352,8 +352,8 @@ int rseq_cmpeqv_trystorev_storev(intptr_t *v, intptr_t expect, RSEQ_ASM_DEFINE_ABORT(4, abort) : /* gcc asm goto does not allow outputs */ : [cpu_id] "r" (cpu), - [current_cpu_id] "m" (__rseq_abi.cpu_id), - [rseq_cs] "m" (__rseq_abi.rseq_cs), + [current_cpu_id] "m" (rseq_get_abi()->cpu_id), + [rseq_cs] "m" (rseq_get_abi()->rseq_cs.arch.ptr), [expect] "r" (expect), [v] "m" (*v), [newv] "r" (newv), @@ -411,8 +411,8 @@ int rseq_cmpeqv_trystorev_storev_release(intptr_t *v, intptr_t expect, RSEQ_ASM_DEFINE_ABORT(4, abort) : /* gcc asm goto does not allow outputs */ : [cpu_id] "r" (cpu), - [current_cpu_id] "m" (__rseq_abi.cpu_id), - [rseq_cs] "m" (__rseq_abi.rseq_cs), + [current_cpu_id] "m" (rseq_get_abi()->cpu_id), + [rseq_cs] "m" (rseq_get_abi()->rseq_cs.arch.ptr), [expect] "r" (expect), [v] "m" (*v), [newv] "r" (newv), @@ -472,8 +472,8 @@ int rseq_cmpeqv_cmpeqv_storev(intptr_t *v, intptr_t expect, RSEQ_ASM_DEFINE_ABORT(4, abort) : /* gcc asm goto does not allow outputs */ : [cpu_id] "r" (cpu), - [current_cpu_id] "m" (__rseq_abi.cpu_id), - [rseq_cs] "m" (__rseq_abi.rseq_cs), + [current_cpu_id] "m" (rseq_get_abi()->cpu_id), + [rseq_cs] "m" (rseq_get_abi()->rseq_cs.arch.ptr), [v] "m" (*v), [expect] "r" (expect), [v2] "m" (*v2), @@ -532,8 +532,8 @@ int rseq_cmpeqv_trymemcpy_storev(intptr_t *v, intptr_t expect, RSEQ_ASM_DEFINE_ABORT(4, abort) : /* gcc asm goto does not allow outputs */ : [cpu_id] "r" (cpu), - [current_cpu_id] "m" (__rseq_abi.cpu_id), - [rseq_cs] "m" (__rseq_abi.rseq_cs), + [current_cpu_id] "m" (rseq_get_abi()->cpu_id), + [rseq_cs] "m" (rseq_get_abi()->rseq_cs.arch.ptr), [expect] "r" (expect), [v] "m" (*v), [newv] "r" (newv), @@ -593,8 +593,8 @@ int rseq_cmpeqv_trymemcpy_storev_release(intptr_t *v, intptr_t expect, RSEQ_ASM_DEFINE_ABORT(4, abort) : /* gcc asm goto does not allow outputs */ : [cpu_id] "r" (cpu), - [current_cpu_id] "m" (__rseq_abi.cpu_id), - [rseq_cs] "m" (__rseq_abi.rseq_cs), + [current_cpu_id] "m" (rseq_get_abi()->cpu_id), + [rseq_cs] "m" (rseq_get_abi()->rseq_cs.arch.ptr), [expect] "r" (expect), [v] "m" (*v), [newv] "r" (newv), @@ -651,8 +651,8 @@ int rseq_offset_deref_addv(intptr_t *ptr, off_t off, intptr_t inc, int cpu) RSEQ_ASM_DEFINE_ABORT(4, abort) : /* gcc asm goto does not allow outputs */ : [cpu_id] "r" (cpu), - [current_cpu_id] "m" (__rseq_abi.cpu_id), - [rseq_cs] "m" (__rseq_abi.rseq_cs), + [current_cpu_id] "m" (rseq_get_abi()->cpu_id), + [rseq_cs] "m" (rseq_get_abi()->rseq_cs.arch.ptr), [ptr] "r" (ptr), [off] "er" (off), [inc] "er" (inc) -- 2.34.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [tip: sched/core] selftests/rseq: riscv: use rseq_get_abi() helper 2022-06-14 15:48 ` [PATCH 1/3] selftests/rseq: riscv: use rseq_get_abi() helper Michael Jeanson @ 2022-06-28 7:16 ` tip-bot2 for Michael Jeanson 0 siblings, 0 replies; 9+ messages in thread From: tip-bot2 for Michael Jeanson @ 2022-06-28 7:16 UTC (permalink / raw) To: linux-tip-commits Cc: Michael Jeanson, Peter Zijlstra (Intel), Mathieu Desnoyers, x86, linux-kernel The following commit has been merged into the sched/core branch of tip: Commit-ID: 4f3394924358fe04ced0411c72fc7eeb0d3be652 Gitweb: https://git.kernel.org/tip/4f3394924358fe04ced0411c72fc7eeb0d3be652 Author: Michael Jeanson <mjeanson@efficios.com> AuthorDate: Tue, 14 Jun 2022 11:48:28 -04:00 Committer: Peter Zijlstra <peterz@infradead.org> CommitterDate: Tue, 28 Jun 2022 09:08:28 +02:00 selftests/rseq: riscv: use rseq_get_abi() helper Make the RISC-V rseq selftests compatible with glibc-2.35 by using the rseq_get_abi() helper. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Link: https://lore.kernel.org/r/20220614154830.1367382-2-mjeanson@efficios.com --- tools/testing/selftests/rseq/rseq-riscv.h | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/tools/testing/selftests/rseq/rseq-riscv.h b/tools/testing/selftests/rseq/rseq-riscv.h index b86642f..6f8a605 100644 --- a/tools/testing/selftests/rseq/rseq-riscv.h +++ b/tools/testing/selftests/rseq/rseq-riscv.h @@ -194,8 +194,8 @@ int rseq_cmpeqv_storev(intptr_t *v, intptr_t expect, intptr_t newv, int cpu) RSEQ_ASM_DEFINE_ABORT(4, abort) : /* gcc asm goto does not allow outputs */ : [cpu_id] "r" (cpu), - [current_cpu_id] "m" (__rseq_abi.cpu_id), - [rseq_cs] "m" (__rseq_abi.rseq_cs), + [current_cpu_id] "m" (rseq_get_abi()->cpu_id), + [rseq_cs] "m" (rseq_get_abi()->rseq_cs.arch.ptr), [v] "m" (*v), [expect] "r" (expect), [newv] "r" (newv) @@ -251,8 +251,8 @@ int rseq_cmpnev_storeoffp_load(intptr_t *v, intptr_t expectnot, RSEQ_ASM_DEFINE_ABORT(4, abort) : /* gcc asm goto does not allow outputs */ : [cpu_id] "r" (cpu), - [current_cpu_id] "m" (__rseq_abi.cpu_id), - [rseq_cs] "m" (__rseq_abi.rseq_cs), + [current_cpu_id] "m" (rseq_get_abi()->cpu_id), + [rseq_cs] "m" (rseq_get_abi()->rseq_cs.arch.ptr), [v] "m" (*v), [expectnot] "r" (expectnot), [load] "m" (*load), @@ -301,8 +301,8 @@ int rseq_addv(intptr_t *v, intptr_t count, int cpu) RSEQ_ASM_DEFINE_ABORT(4, abort) : /* gcc asm goto does not allow outputs */ : [cpu_id] "r" (cpu), - [current_cpu_id] "m" (__rseq_abi.cpu_id), - [rseq_cs] "m" (__rseq_abi.rseq_cs), + [current_cpu_id] "m" (rseq_get_abi()->cpu_id), + [rseq_cs] "m" (rseq_get_abi()->rseq_cs.arch.ptr), [v] "m" (*v), [count] "r" (count) RSEQ_INJECT_INPUT @@ -352,8 +352,8 @@ int rseq_cmpeqv_trystorev_storev(intptr_t *v, intptr_t expect, RSEQ_ASM_DEFINE_ABORT(4, abort) : /* gcc asm goto does not allow outputs */ : [cpu_id] "r" (cpu), - [current_cpu_id] "m" (__rseq_abi.cpu_id), - [rseq_cs] "m" (__rseq_abi.rseq_cs), + [current_cpu_id] "m" (rseq_get_abi()->cpu_id), + [rseq_cs] "m" (rseq_get_abi()->rseq_cs.arch.ptr), [expect] "r" (expect), [v] "m" (*v), [newv] "r" (newv), @@ -411,8 +411,8 @@ int rseq_cmpeqv_trystorev_storev_release(intptr_t *v, intptr_t expect, RSEQ_ASM_DEFINE_ABORT(4, abort) : /* gcc asm goto does not allow outputs */ : [cpu_id] "r" (cpu), - [current_cpu_id] "m" (__rseq_abi.cpu_id), - [rseq_cs] "m" (__rseq_abi.rseq_cs), + [current_cpu_id] "m" (rseq_get_abi()->cpu_id), + [rseq_cs] "m" (rseq_get_abi()->rseq_cs.arch.ptr), [expect] "r" (expect), [v] "m" (*v), [newv] "r" (newv), @@ -472,8 +472,8 @@ int rseq_cmpeqv_cmpeqv_storev(intptr_t *v, intptr_t expect, RSEQ_ASM_DEFINE_ABORT(4, abort) : /* gcc asm goto does not allow outputs */ : [cpu_id] "r" (cpu), - [current_cpu_id] "m" (__rseq_abi.cpu_id), - [rseq_cs] "m" (__rseq_abi.rseq_cs), + [current_cpu_id] "m" (rseq_get_abi()->cpu_id), + [rseq_cs] "m" (rseq_get_abi()->rseq_cs.arch.ptr), [v] "m" (*v), [expect] "r" (expect), [v2] "m" (*v2), @@ -532,8 +532,8 @@ int rseq_cmpeqv_trymemcpy_storev(intptr_t *v, intptr_t expect, RSEQ_ASM_DEFINE_ABORT(4, abort) : /* gcc asm goto does not allow outputs */ : [cpu_id] "r" (cpu), - [current_cpu_id] "m" (__rseq_abi.cpu_id), - [rseq_cs] "m" (__rseq_abi.rseq_cs), + [current_cpu_id] "m" (rseq_get_abi()->cpu_id), + [rseq_cs] "m" (rseq_get_abi()->rseq_cs.arch.ptr), [expect] "r" (expect), [v] "m" (*v), [newv] "r" (newv), @@ -593,8 +593,8 @@ int rseq_cmpeqv_trymemcpy_storev_release(intptr_t *v, intptr_t expect, RSEQ_ASM_DEFINE_ABORT(4, abort) : /* gcc asm goto does not allow outputs */ : [cpu_id] "r" (cpu), - [current_cpu_id] "m" (__rseq_abi.cpu_id), - [rseq_cs] "m" (__rseq_abi.rseq_cs), + [current_cpu_id] "m" (rseq_get_abi()->cpu_id), + [rseq_cs] "m" (rseq_get_abi()->rseq_cs.arch.ptr), [expect] "r" (expect), [v] "m" (*v), [newv] "r" (newv), @@ -651,8 +651,8 @@ int rseq_offset_deref_addv(intptr_t *ptr, off_t off, intptr_t inc, int cpu) RSEQ_ASM_DEFINE_ABORT(4, abort) : /* gcc asm goto does not allow outputs */ : [cpu_id] "r" (cpu), - [current_cpu_id] "m" (__rseq_abi.cpu_id), - [rseq_cs] "m" (__rseq_abi.rseq_cs), + [current_cpu_id] "m" (rseq_get_abi()->cpu_id), + [rseq_cs] "m" (rseq_get_abi()->rseq_cs.arch.ptr), [ptr] "r" (ptr), [off] "er" (off), [inc] "er" (inc) ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/3] selftests/rseq: riscv: fix 'literal-suffix' warning 2022-06-14 15:48 [PATCH 0/3] selftests/rseq: fixes for RISC-V and Glibc 2.35 Michael Jeanson 2022-06-14 15:48 ` [PATCH 1/3] selftests/rseq: riscv: use rseq_get_abi() helper Michael Jeanson @ 2022-06-14 15:48 ` Michael Jeanson 2022-06-28 7:16 ` [tip: sched/core] " tip-bot2 for Michael Jeanson 2022-06-14 15:48 ` [PATCH 3/3] selftests/rseq: check if libc rseq support is registered Michael Jeanson 2022-06-14 17:18 ` [PATCH 0/3] selftests/rseq: fixes for RISC-V and Glibc 2.35 Mathieu Desnoyers 3 siblings, 1 reply; 9+ messages in thread From: Michael Jeanson @ 2022-06-14 15:48 UTC (permalink / raw) To: Mathieu Desnoyers Cc: Peter Zijlstra, Paul E . McKenney, Boqun Feng, linux-kernel, linux-riscv, Michael Jeanson This header is also used in librseq where it can be included in C++ code, add a space between literals and string macros. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> --- tools/testing/selftests/rseq/rseq-riscv.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/rseq/rseq-riscv.h b/tools/testing/selftests/rseq/rseq-riscv.h index 6f8a605b75c0..3a391c9bf468 100644 --- a/tools/testing/selftests/rseq/rseq-riscv.h +++ b/tools/testing/selftests/rseq/rseq-riscv.h @@ -86,7 +86,7 @@ do { \ #define RSEQ_ASM_STORE_RSEQ_CS(label, cs_label, rseq_cs) \ RSEQ_INJECT_ASM(1) \ - "la "RSEQ_ASM_TMP_REG_1 ", " __rseq_str(cs_label) "\n" \ + "la " RSEQ_ASM_TMP_REG_1 ", " __rseq_str(cs_label) "\n" \ REG_S RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(rseq_cs) "]\n" \ __rseq_str(label) ":\n" @@ -103,17 +103,17 @@ do { \ #define RSEQ_ASM_OP_CMPEQ(var, expect, label) \ REG_L RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(var) "]\n" \ - "bne "RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(expect) "] ," \ + "bne " RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(expect) "] ," \ __rseq_str(label) "\n" #define RSEQ_ASM_OP_CMPEQ32(var, expect, label) \ - "lw "RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(var) "]\n" \ - "bne "RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(expect) "] ," \ + "lw " RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(var) "]\n" \ + "bne " RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(expect) "] ," \ __rseq_str(label) "\n" #define RSEQ_ASM_OP_CMPNE(var, expect, label) \ REG_L RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(var) "]\n" \ - "beq "RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(expect) "] ," \ + "beq " RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(expect) "] ," \ __rseq_str(label) "\n" #define RSEQ_ASM_CMP_CPU_ID(cpu_id, current_cpu_id, label) \ @@ -127,12 +127,12 @@ do { \ REG_S RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(var) "]\n" #define RSEQ_ASM_OP_R_LOAD_OFF(offset) \ - "add "RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(offset) "], " \ + "add " RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(offset) "], " \ RSEQ_ASM_TMP_REG_1 "\n" \ REG_L RSEQ_ASM_TMP_REG_1 ", (" RSEQ_ASM_TMP_REG_1 ")\n" #define RSEQ_ASM_OP_R_ADD(count) \ - "add "RSEQ_ASM_TMP_REG_1 ", " RSEQ_ASM_TMP_REG_1 \ + "add " RSEQ_ASM_TMP_REG_1 ", " RSEQ_ASM_TMP_REG_1 \ ", %[" __rseq_str(count) "]\n" #define RSEQ_ASM_OP_FINAL_STORE(value, var, post_commit_label) \ -- 2.34.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [tip: sched/core] selftests/rseq: riscv: fix 'literal-suffix' warning 2022-06-14 15:48 ` [PATCH 2/3] selftests/rseq: riscv: fix 'literal-suffix' warning Michael Jeanson @ 2022-06-28 7:16 ` tip-bot2 for Michael Jeanson 0 siblings, 0 replies; 9+ messages in thread From: tip-bot2 for Michael Jeanson @ 2022-06-28 7:16 UTC (permalink / raw) To: linux-tip-commits Cc: Michael Jeanson, Peter Zijlstra (Intel), Mathieu Desnoyers, x86, linux-kernel The following commit has been merged into the sched/core branch of tip: Commit-ID: d47c0cc94a86b9098930523a9e68180bef6b26cf Gitweb: https://git.kernel.org/tip/d47c0cc94a86b9098930523a9e68180bef6b26cf Author: Michael Jeanson <mjeanson@efficios.com> AuthorDate: Tue, 14 Jun 2022 11:48:29 -04:00 Committer: Peter Zijlstra <peterz@infradead.org> CommitterDate: Tue, 28 Jun 2022 09:08:28 +02:00 selftests/rseq: riscv: fix 'literal-suffix' warning This header is also used in librseq where it can be included in C++ code, add a space between literals and string macros. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Link: https://lore.kernel.org/r/20220614154830.1367382-3-mjeanson@efficios.com --- tools/testing/selftests/rseq/rseq-riscv.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/rseq/rseq-riscv.h b/tools/testing/selftests/rseq/rseq-riscv.h index 6f8a605..3a391c9 100644 --- a/tools/testing/selftests/rseq/rseq-riscv.h +++ b/tools/testing/selftests/rseq/rseq-riscv.h @@ -86,7 +86,7 @@ do { \ #define RSEQ_ASM_STORE_RSEQ_CS(label, cs_label, rseq_cs) \ RSEQ_INJECT_ASM(1) \ - "la "RSEQ_ASM_TMP_REG_1 ", " __rseq_str(cs_label) "\n" \ + "la " RSEQ_ASM_TMP_REG_1 ", " __rseq_str(cs_label) "\n" \ REG_S RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(rseq_cs) "]\n" \ __rseq_str(label) ":\n" @@ -103,17 +103,17 @@ do { \ #define RSEQ_ASM_OP_CMPEQ(var, expect, label) \ REG_L RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(var) "]\n" \ - "bne "RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(expect) "] ," \ + "bne " RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(expect) "] ," \ __rseq_str(label) "\n" #define RSEQ_ASM_OP_CMPEQ32(var, expect, label) \ - "lw "RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(var) "]\n" \ - "bne "RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(expect) "] ," \ + "lw " RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(var) "]\n" \ + "bne " RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(expect) "] ," \ __rseq_str(label) "\n" #define RSEQ_ASM_OP_CMPNE(var, expect, label) \ REG_L RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(var) "]\n" \ - "beq "RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(expect) "] ," \ + "beq " RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(expect) "] ," \ __rseq_str(label) "\n" #define RSEQ_ASM_CMP_CPU_ID(cpu_id, current_cpu_id, label) \ @@ -127,12 +127,12 @@ do { \ REG_S RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(var) "]\n" #define RSEQ_ASM_OP_R_LOAD_OFF(offset) \ - "add "RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(offset) "], " \ + "add " RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(offset) "], " \ RSEQ_ASM_TMP_REG_1 "\n" \ REG_L RSEQ_ASM_TMP_REG_1 ", (" RSEQ_ASM_TMP_REG_1 ")\n" #define RSEQ_ASM_OP_R_ADD(count) \ - "add "RSEQ_ASM_TMP_REG_1 ", " RSEQ_ASM_TMP_REG_1 \ + "add " RSEQ_ASM_TMP_REG_1 ", " RSEQ_ASM_TMP_REG_1 \ ", %[" __rseq_str(count) "]\n" #define RSEQ_ASM_OP_FINAL_STORE(value, var, post_commit_label) \ ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/3] selftests/rseq: check if libc rseq support is registered 2022-06-14 15:48 [PATCH 0/3] selftests/rseq: fixes for RISC-V and Glibc 2.35 Michael Jeanson 2022-06-14 15:48 ` [PATCH 1/3] selftests/rseq: riscv: use rseq_get_abi() helper Michael Jeanson 2022-06-14 15:48 ` [PATCH 2/3] selftests/rseq: riscv: fix 'literal-suffix' warning Michael Jeanson @ 2022-06-14 15:48 ` Michael Jeanson 2022-06-28 7:16 ` [tip: sched/core] " tip-bot2 for Michael Jeanson 2022-06-14 17:18 ` [PATCH 0/3] selftests/rseq: fixes for RISC-V and Glibc 2.35 Mathieu Desnoyers 3 siblings, 1 reply; 9+ messages in thread From: Michael Jeanson @ 2022-06-14 15:48 UTC (permalink / raw) To: Mathieu Desnoyers Cc: Peter Zijlstra, Paul E . McKenney, Boqun Feng, linux-kernel, linux-riscv, Michael Jeanson When checking for libc rseq support in the library constructor, don't only depend on the symbols presence, check that the registration was completed. This targets a scenario where the libc has rseq support but it is not wired for the current architecture in 'bits/rseq.h', we want to fallback to our internal registration mechanism. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> --- tools/testing/selftests/rseq/rseq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/rseq/rseq.c b/tools/testing/selftests/rseq/rseq.c index 986b9458efb2..4177f9507bbe 100644 --- a/tools/testing/selftests/rseq/rseq.c +++ b/tools/testing/selftests/rseq/rseq.c @@ -111,7 +111,8 @@ void rseq_init(void) libc_rseq_offset_p = dlsym(RTLD_NEXT, "__rseq_offset"); libc_rseq_size_p = dlsym(RTLD_NEXT, "__rseq_size"); libc_rseq_flags_p = dlsym(RTLD_NEXT, "__rseq_flags"); - if (libc_rseq_size_p && libc_rseq_offset_p && libc_rseq_flags_p) { + if (libc_rseq_size_p && libc_rseq_offset_p && libc_rseq_flags_p && + *libc_rseq_size_p != 0) { /* rseq registration owned by glibc */ rseq_offset = *libc_rseq_offset_p; rseq_size = *libc_rseq_size_p; -- 2.34.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [tip: sched/core] selftests/rseq: check if libc rseq support is registered 2022-06-14 15:48 ` [PATCH 3/3] selftests/rseq: check if libc rseq support is registered Michael Jeanson @ 2022-06-28 7:16 ` tip-bot2 for Michael Jeanson 0 siblings, 0 replies; 9+ messages in thread From: tip-bot2 for Michael Jeanson @ 2022-06-28 7:16 UTC (permalink / raw) To: linux-tip-commits Cc: Michael Jeanson, Peter Zijlstra (Intel), Mathieu Desnoyers, x86, linux-kernel The following commit has been merged into the sched/core branch of tip: Commit-ID: d1a997ba4c1bf65497d956aea90de42a6398f73a Gitweb: https://git.kernel.org/tip/d1a997ba4c1bf65497d956aea90de42a6398f73a Author: Michael Jeanson <mjeanson@efficios.com> AuthorDate: Tue, 14 Jun 2022 11:48:30 -04:00 Committer: Peter Zijlstra <peterz@infradead.org> CommitterDate: Tue, 28 Jun 2022 09:08:28 +02:00 selftests/rseq: check if libc rseq support is registered When checking for libc rseq support in the library constructor, don't only depend on the symbols presence, check that the registration was completed. This targets a scenario where the libc has rseq support but it is not wired for the current architecture in 'bits/rseq.h', we want to fallback to our internal registration mechanism. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Link: https://lore.kernel.org/r/20220614154830.1367382-4-mjeanson@efficios.com --- tools/testing/selftests/rseq/rseq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/rseq/rseq.c b/tools/testing/selftests/rseq/rseq.c index 986b945..4177f95 100644 --- a/tools/testing/selftests/rseq/rseq.c +++ b/tools/testing/selftests/rseq/rseq.c @@ -111,7 +111,8 @@ void rseq_init(void) libc_rseq_offset_p = dlsym(RTLD_NEXT, "__rseq_offset"); libc_rseq_size_p = dlsym(RTLD_NEXT, "__rseq_size"); libc_rseq_flags_p = dlsym(RTLD_NEXT, "__rseq_flags"); - if (libc_rseq_size_p && libc_rseq_offset_p && libc_rseq_flags_p) { + if (libc_rseq_size_p && libc_rseq_offset_p && libc_rseq_flags_p && + *libc_rseq_size_p != 0) { /* rseq registration owned by glibc */ rseq_offset = *libc_rseq_offset_p; rseq_size = *libc_rseq_size_p; ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 0/3] selftests/rseq: fixes for RISC-V and Glibc 2.35 2022-06-14 15:48 [PATCH 0/3] selftests/rseq: fixes for RISC-V and Glibc 2.35 Michael Jeanson ` (2 preceding siblings ...) 2022-06-14 15:48 ` [PATCH 3/3] selftests/rseq: check if libc rseq support is registered Michael Jeanson @ 2022-06-14 17:18 ` Mathieu Desnoyers 2022-06-15 10:15 ` Peter Zijlstra 3 siblings, 1 reply; 9+ messages in thread From: Mathieu Desnoyers @ 2022-06-14 17:18 UTC (permalink / raw) To: Michael Jeanson, Peter Zijlstra Cc: Paul E . McKenney, Boqun Feng, linux-kernel, linux-riscv ----- On Jun 14, 2022, at 11:48 AM, Michael Jeanson mjeanson@efficios.com wrote: > The patch series allows running the rseq selftests on a Glibc 2.35 > system which has rseq support but no RSEQ_SIG defined for the RISC-V > architecture. > > The patches were tested on both Glibc 2.33 and 2.35. For the whole series: Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Peter, can you pick them up through your tree ? Thanks, Mathieu > > Michael Jeanson (3): > selftests/rseq: riscv: use rseq_get_abi() helper > selftests/rseq: riscv: fix 'literal-suffix' warning > selftests/rseq: check if libc rseq support is registered > > tools/testing/selftests/rseq/rseq-riscv.h | 50 +++++++++++------------ > tools/testing/selftests/rseq/rseq.c | 3 +- > 2 files changed, 27 insertions(+), 26 deletions(-) > > -- > 2.34.1 -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/3] selftests/rseq: fixes for RISC-V and Glibc 2.35 2022-06-14 17:18 ` [PATCH 0/3] selftests/rseq: fixes for RISC-V and Glibc 2.35 Mathieu Desnoyers @ 2022-06-15 10:15 ` Peter Zijlstra 0 siblings, 0 replies; 9+ messages in thread From: Peter Zijlstra @ 2022-06-15 10:15 UTC (permalink / raw) To: Mathieu Desnoyers Cc: Michael Jeanson, Paul E . McKenney, Boqun Feng, linux-kernel, linux-riscv On Tue, Jun 14, 2022 at 01:18:49PM -0400, Mathieu Desnoyers wrote: > ----- On Jun 14, 2022, at 11:48 AM, Michael Jeanson mjeanson@efficios.com wrote: > > > The patch series allows running the rseq selftests on a Glibc 2.35 > > system which has rseq support but no RSEQ_SIG defined for the RISC-V > > architecture. > > > > The patches were tested on both Glibc 2.33 and 2.35. > > For the whole series: > > Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> > > Peter, can you pick them up through your tree ? Sure, thanks! ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2022-06-28 7:17 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-06-14 15:48 [PATCH 0/3] selftests/rseq: fixes for RISC-V and Glibc 2.35 Michael Jeanson 2022-06-14 15:48 ` [PATCH 1/3] selftests/rseq: riscv: use rseq_get_abi() helper Michael Jeanson 2022-06-28 7:16 ` [tip: sched/core] " tip-bot2 for Michael Jeanson 2022-06-14 15:48 ` [PATCH 2/3] selftests/rseq: riscv: fix 'literal-suffix' warning Michael Jeanson 2022-06-28 7:16 ` [tip: sched/core] " tip-bot2 for Michael Jeanson 2022-06-14 15:48 ` [PATCH 3/3] selftests/rseq: check if libc rseq support is registered Michael Jeanson 2022-06-28 7:16 ` [tip: sched/core] " tip-bot2 for Michael Jeanson 2022-06-14 17:18 ` [PATCH 0/3] selftests/rseq: fixes for RISC-V and Glibc 2.35 Mathieu Desnoyers 2022-06-15 10:15 ` Peter Zijlstra
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox