[vbox-dev] Kernel v4.12 API changes

Frank Mehnert frank.mehnert at oracle.com
Fri May 19 09:57:35 GMT 2017


On Mittwoch, 17. Mai 2017 20:49:42 CEST Frank Mehnert wrote:
> Hi Larry,
> 
> On Montag, 15. Mai 2017 16:35:30 CEST Larry Finger wrote:
> > Has anyone found the magic elixir to allow VB to run with kernel 4.12-rc1?
> > 
> > Adding #include <asm/set_memory.h> to vboxdrv/r0drv/linux/alloc-r0drv-linux.c is 
> > trivial; however, I'm having trouble with changes in the page table walk code in 
> > vboxdrv/r0drv/linux/memobj-r0drv-linux.c. I followed the changes in the kernel 
> > and I have code that compiles cleanly, but as soon as I try to start a VM, the 
> > system locks up and panics a few seconds later. At this point, I have no 
> > diagnostics concerning where the fault happened.
> 
> we are working on a fix. The obvious fixes can be found in r66927, r66928
> and r66930. These changes make the modules compile against Linux 4.12-rc1
> but as you noticed, the kernel panics when starting a VM. We are debugging
> this issue.

quick fix for the remaining issue (freeze on VM start) is the following:

--- src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c   (revision 115504)
+++ src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c   (working copy)
@@ -1397,7 +1397,7 @@
 SUPR0DECL(uint32_t) SUPR0GetKernelFeatures(void)
 {
     uint32_t fFlags = 0;
-#ifdef CONFIG_PAX_KERNEXEC
+#if defined(CONFIG_PAX_KERNEXEC) || LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
     fFlags |= SUPKERNELFEATURES_GDT_READ_ONLY;
 #endif
 #if defined(VBOX_STRICT) || defined(VBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV)

The reason is that the GDT is mapped read-only as of Linux 4.12. We have
not yet decided if this will be the final fix for the moment or if an
alternative fix (which requires changes to the VMM part as well) is the
better choice.

Kind regards,

Frank
-- 
Dr.-Ing. Frank Mehnert | Software Development Director, VirtualBox
ORACLE Deutschland B.V. & Co. KG | Werkstr. 24 | 71384 Weinstadt, Germany

ORACLE Deutschland B.V. & Co. KG
Hauptverwaltung: Riesstraße 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603

Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande
Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697
Geschäftsführer: Alexander van der Ven, Jan Schultheiss, Val Maher



More information about the vbox-dev mailing list