• Ard Biesheuvel's avatar
    crypto: aesni - release FPU during skcipher walk API calls · 65d1e3c4
    Ard Biesheuvel authored
    Taking ownership of the FPU in kernel mode disables preemption, and
    this may result in excessive scheduling blackouts if the size of the
    data being processed on the FPU is unbounded.
    
    Given that taking and releasing the FPU is cheap these days on x86, we
    can limit the impact of this issue easily for skcipher implementations,
    by moving the FPU begin/end calls inside the skcipher walk processing
    loop. Considering that skcipher walks operate on at most one page at a
    time, doing so fully mitigates this issue.
    
    This also permits the skcipher walk logic to use non-atomic kmalloc()
    calls etc so we can change the 'atomic' bool argument in the calls to
    skcipher_walk_virt() to false as well.
    Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    65d1e3c4
aesni-intel_glue.c 33.1 KB