* [broonie-ci:arm64-sve-save-support-check 2/2] arch/arm64/kernel/fpsimd.c:454:6: error: implicit declaration of function 'system_support_sve' is invalid in C99
@ 2024-02-27 2:04 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-02-27 2:04 UTC (permalink / raw)
To: Mark Brown; +Cc: llvm, oe-kbuild-all
tree: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/ci.git arm64-sve-save-support-check
head: fff29a9e88fc03d6dd50a8a4b99780d3646a46fa
commit: fff29a9e88fc03d6dd50a8a4b99780d3646a46fa [2/2] arm64/fp: Only check if we need to save SVE registers on systems with SVE
config: arm64-randconfig-001-20240227 (https://download.01.org/0day-ci/archive/20240227/202402270957.KTiImNcE-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project.git f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240227/202402270957.KTiImNcE-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202402270957.KTiImNcE-lkp@intel.com/
All errors (new ones prefixed by >>):
>> arch/arm64/kernel/fpsimd.c:454:6: error: implicit declaration of function 'system_support_sve' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
if (system_support_sve() &&
^
arch/arm64/kernel/fpsimd.c:454:6: note: did you mean 'system_supports_sve'?
arch/arm64/include/asm/cpufeature.h:746:29: note: 'system_supports_sve' declared here
static __always_inline bool system_supports_sve(void)
^
1 error generated.
vim +/system_support_sve +454 arch/arm64/kernel/fpsimd.c
423
424 /*
425 * Ensure FPSIMD/SVE storage in memory for the loaded context is up to
426 * date with respect to the CPU registers. Note carefully that the
427 * current context is the context last bound to the CPU stored in
428 * last, if KVM is involved this may be the guest VM context rather
429 * than the host thread for the VM pointed to by current. This means
430 * that we must always reference the state storage via last rather
431 * than via current, if we are saving KVM state then it will have
432 * ensured that the type of registers to save is set in last->to_save.
433 */
434 static void fpsimd_save_user_state(void)
435 {
436 struct cpu_fp_state const *last =
437 this_cpu_ptr(&fpsimd_last_state);
438 /* set by fpsimd_bind_task_to_cpu() or fpsimd_bind_state_to_cpu() */
439 bool save_sve_regs = false;
440 bool save_ffr;
441 unsigned int vl;
442
443 WARN_ON(!system_supports_fpsimd());
444 WARN_ON(preemptible());
445
446 if (test_thread_flag(TIF_FOREIGN_FPSTATE))
447 return;
448
449 /*
450 * If a task is in a syscall the ABI allows us to only
451 * preserve the state shared with FPSIMD so don't bother
452 * saving the full SVE state in that case.
453 */
> 454 if (system_support_sve() &&
455 ((last->to_save == FP_STATE_CURRENT && test_thread_flag(TIF_SVE) &&
456 !in_syscall(current_pt_regs())) ||
457 last->to_save == FP_STATE_SVE)) {
458 save_sve_regs = true;
459 save_ffr = true;
460 vl = last->sve_vl;
461 }
462
463 if (system_supports_sme()) {
464 u64 *svcr = last->svcr;
465
466 *svcr = read_sysreg_s(SYS_SVCR);
467
468 if (*svcr & SVCR_ZA_MASK)
469 sme_save_state(last->sme_state,
470 system_supports_sme2());
471
472 /* If we are in streaming mode override regular SVE. */
473 if (*svcr & SVCR_SM_MASK) {
474 save_sve_regs = true;
475 save_ffr = system_supports_fa64();
476 vl = last->sme_vl;
477 }
478 }
479
480 if (IS_ENABLED(CONFIG_ARM64_SVE) && save_sve_regs) {
481 /* Get the configured VL from RDVL, will account for SM */
482 if (WARN_ON(sve_get_vl() != vl)) {
483 /*
484 * Can't save the user regs, so current would
485 * re-enter user with corrupt state.
486 * There's no way to recover, so kill it:
487 */
488 force_signal_inject(SIGKILL, SI_KERNEL, 0, 0);
489 return;
490 }
491
492 sve_save_state((char *)last->sve_state +
493 sve_ffr_offset(vl),
494 &last->st->fpsr, save_ffr);
495 *last->fp_type = FP_STATE_SVE;
496 } else {
497 fpsimd_save_state(last->st);
498 *last->fp_type = FP_STATE_FPSIMD;
499 }
500 }
501
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-02-27 2:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-27 2:04 [broonie-ci:arm64-sve-save-support-check 2/2] arch/arm64/kernel/fpsimd.c:454:6: error: implicit declaration of function 'system_support_sve' is invalid in C99 kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.