Enable in-kernel acceleration of SHA1 and SHA2 operations on arm64 by adding
support for the ossl(4) crypto driver. This uses OpenSSL's assembly routines
under the hood, which will take advantage of SHA intrinsics if present.
Details
Compile as module and included in kernel config.
Verified using cryptotest.py and cryptocheck -a hash,mac -d ossl -z.
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 35170 Build 32120: arc lint + arc unit
Event Timeline
See my one caveat on the x86 review about where to put the cpuid file. Looks great in general. The arm cpuid bits are so much simpler. :)
sys/modules/ossl/Makefile | ||
---|---|---|
18 | Adding to OBJS unconditionally here won't work on x86? I think you can still make this 'SRCS.aarch64' and list the S files. You might have to put the build rule for the armv8 object files below the include, and/or use something like: ${SRCS.aarch64:S/S/o}: ${.TARGET:R}.S or perhaps more readable (but verbose): .for f in ${SRCS.aarch64} ${f:R}.o: ${f} ${CC} ... .endfor |
There's one remaining issue I discovered, the generated assembly files want to include the arm_arch.h header. I'm thinking the best solution is to copy this header into the ossl source files rather than modifying the generated files or including it from userland sources. Thoughts?
sys/modules/ossl/Makefile | ||
---|---|---|
18 | Thank you, I had somehow convinced myself that adding these to SRCS.aarch64 didn't work, but it seems it did after all. make is hard :/ |
arm_arch.h looks ok to me the way you've done it (copy).
sys/modules/ossl/Makefile | ||
---|---|---|
36 | Hmmm, this might need an extra :M*.S to not generate a rule for ossl_arch64.c. |
sys/modules/ossl/Makefile | ||
---|---|---|
35 | "filesto" to be fixed before committing. |