initial commit

master
spike 7 years ago
commit 020d3ba8f3

@ -0,0 +1,31 @@
## Patch for Vmware 12.1.1 Kernel 4.9
**Note: User at your own risk !**
Vmware 12.1 modules compilation is broke since kernel 4.9.
Heres a quick and dirty patch I came up with after failing to find a solution.
### Usage
1. Go to vmware modules source directory
`cd /usr/lib/vmware/modules/source/`
2.
https://github.com/torvalds/linux/commit/9beae1ea89305a9667ceaab6d0bf46a045ad71e7
- two variables(write, force) replaced with gup_flags
- gup flags used like this
unsigned int flags = 0;
flags |= FOLL_WRITE
1, 0, pvec + pinned ---> flags, pvec + pinned
https://github.com/torvalds/linux/commit/1e9877902dc7e11d2be038371c6fbf2dfcd469d7#diff-e37c5ffd9b4db050c3f7eae7d74e64c3R1230
write, force, pages --> flags(write=1,force=0)
flags: the flags must be write only and not force
FOLL_WRITE
https://github.com/torvalds/linux/blob/6e5c8381d1db4c1cdd4b4e49d5f0d1255c2246fd/include/linux/mm.h#L227://github.com/torvalds/linux/blob/6e5c8381d1db4c1cdd4b4e49d5f0d1255c2246fd/include/linux/mm.h#L2278

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,33 @@
diff -Naur vmmon-only-bak/linux/hostif.c vmmon-only/linux/hostif.c
--- vmmon-only-bak/linux/hostif.c 2017-02-28 17:05:34.764176166 +0100
+++ vmmon-only/linux/hostif.c 2017-02-28 17:07:07.966050524 +0100
@@ -1160,10 +1160,29 @@
unsigned int numPages) // IN
{
int retval;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0)
+ unsigned int flags = 0; // No rights
+#endif
down_read(&current->mm->mmap_sem);
+
+
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0)
+ retval = get_user_pages_remote(current, current->mm, (unsigned long)uvAddr,
+ numPages, flags, ppages, NULL);
+#else
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
retval = get_user_pages_remote(current, current->mm, (unsigned long)uvAddr,
numPages, 0, 0, ppages, NULL);
+#else
+ retval = get_user_pages(current, current->mm, (unsigned long)uvAddr,
+ numPages, 0, 0, ppages, NULL);
+#endif
+#endif
+
+
+
up_read(&current->mm->mmap_sem);
return retval != numPages;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,26 @@
--- vmnet-only-bak/userif.c 2017-02-28 17:19:28.674984344 +0100
+++ vmnet-only/userif.c 2017-02-28 17:19:21.558424545 +0100
@@ -112,9 +112,23 @@
struct page *page = NULL;
int retval;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0)
+ unsigned int flags = FOLL_WRITE; // Write only
+#endif
+
down_read(&current->mm->mmap_sem);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0)
+ retval = get_user_pages_remote(current, current->mm, addr,
+ 1, flags, &page, NULL);
+#else
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
retval = get_user_pages_remote(current, current->mm, addr,
1, 1, 0, &page, NULL);
+#else
+ retval = get_user_pages(current, current->mm, addr,
+ 1, 1, 0, &page, NULL);
+#endif
+#endif
up_read(&current->mm->mmap_sem);
if (retval != 1) {
Loading…
Cancel
Save