summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-emulation/vmware-modules')
-rw-r--r--app-emulation/vmware-modules/files/308-4.06-00-user-pages-p1.patch (renamed from app-emulation/vmware-modules/files/308-4.06-00-user-pages.patch)62
-rw-r--r--app-emulation/vmware-modules/files/308-4.06-00-user-pages-p2.patch28
-rw-r--r--app-emulation/vmware-modules/files/308-4.09-00-user-pages.patch116
-rw-r--r--app-emulation/vmware-modules/files/308-4.10-00-generic_readlink.patch14
-rw-r--r--app-emulation/vmware-modules/vmware-modules-308.1.1.ebuild4
5 files changed, 120 insertions, 104 deletions
diff --git a/app-emulation/vmware-modules/files/308-4.06-00-user-pages.patch b/app-emulation/vmware-modules/files/308-4.06-00-user-pages-p1.patch
index dc677c2..9012176 100644
--- a/app-emulation/vmware-modules/files/308-4.06-00-user-pages.patch
+++ b/app-emulation/vmware-modules/files/308-4.06-00-user-pages-p1.patch
@@ -4,81 +4,65 @@
int retval;
down_read(&current->mm->mmap_sem);
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 99)
-+ retval = get_user_pages(addr,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
++ retval = get_user_pages(addr, 1, 1, 0, &page, NULL);
+#else
retval = get_user_pages(current, current->mm, addr,
-+#endif
1, 1, 0, &page, NULL);
++#endif
up_read(&current->mm->mmap_sem);
--- ./vmci-only/linux/vmciKernelIf.c.old 2016-05-19 18:57:04.344658673 +0200
+++ ./vmci-only/linux/vmciKernelIf.c 2016-05-19 19:03:28.600680159 +0200
-@@ -1835,7 +1835,11 @@
- if (dirty) {
- set_page_dirty(pages[i]);
- }
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 99)
-+ put_page(pages[i]);
-+#else
- page_cache_release(pages[i]);
-+#endif
- pages[i] = NULL;
- }
- }
-@@ -2049,9 +2053,13 @@
+@@ -2049,6 +2049,13 @@
int err = VMCI_SUCCESS;
down_write(&current->mm->mmap_sem);
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 99)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
+ retval = get_user_pages((VA)produceUVA,
++ produceQ->kernelIf->numPages,
++ 1, 0,
++ produceQ->kernelIf->u.h.headerPage,
++ NULL);
+#else
retval = get_user_pages(current,
current->mm,
(VA)produceUVA,
-+#endif
- produceQ->kernelIf->numPages,
+@@ -2056,6 +2063,7 @@
1, 0,
produceQ->kernelIf->u.h.headerPage,
-@@ -2063,9 +2071,13 @@
- goto out;
- }
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 99)
-+ retval = get_user_pages((VA)consumeUVA,
-+#else
- retval = get_user_pages(current,
- current->mm,
- (VA)consumeUVA,
+ NULL);
+#endif
- consumeQ->kernelIf->numPages,
- 1, 0,
- consumeQ->kernelIf->u.h.headerPage,
+ if (retval < produceQ->kernelIf->numPages) {
+ Log("get_user_pages(produce) failed (retval=%d)\n", retval);
+ VMCIReleasePages(produceQ->kernelIf->u.h.headerPage, retval, FALSE);
--- ./vmmon-only/linux/hostif.c.old 2016-05-19 18:50:42.872637343 +0200
+++ ./vmmon-only/linux/hostif.c 2016-05-19 18:53:40.208647259 +0200
@@ -1163,7 +1163,11 @@
int retval;
down_read(&current->mm->mmap_sem);
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 99)
-+ retval = get_user_pages((unsigned long)uvAddr,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
++ retval = get_user_pages((unsigned long)uvAddr, numPages, 0, 0, ppages, NULL);
+#else
retval = get_user_pages(current, current->mm, (unsigned long)uvAddr,
-+#endif
numPages, 0, 0, ppages, NULL);
++#endif
up_read(&current->mm->mmap_sem);
--- ./vmnet-only/userif.c.old 2016-05-19 18:52:45.904644222 +0200
+++ ./vmnet-only/userif.c 2016-05-19 18:53:28.599646610 +0200
-@@ -113,7 +113,11 @@
+@@ -113,8 +113,12 @@
int retval;
down_read(&current->mm->mmap_sem);
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 99)
-+ retval = get_user_pages(addr,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
++ retval = get_user_pages(addr, 1, 1, 0, &page, NULL);
+#else
retval = get_user_pages(current, current->mm, addr,
+- 1, 1, 0, &page, NULL);
++ 1, 1, 0, &page, NULL);
+#endif
- 1, 1, 0, &page, NULL);
up_read(&current->mm->mmap_sem);
+ if (retval != 1) {
diff --git a/app-emulation/vmware-modules/files/308-4.06-00-user-pages-p2.patch b/app-emulation/vmware-modules/files/308-4.06-00-user-pages-p2.patch
new file mode 100644
index 0000000..14605d1
--- /dev/null
+++ b/app-emulation/vmware-modules/files/308-4.06-00-user-pages-p2.patch
@@ -0,0 +1,28 @@
+--- ./vmci-only/linux/vmciKernelIf.c.old 2016-05-19 18:57:04.344658673 +0200
++++ ./vmci-only/linux/vmciKernelIf.c 2016-05-19 19:03:28.600680159 +0200
+@@ -1835,7 +1835,11 @@
+ if (dirty) {
+ set_page_dirty(pages[i]);
+ }
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 99)
++ put_page(pages[i]);
++#else
+ page_cache_release(pages[i]);
++#endif
+ pages[i] = NULL;
+ }
+ }
+@@ -2063,9 +2067,13 @@
+ goto out;
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 99)
++ retval = get_user_pages((VA)consumeUVA,
++#else
+ retval = get_user_pages(current,
+ current->mm,
+ (VA)consumeUVA,
++#endif
+ consumeQ->kernelIf->numPages,
+ 1, 0,
+ consumeQ->kernelIf->u.h.headerPage,
diff --git a/app-emulation/vmware-modules/files/308-4.09-00-user-pages.patch b/app-emulation/vmware-modules/files/308-4.09-00-user-pages.patch
index 73c6c9f..1790f73 100644
--- a/app-emulation/vmware-modules/files/308-4.09-00-user-pages.patch
+++ b/app-emulation/vmware-modules/files/308-4.09-00-user-pages.patch
@@ -1,77 +1,65 @@
---- vmmon-only/linux/hostif.c 2016-12-12 09:17:44.438182532 -0700
-+++ vmmon-only/linux/hostif.c 2016-12-12 09:19:24.066254301 -0700
-@@ -1172,7 +1172,11 @@
- #else
- retval = get_user_pages(current, current->mm, (unsigned long)uvAddr,
- #endif
-- numPages, 0, 0, ppages, NULL);
-+ numPages, 0,
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0)
-+ 0,
-+#endif
-+ ppages, NULL);
- up_read(&current->mm->mmap_sem);
-
- return retval != numPages;
---- vmnet-only/userif.c 2016-12-12 09:27:12.445246854 -0700
-+++ vmnet-only/userif.c 2016-12-12 09:27:30.654298646 -0700
-@@ -118,7 +118,13 @@
- #else
- retval = get_user_pages(current, current->mm, addr,
- #endif
-- 1, 1, 0, &page, NULL);
-+ 1,
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0)
-+ 1, 0,
-+#else
-+ FOLL_WRITE,
-+#endif
-+ &page, NULL);
- up_read(&current->mm->mmap_sem);
-
- if (retval != 1) {
---- vmci-only/linux/driver.c 2016-12-12 09:38:13.076847013 -0700
-+++ vmci-only/linux/driver.c 2016-12-12 09:38:45.638087445 -0700
-@@ -1473,7 +1473,13 @@
- #else
- retval = get_user_pages(current, current->mm, addr,
- #endif
-- 1, 1, 0, &page, NULL);
-+ 1,
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0)
-+ 1, 0,
-+#else
-+ FOLL_WRITE,
-+#endif
-+ &page, NULL);
- up_read(&current->mm->mmap_sem);
-
- if (retval != 1) {
---- vmci-only/linux/vmciKernelIf.c 2016-12-12 09:38:20.678904322 -0700
-+++ vmci-only/linux/vmciKernelIf.c 2016-12-12 09:39:59.129587451 -0700
-@@ -2061,7 +2061,11 @@
- (VA)produceUVA,
- #endif
+--- ./vmci-only/linux/vmciKernelIf.c 2017-02-23 12:19:59.706822502 +0100
++++ ./vmci-only/linux/vmciKernelIf.c.new 2017-02-23 13:12:09.382997502 +0100
+@@ -2056,7 +2056,11 @@
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
+ retval = get_user_pages((VA)produceUVA,
produceQ->kernelIf->numPages,
-- 1, 0,
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0)
-+ 1, 0,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
++ FOLL_WRITE,
+#else
-+ FOLL_WRITE,
+ 1, 0,
+#endif
produceQ->kernelIf->u.h.headerPage,
NULL);
- if (retval < produceQ->kernelIf->numPages) {
-@@ -2079,7 +2083,11 @@
+ #else
+@@ -2083,7 +2087,11 @@
(VA)consumeUVA,
#endif
consumeQ->kernelIf->numPages,
-- 1, 0,
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0)
-+ 1, 0,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
++ FOLL_WRITE,
+#else
-+ FOLL_WRITE,
+ 1, 0,
+#endif
consumeQ->kernelIf->u.h.headerPage,
NULL);
if (retval < consumeQ->kernelIf->numPages) {
+--- ./vmci-only/linux/driver.c 2017-02-23 12:19:59.645822499 +0100
++++ ./vmci-only/linux/driver.c.new 2017-02-23 12:30:38.845858240 +0100
+@@ -1468,7 +1468,9 @@
+ int retval;
+
+ down_read(&current->mm->mmap_sem);
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
++ retval = get_user_pages(addr, 1, FOLL_WRITE, &page, NULL);
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
+ retval = get_user_pages(addr, 1, 1, 0, &page, NULL);
+ #else
+ retval = get_user_pages(current, current->mm, addr,
+--- ./vmnet-only/userif.c 2017-02-23 12:29:00.909852764 +0100
++++ ./vmnet-only/userif.c.new 2017-02-23 12:28:51.309852227 +0100
+@@ -113,7 +113,9 @@
+ int retval;
+
+ down_read(&current->mm->mmap_sem);
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
++ retval = get_user_pages(addr, 1, FOLL_WRITE, &page, NULL);
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
+ retval = get_user_pages(addr, 1, 1, 0, &page, NULL);
+ #else
+ retval = get_user_pages(current, current->mm, addr,
+--- ./vmmon-only/linux/hostif.c 2017-02-23 12:19:59.772822506 +0100
++++ ./vmmon-only/linux/hostif.c.new 2017-02-23 12:26:42.661845034 +0100
+@@ -1167,7 +1167,9 @@
+ int retval;
+
+ down_read(&current->mm->mmap_sem);
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
++ retval = get_user_pages((unsigned long)uvAddr, numPages, 0, ppages, NULL);
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
+ retval = get_user_pages((unsigned long)uvAddr, numPages, 0, 0, ppages, NULL);
+ #else
+ retval = get_user_pages(current, current->mm, (unsigned long)uvAddr,
diff --git a/app-emulation/vmware-modules/files/308-4.10-00-generic_readlink.patch b/app-emulation/vmware-modules/files/308-4.10-00-generic_readlink.patch
new file mode 100644
index 0000000..ab22a75
--- /dev/null
+++ b/app-emulation/vmware-modules/files/308-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/vmware-modules-308.1.1.ebuild b/app-emulation/vmware-modules/vmware-modules-308.1.1.ebuild
index bb9db4f..1e4eebb 100644
--- a/app-emulation/vmware-modules/vmware-modules-308.1.1.ebuild
+++ b/app-emulation/vmware-modules/vmware-modules-308.1.1.ebuild
@@ -101,11 +101,13 @@ src_prepare() {
kernel_is ge 4 2 0 && epatch "${FILESDIR}/${PV_MAJOR}-4.02-01-sk_alloc.patch"
kernel_is ge 4 3 0 && epatch "${FILESDIR}/${PV_MAJOR}-4.03-00-vmci-misc_deregister.patch"
kernel_is ge 4 5 0 && epatch "${FILESDIR}/${PV_MAJOR}-4.05-00-vmblock-follow_link.patch"
- kernel_is ge 4 6 0 && epatch "${FILESDIR}/${PV_MAJOR}-4.06-00-user-pages.patch"
+ kernel_is ge 4 6 0 && epatch "${FILESDIR}/${PV_MAJOR}-4.06-00-user-pages-p1.patch"
+ kernel_is ge 4 6 0 && epatch "${FILESDIR}/${PV_MAJOR}-4.06-00-user-pages-p2.patch"
kernel_is ge 4 7 0 && epatch "${FILESDIR}/${PV_MAJOR}-4.07-00-trans_start.patch"
kernel_is ge 4 7 0 && epatch "${FILESDIR}/${PV_MAJOR}-4.07-01-readlink_copy.patch"
kernel_is ge 4 8 0 && epatch "${FILESDIR}/${PV_MAJOR}-4.08-00-nr_anon_mapped.patch"
kernel_is ge 4 9 0 && epatch "${FILESDIR}/${PV_MAJOR}-4.09-00-user-pages.patch"
+ kernel_is ge 4 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-4.10-00-generic_readlink.patch"
# Allow user patches so they can support RC kernels and whatever else
epatch_user