[vbox-dev] VirtualBox 6.0 - build fix for Linux 5.1

Valdis Kl=?utf-8?Q?=c4=93?=tnieks valdis.kletnieks at vt.edu
Thu Mar 14 20:57:47 GMT 2019

Sayeth Linus:

commit 736706bee3298208343a76096370e4f6a5c55915
Author: Linus Torvalds <torvalds at linux-foundation.org>
Date:   Mon Mar 4 10:39:05 2019 -0800

    get rid of legacy 'get_ds()' function
    Every in-kernel use of this function defined it to KERNEL_DS (either as
    an actual define, or as an inline function).  It's an entirely
    historical artifact, and long long long ago used to actually read the
    segment selector valueof '%ds' on x86.
    Which in the kernel is always KERNEL_DS.

No kernel release versioning on the patch, as the define was in the tree
when Linus did the initial import into git for v2.6.12-rc2 back in April 2005.
If you're trying to build this on a kernel older than that, this is the least of
your problems. :)

--- vboxhost/vboxpci/linux/VBoxPci-linux.c.dist	2019-03-14 16:37:18.758730554 -0400
+++vboxhost/vboxpci/linux/VBoxPci-linux.c	2019-03-14 16:37:46.354160251 -0400
@@ -372,7 +372,7 @@ static int vboxPciFileWrite(struct file*
     mm_segment_t fs_save;
     fs_save = get_fs();
-    set_fs(get_ds());
+    set_fs(KERNEL_DS);
     ret = kernel_write(file, data, size, &offset);

More information about the vbox-dev mailing list