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

Closed
tonyhutter opened this issue Jan 9, 2019 · 7 comments · Fixed by #8363
Closed

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

tonyhutter opened this issue Jan 9, 2019 · 7 comments · Fixed by #8363
Assignees
Labels
Status: Blocked Depends on another pending change Type: Building Indicates an issue related to building binaries

Comments

@tonyhutter
Copy link
Contributor

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
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
Copy link
Contributor Author

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

@tonyhutter tonyhutter self-assigned this Jan 10, 2019
@tonyhutter tonyhutter added Type: Building Indicates an issue related to building binaries Status: Blocked Depends on another pending change labels Jan 10, 2019
@ideologysec
Copy link

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 has been minimized.

@tonyhutter
Copy link
Contributor Author

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
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: openzfs#8259
tonyhutter added a commit to tonyhutter/zfs that referenced this issue Jan 17, 2019
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: openzfs#8259
tonyhutter added a commit to tonyhutter/zfs that referenced this issue Jan 17, 2019
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: openzfs#8259
tonyhutter added a commit to tonyhutter/zfs that referenced this issue Jan 17, 2019
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: openzfs#8259
tonyhutter added a commit to tonyhutter/zfs that referenced this issue Jan 22, 2019
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: openzfs#8259
tonyhutter added a commit to tonyhutter/zfs that referenced this issue Jan 22, 2019
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: openzfs#8259
tonyhutter added a commit to tonyhutter/zfs that referenced this issue Jan 22, 2019
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: openzfs#8259
tonyhutter added a commit to tonyhutter/zfs that referenced this issue Jan 23, 2019
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: openzfs#8259
tonyhutter added a commit to tonyhutter/zfs that referenced this issue Jan 25, 2019
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: openzfs#8259
tonyhutter added a commit to tonyhutter/zfs that referenced this issue Jan 30, 2019
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.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes openzfs#8259
tonyhutter added a commit to tonyhutter/zfs that referenced this issue Feb 1, 2019
This patch fixes a few issues when detecting which kernel_fpu functions
are available.

- Use kernel_fpu_begin() if it's exported on newer kernels.

- Use ZFS_LINUX_TRY_COMPILE_SYMBOL() to choose the right kernel_fpu
  function when using --enable-linux-builtin.

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes: openzfs#8259
tonyhutter added a commit to tonyhutter/zfs that referenced this issue Feb 1, 2019
This patch fixes a few issues when detecting which kernel_fpu functions
are available.

- Use kernel_fpu_begin() if it's exported on newer kernels.

- Use ZFS_LINUX_TRY_COMPILE_SYMBOL() to choose the right kernel_fpu
  function when using --enable-linux-builtin.

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes: openzfs#8259
tonyhutter added a commit to tonyhutter/zfs that referenced this issue Feb 12, 2019
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.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes openzfs#8259
tonyhutter added a commit that referenced this issue Mar 4, 2019
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.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #8259
tonyhutter added a commit to tonyhutter/zfs that referenced this issue Mar 5, 2019
This patch fixes a few issues when detecting which kernel_fpu functions
are available.

- Use kernel_fpu_begin() if it's exported on newer kernels.

- Use ZFS_LINUX_TRY_COMPILE_SYMBOL() to choose the right kernel_fpu
  function when using --enable-linux-builtin.

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes: openzfs#8259
behlendorf pushed a commit that referenced this issue Mar 7, 2019
This patch fixes a few issues when detecting which kernel_fpu functions
are available.

- Use kernel_fpu_begin() if it's exported on newer kernels.

- Use ZFS_LINUX_TRY_COMPILE_SYMBOL() to choose the right kernel_fpu
  function when using --enable-linux-builtin.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #8259
Closes #8363
@tonyhutter
Copy link
Contributor Author

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.

#8793 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Status: Blocked Depends on another pending change Type: Building Indicates an issue related to building binaries
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@sbuller @mdionne @ideologysec @tonyhutter and others