Skip to content

Commit 4fe2088

Browse files
compudjshuahkh
authored andcommitted
rseq/selftests: Add __rseq_exit_point_array section for debuggers
Knowing all exit points is useful to assist debuggers stepping over the rseq critical sections without requiring them to disassemble the content of the critical section to figure out the exit points. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> CC: Thomas Gleixner <tglx@linutronix.de> CC: Joel Fernandes <joelaf@google.com> CC: Peter Zijlstra <peterz@infradead.org> CC: Catalin Marinas <catalin.marinas@arm.com> CC: Dave Watson <davejwatson@fb.com> CC: Will Deacon <will.deacon@arm.com> CC: Shuah Khan <shuah@kernel.org> CC: Andi Kleen <andi@firstfloor.org> CC: linux-kselftest@vger.kernel.org CC: "H . Peter Anvin" <hpa@zytor.com> CC: Chris Lameter <cl@linux.com> CC: Russell King <linux@arm.linux.org.uk> CC: Michael Kerrisk <mtk.manpages@gmail.com> CC: "Paul E . McKenney" <paulmck@linux.vnet.ibm.com> CC: Paul Turner <pjt@google.com> CC: Boqun Feng <boqun.feng@gmail.com> CC: Josh Triplett <josh@joshtriplett.org> CC: Steven Rostedt <rostedt@goodmis.org> CC: Ben Maurer <bmaurer@fb.com> CC: linux-api@vger.kernel.org CC: Andy Lutomirski <luto@amacapital.net> CC: Andrew Morton <akpm@linux-foundation.org> CC: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
1 parent fe22983 commit 4fe2088

6 files changed

Lines changed: 372 additions & 0 deletions

File tree

