Lines Matching refs:data

69 static bool vec_type_supported(struct vec_data *data)  in vec_type_supported()  argument
71 return getauxval(data->hwcap_type) & data->hwcap; in vec_type_supported()
89 static int get_child_rdvl(struct vec_data *data) in get_child_rdvl() argument
127 ret = execl(data->rdvl_binary, data->rdvl_binary, NULL); in get_child_rdvl()
129 data->rdvl_binary, errno, strerror(errno)); in get_child_rdvl()
218 static void proc_read_default(struct vec_data *data) in proc_read_default() argument
222 ret = file_read_integer(data->default_vl_file, &default_vl); in proc_read_default()
227 child_vl = get_child_rdvl(data); in proc_read_default()
230 data->default_vl_file, in proc_read_default()
235 ksft_test_result_pass("%s default vector length %d\n", data->name, in proc_read_default()
237 data->default_vl = default_vl; in proc_read_default()
241 static void proc_write_min(struct vec_data *data) in proc_write_min() argument
250 ret = file_write_integer(data->default_vl_file, ARCH_MIN_VL); in proc_write_min()
255 ret = file_read_integer(data->default_vl_file, &new_default); in proc_write_min()
260 child_vl = get_child_rdvl(data); in proc_write_min()
263 data->default_vl_file, in proc_write_min()
268 ksft_test_result_pass("%s minimum vector length %d\n", data->name, in proc_write_min()
270 data->min_vl = new_default; in proc_write_min()
272 file_write_integer(data->default_vl_file, data->default_vl); in proc_write_min()
276 static void proc_write_max(struct vec_data *data) in proc_write_max() argument
286 ret = file_write_integer(data->default_vl_file, -1); in proc_write_max()
291 ret = file_read_integer(data->default_vl_file, &new_default); in proc_write_max()
296 child_vl = get_child_rdvl(data); in proc_write_max()
299 data->default_vl_file, in proc_write_max()
304 ksft_test_result_pass("%s maximum vector length %d\n", data->name, in proc_write_max()
306 data->max_vl = new_default; in proc_write_max()
308 file_write_integer(data->default_vl_file, data->default_vl); in proc_write_max()
312 static void prctl_get(struct vec_data *data) in prctl_get() argument
316 ret = prctl(data->prctl_get); in prctl_get()
319 data->name, errno, strerror(errno)); in prctl_get()
327 if (ret == data->rdvl()) in prctl_get()
329 data->name, ret); in prctl_get()
332 data->name, ret, data->rdvl()); in prctl_get()
336 static void prctl_set_same(struct vec_data *data) in prctl_set_same() argument
338 int cur_vl = data->rdvl(); in prctl_set_same()
341 ret = prctl(data->prctl_set, cur_vl); in prctl_set_same()
344 data->name, errno, strerror(errno)); in prctl_set_same()
348 ksft_test_result(cur_vl == data->rdvl(), in prctl_set_same()
350 data->name, cur_vl, data->rdvl()); in prctl_set_same()
354 static void prctl_set(struct vec_data *data) in prctl_set() argument
358 if (data->min_vl == data->max_vl) { in prctl_set()
360 data->name); in prctl_set()
365 ret = prctl(data->prctl_set, data->min_vl); in prctl_set()
368 data->name, data->min_vl, in prctl_set()
373 if ((ret & PR_SVE_VL_LEN_MASK) != data->min_vl) { in prctl_set()
375 data->name, data->min_vl, data->rdvl()); in prctl_set()
379 if (data->rdvl() != data->min_vl) { in prctl_set()
381 data->name, data->min_vl, data->rdvl()); in prctl_set()
386 ret = prctl(data->prctl_set, data->max_vl); in prctl_set()
389 data->name, data->max_vl, in prctl_set()
394 if ((ret & PR_SVE_VL_LEN_MASK) != data->max_vl) { in prctl_set()
396 data->name, data->max_vl, data->rdvl()); in prctl_set()
401 ret = prctl(data->prctl_get); in prctl_set()
404 data->name, errno, strerror(errno)); in prctl_set()
410 data->name); in prctl_set()
414 ksft_test_result_pass("%s prctl() set min/max\n", data->name); in prctl_set()
418 static void prctl_set_no_child(struct vec_data *data) in prctl_set_no_child() argument
422 if (data->min_vl == data->max_vl) { in prctl_set_no_child()
424 data->name); in prctl_set_no_child()
428 ret = prctl(data->prctl_set, data->min_vl); in prctl_set_no_child()
431 data->name, data->min_vl, in prctl_set_no_child()
437 ret = file_write_integer(data->default_vl_file, data->max_vl); in prctl_set_no_child()
442 child_vl = get_child_rdvl(data); in prctl_set_no_child()
443 if (child_vl != data->max_vl) { in prctl_set_no_child()
445 data->default_vl_file, in prctl_set_no_child()
446 data->max_vl, child_vl); in prctl_set_no_child()
450 ksft_test_result_pass("%s vector length used default\n", data->name); in prctl_set_no_child()
452 file_write_integer(data->default_vl_file, data->default_vl); in prctl_set_no_child()
456 static void prctl_set_for_child(struct vec_data *data) in prctl_set_for_child() argument
460 if (data->min_vl == data->max_vl) { in prctl_set_for_child()
462 data->name); in prctl_set_for_child()
466 ret = prctl(data->prctl_set, data->min_vl | PR_SVE_VL_INHERIT); in prctl_set_for_child()
469 data->name, data->min_vl, in prctl_set_for_child()
475 ret = prctl(data->prctl_get); in prctl_set_for_child()
478 data->name, errno, strerror(errno)); in prctl_set_for_child()
483 data->name); in prctl_set_for_child()
488 ret = file_write_integer(data->default_vl_file, data->max_vl); in prctl_set_for_child()
493 child_vl = get_child_rdvl(data); in prctl_set_for_child()
494 if (child_vl != data->min_vl) { in prctl_set_for_child()
496 data->default_vl_file, in prctl_set_for_child()
497 data->min_vl, child_vl); in prctl_set_for_child()
501 ksft_test_result_pass("%s vector length was inherited\n", data->name); in prctl_set_for_child()
503 file_write_integer(data->default_vl_file, data->default_vl); in prctl_set_for_child()
507 static void prctl_set_onexec(struct vec_data *data) in prctl_set_onexec() argument
511 if (data->min_vl == data->max_vl) { in prctl_set_onexec()
513 data->name); in prctl_set_onexec()
518 ret = file_write_integer(data->default_vl_file, data->max_vl); in prctl_set_onexec()
522 ret = prctl(data->prctl_set, data->max_vl); in prctl_set_onexec()
525 data->name, data->min_vl, in prctl_set_onexec()
531 ret = prctl(data->prctl_set, data->min_vl | PR_SVE_SET_VL_ONEXEC); in prctl_set_onexec()
534 data->name, data->min_vl, in prctl_set_onexec()
540 if (data->rdvl() != data->max_vl) { in prctl_set_onexec()
542 data->name); in prctl_set_onexec()
547 child_vl = get_child_rdvl(data); in prctl_set_onexec()
548 if (child_vl != data->min_vl) { in prctl_set_onexec()
550 data->min_vl, child_vl); in prctl_set_onexec()
554 ksft_test_result_pass("%s vector length set on exec\n", data->name); in prctl_set_onexec()
556 file_write_integer(data->default_vl_file, data->default_vl); in prctl_set_onexec()
560 static void prctl_set_all_vqs(struct vec_data *data) in prctl_set_all_vqs() argument
566 if (!data->min_vl || !data->max_vl) { in prctl_set_all_vqs()
568 data->name); in prctl_set_all_vqs()
582 ret = prctl(data->prctl_set, vl); in prctl_set_all_vqs()
586 data->name, vl, in prctl_set_all_vqs()
594 if (data->rdvl() != new_vl) { in prctl_set_all_vqs()
596 data->name, new_vl, data->rdvl()); in prctl_set_all_vqs()
602 if (&vec_data[i] == data) in prctl_set_all_vqs()
621 if (vl < data->min_vl) { in prctl_set_all_vqs()
622 if (new_vl != data->min_vl) { in prctl_set_all_vqs()
624 data->name, vl, new_vl, in prctl_set_all_vqs()
625 data->min_vl); in prctl_set_all_vqs()
633 if (vl > data->max_vl) { in prctl_set_all_vqs()
634 if (new_vl != data->max_vl) { in prctl_set_all_vqs()
636 data->name, vl, new_vl, in prctl_set_all_vqs()
637 data->max_vl); in prctl_set_all_vqs()
647 data->name, vl, new_vl); in prctl_set_all_vqs()
655 data->name, errors); in prctl_set_all_vqs()
773 struct vec_data *data = &vec_data[i]; in main() local
776 supported = vec_type_supported(data); in main()
782 tests[j](data); in main()
785 data->name); in main()