LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   KVM module build on RHEL (https://www.linuxquestions.org/questions/linux-software-2/kvm-module-build-on-rhel-4175580646/)

dexter85 05-25-2016 05:19 AM

KVM module build on RHEL
 
I am trying to compile a specific version of kvm module from source for my kernel version. As per http://www.linux-kvm.org/page/Downloads for kernel versions >= 2.6.29 any version of kvm can be used.

My kernel version is 2.6.32 and i am trying to compile kvm-kmod 3.10.21 version.
However, during make i ran into following error :

Quote:

make -C /lib/modules/2.6.32-431.11.2.el6.x86_64/build M=`pwd` \
> LINUXINCLUDE="-I`pwd`/include -I`pwd`/include/uapi -Iinclude \
> -Iinclude2 -I/lib/modules/2.6.32-431.11.2.el6.x86_64/source/include -I/lib/modules/2.6.32-431.11.2.el6.x86_64/source/include/uapi -I/lib/modules/2.6.32-431.11.2.el6.x86_64/source/arch/x86/include -I/lib/modules/2.6.32-431.11.2.el6.x86_64/source/arch/x86/include/uapi \
> -Iinclude/generated/uapi -Iarch/x86/include/generated \
> -Iarch/x86/include/generated/uapi \
> -I`pwd`/include-compat -I`pwd`/x86 \
> -include include/linux/autoconf.h \
> -include `pwd`/x86/external-module-compat.h" \ "$@" make[1]: Entering directory `/usr/src/kernels/2.6.32-431.11.2.el6.x86_64' CC [M]
> /home/user/kvm_build/kvm-kmod-3.10.21/x86/svm.o In file included from
> /home/user/kvm_build/kvm-kmod-3.10.21/x86/external-module-compat.h:26,
> from <command-line>:0:
> /home/user/kvm_build/kvm-kmod-3.10.21/x86/../external-module-compat-comm.h:731:54:
> error: too many decimal points in number
> /home/user/kvm_build/kvm-kmod-3.10.21/x86/../external-module-compat-comm.h:731:74:
> error: operator '-' has no right operand
> /home/user/kvm_build/kvm-kmod-3.10.21/x86/../external-module-compat-comm.h:748:55:
> error: too many decimal points in number
> /home/user/kvm_build/kvm-kmod-3.10.21/x86/../external-module-compat-comm.h:748:75:
> error: operator '-' has no right operand In file included from
> /home/user/kvm_build/kvm-kmod-3.10.21/x86/external-module-compat.h:26,
> from <command-line>:0:
> /home/user/kvm_build/kvm-kmod-3.10.21/x86/../external-module-compat-comm.h:758:
> error: static declaration of ‘pci_get_domain_bus_and_slot’ follows
> non-static declaration include/linux/pci.h:763: note: previous
> declaration of ‘pci_get_domain_bus_and_slot’ was here
> /home/user/kvm_build/kvm-kmod-3.10.21/x86/../external-module-compat-comm.h:780:
> error: redefinition of ‘struct perf_guest_info_callbacks’
> /home/user/kvm_build/kvm-kmod-3.10.21/x86/../external-module-compat-comm.h:787:
> error: conflicting types for ‘perf_register_guest_info_callbacks’
> include/linux/perf_event.h:1164: note: previous declaration of
> ‘perf_register_guest_info_callbacks’ was here
> /home/user/kvm_build/kvm-kmod-3.10.21/x86/../external-module-compat-comm.h:793:
> error: conflicting types for ‘perf_unregister_guest_info_callbacks’
> include/linux/perf_event.h:1165: note: previous declaration of
> ‘perf_unregister_guest_info_callbacks’ was here
> /home/user/kvm_build/kvm-kmod-3.10.21/x86/../external-module-compat-comm.h:800:1:
> warning: "rcu_dereference_check" redefined In file included from
> include/linux/tracepoint.h:18, from include/linux/module.h:18, from
> include/linux/sysdev.h:25, from include/linux/cpu.h:22, from
> /home/user/kvm_build/kvm-kmod-3.10.21/x86/../external-module-compat-comm.h:15,
> from
> /home/user/kvm_build/kvm-kmod-3.10.21/x86/external-module-compat.h:26,
> from <command-line>:0: include/linux/rcupdate.h:257:1: warning: this
> is the location of the previous definition
Am i missing something ?

smallpond 05-26-2016 12:38 PM

It looks like you are trying to compile the 3.10.21 version of KVM with the 2.6.32 kernel source. Having backported some drivers in the past I can make some suggestions. Compare the sources between the 2.6.32 KVM and the 3.10.21 KVM. You will need to take out or modify new kernel features and new CONFIG_ options to work properly with the older kernel. One source for descriptions of the differences in each kernel release is http://kernelnewbies.org/ You might also consider adding the new features that you need to the older KVM code. I find its generally easier to start from something that works but doesn't do what I want than vice versa.

jpollard 05-26-2016 01:04 PM

There is a warning - somewhere around 2.6.32 (and the 3.x kernels) the kernel VM structure changed. Newer KVM modules won't work without back porting those changes and it may not be possible to do. Some of the changes had to do with how to pass GPU acceleration to the clients securely (as well as access to USB devices...) - and trying to backport that is very likely to fail.

You would have a better chance by using a newer kernel (and yes, you would also have to update some of the kernel support tools as well and maybe, though I don't think so, even rebuild your libc).


All times are GMT -5. The time now is 06:13 AM.