* KVM Build error with 2.6.26
@ 2008-09-18 3:17 Xu, Jiajun
2008-09-18 8:25 ` Jan Kiszka
0 siblings, 1 reply; 5+ messages in thread
From: Xu, Jiajun @ 2008-09-18 3:17 UTC (permalink / raw)
To: kvm
Hi,
Against latest kvm commit, 9644a6d164e3d6d0532ddb064393293134f31ab2. KVM
compile meet error on 2.6.26.2.
[root@kvm-build kernel]# make
rm -f include/asm
ln -sf asm-x86 include/asm
ln -sf asm-x86 include-compat/asm
make -C /lib/modules/2.6.26.2/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"
make[1]: Entering directory `/usr/src/redhat/BUILD/kernel-2.6.26.2'
CC [M] /home/build/gitrepo/test/kvm-userspace/kernel/x86/kvm_main.o
/home/build/gitrepo/test/kvm-userspace/kernel/x86/kvm_main.c: In
function 'gfn_to_pfn':
/home/build/gitrepo/test/kvm-userspace/kernel/x86/kvm_main.c:742: error:
implicit declaration of function 'get_user_pages_fast'
make[3]: ***
[/home/build/gitrepo/test/kvm-userspace/kernel/x86/kvm_main.o] Error 1
make[2]: *** [/home/build/gitrepo/test/kvm-userspace/kernel/x86] Error 2
make[1]: *** [_module_/home/build/gitrepo/test/kvm-userspace/kernel]
Error 2
make[1]: Leaving directory `/usr/src/redhat/BUILD/kernel-2.6.26.2'
Best Regards
Jiajun
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: KVM Build error with 2.6.26
2008-09-18 3:17 KVM Build error with 2.6.26 Xu, Jiajun
@ 2008-09-18 8:25 ` Jan Kiszka
2008-09-18 16:33 ` [PATCH] add compat wrapper for get_user_pages_fast Jan Kiszka
0 siblings, 1 reply; 5+ messages in thread
From: Jan Kiszka @ 2008-09-18 8:25 UTC (permalink / raw)
To: Xu, Jiajun; +Cc: kvm, Marcelo Tosatti
Xu, Jiajun wrote:
> Hi,
> Against latest kvm commit, 9644a6d164e3d6d0532ddb064393293134f31ab2. KVM
> compile meet error on 2.6.26.2.
>
> [root@kvm-build kernel]# make
> rm -f include/asm
> ln -sf asm-x86 include/asm
> ln -sf asm-x86 include-compat/asm
> make -C /lib/modules/2.6.26.2/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"
> make[1]: Entering directory `/usr/src/redhat/BUILD/kernel-2.6.26.2'
> CC [M] /home/build/gitrepo/test/kvm-userspace/kernel/x86/kvm_main.o
> /home/build/gitrepo/test/kvm-userspace/kernel/x86/kvm_main.c: In
> function 'gfn_to_pfn':
> /home/build/gitrepo/test/kvm-userspace/kernel/x86/kvm_main.c:742: error:
> implicit declaration of function 'get_user_pages_fast'
> make[3]: ***
> [/home/build/gitrepo/test/kvm-userspace/kernel/x86/kvm_main.o] Error 1
> make[2]: *** [/home/build/gitrepo/test/kvm-userspace/kernel/x86] Error 2
> make[1]: *** [_module_/home/build/gitrepo/test/kvm-userspace/kernel]
> Error 2
> make[1]: Leaving directory `/usr/src/redhat/BUILD/kernel-2.6.26.2'
>
I can confirm this bug. Looks like Marcelo's get_user_pages_fast patches
lack corresponding compat wrapping (in kvm-userspace)...
Jan
--
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] add compat wrapper for get_user_pages_fast
2008-09-18 8:25 ` Jan Kiszka
@ 2008-09-18 16:33 ` Jan Kiszka
2008-09-18 22:30 ` Marcelo Tosatti
2008-09-19 23:52 ` Avi Kivity
0 siblings, 2 replies; 5+ messages in thread
From: Jan Kiszka @ 2008-09-18 16:33 UTC (permalink / raw)
Cc: Xu, Jiajun, kvm, Marcelo Tosatti, Avi Kivity
Jan Kiszka wrote:
> Xu, Jiajun wrote:
>> Hi,
>> Against latest kvm commit, 9644a6d164e3d6d0532ddb064393293134f31ab2. KVM
>> compile meet error on 2.6.26.2.
>>
>> [root@kvm-build kernel]# make
>> rm -f include/asm
>> ln -sf asm-x86 include/asm
>> ln -sf asm-x86 include-compat/asm
>> make -C /lib/modules/2.6.26.2/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"
>> make[1]: Entering directory `/usr/src/redhat/BUILD/kernel-2.6.26.2'
>> CC [M] /home/build/gitrepo/test/kvm-userspace/kernel/x86/kvm_main.o
>> /home/build/gitrepo/test/kvm-userspace/kernel/x86/kvm_main.c: In
>> function 'gfn_to_pfn':
>> /home/build/gitrepo/test/kvm-userspace/kernel/x86/kvm_main.c:742: error:
>> implicit declaration of function 'get_user_pages_fast'
>> make[3]: ***
>> [/home/build/gitrepo/test/kvm-userspace/kernel/x86/kvm_main.o] Error 1
>> make[2]: *** [/home/build/gitrepo/test/kvm-userspace/kernel/x86] Error 2
>> make[1]: *** [_module_/home/build/gitrepo/test/kvm-userspace/kernel]
>> Error 2
>> make[1]: Leaving directory `/usr/src/redhat/BUILD/kernel-2.6.26.2'
>>
>
> I can confirm this bug. Looks like Marcelo's get_user_pages_fast patches
> lack corresponding compat wrapping (in kvm-userspace)...
Not sure if this is correct, but here is at least a compile fix.
Note that the original mmem_map locking scope was partly far broader on
older kernels than with Marcelo's patch and this fix now. Could anyone
comment on the correctness?
---------
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
kernel/external-module-compat-comm.h | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
Index: b/kernel/external-module-compat-comm.h
===================================================================
--- a/kernel/external-module-compat-comm.h
+++ b/kernel/external-module-compat-comm.h
@@ -531,3 +531,20 @@ struct pci_dev;
struct pci_dev *pci_get_bus_and_slot(unsigned int bus, unsigned int devfn);
#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+
+static inline int get_user_pages_fast(unsigned long start, int nr_pages,
+ int write, struct page **pages)
+{
+ int npages;
+
+ down_read(¤t->mm->mmap_sem);
+ npages = get_user_pages(current, current->mm, start, nr_pages, write,
+ 0, pages, NULL);
+ up_read(¤t->mm->mmap_sem);
+
+ return npages;
+}
+
+#endif
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] add compat wrapper for get_user_pages_fast
2008-09-18 16:33 ` [PATCH] add compat wrapper for get_user_pages_fast Jan Kiszka
@ 2008-09-18 22:30 ` Marcelo Tosatti
2008-09-19 23:52 ` Avi Kivity
1 sibling, 0 replies; 5+ messages in thread
From: Marcelo Tosatti @ 2008-09-18 22:30 UTC (permalink / raw)
To: Jan Kiszka; +Cc: Xu, Jiajun, kvm, Avi Kivity
On Thu, Sep 18, 2008 at 06:33:04PM +0200, Jan Kiszka wrote:
> Not sure if this is correct, but here is at least a compile fix.
Looks good.
> Note that the original mmem_map locking scope was partly far broader on
> older kernels than with Marcelo's patch and this fix now. Could anyone
> comment on the correctness?
I think all cases have been covered (vma manipulation, find_vma
callers).
>
> ---------
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> kernel/external-module-compat-comm.h | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> Index: b/kernel/external-module-compat-comm.h
> ===================================================================
> --- a/kernel/external-module-compat-comm.h
> +++ b/kernel/external-module-compat-comm.h
> @@ -531,3 +531,20 @@ struct pci_dev;
> struct pci_dev *pci_get_bus_and_slot(unsigned int bus, unsigned int devfn);
>
> #endif
> +
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
> +
> +static inline int get_user_pages_fast(unsigned long start, int nr_pages,
> + int write, struct page **pages)
> +{
> + int npages;
> +
> + down_read(¤t->mm->mmap_sem);
> + npages = get_user_pages(current, current->mm, start, nr_pages, write,
> + 0, pages, NULL);
> + up_read(¤t->mm->mmap_sem);
> +
> + return npages;
> +}
> +
> +#endif
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] add compat wrapper for get_user_pages_fast
2008-09-18 16:33 ` [PATCH] add compat wrapper for get_user_pages_fast Jan Kiszka
2008-09-18 22:30 ` Marcelo Tosatti
@ 2008-09-19 23:52 ` Avi Kivity
1 sibling, 0 replies; 5+ messages in thread
From: Avi Kivity @ 2008-09-19 23:52 UTC (permalink / raw)
To: Jan Kiszka; +Cc: Xu, Jiajun, kvm, Marcelo Tosatti, Avi Kivity
Jan Kiszka wrote:
> Not sure if this is correct, but here is at least a compile fix.
>
>
I think it is.
> Note that the original mmem_map locking scope was partly far broader on
> older kernels than with Marcelo's patch and this fix now. Could anyone
> comment on the correctness?
>
Since get_user_pages_fast() falls back to your code sequence, this is at
least as safe as mainline. So I applied it, thanks.
--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-09-19 23:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-18 3:17 KVM Build error with 2.6.26 Xu, Jiajun
2008-09-18 8:25 ` Jan Kiszka
2008-09-18 16:33 ` [PATCH] add compat wrapper for get_user_pages_fast Jan Kiszka
2008-09-18 22:30 ` Marcelo Tosatti
2008-09-19 23:52 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox