Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kernel 6.11.0-12, vmware-host-modules-workstation-17.5.1. Error dev_base_lock undeclared #292

Closed
alexey-koran opened this issue Dec 12, 2024 · 4 comments

Comments

@alexey-koran
Copy link

OS

  • Ubuntu 24.10
  • Kernel 6.11.0-12-generic
  • vmware-host-modules-workstation-17.5.1

Error:

make -C vmmon-only 
make[1]: Entering directory '/home/user/vmware/vmware-host-modules-workstation-17.5.1/vmmon-only'
Using kernel build system.
make -C /lib/modules/6.11.0-12-generic/build/include/.. M=$PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= modules
make[2]: Entering directory '/usr/src/linux-headers-6.11.0-12-generic'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: x86_64-linux-gnu-gcc-14 (Ubuntu 14.2.0-4ubuntu2) 14.2.0
  You are using:           gcc-14 (Ubuntu 14.2.0-4ubuntu2) 14.2.0
make[2]: Leaving directory '/usr/src/linux-headers-6.11.0-12-generic'
make -C $PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= postbuild
make[2]: Entering directory '/home/user/vmware/vmware-host-modules-workstation-17.5.1/vmmon-only'
make[2]: 'postbuild' is up to date.
make[2]: Leaving directory '/home/user/vmware/vmware-host-modules-workstation-17.5.1/vmmon-only'
cp -f vmmon.ko ./../vmmon.o
make[1]: Leaving directory '/home/user/vmware/vmware-host-modules-workstation-17.5.1/vmmon-only'
make -C vmnet-only 
make[1]: Entering directory '/home/user/vmware/vmware-host-modules-workstation-17.5.1/vmnet-only'
Using kernel build system.
make -C /lib/modules/6.11.0-12-generic/build/include/.. M=$PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= modules
make[2]: Entering directory '/usr/src/linux-headers-6.11.0-12-generic'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: x86_64-linux-gnu-gcc-14 (Ubuntu 14.2.0-4ubuntu2) 14.2.0
  You are using:           gcc-14 (Ubuntu 14.2.0-4ubuntu2) 14.2.0
  CC [M]  /home/user/vmware/vmware-host-modules-workstation-17.5.1/vmnet-only/bridge.o
In file included from /home/user/vmware/vmware-host-modules-workstation-17.5.1/vmnet-only/bridge.c:56:
/home/user/vmware/vmware-host-modules-workstation-17.5.1/vmnet-only/vnetInt.h:49:9: warning: "MAX" redefined
   49 | #define MAX(_a, _b)   (((_a) > (_b)) ? (_a) : (_b))
      |         ^~~
In file included from ./include/linux/kernel.h:28,
                 from /home/user/vmware/vmware-host-modules-workstation-17.5.1/vmnet-only/bridge.c:23:
./include/linux/minmax.h:330:9: note: this is the location of the previous definition
  330 | #define MAX(a,b) __cmp(max,a,b)
      |         ^~~
In file included from ./include/linux/spinlock.h:305,
                 from ./include/linux/sched.h:2116,
                 from /home/user/vmware/vmware-host-modules-workstation-17.5.1/vmnet-only/bridge.c:25:
/home/user/vmware/vmware-host-modules-workstation-17.5.1/vmnet-only/bridge.c: In function ‘VNetBridgeReceiveFromVNet’:
/home/user/vmware/vmware-host-modules-workstation-17.5.1/vmnet-only/vmnetInt.h:44:39: error: ‘dev_base_lock’ undeclared (first use in this function); did you mean ‘device_lock’?
   44 | #define dev_lock_list()    read_lock(&dev_base_lock)
      |                                       ^~~~~~~~~~~~~
./include/linux/rwlock.h:56:48: note: in definition of macro ‘read_lock’
   56 | #define read_lock(lock)         _raw_read_lock(lock)
      |                                                ^~~~
/home/user/vmware/vmware-host-modules-workstation-17.5.1/vmnet-only/bridge.c:587:4: note: in expansion of macro ‘dev_lock_list’
  587 |    dev_lock_list();
      |    ^~~~~~~~~~~~~
/home/user/vmware/vmware-host-modules-workstation-17.5.1/vmnet-only/vmnetInt.h:44:39: note: each undeclared identifier is reported only once for each function it appears in
   44 | #define dev_lock_list()    read_lock(&dev_base_lock)
      |                                       ^~~~~~~~~~~~~
./include/linux/rwlock.h:56:48: note: in definition of macro ‘read_lock’
   56 | #define read_lock(lock)         _raw_read_lock(lock)
      |                                                ^~~~
/home/user/vmware/vmware-host-modules-workstation-17.5.1/vmnet-only/bridge.c:587:4: note: in expansion of macro ‘dev_lock_list’
  587 |    dev_lock_list();
      |    ^~~~~~~~~~~~~
/home/user/vmware/vmware-host-modules-workstation-17.5.1/vmnet-only/bridge.c: In function ‘VNetBridgeUp’:
/home/user/vmware/vmware-host-modules-workstation-17.5.1/vmnet-only/vmnetInt.h:44:39: error: ‘dev_base_lock’ undeclared (first use in this function); did you mean ‘device_lock’?
   44 | #define dev_lock_list()    read_lock(&dev_base_lock)
      |                                       ^~~~~~~~~~~~~
./include/linux/rwlock.h:56:48: note: in definition of macro ‘read_lock’
   56 | #define read_lock(lock)         _raw_read_lock(lock)
      |                                                ^~~~
/home/user/vmware/vmware-host-modules-workstation-17.5.1/vmnet-only/bridge.c:902:4: note: in expansion of macro ‘dev_lock_list’
  902 |    dev_lock_list();
      |    ^~~~~~~~~~~~~
make[4]: *** [scripts/Makefile.build:244: /home/user/vmware/vmware-host-modules-workstation-17.5.1/vmnet-only/bridge.o] Error 1
make[3]: *** [/usr/src/linux-headers-6.11.0-12-generic/Makefile:1931: /home/user/vmware/vmware-host-modules-workstation-17.5.1/vmnet-only] Error 2
make[2]: *** [Makefile:224: __sub-make] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-6.11.0-12-generic'
make[1]: *** [Makefile:117: vmnet.ko] Error 2
make[1]: Leaving directory '/home/user/vmware/vmware-host-modules-workstation-17.5.1/vmnet-only'
make: *** [Makefile:21: vmnet-only] Error 2
@alexey-koran
Copy link
Author

Solution

Replace

#define dev_lock_list() read_lock(&dev_base_lock)
#define dev_unlock_list() read_unlock(&dev_base_lock)

To

#define dev_lock_list()    rcu_read_lock()
#define dev_unlock_list()  rcu_read_unlock()

@eku
Copy link

eku commented Dec 12, 2024

It's already there

#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 9, 0)
#   define dev_lock_list()    rcu_read_lock()
#   define dev_unlock_list()  rcu_read_unlock()
#else
#   define dev_lock_list()    read_lock(&dev_base_lock)
#   define dev_unlock_list()  read_unlock(&dev_base_lock)
#endif

@alexey-koran
Copy link
Author

It's already there

#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 9, 0)
#   define dev_lock_list()    rcu_read_lock()
#   define dev_unlock_list()  rcu_read_unlock()
#else
#   define dev_lock_list()    read_lock(&dev_base_lock)
#   define dev_unlock_list()  read_unlock(&dev_base_lock)
#endif

I don't see it in https://github.com/mkubecek/vmware-host-modules/tree/workstation-17.5.1/

@eku
Copy link

eku commented Dec 13, 2024

I'm sorry, you are right.

I've took the changes from #243 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants