There are two different issues, I was able to patch out the first issue but not the second.
- The compat layer is wrong for kernel 4.1, it has kvzalloc and kvzalloc_node but not kvzalloc_array, so the include/linux/mm.h does not add the needed inline calls. This is trivial to fix and I’m able to rebuild the kernel modules to completion. Below is a very crude patch to get past the compilation errors.
diff -uNr mlnx-ofa_kernel-4.2/source/include/linux/mm.h mlnx-ofa_kernel-4.2p/source/include/linux/mm.h
— mlnx-ofa_kernel-4.2/source/include/linux/mm.h 2017-11-29 01:37:46.000000000 -0500
+++ mlnx-ofa_kernel-4.2p/source/include/linux/mm.h 2018-01-24 13:43:26.238722837 -0500
@@ -5,18 +5,18 @@
#include_next <linux/mm.h>
-#ifndef HAVE_KVZALLOC
+//#ifndef HAVE_KVZALLOC
#include <linux/vmalloc.h>
#include <linux/slab.h>
-static inline void *kvzalloc(unsigned long size,…) {
- void *rtn;
-
- rtn = kzalloc(size, GFP_KERNEL | __GFP_NOWARN);
- if (!rtn)
- rtn = vzalloc(size);
- return rtn;
-}
+//static inline void *kvzalloc(unsigned long size,…) {
+// void *rtn;
+//
+// rtn = kzalloc(size, GFP_KERNEL | __GFP_NOWARN);
+// if (!rtn)
+// rtn = vzalloc(size);
+// return rtn;
+//}
static inline void *kvmalloc_array(size_t n, size_t size,…) {
void *rtn;
@@ -27,14 +27,14 @@
return rtn;
}
-static inline void *kvmalloc_node(size_t size, gfp_t flags, int node) {
- void *rtn;
-
- rtn = kmalloc_node(size, GFP_KERNEL | __GFP_NOWARN, node);
- if (!rtn)
- rtn = vmalloc(size);
- return rtn;
-}
-#endif
+//static inline void *kvmalloc_node(size_t size, gfp_t flags, int node) {
+// void *rtn;
+//
+// rtn = kmalloc_node(size, GFP_KERNEL | __GFP_NOWARN, node);
+// if (!rtn)
+// rtn = vmalloc(size);
+// return rtn;
+//}
+//#endif
#endif /* _COMPAT_LINUX_MM_H */
- The built modules appear to have some incompatibility with dtrace. I’ve tried multiple kernel sources including the debian dkms based builds and run into the same module incompatibility. Nothing seems to connect with the uek patched for meltdown.
[11491.875055] Compat-mlnx-ofed backport release: f8de107
[11491.875057] Backport based on mlnx_ofed/mlnx-ofa_kernel-4.0.git f8de107
[11491.875058] compat.git: mlnx_ofed/mlnx-ofa_kernel-4.0.git
[11491.875652] mlx4_core: Unknown symbol __dtrace_probe___lockstat_spin__release (err 0)
[11491.929725] mlx4_core: Unknown symbol __dtrace_probe___lockstat_spin__release (err 0)
[11491.990485] mlx4_core: Unknown symbol __dtrace_probe___lockstat_spin__release (err 0)
[11492.040993] mlx4_core: Unknown symbol __dtrace_probe___lockstat_spin__release (err 0)
[11492.094618] mlx5_core: Unknown symbol __dtrace_probe___lockstat_spin__release (err 0)
[11492.094650] mlx5_core: Unknown symbol __dtrace_probe___lockstat_rw__release (err 0)
[11492.149108] ib_core: Unknown symbol __dtrace_probe___lockstat_spin__release (err 0)
[11492.149128] ib_core: Unknown symbol __dtrace_probe___lockstat_rw__release (err 0)
[11492.193283] mlx5_core: Unknown symbol __dtrace_probe___lockstat_spin__release (err 0)
[11492.193321] mlx5_core: Unknown symbol __dtrace_probe___lockstat_rw__release (err 0)
[11492.251776] ib_core: Unknown symbol __dtrace_probe___lockstat_spin__release (err 0)
[11492.251796] ib_core: Unknown symbol __dtrace_probe___lockstat_rw__release (err 0)
[11492.300214] ib_core: Unknown symbol __dtrace_probe___lockstat_spin__release (err 0)
[11492.300234] ib_core: Unknown symbol __dtrace_probe___lockstat_rw__release (err 0)
[11492.347375] ib_core: Unknown symbol __dtrace_probe___lockstat_spin__release (err 0)
[11492.347396] ib_core: Unknown symbol __dtrace_probe___lockstat_rw__release (err 0)
So I’m stuck at well.