[broonie-ci:kvm-arm64-sme 23/30] arch/arm64/kvm/hyp/include/hyp/switch.h:518:7: warning: unused variable 'max_len'

kernel test robot <[email protected]>
Newsgroups dev.linux.lists.llvm,dev.linux.lists.oe-kbuild-all
Message-ID <[email protected]>
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/ci.git kvm-arm64-sme
head:   b53a1666379c25919672622adc3e3984693ef9a1
commit: 68a05d441f4a2bbe2e9d717764fb171c99f9ec30 [23/30] KVM: arm64: Context switch SME state for guests
config: arm64-randconfig-001-20260708 (https://download.01.org/0day-ci/archive/20260711/[email protected]/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 0a2fb2a2269da0e2a3e230beb6cad39ca314db33)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260711/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

   In file included from arch/arm64/kvm/hyp/vhe/switch.c:7:
   arch/arm64/kvm/hyp/include/hyp/switch.h:489:6: warning: unused variable 'zcr_el2' [-Wunused-variable]
     489 |         u64 zcr_el2 = vcpu_sve_max_vq(vcpu) - 1;
         |             ^~~~~~~
>> arch/arm64/kvm/hyp/include/hyp/switch.h:518:7: warning: unused variable 'max_len' [-Wunused-variable]
     518 |                 u64 max_len = vcpu_sme_max_vq(vcpu) - 1;
         |                     ^~~~~~~
>> arch/arm64/kvm/hyp/include/hyp/switch.h:519:7: warning: unused variable 'smcr_len' [-Wunused-variable]
     519 |                 u64 smcr_len = SYS_FIELD_GET(SMCR_ELx, LEN,
         |                     ^~~~~~~~
   3 warnings generated.


vim +/max_len +518 arch/arm64/kvm/hyp/include/hyp/switch.h

   498	
   499	static inline void __hyp_nv_restore_guest_vls(struct kvm_vcpu *vcpu)
   500	{
   501		if (!is_nested_ctxt(vcpu))
   502			return;
   503	
   504		/*
   505		 * The effective VL for a VM could differ from the max VL when running a
   506		 * nested guest, as the guest hypervisor could select a smaller VL. Slap
   507		 * that into hardware before wrapping up.
   508		 */
   509	
   510		if (vcpu_has_sve(vcpu)) {
   511			u64 zcr_el2 = vcpu_sve_max_vq(vcpu) - 1;
   512	
   513			zcr_el2 = min(zcr_el2, __vcpu_sys_reg(vcpu, ZCR_EL2));
   514			sve_cond_update_zcr_vq(zcr_el2, SYS_ZCR_EL2);
   515		}
   516	
   517		if (vcpu_has_sme(vcpu)) {
 > 518			u64 max_len = vcpu_sme_max_vq(vcpu) - 1;
 > 519			u64 smcr_len = SYS_FIELD_GET(SMCR_ELx, LEN,
   520						     __vcpu_sys_reg(vcpu, SMCR_EL2));
   521	
   522			sme_cond_update_smcr_vq(min(smcr_len, max_len), SYS_SMCR_EL2);
   523		}
   524	}
   525	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.