Linux kernel 4.9 installation vmware12 error solution

Source: Internet
Author: User
Tags function definition

Installing VMware on Inux, prompting for exceptions at startup
Prompt to view log files
/tmp/vmware-root/vmware-19482.log
An error occurred while compiling the VMNET.O module, the error message is as follows

/TMP/MODCONFIG-4UP6CG/VMNET-ONLY/USERIF.C:117: +: error:passing argument5of ' get_user_pages ' fromIncompatible pointer type [-werror=incompatible-pointer-Types]retval= Get_user_pages (addr,1,1,0, &page, NULL);^In file included from/usr/src/linux-headers-4.9.0-deepin4-common/include/linux/highmem.h:7:0, from/TMP/MODCONFIG-4UP6CG/VMNET-ONLY/USERIF.C: -:

View USERIF.C File
Find the error location code as follows

#if linux_version_code >= kernel_version (4, 6, 0) retval = get_user_pages (addr, 1, 1, 0, &page, NULL); #elseretval = Get_user_pages (Current, current->mm, addr,1, 1, 0, &page, NULL);

In

/usr/src/linux-headers-4.9.0-deepin4-common/include/linux/mm.h
The definition of get_user_pages found in

Long Long Long  intstruct page * *pages,struct vm_area_struct **vmas);

The number of arguments is inconsistent with the userif.c inside.
is the Linux kernel modified?
Based on the USERIF.C syntax, download the header file for 4.6 to view mm.h
Discover that it is defined as follows

Long Long Long Nr_pages, int int struct Page * *pages,struct vm_area_struct **vmas);

The function definition was changed.

On GitHub, I saw the change information and found that it was merging write with force into one parameter in 4.9.
Add a macro
#define FOLL_WRITE0X01
#define FOLL_FORCE0X10
To use and operate to get these two parameters
So modify the relevant statements in USERIF.C to

#ifLinux_version_code>= Kernel_version (4, 9, 0)retval= Get_user_pages (addr,1,1, &page, NULL);#elifLinux_version_code >= kernel_version (4, 6, 0)retval= Get_user_pages (addr,1,1,0, &page, NULL);#elseretval= Get_user_pages (Current, current->mm, addr,1,1,0, &page, NULL);#endif

Perform VMware after compiling again

Execute successfully!

Linux kernel 4.9 installation vmware12 error solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.