[vbox-dev] Kernel modules do not build with linux kernel 5.10-rc4

Sérgio Basto sergio at serjux.com
Fri Dec 11 16:41:16 GMT 2020


On Tue, 2020-12-08 at 19:06 +0100, Hans-Peter Jansen wrote:
> Am Montag, 30. November 2020, 02:16:42 CET schrieb Sérgio Basto:
> > Hi,
> > As described in ticket 20055 [1] alloc_vm_area was removed from
> > kernel
> > and we just need to replace one alloc_vm_area in VirtualBox code
> > ...
> > Please provide a fix, kernel 5.10 should be released in a few time
> > ,
> > because 5.10-rc6 was released today .
> > 
> > Thank you.
> > 
> > [1]
> > https://www.virtualbox.org/ticket/20055#comment:2
> 
> Added two more patches to this ticket, but still failing.
> 
> With all thee patches applied, if fails now with:
> 
> 
> [  180s] /home/abuild/rpmbuild/BUILD/VirtualBox-
> 6.1.16/modules_build_dir/
> default/vboxvideo/vbox_ttm.c:176:21: error:
> 'TTM_MEMTYPE_FLAG_MAPPABLE' 
> undeclared (first use in this function)
> [  180s]   176 |  if (!(man->flags & TTM_MEMTYPE_FLAG_MAPPABLE))
> [  180s]       |                     ^~~~~~~~~~~~~~~~~~~~~~~~~
> [  180s] /home/abuild/rpmbuild/BUILD/VirtualBox-
> 6.1.16/modules_build_dir/
> default/vboxvideo/vbox_ttm.c:178:13: error: invalid use of undefined
> type 
> 'struct ttm_mem_reg'
> [  180s]   178 |  switch (mem->mem_type) {
> [  180s]       |             ^~
> [  180s] /home/abuild/rpmbuild/BUILD/VirtualBox-
> 6.1.16/modules_build_dir/
> default/vboxvideo/vbox_ttm.c:183:6: error: invalid use of undefined
> type 
> 'struct ttm_mem_reg'
> [  180s]   183 |   mem->bus.offset = mem->start << PAGE_SHIFT;
> [  180s]       |      ^~
> [  180s] /home/abuild/rpmbuild/BUILD/VirtualBox-
> 6.1.16/modules_build_dir/
> default/vboxvideo/vbox_ttm.c:183:24: error: invalid use of undefined
> type 
> 'struct ttm_mem_reg'
> [  180s]   183 |   mem->bus.offset = mem->start << PAGE_SHIFT;
> [  180s]       |                        ^~
> [  180s] /home/abuild/rpmbuild/BUILD/VirtualBox-
> 6.1.16/modules_build_dir/
> default/vboxvideo/vbox_ttm.c:184:6: error: invalid use of undefined
> type 
> 'struct ttm_mem_reg'
> [  180s]   184 |   mem->bus.base = pci_resource_start(vbox->dev-
> >pdev, 0);
> [  180s]       |      ^~
> [  180s] /home/abuild/rpmbuild/BUILD/VirtualBox-
> 6.1.16/modules_build_dir/
> default/vboxvideo/vbox_ttm.c:185:6: error: invalid use of undefined
> type 
> 'struct ttm_mem_reg'
> [  180s]   185 |   mem->bus.is_iomem = true;
> [  180s]       |      ^~
> [  180s] /home/abuild/rpmbuild/BUILD/VirtualBox-
> 6.1.16/modules_build_dir/
> default/vboxvideo/vbox_ttm.c: At top level:
> [  180s] /home/abuild/rpmbuild/BUILD/VirtualBox-
> 6.1.16/modules_build_dir/
> default/vboxvideo/vbox_ttm.c:194:13: warning: 'struct ttm_mem_reg'
> declared 
> inside parameter list will not be visible outside of this definition
> or 
> declaration
> [  180s]   194 |      struct ttm_mem_reg *mem)
> [  180s]       |             ^~~~~~~~~~~
> [  180s] /home/abuild/rpmbuild/BUILD/VirtualBox-
> 6.1.16/modules_build_dir/
> default/vboxvideo/vbox_ttm.c:204:15: error: variable
> 'vbox_tt_backend_func' 
> has initializer but incomplete type
> [  180s]   204 | static struct ttm_backend_func vbox_tt_backend_func
> = {
> [  180s]       |               ^~~~~~~~~~~~~~~~
> [  180s] /home/abuild/rpmbuild/BUILD/VirtualBox-
> 6.1.16/modules_build_dir/
> default/vboxvideo/vbox_ttm.c:205:3: error: 'struct ttm_backend_func'
> has no 
> member named 'destroy'
> [  180s]   205 |  .destroy = &vbox_ttm_backend_destroy,
> [  180s]       |   ^~~~~~~
> [  180s] /home/abuild/rpmbuild/BUILD/VirtualBox-
> 6.1.16/modules_build_dir/
> default/vboxvideo/vbox_ttm.c:205:13: warning: excess elements in
> struct 
> initializer
> [  180s]   205 |  .destroy = &vbox_ttm_backend_destroy,
> [  180s]       |             ^
> [  180s] /home/abuild/rpmbuild/BUILD/VirtualBox-
> 6.1.16/modules_build_dir/
> default/vboxvideo/vbox_ttm.c:205:13: note: (near initialization for 
> 'vbox_tt_backend_func')
> [  180s] /home/abuild/rpmbuild/BUILD/VirtualBox-
> 6.1.16/modules_build_dir/
> default/vboxvideo/vbox_ttm.c: In function 'vbox_ttm_tt_create':
> [  180s] /home/abuild/rpmbuild/BUILD/VirtualBox-
> 6.1.16/modules_build_dir/
> default/vboxvideo/vbox_ttm.c:224:4: error: 'struct ttm_tt' has no
> member named 
> 'func'
> [  180s]   224 |  tt->func = &vbox_tt_backend_func;
> [  180s]       |    ^~
> [  180s] /home/abuild/rpmbuild/BUILD/VirtualBox-
> 6.1.16/modules_build_dir/
> default/vboxvideo/vbox_ttm.c: At top level:
> [  180s] /home/abuild/rpmbuild/BUILD/VirtualBox-
> 6.1.16/modules_build_dir/
> default/vboxvideo/vbox_ttm.c:263:3: error: 'struct ttm_bo_driver' has
> no 
> member named 'init_mem_type'
> [  180s]   263 |  .init_mem_type = vbox_bo_init_mem_type,
> [  180s]       |   ^~~~~~~~~~~~~
> [  180s] /home/abuild/rpmbuild/BUILD/VirtualBox-
> 6.1.16/modules_build_dir/
> default/vboxvideo/vbox_ttm.c:263:19: error: initialization of 'int
> (*)(struct 
> ttm_bo_device *, struct ttm_tt *, struct ttm_operation_ctx *)' from 
> incompatible pointer type 'int (*)(struct ttm_bo_device *,
> u32,  struct 
> ttm_mem_type_manager *)' {aka 'int (*)(struct ttm_bo_device *,
> unsigned int,  
> struct ttm_mem_type_manager *)'} [-Werror=incompatible-pointer-types]
> [  180s]   263 |  .init_mem_type = vbox_bo_init_mem_type,
> [  180s]       |                   ^~~~~~~~~~~~~~~~~~~~~
> [  180s] /home/abuild/rpmbuild/BUILD/VirtualBox-
> 6.1.16/modules_build_dir/
> default/vboxvideo/vbox_ttm.c:263:19: note: (near initialization for 
> 'vbox_bo_driver.ttm_tt_populate')
> [  180s] /home/abuild/rpmbuild/BUILD/VirtualBox-
> 6.1.16/modules_build_dir/
> default/vboxvideo/vbox_ttm.c:269:20: error: initialization of 'int
> (*)(struct 
> ttm_bo_device *, struct ttm_resource *)' from incompatible pointer
> type 'int 
> (*)(struct ttm_bo_device *, struct ttm_mem_reg *)' [-
> Werror=incompatible-
> pointer-types]
> [  180s]   269 |  .io_mem_reserve = &vbox_ttm_io_mem_reserve,
> [  180s]       |                    ^
> [  180s] /home/abuild/rpmbuild/BUILD/VirtualBox-
> 6.1.16/modules_build_dir/
> default/vboxvideo/vbox_ttm.c:269:20: note: (near initialization for 
> 'vbox_bo_driver.io_mem_reserve')
> [  180s] /home/abuild/rpmbuild/BUILD/VirtualBox-
> 6.1.16/modules_build_dir/
> default/vboxvideo/vbox_ttm.c:270:17: error: initialization of 'void
> (*)(struct 
> ttm_bo_device *, struct ttm_resource *)' from incompatible pointer
> type 'void 
> (*)(struct ttm_bo_device *, struct ttm_mem_reg *)' [-
> Werror=incompatible-
> pointer-types]
> [  180s]   270 |  .io_mem_free = &vbox_ttm_io_mem_free,
> [  180s]       |                 ^
> 
> 
> [  180s] /home/abuild/rpmbuild/BUILD/VirtualBox-
> 6.1.16/modules_build_dir/
> default/vboxvideo/vbox_ttm.c: In function 'vbox_mm_init':
> [  180s] /home/abuild/rpmbuild/BUILD/VirtualBox-
> 6.1.16/modules_build_dir/
> default/vboxvideo/vbox_ttm.c:316:8: error: implicit declaration of
> function 
> 'ttm_bo_init_mm'; did you mean 'ttm_bo_evict_mm'? [-Werror=implicit-
> function-
> declaration]
> [  180s]   316 |  ret = ttm_bo_init_mm(bdev, TTM_PL_VRAM,
> [  180s]       |        ^~~~~~~~~~~~~~
> [  180s]       |        ttm_bo_evict_mm
> [  180s] /home/abuild/rpmbuild/BUILD/VirtualBox-
> 6.1.16/modules_build_dir/
> default/vboxvideo/vbox_ttm.c: At top level:
> [  180s] /home/abuild/rpmbuild/BUILD/VirtualBox-
> 6.1.16/modules_build_dir/
> default/vboxvideo/vbox_ttm.c:204:32: error: storage size of 
> 'vbox_tt_backend_func' isn't known
> [  180s]   204 | static struct ttm_backend_func vbox_tt_backend_func
> = {
> [  180s]       |                                ^~~~~~~~~~~~~~~~~~~~
> [  180s] cc1: some warnings being treated as errors
> [  180s] make[2]: *** [/usr/src/linux-5.10.0-rc6-
> 8/scripts/Makefile.build:284: 
> /home/abuild/rpmbuild/BUILD/VirtualBox-
> 6.1.16/modules_build_dir/default/
> vboxvideo/vbox_ttm.o] Error 1
> 
> and yes, ttm_bo_init_mm was removed by commit 
> 98399abd52b234b82457ef6c40c41543d806d3b7, haven't investigated the
> other 
> issues.
> 
> Looks, like we will have another kernel release without an
> operational VB.


vboxvideo.ko is provided in the vanilla kernel for more than two years.
So you don't need compile vboxvideo anymore . 



> Pete
> 
> 
> 
> _______________________________________________
> vbox-dev mailing list
> vbox-dev at virtualbox.org
> https://www.virtualbox.org/mailman/listinfo/vbox-dev
-- 
Sérgio M. B.




More information about the vbox-dev mailing list