Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.

Build error in kvm-rvmi-kmod: 'cpu_tss' undeclared #9

Open
v-p-b opened this issue Apr 30, 2018 · 3 comments
Open

Build error in kvm-rvmi-kmod: 'cpu_tss' undeclared #9

v-p-b opened this issue Apr 30, 2018 · 3 comments

Comments

@v-p-b
Copy link

v-p-b commented Apr 30, 2018

When running the build script I get the following error:

/home/user/rvmi/kvm-rvmi-kmod/x86/external-module-compat.h:1984:46: error: ‘cpu_tss’ undeclared (first use in this function)
         return (unsigned long) this_cpu_ptr(&cpu_tss);

GCC version: 5.4.0

Kernel: 4.13.0

I'm doing the build in a VM, but I don't think that should be a problem.

@ichigoXZ
Copy link

ichigoXZ commented Jul 19, 2018

I have the same problem with

GCC version: 7.2.0
kernel: 4.15.0

/home/rvmi/kvm-rvmi-kmod/x86/external-module-compat.h:1984:46: error: ‘cpu_tss’ undeclared (first use in this function); did you mean ‘cpu_has’?
         return (unsigned long) this_cpu_ptr(&cpu_tss);
                                              ^
include/linux/percpu-defs.h:221:47: note: in definition of macro ‘__verify_pcpu_ptr’
  const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL; \
                                               ^~~
include/linux/percpu-defs.h:254:27: note: in expansion of macro ‘raw_cpu_ptr’
 #define this_cpu_ptr(ptr) raw_cpu_ptr(ptr)
                           ^~~~~~~~~~~
/home/rvmi/kvm-rvmi-kmod/x86/external-module-compat.h:1984:32: note: in expansion of macro ‘this_cpu_ptr’
         return (unsigned long) this_cpu_ptr(&cpu_tss);
                                ^~~~~~~~~~~~
/home/rvmi/kvm-rvmi-kmod/x86/external-module-compat.h:1984:46: note: each undeclared identifier is reported only once for each function it appears in
         return (unsigned long) this_cpu_ptr(&cpu_tss);
                                              ^
include/linux/percpu-defs.h:221:47: note: in definition of macro ‘__verify_pcpu_ptr’
  const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL; \
                                               ^~~
include/linux/percpu-defs.h:254:27: note: in expansion of macro ‘raw_cpu_ptr’
 #define this_cpu_ptr(ptr) raw_cpu_ptr(ptr)
                           ^~~~~~~~~~~
/home/rvmi/kvm-rvmi-kmod/x86/external-module-compat.h:1984:32: note: in expansion of macro ‘this_cpu_ptr’
         return (unsigned long) this_cpu_ptr(&cpu_tss);
                                ^~~~~~~~~~~~
In file included from /home/rvmi/kvm-rvmi-kmod/include/linux/kvm_host.h:75:0,
                 from /home/rvmi/kvm-rvmi-kmod/x86/kvm_main.c:55:
/home/rvmi/kvm-rvmi-kmod/include/asm/kvm_host.h: In function ‘kvm_cpu_get_apicid’:
/home/rvmi/kvm-rvmi-kmod/include/asm/kvm_host.h:1476:9: error: implicit declaration of function ‘__default_cpu_present_to_apicid’; did you mean ‘default_cpu_present_to_apicid’? [-Werror=implicit-function-declaration]
  return __default_cpu_present_to_apicid(mps_cpu);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         default_cpu_present_to_apicid
/home/rvmi/kvm-rvmi-kmod/x86/kvm_main.c: At top level:
/home/rvmi/kvm-rvmi-kmod/x86/kvm_main.c:568:3: error: ‘const struct mmu_notifier_ops’ has no member named ‘invalidate_page’; did you mean ‘invalidate_range’?
  .invalidate_page = kvm_mmu_notifier_invalidate_page,
   ^~~~~~~~~~~~~~~
   invalidate_range
/home/rvmi/kvm-rvmi-kmod/x86/kvm_main.c:568:21: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
  .invalidate_page = kvm_mmu_notifier_invalidate_page,
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/rvmi/kvm-rvmi-kmod/x86/kvm_main.c:568:21: note: (near initialization for ‘kvm_mmu_notifier_ops.release’)
/home/rvmi/kvm-rvmi-kmod/x86/kvm_main.c: In function ‘kvm_vcpu_on_spin’:
/home/rvmi/kvm-rvmi-kmod/x86/kvm_main.c:2409:9: error: implicit declaration of function ‘ACCESS_ONCE’; did you mean ‘__READ_ONCE’? [-Werror=implicit-function-declaration]
    if (!ACCESS_ONCE(vcpu->preempted))
         ^~~~~~~~~~~
         __READ_ONCE
In file included from /home/rvmi/kvm-rvmi-kmod/x86/external-module-compat.h:46:0,
                 from <command-line>:0:
/home/rvmi/kvm-rvmi-kmod/x86/kvm_main.c: In function ‘kvm_vcpu_compat_ioctl’:
/home/rvmi/kvm-rvmi-kmod/x86/../external-module-compat-comm.h:983:32: error: implicit declaration of function ‘sigset_from_compat’; did you mean ‘kvm_sigset_from_compat’? [-Werror=implicit-function-declaration]
 #define kvm_sigset_from_compat sigset_from_compat
                                ^
/home/rvmi/kvm-rvmi-kmod/x86/kvm_main.c:2853:4: note: in expansion of macro ‘kvm_sigset_from_compat’
    kvm_sigset_from_compat(&sigset, &csigset);

@ichigoXZ
Copy link

ichigoXZ commented Jul 23, 2018

It seems to be a problem of kernel version.....

AndI can not find cpu_tss in kernel source code

@pfohjo
Copy link
Contributor

pfohjo commented Jul 26, 2018

I apologize for the delayed response....

Yes, this is an issue with kernel compatibility. For the time being, please use an older kernel version. Hopefully, we can get an updated kmod pushed out soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants