Page MenuHomeFreeBSD

openzfs: arm64: implement kfpu_begin/kfpu_end
ClosedPublic

Authored by kevans on Apr 6 2023, 3:40 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 10, 10:14 AM
Unknown Object (File)
Wed, Nov 6, 1:25 AM
Unknown Object (File)
Sun, Nov 3, 8:55 AM
Unknown Object (File)
Sat, Nov 2, 9:30 AM
Unknown Object (File)
Tue, Oct 29, 7:23 AM
Unknown Object (File)
Oct 9 2024, 9:07 AM
Unknown Object (File)
Oct 9 2024, 9:07 AM
Unknown Object (File)
Oct 9 2024, 9:06 AM
Subscribers

Details

Summary

This is part one of a fix for booting with ZFS on arm64. Checksum
benchmarking will attempt to use the FPU, so we currently panic quickly
on boot. BLAKE3 is still broken, as it clobbers x18 and we promptly
discover that fact as soon as we attempt to fetch curthread in
kfpu_end().

This is staged in OpenZFS PR #14715, but this PR is being actively
debated.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kevans requested review of this revision.Apr 6 2023, 3:40 PM

Can we just disable the accelerated BLAKE3 for now? It sounds like it's a pretty low priority for Tino to fix, and looking at the referenced tooling it's not clear at all how they generated these files from their original SSE implementations. SIMDE is a header-only library.

Can't be worse than what's there now

This has now been merged upstream

Tino has now sent a PR upstream to address the primary issues with the BLAKE3 implementation: https://github.com/openzfs/zfs/pull/14728

There's one additional issue that @imp was going to take a stab at, there's no way at the moment to disable the accelerated implementation in the bootloader so we have kfpu_begin/kfpu_end leaking in and failing miserably since we don't have fpu_kern(9) there.

Something like this should sort it.

sys/contrib/openzfs/include/os/freebsd/spl/sys/simd_aarch64.h
54

#ifdef _STANDALONE
#define kfpu_allowed() 0
#define kfpu_initialize(tsk) do {} while (0)
#define kfpu_begin() do {} while (0)
#define kfpu_end() do {} while (0)
#else

80

#enidf

sys/contrib/openzfs/include/os/freebsd/spl/sys/simd_aarch64.h
54

Yeah, I was really hoping to avoid needing shenanigans like that to keep this consistent with other architectures that don't need to be careful about it.

This revision was not accepted when it landed; it landed in state Needs Review.Apr 26 2023, 5:25 PM
This revision was automatically updated to reflect the committed changes.