New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add aarch64 asm accelerated versions of crypto algorihtms to kernel #9756
Conversation
Should anybody wish to benchmark this, install
|
I think it would be better to build these modules as packages instead of permanently compiling them into the kernel. Compiling them permanently into the kernel results in increased size. For example, ghash is built this way. |
I know. That was introduced by 285df63, in Feb 2020. Then in Dec 2021, fa3690f made the generic version built-in, and mac80211 will happily use it instead of the optimized version. Most of the crypto api was switched to being built in by c718212, earlier in June, 2021, because:
This is basically what I'm mimicking here. I looked at all of generic drivers that were already built in (not necessarily by the above commits), and selected their asm version where available. The exception was mvebu, where I mimicked the 32-bit behavior instead. I did so because the 32-bit selection was not done in the subtarget config, but in the target one--which should apply to both 32 and 64-bit SoC. I wasn't sure this would be the best course of action, but if I owned one of them, I would build them in. |
47e5322
to
1dabe86
Compare
I'm marking this ready for review. Kernel detects CE support before enabling the drivers, so this should not break anything. I've rebased and compile-tested this today. |
This enables arm64/neon version of AES, SHA256 and SHA512 algorithms in the kernel. bcm2710 does not support armv8 crypto extensions, so they are not included. Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
This enables arm64/neon version of AES, SHA256 and SHA512 algorithms in the kernel. bcm2711 does not support armv8 crypto extensions, so they are not included. Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
This enables armv8 crypto extensions version of AES and GHASH algorithms in the kernel. Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
This enables armv8 crypto extensions version of AES, GHASH, SHA256 and CRC T10 algorithms in the kernel. Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
This is result of a plain make kernel_oldconfig CONFIG_TARGET=subtarget. Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
This enables armv8 crypto extensions version of AES, GHASH, SHA1, SHA256, and SHA512 algorithms in the kernel. The choice of algorithms match the 32-bit versions that are enabled in the target config-5.10 file, but were only used by the cortexa9 subtarget. Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
This is result of a plain make kernel_oldconfig CONFIG_TARGET=subtarget. Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
This enables armv8 crypto extensions version of AES, GHASH, SHA1, SHA256, and SHA512 algorithms in the kernel. The choice of algorithms match the 32-bit versions that are enabled in the target config-5.10 file, but were only used by the cortexa9 subtarget. Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
Adds the crypto extensions version of the CRC T10 algorithm that is already built into the kernel. Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
This enables armv8 crypto extensions version of AES, GHASH, and CRC T10 algorithms in the kernel. Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
This is result of a make kernel_oldconfig CONFIG_TARGET=subtarget. One new option popped up: Support for the Allwinner H616 CCU (SUN50I_H616_CCU) [Y/n/?] (NEW) n Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
This enables armv8 crypto extensions version of AES, GHASH, SHA1, and CRC T10 algorithms in the kernel. Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
1dabe86
to
dbfec2c
Compare
@cotequeiroz only concern of this is size increase... aside from this i think it should be safe to enable this... @ynezz wonder if you can spin this on a github action just to make sure the additional config doesn't cause some strange thing? |
It's a 20k increase for most compressed target images, and 30k for mvebu, which adds the most algorithms. |
I just read the reason of why it would be a bad idea to use mods... think will just merge this |
Anyway i'm running this under https://github.com/Ansuel/openwrt/runs/6730322372 and then merge if everything goes well |
Thanks, merged to master! We still have to wait for the wolfssl pr tho... |
This series adds armv8 Crypto Extensions accelerated versions of crypto algorithms to the following targets:
bcm4908
layerscape/armv8_64b
mvebu/cortexa53
mvebu/cortexa72
rockchip/armv8
sunxi/cortexa53
Also:
octeontx
was missing the CE optimized CRC T10 algorihtm, so it was added here.bcm27xx/bcm2710
andbcm27xx/bcm2711
don't have the crypto extensions, so the SIMD neon versions were added instead.mvebu/cortex{a53,a72}
configs were given a refresh, although they are not strictly required.For most targets, no algorithms were added if the regular C version was not included. I've made an exception for mvebu: I've mirrored the algorithms that the 32-bit cortex-a9 has. I found it rather odd that the asm config symbols were set at the target, not subtarget config, even though they only apply to the 32-bit a9. So, i mimicked what 86e27f1 had done to cortex-a9 and added the same algorithms to the 64-bit targets. I have not gone so far as to move the 32bit symbols to the cortexa9 subtarget, but I do think it is a good idea. I think I'm already doing too much in one PR, so I'm leaving this one out.
noob alert:
sunxi/cortexa53
config-5.15 was missing theCONFIG_SUN50I_H616_CCU
symbol, so I added it as an
. IIUC, it is a new H616 SOC, which--I'm guessing--is not supported by openwrt yet (or else someone would have already fixed it). Of course, if setting this toy
is enough to add support for it, let me know, and I'll happily change this.I've already done this to mediatek/mt7622 in #9698 because I have access to the hardware. The speedup was 16 times for aes-128-ctr, 17x for aes-128-gcm, and 9 times for sha256.
The targets supporting CE should be confirmed here or in #9738. I've compiled-tested the changes for all targets, but I don't have any of them to run-test.