summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Rossi <rossi.f@inwind.it>2017-05-24 01:10:54 +0200
committerFabio Rossi <rossi.f@inwind.it>2017-05-24 01:10:54 +0200
commit9a41d0c3db28fb44493720e49e81384943611b0d (patch)
tree67f0808a279d753dfce72873d3bf5ed232315caa
parentapp-emulation/vmware-modules: add support to kernel 4.11 (diff)
downloadvmware-9a41d0c3db28fb44493720e49e81384943611b0d.tar.gz
vmware-9a41d0c3db28fb44493720e49e81384943611b0d.tar.bz2
vmware-9a41d0c3db28fb44493720e49e81384943611b0d.zip
Fix support to kernel 4.9 and add 4.10 and 4.11 for old =vmware-modules-304
-rw-r--r--app-emulation/vmware-modules/files/304-4.10-00-generic_readlink.patch14
-rw-r--r--app-emulation/vmware-modules/files/304-4.11-00-missing-headers-p1.patch40
-rw-r--r--app-emulation/vmware-modules/files/304-4.11-00-missing-headers-p2.patch20
-rw-r--r--app-emulation/vmware-modules/files/304-4.11-01-vsock-lockdep.patch21
-rw-r--r--app-emulation/vmware-modules/files/304-4.11-02-vmmon.patch30
-rw-r--r--app-emulation/vmware-modules/files/304-4.9-02-get_user_pages.patch40
-rw-r--r--app-emulation/vmware-modules/vmware-modules-304.4-r1.ebuild8
7 files changed, 172 insertions, 1 deletions
diff --git a/app-emulation/vmware-modules/files/304-4.10-00-generic_readlink.patch b/app-emulation/vmware-modules/files/304-4.10-00-generic_readlink.patch
new file mode 100644
index 0000000..ab22a75
--- /dev/null
+++ b/app-emulation/vmware-modules/files/304-4.10-00-generic_readlink.patch
@@ -0,0 +1,14 @@
+--- vmblock-only/linux/inode.c 2017-02-21 08:38:50.844678686 -0700
++++ vmblock-only/linux/inode.c 2017-02-21 08:59:40.557917497 -0700
+@@ -207,8 +207,10 @@
+ return vfs_readlink(dentry, buffer, buflen, iinfo->name);
+ #elif LINUX_VERSION_CODE <= KERNEL_VERSION(4, 6, 99)
+ return readlink_copy(buffer, buflen, iinfo->name);
+-#else
++#elif LINUX_VERSION_CODE <= KERNEL_VERSION(4, 9, 99)
+ return generic_readlink(dentry, buffer, buflen);
++#else
++ return vfs_readlink(dentry, buffer, buflen);
+ #endif
+ }
+
diff --git a/app-emulation/vmware-modules/files/304-4.11-00-missing-headers-p1.patch b/app-emulation/vmware-modules/files/304-4.11-00-missing-headers-p1.patch
new file mode 100644
index 0000000..215bcf3
--- /dev/null
+++ b/app-emulation/vmware-modules/files/304-4.11-00-missing-headers-p1.patch
@@ -0,0 +1,40 @@
+--- vmblock-only/linux/inode.c 2017-05-06 16:54:57.000000000 +0200
++++ vmblock-only/linux/inode.c.new 2017-05-06 16:55:32.000000000 +0200
+@@ -28,6 +28,7 @@
+ #include <linux/fs.h>
+ #include <linux/time.h>
+ #include <linux/namei.h>
++#include <linux/cred.h>
+
+ #include "vmblockInt.h"
+ #include "filesystem.h"
+--- vmci-only/linux/driver.c 2017-05-06 16:59:06.000000000 +0200
++++ vmci-only/linux/driver.c.new 2017-05-06 17:00:03.000000000 +0200
+@@ -38,6 +38,7 @@
+ #include <linux/moduleparam.h>
+ #include <linux/poll.h>
+ #include <linux/smp.h>
++#include <linux/cred.h>
+
+ #include "compat_highmem.h"
+ #include "compat_interrupt.h"
+--- vmci-only/linux/vmciKernelIf.c 2017-05-06 17:00:42.000000000 +0200
++++ vmci-only/linux/vmciKernelIf.c.new 2017-05-06 17:01:24.000000000 +0200
+@@ -41,6 +41,7 @@
+ #include <linux/vmalloc.h>
+ #include <linux/wait.h>
+ #include <linux/skbuff.h>
++#include <linux/sched/signal.h>
+
+ #include "compat_highmem.h"
+ #include "compat_interrupt.h"
+--- vsock-only/linux/af_vsock.c 2017-05-06 17:02:05.000000000 +0200
++++ vsock-only/linux/af_vsock.c.new 2017-05-06 17:02:49.000000000 +0200
+@@ -106,6 +106,7 @@
+ #include <linux/list.h>
+ #include <linux/wait.h>
+ #include <linux/init.h>
++#include <linux/sched/signal.h>
+ #include <asm/io.h>
+ #if defined(__x86_64__) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 12)
+ # include <linux/ioctl32.h>
diff --git a/app-emulation/vmware-modules/files/304-4.11-00-missing-headers-p2.patch b/app-emulation/vmware-modules/files/304-4.11-00-missing-headers-p2.patch
new file mode 100644
index 0000000..29a0c9d
--- /dev/null
+++ b/app-emulation/vmware-modules/files/304-4.11-00-missing-headers-p2.patch
@@ -0,0 +1,20 @@
+--- vmmon-only/linux/hostif.c 2017-05-06 16:56:09.000000000 +0200
++++ vmmon-only/linux/hostif.c.new 2017-05-06 16:56:41.000000000 +0200
+@@ -73,6 +73,7 @@
+ #include <linux/capability.h>
+ #include <linux/kthread.h>
+ #include <linux/wait.h>
++#include <linux/sched/signal.h>
+
+ #include <asm/apic.h>
+
+--- vmnet-only/userif.c 2017-03-13 04:05:59.000000000 +0100
++++ vmnet-only/userif.c.new 2017-05-06 16:58:32.000000000 +0200
+@@ -36,6 +36,7 @@
+ #include <linux/slab.h>
+ #include <linux/version.h>
+ #include <linux/wait.h>
++#include <linux/sched/signal.h>
+
+ #include <net/checksum.h>
+ #include <net/sock.h>
diff --git a/app-emulation/vmware-modules/files/304-4.11-01-vsock-lockdep.patch b/app-emulation/vmware-modules/files/304-4.11-01-vsock-lockdep.patch
new file mode 100644
index 0000000..7218d27
--- /dev/null
+++ b/app-emulation/vmware-modules/files/304-4.11-01-vsock-lockdep.patch
@@ -0,0 +1,21 @@
+--- vsock-only/linux/af_vsock.c 2017-05-21 00:58:02.900776185 +0200
++++ vsock-only/linux/af_vsock.c.new 2017-05-21 00:57:18.932773727 +0200
+@@ -213,7 +213,7 @@
+ struct sockaddr *addr, int addrLen, int flags);
+ static int VSockVmciStreamConnect(struct socket *sock,
+ struct sockaddr *addr, int addrLen, int flags);
+-static int VSockVmciAccept(struct socket *sock, struct socket *newsock, int flags);
++static int VSockVmciAccept(struct socket *sock, struct socket *newsock, int flags, bool kern);
+ static int VSockVmciGetname(struct socket *sock,
+ struct sockaddr *addr, int *addrLen, int peer);
+ static unsigned int VSockVmciPoll(struct file *file,
+@@ -3772,7 +3772,8 @@
+ static int
+ VSockVmciAccept(struct socket *sock, // IN
+ struct socket *newsock, // IN/OUT
+- int flags) // IN
++ int flags, // IN
++ bool kern) // IN
+ {
+ struct sock *listener;
+ int err;
diff --git a/app-emulation/vmware-modules/files/304-4.11-02-vmmon.patch b/app-emulation/vmware-modules/files/304-4.11-02-vmmon.patch
new file mode 100644
index 0000000..b126453
--- /dev/null
+++ b/app-emulation/vmware-modules/files/304-4.11-02-vmmon.patch
@@ -0,0 +1,30 @@
+diff -ur old/vmmon-only/linux/driver.c vmmon-only/linux/driver.c
+--- old/vmmon-only/linux/driver.c 2016-11-12 09:15:52.000000000 +0200
++++ vmmon-only/linux/driver.c 2017-03-06 10:46:33.347053458 +0200
+@@ -105,7 +105,7 @@
+ static int LinuxDriver_Close(struct inode *inode, struct file *filp);
+ static unsigned int LinuxDriverPoll(struct file *file, poll_table *wait);
+ #if defined(VMW_NOPAGE_2624)
+-static int LinuxDriverFault(struct vm_area_struct *vma, struct vm_fault *fault);
++static int LinuxDriverFault(struct vm_fault *fault);
+ #else
+ static struct page *LinuxDriverNoPage(struct vm_area_struct *vma,
+ unsigned long address,
+@@ -882,15 +882,14 @@
+ */
+
+ #if defined(VMW_NOPAGE_2624)
+-static int LinuxDriverFault(struct vm_area_struct *vma, //IN
+- struct vm_fault *fault) //IN/OUT
++static int LinuxDriverFault(struct vm_fault *fault) //IN/OUT
+ #else
+ static struct page *LinuxDriverNoPage(struct vm_area_struct *vma, //IN
+ unsigned long address, //IN
+ int *type) //OUT: Fault type
+ #endif
+ {
+- VMLinux *vmLinux = (VMLinux *) vma->vm_file->private_data;
++ VMLinux *vmLinux = (VMLinux *) fault->vma->vm_file->private_data;
+ unsigned long pg;
+ struct page* page;
+
diff --git a/app-emulation/vmware-modules/files/304-4.9-02-get_user_pages.patch b/app-emulation/vmware-modules/files/304-4.9-02-get_user_pages.patch
new file mode 100644
index 0000000..1b8b87f
--- /dev/null
+++ b/app-emulation/vmware-modules/files/304-4.9-02-get_user_pages.patch
@@ -0,0 +1,40 @@
+--- vmci-only/linux/driver.c.old 2017-05-24 01:02:34.453636688 +0200
++++ vmci-only/linux/driver.c 2017-05-24 01:04:12.757631983 +0200
+@@ -1476,7 +1476,11 @@
+ #else
+ retval = get_user_pages(current, current->mm, addr,
+ #endif
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
++ 1, FOLL_WRITE, &page, NULL);
++#else
+ 1, 1, 0, &page, NULL);
++#endif
+ up_read(&current->mm->mmap_sem);
+
+ if (retval != 1) {
+--- vmci-only/linux/vmciKernelIf.c.old 2017-05-24 00:58:58.837647006 +0200
++++ vmci-only/linux/vmciKernelIf.c 2017-05-24 01:02:07.668637969 +0200
+@@ -2062,7 +2062,11 @@
+ (VA)produceUVA,
+ #endif
+ produceQ->kernelIf->numPages,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
++ FOLL_WRITE,
++#else
+ 1, 0,
++#endif
+ produceQ->kernelIf->u.h.headerPage,
+ NULL);
+ if (retval < produceQ->kernelIf->numPages) {
+@@ -2080,7 +2084,11 @@
+ (VA)consumeUVA,
+ #endif
+ consumeQ->kernelIf->numPages,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
++ FOLL_WRITE,
++#else
+ 1, 0,
++#endif
+ consumeQ->kernelIf->u.h.headerPage,
+ NULL);
+ if (retval < consumeQ->kernelIf->numPages) {
diff --git a/app-emulation/vmware-modules/vmware-modules-304.4-r1.ebuild b/app-emulation/vmware-modules/vmware-modules-304.4-r1.ebuild
index d50aedc..8bf050e 100644
--- a/app-emulation/vmware-modules/vmware-modules-304.4-r1.ebuild
+++ b/app-emulation/vmware-modules/vmware-modules-304.4-r1.ebuild
@@ -107,7 +107,13 @@ src_prepare() {
kernel_is ge 4 8 0 && epatch "${FILESDIR}/${PV_MAJOR}-4.8-00-nr_anon_mapped.patch"
kernel_is ge 4 9 0 && epatch "${FILESDIR}/${PV_MAJOR}-4.9-00-get_user_pages.patch"
kernel_is ge 4 9 0 && epatch "${FILESDIR}/${PV_MAJOR}-4.9-01-get_user_pages.patch"
-
+ kernel_is ge 4 9 0 && epatch "${FILESDIR}/${PV_MAJOR}-4.9-02-get_user_pages.patch"
+ kernel_is ge 4 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-4.10-00-generic_readlink.patch"
+ kernel_is ge 4 11 0 && epatch "${FILESDIR}/${PV_MAJOR}-4.11-00-missing-headers-p1.patch"
+ kernel_is ge 4 11 0 && epatch "${FILESDIR}/${PV_MAJOR}-4.11-00-missing-headers-p2.patch"
+ kernel_is ge 4 11 0 && epatch "${FILESDIR}/${PV_MAJOR}-4.11-01-vsock-lockdep.patch"
+ kernel_is ge 4 11 0 && epatch "${FILESDIR}/${PV_MAJOR}-4.11-02-vmmon.patch"
+
# Allow user patches so they can support RC kernels and whatever else
epatch_user
}