Re: compilation on ubuntu 32 bit host?

Avi Kivity
2006-11-10T16:02:46Z

Gildas wrote:
> Hi,
>
> Has anyone managed to compile kvm on an ubuntu 32 bit host? (using the
> tarball kvm-2 available on sourceforge)
>
>

[...]

> gn1@mbp18006i:~/install/kvm-2$ make
> make -C kernel
> make[1]: Entering directory `/home/gn1/install/kvm-2/kernel'
> make -C /lib/modules/`uname -r`/build M=`pwd` "$@"
> make[2]: Entering directory `/usr/src/linux-headers-2.6.15-27-686'
> CC [M] /home/gn1/install/kvm-2/kernel/kvm_main.o
> In file included from /home/gn1/install/kvm-2/kernel/kvm_main.c:18:
> /home/gn1/install/kvm-2/kernel/kvm.h:11:25: error: linux/mutex.h: No
> such file or directory
>
Linux 2.6.15 is pre 'struct mutex'. That turned up in Linux 2.6.16.

If Ubuntu has a kernel update for 2.6.16 or later, you should try that.
If not, you can convert the mutex to a semaphore:

#include <linux/mutex.h> -> #include <asm/semaphore.h>
'struct mutex' -> 'struct semaphore'
'mutex_init()' -> 'init_MUTEX()'
'mutex_lock()' -> 'down()'
'mutex_unlock()' -> 'up()'

Looks like 'struct page::private' has also been renamed.

--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.