[vbox-dev] Error in building latest SVN

Larry Finger Larry.Finger at lwfinger.net
Thu Feb 14 16:42:59 GMT 2008


Frank Mehnert wrote:
> On Sunday 10 February 2008, Larry Finger wrote:
>> Larry Finger wrote:
>>> There are at least 2 more changes in the 2.6.25 kernel that affect
>>> VirtualBox:
> 
> Please keep in mind that even 2.6.25rc1 is not released yet.

Linus has now released 2.6.25-rc1. The patches to make VirtualBox work with it are below:

Index: vbox/src/VBox/Additions/linux/sharedfolders/vfsmod.c
===================================================================
--- vbox.orig/src/VBox/Additions/linux/sharedfolders/vfsmod.c
+++ vbox/src/VBox/Additions/linux/sharedfolders/vfsmod.c
@@ -296,10 +296,12 @@ sf_clear_inode (struct inode *inode)
    the only thing that is known about inode at this point is its index
    hence we can't do anything here, and let lookup/whatever with the
    job to properly fill then [inode] */
+#if LINUX_VERSION_CODE < KERNEL_VERSION (2, 6, 25)
 static void
 sf_read_inode (struct inode *inode)
 {
 }
+#endif

 /* vfs is done with [sb] (umount called) call [sf_glob_free] to unmap
    the folder and free [sf_g] */
@@ -337,7 +339,9 @@ sf_remount_fs (struct super_block *sb, i

 static struct super_operations sf_super_ops = {
 	.clear_inode = sf_clear_inode,
+#if LINUX_VERSION_CODE < KERNEL_VERSION (2, 6, 25)
 	.read_inode  = sf_read_inode,
+#endif
 	.put_super   = sf_put_super,
 	.statfs      = sf_statfs,
 	.remount_fs  = sf_remount_fs
Index: vbox/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
===================================================================
--- vbox.orig/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
+++ vbox/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
@@ -1499,6 +1499,17 @@ RTDECL(void) AssertMsg2(const char *pszF
 /* GCC C++ hack. */
 unsigned __gxx_personality_v0 = 0xcccccccc;

+/* Add the change_page_attr routine for kernels 2.6.25 or later */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
+int change_page_attr(struct page *page, int numpages, pgprot_t prot)
+{
+	/* use the set_pages_* API */
+	if (pgprot_val(prot) & _PAGE_NX)
+		set_pages_nx(page, numpages);
+	set_pages_uc(page, numpages);
+	return 0;
+}
+#endif

 module_init(VBoxDrvLinuxInit);
 module_exit(VBoxDrvLinuxUnload);
Index: vbox/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h
===================================================================
--- vbox.orig/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h
+++ vbox/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h
@@ -234,11 +234,12 @@ DECLINLINE(unsigned long) msecs_to_jiffi
 #undef bool

 /*
- * There are post-2.6.24 kernels (confusingly with unchanged version number)
- * which eliminate macros which were marked as deprecated.
+ * The 2.6.25 kernel eliminates macros that were marked as deprecated and eliminates
+ * routine change_page_attr() in favor of the set_pages_* API.
  */
-#ifndef __attribute_used__
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
 #define __attribute_used__ __used
+int change_page_attr(struct page *page, int numpages, pgprot_t prot);
 #endif

 #endif


Larry





More information about the vbox-dev mailing list