Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux 4.13+: Warnings from objtool while compiling the 'icp' kernel module: "unsupported stack pointer realignment" (in SHA1/SHA2 functions) #6950

Closed
jgottula opened this issue Dec 13, 2017 · 17 comments
Labels
Type: Building Indicates an issue related to building binaries

Comments

@jgottula
Copy link
Contributor

I don't know how important these build-time warnings actually are, but I've typed up a full report here anyway.

The warnings

I was building the latest zfs master, 4e9b156, for Linux 4.14.5, on x86_64 today.

Here's what came up during the build process:

/home/build/zfs/zfs-20171212-latest/archzfs/packages/linux/zfs-linux-git/src/zfs/module/icp/asm-x86_64/sha1/sha1-x86_64.o: warning: objtool: sha1_block_data_order()+0x11: unsupported stack pointer realignment
/home/build/zfs/zfs-20171212-latest/archzfs/packages/linux/zfs-linux-git/src/zfs/module/icp/asm-x86_64/sha2/sha256_impl.o: warning: objtool: SHA256TransformBlocks()+0x19: unsupported stack pointer realignment
/home/build/zfs/zfs-20171212-latest/archzfs/packages/linux/zfs-linux-git/src/zfs/module/icp/asm-x86_64/sha2/sha512_impl.o: warning: objtool: SHA512TransformBlocks()+0x1c: unsupported stack pointer realignment

Those warnings correspond to these particular instructions from the objdump'd object files:

0000000000000000 <sha1_block_data_order>:
      ...
      11:       48 83 e4 c0             and    rsp,0xffffffffffffffc0
      ...
0000000000000000 <SHA256TransformBlocks>:
      ...
      19:       48 83 e4 c0             and    rsp,0xffffffffffffffc0
      ...
0000000000000000 <SHA512TransformBlocks>:
      ...
      1c:       48 83 e4 c0             and    rsp,0xffffffffffffffc0
      ...

The recent update to objtool

It looks like this warning will only appear when compiling for Linux 4.13 or later, since the objtool patchset that added new warnings (including the "unsupported stack pointer realignment" one) was merged into the mainline kernel in 4.13.

Here's some additional info on that objtool patchset:

Here's the specific part of the objtool code that's complaining.
And here's some internal documentation regarding what it's complaining about.

The ZoL source lines being complained about

Here are the relevant assembly code source file lines in ZoL:

https://github.com/zfsonlinux/zfs/blob/4e9b156960562373e005798575a3fbc6d66e32ff/module/icp/asm-x86_64/sha1/sha1-x86_64.S#L79
https://github.com/zfsonlinux/zfs/blob/4e9b156960562373e005798575a3fbc6d66e32ff/module/icp/asm-x86_64/sha2/sha256_impl.S#L96
https://github.com/zfsonlinux/zfs/blob/4e9b156960562373e005798575a3fbc6d66e32ff/module/icp/asm-x86_64/sha2/sha512_impl.S#L97

32-bit

As far as I can tell, i386 builds of zfs won't emit this warning, as from what I can see, the asm implementations of the three SHA functions in question are only used for the kernel module on x86_64, and everything else just uses the C implementations.

But I don't have an i386 Linux box/VM ready-at-hand to do a quick build and actually confirm for sure that these warnings don't happen there.

@jgottula
Copy link
Contributor Author

Also, I thought it'd be worth mentioning that the asm implementations of SHA1/SHA2 in the ICP module come from Illumos, which in turn got them from OpenSSL; quite a long time ago, by the looks of it (2009 at the very latest).

It looks like the upstream OpenSSL implementation has advanced quite a bit since Illumos branched their code off; among other things, the OpenSSL version now has specializations for SSSE3, AVX, AVX2+BMI, and Intel SHA instruction set extensions now.

So that might be worth looking at sometime. (And/or #2351.)

@h1z1
Copy link

h1z1 commented Jan 31, 2018

Still outstanding as of latest git. Funny thing is this was the first hit on google for that error :)

behlendorf pushed a commit to behlendorf/zfs that referenced this issue Mar 5, 2018
…ecompression

