Lines Matching refs:data
84 static int get_child_rdvl(struct vec_data *data) in get_child_rdvl() argument
122 ret = execl(data->rdvl_binary, data->rdvl_binary, NULL); in get_child_rdvl()
124 data->rdvl_binary, errno, strerror(errno)); in get_child_rdvl()
213 static void proc_read_default(struct vec_data *data) in proc_read_default() argument
217 ret = file_read_integer(data->default_vl_file, &default_vl); in proc_read_default()
222 child_vl = get_child_rdvl(data); in proc_read_default()
225 data->default_vl_file, in proc_read_default()
230 ksft_test_result_pass("%s default vector length %d\n", data->name, in proc_read_default()
232 data->default_vl = default_vl; in proc_read_default()
236 static void proc_write_min(struct vec_data *data) in proc_write_min() argument
245 ret = file_write_integer(data->default_vl_file, ARCH_MIN_VL); in proc_write_min()
250 ret = file_read_integer(data->default_vl_file, &new_default); in proc_write_min()
255 child_vl = get_child_rdvl(data); in proc_write_min()
258 data->default_vl_file, in proc_write_min()
263 ksft_test_result_pass("%s minimum vector length %d\n", data->name, in proc_write_min()
265 data->min_vl = new_default; in proc_write_min()
267 file_write_integer(data->default_vl_file, data->default_vl); in proc_write_min()
271 static void proc_write_max(struct vec_data *data) in proc_write_max() argument
281 ret = file_write_integer(data->default_vl_file, -1); in proc_write_max()
286 ret = file_read_integer(data->default_vl_file, &new_default); in proc_write_max()
291 child_vl = get_child_rdvl(data); in proc_write_max()
294 data->default_vl_file, in proc_write_max()
299 ksft_test_result_pass("%s maximum vector length %d\n", data->name, in proc_write_max()
301 data->max_vl = new_default; in proc_write_max()
303 file_write_integer(data->default_vl_file, data->default_vl); in proc_write_max()
307 static void prctl_get(struct vec_data *data) in prctl_get() argument
311 ret = prctl(data->prctl_get); in prctl_get()
314 data->name, errno, strerror(errno)); in prctl_get()
322 if (ret == data->rdvl()) in prctl_get()
324 data->name, ret); in prctl_get()
327 data->name, ret, data->rdvl()); in prctl_get()
331 static void prctl_set_same(struct vec_data *data) in prctl_set_same() argument
333 int cur_vl = data->rdvl(); in prctl_set_same()
336 ret = prctl(data->prctl_set, cur_vl); in prctl_set_same()
339 data->name, errno, strerror(errno)); in prctl_set_same()
343 ksft_test_result(cur_vl == data->rdvl(), in prctl_set_same()
345 data->name, cur_vl, data->rdvl()); in prctl_set_same()
349 static void prctl_set(struct vec_data *data) in prctl_set() argument
353 if (data->min_vl == data->max_vl) { in prctl_set()
355 data->name); in prctl_set()
360 ret = prctl(data->prctl_set, data->min_vl); in prctl_set()
363 data->name, data->min_vl, in prctl_set()
368 if ((ret & PR_SVE_VL_LEN_MASK) != data->min_vl) { in prctl_set()
370 data->name, data->min_vl, data->rdvl()); in prctl_set()
374 if (data->rdvl() != data->min_vl) { in prctl_set()
376 data->name, data->min_vl, data->rdvl()); in prctl_set()
381 ret = prctl(data->prctl_set, data->max_vl); in prctl_set()
384 data->name, data->max_vl, in prctl_set()
389 if ((ret & PR_SVE_VL_LEN_MASK) != data->max_vl) { in prctl_set()
391 data->name, data->max_vl, data->rdvl()); in prctl_set()
396 ret = prctl(data->prctl_get); in prctl_set()
399 data->name, errno, strerror(errno)); in prctl_set()
405 data->name); in prctl_set()
409 ksft_test_result_pass("%s prctl() set min/max\n", data->name); in prctl_set()
413 static void prctl_set_no_child(struct vec_data *data) in prctl_set_no_child() argument
417 if (data->min_vl == data->max_vl) { in prctl_set_no_child()
419 data->name); in prctl_set_no_child()
423 ret = prctl(data->prctl_set, data->min_vl); in prctl_set_no_child()
426 data->name, data->min_vl, in prctl_set_no_child()
432 ret = file_write_integer(data->default_vl_file, data->max_vl); in prctl_set_no_child()
437 child_vl = get_child_rdvl(data); in prctl_set_no_child()
438 if (child_vl != data->max_vl) { in prctl_set_no_child()
440 data->default_vl_file, in prctl_set_no_child()
441 data->max_vl, child_vl); in prctl_set_no_child()
445 ksft_test_result_pass("%s vector length used default\n", data->name); in prctl_set_no_child()
447 file_write_integer(data->default_vl_file, data->default_vl); in prctl_set_no_child()
451 static void prctl_set_for_child(struct vec_data *data) in prctl_set_for_child() argument
455 if (data->min_vl == data->max_vl) { in prctl_set_for_child()
457 data->name); in prctl_set_for_child()
461 ret = prctl(data->prctl_set, data->min_vl | PR_SVE_VL_INHERIT); in prctl_set_for_child()
464 data->name, data->min_vl, in prctl_set_for_child()
470 ret = prctl(data->prctl_get); in prctl_set_for_child()
473 data->name, errno, strerror(errno)); in prctl_set_for_child()
478 data->name); in prctl_set_for_child()
483 ret = file_write_integer(data->default_vl_file, data->max_vl); in prctl_set_for_child()
488 child_vl = get_child_rdvl(data); in prctl_set_for_child()
489 if (child_vl != data->min_vl) { in prctl_set_for_child()
491 data->default_vl_file, in prctl_set_for_child()
492 data->min_vl, child_vl); in prctl_set_for_child()
496 ksft_test_result_pass("%s vector length was inherited\n", data->name); in prctl_set_for_child()
498 file_write_integer(data->default_vl_file, data->default_vl); in prctl_set_for_child()
502 static void prctl_set_onexec(struct vec_data *data) in prctl_set_onexec() argument
506 if (data->min_vl == data->max_vl) { in prctl_set_onexec()
508 data->name); in prctl_set_onexec()
513 ret = file_write_integer(data->default_vl_file, data->max_vl); in prctl_set_onexec()
517 ret = prctl(data->prctl_set, data->max_vl); in prctl_set_onexec()
520 data->name, data->min_vl, in prctl_set_onexec()
526 ret = prctl(data->prctl_set, data->min_vl | PR_SVE_SET_VL_ONEXEC); in prctl_set_onexec()
529 data->name, data->min_vl, in prctl_set_onexec()
535 if (data->rdvl() != data->max_vl) { in prctl_set_onexec()
537 data->name); in prctl_set_onexec()
542 child_vl = get_child_rdvl(data); in prctl_set_onexec()
543 if (child_vl != data->min_vl) { in prctl_set_onexec()
545 data->min_vl, child_vl); in prctl_set_onexec()
549 ksft_test_result_pass("%s vector length set on exec\n", data->name); in prctl_set_onexec()
551 file_write_integer(data->default_vl_file, data->default_vl); in prctl_set_onexec()
555 static void prctl_set_all_vqs(struct vec_data *data) in prctl_set_all_vqs() argument
561 if (!data->min_vl || !data->max_vl) { in prctl_set_all_vqs()
563 data->name); in prctl_set_all_vqs()
574 ret = prctl(data->prctl_set, vl); in prctl_set_all_vqs()
578 data->name, vl, in prctl_set_all_vqs()
586 if (data->rdvl() != new_vl) { in prctl_set_all_vqs()
588 data->name, new_vl, data->rdvl()); in prctl_set_all_vqs()
594 if (&vec_data[i] == data) in prctl_set_all_vqs()
613 if (vl < data->min_vl) { in prctl_set_all_vqs()
614 if (new_vl != data->min_vl) { in prctl_set_all_vqs()
616 data->name, vl, new_vl, in prctl_set_all_vqs()
617 data->min_vl); in prctl_set_all_vqs()
625 if (vl > data->max_vl) { in prctl_set_all_vqs()
626 if (new_vl != data->max_vl) { in prctl_set_all_vqs()
628 data->name, vl, new_vl, in prctl_set_all_vqs()
629 data->max_vl); in prctl_set_all_vqs()
639 data->name, vl, new_vl); in prctl_set_all_vqs()
647 data->name, errors); in prctl_set_all_vqs()
765 struct vec_data *data = &vec_data[i]; in main() local
768 supported = getauxval(data->hwcap_type) & data->hwcap; in main()
774 tests[j](data); in main()
777 data->name); in main()