[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202308172123.fPQkVpYE-lkp@intel.com>
Date: Thu, 17 Aug 2023 21:17:15 +0800
From: kernel test robot <lkp@...el.com>
To: Jing Zhang <jingzhangos@...gle.com>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
Oliver Upton <oliver.upton@...ux.dev>
Subject: arch/arm64/kvm/sys_regs.c:1239: warning: Function parameter or
member 'vcpu' not described in 'arm64_check_features'
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 4853c74bd7ab7fdb83f319bd9ace8a08c031e9b6
commit: 2e8bf0cbd0589bae3a0466a3ed45f9cf9f3164eb KVM: arm64: Use arm64_ftr_bits to sanitise ID register writes
date: 9 weeks ago
config: arm64-defconfig (https://download.01.org/0day-ci/archive/20230817/202308172123.fPQkVpYE-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230817/202308172123.fPQkVpYE-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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202308172123.fPQkVpYE-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> arch/arm64/kvm/sys_regs.c:1239: warning: Function parameter or member 'vcpu' not described in 'arm64_check_features'
>> arch/arm64/kvm/sys_regs.c:1239: warning: Function parameter or member 'rd' not described in 'arm64_check_features'
>> arch/arm64/kvm/sys_regs.c:1239: warning: Function parameter or member 'val' not described in 'arm64_check_features'
arch/arm64/kvm/sys_regs.c:2868: warning: Function parameter or member 'global' not described in 'kvm_handle_cp_64'
arch/arm64/kvm/sys_regs.c:2868: warning: Function parameter or member 'nr_global' not described in 'kvm_handle_cp_64'
arch/arm64/kvm/sys_regs.c:2868: warning: Excess function parameter 'run' description in 'kvm_handle_cp_64'
arch/arm64/kvm/sys_regs.c:3036: warning: Function parameter or member 'params' not described in 'kvm_handle_cp_32'
arch/arm64/kvm/sys_regs.c:3036: warning: Function parameter or member 'global' not described in 'kvm_handle_cp_32'
arch/arm64/kvm/sys_regs.c:3036: warning: Function parameter or member 'nr_global' not described in 'kvm_handle_cp_32'
arch/arm64/kvm/sys_regs.c:3036: warning: Excess function parameter 'run' description in 'kvm_handle_cp_32'
vim +1239 arch/arm64/kvm/sys_regs.c
1223
1224 /**
1225 * arm64_check_features() - Check if a feature register value constitutes
1226 * a subset of features indicated by the idreg's KVM sanitised limit.
1227 *
1228 * This function will check if each feature field of @val is the "safe" value
1229 * against idreg's KVM sanitised limit return from reset() callback.
1230 * If a field value in @val is the same as the one in limit, it is always
1231 * considered the safe value regardless For register fields that are not in
1232 * writable, only the value in limit is considered the safe value.
1233 *
1234 * Return: 0 if all the fields are safe. Otherwise, return negative errno.
1235 */
1236 static int arm64_check_features(struct kvm_vcpu *vcpu,
1237 const struct sys_reg_desc *rd,
1238 u64 val)
> 1239 {
1240 const struct arm64_ftr_reg *ftr_reg;
1241 const struct arm64_ftr_bits *ftrp = NULL;
1242 u32 id = reg_to_encoding(rd);
1243 u64 writable_mask = rd->val;
1244 u64 limit = rd->reset(vcpu, rd);
1245 u64 mask = 0;
1246
1247 /*
1248 * Hidden and unallocated ID registers may not have a corresponding
1249 * struct arm64_ftr_reg. Of course, if the register is RAZ we know the
1250 * only safe value is 0.
1251 */
1252 if (sysreg_visible_as_raz(vcpu, rd))
1253 return val ? -E2BIG : 0;
1254
1255 ftr_reg = get_arm64_ftr_reg(id);
1256 if (!ftr_reg)
1257 return -EINVAL;
1258
1259 ftrp = ftr_reg->ftr_bits;
1260
1261 for (; ftrp && ftrp->width; ftrp++) {
1262 s64 f_val, f_lim, safe_val;
1263 u64 ftr_mask;
1264
1265 ftr_mask = arm64_ftr_mask(ftrp);
1266 if ((ftr_mask & writable_mask) != ftr_mask)
1267 continue;
1268
1269 f_val = arm64_ftr_value(ftrp, val);
1270 f_lim = arm64_ftr_value(ftrp, limit);
1271 mask |= ftr_mask;
1272
1273 if (f_val == f_lim)
1274 safe_val = f_val;
1275 else
1276 safe_val = kvm_arm64_ftr_safe_value(id, ftrp, f_val, f_lim);
1277
1278 if (safe_val != f_val)
1279 return -E2BIG;
1280 }
1281
1282 /* For fields that are not writable, values in limit are the safe values. */
1283 if ((val & ~mask) != (limit & ~mask))
1284 return -E2BIG;
1285
1286 return 0;
1287 }
1288
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists