LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   KVM Build Error (https://www.linuxquestions.org/questions/slackware-14/kvm-build-error-851818/)

2handband 12-22-2010 09:56 AM

KVM Build Error
 
I'm trying to build KVM from the Slackbuilds.org package and the build is ending with this:

Code:

make -C /lib/modules/2.6.33.4/build M=`pwd` \
                LINUXINCLUDE="-I`pwd`/include -Iinclude \
                -Iarch/x86/include -I`pwd`/include-compat \
                -include include/linux/autoconf.h \
                -include `pwd`/x86/external-module-compat.h " \
                "$@"
  LD      /tmp/SBo/kvm-88/kvm/kernel/x86/built-in.o
  CC [M]  /tmp/SBo/kvm-88/kvm/kernel/x86/svm.o
cc1: error: include/linux/autoconf.h: No such file or directory
In file included from /tmp/SBo/kvm-88/kvm/kernel/include/asm/kvm_para.h:89,
                from /tmp/SBo/kvm-88/kvm/kernel/include/linux/kvm_para.h:63,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/../external-module-compat-comm.h:14,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/external-module-compat.h:16,
                from <command-line>:0:
arch/x86/include/asm/processor.h:117: error: 'CONFIG_X86_L1_CACHE_SHIFT' undeclared here (not in a function)
arch/x86/include/asm/processor.h:117: error: requested alignment is not a constant
In file included from /tmp/SBo/kvm-88/kvm/kernel/include/asm/kvm_para.h:89,
                from /tmp/SBo/kvm-88/kvm/kernel/include/linux/kvm_para.h:63,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/../external-module-compat-comm.h:14,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/external-module-compat.h:16,
                from <command-line>:0:
arch/x86/include/asm/processor.h:163:1: warning: "cache_line_size" redefined
In file included from arch/x86/include/asm/processor.h:28,
                from /tmp/SBo/kvm-88/kvm/kernel/include/asm/kvm_para.h:89,
                from /tmp/SBo/kvm-88/kvm/kernel/include/linux/kvm_para.h:63,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/../external-module-compat-comm.h:14,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/external-module-compat.h:16,
                from <command-line>:0:
include/linux/cache.h:64:1: warning: this is the location of the previous definition
arch/x86/include/asm/processor.h:243: error: requested alignment is not a constant
arch/x86/include/asm/processor.h:274: error: requested alignment is not a constant
arch/x86/include/asm/processor.h: In function 'wbinvd_halt':
arch/x86/include/asm/processor.h:790: error: implicit declaration of function 'halt'
In file included from arch/x86/include/asm/atomic.h:4,
                from include/linux/sysfs.h:18,
                from include/linux/kobject.h:21,
                from include/linux/sysdev.h:24,
                from include/linux/cpu.h:22,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/../external-module-compat-comm.h:15,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/external-module-compat.h:16,
                from <command-line>:0:
arch/x86/include/asm/atomic_64.h: At top level:
arch/x86/include/asm/atomic_64.h:201: warning: type defaults to 'int' in declaration of 'atomic64_t'
arch/x86/include/asm/atomic_64.h:201: error: expected ';', ',' or ')' before '*' token
arch/x86/include/asm/atomic_64.h:213: error: expected ')' before '*' token
arch/x86/include/asm/atomic_64.h:225: error: expected declaration specifiers or '...' before 'atomic64_t'
arch/x86/include/asm/atomic_64.h: In function 'atomic64_add':
arch/x86/include/asm/atomic_64.h:228: error: 'v' undeclared (first use in this function)
arch/x86/include/asm/atomic_64.h:228: error: (Each undeclared identifier is reported only once
arch/x86/include/asm/atomic_64.h:228: error: for each function it appears in.)
arch/x86/include/asm/atomic_64.h:227: error: invalid lvalue in asm output 0
arch/x86/include/asm/atomic_64.h:227: error: memory input 2 is not directly addressable
arch/x86/include/asm/atomic_64.h: At top level:
arch/x86/include/asm/atomic_64.h:239: error: expected declaration specifiers or '...' before 'atomic64_t'
arch/x86/include/asm/atomic_64.h: In function 'atomic64_sub':
arch/x86/include/asm/atomic_64.h:242: error: 'v' undeclared (first use in this function)
arch/x86/include/asm/atomic_64.h:241: error: invalid lvalue in asm output 0
arch/x86/include/asm/atomic_64.h:241: error: memory input 2 is not directly addressable
arch/x86/include/asm/atomic_64.h: At top level:
arch/x86/include/asm/atomic_64.h:255: error: expected declaration specifiers or '...' before 'atomic64_t'
arch/x86/include/asm/atomic_64.h: In function 'atomic64_sub_and_test':
arch/x86/include/asm/atomic_64.h:260: error: 'v' undeclared (first use in this function)
arch/x86/include/asm/atomic_64.h:259: error: invalid lvalue in asm output 0
arch/x86/include/asm/atomic_64.h:259: error: memory input 3 is not directly addressable
arch/x86/include/asm/atomic_64.h: At top level:
arch/x86/include/asm/atomic_64.h:271: error: expected ')' before '*' token
arch/x86/include/asm/atomic_64.h:284: error: expected ')' before '*' token
arch/x86/include/asm/atomic_64.h:299: error: expected ')' before '*' token
arch/x86/include/asm/atomic_64.h:317: error: expected ')' before '*' token
arch/x86/include/asm/atomic_64.h:336: error: expected declaration specifiers or '...' before 'atomic64_t'
arch/x86/include/asm/atomic_64.h: In function 'atomic64_add_negative':
arch/x86/include/asm/atomic_64.h:341: error: 'v' undeclared (first use in this function)
arch/x86/include/asm/atomic_64.h:340: error: invalid lvalue in asm output 0
arch/x86/include/asm/atomic_64.h:340: error: memory input 3 is not directly addressable
arch/x86/include/asm/atomic_64.h: At top level:
arch/x86/include/asm/atomic_64.h:353: error: expected declaration specifiers or '...' before 'atomic64_t'
arch/x86/include/asm/atomic_64.h: In function 'atomic64_add_return':
arch/x86/include/asm/atomic_64.h:357: error: 'v' undeclared (first use in this function)
arch/x86/include/asm/atomic_64.h:356: error: invalid lvalue in asm output 1
arch/x86/include/asm/atomic_64.h:356: error: memory input 3 is not directly addressable
arch/x86/include/asm/atomic_64.h: At top level:
arch/x86/include/asm/atomic_64.h:362: error: expected declaration specifiers or '...' before 'atomic64_t'
arch/x86/include/asm/atomic_64.h: In function 'atomic64_sub_return':
arch/x86/include/asm/atomic_64.h:364: error: 'v' undeclared (first use in this function)
arch/x86/include/asm/atomic_64.h:364: error: too many arguments to function 'atomic64_add_return'
arch/x86/include/asm/atomic_64.h: At top level:
arch/x86/include/asm/atomic_64.h:370: error: expected ')' before '*' token
arch/x86/include/asm/atomic_64.h:375: error: expected ')' before '*' token
arch/x86/include/asm/atomic_64.h:425: error: expected ')' before '*' token
In file included from include/linux/kobject.h:23,
                from include/linux/sysdev.h:24,
                from include/linux/cpu.h:22,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/../external-module-compat-comm.h:15,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/external-module-compat.h:16,
                from <command-line>:0:
include/linux/spinlock.h: In function 'spin_lock_irq':
include/linux/spinlock.h:306: error: implicit declaration of function 'local_irq_disable'
include/linux/spinlock.h: In function 'spin_unlock_irq':
include/linux/spinlock.h:331: error: implicit declaration of function 'local_irq_enable'
include/linux/spinlock.h: In function 'spin_unlock_irqrestore':
include/linux/spinlock.h:336: error: implicit declaration of function 'local_irq_restore'
In file included from include/linux/mmzone.h:16,
                from include/linux/gfp.h:4,
                from include/linux/kmod.h:22,
                from include/linux/module.h:13,
                from include/linux/sysdev.h:25,
                from include/linux/cpu.h:22,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/../external-module-compat-comm.h:15,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/external-module-compat.h:16,
                from <command-line>:0:
include/linux/nodemask.h: In function '__first_node':
include/linux/nodemask.h:239: error: implicit declaration of function 'find_first_bit'
include/linux/nodemask.h: In function '__next_node':
include/linux/nodemask.h:245: error: implicit declaration of function 'find_next_bit'
include/linux/nodemask.h: In function '__first_unset_node':
include/linux/nodemask.h:268: error: implicit declaration of function 'find_first_zero_bit'
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 /tmp/SBo/kvm-88/kvm/kernel/x86/../external-module-compat-comm.h:15,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/external-module-compat.h:16,
                from <command-line>:0:
include/linux/rcupdate.h:71:2: error: #error "Unknown RCU implementation specified to kernel configuration"
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 /tmp/SBo/kvm-88/kvm/kernel/x86/../external-module-compat-comm.h:15,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/external-module-compat.h:16,
                from <command-line>:0:
include/linux/rcupdate.h: In function 'rcu_read_lock':
include/linux/rcupdate.h:121: error: implicit declaration of function '__rcu_read_lock'
include/linux/rcupdate.h: In function 'rcu_read_unlock':
include/linux/rcupdate.h:145: error: implicit declaration of function '__rcu_read_unlock'
include/linux/rcupdate.h: In function 'rcu_read_lock_bh':
include/linux/rcupdate.h:161: error: implicit declaration of function '__rcu_read_lock_bh'
include/linux/rcupdate.h: In function 'rcu_read_unlock_bh':
include/linux/rcupdate.h:175: error: implicit declaration of function '__rcu_read_unlock_bh'
In file included from include/linux/slab_def.h:144,
                from include/linux/slab.h:166,
                from include/linux/percpu.h:5,
                from arch/x86/include/asm/local.h:4,
                from include/linux/module.h:20,
                from include/linux/sysdev.h:25,
                from include/linux/cpu.h:22,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/../external-module-compat-comm.h:15,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/external-module-compat.h:16,
                from <command-line>:0:
include/linux/kmalloc_sizes.h:5:5: warning: "CONFIG_X86_L1_CACHE_SHIFT" is not defined
include/linux/kmalloc_sizes.h:9:5: warning: "CONFIG_X86_L1_CACHE_SHIFT" is not defined
In file included from include/linux/ktime.h:25,
                from include/linux/timer.h:5,
                from include/linux/workqueue.h:8,
                from include/linux/pm.h:25,
                from include/linux/sysdev.h:26,
                from include/linux/cpu.h:22,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/../external-module-compat-comm.h:15,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/external-module-compat.h:16,
                from <command-line>:0:
include/linux/jiffies.h:18:5: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:20:7: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:22:7: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:24:7: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:26:7: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:28:7: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:30:7: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:32:7: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:34:7: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:36:7: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:39:3: error: #error Invalid value of HZ.
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: error: division by zero in #if
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: error: division by zero in #if
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: error: division by zero in #if
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: error: division by zero in #if
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: error: division by zero in #if
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: error: division by zero in #if
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: error: division by zero in #if
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: error: division by zero in #if
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: error: division by zero in #if
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: error: division by zero in #if
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: error: division by zero in #if
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: error: division by zero in #if
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: error: division by zero in #if
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: error: division by zero in #if
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: error: division by zero in #if
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: warning: "CONFIG_HZ" is not defined
include/linux/jiffies.h:257:31: error: division by zero in #if
include/linux/jiffies.h:257:46: warning: "SHIFT_HZ" is not defined
In file included from include/linux/sched.h:63,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/../external-module-compat-comm.h:213,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/external-module-compat.h:16,
                from <command-line>:0:
include/linux/mm_types.h:27:5: warning: "CONFIG_SPLIT_PTLOCK_CPUS" is not defined
include/linux/mm_types.h:71:5: warning: "CONFIG_SPLIT_PTLOCK_CPUS" is not defined
In file included from include/linux/sched.h:79,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/../external-module-compat-comm.h:213,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/external-module-compat.h:16,
                from <command-line>:0:
include/linux/proportions.h: In function 'prop_inc_percpu':
include/linux/proportions.h:75: error: implicit declaration of function 'local_irq_save'
In file included from /tmp/SBo/kvm-88/kvm/kernel/x86/../external-module-compat-comm.h:213,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/external-module-compat.h:16,
                from <command-line>:0:
include/linux/sched.h:399:5: warning: "CONFIG_SPLIT_PTLOCK_CPUS" is not defined
In file included from /tmp/SBo/kvm-88/kvm/kernel/x86/../external-module-compat-comm.h:312,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/external-module-compat.h:16,
                from <command-line>:0:
include/linux/mm.h: In function 'virt_to_head_page':
include/linux/mm.h:318: error: implicit declaration of function '__pfn_to_page'
include/linux/mm.h:318: warning: initialization makes pointer from integer without a cast
In file included from /tmp/SBo/kvm-88/kvm/kernel/x86/../external-module-compat-comm.h:312,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/external-module-compat.h:16,
                from <command-line>:0:
include/linux/mm.h: In function 'lowmem_page_address':
include/linux/mm.h:592: error: implicit declaration of function '__page_to_pfn'
In file included from /tmp/SBo/kvm-88/kvm/kernel/x86/../external-module-compat-comm.h:312,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/external-module-compat.h:16,
                from <command-line>:0:
include/linux/mm.h:943:5: warning: "CONFIG_SPLIT_PTLOCK_CPUS" is not defined
In file included from include/linux/hardirq.h:10,
                from include/linux/interrupt.h:12,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/../external-module-compat-comm.h:675,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/external-module-compat.h:16,
                from <command-line>:0:
arch/x86/include/asm/hardirq.h: At top level:
arch/x86/include/asm/hardirq.h:29: error: requested alignment is not a constant
In file included from /tmp/SBo/kvm-88/kvm/kernel/include/linux/kvm_host.h:67,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/svm.c:56:
/tmp/SBo/kvm-88/kvm/kernel/include/asm/kvm_host.h: In function 'page_header':
/tmp/SBo/kvm-88/kvm/kernel/include/asm/kvm_host.h:705: warning: initialization makes pointer from integer without a cast
In file included from /tmp/SBo/kvm-88/kvm/kernel/x86/svm.c:56:
/tmp/SBo/kvm-88/kvm/kernel/include/linux/kvm_host.h: At top level:
/tmp/SBo/kvm-88/kvm/kernel/include/linux/kvm_host.h:209: error: field 'mmu_notifier' has incomplete type
/tmp/SBo/kvm-88/kvm/kernel/x86/svm.c: In function 'svm_hardware_unsetup':
/tmp/SBo/kvm-88/kvm/kernel/x86/svm.c:529: warning: passing argument 1 of '__free_pages' makes pointer from integer without a cast
include/linux/gfp.h:326: note: expected 'struct page *' but argument is of type 'int'
/tmp/SBo/kvm-88/kvm/kernel/x86/svm.c: In function 'svm_free_vcpu':
/tmp/SBo/kvm-88/kvm/kernel/x86/svm.c:758: warning: passing argument 1 of '__free_pages' makes pointer from integer without a cast
include/linux/gfp.h:326: note: expected 'struct page *' but argument is of type 'int'
/tmp/SBo/kvm-88/kvm/kernel/x86/svm.c:759: warning: passing argument 1 of '__free_pages' makes pointer from integer without a cast
include/linux/gfp.h:326: note: expected 'struct page *' but argument is of type 'int'
/tmp/SBo/kvm-88/kvm/kernel/x86/svm.c:760: warning: passing argument 1 of '__free_pages' makes pointer from integer without a cast
include/linux/gfp.h:326: note: expected 'struct page *' but argument is of type 'int'
/tmp/SBo/kvm-88/kvm/kernel/x86/svm.c:761: warning: passing argument 1 of '__free_pages' makes pointer from integer without a cast
include/linux/gfp.h:326: note: expected 'struct page *' but argument is of type 'int'
make[4]: *** [/tmp/SBo/kvm-88/kvm/kernel/x86/svm.o] Error 1
make[3]: *** [/tmp/SBo/kvm-88/kvm/kernel/x86] Error 2
make[2]: *** [_module_/tmp/SBo/kvm-88/kvm/kernel] Error 2
make[1]: *** [all] Error 2
make: *** [kvm-kmod] Error 2

Am I doing something stupid?

ponce 12-22-2010 09:59 AM

no, it's only that kvm-88 is old, you have to use qemu-kvm.

the kvm kernel modules should be already included with slackware kernel.

Ramurd 12-22-2010 10:18 AM

What ponce said.

Read:
http://www.linux-kvm.org/page/HOWTO1
and know:
1) Slack kernel has the headers, you should be fine there.
2) Don't forget to enable virtualisation in your bios or you'll have terribly slow emulation

or... the almighty Alien Bob has some nice packages:
http://connie.slackware.com/~alien/s...ilds/qemu-kvm/
Alien Bob did an excellent writeup on his wiki as well about Qemu and VDE networking. Readup here: http://wiki.alienbase.nl/doku.php?id=slackware:vde
Follow his guidance and be awed that the world of virtualization has become as simple as that.

guanx 12-22-2010 10:22 AM

The kvm-88 builds fine if you just change the makefile to not build the kernel module. Or in other words, just build the the userspace program. I am using it myself. Here is the modified version:
http://hera.ph1.uni-koeln.de/ftpspac.../kvm-88.tar.gz

When started by the qemu-kvm, my Windows detects that my computer (actually the virtual machine) changed (from kvm to qemu) and stops working. The evil Microsoft! I will use pirate versions of Windows in the future! A legal copy is too troublesome.


All times are GMT -5. The time now is 04:35 PM.