With compressed ARC (bug openzfs#6950) we use up to 25% of our CPU to decompress
indirect blocks, under a workload of random cached reads. To reduce this
decompression cost, we would like to increase the size of the dbuf cache so
that more indirect blocks can be stored uncompressed.

If we are caching entire large files of recordsize=8K, the indirect blocks
use 1/64th as much memory as the data blocks (assuming they have the same
compression ratio). We suggest making the dbuf cache be 1/32nd of all memory,
so that in this scenario we should be able to keep all the indirect blocks
decompressed in the dbuf cache. (We want it to be more than the 1/64th that
the indirect blocks would use because we need to cache other stuff in the dbuf
cache as well.)

In real world workloads, this won't help as dramatically as the example above,
but we think it's still worth it because the risk of decreasing performance is
low. The potential negative performance impact is that we will be slightly
reducing the size of the ARC (by ~3%).

Porting Notes:
* Added modules options to zfs-module-parameters.5 man page.
* Preserved scaling based on target ARC size rather than max ARC size.

Authored by: George Wilson <[email protected]>
Reviewed by: Dan Kimmel <[email protected]>
Reviewed by: Prashanth Sreenivasa <[email protected]>
Reviewed by: Paul Dagnelie <[email protected]>
Ported-by: Brian Behlendorf <[email protected]>

OpenZFS-issue: https://www.illumos.org/issues/9188
OpenZFS-commit: openzfs/openzfs#564
Upstream bug: DLPX-46942
@c0d3z3r0
Copy link
Contributor

c0d3z3r0 commented Nov 11, 2018

Confirmed on Debian testing with ZFS 0.7.11, custom Kernel 4.19.1
(I know 0.7.11 officially supports 4.18 only... just for completeness)

[...]
/var/lib/dkms/zfs/0.7.11/build/module/icp/asm-x86_64/sha1/sha1-x86_64.o: warning: objtool: sha1_block_data_order()+0x11: unsupported stack pointer realignment
  AS [M]  /var/lib/dkms/zfs/0.7.11/build/module/icp/asm-x86_64/sha2/sha512_impl.o
/var/lib/dkms/zfs/0.7.11/build/module/icp/asm-x86_64/sha2/sha256_impl.o: warning: objtool: SHA256TransformBlocks()+0x19: unsupported stack pointer realignment
/var/lib/dkms/zfs/0.7.11/build/module/icp/asm-x86_64/sha2/sha512_impl.o: warning: objtool: SHA512TransformBlocks()+0x1c: unsupported stack pointer realignment
  LD [M]  /var/lib/dkms/zfs/0.7.11/build/module/icp/icp.o
make[3]: *** [Makefile:1517: _module_/var/lib/dkms/zfs/0.7.11/build/module] Error 2
make[3]: Leaving directory '/usr/src/linux-headers-4.19.1'
make[2]: *** [Makefile:27: modules] Error 2
make[2]: Leaving directory '/var/lib/dkms/zfs/0.7.11/build/module'
make[1]: *** [Makefile:701: all-recursive] Error 1
make[1]: Leaving directory '/var/lib/dkms/zfs/0.7.11/build'
make: *** [Makefile:572: all] Error 2
root@debian:/usr/src/kernel# dkms status
spl, 0.7.11, 4.18.0-2-amd64, x86_64: installed
spl, 0.7.11, 4.19.1, x86_64: installed
zfs, 0.7.11, 4.18.0-2-amd64, x86_64: installed

@darrenfreeman
Copy link

What are the consequences of this? Is it safe to ignore?

@3f8wohoo
Copy link

3f8wohoo commented Feb 14, 2019

can confirm this for 0.7.12 and kernel 4.19.14 on debian stretch:

...
Making all in 02zfsexpandknowledge
Making all in 90zfs
Making all in initramfs
Making all in module
/root/zfs-0.7.12/module/icp/asm-x86_64/sha1/.tmp_sha1-x86_64.o: warning: objtool: sha1_block_data_order()+0x11: unsupported stack pointer realignment
/root/zfs-0.7.12/module/icp/asm-x86_64/sha2/.tmp_sha256_impl.o: warning: objtool: SHA256TransformBlocks()+0x19: unsupported stack pointer realignment
/root/zfs-0.7.12/module/icp/asm-x86_64/sha2/.tmp_sha512_impl.o: warning: objtool: SHA512TransformBlocks()+0x1c: unsupported stack pointer realignment

@behlendorf behlendorf added the Type: Building Indicates an issue related to building binaries label Feb 15, 2019
@behlendorf
Copy link
Contributor

Yes, it's safe to ignore. Though of course we would like to resolve the warning.

@stale
Copy link

stale bot commented Aug 25, 2020

This issue has been automatically marked as "stale" because it has not had any activity for a while. It will be closed in 90 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Stale No recent activity for issue label Aug 25, 2020
@stale stale bot closed this as completed Nov 24, 2020
@behlendorf behlendorf reopened this Dec 28, 2020
@stale stale bot removed the Status: Stale No recent activity for issue label Dec 28, 2020
@sempervictus
Copy link
Contributor

This is still a thing on Arch Linux GCC 10.2 against 5.10.12:

fs/zfs/icp/asm-x86_64/sha1/sha1-x86_64.o: warning: objtool: sha1_block_data_order()+0x11: unsupported stack pointer realignment
  AS      fs/zfs/icp/asm-x86_64/sha2/sha256_impl.o
  CC      arch/x86/kernel/acpi/boot.o
  CC      fs/zfs/zcommon/zfs_fletcher_superscalar.o
  CC      arch/x86/kernel/acpi/sleep.o
fs/zfs/icp/asm-x86_64/sha2/sha256_impl.o: warning: objtool: SHA256TransformBlocks()+0x19: unsupported stack pointer realignment
  AS      fs/zfs/icp/asm-x86_64/sha2/sha512_impl.o
  CC      crypto/asymmetric_keys/asymmetric_type.o
fs/zfs/icp/asm-x86_64/sha2/sha512_impl.o: warning: objtool: SHA512TransformBlocks()+0x1c: unsupported stack pointer realignment

@AndyLavr
Copy link

AndyLavr commented Feb 25, 2021

Fix it, the kernel will be adopting this fix soon:

"x86/crypto/asm: objtool support"
https://lore.kernel.org/patchwork/cover/1383999/

@AttilaFueloep
Copy link
Contributor

Thanks to the excellent information in this ticket, I'd say objtool is complaining that we don't use a DRAP register while aligning the stack to a 64 byte boundary. A DRAP register is a gcc concept. Since we are notoriously low on registers in the crypto code, I'd say it isn't worth the effort to mimic gcc generated stack alignment. I think the best approach will be to just silence the warning with STACK_FRAME_NON_STANDARD or OBJECT_FILES_NON_STANDARD. Is there any benefit in an objtool conforming stack with hand written assembly?

@behlendorf
Copy link
Contributor

I'm fine with silencing the warning for all the reasons you mentioned.

@AttilaFueloep
Copy link
Contributor

OK, will open a PR once #11733 settles.

@AndyLavr
Copy link

AndyLavr commented Mar 13, 2021

I think the best approach will be to just silence the warning with STACK_FRAME_NON_STANDARD or OBJECT_FILES_NON_STANDARD

"objtool, modules: Discard objtool annotation sections for modules"
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e390f9a9689a42f477a6073e2e7df530a4c1b740

I use such a patch on my local test branch, there are no problems, everything works and the build goes without any warnings.

diff --git a/fs/zfs/icp/asm-x86_64/modes/aesni-gcm-x86_64.S b/fs/zfs/icp/asm-x86_64/modes/aesni-gcm-x86_64.S
index dc71ae2..b7f0296 100644
--- a/fs/zfs/icp/asm-x86_64/modes/aesni-gcm-x86_64.S
+++ b/fs/zfs/icp/asm-x86_64/modes/aesni-gcm-x86_64.S
@@ -1239,6 +1239,7 @@
        ret
 .size  atomic_toggle_boolean_nv,.-atomic_toggle_boolean_nv
 
+.data
 .align 64
 .Lbswap_mask:
 .byte  15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
@@ -1253,6 +1254,13 @@
 .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
 .align 64
 
+
+.pushsection .discard.func_stack_frame_non_standard, "aw"
+.long _aesni_ctr32_ghash_no_movbe_6x - .
+.long aesni_gcm_decrypt - .
+.long aesni_gcm_encrypt - .
+.popsection
+
 /* Mark the stack non-executable. */
 #if defined(__linux__) && defined(__ELF__)
 .section .note.GNU-stack,"",%progbits
diff --git a/fs/zfs/icp/asm-x86_64/modes/ghash-x86_64.S b/fs/zfs/icp/asm-x86_64/modes/ghash-x86_64.S
index 90cc36b..501a3a5 100644
--- a/fs/zfs/icp/asm-x86_64/modes/ghash-x86_64.S
+++ b/fs/zfs/icp/asm-x86_64/modes/ghash-x86_64.S
@@ -652,6 +652,8 @@
        .byte   0xf3,0xc3
 .cfi_endproc
 .size  gcm_ghash_avx,.-gcm_ghash_avx
+
+.data
 .align 64
 .Lbswap_mask:
 .byte  15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
diff --git a/fs/zfs/icp/asm-x86_64/sha1/sha1-x86_64.S b/fs/zfs/icp/asm-x86_64/sha1/sha1-x86_64.S
index cb92378..da854a3 100644
--- a/fs/zfs/icp/asm-x86_64/sha1/sha1-x86_64.S
+++ b/fs/zfs/icp/asm-x86_64/sha1/sha1-x86_64.S
@@ -1348,6 +1348,10 @@
 
 #endif /* lint || __lint */
 
+.pushsection .discard.func_stack_frame_non_standard, "aw"
+.long sha1_block_data_order - .
+.popsection
+
 #ifdef __ELF__
 .section .note.GNU-stack,"",%progbits
 #endif
diff --git a/fs/zfs/icp/asm-x86_64/sha2/sha256_impl.S b/fs/zfs/icp/asm-x86_64/sha2/sha256_impl.S
index 766b753..57867fc 100644
--- a/fs/zfs/icp/asm-x86_64/sha2/sha256_impl.S
+++ b/fs/zfs/icp/asm-x86_64/sha2/sha256_impl.S
@@ -2058,6 +2058,10 @@
        .long   0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2
 #endif /* !lint && !__lint */
 
+.pushsection .discard.func_stack_frame_non_standard, "aw"
+.long SHA256TransformBlocks - .
+.popsection
+
 #ifdef __ELF__
 .section .note.GNU-stack,"",%progbits
 #endif
diff --git a/fs/zfs/icp/asm-x86_64/sha2/sha512_impl.S b/fs/zfs/icp/asm-x86_64/sha2/sha512_impl.S
index 6e37618..1239d53 100644
--- a/fs/zfs/icp/asm-x86_64/sha2/sha512_impl.S
+++ b/fs/zfs/icp/asm-x86_64/sha2/sha512_impl.S
@@ -2083,6 +2083,10 @@
        .quad   0x5fcb6fab3ad6faec,0x6c44198c4a475817
 #endif /* !lint && !__lint */
 
+.pushsection .discard.func_stack_frame_non_standard, "aw"
+.long SHA512TransformBlocks - .
+.popsection
+
 #ifdef __ELF__
 .section .note.GNU-stack,"",%progbits
 #endif
  CHK     include/generated/compile.h
  CC      fs/zfs/spl/../os/linux/spl/spl-atomic.o
  CC      fs/zfs/spl/../os/linux/spl/spl-condvar.o
  CC      fs/zfs/avl/avl.o
  CC      fs/zfs/spl/../os/linux/spl/spl-cred.o
  CC      fs/zfs/spl/../os/linux/spl/spl-err.o
  AR      fs/zfs/avl/built-in.a
  CC      fs/zfs/spl/../os/linux/spl/spl-generic.o
  CC      fs/zfs/spl/../os/linux/spl/spl-kmem.o
  CC      fs/zfs/spl/../os/linux/spl/spl-kmem-cache.o
  CC      fs/zfs/spl/../os/linux/spl/spl-kstat.o
  CC      fs/zfs/spl/../os/linux/spl/spl-proc.o
  CC      fs/zfs/icp/illumos-crypto.o
  CC      fs/zfs/spl/../os/linux/spl/spl-procfs-list.o
  CC      fs/zfs/spl/../os/linux/spl/spl-taskq.o
  CC      fs/zfs/icp/api/kcf_cipher.o
  CC      fs/zfs/icp/api/kcf_digest.o
  CC      fs/zfs/spl/../os/linux/spl/spl-thread.o
  CC      fs/zfs/spl/../os/linux/spl/spl-trace.o
  CC      fs/zfs/icp/api/kcf_mac.o
  CC      fs/zfs/icp/api/kcf_miscapi.o
  CC      fs/zfs/icp/api/kcf_ctxops.o
  CC      fs/zfs/spl/../os/linux/spl/spl-tsd.o
  CC      fs/zfs/spl/../os/linux/spl/spl-vmem.o
  CC      fs/zfs/icp/core/kcf_callprov.o
  CHK     kernel/kheaders_data.tar.xz
  CC      fs/zfs/spl/../os/linux/spl/spl-xdr.o
  CC      fs/zfs/icp/core/kcf_prov_tabs.o
  CC      fs/zfs/spl/../os/linux/spl/spl-zlib.o
  CC      fs/zfs/icp/core/kcf_sched.o
  AR      fs/zfs/spl/built-in.a
  CC      fs/zfs/lua/lapi.o
  CC      fs/zfs/icp/core/kcf_mech_tabs.o
  CC      fs/zfs/icp/core/kcf_prov_lib.o
  CC      fs/zfs/lua/lauxlib.o
  CC      fs/zfs/icp/spi/kcf_spi.o
  CC      fs/zfs/icp/io/aes.o
  CC      fs/zfs/lua/lbaselib.o
  CC      fs/zfs/icp/io/edonr_mod.o
  CC      fs/zfs/nvpair/nvpair.o
  CC      fs/zfs/lua/lcode.o
  CC      fs/zfs/icp/io/sha1_mod.o
  CC      fs/zfs/nvpair/fnvpair.o
  CC      fs/zfs/nvpair/nvpair_alloc_spl.o
  CC      fs/zfs/nvpair/nvpair_alloc_fixed.o
  CC      fs/zfs/icp/io/sha2_mod.o
  CC      fs/zfs/lua/lcompat.o
  AR      fs/zfs/nvpair/built-in.a
  CC      fs/zfs/icp/io/skein_mod.o
  CC      fs/zfs/unicode/u8_textprep.o
  CC      fs/zfs/lua/lcorolib.o
  CC      fs/zfs/zcommon/cityhash.o
  CC      fs/zfs/zcommon/zfeature_common.o
  CC      fs/zfs/icp/os/modhash.o
  CC      fs/zfs/unicode/uconv.o
  CC      fs/zfs/zcommon/zfs_comutil.o
  CC      fs/zfs/lua/lctype.o
  CC      fs/zfs/icp/os/modconf.o
  CC      fs/zfs/lua/ldebug.o
  AR      fs/zfs/unicode/built-in.a
  CC      fs/zfs/icp/algs/modes/cbc.o
  CC      fs/zfs/zcommon/zfs_deleg.o
  CC      fs/zfs/zcommon/zfs_fletcher.o
  CC      fs/zfs/zcommon/zfs_fletcher_superscalar.o
  CC      fs/zfs/icp/algs/modes/ccm.o
  CC      fs/zfs/icp/algs/modes/ctr.o
  CC      fs/zfs/lua/ldo.o
  CC      fs/zfs/zcommon/zfs_fletcher_superscalar4.o
  CC      fs/zfs/zcommon/zfs_namecheck.o
  CC      fs/zfs/lua/lfunc.o
  CC      fs/zfs/icp/algs/modes/ecb.o
  CC      fs/zfs/lua/lgc.o
  CC      fs/zfs/icp/algs/modes/gcm_generic.o
  CC      fs/zfs/lua/llex.o
  CC      fs/zfs/lua/lmem.o
  CC      fs/zfs/zcommon/zfs_prop.o
  CC      fs/zfs/zcommon/zpool_prop.o
  CC      fs/zfs/icp/algs/modes/gcm.o
  CC      fs/zfs/zcommon/zprop_common.o
  CC      fs/zfs/lua/lobject.o
  CC      fs/zfs/lua/lopcodes.o
  CC      fs/zfs/icp/algs/modes/modes.o
  CC      fs/zfs/zcommon/zfs_fletcher_intel.o
  CC      fs/zfs/lua/lparser.o
  CC      fs/zfs/icp/algs/aes/aes_impl_generic.o
  CC      fs/zfs/lua/lstate.o
  CC      fs/zfs/zcommon/zfs_fletcher_sse.o
  CC      fs/zfs/lua/lstring.o
  CC      fs/zfs/icp/algs/aes/aes_impl.o
  CC      fs/zfs/zcommon/zfs_fletcher_avx512.o
  CC      fs/zfs/icp/algs/aes/aes_modes.o
  CC      fs/zfs/lua/lstrlib.o
  CC      fs/zfs/lua/ltable.o
  AR      fs/zfs/zcommon/built-in.a
  CC      fs/zfs/icp/algs/edonr/edonr.o
  CC      fs/zfs/lua/ltablib.o
  CC      fs/zfs/icp/algs/sha1/sha1.o
  CC      fs/zfs/lua/ltm.o
  CC      fs/zfs/lua/lvm.o
  CC      fs/zfs/icp/algs/sha2/sha2.o
  CC      fs/zfs/lua/lzio.o
  CC      fs/zfs/icp/algs/skein/skein.o
  CC      fs/zfs/icp/algs/skein/skein_block.o
  CC      fs/zfs/icp/algs/skein/skein_iv.o
  AS      fs/zfs/lua/setjmp/setjmp.o
  AR      fs/zfs/lua/built-in.a
  CC      fs/zfs/zfs/abd.o
  CC      fs/zfs/icp/asm-x86_64/aes/aeskey.o
  AS      fs/zfs/icp/asm-x86_64/aes/aes_amd64.o
  CC      fs/zfs/zfs/aggsum.o
  AS      fs/zfs/icp/asm-x86_64/aes/aes_aesni.o
  CC      fs/zfs/zfs/arc.o
  CC      fs/zfs/zfs/blkptr.o
  CC      fs/zfs/zfs/bplist.o
  AS      fs/zfs/icp/asm-x86_64/modes/gcm_pclmulqdq.o
  AS      fs/zfs/icp/asm-x86_64/modes/aesni-gcm-x86_64.o
  AS      fs/zfs/icp/asm-x86_64/modes/ghash-x86_64.o
  AS      fs/zfs/icp/asm-x86_64/sha1/sha1-x86_64.o
  AS      fs/zfs/icp/asm-x86_64/sha2/sha256_impl.o
  AS      fs/zfs/icp/asm-x86_64/sha2/sha512_impl.o
  CC      fs/zfs/icp/algs/modes/gcm_pclmulqdq.o
  CC      fs/zfs/zfs/bpobj.o
  CC      fs/zfs/icp/algs/aes/aes_impl_aesni.o
  CC      fs/zfs/zfs/bptree.o
  CC      fs/zfs/zfs/compress_adaptive.o
  CC      fs/zfs/icp/algs/aes/aes_impl_x86-64.o
  CC      fs/zfs/zfs/btree.o
  AR      fs/zfs/icp/built-in.a
  CC      fs/zfs/zstd/zfs_zstd.o
  CC      fs/zfs/zfs/bqueue.o
  AR      fs/zfs/os/linux/spl/built-in.a
  AR      fs/zfs/os/linux/zfs/built-in.a
  CC      fs/zfs/zstd/lib/zstd.o
  CC      fs/zfs/zfs/dataset_kstats.o
  CC      fs/zfs/zfs/dbuf.o
  CC      fs/zfs/zstd/lib/zstd_trace.o
  CC      fs/zfs/zfs/dbuf_stats.o
  CC      fs/zfs/zfs/ddt.o
  CC      fs/zfs/zfs/ddt_zap.o
  CC      fs/zfs/zfs/dmu.o
  CC      fs/zfs/zfs/dmu_direct.o
  CC      fs/zfs/zfs/dmu_diff.o
  CC      fs/zfs/zfs/dmu_object.o
  AR      fs/zfs/zstd/built-in.a
  CC      fs/zfs/zfs/dmu_objset.o
  CC      fs/zfs/zfs/dmu_recv.o
  CC      fs/zfs/zfs/dmu_redact.o
  CC      fs/zfs/zfs/dmu_send.o
  CC      fs/zfs/zfs/dmu_traverse.o
  CC      fs/zfs/zfs/dmu_tx.o
  CC      fs/zfs/zfs/dmu_zfetch.o
  CC      fs/zfs/zfs/dnode.o
  CC      fs/zfs/zfs/dnode_sync.o
  CC      fs/zfs/zfs/dsl_bookmark.o
  CC      fs/zfs/zfs/dsl_crypt.o
  CC      fs/zfs/zfs/dsl_dataset.o
  CC      fs/zfs/zfs/dsl_deadlist.o
  CC      fs/zfs/zfs/dsl_deleg.o
  CC      fs/zfs/zfs/dsl_destroy.o
  CC      fs/zfs/zfs/dsl_dir.o
  CC      fs/zfs/zfs/dsl_pool.o
  CC      fs/zfs/zfs/dsl_prop.o
  CC      fs/zfs/zfs/dsl_scan.o
  CC      fs/zfs/zfs/dsl_synctask.o
  CC      fs/zfs/zfs/dsl_userhold.o
  CC      fs/zfs/zfs/edonr_zfs.o
  CC      fs/zfs/zfs/fm.o
  CC      fs/zfs/zfs/gzip.o
  CC      fs/zfs/zfs/hkdf.o
  CC      fs/zfs/zfs/lz4.o
  CC      fs/zfs/zfs/lzjb.o
  CC      fs/zfs/zfs/metaslab.o
  CC      fs/zfs/zfs/mmp.o
  CC      fs/zfs/zfs/multilist.o
  CC      fs/zfs/zfs/objlist.o
  CC      fs/zfs/zfs/pathname.o
  CC      fs/zfs/zfs/range_tree.o
  CC      fs/zfs/zfs/refcount.o
  CC      fs/zfs/zfs/rrwlock.o
  CC      fs/zfs/zfs/sa.o
  CC      fs/zfs/zfs/sha256.o
  CC      fs/zfs/zfs/skein_zfs.o
  CC      fs/zfs/zfs/spa.o
  CC      fs/zfs/zfs/spa_boot.o
  CC      fs/zfs/zfs/spa_checkpoint.o
  CC      fs/zfs/zfs/spa_config.o
  CC      fs/zfs/zfs/spa_errlog.o
  CC      fs/zfs/zfs/spa_history.o
  CC      fs/zfs/zfs/spa_log_spacemap.o
  CC      fs/zfs/zfs/spa_misc.o
  CC      fs/zfs/zfs/spa_stats.o
  CC      fs/zfs/zfs/space_map.o
  CC      fs/zfs/zfs/space_reftree.o
  CC      fs/zfs/zfs/txg.o
  CC      fs/zfs/zfs/uberblock.o
  CC      fs/zfs/zfs/unique.o
  CC      fs/zfs/zfs/vdev.o
  CC      fs/zfs/zfs/vdev_cache.o
  CC      fs/zfs/zfs/vdev_draid.o
  CC      fs/zfs/zfs/vdev_draid_rand.o
  CC      fs/zfs/zfs/vdev_indirect.o
  CC      fs/zfs/zfs/vdev_indirect_births.o
  CC      fs/zfs/zfs/vdev_indirect_mapping.o
  CC      fs/zfs/zfs/vdev_initialize.o
  CC      fs/zfs/zfs/vdev_label.o
  CC      fs/zfs/zfs/vdev_mirror.o
  CC      fs/zfs/zfs/vdev_missing.o
  CC      fs/zfs/zfs/vdev_queue.o
  CC      fs/zfs/zfs/vdev_raidz.o
  CC      fs/zfs/zfs/vdev_raidz_math.o
  CC      fs/zfs/zfs/vdev_raidz_math_scalar.o
  CC      fs/zfs/zfs/vdev_rebuild.o
  CC      fs/zfs/zfs/vdev_removal.o
  CC      fs/zfs/zfs/vdev_root.o
  CC      fs/zfs/zfs/vdev_trim.o
  CC      fs/zfs/zfs/zap.o
  CC      fs/zfs/zfs/zap_leaf.o
  CC      fs/zfs/zfs/zap_micro.o
  CC      fs/zfs/zfs/zcp.o
  CC      fs/zfs/zfs/zcp_get.o
  CC      fs/zfs/zfs/zcp_global.o
  CC      fs/zfs/zfs/zcp_iter.o
  CC      fs/zfs/zfs/zcp_set.o
  CC      fs/zfs/zfs/zcp_synctask.o
  CC      fs/zfs/zfs/zfeature.o
  CC      fs/zfs/zfs/zfs_byteswap.o
  CC      fs/zfs/zfs/zfs_fm.o
  CC      fs/zfs/zfs/zfs_fuid.o
  CC      fs/zfs/zfs/zfs_ioctl.o
  CC      fs/zfs/zfs/zfs_log.o
  CC      fs/zfs/zfs/zfs_onexit.o
  CC      fs/zfs/zfs/zfs_quota.o
  CC      fs/zfs/zfs/zfs_ratelimit.o
  CC      fs/zfs/zfs/zfs_replay.o
  CC      fs/zfs/zfs/zfs_rlock.o
  CC      fs/zfs/zfs/zfs_sa.o
  CC      fs/zfs/zfs/zfs_vnops.o
  CC      fs/zfs/zfs/zil.o
  CC      fs/zfs/zfs/zio.o
  CC      fs/zfs/zfs/zio_checksum.o
  CC      fs/zfs/zfs/zio_compress.o
  CC      fs/zfs/zfs/zio_inject.o
  CC      fs/zfs/zfs/zle.o
  CC      fs/zfs/zfs/zrlock.o
  CC      fs/zfs/zfs/zthr.o
  CC      fs/zfs/zfs/zvol.o
  CC      fs/zfs/zfs/../os/linux/zfs/abd_os.o
  CC      fs/zfs/zfs/../os/linux/zfs/arc_os.o
  CC      fs/zfs/zfs/../os/linux/zfs/mmp_os.o
  CC      fs/zfs/zfs/../os/linux/zfs/policy.o
  CC      fs/zfs/zfs/../os/linux/zfs/trace.o
  CC      fs/zfs/zfs/../os/linux/zfs/qat.o
  CC      fs/zfs/zfs/../os/linux/zfs/qat_compress.o
  CC      fs/zfs/zfs/../os/linux/zfs/qat_crypt.o
  CC      fs/zfs/zfs/../os/linux/zfs/spa_misc_os.o
  CC      fs/zfs/zfs/../os/linux/zfs/vdev_disk.o
  CC      fs/zfs/zfs/../os/linux/zfs/vdev_file.o
  CC      fs/zfs/zfs/../os/linux/zfs/zfs_acl.o
  CC      fs/zfs/zfs/../os/linux/zfs/zfs_ctldir.o
  CC      fs/zfs/zfs/../os/linux/zfs/zfs_debug.o
  CC      fs/zfs/zfs/../os/linux/zfs/zfs_dir.o
  CC      fs/zfs/zfs/../os/linux/zfs/zfs_file_os.o
  CC      fs/zfs/zfs/../os/linux/zfs/zfs_ioctl_os.o
  CC      fs/zfs/zfs/../os/linux/zfs/zfs_racct.o
  CC      fs/zfs/zfs/../os/linux/zfs/zfs_sysfs.o
  CC      fs/zfs/zfs/../os/linux/zfs/zfs_uio.o
  CC      fs/zfs/zfs/../os/linux/zfs/zfs_vfsops.o
  CC      fs/zfs/zfs/../os/linux/zfs/zfs_vnops_os.o
  CC      fs/zfs/zfs/../os/linux/zfs/zfs_znode.o
  CC      fs/zfs/zfs/../os/linux/zfs/zio_crypt.o
  CC      fs/zfs/zfs/../os/linux/zfs/zpl_ctldir.o
  CC      fs/zfs/zfs/../os/linux/zfs/zpl_export.o
  CC      fs/zfs/zfs/../os/linux/zfs/zpl_file.o
  CC      fs/zfs/zfs/../os/linux/zfs/zpl_inode.o
  CC      fs/zfs/zfs/../os/linux/zfs/zpl_super.o
  CC      fs/zfs/zfs/../os/linux/zfs/zpl_xattr.o
  CC      fs/zfs/zfs/../os/linux/zfs/zvol_os.o
  CC      fs/zfs/zfs/vdev_raidz_math_sse2.o
  CC      fs/zfs/zfs/vdev_raidz_math_ssse3.o
  CC      fs/zfs/zfs/vdev_raidz_math_avx2.o
  CC      fs/zfs/zfs/vdev_raidz_math_avx512f.o
  CC      fs/zfs/zfs/vdev_raidz_math_avx512bw.o
  AR      fs/zfs/zfs/built-in.a
  AR      fs/zfs/built-in.a
  AR      fs/built-in.a
  GEN     .version
  CHK     include/generated/compile.h
  GEN     .tmp_initcalls.lds
  GEN     .tmp_symversions.lds
  LTO     vmlinux.o
  OBJTOOL vmlinux.o
  MODPOST vmlinux.symvers
  MODINFO modules.builtin.modinfo
  GEN     modules.builtin
  LD      .tmp_vmlinux.kallsyms1
  KSYMS   .tmp_vmlinux.kallsyms1.S
  AS      .tmp_vmlinux.kallsyms1.S
  LD      .tmp_vmlinux.kallsyms2
  KSYMS   .tmp_vmlinux.kallsyms2.S
  AS      .tmp_vmlinux.kallsyms2.S
  LD      vmlinux
  SORTTAB vmlinux
  SYSMAP  System.map
  CC      arch/x86/boot/a20.o
  AS      arch/x86/boot/bioscall.o
  CC      arch/x86/boot/cmdline.o
  AS      arch/x86/boot/copy.o
  HOSTCC  arch/x86/boot/mkcpustr

@AttilaFueloep
Copy link
Contributor

@AndyLavr

+.pushsection .discard.func_stack_frame_non_standard, "aw"
+...

Actually I'd prefer to use the C macro STACK_FRAME_NON_STANDARDfor that. IIUC in the end it inserts exactly that. Since the MacOS and Windows ports use the ICP as well, it would be better not to add Linux specific directives to the assembly file.

@AndyLavr
Copy link

AndyLavr commented Mar 13, 2021

@AttilaFueloep

Actually I'd prefer to use the C macro STACK_FRAME_NON_STANDARDfor that.

For build with Clang + LTO, this doesn't work:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/Makefile.build?h=v5.12-rc2#n220

I've provided my variant for Linux. I have no other systems. It also allowed us to move bswap_mask to the .data section and get rid of the "can't find jump dest instruction" warning.

@AttilaFueloep
Copy link
Contributor

Much appreciated. Regarding bswap_mask please see #11733 (comment). Not sure if we officially support clang on Linux? But I'll have a look anyhow.

@AndyLavr
Copy link

AndyLavr commented Mar 13, 2021

@AttilaFueloep

Regarding bswap_mask please see

Please see

Not sure if we officially support clang on Linux? But I'll have a look anyhow.

Clang + LTO build support has already been added to the Linux tree.

AttilaFueloep added a commit to AttilaFueloep/zfs that referenced this issue Apr 16, 2021
Objtool requires the use of a DRAP register while aligning the
stack. Since a DRAP register is a gcc concept and we are
notoriously low on registers in the crypto code, it's not worth
the effort to mimic gcc generated stack realignment.

We simply silence the warning by adding the offending object files
to OBJECT_FILES_NON_STANDARD.

Signed-off-by: Attila Fülöp <[email protected]>
Closes openzfs#6950
behlendorf pushed a commit to behlendorf/zfs that referenced this issue Apr 18, 2021
Objtool requires the use of a DRAP register while aligning the
stack. Since a DRAP register is a gcc concept and we are
notoriously low on registers in the crypto code, it's not worth
the effort to mimic gcc generated stack realignment.

We simply silence the warning by adding the offending object files
to OBJECT_FILES_NON_STANDARD.

Signed-off-by: Attila Fülöp <[email protected]>
Closes openzfs#6950
behlendorf pushed a commit to behlendorf/zfs that referenced this issue Apr 21, 2021
Objtool requires the use of a DRAP register while aligning the
stack. Since a DRAP register is a gcc concept and we are
notoriously low on registers in the crypto code, it's not worth
the effort to mimic gcc generated stack realignment.

We simply silence the warning by adding the offending object files
to OBJECT_FILES_NON_STANDARD.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Attila Fülöp <[email protected]>
Closes openzfs#6950
Closes openzfs#11914
sempervictus pushed a commit to sempervictus/zfs that referenced this issue May 31, 2021
Objtool requires the use of a DRAP register while aligning the
stack. Since a DRAP register is a gcc concept and we are
notoriously low on registers in the crypto code, it's not worth
the effort to mimic gcc generated stack realignment.

We simply silence the warning by adding the offending object files
to OBJECT_FILES_NON_STANDARD.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Attila Fülöp <[email protected]>
Closes openzfs#6950
Closes openzfs#11914
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Building Indicates an issue related to building binaries
Projects
None yet
Development

No branches or pull requests

9 participants