Skip to content

Commit

Permalink
Add patch to mlnx-ofa_kernel module for IBT compatibility (#12045)
Browse files Browse the repository at this point in the history
Co-authored-by: Binu Jose Philip <[email protected]>
  • Loading branch information
binujp and Binu Jose Philip authored Jan 23, 2025
1 parent e148529 commit a181899
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
20 changes: 20 additions & 0 deletions SPECS/mlnx-ofa_kernel/001-fix-module-init-for-ibt.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This patch is based on
# https://opendev.org/starlingx/kernel/raw/commit/b6f8503866c3cae009d5b2e8e8db17149c917d9c/kernel-modules/mlnx-ofa_kernel/debian/patches/0003-Fix-the-obsolete-module-init.patch
# modified to apply cleanly with no change in logic.

--- a/include/linux/compat-2.6.h
+++ b/include/linux/compat-2.6.h
@@ -31,9 +31,11 @@
#define module_init(initfn) \
static int __init __init_backport(void) \
{ \
- mlx_backport_dependency_symbol(); \
+ mlx_backport_dependency_symbol(); \
return initfn(); \
} \
- int init_module(void) __copy(initfn) __attribute__((alias("__init_backport")));
+ int init_module(void) __copy(initfn) \
+ __attribute__((alias("__init_backport"))); \
+ ___ADDRESSABLE(init_module, __initdata);

#endif /* LINUX_26_COMPAT_H */
5 changes: 4 additions & 1 deletion SPECS/mlnx-ofa_kernel/mlnx-ofa_kernel.spec
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ Release: 1%{?dist}
License: GPLv2
Url: http://www.mellanox.com/
Group: System Environment/Base
Source0: https://linux.mellanox.com/public/repo/mlnx_ofed/24.10-0.7.0.0/SRPMS/mlnx-ofa_kernel-24.10.tgz#/%{_name}-%{_version}.tgz
Source0: https://linux.mellanox.com/public/repo/mlnx_ofed/24.10-0.7.0.0/SRPMS/mlnx-ofa_kernel-24.10.tgz#/%{_name}-%{_version}.tgz
Patch0: 001-fix-module-init-for-ibt.patch

BuildRoot: /var/tmp/%{name}-%{version}-build
Vendor: Microsoft Corporation
Distribution: Azure Linux
Expand Down Expand Up @@ -289,6 +291,7 @@ drivers against it.

%prep
%setup -n %{_name}-%{_version}
%patch 0 -p1
set -- *
mkdir source
mv "$@" source/
Expand Down

0 comments on commit a181899

Please sign in to comment.