[Bug 216365] New: kvm selftests build fail

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.kernel.org/show_bug.cgi?id=216365

            Bug ID: 216365
           Summary: kvm selftests build fail
           Product: Virtualization
           Version: unspecified
    Kernel Version: 5.20
          Hardware: Intel
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: high
          Priority: P1
         Component: kvm
          Assignee: virtualization_kvm@xxxxxxxxxxxxxxxxxxxx
          Reporter: lixiao.yang@xxxxxxxxx
        Regression: No

Environment:

Host kernel: 5.19.0-rc8

Host OS: rhel8.3

upstream kvm repo: https://git.kernel.org/pub/scm/virt/kvm/kvm.git

branch: next

commit: 19a7cc817a380f7a412d7d76e145e9e2bc47e52f

GCC version: gcc (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5)

Bug Detailed Description:

Error happens when trying to compile upstream kvm selftests.

git clone https://git.kernel.org/pub/scm/virt/kvm/kvm.git
git checkout -b next origin/next
cd kvm/tools/testing/selftests/kvm
make

Expected results:
Successfully build

Actual results:
gcc -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99
-fno-stack-protector -fno-PIE -I../../../../tools/include
-I../../../../tools/arch/x86/include -I../../../../usr/include/ -Iinclude -Ilib
-Iinclude/x86_64 -I ../rseq -I..     -c lib/assert.c -o
/home/lxy/kvm/tools/testing/selftests/kvm/lib/assert.o
gcc -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99
-fno-stack-protector -fno-PIE -I../../../../tools/include
-I../../../../tools/arch/x86/include -I../../../../usr/include/ -Iinclude -Ilib
-Iinclude/x86_64 -I ../rseq -I..     -c lib/elf.c -o
/home/lxy/kvm/tools/testing/selftests/kvm/lib/elf.o
In file included from include/kvm_util.h:10,
                 from lib/elf.c:13:
include/kvm_util_base.h:93:26: error: field ‘stats_header’ has incomplete type
  struct kvm_stats_header stats_header;
                          ^~~~~~~~~~~~
In file included from ../../../../tools/include/linux/kernel.h:8,
                 from ../../../../tools/include/linux/list.h:7,
                 from ../../../../tools/include/linux/hashtable.h:10,
                 from include/kvm_util_base.h:13,
                 from include/kvm_util.h:10,
                 from lib/elf.c:13:
include/kvm_util_base.h: In function ‘kvm_vm_reset_dirty_ring’:
include/kvm_util_base.h:308:24: error: ‘KVM_RESET_DIRTY_RINGS’ undeclared
(first use in this function); did you mean ‘KVM_GET_DIRTY_LOG’?
  return __vm_ioctl(vm, KVM_RESET_DIRTY_RINGS, NULL);
                        ^~~~~~~~~~~~~~~~~~~~~
../../../../tools/include/linux/build_bug.h:79:56: note: in definition of macro
‘__static_assert’
 #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
                                                        ^~~~
include/kvm_util_base.h:193:2: note: in expansion of macro ‘static_assert’
  static_assert(!_IOC_SIZE(cmd) || sizeof(*arg) == _IOC_SIZE(cmd), ""); \
  ^~~~~~~~~~~~~
include/kvm_util_base.h:216:2: note: in expansion of macro ‘kvm_do_ioctl’
  kvm_do_ioctl((vm)->fd, cmd, arg);   \
  ^~~~~~~~~~~~
include/kvm_util_base.h:308:9: note: in expansion of macro ‘__vm_ioctl’
  return __vm_ioctl(vm, KVM_RESET_DIRTY_RINGS, NULL);
         ^~~~~~~~~~
include/kvm_util_base.h:308:24: note: each undeclared identifier is reported
only once for each function it appears in
  return __vm_ioctl(vm, KVM_RESET_DIRTY_RINGS, NULL);
                        ^~~~~~~~~~~~~~~~~~~~~
../../../../tools/include/linux/build_bug.h:79:56: note: in definition of macro
‘__static_assert’
 #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
                                                        ^~~~
