Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp701482pxb; Wed, 22 Sep 2021 10:51:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxr0vrG+3WjpIy0oeZi8WqWHwMmvtbzRgDZUBzIv/tuSXs/ihC0GFnpeV3v0tGZqlfa8I5M X-Received: by 2002:a5d:9601:: with SMTP id w1mr186752iol.209.1632333090333; Wed, 22 Sep 2021 10:51:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632333090; cv=none; d=google.com; s=arc-20160816; b=DMwsYkRu5EawAGX7OFEcyBP3P20tOW55HWkW2N+6JH/T69g+MCM1hqCPDDC1SvSjeG w+nToRpj6hhDehmGg40BvhIp+5swZTNAMJpreBqchIeNgFpZhjxPAwl0ve8y43tDlawM Vo0GisHT48vp28JqzqjZIgxRg04Cl30Y73PY0xQvmQd73PKp3ZIyPY0qqJS6IcIlbTj1 a2sh8W+NNdoFzCLvNj7M49MzAnwBvQbR5c/I6oHCKWrvfcAvxF6B+uQiUvghsJF4sb6A zor+OcRGZBTDZQP9kpBZnJ/G5+Eh8os9IQMe+Nrbmr+nFhlHkg10Gduh6AaGrr7mxUPs 1aNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=rZT2K/Q8MUfaC2qjpJTTFyZ9xAJMAYxQ7cgEJCjq2XY=; b=xQ4zQbRnnvxN83fooiASJbnozV3HNhatzavO89BfUYq3fD5+VrdXxOA6khXKNWwPhr uK4iXKyq4C9BNaSRxfh8EJiFCDl822uAKKa8DkoLpc+BWO4mPD45nc/mq6wo2g+NHf8u CKDR5RbHLz5pstj+F6Q6evaEw6mkK+tsPH2bd6VVLZTmhfsdBl6qeUGu1iE3TRhW3ZSA oOQZ256OUBndzWyBkd7ukf8Ux32kiCtu3Lr9IIbw6ZbuiD86oy1AWkzUuEDBXknHRE4P 0pZHdL9PEk8X5fjhclQXHfIom6VJnBvJsiLZy5mt/jZOKOdQ6a3AnJZ5s9Lkgw4hu9Aw 1ydw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=MPds0ZGb; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q25si3194184ios.80.2021.09.22.10.51.11; Wed, 22 Sep 2021 10:51:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=MPds0ZGb; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233552AbhIVRwj (ORCPT + 99 others); Wed, 22 Sep 2021 13:52:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236837AbhIVRwj (ORCPT ); Wed, 22 Sep 2021 13:52:39 -0400 Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3CE1C061757 for ; Wed, 22 Sep 2021 10:51:08 -0700 (PDT) Received: by mail-qk1-x730.google.com with SMTP id p4so12738685qki.3 for ; Wed, 22 Sep 2021 10:51:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=rZT2K/Q8MUfaC2qjpJTTFyZ9xAJMAYxQ7cgEJCjq2XY=; b=MPds0ZGb7d0+CWzI3IilgsLSQygqyPWCjWlOAXUh2tHeCGrHgpetNvxFmfD6QnhOQV 1bdl5zXekJR4RUdJYMmgVcLebiNcBUPeRUVsy57tWR2SJvZEqg0xZb8frrm+Wom5QqIT mL5HC0qmGPH+zzRqBhXinHZCCIGvLqAs+9S2biycWjurIpNIxmG3M5PU9IuPk9VzCgmK Qsnw0QAypE6Sfu8609A3TGaAQ6ue+0MbApyeG7ZX4YH92Fy/L6sCPY+AU3JdXySi60Yw WKz0pXYX6Mkcd7YiEgbzEpUyKfBEiTXlEGs1h7v6hyQPpGvXTU+xSDQCWXTGHkOVMoir 90VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=rZT2K/Q8MUfaC2qjpJTTFyZ9xAJMAYxQ7cgEJCjq2XY=; b=LMYzKE9m0PNT3kPsvjaXdiOh9kbflWOuvwy9lY1W0k08+4AQ8I66Lr+TK2NZV+2bcN 17qls9vhu40T1k0CHDhIijBQy19HvqZFvKCyo4ZEoDL3x7KMPoMiICNELI6I2MgEj1IA aoXvM1UleD3Bw9znd0XIsdymW8mrCMh1zQVn+pOd+ULZDptvqjTa6oV9UR0NriFRYFkj BfIIeFT2+vRwcRkN51Rp0YtEJiqMQxZ9paNajFtNo86Vl7hrajifj0nCsi+qZOfqXpxk e5v/qLp8khwxWRJyTzXuqvBCOCQm/s+/phbKQ/EWpZWZQ2BtTbGHoeq7rIIMOTOLTl7h 86Bg== X-Gm-Message-State: AOAM532QkwwMr70rC9TLrfrZt9RSCUr6zVdhrFqkWqw+dw5AY7KUXqMj qP86tFxjJlCXguEGN1IkUVK4b3/AdX+7nKgRkxpPUg== X-Received: by 2002:a37:8044:: with SMTP id b65mr531503qkd.150.1632333067678; Wed, 22 Sep 2021 10:51:07 -0700 (PDT) MIME-Version: 1.0 References: <20210922170903.577801-1-lvivier@redhat.com> In-Reply-To: <20210922170903.577801-1-lvivier@redhat.com> From: Alexander Potapenko Date: Wed, 22 Sep 2021 19:50:31 +0200 Message-ID: Subject: Re: [PATCH 0/4] hwrng: virtio - add an internal buffer To: Laurent Vivier Cc: LKML , linux-crypto@vger.kernel.org, Dmitriy Vyukov , rusty@rustcorp.com.au, amit@kernel.org, akong@redhat.com, Herbert Xu , "Michael S . Tsirkin" , Matt Mackall , virtualization@lists.linux-foundation.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, Sep 22, 2021 at 7:09 PM Laurent Vivier wrote: > > hwrng core uses two buffers that can be mixed in the virtio-rng queue. > > This series fixes the problem by adding an internal buffer in virtio-rng. > > Once the internal buffer is added, we can fix two other problems: > > - to be able to release the driver without waiting the device releases th= e > buffer > > - actually returns some data when wait=3D0 as we can have some already > available data > > It also tries to improve the performance by always having a buffer in > the queue of the device. Tested-by: Alexander Potapenko for the series With these four patches applied, KMSAN stops reporting boot-time errors in _mix_pool_bytes reported here: https://www.spinics.net/lists/linux-virtualization/msg46310.html > Laurent Vivier (4): > hwrng: virtio - add an internal buffer > hwrng: virtio - don't wait on cleanup > hwrng: virtio - don't waste entropy > hwrng: virtio - always add a pending request > > drivers/char/hw_random/virtio-rng.c | 84 +++++++++++++++++++++-------- > 1 file changed, 63 insertions(+), 21 deletions(-) > > -- > 2.31.1 > > --=20 Alexander Potapenko Software Engineer Google Germany GmbH Erika-Mann-Stra=C3=9Fe, 33 80636 M=C3=BCnchen Gesch=C3=A4ftsf=C3=BChrer: Paul Manicle, Halimah DeLaine Prado Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg