You are not logged in.

#1 2017-12-03 17:33:14

avocadoom
Member
Registered: 2017-04-24
Posts: 12

[SOLVED] Installing Virtualbox DKMS on 4.15.0.rc2 Kernel fails

Hey Community,

in order to use Vagrant, I tried to install Virtualbox under 4.15.0.rc2 Kernel. I typically need this kernel because of the NPT Patch. But when I try to install the DKMS modules, it errors with a bad return status. This is the complete make.log:

DKMS make.log for vboxhost-5.2.2_OSE for kernel 4.15.0-rc2-mainline (x86_64)
So 3. Dez 18:27:10 CET 2017
make: Entering directory '/usr/lib/modules/4.15.0-rc2-mainline/build'
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxnetflt/linux/VBoxNetFlt-linux.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxpci/linux/VBoxPci-linux.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/linux/SUPDrv-linux.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxnetadp/linux/VBoxNetAdp-linux.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxnetflt/VBoxNetFlt.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/SUPDrv.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxpci/VBoxPci.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxnetadp/VBoxNetAdp.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/SUPDrvGip.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxnetflt/SUPR0IdcClient.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxpci/SUPR0IdcClient.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/SUPDrvSem.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxpci/SUPR0IdcClientComponent.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxnetflt/SUPR0IdcClientComponent.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/SUPDrvTracer.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxnetflt/linux/SUPR0IdcClient-linux.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxpci/linux/SUPR0IdcClient-linux.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/SUPLibAll.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/r0drv/alloc-r0drv.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/r0drv/initterm-r0drv.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/r0drv/memobj-r0drv.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/r0drv/mpnotification-r0drv.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/r0drv/powernotification-r0drv.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/r0drv/linux/assert-r0drv-linux.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/r0drv/linux/alloc-r0drv-linux.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/r0drv/linux/initterm-r0drv-linux.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/r0drv/linux/memuserkernel-r0drv-linux.o
/var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/SUPDrvTracer.o: warning: objtool: .text+0x0: unreachable instruction
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/r0drv/linux/mp-r0drv-linux.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/r0drv/linux/mpnotification-r0drv-linux.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/r0drv/linux/process-r0drv-linux.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/r0drv/linux/rtStrFormatKernelAddress-r0drv-linux.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/r0drv/linux/semevent-r0drv-linux.o
  LD [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxnetadp/vboxnetadp.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/r0drv/linux/semeventmulti-r0drv-linux.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/r0drv/linux/semfastmutex-r0drv-linux.o
  LD [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxpci/vboxpci.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/r0drv/linux/semmutex-r0drv-linux.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/r0drv/linux/spinlock-r0drv-linux.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/r0drv/linux/thread-r0drv-linux.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/r0drv/linux/thread2-r0drv-linux.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/r0drv/linux/threadctxhooks-r0drv-linux.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/r0drv/linux/time-r0drv-linux.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/r0drv/linux/timer-r0drv-linux.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/r0drv/generic/semspinmutex-r0drv-generic.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/common/alloc/alloc.o
  LD [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxnetflt/vboxnetflt.o
/var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/r0drv/linux/memuserkernel-r0drv-linux.o: warning: objtool: .fixup: unexpected end of section
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/common/checksum/crc32.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/common/checksum/ipv4.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/common/checksum/ipv6.o
  CC [M]  /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/common/err/RTErrConvertFromErrno.o
/var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/r0drv/linux/timer-r0drv-linux.c: In function ‘VBoxHost_RTTimerCreateEx’:
/var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/r0drv/linux/timer-r0drv-linux.c:1588:13: error: implicit declaration of function ‘init_timer_pinned’; did you mean ‘init_timer_key’? [-Werror=implicit-function-declaration]
             init_timer_pinned(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer);
             ^~~~~~~~~~~~~~~~~
             init_timer_key
/var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/r0drv/linux/timer-r0drv-linux.c:1592:52: error: ‘struct timer_list’ has no member named ‘data’
             pTimer->aSubTimers[iCpu].u.Std.LnxTimer.data        = (unsigned long)&pTimer->aSubTimers[iCpu];
                                                    ^
/var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/r0drv/linux/timer-r0drv-linux.c:1593:65: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
             pTimer->aSubTimers[iCpu].u.Std.LnxTimer.function    = rtTimerLinuxStdCallback;
                                                                 ^
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:310: /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv/r0drv/linux/timer-r0drv-linux.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [scripts/Makefile.build:569: /var/lib/dkms/vboxhost/5.2.2_OSE/build/vboxdrv] Error 2
make: *** [Makefile:1502: _module_/var/lib/dkms/vboxhost/5.2.2_OSE/build] Error 2
make: Leaving directory '/usr/lib/modules/4.15.0-rc2-mainline/build'

I hope you can help me. smile

Thanks in advance,
avocadoom

Last edited by avocadoom (2017-12-03 18:13:41)

Offline

#2 2017-12-03 17:43:39

loqs
Member
Registered: 2014-03-06
Posts: 18,042

Re: [SOLVED] Installing Virtualbox DKMS on 4.15.0.rc2 Kernel fails

Are yous sure you want 4.15.0.rc2 that was released only a few hours ago if you do see https://patchwork.kernel.org/patch/9985967/
The NPT patch is in 4.14.3 by the way.

Offline

#3 2017-12-03 18:07:04

avocadoom
Member
Registered: 2017-04-24
Posts: 12

Re: [SOLVED] Installing Virtualbox DKMS on 4.15.0.rc2 Kernel fails

loqs wrote:

The NPT patch is in 4.14.3 by the way.

Ok, didn't noticed that. That solves my problem! big_smile

Thanks smile

EDIT Even if this does not solve the problem for the specific kernel, it solves my problem smile so I makred this as solved.

Last edited by avocadoom (2017-12-03 18:14:58)

Offline

#4 2017-12-04 00:45:23

loqs
Member
Registered: 2014-03-06
Posts: 18,042

Re: [SOLVED] Installing Virtualbox DKMS on 4.15.0.rc2 Kernel fails

In case someone needs a patch for 4.15 this is only compile tested but as I had already generated it thought I may as well post it

diff --git a/vboxdrv/r0drv/linux/timer-r0drv-linux.c b/vboxdrv/r0drv/linux/timer-r0drv-linux.c
index 810779a..c0b5245 100644
--- a/vboxdrv/r0drv/linux/timer-r0drv-linux.c
+++ b/vboxdrv/r0drv/linux/timer-r0drv-linux.c
@@ -720,9 +720,17 @@ static enum hrtimer_restart rtTimerLinuxHrCallback(struct hrtimer *pHrTimer)
  *
  * @param   ulUser      Address of the sub-timer structure.
  */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+static void rtTimerLinuxStdCallback(struct timer_list *t)
+#else
 static void rtTimerLinuxStdCallback(unsigned long ulUser)
+#endif
 {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+    PRTTIMERLNXSUBTIMER pSubTimer = from_timer(pSubTimer, t, u.Std.LnxTimer);
+#else
     PRTTIMERLNXSUBTIMER pSubTimer = (PRTTIMERLNXSUBTIMER)ulUser;
+#endif
     PRTTIMER            pTimer    = pSubTimer->pParent;
 
     RTTIMERLNX_LOG(("stdcallback %p\n", pTimer));
@@ -1585,12 +1593,15 @@ RTDECL(int) RTTimerCreateEx(PRTTIMER *ppTimer, uint64_t u64NanoInterval, uint32_
 #endif
         {
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
-            init_timer_pinned(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer);
+            timer_setup(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer,
+                rtTimerLinuxStdCallback, TIMER_PINNED);
 #else
             init_timer(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer);
 #endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
             pTimer->aSubTimers[iCpu].u.Std.LnxTimer.data        = (unsigned long)&pTimer->aSubTimers[iCpu];
             pTimer->aSubTimers[iCpu].u.Std.LnxTimer.function    = rtTimerLinuxStdCallback;
+#endif
             pTimer->aSubTimers[iCpu].u.Std.LnxTimer.expires     = jiffies;
             pTimer->aSubTimers[iCpu].u.Std.u64NextTS            = 0;
         }

Last edited by loqs (2017-12-04 08:49:12)

Offline

#5 2018-02-04 16:06:39

jepjep
Member
Registered: 2018-02-04
Posts: 2

Re: [SOLVED] Installing Virtualbox DKMS on 4.15.0.rc2 Kernel fails

Hi,

test.

Last edited by jepjep (2018-02-04 16:08:09)

Offline

#6 2018-02-04 16:07:28

jepjep
Member
Registered: 2018-02-04
Posts: 2

Re: [SOLVED] Installing Virtualbox DKMS on 4.15.0.rc2 Kernel fails

Hello,

Came here by Just googling.

Are you sure it is for 4.15 kernels? From the patch I can read a 4.8.0 kernel version

Regards,
Josep


loqs wrote:

In case someone needs a patch for 4.15 this is only compile tested but as I had already generated it thought I may as well post it

diff --git a/vboxdrv/r0drv/linux/timer-r0drv-linux.c b/vboxdrv/r0drv/linux/timer-r0drv-linux.c
index 810779a..c0b5245 100644
--- a/vboxdrv/r0drv/linux/timer-r0drv-linux.c
+++ b/vboxdrv/r0drv/linux/timer-r0drv-linux.c
@@ -720,9 +720,17 @@ static enum hrtimer_restart rtTimerLinuxHrCallback(struct hrtimer *pHrTimer)
  *
  * @param   ulUser      Address of the sub-timer structure.
  */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+static void rtTimerLinuxStdCallback(struct timer_list *t)
+#else
 static void rtTimerLinuxStdCallback(unsigned long ulUser)
+#endif
 {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+    PRTTIMERLNXSUBTIMER pSubTimer = from_timer(pSubTimer, t, u.Std.LnxTimer);
+#else
     PRTTIMERLNXSUBTIMER pSubTimer = (PRTTIMERLNXSUBTIMER)ulUser;
+#endif
     PRTTIMER            pTimer    = pSubTimer->pParent;
 
     RTTIMERLNX_LOG(("stdcallback %p\n", pTimer));
@@ -1585,12 +1593,15 @@ RTDECL(int) RTTimerCreateEx(PRTTIMER *ppTimer, uint64_t u64NanoInterval, uint32_
 #endif
         {
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
-            init_timer_pinned(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer);
+            timer_setup(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer,
+                rtTimerLinuxStdCallback, TIMER_PINNED);
 #else
             init_timer(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer);
 #endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
             pTimer->aSubTimers[iCpu].u.Std.LnxTimer.data        = (unsigned long)&pTimer->aSubTimers[iCpu];
             pTimer->aSubTimers[iCpu].u.Std.LnxTimer.function    = rtTimerLinuxStdCallback;
+#endif
             pTimer->aSubTimers[iCpu].u.Std.LnxTimer.expires     = jiffies;
             pTimer->aSubTimers[iCpu].u.Std.u64NextTS            = 0;
         }

Offline

#7 2018-02-04 17:57:53

loqs
Member
Registered: 2014-03-06
Posts: 18,042

Re: [SOLVED] Installing Virtualbox DKMS on 4.15.0.rc2 Kernel fails

@jedjep yes I used greater than or equal to 4.8.0 to avoid doing the following:

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
            init_timer_pinned(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
            timer_setup(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer,
                rtTimerLinuxStdCallback, TIMER_PINNED);
 #else
             init_timer(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer);
 #endif

I found the following simpler and timer_setup was available in 4.8.0 to keep from a code mismatch the earlier test uses 4.8.0 as well

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
            timer_setup(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer,
                rtTimerLinuxStdCallback, TIMER_PINNED);
 #else
             init_timer(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer);
 #endif

However no patch should be needed with the current arch packages.

Offline

Board footer

Powered by FluxBB