]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
crypto: virtio - Add spinlock protection with virtqueue notification
authorBibo Mao <maobibo@loongson.cn>
Tue, 13 Jan 2026 03:05:54 +0000 (11:05 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 31 Jan 2026 02:52:30 +0000 (10:52 +0800)
commitb505047ffc8057555900d2d3a005d033e6967382
tree2c6214a3638d8f5f7c7b1c086cb4094147f499c5
parent0ceeadc7b53a041d89d5843f6bf0ccb7c98b0b4f
crypto: virtio - Add spinlock protection with virtqueue notification

When VM boots with one virtio-crypto PCI device and builtin backend,
run openssl benchmark command with multiple processes, such as
  openssl speed -evp aes-128-cbc -engine afalg  -seconds 10 -multi 32

openssl processes will hangup and there is error reported like this:
 virtio_crypto virtio0: dataq.0:id 3 is not a head!

It seems that the data virtqueue need protection when it is handled
for virtio done notification. If the spinlock protection is added
in virtcrypto_done_task(), openssl benchmark with multiple processes
works well.

Fixes: fed93fb62e05 ("crypto: virtio - Handle dataq logic with tasklet")
Cc: stable@vger.kernel.org
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Acked-by: Jason Wang <jasowang@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/virtio/virtio_crypto_core.c