‎tools/testing/selftests/rseq/rseq-arm.h‎

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,19 @@ do { \
4242
__RSEQ_ASM_DEFINE_TABLE(0x0, 0x0, start_ip, \
4343
(post_commit_ip - start_ip), abort_ip)
4444

45+
/*
46+
* Exit points of a rseq critical section consist of all instructions outside
47+
* of the critical section where a critical section can either branch to or
48+
* reach through the normal course of its execution. The abort IP and the
49+
* post-commit IP are already part of the __rseq_table section and should not
50+
* be explicitly defined as additional exit points. Knowing all exit points is
51+
* useful to assist debuggers stepping over the critical section.
52+
*/
53+
#define RSEQ_ASM_DEFINE_EXIT_POINT(start_ip, exit_ip) \
54+
".pushsection __rseq_exit_point_array, \"aw\"\n\t" \
55+
".word " __rseq_str(start_ip) ", 0x0, " __rseq_str(exit_ip) ", 0x0\n\t" \
56+
".popsection\n\t"
57+
4558
#define RSEQ_ASM_STORE_RSEQ_CS(label, cs_label, rseq_cs) \
4659
RSEQ_INJECT_ASM(1) \
4760
"adr r0, " __rseq_str(cs_label) "\n\t" \
@@ -87,6 +100,11 @@ int rseq_cmpeqv_storev(intptr_t *v, intptr_t expect, intptr_t newv, int cpu)
87100
rseq_workaround_gcc_asm_size_guess();
88101
__asm__ __volatile__ goto (
89102
RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
103+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail])
104+
#ifdef RSEQ_COMPARE_TWICE
105+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
106+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error2])
107+
#endif
90108
/* Start rseq by storing table entry pointer into rseq_cs. */
91109
RSEQ_ASM_STORE_RSEQ_CS(1, 3f, rseq_cs)
92110
RSEQ_ASM_CMP_CPU_ID(cpu_id, current_cpu_id, 4f)
@@ -149,6 +167,11 @@ int rseq_cmpnev_storeoffp_load(intptr_t *v, intptr_t expectnot,
149167
rseq_workaround_gcc_asm_size_guess();
150168
__asm__ __volatile__ goto (
151169
RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
170+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail])
171+
#ifdef RSEQ_COMPARE_TWICE
172+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
173+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error2])
174+
#endif
152175
/* Start rseq by storing table entry pointer into rseq_cs. */
153176
RSEQ_ASM_STORE_RSEQ_CS(1, 3f, rseq_cs)
154177
RSEQ_ASM_CMP_CPU_ID(cpu_id, current_cpu_id, 4f)
@@ -215,6 +238,9 @@ int rseq_addv(intptr_t *v, intptr_t count, int cpu)
215238
rseq_workaround_gcc_asm_size_guess();
216239
__asm__ __volatile__ goto (
217240
RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
241+
#ifdef RSEQ_COMPARE_TWICE
242+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
243+
#endif
218244
/* Start rseq by storing table entry pointer into rseq_cs. */
219245
RSEQ_ASM_STORE_RSEQ_CS(1, 3f, rseq_cs)
220246
RSEQ_ASM_CMP_CPU_ID(cpu_id, current_cpu_id, 4f)
@@ -267,6 +293,11 @@ int rseq_cmpeqv_trystorev_storev(intptr_t *v, intptr_t expect,
267293
rseq_workaround_gcc_asm_size_guess();
268294
__asm__ __volatile__ goto (
269295
RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
296+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail])
297+
#ifdef RSEQ_COMPARE_TWICE
298+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
299+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error2])
300+
#endif
270301
/* Start rseq by storing table entry pointer into rseq_cs. */
271302
RSEQ_ASM_STORE_RSEQ_CS(1, 3f, rseq_cs)
272303
RSEQ_ASM_CMP_CPU_ID(cpu_id, current_cpu_id, 4f)
@@ -337,6 +368,11 @@ int rseq_cmpeqv_trystorev_storev_release(intptr_t *v, intptr_t expect,
337368
rseq_workaround_gcc_asm_size_guess();
338369
__asm__ __volatile__ goto (
339370
RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
371+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail])
372+
#ifdef RSEQ_COMPARE_TWICE
373+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
374+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error2])
375+
#endif
340376
/* Start rseq by storing table entry pointer into rseq_cs. */
341377
RSEQ_ASM_STORE_RSEQ_CS(1, 3f, rseq_cs)
342378
RSEQ_ASM_CMP_CPU_ID(cpu_id, current_cpu_id, 4f)
@@ -408,6 +444,12 @@ int rseq_cmpeqv_cmpeqv_storev(intptr_t *v, intptr_t expect,
408444
rseq_workaround_gcc_asm_size_guess();
409445
__asm__ __volatile__ goto (
410446
RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
447+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail])
448+
#ifdef RSEQ_COMPARE_TWICE
449+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
450+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error2])
451+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error3])
452+
#endif
411453
/* Start rseq by storing table entry pointer into rseq_cs. */
412454
RSEQ_ASM_STORE_RSEQ_CS(1, 3f, rseq_cs)
413455
RSEQ_ASM_CMP_CPU_ID(cpu_id, current_cpu_id, 4f)
@@ -486,6 +528,11 @@ int rseq_cmpeqv_trymemcpy_storev(intptr_t *v, intptr_t expect,
486528
rseq_workaround_gcc_asm_size_guess();
487529
__asm__ __volatile__ goto (
488530
RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
531+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail])
532+
#ifdef RSEQ_COMPARE_TWICE
533+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
534+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error2])
535+
#endif
489536
"str %[src], %[rseq_scratch0]\n\t"
490537
"str %[dst], %[rseq_scratch1]\n\t"
491538
"str %[len], %[rseq_scratch2]\n\t"
@@ -605,6 +652,11 @@ int rseq_cmpeqv_trymemcpy_storev_release(intptr_t *v, intptr_t expect,
605652
rseq_workaround_gcc_asm_size_guess();
606653
__asm__ __volatile__ goto (
607654
RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
655+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail])
656+
#ifdef RSEQ_COMPARE_TWICE
657+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
658+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error2])
659+
#endif
608660
"str %[src], %[rseq_scratch0]\n\t"
609661
"str %[dst], %[rseq_scratch1]\n\t"
610662
"str %[len], %[rseq_scratch2]\n\t"

‎tools/testing/selftests/rseq/rseq-arm64.h‎

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,19 @@ do { \
9595
__RSEQ_ASM_DEFINE_TABLE(label, 0x0, 0x0, start_ip, \
9696
(post_commit_ip - start_ip), abort_ip)
9797

98+
/*
99+
* Exit points of a rseq critical section consist of all instructions outside
100+
* of the critical section where a critical section can either branch to or
101+
* reach through the normal course of its execution. The abort IP and the
102+
* post-commit IP are already part of the __rseq_table section and should not
103+
* be explicitly defined as additional exit points. Knowing all exit points is
104+
* useful to assist debuggers stepping over the critical section.
105+
*/
106+
#define RSEQ_ASM_DEFINE_EXIT_POINT(start_ip, exit_ip) \
107+
" .pushsection __rseq_exit_point_array, \"aw\"\n" \
108+
" .quad " __rseq_str(start_ip) ", " __rseq_str(exit_ip) "\n" \
109+
" .popsection\n"
110+
98111
#define RSEQ_ASM_STORE_RSEQ_CS(label, cs_label, rseq_cs) \
99112
RSEQ_INJECT_ASM(1) \
100113
" adrp " RSEQ_ASM_TMP_REG ", " __rseq_str(cs_label) "\n" \
@@ -182,6 +195,11 @@ int rseq_cmpeqv_storev(intptr_t *v, intptr_t expect, intptr_t newv, int cpu)
182195

183196
__asm__ __volatile__ goto (
184197
RSEQ_ASM_DEFINE_TABLE(1, 2f, 3f, 4f)
198+
RSEQ_ASM_DEFINE_EXIT_POINT(2f, %l[cmpfail])
199+
#ifdef RSEQ_COMPARE_TWICE
200+
RSEQ_ASM_DEFINE_EXIT_POINT(2f, %l[error1])
201+
RSEQ_ASM_DEFINE_EXIT_POINT(2f, %l[error2])
202+
#endif
185203
RSEQ_ASM_STORE_RSEQ_CS(2, 1b, rseq_cs)
186204
RSEQ_ASM_CMP_CPU_ID(cpu_id, current_cpu_id, 4f)
187205
RSEQ_INJECT_ASM(3)
@@ -231,6 +249,11 @@ int rseq_cmpnev_storeoffp_load(intptr_t *v, intptr_t expectnot,
231249

232250
__asm__ __volatile__ goto (
233251
RSEQ_ASM_DEFINE_TABLE(1, 2f, 3f, 4f)
252+
RSEQ_ASM_DEFINE_EXIT_POINT(2f, %l[cmpfail])
253+
#ifdef RSEQ_COMPARE_TWICE
254+
RSEQ_ASM_DEFINE_EXIT_POINT(2f, %l[error1])
255+
RSEQ_ASM_DEFINE_EXIT_POINT(2f, %l[error2])
256+
#endif
234257
RSEQ_ASM_STORE_RSEQ_CS(2, 1b, rseq_cs)
235258
RSEQ_ASM_CMP_CPU_ID(cpu_id, current_cpu_id, 4f)
236259
RSEQ_INJECT_ASM(3)
@@ -282,6 +305,9 @@ int rseq_addv(intptr_t *v, intptr_t count, int cpu)
282305

283306
__asm__ __volatile__ goto (
284307
RSEQ_ASM_DEFINE_TABLE(1, 2f, 3f, 4f)
308+
#ifdef RSEQ_COMPARE_TWICE
309+
RSEQ_ASM_DEFINE_EXIT_POINT(2f, %l[error1])
310+
#endif
285311
RSEQ_ASM_STORE_RSEQ_CS(2, 1b, rseq_cs)
286312
RSEQ_ASM_CMP_CPU_ID(cpu_id, current_cpu_id, 4f)
287313
RSEQ_INJECT_ASM(3)
@@ -325,6 +351,11 @@ int rseq_cmpeqv_trystorev_storev(intptr_t *v, intptr_t expect,
325351

326352
__asm__ __volatile__ goto (
327353
RSEQ_ASM_DEFINE_TABLE(1, 2f, 3f, 4f)
354+
RSEQ_ASM_DEFINE_EXIT_POINT(2f, %l[cmpfail])
355+
#ifdef RSEQ_COMPARE_TWICE
356+
RSEQ_ASM_DEFINE_EXIT_POINT(2f, %l[error1])
357+
RSEQ_ASM_DEFINE_EXIT_POINT(2f, %l[error2])
358+
#endif
328359
RSEQ_ASM_STORE_RSEQ_CS(2, 1b, rseq_cs)
329360
RSEQ_ASM_CMP_CPU_ID(cpu_id, current_cpu_id, 4f)
330361
RSEQ_INJECT_ASM(3)
@@ -379,6 +410,11 @@ int rseq_cmpeqv_trystorev_storev_release(intptr_t *v, intptr_t expect,
379410

380411
__asm__ __volatile__ goto (
381412
RSEQ_ASM_DEFINE_TABLE(1, 2f, 3f, 4f)
413+
RSEQ_ASM_DEFINE_EXIT_POINT(2f, %l[cmpfail])
414+
#ifdef RSEQ_COMPARE_TWICE
415+
RSEQ_ASM_DEFINE_EXIT_POINT(2f, %l[error1])
416+
RSEQ_ASM_DEFINE_EXIT_POINT(2f, %l[error2])
417+
#endif
382418
RSEQ_ASM_STORE_RSEQ_CS(2, 1b, rseq_cs)
383419
RSEQ_ASM_CMP_CPU_ID(cpu_id, current_cpu_id, 4f)
384420
RSEQ_INJECT_ASM(3)
@@ -433,6 +469,12 @@ int rseq_cmpeqv_cmpeqv_storev(intptr_t *v, intptr_t expect,
433469

434470
__asm__ __volatile__ goto (
435471
RSEQ_ASM_DEFINE_TABLE(1, 2f, 3f, 4f)
472+
RSEQ_ASM_DEFINE_EXIT_POINT(2f, %l[cmpfail])
473+
#ifdef RSEQ_COMPARE_TWICE
474+
RSEQ_ASM_DEFINE_EXIT_POINT(2f, %l[error1])
475+
RSEQ_ASM_DEFINE_EXIT_POINT(2f, %l[error2])
476+
RSEQ_ASM_DEFINE_EXIT_POINT(2f, %l[error3])
477+
#endif
436478
RSEQ_ASM_STORE_RSEQ_CS(2, 1b, rseq_cs)
437479
RSEQ_ASM_CMP_CPU_ID(cpu_id, current_cpu_id, 4f)
438480
RSEQ_INJECT_ASM(3)
@@ -490,6 +532,11 @@ int rseq_cmpeqv_trymemcpy_storev(intptr_t *v, intptr_t expect,
490532

491533
__asm__ __volatile__ goto (
492534
RSEQ_ASM_DEFINE_TABLE(1, 2f, 3f, 4f)
535+
RSEQ_ASM_DEFINE_EXIT_POINT(2f, %l[cmpfail])
536+
#ifdef RSEQ_COMPARE_TWICE
537+
RSEQ_ASM_DEFINE_EXIT_POINT(2f, %l[error1])
538+
RSEQ_ASM_DEFINE_EXIT_POINT(2f, %l[error2])
539+
#endif
493540
RSEQ_ASM_STORE_RSEQ_CS(2, 1b, rseq_cs)
494541
RSEQ_ASM_CMP_CPU_ID(cpu_id, current_cpu_id, 4f)
495542
RSEQ_INJECT_ASM(3)
@@ -545,6 +592,11 @@ int rseq_cmpeqv_trymemcpy_storev_release(intptr_t *v, intptr_t expect,
545592

546593
__asm__ __volatile__ goto (
547594
RSEQ_ASM_DEFINE_TABLE(1, 2f, 3f, 4f)
595+
RSEQ_ASM_DEFINE_EXIT_POINT(2f, %l[cmpfail])
596+
#ifdef RSEQ_COMPARE_TWICE
597+
RSEQ_ASM_DEFINE_EXIT_POINT(2f, %l[error1])
598+
RSEQ_ASM_DEFINE_EXIT_POINT(2f, %l[error2])
599+
#endif
548600
RSEQ_ASM_STORE_RSEQ_CS(2, 1b, rseq_cs)
549601
RSEQ_ASM_CMP_CPU_ID(cpu_id, current_cpu_id, 4f)
550602
RSEQ_INJECT_ASM(3)

‎tools/testing/selftests/rseq/rseq-mips.h‎

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,20 @@ do { \
6868
__RSEQ_ASM_DEFINE_TABLE(0x0, 0x0, start_ip, \
6969
(post_commit_ip - start_ip), abort_ip)
7070

71+
/*
72+
* Exit points of a rseq critical section consist of all instructions outside
73+
* of the critical section where a critical section can either branch to or
74+
* reach through the normal course of its execution. The abort IP and the
75+
* post-commit IP are already part of the __rseq_table section and should not
76+
* be explicitly defined as additional exit points. Knowing all exit points is
77+
* useful to assist debuggers stepping over the critical section.
78+
*/
79+
#define RSEQ_ASM_DEFINE_EXIT_POINT(start_ip, exit_ip) \
80+
".pushsection __rseq_exit_point_array, \"aw\"\n\t" \
81+
LONG " " U32_U64_PAD(__rseq_str(start_ip)) "\n\t" \
82+
LONG " " U32_U64_PAD(__rseq_str(exit_ip)) "\n\t" \
83+
".popsection\n\t"
84+
7185
#define RSEQ_ASM_STORE_RSEQ_CS(label, cs_label, rseq_cs) \
7286
RSEQ_INJECT_ASM(1) \
7387
LONG_LA " $4, " __rseq_str(cs_label) "\n\t" \
@@ -114,6 +128,11 @@ int rseq_cmpeqv_storev(intptr_t *v, intptr_t expect, intptr_t newv, int cpu)
114128
rseq_workaround_gcc_asm_size_guess();
115129
__asm__ __volatile__ goto (
116130
RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
131+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail])
132+
#ifdef RSEQ_COMPARE_TWICE
133+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
134+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error2])
135+
#endif
117136
/* Start rseq by storing table entry pointer into rseq_cs. */
118137
RSEQ_ASM_STORE_RSEQ_CS(1, 3f, rseq_cs)
119138
RSEQ_ASM_CMP_CPU_ID(cpu_id, current_cpu_id, 4f)
@@ -174,6 +193,11 @@ int rseq_cmpnev_storeoffp_load(intptr_t *v, intptr_t expectnot,
174193
rseq_workaround_gcc_asm_size_guess();
175194
__asm__ __volatile__ goto (
176195
RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
196+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail])
197+
#ifdef RSEQ_COMPARE_TWICE
198+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
199+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error2])
200+
#endif
177201
/* Start rseq by storing table entry pointer into rseq_cs. */
178202
RSEQ_ASM_STORE_RSEQ_CS(1, 3f, rseq_cs)
179203
RSEQ_ASM_CMP_CPU_ID(cpu_id, current_cpu_id, 4f)
@@ -238,6 +262,9 @@ int rseq_addv(intptr_t *v, intptr_t count, int cpu)
238262
rseq_workaround_gcc_asm_size_guess();
239263
__asm__ __volatile__ goto (
240264
RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
265+
#ifdef RSEQ_COMPARE_TWICE
266+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
267+
#endif
241268
/* Start rseq by storing table entry pointer into rseq_cs. */
242269
RSEQ_ASM_STORE_RSEQ_CS(1, 3f, rseq_cs)
243270
RSEQ_ASM_CMP_CPU_ID(cpu_id, current_cpu_id, 4f)
@@ -290,6 +317,11 @@ int rseq_cmpeqv_trystorev_storev(intptr_t *v, intptr_t expect,
290317
rseq_workaround_gcc_asm_size_guess();
291318
__asm__ __volatile__ goto (
292319
RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
320+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail])
321+
#ifdef RSEQ_COMPARE_TWICE
322+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
323+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error2])
324+
#endif
293325
/* Start rseq by storing table entry pointer into rseq_cs. */
294326
RSEQ_ASM_STORE_RSEQ_CS(1, 3f, rseq_cs)
295327
RSEQ_ASM_CMP_CPU_ID(cpu_id, current_cpu_id, 4f)
@@ -358,6 +390,11 @@ int rseq_cmpeqv_trystorev_storev_release(intptr_t *v, intptr_t expect,
358390
rseq_workaround_gcc_asm_size_guess();
359391
__asm__ __volatile__ goto (
360392
RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
393+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail])
394+
#ifdef RSEQ_COMPARE_TWICE
395+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
396+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error2])
397+
#endif
361398
/* Start rseq by storing table entry pointer into rseq_cs. */
362399
RSEQ_ASM_STORE_RSEQ_CS(1, 3f, rseq_cs)
363400
RSEQ_ASM_CMP_CPU_ID(cpu_id, current_cpu_id, 4f)
@@ -427,6 +464,12 @@ int rseq_cmpeqv_cmpeqv_storev(intptr_t *v, intptr_t expect,
427464
rseq_workaround_gcc_asm_size_guess();
428465
__asm__ __volatile__ goto (
429466
RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
467+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail])
468+
#ifdef RSEQ_COMPARE_TWICE
469+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
470+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error2])
471+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error3])
472+
#endif
430473
/* Start rseq by storing table entry pointer into rseq_cs. */
431474
RSEQ_ASM_STORE_RSEQ_CS(1, 3f, rseq_cs)
432475
RSEQ_ASM_CMP_CPU_ID(cpu_id, current_cpu_id, 4f)
@@ -501,6 +544,11 @@ int rseq_cmpeqv_trymemcpy_storev(intptr_t *v, intptr_t expect,
501544
rseq_workaround_gcc_asm_size_guess();
502545
__asm__ __volatile__ goto (
503546
RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
547+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail])
548+
#ifdef RSEQ_COMPARE_TWICE
549+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
550+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error2])
551+
#endif
504552
LONG_S " %[src], %[rseq_scratch0]\n\t"
505553
LONG_S " %[dst], %[rseq_scratch1]\n\t"
506554
LONG_S " %[len], %[rseq_scratch2]\n\t"
@@ -617,6 +665,11 @@ int rseq_cmpeqv_trymemcpy_storev_release(intptr_t *v, intptr_t expect,
617665
rseq_workaround_gcc_asm_size_guess();
618666
__asm__ __volatile__ goto (
619667
RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
668+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail])
669+
#ifdef RSEQ_COMPARE_TWICE
670+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
671+
RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error2])
672+
#endif
620673
LONG_S " %[src], %[rseq_scratch0]\n\t"
621674
LONG_S " %[dst], %[rseq_scratch1]\n\t"
622675
LONG_S " %[len], %[rseq_scratch2]\n\t"

0 commit comments

Comments
 (0)