Re: compilation on ubuntu 32 bit host?

Avi Kivity
2006-11-10T16:29:25Z

Gildas wrote:
> 2006/11/10, Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>:
>> 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()'
>
> Done, I include a patch with the modifications for those ubuntu users
> out there :)
>

Cool. Once it works I'll post it and link to it from the HOWTO.

>> Looks like 'struct page::private' has also been renamed.
>
> Yes...
> In file included from /home/gn1/install/kvm-2/kernel/kvm_main.c:18:
> /home/gn1/install/kvm-2/kernel/kvm.h: In function 'page_header':
> /home/gn1/install/kvm-2/kernel/kvm.h:377: error: 'struct page' has no
> member named 'private'
>
> What should I change?
>

Look in your include/linux/mm.h, where 'struct page' lived until
recently. It's probably named 'private' but inside some union or
sub-structure.

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