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

modprobe zfs: Exec format error on ARMv7 (32-bit) #9957

Closed
awehrfritz opened this issue Feb 6, 2020 · 3 comments
Closed

modprobe zfs: Exec format error on ARMv7 (32-bit) #9957

awehrfritz opened this issue Feb 6, 2020 · 3 comments
Labels
Type: Architecture Indicates an issue is specific to a single processor architecture

Comments

@awehrfritz
Copy link
Contributor

System information

Type Version/Name
Distribution Name Armbian (Debian Buster)
Distribution Version 19.11.3
Linux Kernel 4.19.84-mvebu
Architecture ARMv7 (32-bit)
ZFS Version 0.8.2
SPL Version 0.8.2

Describe the problem you're observing

When loading the zfs kernel model on a Helios4 NAS with a Marvell Armada 388 SoC (ARM Cortex-A9), modprob fails with the following error:
ERROR: could not insert 'zfs': Exec format error

The dmesg output seems to indicate that there is some CPU
instruction/function is missing:
zlua: section 4 reloc 44 sym 'longjmp': unsupported interworking call (Thumb -> ARM)

This is essentially a duplicate of issue #7408, which was however closed without addressing the underlying issue. As far as I can tell, the issue boils down to missing support for the Thumb-2 instruction set in module/lua/setjmp/setjmp_arm.S. The Thumb-2 instruction set is present, e.g., in ARM Cortex-A CPUs and the Armbian kernel for the Helios4 is all Thumb-2. @jsrlabs debugged this issue and found a workaround, and provided a patch to fix the issue.

Describe how to reproduce the problem

The issue can be reproduced by installing the zfs-dkms from the Debian buster-backports repository on a ARMv7 (32-bit) platform. Tested on a Helios4 NAS with a Marvell Armada 388 SoC (ARM Cortex-A9). This issue only occurs with ZFS version 0.8.2, version 0.7.12 works without problems on otherwise the exact same system.

@behlendorf behlendorf added the Type: Architecture Indicates an issue is specific to a single processor architecture label Feb 7, 2020
behlendorf added a commit to behlendorf/zfs that referenced this issue Feb 7, 2020
When a Thumb-2 kernel is being used, then longjmp must be implemented
using the Thumb-2 instruction set in module/lua/setjmp/setjmp_arm.S.

Original-patch-by: @jsrlabs
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue openzfs#9957
@behlendorf
Copy link
Contributor

Thanks for opening a new issue for this and referencing @jsrlabs proposed fix. I've created PR #9967 with a slightly updated of the patch for ARM and Thumb-2 so we can get it reviewed and merged.

Unfortunately, I don't have access to the required hardware to test the fix so if you're able to do so that would be exceptionally helpful. Internally ZFS uses this code for the zfs destroy command. So a relatively easy way to test it would to create a new throw away dataset, a few snapshots, and then destroy them.

@awehrfritz
Copy link
Contributor Author

Wow, that was quick! Thanks @behlendorf for addressing this issue right away. I will look into testing this on my system.

@jsrlabs
Copy link

jsrlabs commented Feb 8, 2020

I'll also try this sometime this weekend. Thanks for the fix!

behlendorf added a commit to behlendorf/zfs that referenced this issue Apr 28, 2020
When a Thumb-2 kernel is being used, then longjmp must be implemented
using the Thumb-2 instruction set in module/lua/setjmp/setjmp_arm.S.

Original-patch-by: @jsrlabs
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue openzfs#9957
awehrfritz pushed a commit to awehrfritz/zfs that referenced this issue Aug 18, 2020
When a Thumb-2 kernel is being used, then longjmp must be implemented
using the Thumb-2 instruction set in module/lua/setjmp/setjmp_arm.S.

Original-patch-by: @jsrlabs
Reviewed-by: @awehrfritz
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#7408 
Closes openzfs#9957 
Closes openzfs#9967
tonyhutter pushed a commit that referenced this issue Aug 19, 2020
When a Thumb-2 kernel is being used, then longjmp must be implemented
using the Thumb-2 instruction set in module/lua/setjmp/setjmp_arm.S.

Original-patch-by: @jsrlabs
Reviewed-by: @awehrfritz
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #7408 
Closes #9957 
Closes #9967
tonyhutter pushed a commit to tonyhutter/zfs that referenced this issue Sep 15, 2020
When a Thumb-2 kernel is being used, then longjmp must be implemented
using the Thumb-2 instruction set in module/lua/setjmp/setjmp_arm.S.

Original-patch-by: @jsrlabs
Reviewed-by: @awehrfritz
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#7408 
Closes openzfs#9957 
Closes openzfs#9967
jsai20 pushed a commit to jsai20/zfs that referenced this issue Mar 30, 2021
When a Thumb-2 kernel is being used, then longjmp must be implemented
using the Thumb-2 instruction set in module/lua/setjmp/setjmp_arm.S.

Original-patch-by: @jsrlabs
Reviewed-by: @awehrfritz
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#7408 
Closes openzfs#9957 
Closes openzfs#9967
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Architecture Indicates an issue is specific to a single processor architecture
Projects
None yet
Development

No branches or pull requests

3 participants