Summary: | armv8crypto doesn't announce it self in the dmesg output | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Gordon Bergling <gbe> | ||||||||
Component: | arm | Assignee: | Mitchell Horne <mhorne> | ||||||||
Status: | Closed FIXED | ||||||||||
Severity: | Affects Some People | CC: | emaste, mhorne | ||||||||
Priority: | --- | ||||||||||
Version: | CURRENT | ||||||||||
Hardware: | Any | ||||||||||
OS: | Any | ||||||||||
Attachments: |
|
Description
Gordon Bergling
![]() ![]() Created attachment 221494 [details] Print message Hi Gordon, Plucking a random RPi4B dmesg: https://dmesgd.nycbug.org/index.cgi?do=view&id=5864 It seems that the CPU lacks the AES instruction extension, and armv8crypto doesn't attach. For a supported CPU, we would expect to see "AES" or "AES+PMULL" listed under Instruction Set Attributes 0. I've attached a patch that adds a message when the driver fails to attach. Note that on supported hardware, the driver announces itself as expected. Created attachment 221600 [details]
dmesg of RPi4 with patch applied
I applied your patch, but I didn't see a positive or negative announcement of armv8crypto module, even if the RPi4B doesn't support the hardware acceleration. Maybe D27454 improves the situation. Add AES-GCM H/W acceleration for kTLS on ARMv8 architecture https://reviews.freebsd.org/D27454 (In reply to Gordon Bergling from comment #3) That's quite surprising, since the patch contains case statements for all three legal values. Which git revision did you build from? It should at least be newer than 074a91f746bd (Jan 13) for armv8crypto to be loaded automatically, otherwise you will need to kldload armv8crypto. Created attachment 221602 [details]
Print message (extra printf)
You might try this patch next, to ensure we get _something_ printed.
(In reply to Mitchell Horne from comment #5) Even with the latest patch applied, no value is printed. Please see https://people.freebsd.org/~gbe/2021-01-15-dmesg-RPi4B-with_modification.txt for a full dmesg output and local modifications. Besides your patch, I currently have a change in the tree regarding KTLS on the RPi4B, but I wouldn't think that this makes a difference. The tree itself is 'git: b14cfecbf0ed - main - pkgfs_open: follow symlink' from today. (In reply to Gordon Bergling from comment #6) > FreeBSD 13.0-ALPHA1 #12 main-c255973-gb14cfecbf0ed: Fri Jan 15 09:32:46 CET 2021 Are you sure that you built the kernel with the patches applied? I would expect to see "-dirty" appended to the version string if so, or a different hash if you applied them and made a local commit. For example, the kernel I just built with the patch applied, uncommitted: > FreeBSD 13.0-ALPHA1 #52 main-c255982-g0b92d1dd18c1-dirty: Fri Jan 15 11:59:47 AST 2021 (In reply to Mitchell Horne from comment #7) Yes I did. Please see the mentioned link above. I didn't have committed the patches locally, but appended a 'git diff' from /usr/src to the dmesg output. (In reply to Mitchell Horne from comment #7) Mmhh, but if you see a -dirty applied to the uname output with a local non-committed change that is strange. I thought -dirty can only be work for local commits. (In reply to Mitchell Horne from comment #7) Sorry, I messed up the obj directory. dmesg shows now, armv8crypto0: CPU lacks AES intrinsicsAES val: 0 Wish indicates that the RPi4B is missing the needed instructions. (In reply to Gordon Bergling from comment #10) All good, thanks for confirming the patch. I will commit it shortly. A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=a520f5ca580fcff34fd0d9f0d64a4c165f57eb30 commit a520f5ca580fcff34fd0d9f0d64a4c165f57eb30 Author: Mitchell Horne <mhorne@FreeBSD.org> AuthorDate: 2021-01-18 20:59:21 +0000 Commit: Mitchell Horne <mhorne@FreeBSD.org> CommitDate: 2021-01-18 20:59:21 +0000 armv8crypto: print a message on probe failure Similar to the message printed by aesni(4), let the user know if the driver is unsupported by their CPU. PR: 252543 Reported by: gbe MFC after: 3 days Sponsored by: The FreeBSD Foundation sys/crypto/armv8/armv8_crypto.c | 3 +++ 1 file changed, 3 insertions(+) A commit in branch stable/12 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=d970a8218e16e3da8234f8b236d28919c1439090 commit d970a8218e16e3da8234f8b236d28919c1439090 Author: Mitchell Horne <mhorne@FreeBSD.org> AuthorDate: 2021-01-18 20:59:21 +0000 Commit: Mitchell Horne <mhorne@FreeBSD.org> CommitDate: 2021-01-21 17:12:00 +0000 armv8crypto: print a message on probe failure Similar to the message printed by aesni(4), let the user know if the driver is unsupported by their CPU. PR: 252543 Reported by: gbe Sponsored by: The FreeBSD Foundation (cherry picked from commit a520f5ca580fcff34fd0d9f0d64a4c165f57eb30) sys/crypto/armv8/armv8_crypto.c | 3 +++ 1 file changed, 3 insertions(+) |