Last active
June 19, 2017 22:16
-
-
Save salaros/07a3a18aee05bcf169d9c7bd9c98ff2c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static int | |
HostIFGetUserPages(void *uvAddr, // IN | |
struct page **ppages, // OUT | |
unsigned int numPages) // IN | |
{ | |
int retval; | |
down_read(¤t->mm->mmap_sem); | |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0) | |
unsigned int flags = 0; | |
flags |= 1; | |
retval = get_user_pages_remote(current, current->mm, (unsigned long)uvAddr, | |
numPages, flags, 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, | |
numPages, 0, 0, ppages, NULL); | |
#endif | |
up_read(¤t->mm->mmap_sem); | |
return retval != numPages; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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, | |
numPages, 0, 0, ppages, NULL); | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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); | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /usr/lib/vmware/modules/source | |
cp vmnet.tar vmnet.tar.bak | |
cp vmmon.tar vmmon.tar.bak | |
tar cf vmmon.tar vmmon-only/ | |
tar cf vmnet.tar vmnet-only/ | |
# The row below usually works, however on some computers we had | |
# to run 'vmware' as root in order to trigger module installation | |
vmware-modconfig --console --install-all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /usr/lib/vmware/modules/source | |
tar xfv vmmon.tar | |
tar xfv vmnet.tar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0) | |
retval = get_user_pages(addr, 1, 1, 0, &page, NULL); | |
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0) | |
unsigned int flags = 0; | |
flags |= 1; | |
retval = get_user_pages_remote(current, current->mm, addr, 1, flags, &page, NULL); | |
#else | |
retval = get_user_pages(current, current->mm, addr, | |
1, 1, 0, &page, NULL); | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment