Repository navigation
crypto: apple: SIO AES engine skcipher driver for T6000 and T8112 - #1572
Merged
Merged
Conversation
Add ecb(aes), cbc(aes) and ctr(aes) on the SIO AES engine of T6000 and T8112. The driver loads a software key and IV through the command FIFO, runs the block operation by DMA behind the SIO DART and waits for the barrier interrupt. It never selects a hardware key and never maps the key-disable bank. Requests go through crypto_engine and are staged in one 512 KiB DMA bounce buffer, which handles arbitrary scatterlists, in-place requests and CTR tails. CTR commands are split so the low counter word never wraps inside one command. The output IV is computed in software. The block is powered by runtime PM with a 50 ms autosuspend delay. The engine is slower than the ARMv8 Crypto Extensions, so the algorithms register at priority 150, below aes-ce and aes-neon. Users get them only by driver name. The probe-only diagnostics driver keeps T6041 and T8140. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
The skcipher driver now drives these nodes. Enable them on T6000, T6001, T6002 and T8112. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
The engine takes the key and IV bytes as little-endian 32-bit words. With big-endian words the FIPS-197 vector comes out wrong and the self-tests fail; with little-endian words ecb, cbc and ctr pass. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
Contributor
Author
|
Buildbox gates: full arm64 kernel build of 6a15dd2 with the fleet config (CONFIG_CRYPTO_DEV_APPLE_SIO_AES=m, no new warnings in drivers/crypto/apple-aes.c); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a crypto API driver for the SIO AES engine on T6000 (M1 Pro/Max/Ultra) and T8112 (M2), and enables the existing
apple,aesnodes on those SoCs.Driver
drivers/crypto/apple-aes.cregistersecb(aes),cbc(aes)andctr(aes)(*-aes-apple-sio) through crypto_engine.capi:cbc-aes-apple-sio-plain64in dm-crypt.drivers/soc/apple/apple-sio-aes.c) keeps T6041 and T8140.Key and IV bytes go into the FIFO as little-endian 32-bit words. Big-endian words fail the FIPS-197 vector.
Results, M1 Pro (j316s)
Kernel 7.3.0-aurora-aesref1 (this branch on integration/aurora 9b181ec), DTB = the production fleet64 j316s DTB with only
crypto@39b060000set okay.selftest: passed.ecb(aes)/cbc(aes)/ctr(aes)stay*-aes-ce(priority 300).cryptsetup benchmark -c aes-cbc -s 256(aes-ce): 896 MiB/s encrypt, 5515 MiB/s decrypt.Results, M2 (j413)
Kernel 7.3.0-aurora-aesref2 (this branch at 6a15dd2), DTB = the production fleet64 j413 DTB with only
aes@23500c000set okay.selftest: passed. Defaults stay*-aes-ce.cryptsetup benchmark -c aes-cbc -s 256(aes-ce): 860 MiB/s encrypt, 5794 MiB/s decrypt.The M1 Pro run used aesref1 with the driver module rebuilt from 6a15dd2 against that tree. The M2 run used a kernel built from the branch head.
🤖 Generated with Claude Code