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 5.0: _kernel_fpu{begin,end} no longer exported #8259

Open
tonyhutter opened this Issue Jan 9, 2019 · 6 comments

Comments

Projects
None yet
5 participants
@tonyhutter
Copy link
Member

tonyhutter commented Jan 9, 2019

System information

Type Version/Name
Distribution Name Fedora
Distribution Version 30 (rawhide)
Linux Kernel 5.0.0-0.rc1.git0.1.fc30.x86_64
Architecture x86-64
ZFS Version master
SPL Version master

Describe the problem you're observing

The 4.2 kernel refractored the FPU code: https://lwn.net/Articles/643235/ It seems the latest kernels removed the old compatibility headers.

We need to rename our #includes <asm/i387.h> -> <asm/fpu/api.h> and <asm/xcr.h> -> <asm/fpu/internal.h> on newer kernels.

Describe how to reproduce the problem

make on rawhide with ZFS master

Include any warning/errors/backtraces from the system logs

/home/hutter/current_kernel_time64/include/linux/simd_x86.h:98:10: fatal error: asm/i387.h: No such file or directory
 #include <asm/i387.h>
          ^~~~~~~~~~~~
compilation terminated.
@mdionne

This comment has been minimized.

Copy link

mdionne commented Jan 9, 2019

The underlying issue comes from kernel commit 12209993e98c5fa1855c467f22a24e3d5b8be205 ("x86/fpu: Don't export _kernel_fpu{begin,end}()"), which unexports __kernel_fpu_begin(), and causes the configure tests not to define HAVE_FPU_API_H. Changing the header locations will just lead to another failure later because kernel_fpu_begin/end() are exported GPL, and can't be used directly from the zfs module.

See the thread on LKML starting here: https://marc.info/?l=linux-kernel&m=154689892914091

Marc

@tonyhutter

This comment has been minimized.

Copy link
Member

tonyhutter commented Jan 10, 2019

@mdionne thanks for bringing this to our attention. Hopefully they change their minds and EXPORT_SYMBOL(kernel_fpu_begin) so we can use that instead.

@ideologysec

This comment has been minimized.

Copy link

ideologysec commented Jan 10, 2019

https://marc.info/?l=linux-kernel&m=154714516832389&w=2

Gotta love the replies. Greg K-H:

My tolerance for ZFS is pretty non-existant. Sun explicitly did not
want their code to work on Linux, so why would we do extra work to get
their code to work properly?

@sbuller

This comment was marked as off-topic.

Copy link

sbuller commented Jan 11, 2019

It would be nice if Oracle would just fix the license once and for all.

@kpande

This comment has been minimized.

Copy link
Member

kpande commented Jan 11, 2019

please don't post meaningless comments.

@zfsonlinux zfsonlinux locked as too heated and limited conversation to collaborators Jan 11, 2019

@tonyhutter

This comment has been minimized.

Copy link
Member

tonyhutter commented Jan 14, 2019

I think we need to operate under the assumption that they're not going to export the functions, and just disable the vectorized versions of the checksums if _kernel_fpu{begin,end} are not detected.

@tonyhutter tonyhutter changed the title Linux 5.0: asm/i387.h: No such file or directory Linux 5.0: _kernel_fpu{begin,end} no longer exported Jan 14, 2019

tonyhutter added a commit to tonyhutter/zfs that referenced this issue Jan 17, 2019

Linux 5.0: Disable vector instructions on 5.0+ kernels
The 5.0 kernel no longer exports the functions we need to vector
(SSE/SSE2/SSE3/AVX...) instructions.  Disable vector-based checksum
algorithms when building against those kernels.

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Fixes: zfsonlinux#8259

tonyhutter added a commit to tonyhutter/zfs that referenced this issue Jan 17, 2019

Linux 5.0: Disable vector instructions on 5.0+ kernels
The 5.0 kernel no longer exports the functions we need to vector
(SSE/SSE2/SSE3/AVX...) instructions.  Disable vector-based checksum
algorithms when building against those kernels.

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Fixes: zfsonlinux#8259

tonyhutter added a commit to tonyhutter/zfs that referenced this issue Jan 17, 2019

Linux 5.0: Disable vector instructions on 5.0+ kernels
The 5.0 kernel no longer exports the functions we need to do vector
(SSE/SSE2/SSE3/AVX...) instructions.  Disable vector-based checksum
algorithms when building against those kernels.

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Fixes: zfsonlinux#8259

tonyhutter added a commit to tonyhutter/zfs that referenced this issue Jan 17, 2019

Linux 5.0: Disable vector instructions on 5.0+ kernels
The 5.0 kernel no longer exports the functions we need to do vector
(SSE/SSE2/SSE3/AVX...) instructions.  Disable vector-based checksum
algorithms when building against those kernels.

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Fixes: zfsonlinux#8259
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.