@@ -439,29 +439,36 @@ static int __init check_unaligned_access_all_cpus(void)
439
439
{
440
440
int cpu ;
441
441
442
- if (unaligned_scalar_speed_param == RISCV_HWPROBE_MISALIGNED_SCALAR_UNKNOWN &&
443
- !check_unaligned_access_emulated_all_cpus ()) {
444
- check_unaligned_access_speed_all_cpus ();
445
- } else {
446
- pr_info ("scalar unaligned access speed set to '%s' by command line\n" ,
447
- speed_str [unaligned_scalar_speed_param ]);
442
+ if (unaligned_scalar_speed_param != RISCV_HWPROBE_MISALIGNED_SCALAR_UNKNOWN ) {
443
+ pr_info ("scalar unaligned access speed set to '%s' (%lu) by command line\n" ,
444
+ speed_str [unaligned_scalar_speed_param ], unaligned_scalar_speed_param );
448
445
for_each_online_cpu (cpu )
449
446
per_cpu (misaligned_access_speed , cpu ) = unaligned_scalar_speed_param ;
447
+ } else if (!check_unaligned_access_emulated_all_cpus ()) {
448
+ check_unaligned_access_speed_all_cpus ();
449
+ }
450
+
451
+ if (unaligned_vector_speed_param != RISCV_HWPROBE_MISALIGNED_VECTOR_UNKNOWN ) {
452
+ if (!has_vector () &&
453
+ unaligned_vector_speed_param != RISCV_HWPROBE_MISALIGNED_VECTOR_UNSUPPORTED ) {
454
+ pr_warn ("vector support is not available, ignoring unaligned_vector_speed=%s\n" ,
455
+ speed_str [unaligned_vector_speed_param ]);
456
+ } else {
457
+ pr_info ("vector unaligned access speed set to '%s' (%lu) by command line\n" ,
458
+ speed_str [unaligned_vector_speed_param ], unaligned_vector_speed_param );
459
+ }
450
460
}
451
461
452
462
if (!has_vector ())
453
463
unaligned_vector_speed_param = RISCV_HWPROBE_MISALIGNED_VECTOR_UNSUPPORTED ;
454
464
455
- if (unaligned_vector_speed_param == RISCV_HWPROBE_MISALIGNED_VECTOR_UNKNOWN &&
456
- !check_vector_unaligned_access_emulated_all_cpus () &&
457
- IS_ENABLED (CONFIG_RISCV_PROBE_VECTOR_UNALIGNED_ACCESS )) {
458
- kthread_run (vec_check_unaligned_access_speed_all_cpus ,
459
- NULL , "vec_check_unaligned_access_speed_all_cpus" );
460
- } else {
461
- pr_info ("vector unaligned access speed set to '%s' by command line\n" ,
462
- speed_str [unaligned_vector_speed_param ]);
465
+ if (unaligned_vector_speed_param != RISCV_HWPROBE_MISALIGNED_VECTOR_UNKNOWN ) {
463
466
for_each_online_cpu (cpu )
464
467
per_cpu (vector_misaligned_access , cpu ) = unaligned_vector_speed_param ;
468
+ } else if (!check_vector_unaligned_access_emulated_all_cpus () &&
469
+ IS_ENABLED (CONFIG_RISCV_PROBE_VECTOR_UNALIGNED_ACCESS )) {
470
+ kthread_run (vec_check_unaligned_access_speed_all_cpus ,
471
+ NULL , "vec_check_unaligned_access_speed_all_cpus" );
465
472
}
466
473
467
474
/*
0 commit comments