Trying to build KVM

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

 



Hi,

I am trying to build KVM-QEMU using instructions at, i am on Ubuntu 18.04:

https://www.linux-kvm.org/page/RunningKVM#Unpacking_and_configuring_kvm_components
https://www.linux-kvm.org/page/Getting_the_kvm_kernel_modules

During the userspace build i had the following issues:

The prerequisites listed at https://www.linux-kvm.org/page/RunningKVM
does not work for Ubuntu 18.04. The problems is that libgnutls-dev
package has been renamed, so instead the following command has to be
used:

sudo  apt-get install gcc libsdl1.2-dev zlib1g-dev libasound2-dev
linux-kernel-headers pkg-config  libgnutls28-dev  libpci-dev

After changing this i was able to build the userspace program.

For kernel module build, i used the external module kit, but during
that i am seeing a lot of errors, i have attached the build log. If i
see

http://git.kiszka.org/?p=kvm-kmod.git

the last commit was in 2014 so i am guessing this repo is long
abandoned. Where do i get the modules latest sources? Is the upstream
kernel only place for this or do we still develop in some external
module kit? My end goal is to debug both kernel module and userspace
program.

Lastly i think the documentation i am following is bit outdated, is
there any place i can find the latest documentation. I can also do a
write up of the steps that i am following if that helps.

Thanks,
Arslan
arslan@arslan-OptiPlex-5050:~/Documents/kvm-kmod$ make
make -C /lib/modules/4.15.0-36-generic/build M=`pwd` \
	LINUXINCLUDE="-I`pwd`/include -I`pwd`/include/uapi -Iinclude \
		 -Iinclude/uapi -Iarch/x86/include -Iarch/x86/include/uapi \
		-Iinclude/generated/uapi -Iarch/x86/include/generated \
		-Iarch/x86/include/generated/uapi \
		-I`pwd`/include-compat -I`pwd`/x86 \
		-include  include/generated/autoconf.h \
		-include `pwd`/x86/external-module-compat.h" \
	"$@"
make[1]: Entering directory '/usr/src/linux-headers-4.15.0-36-generic'
Makefile:975: "Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel"
  CC [M]  /home/arslan/Documents/kvm-kmod/x86/kvm_main.o
In file included from arch/x86/include/asm/paravirt_types.h:46:0,
                 from arch/x86/include/asm/ptrace.h:92,
                 from arch/x86/include/asm/math_emu.h:5,
                 from arch/x86/include/asm/processor.h:12,
                 from arch/x86/include/asm/cpufeature.h:5,
                 from /home/arslan/Documents/kvm-kmod/x86/external-module-compat.h:16,
                 from <command-line>:0:
arch/x86/include/asm/nospec-branch.h: In function ‘indirect_branch_prediction_barrier’:
arch/x86/include/asm/nospec-branch.h:265:12: error: ‘PRED_CMD_IBPB’ undeclared (first use in this function)
  u64 val = PRED_CMD_IBPB;
            ^~~~~~~~~~~~~
arch/x86/include/asm/nospec-branch.h:265:12: note: each undeclared identifier is reported only once for each function it appears in
arch/x86/include/asm/nospec-branch.h:267:24: error: ‘MSR_IA32_PRED_CMD’ undeclared (first use in this function); did you mean ‘MSR_IA32_PERF_CTL’?
  alternative_msr_write(MSR_IA32_PRED_CMD, val, X86_FEATURE_USE_IBPB);
                        ^~~~~~~~~~~~~~~~~
                        MSR_IA32_PERF_CTL
In file included from /home/arslan/Documents/kvm-kmod/x86/external-module-compat.h:45:0,
                 from <command-line>:0:
/home/arslan/Documents/kvm-kmod/x86/../external-module-compat-comm.h: At top level:
/home/arslan/Documents/kvm-kmod/x86/../external-module-compat-comm.h:83:0: warning: "CPU_DEAD_FROZEN" redefined
 #define CPU_DEAD_FROZEN                (CPU_DEAD | CPU_TASKS_FROZEN)
 
In file included from /home/arslan/Documents/kvm-kmod/x86/../external-module-compat-comm.h:16:0,
                 from /home/arslan/Documents/kvm-kmod/x86/external-module-compat.h:45,
                 from <command-line>:0:
include/linux/cpu.h:78:0: note: this is the location of the previous definition
 #define CPU_DEAD_FROZEN  0x0008 /* CPU timed out on unplug */
 
In file included from <command-line>:0:0:
/home/arslan/Documents/kvm-kmod/x86/external-module-compat.h:981:10: fatal error: asm/i387.h: No such file or directory
 #include <asm/i387.h>
          ^~~~~~~~~~~~
compilation terminated.
scripts/Makefile.build:332: recipe for target '/home/arslan/Documents/kvm-kmod/x86/kvm_main.o' failed
make[3]: *** [/home/arslan/Documents/kvm-kmod/x86/kvm_main.o] Error 1
scripts/Makefile.build:606: recipe for target '/home/arslan/Documents/kvm-kmod/x86' failed
make[2]: *** [/home/arslan/Documents/kvm-kmod/x86] Error 2
Makefile:1551: recipe for target '_module_/home/arslan/Documents/kvm-kmod' failed
make[1]: *** [_module_/home/arslan/Documents/kvm-kmod] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.15.0-36-generic'
Makefile:21: recipe for target 'all' failed
make: *** [all] Error 2


[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