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

compact: add check for kernel_neon_* availability #15711

Merged
merged 1 commit into from
Jan 9, 2024

Conversation

Harry-Chen
Copy link
Contributor

Motivation and Context

Currently openzfs won't build on:

  1. Linux 6.2+ on arm64 due to kernel_neon_* symbols exported with GPL-only license.
  2. Any arm platforms with CONFIG_KERNEL_MODE_NEON disabled, because these symbols lack definition.

Closes: #14555, #15401

Description

Add check for kernel_neon_ availability and license in configuration phase, and add check for CONFIG_KERNEL_MODE_NEON in arch-related FPU headers. KFPU will be disabled when either is not satisfied.

I understand that for arm64, the best way to solve the problem is to implement the KFPU logic as on amd64. This patch, however, aims to workaround the issue and make it compile.

How Has This Been Tested?

I build and install the modules on armel, armhf and arm64 platforms on Debian unstable. Now the code compiles instead of throwing errors.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

This patch adds check for `kernel_neon_*` symbols on arm and arm64
platforms to address the following issues:

1. Linux 6.2+ on arm64 has exported them with `EXPORT_SYMBOL_GPL`, so
   license compatibility must be checked before use.
2. On both arm and arm64, the definitions of these symbols are guarded
   by `CONFIG_KERNEL_MODE_NEON`, but their declarations are still
   present. Checking in configuration phase only leads to MODPOST
   errors (undefined references).

Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
@behlendorf behlendorf added Type: Architecture Indicates an issue is specific to a single processor architecture Status: Accepted Ready to integrate (reviewed, tested) labels Dec 26, 2023
@Harry-Chen
Copy link
Contributor Author

FYI, this patch is shipped in debian testing with version 2.2.2-3. It also successfully passed debian CI.

@behlendorf behlendorf merged commit 7b89149 into openzfs:master Jan 9, 2024
24 of 25 checks passed
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Jan 9, 2024
This patch adds check for `kernel_neon_*` symbols on arm and arm64
platforms to address the following issues:

1. Linux 6.2+ on arm64 has exported them with `EXPORT_SYMBOL_GPL`, so
   license compatibility must be checked before use.
2. On both arm and arm64, the definitions of these symbols are guarded
   by `CONFIG_KERNEL_MODE_NEON`, but their declarations are still
   present. Checking in configuration phase only leads to MODPOST
   errors (undefined references).

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
Closes openzfs#15711 
Closes openzfs#14555 
Closes: openzfs#15401
@Harry-Chen Harry-Chen deleted the add-check-for-neon branch January 9, 2024 05:20
ziggythehamster added a commit to ziggythehamster/zfs that referenced this pull request Jan 12, 2024
This patch backports the change from openzfs#15711 (to ZFS 2.2.x) because
some OS vendors have back-ported this change from Linux 6.2+ to their
older kernels.

The original patch addressed these issues:

1. Linux 6.2+ on arm64 has exported them with `EXPORT_SYMBOL_GPL`, so
   license compatibility must be checked before use.
2. On both arm and arm64, the definitions of these symbols are guarded
   by `CONFIG_KERNEL_MODE_NEON`, but their declarations are still
   present. Checking in configuration phase only leads to MODPOST
   errors (undefined references).

Signed-off-by: Keith Gable <keith@ziggythehamster.sh>
Co-authored-by: Shengqi Chen <harry-chen@outlook.com>
behlendorf pushed a commit that referenced this pull request Jan 12, 2024
This patch adds check for `kernel_neon_*` symbols on arm and arm64
platforms to address the following issues:

1. Linux 6.2+ on arm64 has exported them with `EXPORT_SYMBOL_GPL`, so
   license compatibility must be checked before use.
2. On both arm and arm64, the definitions of these symbols are guarded
   by `CONFIG_KERNEL_MODE_NEON`, but their declarations are still
   present. Checking in configuration phase only leads to MODPOST
   errors (undefined references).

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
Closes #15711 
Closes #14555 
Closes: #15401
behlendorf pushed a commit that referenced this pull request Jan 12, 2024
This patch backports the change from #15711 (to ZFS 2.2.x) because
some OS vendors have back-ported this change from Linux 6.2+ to their
older kernels.

The original patch addressed these issues:

1. Linux 6.2+ on arm64 has exported them with `EXPORT_SYMBOL_GPL`, so
   license compatibility must be checked before use.
2. On both arm and arm64, the definitions of these symbols are guarded
   by `CONFIG_KERNEL_MODE_NEON`, but their declarations are still
   present. Checking in configuration phase only leads to MODPOST
   errors (undefined references).

Signed-off-by: Keith Gable <keith@ziggythehamster.sh>
Co-authored-by: Shengqi Chen <harry-chen@outlook.com>
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Mar 13, 2024
This patch adds check for `kernel_neon_*` symbols on arm and arm64
platforms to address the following issues:

1. Linux 6.2+ on arm64 has exported them with `EXPORT_SYMBOL_GPL`, so
   license compatibility must be checked before use.
2. On both arm and arm64, the definitions of these symbols are guarded
   by `CONFIG_KERNEL_MODE_NEON`, but their declarations are still
   present. Checking in configuration phase only leads to MODPOST
   errors (undefined references).

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
Closes openzfs#15711 
Closes openzfs#14555 
Closes: openzfs#15401
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Mar 13, 2024
This patch adds check for `kernel_neon_*` symbols on arm and arm64
platforms to address the following issues:

1. Linux 6.2+ on arm64 has exported them with `EXPORT_SYMBOL_GPL`, so
   license compatibility must be checked before use.
2. On both arm and arm64, the definitions of these symbols are guarded
   by `CONFIG_KERNEL_MODE_NEON`, but their declarations are still
   present. Checking in configuration phase only leads to MODPOST
   errors (undefined references).

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
Closes openzfs#15711 
Closes openzfs#14555 
Closes: openzfs#15401
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested) Type: Architecture Indicates an issue is specific to a single processor architecture
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Module build fails on aarch64 due to using GPL-only symbol
2 participants