OP-TEE / optee_os

Trusted side of the TEE
Other
1.57k stars 1.06k forks source link

Can optee support ARMv8 SIMD, floating-point and optional Crypto Extension? #1446

Closed chinnabha closed 7 years ago

chinnabha commented 7 years ago

@jenswi-linaro, @jbech-linaro

Please confirm if Optee can support A64 SIMD, floating-point and optional Crypto Extension? In case no, is there any plan in pipeline to support them?

Thanks.

jenswi-linaro commented 7 years ago

Yes, it's supported.

chinnabha commented 7 years ago

Those are hardware supported.

Does Optee supports the SW versions of those operations (or) it can run the hw supported instructions on the secure memory address space contents?

Kindly help in elaborating this.

jenswi-linaro commented 7 years ago

It's supported to run in hardware. See for instance how AES is accelerated using Crypto Extensions in core/lib/libtomcrypt/src/ciphers/aes_armv8a_ce.c function aes_ecb_encrypt_nblocks(). This is EL1 code so CE code has to be surrounded by thread_kernel_enable_vfp() and thread_kernel_disable_vfp(). This pattern is similar to how it's done in the Linux kernel.

In EL0 we're trapping the accesses and enable accesses to the registers as needed instead.

chinnabha commented 7 years ago

Thanks Jens, this is helpful.

chinnabha commented 7 years ago

Earlier, Linux Kernel use to have support for ARMv7 (neon) based Crypto. I am not aware of the current state of the Kernel crypto driver. What might be the case of optee CE code? Is it a full blown A64 CE or the base set?

jenswi-linaro commented 7 years ago

Both OP-TEE and the Linux kernel uses full AAarch64 (and AArch32) CE.

chinnabha commented 7 years ago

Thanks much @jenswi-linaro.