include/kvm_util_base.h:193:2: note: in expansion of macro ‘static_assert’
  static_assert(!_IOC_SIZE(cmd) || sizeof(*arg) == _IOC_SIZE(cmd), ""); \
  ^~~~~~~~~~~~~
include/kvm_util_base.h:216:2: note: in expansion of macro ‘kvm_do_ioctl’
  kvm_do_ioctl((vm)->fd, cmd, arg);   \
  ^~~~~~~~~~~~
include/kvm_util_base.h:308:9: note: in expansion of macro ‘__vm_ioctl’
  return __vm_ioctl(vm, KVM_RESET_DIRTY_RINGS, NULL);
         ^~~~~~~~~~
include/kvm_util_base.h:193:16: error: expression in static assertion is not an
integer
  static_assert(!_IOC_SIZE(cmd) || sizeof(*arg) == _IOC_SIZE(cmd), ""); \
                ^
../../../../tools/include/linux/build_bug.h:79:56: note: in definition of macro
‘__static_assert’
 #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
                                                        ^~~~
include/kvm_util_base.h:193:2: note: in expansion of macro ‘static_assert’
  static_assert(!_IOC_SIZE(cmd) || sizeof(*arg) == _IOC_SIZE(cmd), ""); \
  ^~~~~~~~~~~~~
include/kvm_util_base.h:216:2: note: in expansion of macro ‘kvm_do_ioctl’
  kvm_do_ioctl((vm)->fd, cmd, arg);   \
  ^~~~~~~~~~~~
include/kvm_util_base.h:308:9: note: in expansion of macro ‘__vm_ioctl’
  return __vm_ioctl(vm, KVM_RESET_DIRTY_RINGS, NULL);
         ^~~~~~~~~~
include/kvm_util_base.h: In function ‘vm_get_stats_fd’:
include/kvm_util_base.h:313:26: error: ‘KVM_GET_STATS_FD’ undeclared (first use
in this function); did you mean ‘KVM_GET_SREGS’?
  int fd = __vm_ioctl(vm, KVM_GET_STATS_FD, NULL);
                          ^~~~~~~~~~~~~~~~
../../../../tools/include/linux/build_bug.h:79:56: note: in definition of macro
‘__static_assert’
 #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
                                                        ^~~~
include/kvm_util_base.h:193:2: note: in expansion of macro ‘static_assert’
  static_assert(!_IOC_SIZE(cmd) || sizeof(*arg) == _IOC_SIZE(cmd), ""); \
  ^~~~~~~~~~~~~
include/kvm_util_base.h:216:2: note: in expansion of macro ‘kvm_do_ioctl’
  kvm_do_ioctl((vm)->fd, cmd, arg);   \
  ^~~~~~~~~~~~
include/kvm_util_base.h:313:11: note: in expansion of macro ‘__vm_ioctl’
  int fd = __vm_ioctl(vm, KVM_GET_STATS_FD, NULL);
           ^~~~~~~~~~
include/kvm_util_base.h:193:16: error: expression in static assertion is not an
integer
  static_assert(!_IOC_SIZE(cmd) || sizeof(*arg) == _IOC_SIZE(cmd), ""); \
                ^
../../../../tools/include/linux/build_bug.h:79:56: note: in definition of macro
‘__static_assert’
 #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
                                                        ^~~~
include/kvm_util_base.h:193:2: note: in expansion of macro ‘static_assert’
  static_assert(!_IOC_SIZE(cmd) || sizeof(*arg) == _IOC_SIZE(cmd), ""); \
  ^~~~~~~~~~~~~
include/kvm_util_base.h:216:2: note: in expansion of macro ‘kvm_do_ioctl’
  kvm_do_ioctl((vm)->fd, cmd, arg);   \
  ^~~~~~~~~~~~
include/kvm_util_base.h:313:11: note: in expansion of macro ‘__vm_ioctl’
  int fd = __vm_ioctl(vm, KVM_GET_STATS_FD, NULL);
           ^~~~~~~~~~
