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)
Apr 10 2024, 3:19 AM
Unknown Object (File)
Feb 29 2024, 4:23 AM
Unknown Object (File)
Feb 28 2024, 7:51 PM
Unknown Object (File)
Jan 24 2024, 1:50 AM
Unknown Object (File)
Jan 9 2024, 11:27 AM
Unknown Object (File)
Dec 20 2023, 4:35 AM
Unknown Object (File)
Dec 12 2023, 1:53 PM
Unknown Object (File)
Dec 11 2023, 2:08 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.