Skip to content

Conversation

@behlendorf
Copy link
Contributor

Motivation and Context

#17852

Description

Disable the aarch64 NEON SIMD intrinsics for kernel builds. Safely using them in the kernel context requires saving/restoring the FPU registers which is not currently done.

This lets us remove the problematic workaround in the aarch64_compat.h header which undefines the aarch64 macro.

How Has This Been Tested?

Basic compilation will be tested by the CI, but unfortunately we don't yet have an aarch64 target. Help testing this on an aarch64 system would be appreciated.

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)
  • Quality assurance (non-breaking change which makes the code more robust against bugs)
  • 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:

@behlendorf behlendorf added Type: Architecture Indicates an issue is specific to a single processor architecture Status: Code Review Needed Ready for review and testing labels Nov 5, 2025
@robn
Copy link
Member

robn commented Nov 6, 2025

This looks much better.

I'm just getting my hinky little rpi4 back on, and then I can at least say whether or not it "works" before/after. It doesn't have NEON though so its only half a test, but better than nothing.

Copy link
Member

@robn robn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builds ok on 6.12.47 aarch64, and select parts of the test suite continue to run (most importantly, compression). So at least not worse I think. Good job!

@behlendorf behlendorf requested a review from tonyhutter November 6, 2025 19:12
Disable the aarch64 NEON SIMD intrinsics for kernel builds.  Safely
using them in the kernel context requires saving/restoring the FPU
registers which is not currently done.

Additionally, remove the aarch64 optimized PREFETCH_L1 and PREFETCH_L2
instruction.  Rely on the more portable compiler built ins.

This lets us remove the problematic workaround in the aarch64_compat.h
header which undefines the __aarch64__ macro.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
@behlendorf
Copy link
Contributor Author

Out of an abundance of caution I updated the patch to remove the aarch64 assembly for L1 and L2 prefetching. The generic __builtin_prefetch() is now used in the same way as other architectures.

@robn
Copy link
Member

robn commented Nov 7, 2025

compression still passing here.

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Nov 7, 2025
@behlendorf behlendorf merged commit 962474d into openzfs:master Nov 7, 2025
23 of 25 checks passed
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.

3 participants