Zfs: Linux 5.0: _kernel_fpu{begin,end} no longer exported

Created on 9 Jan 2019  路  6Comments  路  Source: openzfs/zfs

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.
Blocked Building

All 6 comments

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

@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.

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?

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

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.

Looks like the kernel people may have backported their patch to older kernels:

For the record, it appears the FPU export was removed in 4.19.38 (released 2019-05-02) via d4ff57d0320bf441ad5a3084b3adbba4da1d79f8 and 4.14.120 (released 2019-05-16) via a725c5201f0807a9f843db525f5f98f6c7a4c25b.

https://github.com/zfsonlinux/zfs/issues/8793#issuecomment-496709454

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pcd1193182 picture pcd1193182  路  4Comments

Hubbitus picture Hubbitus  路  4Comments

marker5a picture marker5a  路  4Comments

adamdmoss picture adamdmoss  路  3Comments

jakeogh picture jakeogh  路  3Comments