lkml.org 
[lkml]   [2022]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: :Re: [PATCH v2 04/19] crypto: x86/sha - limit FPU preemption
Date


> > diff --git a/arch/x86/crypto/sha1_ssse3_glue.c
...
> > + do {
> > + unsigned int chunk = min(len, FPU_BYTES);
> > +
> > + if (chunk) {
> > + kernel_fpu_begin();
> > + sha1_base_do_update(desc, data, chunk, sha1_xform);
> > + kernel_fpu_end();
> > + }
> > +
> > + len -= chunk;
> > + data += chunk;
> > + } while (len);
>
> 'len' can't be 0 at the beginning of this loop, so the 'if (chunk)' check
> isn't needed. And it wouldn't make sense even if 'len' could be 0, since
> a while loop could just be used in that case.

Thanks, I'll remove that if from all the sha functions, since they do
have that protective check upfront. I'll review the 0 byte handling in
all of them.

\
 
 \ /
  Last update: 2022-10-14 00:43    [W:0.078 / U:2.560 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site