Skip to content

workstation 17.5.1 make failed when using RHEL with kernel version: 5.14.0-427.13.1.el9_4.x86_64 #244

@Paperside

Description

@Paperside

Briefly speaking, you may do following things to fix the problem:

Find the following part in ./vmmon-only/include/pgtbl.h and ./vmnet-only/bridge.c then modify them as follows:

  • pgtbl.h
...
 91#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,5,0)
 92             pte_t *pte = pte_offset_kernel(pmd, addr);
 93 #else
 94             pte_t *pte = pte_offset_map(pmd, addr);
 95 #endif
...

line 94: replace pte_offset_map with pte_offset_kernel to make kernel version check invalid

 94             pte_t *pte = pte_offset_kernel(pmd, addr);
  • bridge.c
...
  28
  29 #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 10)
  30 #include <net/gso.h>
  31 #endif
...

line 28: add #include <net/gso.h> so that net/gso.h will be included anyway

  28 #include <net/gso.h>

Hopefully that may solve the problems!

The Following part is my analysing experience:

VMWare workstation cannot automatically install vmmon and vmnet modules with error logs like this:

2024-05-02T04:02:14.437Z In(05) host-6681 ERROR: modpost: "__pte_offset_map" [/tmp/modconfig-HY9acv/vmmon-only/vmmon.ko] undefined!
2024-05-02T04:02:14.437Z In(05) host-6681 make[2]: *** [scripts/Makefile.modpost:134: /tmp/modconfig-HY9acv/vmmon-only/Module.symvers] Error 1
2024-05-02T04:02:14.437Z In(05) host-6681 make[2]: *** Deleting file '/tmp/modconfig-HY9acv/vmmon-only/Module.symvers'
2024-05-02T04:02:14.437Z In(05) host-6681 make[1]: *** [Makefile:1848: modules] Error 2
2024-05-02T04:02:14.437Z In(05) host-6681 make: *** [Makefile:117: vmmon.ko] Error 2
2024-05-02T04:02:14.437Z In(05) host-6681 Using kernel build system.
2024-05-02T04:02:14.437Z In(05) host-6681 /tmp/modconfig-HY9acv/vmnet-only/bridge.c: In function ‘VNetBridgeSendLargePacket’:
2024-05-02T04:02:14.437Z In(05) host-6681 /tmp/modconfig-HY9acv/vmnet-only/bridge.c:1416:11: error: implicit declaration of function ‘skb_gso_segment’; did you mean ‘tcp_gso_segment’? [-Werror=implicit-function-declaration]
2024-05-02T04:02:14.437Z In(05) host-6681  1416 |    segs = skb_gso_segment(skb, 0);
2024-05-02T04:02:14.437Z In(05) host-6681       |           ^~~~~~~~~~~~~~~
2024-05-02T04:02:14.437Z In(05) host-6681       |           tcp_gso_segment
2024-05-02T04:02:14.437Z In(05) host-6681 /tmp/modconfig-HY9acv/vmnet-only/bridge.c:1416:9: warning: assignment to ‘struct sk_buff *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
2024-05-02T04:02:14.437Z In(05) host-6681  1416 |    segs = skb_gso_segment(skb, 0);
2024-05-02T04:02:14.437Z In(05) host-6681       |         ^
2024-05-02T04:02:14.437Z In(05) host-6681 cc1: some warnings being treated as errors
2024-05-02T04:02:14.437Z In(05) host-6681 make[2]: *** [scripts/Makefile.build:299: /tmp/modconfig-HY9acv/vmnet-only/bridge.o] Error 1
2024-05-02T04:02:14.437Z In(05) host-6681 make[2]: *** Waiting for unfinished jobs....
2024-05-02T04:02:14.437Z In(05) host-6681 make[1]: *** [Makefile:1934: /tmp/modconfig-HY9acv/vmnet-only] Error 2

Thus I cloned this git repo to mannually compile and install vmmon and vmnet. But when I switched to the correct branch and began to make, the same error occurs:

