Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rseq/selftests: Introduce __rseq_cs_ptr_array, rename __rseq_table to __rseq_cs

The entries within __rseq_table are aligned on 32 bytes due to
linux/rseq.h struct rseq_cs uapi requirements, but the start of the
__rseq_table section is not guaranteed to be 32-byte aligned. It can
cause padding to be added at the start of the section, which makes it
hard to use as an array of items by debuggers.

Considering that __rseq_table does not really consist of a table due to
the presence of padding, rename this section to __rseq_cs.

Create a new __rseq_cs_ptr_array section which contains 64-bit packed
pointers to entries within the __rseq_cs section.

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>

authored by

Mathieu Desnoyers and committed by
Shuah Khan
a3e3131f 4fe2088e

+81 -51
+18 -14
tools/testing/selftests/rseq/rseq-arm.h
··· 30 30 #include "rseq-skip.h" 31 31 #else /* !RSEQ_SKIP_FASTPATH */ 32 32 33 - #define __RSEQ_ASM_DEFINE_TABLE(version, flags, start_ip, \ 33 + #define __RSEQ_ASM_DEFINE_TABLE(label, version, flags, start_ip, \ 34 34 post_commit_offset, abort_ip) \ 35 - ".pushsection __rseq_table, \"aw\"\n\t" \ 35 + ".pushsection __rseq_cs, \"aw\"\n\t" \ 36 36 ".balign 32\n\t" \ 37 + __rseq_str(label) ":\n\t" \ 37 38 ".word " __rseq_str(version) ", " __rseq_str(flags) "\n\t" \ 38 39 ".word " __rseq_str(start_ip) ", 0x0, " __rseq_str(post_commit_offset) ", 0x0, " __rseq_str(abort_ip) ", 0x0\n\t" \ 40 + ".popsection\n\t" \ 41 + ".pushsection __rseq_cs_ptr_array, \"aw\"\n\t" \ 42 + ".word " __rseq_str(label) "b, 0x0\n\t" \ 39 43 ".popsection\n\t" 40 44 41 - #define RSEQ_ASM_DEFINE_TABLE(start_ip, post_commit_ip, abort_ip) \ 42 - __RSEQ_ASM_DEFINE_TABLE(0x0, 0x0, start_ip, \ 45 + #define RSEQ_ASM_DEFINE_TABLE(label, start_ip, post_commit_ip, abort_ip) \ 46 + __RSEQ_ASM_DEFINE_TABLE(label, 0x0, 0x0, start_ip, \ 43 47 (post_commit_ip - start_ip), abort_ip) 44 48 45 49 /* 46 50 * Exit points of a rseq critical section consist of all instructions outside 47 51 * of the critical section where a critical section can either branch to or 48 52 * 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 53 + * post-commit IP are already part of the __rseq_cs section and should not be 54 + * explicitly defined as additional exit points. Knowing all exit points is 51 55 * useful to assist debuggers stepping over the critical section. 52 56 */ 53 57 #define RSEQ_ASM_DEFINE_EXIT_POINT(start_ip, exit_ip) \ ··· 103 99 104 100 rseq_workaround_gcc_asm_size_guess(); 105 101 __asm__ __volatile__ goto ( 106 - RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */ 102 + RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */ 107 103 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail]) 108 104 #ifdef RSEQ_COMPARE_TWICE 109 105 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1]) ··· 170 166 171 167 rseq_workaround_gcc_asm_size_guess(); 172 168 __asm__ __volatile__ goto ( 173 - RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */ 169 + RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */ 174 170 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail]) 175 171 #ifdef RSEQ_COMPARE_TWICE 176 172 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1]) ··· 241 237 242 238 rseq_workaround_gcc_asm_size_guess(); 243 239 __asm__ __volatile__ goto ( 244 - RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */ 240 + RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */ 245 241 #ifdef RSEQ_COMPARE_TWICE 246 242 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1]) 247 243 #endif ··· 296 292 297 293 rseq_workaround_gcc_asm_size_guess(); 298 294 __asm__ __volatile__ goto ( 299 - RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */ 295 + RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */ 300 296 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail]) 301 297 #ifdef RSEQ_COMPARE_TWICE 302 298 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1]) ··· 371 367 372 368 rseq_workaround_gcc_asm_size_guess(); 373 369 __asm__ __volatile__ goto ( 374 - RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */ 370 + RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */ 375 371 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail]) 376 372 #ifdef RSEQ_COMPARE_TWICE 377 373 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1]) ··· 447 443 448 444 rseq_workaround_gcc_asm_size_guess(); 449 445 __asm__ __volatile__ goto ( 450 - RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */ 446 + RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */ 451 447 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail]) 452 448 #ifdef RSEQ_COMPARE_TWICE 453 449 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1]) ··· 531 527 532 528 rseq_workaround_gcc_asm_size_guess(); 533 529 __asm__ __volatile__ goto ( 534 - RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */ 530 + RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */ 535 531 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail]) 536 532 #ifdef RSEQ_COMPARE_TWICE 537 533 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1]) ··· 655 651 656 652 rseq_workaround_gcc_asm_size_guess(); 657 653 __asm__ __volatile__ goto ( 658 - RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */ 654 + RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */ 659 655 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail]) 660 656 #ifdef RSEQ_COMPARE_TWICE 661 657 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
+6 -3
tools/testing/selftests/rseq/rseq-arm64.h
··· 82 82 83 83 #define __RSEQ_ASM_DEFINE_TABLE(label, version, flags, start_ip, \ 84 84 post_commit_offset, abort_ip) \ 85 - " .pushsection __rseq_table, \"aw\"\n" \ 85 + " .pushsection __rseq_cs, \"aw\"\n" \ 86 86 " .balign 32\n" \ 87 87 __rseq_str(label) ":\n" \ 88 88 " .long " __rseq_str(version) ", " __rseq_str(flags) "\n" \ 89 89 " .quad " __rseq_str(start_ip) ", " \ 90 90 __rseq_str(post_commit_offset) ", " \ 91 91 __rseq_str(abort_ip) "\n" \ 92 + " .popsection\n\t" \ 93 + " .pushsection __rseq_cs_ptr_array, \"aw\"\n" \ 94 + " .quad " __rseq_str(label) "b\n" \ 92 95 " .popsection\n" 93 96 94 97 #define RSEQ_ASM_DEFINE_TABLE(label, start_ip, post_commit_ip, abort_ip) \ ··· 102 99 * Exit points of a rseq critical section consist of all instructions outside 103 100 * of the critical section where a critical section can either branch to or 104 101 * reach through the normal course of its execution. The abort IP and the 105 - * post-commit IP are already part of the __rseq_table section and should not 106 - * be explicitly defined as additional exit points. Knowing all exit points is 102 + * post-commit IP are already part of the __rseq_cs section and should not be 103 + * explicitly defined as additional exit points. Knowing all exit points is 107 104 * useful to assist debuggers stepping over the critical section. 108 105 */ 109 106 #define RSEQ_ASM_DEFINE_EXIT_POINT(start_ip, exit_ip) \
+18 -14
tools/testing/selftests/rseq/rseq-mips.h
··· 54 54 # error unsupported _MIPS_SZLONG 55 55 #endif 56 56 57 - #define __RSEQ_ASM_DEFINE_TABLE(version, flags, start_ip, \ 57 + #define __RSEQ_ASM_DEFINE_TABLE(label, version, flags, start_ip, \ 58 58 post_commit_offset, abort_ip) \ 59 - ".pushsection __rseq_table, \"aw\"\n\t" \ 59 + ".pushsection __rseq_cs, \"aw\"\n\t" \ 60 60 ".balign 32\n\t" \ 61 + __rseq_str(label) ":\n\t" \ 61 62 ".word " __rseq_str(version) ", " __rseq_str(flags) "\n\t" \ 62 63 LONG " " U32_U64_PAD(__rseq_str(start_ip)) "\n\t" \ 63 64 LONG " " U32_U64_PAD(__rseq_str(post_commit_offset)) "\n\t" \ 64 65 LONG " " U32_U64_PAD(__rseq_str(abort_ip)) "\n\t" \ 66 + ".popsection\n\t" \ 67 + ".pushsection __rseq_cs_ptr_array, \"aw\"\n\t" \ 68 + LONG " " U32_U64_PAD(__rseq_str(label) "b") "\n\t" \ 65 69 ".popsection\n\t" 66 70 67 - #define RSEQ_ASM_DEFINE_TABLE(start_ip, post_commit_ip, abort_ip) \ 68 - __RSEQ_ASM_DEFINE_TABLE(0x0, 0x0, start_ip, \ 71 + #define RSEQ_ASM_DEFINE_TABLE(label, start_ip, post_commit_ip, abort_ip) \ 72 + __RSEQ_ASM_DEFINE_TABLE(label, 0x0, 0x0, start_ip, \ 69 73 (post_commit_ip - start_ip), abort_ip) 70 74 71 75 /* 72 76 * Exit points of a rseq critical section consist of all instructions outside 73 77 * of the critical section where a critical section can either branch to or 74 78 * 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 79 + * post-commit IP are already part of the __rseq_cs section and should not be 80 + * explicitly defined as additional exit points. Knowing all exit points is 77 81 * useful to assist debuggers stepping over the critical section. 78 82 */ 79 83 #define RSEQ_ASM_DEFINE_EXIT_POINT(start_ip, exit_ip) \ ··· 131 127 132 128 rseq_workaround_gcc_asm_size_guess(); 133 129 __asm__ __volatile__ goto ( 134 - RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */ 130 + RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */ 135 131 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail]) 136 132 #ifdef RSEQ_COMPARE_TWICE 137 133 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1]) ··· 196 192 197 193 rseq_workaround_gcc_asm_size_guess(); 198 194 __asm__ __volatile__ goto ( 199 - RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */ 195 + RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */ 200 196 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail]) 201 197 #ifdef RSEQ_COMPARE_TWICE 202 198 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1]) ··· 265 261 266 262 rseq_workaround_gcc_asm_size_guess(); 267 263 __asm__ __volatile__ goto ( 268 - RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */ 264 + RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */ 269 265 #ifdef RSEQ_COMPARE_TWICE 270 266 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1]) 271 267 #endif ··· 320 316 321 317 rseq_workaround_gcc_asm_size_guess(); 322 318 __asm__ __volatile__ goto ( 323 - RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */ 319 + RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */ 324 320 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail]) 325 321 #ifdef RSEQ_COMPARE_TWICE 326 322 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1]) ··· 393 389 394 390 rseq_workaround_gcc_asm_size_guess(); 395 391 __asm__ __volatile__ goto ( 396 - RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */ 392 + RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */ 397 393 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail]) 398 394 #ifdef RSEQ_COMPARE_TWICE 399 395 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1]) ··· 467 463 468 464 rseq_workaround_gcc_asm_size_guess(); 469 465 __asm__ __volatile__ goto ( 470 - RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */ 466 + RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */ 471 467 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail]) 472 468 #ifdef RSEQ_COMPARE_TWICE 473 469 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1]) ··· 547 543 548 544 rseq_workaround_gcc_asm_size_guess(); 549 545 __asm__ __volatile__ goto ( 550 - RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */ 546 + RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */ 551 547 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail]) 552 548 #ifdef RSEQ_COMPARE_TWICE 553 549 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1]) ··· 668 664 669 665 rseq_workaround_gcc_asm_size_guess(); 670 666 __asm__ __volatile__ goto ( 671 - RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */ 667 + RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */ 672 668 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail]) 673 669 #ifdef RSEQ_COMPARE_TWICE 674 670 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
+14 -8
tools/testing/selftests/rseq/rseq-ppc.h
··· 33 33 #else /* !RSEQ_SKIP_FASTPATH */ 34 34 35 35 /* 36 - * The __rseq_table section can be used by debuggers to better handle 37 - * single-stepping through the restartable critical sections. 36 + * The __rseq_cs_ptr_array and __rseq_cs sections can be used by debuggers to 37 + * better handle single-stepping through the restartable critical sections. 38 38 */ 39 39 40 40 #ifdef __PPC64__ ··· 46 46 47 47 #define __RSEQ_ASM_DEFINE_TABLE(label, version, flags, \ 48 48 start_ip, post_commit_offset, abort_ip) \ 49 - ".pushsection __rseq_table, \"aw\"\n\t" \ 49 + ".pushsection __rseq_cs, \"aw\"\n\t" \ 50 50 ".balign 32\n\t" \ 51 51 __rseq_str(label) ":\n\t" \ 52 52 ".long " __rseq_str(version) ", " __rseq_str(flags) "\n\t" \ 53 53 ".quad " __rseq_str(start_ip) ", " __rseq_str(post_commit_offset) ", " __rseq_str(abort_ip) "\n\t" \ 54 + ".popsection\n\t" \ 55 + ".pushsection __rseq_cs_ptr_array, \"aw\"\n\t" \ 56 + ".quad " __rseq_str(label) "b\n\t" \ 54 57 ".popsection\n\t" 55 58 56 59 #define RSEQ_ASM_STORE_RSEQ_CS(label, cs_label, rseq_cs) \ ··· 70 67 * Exit points of a rseq critical section consist of all instructions outside 71 68 * of the critical section where a critical section can either branch to or 72 69 * reach through the normal course of its execution. The abort IP and the 73 - * post-commit IP are already part of the __rseq_table section and should not 74 - * be explicitly defined as additional exit points. Knowing all exit points is 70 + * post-commit IP are already part of the __rseq_cs section and should not be 71 + * explicitly defined as additional exit points. Knowing all exit points is 75 72 * useful to assist debuggers stepping over the critical section. 76 73 */ 77 74 #define RSEQ_ASM_DEFINE_EXIT_POINT(start_ip, exit_ip) \ ··· 88 85 89 86 #define __RSEQ_ASM_DEFINE_TABLE(label, version, flags, \ 90 87 start_ip, post_commit_offset, abort_ip) \ 91 - ".pushsection __rseq_table, \"aw\"\n\t" \ 88 + ".pushsection __rseq_cs, \"aw\"\n\t" \ 92 89 ".balign 32\n\t" \ 93 90 __rseq_str(label) ":\n\t" \ 94 91 ".long " __rseq_str(version) ", " __rseq_str(flags) "\n\t" \ 95 92 /* 32-bit only supported on BE */ \ 96 93 ".long 0x0, " __rseq_str(start_ip) ", 0x0, " __rseq_str(post_commit_offset) ", 0x0, " __rseq_str(abort_ip) "\n\t" \ 94 + ".popsection\n\t" \ 95 + ".pushsection __rseq_cs_ptr_array, \"aw\"\n\t" \ 96 + ".long 0x0, " __rseq_str(label) "b\n\t" \ 97 97 ".popsection\n\t" 98 98 99 99 /* 100 100 * Exit points of a rseq critical section consist of all instructions outside 101 101 * of the critical section where a critical section can either branch to or 102 102 * reach through the normal course of its execution. The abort IP and the 103 - * post-commit IP are already part of the __rseq_table section and should not 104 - * be explicitly defined as additional exit points. Knowing all exit points is 103 + * post-commit IP are already part of the __rseq_cs section and should not be 104 + * explicitly defined as additional exit points. Knowing all exit points is 105 105 * useful to assist debuggers stepping over the critical section. 106 106 */ 107 107 #define RSEQ_ASM_DEFINE_EXIT_POINT(start_ip, exit_ip) \
+12 -6
tools/testing/selftests/rseq/rseq-s390.h
··· 37 37 38 38 #define __RSEQ_ASM_DEFINE_TABLE(label, version, flags, \ 39 39 start_ip, post_commit_offset, abort_ip) \ 40 - ".pushsection __rseq_table, \"aw\"\n\t" \ 40 + ".pushsection __rseq_cs, \"aw\"\n\t" \ 41 41 ".balign 32\n\t" \ 42 42 __rseq_str(label) ":\n\t" \ 43 43 ".long " __rseq_str(version) ", " __rseq_str(flags) "\n\t" \ 44 44 ".quad " __rseq_str(start_ip) ", " __rseq_str(post_commit_offset) ", " __rseq_str(abort_ip) "\n\t" \ 45 + ".popsection\n\t" \ 46 + ".pushsection __rseq_cs_ptr_array, \"aw\"\n\t" \ 47 + ".quad " __rseq_str(label) "b\n\t" \ 45 48 ".popsection\n\t" 46 49 47 50 /* 48 51 * Exit points of a rseq critical section consist of all instructions outside 49 52 * of the critical section where a critical section can either branch to or 50 53 * reach through the normal course of its execution. The abort IP and the 51 - * post-commit IP are already part of the __rseq_table section and should not 52 - * be explicitly defined as additional exit points. Knowing all exit points is 54 + * post-commit IP are already part of the __rseq_cs section and should not be 55 + * explicitly defined as additional exit points. Knowing all exit points is 53 56 * useful to assist debuggers stepping over the critical section. 54 57 */ 55 58 #define RSEQ_ASM_DEFINE_EXIT_POINT(start_ip, exit_ip) \ ··· 64 61 65 62 #define __RSEQ_ASM_DEFINE_TABLE(label, version, flags, \ 66 63 start_ip, post_commit_offset, abort_ip) \ 67 - ".pushsection __rseq_table, \"aw\"\n\t" \ 64 + ".pushsection __rseq_cs, \"aw\"\n\t" \ 68 65 ".balign 32\n\t" \ 69 66 __rseq_str(label) ":\n\t" \ 70 67 ".long " __rseq_str(version) ", " __rseq_str(flags) "\n\t" \ 71 68 ".long 0x0, " __rseq_str(start_ip) ", 0x0, " __rseq_str(post_commit_offset) ", 0x0, " __rseq_str(abort_ip) "\n\t" \ 69 + ".popsection\n\t" \ 70 + ".pushsection __rseq_cs_ptr_array, \"aw\"\n\t" \ 71 + ".long 0x0, " __rseq_str(label) "b\n\t" \ 72 72 ".popsection\n\t" 73 73 74 74 /* 75 75 * Exit points of a rseq critical section consist of all instructions outside 76 76 * of the critical section where a critical section can either branch to or 77 77 * reach through the normal course of its execution. The abort IP and the 78 - * post-commit IP are already part of the __rseq_table section and should not 79 - * be explicitly defined as additional exit points. Knowing all exit points is 78 + * post-commit IP are already part of the __rseq_cs section and should not be 79 + * explicitly defined as additional exit points. Knowing all exit points is 80 80 * useful to assist debuggers stepping over the critical section. 81 81 */ 82 82 #define RSEQ_ASM_DEFINE_EXIT_POINT(start_ip, exit_ip) \
+13 -6
tools/testing/selftests/rseq/rseq-x86.h
··· 47 47 48 48 #define __RSEQ_ASM_DEFINE_TABLE(label, version, flags, \ 49 49 start_ip, post_commit_offset, abort_ip) \ 50 - ".pushsection __rseq_table, \"aw\"\n\t" \ 50 + ".pushsection __rseq_cs, \"aw\"\n\t" \ 51 51 ".balign 32\n\t" \ 52 52 __rseq_str(label) ":\n\t" \ 53 53 ".long " __rseq_str(version) ", " __rseq_str(flags) "\n\t" \ 54 54 ".quad " __rseq_str(start_ip) ", " __rseq_str(post_commit_offset) ", " __rseq_str(abort_ip) "\n\t" \ 55 + ".popsection\n\t" \ 56 + ".pushsection __rseq_cs_ptr_array, \"aw\"\n\t" \ 57 + ".quad " __rseq_str(label) "b\n\t" \ 55 58 ".popsection\n\t" 59 + 56 60 57 61 #define RSEQ_ASM_DEFINE_TABLE(label, start_ip, post_commit_ip, abort_ip) \ 58 62 __RSEQ_ASM_DEFINE_TABLE(label, 0x0, 0x0, start_ip, \ ··· 66 62 * Exit points of a rseq critical section consist of all instructions outside 67 63 * of the critical section where a critical section can either branch to or 68 64 * reach through the normal course of its execution. The abort IP and the 69 - * post-commit IP are already part of the __rseq_table section and should not 70 - * be explicitly defined as additional exit points. Knowing all exit points is 65 + * post-commit IP are already part of the __rseq_cs section and should not be 66 + * explicitly defined as additional exit points. Knowing all exit points is 71 67 * useful to assist debuggers stepping over the critical section. 72 68 */ 73 69 #define RSEQ_ASM_DEFINE_EXIT_POINT(start_ip, exit_ip) \ ··· 570 566 */ 571 567 #define __RSEQ_ASM_DEFINE_TABLE(label, version, flags, \ 572 568 start_ip, post_commit_offset, abort_ip) \ 573 - ".pushsection __rseq_table, \"aw\"\n\t" \ 569 + ".pushsection __rseq_cs, \"aw\"\n\t" \ 574 570 ".balign 32\n\t" \ 575 571 __rseq_str(label) ":\n\t" \ 576 572 ".long " __rseq_str(version) ", " __rseq_str(flags) "\n\t" \ 577 573 ".long " __rseq_str(start_ip) ", 0x0, " __rseq_str(post_commit_offset) ", 0x0, " __rseq_str(abort_ip) ", 0x0\n\t" \ 574 + ".popsection\n\t" \ 575 + ".pushsection __rseq_cs_ptr_array, \"aw\"\n\t" \ 576 + ".long " __rseq_str(label) "b, 0x0\n\t" \ 578 577 ".popsection\n\t" 579 578 580 579 #define RSEQ_ASM_DEFINE_TABLE(label, start_ip, post_commit_ip, abort_ip) \ ··· 588 581 * Exit points of a rseq critical section consist of all instructions outside 589 582 * of the critical section where a critical section can either branch to or 590 583 * reach through the normal course of its execution. The abort IP and the 591 - * post-commit IP are already part of the __rseq_table section and should not 592 - * be explicitly defined as additional exit points. Knowing all exit points is 584 + * post-commit IP are already part of the __rseq_cs section and should not be 585 + * explicitly defined as additional exit points. Knowing all exit points is 593 586 * useful to assist debuggers stepping over the critical section. 594 587 */ 595 588 #define RSEQ_ASM_DEFINE_EXIT_POINT(start_ip, exit_ip) \