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)
Jun 1 2024, 3:42 PM
Unknown Object (File)
May 3 2024, 9:31 AM
Unknown Object (File)
Apr 13 2024, 11:50 AM
Unknown Object (File)
Mar 13 2024, 3:45 PM
Unknown Object (File)
Feb 10 2024, 5:24 PM
Unknown Object (File)
Jan 14 2024, 5:38 AM
Unknown Object (File)
Dec 20 2023, 6:27 AM
Unknown Object (File)
Oct 20 2023, 10:57 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