Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp668120pxb; Wed, 22 Sep 2021 10:10:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynLTuL/St1WR6NVcnDLo2vezb3cNe1IymIwNQlQGhFzNDcRvWlzLXhzA6vhTXdaFcWRfO7 X-Received: by 2002:a17:906:7147:: with SMTP id z7mr296423ejj.94.1632330599723; Wed, 22 Sep 2021 10:09:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632330599; cv=none; d=google.com; s=arc-20160816; b=Tuk7dzdtXL61zDWo5gOofRGPANTYv1ohwT+4xi6GQ++l7E22VSDlse8iErqCsk539l tYIqEzKQIDicxTi0TqGqK3khWwPQtW/SWushCBZmajrvN1ZQfftvhU1V7xLGWEyEJfLD ZmO332nxRpQ/edMBDEVCTCH7fcwhv2ju4/j4gR7c8fgJihO4FK+xHfVdTtTImDjQQSh4 95A6Fu8L9/HCXJ1X7g/jtVxJ2vdjbNp/5sfwCeeDhYUOjh7Wz56tDcvmNVfsVUx8hyXO pv3u+FLkgZl+Z7WaBbayZd9zp6wGdyTJ9HQRFNK3B2GlVv2NwaEONYecB+eqvQGx9nab bTiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=SHrxHOUJFC7SXjO6oPt56HM9d80tm/abAg5EY0FI59M=; b=hMPJIuVPciF16kfp+hIxeQOh0smTVQgx2RXhK2bF8i6uQm4rTKEi9dIvkGtpjjLp+C DC2wBtQiRkEbEFaq4QLQcKf8JuPdZwqsXDtY9i2EuGY/HtRbh01AKWX05H0Cwn74ffze bWfSMF/QCfi8RhnEG82SqcL6AqvOe2HfN9qwLjfKxOxwn529P/W9rGhhfk9lOMMq+LUo F70ACOAXWtoli8WRrKmTEPiz6r6c9N2slXLNvJlGciY6sl7EqZu+oOANcl4l59/Dulm/ BRbJmS1JRxPsGHIIG87LuKWG9GUNeIvAFkJ/4Tpm14/rXk7z1bpj5PbQOP20HOIyToDu MHTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=X7FXEWQi; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b27si3481086edj.49.2021.09.22.10.09.29; Wed, 22 Sep 2021 10:09:59 -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=@redhat.com header.s=mimecast20190719 header.b=X7FXEWQi; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236770AbhIVRKq (ORCPT + 99 others); Wed, 22 Sep 2021 13:10:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:25851 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236705AbhIVRKp (ORCPT ); Wed, 22 Sep 2021 13:10:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632330555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SHrxHOUJFC7SXjO6oPt56HM9d80tm/abAg5EY0FI59M=; b=X7FXEWQiQ6PjhXFJNeNgvBLE0+qxWo0K5/6udE6E8HOgJ4wcAp7MjRa1l9SFhT1J7Did63 X38hISAQOXjFA/s2I9m3jTanI0YLJS0+n5Ir5xUVtyZguk6aEeXM/q+KivHVik380vl954 Q3p9/UdQqqw/NezEh9UHUPemH41g1Pg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-399-bqVte1b5PcW-zOzon214Pw-1; Wed, 22 Sep 2021 13:09:11 -0400 X-MC-Unique: bqVte1b5PcW-zOzon214Pw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 93E261023F4D; Wed, 22 Sep 2021 17:09:08 +0000 (UTC) Received: from thinkpad.redhat.com (unknown [10.39.192.105]) by smtp.corp.redhat.com (Postfix) with ESMTP id F001E970E0; Wed, 22 Sep 2021 17:09:04 +0000 (UTC) From: Laurent Vivier To: linux-kernel@vger.kernel.org Cc: Alexander Potapenko , 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, Laurent Vivier Subject: [PATCH 0/4] hwrng: virtio - add an internal buffer Date: Wed, 22 Sep 2021 19:08:59 +0200 Message-Id: <20210922170903.577801-1-lvivier@redhat.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org hwrng core uses two buffers that can be mixed in the virtio-rng queue.=0D =0D This series fixes the problem by adding an internal buffer in virtio-rng.=0D =0D Once the internal buffer is added, we can fix two other problems:=0D =0D - to be able to release the driver without waiting the device releases the= =0D buffer=0D =0D - actually returns some data when wait=3D0 as we can have some already=0D available data=0D =0D It also tries to improve the performance by always having a buffer in=0D the queue of the device.=0D =0D Laurent Vivier (4):=0D hwrng: virtio - add an internal buffer=0D hwrng: virtio - don't wait on cleanup=0D hwrng: virtio - don't waste entropy=0D hwrng: virtio - always add a pending request=0D =0D drivers/char/hw_random/virtio-rng.c | 84 +++++++++++++++++++++--------=0D 1 file changed, 63 insertions(+), 21 deletions(-)=0D =0D -- =0D 2.31.1=0D =0D