1
0
forked from pool/virtualbox

- Removed "vbox_fix_4.9_api_changes.patch" as changes are upstream.

Fixed API changes for kernel 4.10 in "vbox_fix_4.10_api_changes.patch".

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=306
This commit is contained in:
Larry Finger 2017-01-28 21:09:26 +00:00 committed by Git OBS Bridge
parent 798ba7e584
commit 6ae60f24fd
4 changed files with 39 additions and 133 deletions

View File

@ -1,67 +1,37 @@
Index: VirtualBox-5.1.12/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
Index: VirtualBox-5.1.14/src/VBox/Additions/linux/sharedfolders/lnkops.c
===================================================================
--- VirtualBox-5.1.12.orig/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
+++ VirtualBox-5.1.12/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
@@ -1078,7 +1078,12 @@ DECLHIDDEN(int) rtR0MemObjNativeLockUser
fWrite, /* force write access. */
# endif
&pMemLnx->apPages[0], /* Page array. */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
+ papVMAs, /* vmas */
+ NULL);
+#else
papVMAs); /* vmas */
+#endif
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0) */
rc = get_user_pages(pTask, /* Task for fault accounting. */
pTask->mm, /* Whose pages. */
@@ -1093,7 +1098,12 @@ DECLHIDDEN(int) rtR0MemObjNativeLockUser
fWrite, /* force write access. */
# endif
&pMemLnx->apPages[0], /* Page array. */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
+ papVMAs, /* vmas */
+ NULL);
+#else
papVMAs); /* vmas */
+#endif
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0) */
if (rc == cPages)
{
Index: VirtualBox-5.1.12/src/VBox/Runtime/r0drv/linux/mpnotification-r0drv-linux.c
===================================================================
--- VirtualBox-5.1.12.orig/src/VBox/Runtime/r0drv/linux/mpnotification-r0drv-linux.c
+++ VirtualBox-5.1.12/src/VBox/Runtime/r0drv/linux/mpnotification-r0drv-linux.c
@@ -39,8 +39,32 @@
--- VirtualBox-5.1.14.orig/src/VBox/Additions/linux/sharedfolders/lnkops.c
+++ VirtualBox-5.1.14/src/VBox/Additions/linux/sharedfolders/lnkops.c
@@ -88,6 +88,31 @@ static const char *sf_get_link(struct de
}
# endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0) */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 71) && defined(CONFIG_SMP)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
+/* This hack allows VB to build under kernel 4.10 and later, but it
+ * should be replaced with a version that uses the hotplug state machine
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
+/*
+ * A helper for ->readlink(). This should be used *ONLY* for symlinks that
+ * have ->get_link() not calling nd_jump_link(). Using (or not using) it
+ * for any given inode is up to filesystem.
+ */
+static DEFINE_MUTEX(cpu_add_remove_lock);
+static RAW_NOTIFIER_HEAD(cpu_chain);
+/* Need to know about CPUs going up/down? */
+static int register_cpu_notifier(struct notifier_block *nb)
+static int generic_readlink(struct dentry *dentry, char __user *buffer,
+ int buflen)
+{
+ int ret;
+ mutex_lock(&cpu_add_remove_lock);
+ ret = raw_notifier_chain_register(&cpu_chain, nb);
+ mutex_unlock(&cpu_add_remove_lock);
+ return ret;
+}
+ DEFINE_DELAYED_CALL(done);
+ struct inode *inode = d_inode(dentry);
+ const char *link = inode->i_link;
+ int res;
+
+/* Need to know about CPUs going up/down? */
+static void unregister_cpu_notifier(struct notifier_block *nb)
+{
+ mutex_lock(&cpu_add_remove_lock);
+ raw_notifier_chain_unregister(&cpu_chain, nb);
+ mutex_unlock(&cpu_add_remove_lock);
+ if (!link) {
+ link = inode->i_op->get_link(dentry, inode, &done);
+ if (IS_ERR(link))
+ return PTR_ERR(link);
+ }
+ res = readlink_copy(buffer, buflen, link);
+ do_delayed_call(&done);
+ return res;
+}
+#endif
/*********************************************************************************************************************************
* Internal Functions *
*********************************************************************************************************************************/
+
struct inode_operations sf_lnk_iops =
{
.readlink = generic_readlink,

View File

@ -1,70 +0,0 @@
Index: VirtualBox-5.1.10/src/VBox/Additions/linux/sharedfolders/dirops.c
===================================================================
--- VirtualBox-5.1.10.orig/src/VBox/Additions/linux/sharedfolders/dirops.c
+++ VirtualBox-5.1.10/src/VBox/Additions/linux/sharedfolders/dirops.c
@@ -748,12 +748,18 @@ static int sf_rmdir(struct inode *parent
* @param flags flags
* @returns 0 on success, Linux error code otherwise
*/
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0)
static int sf_rename(struct inode *old_parent, struct dentry *old_dentry,
struct inode *new_parent, struct dentry *new_dentry
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
, unsigned flags
#endif
)
+#else
+static int sf_rename(struct inode *old_parent, struct dentry *old_dentry,
+ struct inode *new_parent, struct dentry *new_dentry,
+ unsigned int flags)
+#endif
{
int err = 0, rc = VINF_SUCCESS;
struct sf_glob_info *sf_g = GET_GLOB_INFO(old_parent->i_sb);
Index: VirtualBox-5.1.10/src/VBox/Additions/linux/drm/vbox_ttm.c
===================================================================
--- VirtualBox-5.1.10.orig/src/VBox/Additions/linux/drm/vbox_ttm.c
+++ VirtualBox-5.1.10/src/VBox/Additions/linux/drm/vbox_ttm.c
@@ -221,7 +221,8 @@ static int vbox_bo_move(struct ttm_buffe
struct ttm_mem_reg *new_mem)
{
int r;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0) || \
+ LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
r = ttm_bo_move_memcpy(bo, evict, no_wait_gpu, new_mem);
#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0)
r = ttm_bo_move_memcpy(bo, evict, interruptible, no_wait_gpu, new_mem);
Index: VirtualBox-5.1.10/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
===================================================================
--- VirtualBox-5.1.10.orig/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
+++ VirtualBox-5.1.10/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
@@ -1045,7 +1045,27 @@ DECLHIDDEN(int) rtR0MemObjNativeLockUser
/*
* Get user pages.
*/
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+ if (R0Process == RTR0ProcHandleSelf())
+ rc = get_user_pages(R3Ptr, /* Where from. */
+ cPages, /* How many pages. */
+ fWrite, /* Write to memory. */
+ &pMemLnx->apPages[0], /* Page array. */
+ papVMAs); /* vmas */
+ /*
+ * Actually this should not happen at the moment as call this function
+ * only for our own process.
+ */
+ else
+ rc = get_user_pages_remote(
+ pTask, /* Task for fault accounting. */
+ pTask->mm, /* Whose pages. */
+ R3Ptr, /* Where from. */
+ cPages, /* How many pages. */
+ fWrite, /* Write to memory. */
+ &pMemLnx->apPages[0], /* Page array. */
+ papVMAs); /* vmas */
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
if (R0Process == RTR0ProcHandleSelf())
rc = get_user_pages(R3Ptr, /* Where from. */
cPages, /* How many pages. */

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sat Jan 28 20:37:54 UTC 2017 - Larry.Finger@lwfinger.net
- Removed "vbox_fix_4.9_api_changes.patch" as changes are upstream.
Fixed API changes for kernel 4.10 in "vbox_fix_4.10_api_changes.patch".
-------------------------------------------------------------------
Wed Jan 25 02:52:51 UTC 2017 - Larry.Finger@lwfinger.net

View File

@ -89,11 +89,11 @@ Patch111: vbox_prevent_wrong_SONAME.patch
Patch112: modify_for_4_8_bo_move.patch
# Remove all mention of _smp_mflags
Patch113: vbox_remove_smp_mflags.patch
# Fix build error on kernel 4.9
Patch114: vbox_fix_4.9_api_changes.patch
# Fix for missing include needed for server 1.19
Patch116: Fix_for_server_1.19.patch
#
Patch117: vbox_fix_4.10_api_changes.patch
#
BuildRequires: LibVNCServer-devel
BuildRequires: SDL-devel
BuildRequires: acpica
@ -328,8 +328,8 @@ This package contains icons for guest desktop files that were created on the des
%patch111 -p1
%patch112 -p1
%patch113 -p1
%patch114 -p1
%patch116 -p1
%patch117 -p1
#copy user manual
cp %{SOURCE1} UserManual.pdf