ERROR: modpost: "__pte_offset_map" [/root/Downloads/vmware-host-modules/vmmon-only/vmmon.ko] undefined!
make[3]: *** [scripts/Makefile.modpost:134: /root/Downloads/vmware-host-modules/vmmon-only/Module.symvers] Error 1
make[3]: *** Deleting file '/root/Downloads/vmware-host-modules/vmmon-only/Module.symvers'
make[2]: *** [Makefile:1848: modules] Error 2
make[2]: Leaving directory '/usr/src/kernels/5.14.0-427.13.1.el9_4.x86_64'
make[1]: *** [Makefile:117: vmmon.ko] Error 2
make[1]: Leaving directory '/root/Downloads/vmware-host-modules/vmmon-only'
make: *** [Makefile:21: vmmon-only] Error 2
/root/Downloads/vmware-host-modules/vmnet-only/bridge.c: In function ‘VNetBridgeSendLargePacket’:
/root/Downloads/vmware-host-modules/vmnet-only/bridge.c:1418:11: error: implicit declaration of function ‘skb_gso_segment’; did you mean ‘tcp_gso_segment’? [-Werror=implicit-function-declaration]
 1418 |    segs = skb_gso_segment(skb, 0);
      |           ^~~~~~~~~~~~~~~
      |           tcp_gso_segment
/root/Downloads/vmware-host-modules/vmnet-only/bridge.c:1418:9: warning: assignment to ‘struct sk_buff *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
 1418 |    segs = skb_gso_segment(skb, 0);
      |         ^
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:299: /root/Downloads/vmware-host-modules/vmnet-only/bridge.o] Error 1
make[2]: *** [Makefile:1934: /root/Downloads/vmware-host-modules/vmnet-only] Error 2
make[2]: Leaving directory '/usr/src/kernels/5.14.0-427.13.1.el9_4.x86_64'
make[1]: *** [Makefile:117: vmnet.ko] Error 2
make[1]: Leaving directory '/root/Downloads/vmware-host-modules/vmnet-only'
make: *** [Makefile:21: vmnet-only] Error 2

Eventually I checked ./vmmon-only/include/pgtbl.h and ./vmnet-only/bridge.c then found out why:
Linux branches like RHEL CentOS and Fedora have different linux kernel version name definition compare to other branches like Ubuntu, who uses standard linux kernel version name instead. If you execute uname -r to get kernel version in ubuntu 22.04, you are likely to get this :

6.5.0-28-generic

But when you run that in RHEL9 or CentOS 9 Stream...You will get this:

5.14.0-427.13.1.el9_4.x86_64

RHEL 9 actually have a newer kernel but its version is even lower!

Now let's check out what is in ./vmmon-only/include/pgtbl.h and ./vmnet-only/bridge.c :

  • pgtbl.h
...
 91#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,5,0)
 92             pte_t *pte = pte_offset_kernel(pmd, addr);
 93 #else
 94             pte_t *pte = pte_offset_map(pmd, addr);
 95 #endif
...
  • bridge.c
...
  29 #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 10)
  30 #include <net/gso.h>
  31 #endif
...

Have you figured out where the problem lies in? That's exactly: Your linux kernel version(5.14.0) is probably misjudjed as "OUT OF DATE(>=6.5.0|>=6.4.10)" in the two files. But that's not true.
Now that we have known the possible reason, it's comparatively easy to fix them up though the way may not be very elegant, just edit the two files like this:

  • pgtbl.h
...
 91#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,5,0)
 92             pte_t *pte = pte_offset_kernel(pmd, addr);
 93 #else
 94             pte_t *pte = pte_offset_kernel(pmd, addr);//replace "pte_offset_map" with "pte_offset_kernel" to make kernel version check invalid
 95 #endif
...
  • bridge.c
...
  28 #include <net/gso.h> //add this line so that net/gso.h will be included anyway
  29 #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 10)
  30 #include <net/gso.h>
  31 #endif
...

I have no idea about whether there are still other files have similar problems, but I installed vmmon and vmnet successfully after fixed up only both of the two files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions