Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [mark:arm64/kvm/fpsimd-fixes 11/11] arch/arm64/kvm/fpsimd.c:141:16: warning: variable 'old_vl' set but not used
@ 2025-02-08  1:14 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-02-08  1:14 UTC (permalink / raw)
  To: Mark Rutland; +Cc: llvm, oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git arm64/kvm/fpsimd-fixes
head:   874ec7cd4fdbab02ffc8297b012721f9c74f7954
commit: 874ec7cd4fdbab02ffc8297b012721f9c74f7954 [11/11] HACK: Check the host's VL isn't artifically constrained
config: arm64-randconfig-004-20250208 (https://download.01.org/0day-ci/archive/20250208/202502080941.kKctv9BR-lkp@intel.com/config)
compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250208/202502080941.kKctv9BR-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/202502080941.kKctv9BR-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> arch/arm64/kvm/fpsimd.c:141:16: warning: variable 'old_vl' set but not used [-Wunused-but-set-variable]
                   unsigned int old_vl, new_vl, max_vl;
                                ^
   1 warning generated.


vim +/old_vl +141 arch/arm64/kvm/fpsimd.c

    88	
    89	/*
    90	 * Called just after exiting the guest. If the guest FPSIMD state
    91	 * was loaded, update the host's context tracking data mark the CPU
    92	 * FPSIMD regs as dirty and belonging to vcpu so that they will be
    93	 * written back if the kernel clobbers them due to kernel-mode NEON
    94	 * before re-entry into the guest.
    95	 */
    96	void kvm_arch_vcpu_ctxsync_fp(struct kvm_vcpu *vcpu)
    97	{
    98		struct cpu_fp_state fp_state;
    99	
   100		WARN_ON_ONCE(!irqs_disabled());
   101	
   102		if (guest_owns_fp_regs()) {
   103			if (system_supports_sve()) {
   104				unsigned int active_vl = sve_get_vl();
   105				unsigned int guest_max_vl = vcpu->arch.sve_max_vl;
   106	
   107				WARN_ONCE(active_vl != guest_max_vl,
   108					  "Active VL (%u) is not guest max VL (%u)\n",
   109					  active_vl, guest_max_vl);
   110			}
   111	
   112			/*
   113			 * Currently we do not support SME guests so SVCR is
   114			 * always 0 and we just need a variable to point to.
   115			 */
   116			fp_state.st = &vcpu->arch.ctxt.fp_regs;
   117			fp_state.sve_state = vcpu->arch.sve_state;
   118			fp_state.sve_vl = vcpu->arch.sve_max_vl;
   119			fp_state.sme_state = NULL;
   120			fp_state.svcr = &__vcpu_sys_reg(vcpu, SVCR);
   121			fp_state.fpmr = &__vcpu_sys_reg(vcpu, FPMR);
   122			fp_state.fp_type = &vcpu->arch.fp_type;
   123	
   124			if (vcpu_has_sve(vcpu))
   125				fp_state.to_save = FP_STATE_SVE;
   126			else
   127				fp_state.to_save = FP_STATE_FPSIMD;
   128	
   129			fpsimd_bind_state_to_cpu(&fp_state);
   130	
   131			clear_thread_flag(TIF_FOREIGN_FPSTATE);
   132		}
   133	
   134		/*
   135		 * HACK: test that the hsot can use its maximum VL, regardless of the
   136		 * guest configuration.
   137		 *
   138		 * This relies on NOT being in streaming mode.
   139		 */
   140		if (system_supports_sve()) {
 > 141			unsigned int old_vl, new_vl, max_vl;
   142	
   143			old_vl = sve_get_vl();
   144	
   145			max_vl = sve_max_vl();
   146			sve_cond_update_zcr_vq(sve_vq_from_vl(max_vl) - 1, SYS_ZCR_EL1);
   147			new_vl = sve_get_vl();
   148	
   149			WARN_ONCE(new_vl != max_vl, "Unable to set max VL (%u), got %u\n",
   150				  max_vl, new_vl);
   151	
   152			sve_cond_update_zcr_vq(sve_vq_from_vl(old_vl) - 1, SYS_ZCR_EL1);
   153		}
   154	}
   155	

-- 
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:[~2025-02-08  1:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-08  1:14 [mark:arm64/kvm/fpsimd-fixes 11/11] arch/arm64/kvm/fpsimd.c:141:16: warning: variable 'old_vl' set but not used kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox