Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [sean-jc:x86/mediated_pmu 66/109] arch/x86/kvm/svm/svm.c:149:15: error: static assertion failed due to requirement '(sizeof (direct_access_msrs) / sizeof ((direct_access_msrs)[0]) + ((int)sizeof(struct (unnamed at arch/x86/kvm/svm/svm.c:149:1)))) == 47': ARRAY_SIZE(direct_access_msrs) == ...
@ 2025-05-17 14:21 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-05-17 14:21 UTC (permalink / raw)
  To: Sean Christopherson; +Cc: llvm, oe-kbuild-all

tree:   https://github.com/sean-jc/linux x86/mediated_pmu
head:   4cc8b36f2f60e45223b6ad98c22b31dec0d65022
commit: 2f97b58b68724b4ed0c528535d29d58ee0d695f4 [66/109] KVM: SVM: Use ARRAY_SIZE() to iterate over direct_access_msrs
config: i386-buildonly-randconfig-001-20250517 (https://download.01.org/0day-ci/archive/20250517/202505172232.LdWP0Wjp-lkp@intel.com/config)
compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250517/202505172232.LdWP0Wjp-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/202505172232.LdWP0Wjp-lkp@intel.com/

All errors (new ones prefixed by >>):

>> arch/x86/kvm/svm/svm.c:149:15: error: static assertion failed due to requirement '(sizeof (direct_access_msrs) / sizeof ((direct_access_msrs)[0]) + ((int)sizeof(struct (unnamed at arch/x86/kvm/svm/svm.c:149:1)))) == 47': ARRAY_SIZE(direct_access_msrs) == MAX_DIRECT_ACCESS_MSRS
     149 | static_assert(ARRAY_SIZE(direct_access_msrs) == MAX_DIRECT_ACCESS_MSRS);
         | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/array_size.h:11:25: note: expanded from macro 'ARRAY_SIZE'
      11 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
         |                         ^
   include/linux/build_bug.h:77:50: note: expanded from macro 'static_assert'
      77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
         |                                  ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:78:56: note: expanded from macro '__static_assert'
      78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
         |                                                        ^~~~
   arch/x86/kvm/svm/svm.c:149:46: note: expression evaluates to '41 == 47'
     149 | static_assert(ARRAY_SIZE(direct_access_msrs) == MAX_DIRECT_ACCESS_MSRS);
         | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:77:50: note: expanded from macro 'static_assert'
      77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
         |                                  ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:78:56: note: expanded from macro '__static_assert'
      78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
         |                                                        ^~~~
   1 error generated.


vim +149 arch/x86/kvm/svm/svm.c

   148	
 > 149	static_assert(ARRAY_SIZE(direct_access_msrs) == MAX_DIRECT_ACCESS_MSRS);
   150	#undef MAX_DIRECT_ACCESS_MSRS
   151	

-- 
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-05-17 14:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-17 14:21 [sean-jc:x86/mediated_pmu 66/109] arch/x86/kvm/svm/svm.c:149:15: error: static assertion failed due to requirement '(sizeof (direct_access_msrs) / sizeof ((direct_access_msrs)[0]) + ((int)sizeof(struct (unnamed at arch/x86/kvm/svm/svm.c:149:1)))) == 47': ARRAY_SIZE(direct_access_msrs) == 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