Skip to content

Commit f2238bb

Browse files
Fix RHEL 8
Signed-off-by: Attila Fülöp <attila@fueloep.org> Co-authored-by: Brian Behlendorf <behlendorf1@llnl.gov>
1 parent d58740d commit f2238bb

File tree

5 files changed

+49
-0
lines changed

5 files changed

+49
-0
lines changed

config/kernel-objtool.m4

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ AC_DEFUN([ZFS_AC_KERNEL_OBJTOOL_HEADER], [
1111
#include <linux/objtool.h>
1212
],[
1313
],[
14+
objtool_header=$LINUX/include/linux/objtool.h
1415
AC_DEFINE(HAVE_KERNEL_OBJTOOL_HEADER, 1,
1516
[kernel has linux/objtool.h])
1617
AC_MSG_RESULT(linux/objtool.h)
1718
],[
19+
objtool_header=$LINUX/include/linux/frame.h
1820
AC_MSG_RESULT(linux/frame.h)
1921
])
2022
])
@@ -62,6 +64,17 @@ AC_DEFUN([ZFS_AC_KERNEL_OBJTOOL], [
6264
AC_MSG_RESULT(yes)
6365
AC_DEFINE(HAVE_STACK_FRAME_NON_STANDARD, 1,
6466
[STACK_FRAME_NON_STANDARD is defined])
67+
68+
dnl # Needed for kernels missing the asm macro.
69+
AC_MSG_CHECKING(
70+
[whether STACK_FRAME_NON_STANDARD asm macro is defined])
71+
AS_IF([$GREP -s -q ".macro STACK_FRAME_NON_STANDARD" $objtool_header],[
72+
AC_MSG_RESULT(yes)
73+
AC_DEFINE(HAVE_STACK_FRAME_NON_STANDARD_ASM, 1,
74+
[STACK_FRAME_NON_STANDARD asm macro is defined])
75+
],[
76+
AC_MSG_RESULT(no)
77+
])
6578
],[
6679
AC_MSG_RESULT(no)
6780
])

include/sys/frame.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ extern "C" {
3131
#else
3232
#include <linux/frame.h>
3333
#endif
34+
#if ! defined(HAVE_STACK_FRAME_NON_STANDARD_ASM)
35+
.macro STACK_FRAME_NON_STANDARD func:req
36+
.endm
37+
#endif
3438
#else
3539
#define STACK_FRAME_NON_STANDARD(func)
3640
#if defined(_ASM)

module/icp/asm-x86_64/modes/aesni-gcm-x86_64.S

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,6 +1262,18 @@ SECTION_STATIC
12621262
.byte 65,69,83,45,78,73,32,71,67,77,32,109,111,100,117,108,101,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
12631263
.balign 64
12641264

1265+
/* Workaround for missing asm macro in RHEL 8. */
1266+
#if defined(__linux__) && defined(HAVE_STACK_FRAME_NON_STANDARD) && \
1267+
! defined(HAVE_STACK_FRAME_NON_STANDARD_ASM)
1268+
.section .discard.func_stack_frame_non_standard, "aw"
1269+
#ifdef HAVE_MOVBE
1270+
.long _aesni_ctr32_ghash_6x - .
1271+
#endif
1272+
.long _aesni_ctr32_ghash_no_movbe_6x - .
1273+
.long aesni_gcm_decrypt - .
1274+
.long aesni_gcm_encrypt - .
1275+
#endif
1276+
12651277
/* Mark the stack non-executable. */
12661278
#if defined(__linux__) && defined(__ELF__)
12671279
.section .note.GNU-stack,"",%progbits

module/icp/asm-x86_64/sha2/sha256-x86_64.S

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5105,6 +5105,17 @@ ENTRY_ALIGN(zfs_sha256_transform_avx2, 64)
51055105
SET_SIZE(zfs_sha256_transform_avx2)
51065106
STACK_FRAME_NON_STANDARD zfs_sha256_transform_avx2
51075107

5108+
/* Workaround for missing asm macro in RHEL 8. */
5109+
#if defined(__linux__) && defined(HAVE_STACK_FRAME_NON_STANDARD) && \
5110+
! defined(HAVE_STACK_FRAME_NON_STANDARD_ASM)
5111+
.section .discard.func_stack_frame_non_standard, "aw"
5112+
.long zfs_sha256_transform_x64 - .
5113+
.long zfs_sha256_transform_shani - .
5114+
.long zfs_sha256_transform_ssse3 - .
5115+
.long zfs_sha256_transform_avx - .
5116+
.long zfs_sha256_transform_avx2 - .
5117+
#endif
5118+
51085119
#if defined(__ELF__)
51095120
.section .note.GNU-stack,"",%progbits
51105121
#endif

module/icp/asm-x86_64/sha2/sha512-x86_64.S

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4010,6 +4010,15 @@ ENTRY_ALIGN(zfs_sha512_transform_avx2, 64)
40104010
SET_SIZE(zfs_sha512_transform_avx2)
40114011
STACK_FRAME_NON_STANDARD zfs_sha512_transform_avx2
40124012

4013+
/* Workaround for missing asm macro in RHEL 8. */
4014+
#if defined(__linux__) && defined(HAVE_STACK_FRAME_NON_STANDARD) && \
4015+
! defined(HAVE_STACK_FRAME_NON_STANDARD_ASM)
4016+
.section .discard.func_stack_frame_non_standard, "aw"
4017+
.long zfs_sha512_transform_x64 - .
4018+
.long zfs_sha512_transform_avx - .
4019+
.long zfs_sha512_transform_avx2 - .
4020+
#endif
4021+
40134022
#if defined(__ELF__)
40144023
.section .note.GNU-stack,"",%progbits
40154024
#endif

0 commit comments

Comments
 (0)