In file included from include/kvm_util.h:10,
                 from lib/elf.c:13:
include/kvm_util_base.h: In function ‘read_stats_header’:
include/kvm_util_base.h:323:38: error: dereferencing pointer to incomplete type
‘struct kvm_stats_header’
  ret = read(stats_fd, header, sizeof(*header));
                                      ^~~~~~~
include/kvm_util_base.h: In function ‘get_stats_descriptor_size’:
include/kvm_util_base.h:338:16: error: invalid application of ‘sizeof’ to
incomplete type ‘struct kvm_stats_desc’
  return sizeof(struct kvm_stats_desc) + header->name_size;
                ^~~~~~
In file included from ../../../../tools/include/linux/kernel.h:8,
                 from ../../../../tools/include/linux/list.h:7,
                 from ../../../../tools/include/linux/hashtable.h:10,
                 from include/kvm_util_base.h:13,
                 from include/kvm_util.h:10,
                 from lib/elf.c:13:
include/kvm_util_base.h: In function ‘vcpu_get_stats_fd’:
include/kvm_util_base.h:517:30: error: ‘KVM_GET_STATS_FD’ undeclared (first use
in this function); did you mean ‘KVM_GET_SREGS’?
  int fd = __vcpu_ioctl(vcpu, KVM_GET_STATS_FD, NULL);
                              ^~~~~~~~~~~~~~~~
../../../../tools/include/linux/build_bug.h:79:56: note: in definition of macro
‘__static_assert’
 #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
                                                        ^~~~
include/kvm_util_base.h:193:2: note: in expansion of macro ‘static_assert’
  static_assert(!_IOC_SIZE(cmd) || sizeof(*arg) == _IOC_SIZE(cmd), ""); \
  ^~~~~~~~~~~~~
include/kvm_util_base.h:235:2: note: in expansion of macro ‘kvm_do_ioctl’
  kvm_do_ioctl((vcpu)->fd, cmd, arg);   \
  ^~~~~~~~~~~~
include/kvm_util_base.h:517:11: note: in expansion of macro ‘__vcpu_ioctl’
  int fd = __vcpu_ioctl(vcpu, KVM_GET_STATS_FD, NULL);
           ^~~~~~~~~~~~
include/kvm_util_base.h:193:16: error: expression in static assertion is not an
integer
  static_assert(!_IOC_SIZE(cmd) || sizeof(*arg) == _IOC_SIZE(cmd), ""); \
                ^
../../../../tools/include/linux/build_bug.h:79:56: note: in definition of macro
‘__static_assert’
 #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
                                                        ^~~~
include/kvm_util_base.h:193:2: note: in expansion of macro ‘static_assert’
  static_assert(!_IOC_SIZE(cmd) || sizeof(*arg) == _IOC_SIZE(cmd), ""); \
  ^~~~~~~~~~~~~
include/kvm_util_base.h:235:2: note: in expansion of macro ‘kvm_do_ioctl’
  kvm_do_ioctl((vcpu)->fd, cmd, arg);   \
  ^~~~~~~~~~~~
include/kvm_util_base.h:517:11: note: in expansion of macro ‘__vcpu_ioctl’
  int fd = __vcpu_ioctl(vcpu, KVM_GET_STATS_FD, NULL);
           ^~~~~~~~~~~~
In file included from include/kvm_util.h:10,
                 from lib/elf.c:13:
include/kvm_util_base.h: In function ‘__vm_disable_nx_huge_pages’:
include/kvm_util_base.h:834:29: error: ‘KVM_CAP_VM_DISABLE_NX_HUGE_PAGES’
undeclared (first use in this function); did you mean
‘KVM_CAP_X86_DISABLE_EXITS’?
  return __vm_enable_cap(vm, KVM_CAP_VM_DISABLE_NX_HUGE_PAGES, 0);
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                             KVM_CAP_X86_DISABLE_EXITS
make: *** [Makefile:229: /home/lxy/kvm/tools/testing/selftests/kvm/lib/elf.o]
Error 1

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux