Bug 249410

Summary: [ZFS][workaround exists] missing symbol for fletcher4+NEON on zfs.ko on aarch64 making root-on-zfs impossible
Product: Base System Reporter: filcab <freebsd.bz>
Component: kernAssignee: freebsd-fs (Nobody) <fs>
Status: Closed Overcome By Events    
Severity: Affects Some People CC: freqlabs, lwhsu, mmacy
Priority: ---    
Version: CURRENT   
Hardware: arm64   
OS: Any   

Description filcab 2020-09-17 20:45:24 UTC
Hi all,

I'm trying to boot a Raspberry Pi 4 straight to root on ZFS (I know, it's my own fault :-) ).
The issue here is that when the loader loads zfs.ko (even when manually loading its deps (opensolaris.ko and cryptodev.ko)), it complains that fletcher_4_aarch64_neon_ops is not defined.

OpenZFS has commit with a simple workaround (disable NEON implementation of fletcher4 on FreeBSD):
https://github.com/openzfs/zfs/commit/2dbad4471005784e97b65b60ecfdbf6dddc4b751

Is it possible to import it into FreeBSD for now? (Ideally the issue will be fixed and we'll have a NEON impl of fletcher4, but for now having it work would be better than just failing).

I've tested this with the -CURRENT image for RPi3:
https://download.freebsd.org/ftp/snapshots/arm64/aarch64/ISO-IMAGES/13.0/FreeBSD-13.0-CURRENT-arm64-aarch64-RPI3-20200827-r364846.img.xz

Unfortunately, I don't have enough hardware to run a full crochet build in an appropriate amount of time (I'm trying in a VM, but it's taking so long to even clone to /usr/src...).

I don't have the boot output, but have this:
I've mounted the UFS partition from the image I mentioned above and:
root@vm:/mnt/boot # nm kernel/zfs.ko | grep 'fletcher_4_' | grep U
                 U fletcher_4_aarch64_neon_ops

This symbol should be defined in the module, per the source code. But for some reason it isn't. I'm not familiar enough with the FreeBSD CI to try and track errors about it, sorry :-(

Hopefully we can import the workaround for now and/or fix it properly soon.

Thank you, and sorry I can't help much more,

 Filipe
Comment 1 filcab 2020-09-28 21:49:25 UTC
Closing this bug.

It seems I was looking at older versions of the code and had an old (a few days too old) image. This now works in the current images.

Thank you,
 Filipe