Skip to content

vmmon/vmnet: Build fixes for kernel 6.17.0-14-generic#329

Open
MorphyKutay wants to merge 1 commit intomkubecek:masterfrom
MorphyKutay:workstation-17.6.4
Open

vmmon/vmnet: Build fixes for kernel 6.17.0-14-generic#329
MorphyKutay wants to merge 1 commit intomkubecek:masterfrom
MorphyKutay:workstation-17.6.4

Conversation

@MorphyKutay
Copy link
Copy Markdown

Pull Request: vmmon/vmnet – Linux 6.17.0 Compatibility

Overview

These changes enable the vmware-host-modules project to build against Linux kernel 6.17.0-14-generic. Kernel API changes, removed symbols, and objtool warnings have been addressed.


1. Makefile / Build System

Issue

  • driver-config.h could not be found.
  • SRCROOT was not propagated correctly in the kernel sub-build.

Solution

  • vmmon-only/Makefile and vmnet-only/Makefile: Pass the module directory via VMWARE_MOD_ROOT=$(cd $$PWD && pwd) during the build.
  • vmmon-only/Makefile.kernel and vmnet-only/Makefile.kernel: Use VMWARE_MOD_ROOT for MOD_ROOT, and pass -DVMMON/-DVMCORE and include paths via ccflags-y.

Objtool Skipped

  • common/phystrack.o: objtool tail-call / fallthrough warnings
  • common/task.o: objtool "unexpected end of section" for Task_Switch()
  • userif.o (vmnet): objtool csum_partial_copy_nocheck uaccess warning

OBJECT_FILES_NON_STANDARD was added for these files.


2. Timer API

Issue

  • Kernel 6.10+ removed del_timer_sync; it was replaced by timer_delete_sync.
  • Implicit declaration errors were produced.

Solution

  • vmmon-only/include/compat_timer.h added:
    • #include <linux/timer.h>
    • For LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0): #define del_timer_sync timer_delete_sync
  • Included compat_timer.h in driver.c and hostif.c.

3. Page Table API

Issue

  • Kernel 6.9+ removed pgd_large, p4d_large, pud_large, and pmd_large.
  • The new equivalents are pgd_leaf, p4d_leaf, pud_leaf, and pmd_leaf.
  • On x86 only pud_leaf and pmd_leaf exist; pgd_leaf and p4d_leaf are not defined.

Solution

  • vmmon-only/include/compat_pgtable.h: For 6.9+, map compat_pud_largepud_leaf and compat_pmd_largepmd_leaf; use (0) for compat_pgd_large and compat_p4d_large on x86.
  • vmmon-only/include/pgtbl.h: Replaced direct uses with the compat_* macros.

4. MSR API

Issue

  • rdmsrl_safe is no longer available; rdmsrq_safe should be used instead.

Solution

  • hostif.c: Replaced rdmsrl_safe with rdmsrq_safe and added #include <asm/msr.h>.

5. Crosspage Assembly (RETHUNK / objtool)

Issue

  • Objtool reported: "naked return found in MITIGATION_RETHUNK build".
  • Plain ret must use the return thunk (__x86_return_thunk).
  • GDT_SIZE conflicted with a kernel header definition.

Solution

  • crosspage.c: Added #include <asm/linkage.h> and replaced ret with ASM_RET.
  • segs.h: Renamed GDT_SIZEVMMON_GDT_SIZE and GDT_LIMITVMMON_GDT_LIMIT.
  • crosspage.c: Updated references to use VMMON_GDT_LIMIT.

6. random_get_entropy_fallback (vmx86.c)

Issue

  • The inline function in asm/timex.h calls random_get_entropy_fallback().
  • This function was not declared in the module build context.

Solution

  • vmx86.c: Added extern unsigned long random_get_entropy_fallback(void); before including asm/timex.h.

7. vmnet: dev_base_lock

Issue

  • Kernel 6.6+ removed dev_base_lock.

Solution

  • vmnet-only/vmnetInt.h: For 6.6+, map dev_lock_list()rtnl_lock() and dev_unlock_list()rtnl_unlock().

Modified / Added Files

File Change
vmmon-only/Makefile VMWARE_MOD_ROOT propagation
vmmon-only/Makefile.kernel MOD_ROOT, ccflags-y, OBJECT_FILES_NON_STANDARD
vmnet-only/Makefile VMWARE_MOD_ROOT propagation
vmnet-only/Makefile.kernel MOD_ROOT, OBJECT_FILES_NON_STANDARD
vmmon-only/include/compat_timer.h New file
vmmon-only/include/compat_pgtable.h 6.9+ page table compatibility
vmmon-only/include/pgtbl.h compat_* macro usage
vmmon-only/include/segs.h VMMON_GDT_SIZE, VMMON_GDT_LIMIT
vmmon-only/linux/driver.c compat_timer.h include
vmmon-only/linux/hostif.c compat_timer.h, asm/msr.h, rdmsrq_safe
vmmon-only/common/crosspage.c ASM_RET, linkage.h, GDT_LIMIT
vmmon-only/common/vmx86.c random_get_entropy_fallback extern
vmnet-only/vmnetInt.h dev_base_lock → rtnl_lock (6.6+)

Testing

  • make successfully builds both vmmon and vmnet modules.
  • make install installs them under /lib/modules/6.17.0-14-generic/misc/.
  • Target kernel: 6.17.0-14-generic (Ubuntu).

@eku
Copy link
Copy Markdown

eku commented Mar 11, 2026

I'm wondering why changes to 168 files are needed to fix some problems with kernel API?

@mkonnov
Copy link
Copy Markdown

mkonnov commented Mar 19, 2026

I can confirm it worked for 6.17.0-19-generic against VMware Workstation 17.5.1 build-23298084

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

Successfully merging this pull request may close these issues.

3 participants