Kernel – 5.4-rc1 Released – Odd Quirks with Kernel Symbols
Kernel 5.4-rc1 is out – a day later than usual, and brief details are here: http://lkml.iu.edu/hypermail/linux/kernel/1909.3/04895.html
My tests with VMware and NVIDIA revealed some odd errors/warning relating to kernel symbols..
With the latest NVIDIA (435.21) I got the following:
# make
make[1]: Entering directory '/usr/src/linux-5.4-rc1'
The Module.symvers file is missing, or does not contain any
symbols exported from the kernel. This could cause the NVIDIA
kernel modules to be built against a configuration that does
not accurately reflect the actual target kernel.
The Module.symvers file check can be disabled by setting the
environment variable IGNORE_MISSING_MODULE_SYMVERS to 1.
make[2]: *** [/home/rgadsdon/kernel/NVIDIA-Linux-x86_64-435.21/kernel/Kbuild:181: module_symvers_sanity_check] Error 1
make[1]: *** [Makefile:1670: /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-435.21/kernel] Error 2
make[1]: Leaving directory '/usr/src/linux-5.4-rc1'
make: *** [Makefile:81: modules] Error 2
– But… the file does exist:
# ll /usr/src/linux-5.4-rc1/Module.symvers
-rw-r--r-- 1 root root 889339 Sep 30 14:47 /usr/src/linux-5.4-rc1/Module.symvers
To get the compile working:
# export IGNORE_MISSING_MODULE_SYMVERS=1
# make
make[1]: Entering directory '/usr/src/linux-5.4-rc1'
CONFTEST: hash__remap_4k_pfn
CONFTEST: set_pages_uc
CONFTEST: list_is_first
CONFTEST: set_memory_uc
CONFTEST: set_memory_array_uc
CONFTEST: acquire_console_sem
..................
but then:
.............
SYMLINK /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-435.21/kernel/nvidia-modeset/nv-modeset-kernel.o
LD [M] /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-435.21/kernel/nvidia-modeset.o
CC [M] /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-435.21/kernel/nvidia-drm/nvidia-drm.o
CC [M] /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-435.21/kernel/nvidia-drm/nvidia-drm-drv.o
/home/rgadsdon/kernel/NVIDIA-Linux-x86_64-435.21/kernel/nvidia-drm/nvidia-drm-drv.c:662:44: error: ‘DRIVER_PRIME’ undeclared here (not in a function); did you mean ‘DRIVER_PCI_DMA’?
662 | .driver_features = DRIVER_GEM | DRIVER_PRIME | DRIVER_RENDER,
| ^~~~~~~~~~~~
| DRIVER_PCI_DMA
make[2]: *** [scripts/Makefile.build:266: /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-435.21/kernel/nvidia-drm/nvidia-drm-drv.o] Error 1
make[1]: *** [Makefile:1670: /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-435.21/kernel] Error 2
make[1]: Leaving directory '/usr/src/linux-5.4-rc1'
make: *** [Makefile:81: modules] Error 2
So – more investigation is needed here..
With VMware 15.5.0, there is a 5.4 patched version of vmmon/vmnet at https://github.com/mkubecek/vmware-host-modules/tree/tmp/workstation-15.5.0-k5.4
I applied these, and the vmmon/vmnet compile completed, but with some odd warnings (output truncated):
.....................
WARNING: module vmmon uses symbol alloc_pages_current from namespace uptible, but does not import it.
WARNING: module vmmon uses symbol kmalloc_caches from namespace nterruptible, but does not import it.
WARNING: module vmmon uses symbol __kmalloc from namespace ock_interruptible, but does not import it.
WARNING: module vmmon uses symbol up_read from namespace _lock_interruptible, but does not import it.
WARNING: module vmmon uses symbol __put_devmap_managed_page from namespace e, but does not import it.
WARNING: module vmmon uses symbol vmalloc from namespace _lock_interruptible, but does not import it.
WARNING: module vmmon uses symbol schedule_hrtimeout from namespace ruptible, but does not import it.
WARNING: module vmmon uses symbol gdt_page from namespace lock_interruptible, but does not import it.
WARNING: module vmmon uses symbol vm_node_stat from namespace _interruptible, but does not import it.
WARNING: module vmmon uses symbol init_timer_key from namespace nterruptible, but does not import it.
WARNING: module vmmon uses symbol vfree from namespace ex_lock_interruptible, but does not import it.
WARNING: module vmmon uses symbol __get_user_1 from namespace _interruptible, but does not import it.
WARNING: module vmmon uses symbol tsc_khz from namespace _lock_interruptible, but does not import it.
WARNING: module vmmon uses symbol cpu_number from namespace ck_interruptible, but does not import it.
WARNING: module vmmon uses symbol vmemmap_base from namespace _interruptible, but does not import it.
WARNING: module vmmon uses symbol kthread_create_on_node from namespace ible, but does not import it.
WARNING: module vmmon uses symbol jiffies from namespace _lock_interruptible, but does not import it.
WARNING: module vmmon uses symbol down_read from namespace ock_interruptible, but does not import it.
WARNING: module vmmon uses symbol vm_zone_stat from namespace _interruptible, but does not import it.
WARNING: module vmmon uses symbol _copy_to_user from namespace interruptible, but does not import it.
WARNING: module vmmon uses symbol misc_register from namespace interruptible, but does not import it.
WARNING: module vmmon uses symbol del_timer_sync from namespace nterruptible, but does not import it.
WARNING: module vmmon uses symbol memset from namespace x_lock_interruptible, but does not import it.
WARNING: module vmmon uses symbol __default_kernel_pte_mask from namespace e, but does not import it.
WARNING: module vmmon uses symbol vmalloc_to_pfn from namespace nterruptible, but does not import it.
WARNING: module vmmon uses symbol current_task from namespace _interruptible, but does not import it.
WARNING: module vmmon uses symbol printk from namespace x_lock_interruptible, but does not import it.
WARNING: module vmmon uses symbol kthread_stop from namespace _interruptible, but does not import it.
WARNING: module vmmon uses symbol _totalram_pages from namespace terruptible, but does not import it.
WARNING: module vmmon uses symbol ktime_get_raw_ts64 from namespace ruptible, but does not import it.
WARNING: module vmmon uses symbol vmap from namespace tex_lock_interruptible, but does not import it.
WARNING: module vmmon uses symbol _cond_resched from namespace interruptible, but does not import it.
WARNING: module vmmon uses symbol __x86_indirect_thunk_rbx from namespace le, but does not import it.
WARNING: module vmmon uses symbol down from namespace tex_lock_interruptible, but does not import it.
WARNING: module vmmon uses symbol mod_timer from namespace ock_interruptible, but does not import it.
WARNING: module vmmon uses symbol poll_freewait from namespace interruptible, but does not import it.
WARNING: module vmmon uses symbol add_timer from namespace ock_interruptible, but does not import it.
WARNING: module vmmon uses symbol up_write from namespace lock_interruptible, but does not import it.
WARNING: module vmmon uses symbol down_write from namespace ck_interruptible, but does not import it.
WARNING: module vmmon uses symbol fput from namespace tex_lock_interruptible, but does not import it.
WARNING: module vmmon uses symbol poll_initwait from namespace interruptible, but does not import it.
WARNING: module vmmon uses symbol page_offset_base from namespace erruptible, but does not import it.
WARNING: module vmmon uses symbol kmem_cache_alloc from namespace erruptible, but does not import it.
WARNING: module vmmon uses symbol __free_pages from namespace _interruptible, but does not import it.
WARNING: module vmmon uses symbol smp_call_function from namespace rruptible, but does not import it.
WARNING: module vmmon uses symbol ioremap_nocache from namespace terruptible, but does not import it.
WARNING: module vmmon uses symbol cpu_khz from namespace _lock_interruptible, but does not import it.
WARNING: module vmmon uses symbol __get_free_pages from namespace erruptible, but does not import it.
WARNING: module vmmon uses symbol __stack_chk_fail from namespace erruptible, but does not import it.
WARNING: module vmmon uses symbol schedule_timeout from namespace erruptible, but does not import it.
WARNING: module vmmon uses symbol schedule from namespace lock_interruptible, but does not import it.
WARNING: module vmmon uses symbol __x86_indirect_thunk_rax from namespace le, but does not import it.
WARNING: module vmmon uses symbol wake_up_process from namespace terruptible, but does not import it.
WARNING: module vmmon uses symbol msleep_interruptible from namespace ptible, but does not import it.
WARNING: module vmmon uses symbol _raw_spin_lock from namespace nterruptible, but does not import it.
WARNING: module vmmon uses symbol vsnprintf from namespace ock_interruptible, but does not import it.
WARNING: module vmmon uses symbol free_pages from namespace ck_interruptible, but does not import it.
...etc, etc ..........
– and with similar warnings for vmnet..
Despite this, the modules install, and #vmare seems to work OK? (tested with Win7 guest).
I did think that this might be a kernel config problem at my end, but installed the pre-compiled Fedora (Rawhide) kernel version – 5.4.0-0.rc0.git6.1.fc32.x86_64 – and got similar results.
So.. more investigation needed!
Robert Gadsdon. September 30th 2019.
Patch for 5.4 build tested only http://ix.io/1MRE
Format of Module.symvers has changed adding extra tab and namespace the symbol is in if any. [1]
Per file build flags now must include the path to the file instead of just the filename. [2]
DRIVER_PRIME flag is dropped as redundant. [3]
[1] Is also the cause of the warnings you highlighted.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cb9b55d21fe06ca5e4ba244bb5aac0afeb745c8e
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=54b8ae66ae1a3454a7645d159a482c31cd89ab33
[3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ee8375d5dc5bbb50b03bedfb0020d3e1c27ceacb
Thanks for the details.. Expect a lot of patches/new versions of 3rd-party applications..!
RG.
The vmmon warnings are malformed in a strange way, as if something preserved the beginning and the end bug cut out the middle to limit line length… are you using some wrapper that could do this? In any case, the symbols reported should not be in any symbol namespace – and I doubt there would be symbol namespace “mutex_lock_interruptible” so there is something seriously wrong but I have no idea what could cause these warnings (and I don’t see them in my builds).
The false positive namespace warnings are fixed by [1].
[1] https://www.spinics.net/lists/linux-kbuild/msg23445.html
Interesting. I wonder why I never hit this issue, neither when building against a mainline snapshot with just “make modules_prepare” (including v5.4-rc1), neither against a full set of RPM packages. But now I get these warnings with 5.4-rc1 packages… Thanks for the information.