Page MenuHomeFreeBSD

aesni: sha also uses %xmm registers file
AbandonedPublic

Authored by kib on Feb 4 2021, 6:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 18 2025, 11:02 PM
Unknown Object (File)
Nov 18 2025, 11:02 PM
Unknown Object (File)
Nov 18 2025, 9:40 PM
Unknown Object (File)
Oct 9 2025, 10:45 AM
Unknown Object (File)
Sep 12 2025, 2:25 AM
Unknown Object (File)
Aug 2 2025, 10:47 PM
Unknown Object (File)
Jul 28 2025, 12:45 AM
Unknown Object (File)
Jul 5 2025, 8:31 AM
Subscribers

Details

Reviewers
jhb
Summary

PR: 251462

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

kib requested review of this revision.Feb 4 2021, 6:16 PM
kib created this revision.
jhb requested changes to this revision.Feb 4 2021, 6:27 PM
jhb added a subscriber: jhb.

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.

This revision now requires changes to proceed.Feb 4 2021, 6:27 PM