■ ■ ■ ■ ■ ■
test/zdtm/transition/rseq01.c
skipped 118 lines 119 119 120 120 #define rseq_after_asm_goto() asm volatile("" : : : "memory") 121 121 122 - static int rseq_addv(intptr_t *v, intptr_t count, int cpu) 122 + static int rseq_addv(intptr_t *v, intptr_t count, int cpu, bool ignore_abort ) 123 123 { 124 124 double a = 10000000000000000.0; 125 125 double b = -1; skipped 67 lines 193 193 abort: 194 194 rseq_after_asm_goto(); 195 195 test_msg("abort %lx %lx %f %f\n", rseq_cs1, rseq_cs2, a, b); 196 + if (ignore_abort) 197 + return 0; 196 198 return -1; 197 199 } 198 200 skipped 3 lines 202 204 int ret; 203 205 intptr_t *cpu_data; 204 206 long nr_cpus; 207 + bool ignore_abort = true; 205 208 206 209 rseq_ptr = &__rseq_abi; 207 210 memset((void *)rseq_ptr, 0, sizeof(struct rseq)); skipped 17 lines 225 228 * https://github.com/torvalds/linux/blob/ce522ba9/kernel/rseq.c#L192 226 229 */ 227 230 #ifdef NORESTART 231 + ignore_abort = false; 228 232 rseq_ptr->flags = RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT | RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL | 229 233 RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE; 230 234 #endif skipped 2 lines 233 237 234 238 while (test_go()) { 235 239 cpu = RSEQ_ACCESS_ONCE(rseq_ptr->cpu_id_start); 236 - ret = rseq_addv(&cpu_data[cpu], 2, cpu); 237 - 238 - /* NORESTART is NOT set */ 239 - #ifndef NORESTART 240 - /* just ignore abort */ 241 - ret = 0; 242 - #endif 240 + ret = rseq_addv(&cpu_data[cpu], 2, cpu, ignore_abort ); 243 241 244 242 if (ret) 245 243 break; skipped 28 lines