RNDR/SS vs. SMCCC

Benjamin Herrenschmidt benh at kernel.crashing.org
Wed May 26 16:54:03 PDT 2021


Hi folks !

I'm trying to understand the rationale for having SMCCC take precedence
over the architected instruction in
arch/arm64/include/asm/archrandom.h 

Especially I don't quite get the comment about SMCCC being more in the
"spirit" than let's say RNDRSS. It's definitely MUCH slower.

Also, why not implement arch_get_random_* using RNDR rather than
forcing these through the kernel CNRG ?

Finally, RNDR/RNDRSS can fail occasionally, we should probably
implement some kind of delay+retry here. I'm not super familiar with
the context in which arch_get_random_* can be called (are they allowed
to sleep ?) but from the implementation I'm aware of at least, the idea
is that they might under some HW recovery scenarii so we should sleep a
couple of ms and try again a few times.

Thoughts ?

Cheers,
Ben.





More information about the linux-arm-kernel mailing list