VirtualBox

Ticket #18869 (closed defect: fixed)

Opened 3 months ago

Last modified 13 days ago

vbox_ttm.c - header file nit in include directive

Reported by: fbatschu Owned by:
Component: guest additions Version: VirtualBox 6.0.10
Keywords: drm header file Cc:
Guest type: Linux Host type: Linux

Description (last modified by fbatschu) (diff)

From: "Gianfranco Costamagna" <> To: "VirtualBox Developer's List" <>

Subject: [vbox-dev] kernel 5.2 build fix [PATCH] Date: Mon, 26 Aug 2019 12:02:26 +0200

Hello, for some reasons, see [1] virtualbox doesn't build its kernel modules correctly on some configurations...The following patch fixes the issue

+--- virtualbox-6.0.10-dfsg.orig/src/VBox/Additions/linux/drm/vbox_ttm.c
++++ virtualbox-6.0.10-dfsg/src/VBox/Additions/linux/drm/vbox_ttm.c
+@@ -33,7 +33,7 @@
+  *          Michael Thayer <>
+  */
+ #include "vbox_drv.h"
+-#include <ttm/ttm_page_alloc.h>
++#include <drm/ttm/ttm_page_alloc.h>
+
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) && !defined(RHEL_72)
+ #define PLACEMENT_FLAGS(placement) (placement)

please apply(you are not supposed to think that kernel is exporting -Iinclude/drm directory, and in all the other places it is not included that way)

see for comparison:src/VBox/Additions/linux/drm/vbox_drv.h:#include  
<drm/ttm/ttm_bo_api.h>
src/VBox/Additions/linux/drm/vbox_drv.h:#include <drm/ttm/ttm_bo_driver.h>
src/VBox/Additions/linux/drm/vbox_drv.h:#include <drm/ttm/ttm_placement.h>
src/VBox/Additions/linux/drm/vbox_drv.h:#include <drm/ttm/ttm_memory.h>
src/VBox/Additions/linux/drm/vbox_drv.h:#include <drm/ttm/ttm_module.h>

MIT licensed, as usual G. [1]  https://bugs.debian.org/934483

https://www.virtualbox.org/pipermail/vbox-dev/2019-August/015323.html

Change History

comment:1 Changed 3 months ago by fbatschu

  • Description modified (diff)

comment:2 Changed 3 months ago by fbatschu

  • Owner set to fbatschu
  • Status changed from new to accepted

comment:3 Changed 3 months ago by fbatschu

  • Description modified (diff)

comment:4 Changed 3 months ago by fbatschu

suggested fix:

VBox/Trunk fbatschu@hpbox trunk $ svn diff
Index: src/VBox/Additions/linux/drm/vbox_ttm.c
===================================================================
--- src/VBox/Additions/linux/drm/vbox_ttm.c	(revision 132923)
+++ src/VBox/Additions/linux/drm/vbox_ttm.c	(working copy)
@@ -33,7 +33,7 @@
  *          Michael Thayer <michael.thayer@oracle.com>
  */
 #include "vbox_drv.h"
-#include <ttm/ttm_page_alloc.h>
+#include <drm/ttm/ttm_page_alloc.h>
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) && !defined(RHEL_72)
 #define PLACEMENT_FLAGS(placement) (placement)
Last edited 3 months ago by fbatschu (previous) (diff)

comment:5 Changed 3 months ago by fbatschu

The problem has already been fixed in Trunk and 6.0 branch in a different way by changing the corresponding VBOX makefile:

src/VBox/Additions/linux/drm/Makefile.module.kms 

-- 51	 	        include/drm
-- 52	 	## @todo r=bird: -Iinclude/drm is ambigious.
++ 	51	        $(KERN_INCL)/drm

with Changeset 132724.

this will also be backported to the 5.2 branch.

closing bug as fixed.

comment:6 Changed 3 months ago by fbatschu

  • Status changed from accepted to closed
  • Resolution set to fixed

comment:7 Changed 5 weeks ago by fbatschu

From: "Gianfranco Costamagna" <> To: vbox-dev@… Subject: Re: [vbox-dev] [PATCH] drm vbox_ttm build fix Date: Sat, 19 Oct 2019 13:57:10 +0200

Hello Frank,

src/VBox/Additions/linux/drm/vbox_drv.h:#include <drm/ttm/ttm_bo_api.h>
src/VBox/Additions/linux/drm/vbox_drv.h:#include <drm/ttm/ttm_bo_driver.h>
src/VBox/Additions/linux/drm/vbox_drv.h:#include <drm/ttm/ttm_placement.h>
src/VBox/Additions/linux/drm/vbox_drv.h:#include <drm/ttm/ttm_memory.h>
src/VBox/Additions/linux/drm/vbox_drv.h:#include <drm/ttm/ttm_module.h>
src/VBox/Additions/linux/drm/vbox_ttm.c:#include <ttm/ttm_page_alloc.h>

while the workaround might work for you, it has 2+ issues:1) it makes the includes not consistent across the code2) it is not what kernel developers suggest to do3) breaks other build systems using standard tools to build kernel modules(e.g. Debian dkms, and Yocto builds) can you please also apply the patch? thanks!

Il giovedì 17 ottobre 2019, 13:30:38 CEST, Frank Batschulat <> ha scritto:

Gianfranco, pls. refer to

https://www.virtualbox.org/ticket/18869

On 17.10.19 12:51, Gianfranco Costamagna wrote:

Hello, this patch was already acked but seems to have missed the 6.0.14 release Bug-Debian:  https://bugs.debian.org/934483 Last-Update: 2019-08-21

> --- virtualbox-6.0.10-dfsg.orig/src/VBox/Additions/linux/drm/vbox_ttm.c
> +++ virtualbox-6.0.10-dfsg/src/VBox/Additions/linux/drm/vbox_ttm.c
> @@ -33,7 +33,7 @@
>     *          Michael Thayer <michael.thayer@oracle.com>
>     */
>    #include "vbox_drv.h"
> -#include <ttm/ttm_page_alloc.h>
> +#include <drm/ttm/ttm_page_alloc.h>
>
>    #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) && !defined(RHEL_72)
>    #define PLACEMENT_FLAGS(placement) (placement)

MIT licensed, and fixes a build failure with some new kernels, by unifying the include header in all the places thanks Gianfranco

Last edited 5 weeks ago by fbatschu (previous) (diff)

comment:8 Changed 5 weeks ago by fbatschu

re-opening

comment:9 Changed 5 weeks ago by fbatschu

  • Status changed from closed to reopened
  • Resolution fixed deleted

comment:10 Changed 4 weeks ago by fbatschu

  • Owner fbatschu deleted
  • Status changed from reopened to assigned

comment:11 Changed 13 days ago by fbatschu

this has been fixed in trunk with changeset revision: r134528

comment:12 Changed 13 days ago by fbatschu

this has been fixed in the 6.x branch with changeset r134529 and in the 5.2 branch with changeset: r134530

comment:13 Changed 13 days ago by fbatschu

  • Status changed from assigned to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use