Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [sean-jc:x86/dynamic_mmu_page_hash 65/66] arch/x86/kvm/x86.h:61:15: error: static assertion failed due to requirement '(sizeof (((struct kvm_memslots *)0)->id_hash) * 2 * 1) == 2048 * (1 + 0)': SIZE_OF_MEMSLOTS_HASHTABLE == 2048 * (1 + IS_ENABLED(CONFIG_KVM_SMM))
@ 2025-05-10 21:27 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-05-10 21:27 UTC (permalink / raw)
  To: Sean Christopherson; +Cc: llvm, oe-kbuild-all

tree:   https://github.com/sean-jc/linux x86/dynamic_mmu_page_hash
head:   d828b30b070f9e2007facb2a2cd6fe453d3dba1e
commit: 52f79fe55637526ff07ae355247de566ec036653 [65/66] KVM: x86: Use kvzalloc() to allocate VM struct
config: i386-randconfig-013-20250510 (https://download.01.org/0day-ci/archive/20250511/202505110508.7KHGHZAA-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/20250511/202505110508.7KHGHZAA-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/202505110508.7KHGHZAA-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from arch/x86/kvm/mmu/mmu.c:19:
   In file included from arch/x86/kvm/irq.h:19:
   In file included from arch/x86/kvm/lapic.h:9:
   In file included from arch/x86/kvm/hyperv.h:25:
>> arch/x86/kvm/x86.h:61:15: error: static assertion failed due to requirement '(sizeof (((struct kvm_memslots *)0)->id_hash) * 2 * 1) == 2048 * (1 + 0)': SIZE_OF_MEMSLOTS_HASHTABLE == 2048 * (1 + IS_ENABLED(CONFIG_KVM_SMM))
      61 | static_assert(SIZE_OF_MEMSLOTS_HASHTABLE == 2048 * (1 + IS_ENABLED(CONFIG_KVM_SMM)));
         | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/kvm/x86.h:59:2: note: expanded from macro 'SIZE_OF_MEMSLOTS_HASHTABLE'
      59 |         (sizeof(((struct kvm_memslots *)0)->id_hash) * 2 * KVM_MAX_NR_ADDRESS_SPACES)
         |         ^
   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/x86.h:61:42: note: expression evaluates to '1024 == 2048'
      61 | static_assert(SIZE_OF_MEMSLOTS_HASHTABLE == 2048 * (1 + IS_ENABLED(CONFIG_KVM_SMM)));
         | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   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.
--
   In file included from arch/x86/kvm/x86.c:21:
   In file included from arch/x86/kvm/irq.h:19:
   In file included from arch/x86/kvm/lapic.h:9:
   In file included from arch/x86/kvm/hyperv.h:25:
>> arch/x86/kvm/x86.h:61:15: error: static assertion failed due to requirement '(sizeof (((struct kvm_memslots *)0)->id_hash) * 2 * 1) == 2048 * (1 + 0)': SIZE_OF_MEMSLOTS_HASHTABLE == 2048 * (1 + IS_ENABLED(CONFIG_KVM_SMM))
      61 | static_assert(SIZE_OF_MEMSLOTS_HASHTABLE == 2048 * (1 + IS_ENABLED(CONFIG_KVM_SMM)));
         | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/kvm/x86.h:59:2: note: expanded from macro 'SIZE_OF_MEMSLOTS_HASHTABLE'
      59 |         (sizeof(((struct kvm_memslots *)0)->id_hash) * 2 * KVM_MAX_NR_ADDRESS_SPACES)
         |         ^
   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/x86.h:61:42: note: expression evaluates to '1024 == 2048'
      61 | static_assert(SIZE_OF_MEMSLOTS_HASHTABLE == 2048 * (1 + IS_ENABLED(CONFIG_KVM_SMM)));
         | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   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)
         |                                                        ^~~~
   In file included from arch/x86/kvm/x86.c:44:
   include/linux/mman.h:157:9: warning: division by zero is undefined [-Wdivision-by-zero]
     157 |                _calc_vm_trans(flags, MAP_SYNC,       VM_SYNC      ) |
         |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/mman.h:135:21: note: expanded from macro '_calc_vm_trans'
     135 |    : ((x) & (bit1)) / ((bit1) / (bit2))))
         |                     ^ ~~~~~~~~~~~~~~~~~
   include/linux/mman.h:158:9: warning: division by zero is undefined [-Wdivision-by-zero]
     158 |                _calc_vm_trans(flags, MAP_STACK,      VM_NOHUGEPAGE) |
         |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/mman.h:135:21: note: expanded from macro '_calc_vm_trans'
     135 |    : ((x) & (bit1)) / ((bit1) / (bit2))))
         |                     ^ ~~~~~~~~~~~~~~~~~
   2 warnings and 1 error generated.
--
   In file included from arch/x86/kvm/vmx/hyperv_evmcs.c:7:
   In file included from arch/x86/kvm/vmx/hyperv_evmcs.h:11:
   In file included from arch/x86/kvm/vmx/capabilities.h:7:
   In file included from arch/x86/kvm/vmx/../lapic.h:9:
   In file included from arch/x86/kvm/vmx/../hyperv.h:25:
>> arch/x86/kvm/vmx/../x86.h:61:15: error: static assertion failed due to requirement '(sizeof (((struct kvm_memslots *)0)->id_hash) * 2 * 1) == 2048 * (1 + 0)': SIZE_OF_MEMSLOTS_HASHTABLE == 2048 * (1 + IS_ENABLED(CONFIG_KVM_SMM))
      61 | static_assert(SIZE_OF_MEMSLOTS_HASHTABLE == 2048 * (1 + IS_ENABLED(CONFIG_KVM_SMM)));
         | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/kvm/vmx/../x86.h:59:2: note: expanded from macro 'SIZE_OF_MEMSLOTS_HASHTABLE'
      59 |         (sizeof(((struct kvm_memslots *)0)->id_hash) * 2 * KVM_MAX_NR_ADDRESS_SPACES)
         |         ^
   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/vmx/../x86.h:61:42: note: expression evaluates to '1024 == 2048'
      61 | static_assert(SIZE_OF_MEMSLOTS_HASHTABLE == 2048 * (1 + IS_ENABLED(CONFIG_KVM_SMM)));
         | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   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.
--
   In file included from arch/x86/kvm/svm/hyperv.c:7:
   In file included from arch/x86/kvm/svm/hyperv.h:11:
   In file included from arch/x86/kvm/svm/../hyperv.h:25:
>> arch/x86/kvm/svm/../x86.h:61:15: error: static assertion failed due to requirement '(sizeof (((struct kvm_memslots *)0)->id_hash) * 2 * 1) == 2048 * (1 + 0)': SIZE_OF_MEMSLOTS_HASHTABLE == 2048 * (1 + IS_ENABLED(CONFIG_KVM_SMM))
      61 | static_assert(SIZE_OF_MEMSLOTS_HASHTABLE == 2048 * (1 + IS_ENABLED(CONFIG_KVM_SMM)));
         | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/kvm/svm/../x86.h:59:2: note: expanded from macro 'SIZE_OF_MEMSLOTS_HASHTABLE'
      59 |         (sizeof(((struct kvm_memslots *)0)->id_hash) * 2 * KVM_MAX_NR_ADDRESS_SPACES)
         |         ^
   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/../x86.h:61:42: note: expression evaluates to '1024 == 2048'
      61 | static_assert(SIZE_OF_MEMSLOTS_HASHTABLE == 2048 * (1 + IS_ENABLED(CONFIG_KVM_SMM)));
         | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   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 +61 arch/x86/kvm/x86.h

    57	
    58	#define SIZE_OF_MEMSLOTS_HASHTABLE \
    59		(sizeof(((struct kvm_memslots *)0)->id_hash) * 2 * KVM_MAX_NR_ADDRESS_SPACES)
    60	
  > 61	static_assert(SIZE_OF_MEMSLOTS_HASHTABLE == 2048 * (1 + IS_ENABLED(CONFIG_KVM_SMM)));
    62	

-- 
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-10 21:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-10 21:27 [sean-jc:x86/dynamic_mmu_page_hash 65/66] arch/x86/kvm/x86.h:61:15: error: static assertion failed due to requirement '(sizeof (((struct kvm_memslots *)0)->id_hash) * 2 * 1) == 2048 * (1 + 0)': SIZE_OF_MEMSLOTS_HASHTABLE == 2048 * (1 + IS_ENABLED(CONFIG_KVM_SMM)) 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