PR: 251462
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Comment Actions
Bah, I clicked accept too soon and can't undo it, so using the request changes thing. Phab's UI is kind of crappy.
While SHA does use the FPU during processing, it doesn't use it during session setup. If it did, we would instead need to acquire the FPU earlier before calling aesni_authprepare(). As it is, even the current check is kind of wrong as we only need the context if we call aesni_cipher_setup_common() which is conditional on a session key being set, not having a cipher algorithm. It would perhaps be clearer if the code was instead structured as:
if (csp->csp_cipher_key != NULL) {
kt = is_fpu_kern_thread(0);
if (!kt) {
ACQUIRE_CTX(ctxidx, ctx);
fpu_kern_enter(...);
}
aesni_cipher_setup_common(...);
if (!kt) {
...
}
}
return (0);Though for something as short as setting up the key schedule, using FPU_KERN_NOCTX (which didn't exist when this was first written) is probably cheaper.