llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [broonie-misc:kvm-arm64-fix-pkvm-sve-vl 3/5] arch/arm64/kernel/fpsimd.c:1096:36: warning: format specifies type 'unsigned int' but the argument has type 'unsigned long'
@ 2024-06-07  7:07 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-06-07  7:07 UTC (permalink / raw)
  To: Mark Brown; +Cc: llvm, oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc.git kvm-arm64-fix-pkvm-sve-vl
head:   68353e223a2346c7009e15d8b44f6c58e0d5a094
commit: e231f23d830ceaa42055c7464e12f55faf811198 [3/5] arm64/fpsimd: Discover maximum vector length implemented by any CPU
config: arm64-randconfig-002-20240607 (https://download.01.org/0day-ci/archive/20240607/202406071530.vhvvPnx1-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project d7d2d4f53fc79b4b58e8d8d08151b577c3699d4a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240607/202406071530.vhvvPnx1-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/202406071530.vhvvPnx1-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from arch/arm64/kernel/fpsimd.c:26:
   In file included from include/linux/ptrace.h:10:
   In file included from include/linux/pid_namespace.h:7:
   In file included from include/linux/mm.h:2253:
   include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     514 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
>> arch/arm64/kernel/fpsimd.c:1096:36: warning: format specifies type 'unsigned int' but the argument has type 'unsigned long' [-Wformat]
    1095 |                 pr_warn("%s: cpu%d: increases maximum VL to %u\n",
         |                                                             ~~
         |                                                             %lu
    1096 |                         info->name, smp_processor_id(), max_vl);
         |                                                         ^~~~~~
   include/linux/printk.h:517:37: note: expanded from macro 'pr_warn'
     517 |         printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
         |                                    ~~~     ^~~~~~~~~~~
   include/linux/printk.h:464:60: note: expanded from macro 'printk'
     464 | #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
         |                                                     ~~~    ^~~~~~~~~~~
   include/linux/printk.h:436:19: note: expanded from macro 'printk_index_wrap'
     436 |                 _p_func(_fmt, ##__VA_ARGS__);                           \
         |                         ~~~~    ^~~~~~~~~~~
   2 warnings generated.


vim +1096 arch/arm64/kernel/fpsimd.c

  1074	
  1075	/*
  1076	 * Check whether the current CPU supports all VQs in the committed set.
  1077	 * This function is called during the bring-up of late secondary CPUs only.
  1078	 */
  1079	int vec_verify_vq_map(enum vec_type type)
  1080	{
  1081		struct vl_info *info = &vl_info[type];
  1082		DECLARE_BITMAP(tmp_map, SVE_VQ_MAX);
  1083		unsigned long b, max_vl;
  1084	
  1085		vec_probe_vqs(info, tmp_map);
  1086	
  1087		/*
  1088		 * Currently the maximum VL is only used for pKVM which
  1089		 * doesn't allow late CPUs but we don't expect asymmetry and
  1090		 * if we encounter any then future users will need handling so
  1091		 * warn if we see anything.
  1092		 */
  1093		max_vl = __bit_to_vl(find_first_bit(tmp_map, SVE_VQ_MAX));
  1094		if (max_vl > info->max_cpu_vl) {
  1095			pr_warn("%s: cpu%d: increases maximum VL to %u\n",
> 1096				info->name, smp_processor_id(), max_vl);
  1097			info->max_cpu_vl = max_vl;
  1098		}
  1099	
  1100		bitmap_complement(tmp_map, tmp_map, SVE_VQ_MAX);
  1101		if (bitmap_intersects(tmp_map, info->vq_map, SVE_VQ_MAX)) {
  1102			pr_warn("%s: cpu%d: Required vector length(s) missing\n",
  1103				info->name, smp_processor_id());
  1104			return -EINVAL;
  1105		}
  1106	
  1107		if (!IS_ENABLED(CONFIG_KVM) || !is_hyp_mode_available())
  1108			return 0;
  1109	
  1110		/*
  1111		 * For KVM, it is necessary to ensure that this CPU doesn't
  1112		 * support any vector length that guests may have probed as
  1113		 * unsupported.
  1114		 */
  1115	
  1116		/* Recover the set of supported VQs: */
  1117		bitmap_complement(tmp_map, tmp_map, SVE_VQ_MAX);
  1118		/* Find VQs supported that are not globally supported: */
  1119		bitmap_andnot(tmp_map, tmp_map, info->vq_map, SVE_VQ_MAX);
  1120	
  1121		/* Find the lowest such VQ, if any: */
  1122		b = find_last_bit(tmp_map, SVE_VQ_MAX);
  1123		if (b >= SVE_VQ_MAX)
  1124			return 0; /* no mismatches */
  1125	
  1126		/*
  1127		 * Mismatches above sve_max_virtualisable_vl are fine, since
  1128		 * no guest is allowed to configure ZCR_EL2.LEN to exceed this:
  1129		 */
  1130		if (__bit_to_vl(b) <= info->max_virtualisable_vl) {
  1131			pr_warn("%s: cpu%d: Unsupported vector length(s) present\n",
  1132				info->name, smp_processor_id());
  1133			return -EINVAL;
  1134		}
  1135	
  1136		return 0;
  1137	}
  1138	

-- 
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-06-07  7:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-07  7:07 [broonie-misc:kvm-arm64-fix-pkvm-sve-vl 3/5] arch/arm64/kernel/fpsimd.c:1096:36: warning: format specifies type 'unsigned int' but the argument has type 'unsigned long' 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;
as well as URLs for NNTP newsgroup(s).