[arm-platforms:kvm-arm64/gicv5-full 78/82] arch/arm64/kvm/vgic/vgic-v5-tables.c:1186:44: warning: variable 'host_l2sz' set but not used

kernel test robot lkp at intel.com
Mon Dec 22 10:29:18 PST 2025


tree:   https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git kvm-arm64/gicv5-full
head:   1426b88096b597395df4c82f089b87c62bab45da
commit: ba5d2e0b287e57a009751d6a993a4b31206fd97b [78/82] KVM: arm64: gic-v5: Implement Save/Restore for ISTs
config: arm64-randconfig-003-20251222 (https://download.01.org/0day-ci/archive/20251223/202512230249.PtF5RcJh-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 11.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251223/202512230249.PtF5RcJh-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 at intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512230249.PtF5RcJh-lkp@intel.com/

All warnings (new ones prefixed by >>):

   arch/arm64/kvm/vgic/vgic-v5-tables.c: In function 'vgic_v5_save_spi_ist':
>> arch/arm64/kvm/vgic/vgic-v5-tables.c:1186:44: warning: variable 'host_l2sz' set but not used [-Wunused-but-set-variable]
    1186 |         unsigned host_id_bits, host_istsz, host_l2sz;
         |                                            ^~~~~~~~~
   arch/arm64/kvm/vgic/vgic-v5-tables.c: In function 'vgic_v5_restore_spi_ist':
   arch/arm64/kvm/vgic/vgic-v5-tables.c:1380:44: warning: variable 'host_l2sz' set but not used [-Wunused-but-set-variable]
    1380 |         unsigned host_id_bits, host_istsz, host_l2sz;
         |                                            ^~~~~~~~~


vim +/host_l2sz +1186 arch/arm64/kvm/vgic/vgic-v5-tables.c

  1179	
  1180	int vgic_v5_save_spi_ist(struct kvm *kvm, struct kvm_device_attr *attr)
  1181	{
  1182		u16 vm_id = vgic_v5_vm_id(kvm);
  1183		u32 __user *uaddr = (u32 __user *)(unsigned long)attr->addr;
  1184		int ret = 0;
  1185		__le32 h_iste;
> 1186		unsigned host_id_bits, host_istsz, host_l2sz;
  1187		volatile void *host_ist_base;
  1188		struct vmtl2_entry *vmte;
  1189		gicv5_vm_info *vmi;
  1190	
  1191		ret = vgic_v5_check_vm_id(vm_id);
  1192		if (ret)
  1193			return ret;
  1194	
  1195		vmi = xa_load(&vm_info, vm_id);
  1196		if (WARN_ON_ONCE(!vmi))
  1197			return -EINVAL;
  1198	
  1199		ret = vgic_v5_get_l2_vmte(vm_id, &vmte);
  1200		if (ret)
  1201			return ret;
  1202	
  1203		host_ist_base = vmi->h_spi_ist;
  1204		if (!host_ist_base && attr)
  1205			return -ENOENT;
  1206		else if (host_ist_base && !attr)
  1207			return -EINVAL;
  1208	
  1209		host_id_bits = FIELD_GET(GICV5_VMTEL2E_IST_ID_BITS, vmte->val[3]);
  1210		host_istsz = FIELD_GET(GICV5_VMTEL2E_IST_ISTSZ, vmte->val[3]);
  1211		host_l2sz = FIELD_GET(GICV5_VMTEL2E_IST_L2SZ, vmte->val[3]);
  1212	
  1213		for (int i = 0; i < BIT(host_id_bits); ++i) {
  1214			volatile void *h_iste_addr = host_ist_base + i * BIT(host_istsz + 2);
  1215			h_iste = *((__le32*)h_iste_addr);
  1216	
  1217			ret = put_user(h_iste, uaddr);
  1218			if (ret)
  1219				return ret;
  1220	
  1221			uaddr++;
  1222		}
  1223	
  1224		return ret;
  1225	}
  1226	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki



More information about the linux-arm-kernel mailing list