From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2ED1AC33CB1 for ; Thu, 16 Jan 2020 06:49:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DC0E0208C3 for ; Thu, 16 Jan 2020 06:49:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="KFR5dNqE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726889AbgAPGtO (ORCPT ); Thu, 16 Jan 2020 01:49:14 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:60756 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726160AbgAPGtN (ORCPT ); Thu, 16 Jan 2020 01:49:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ZH6TbtHlgpYJkkCSitMQjjtRHf50m8KSlIQRVZB5JTw=; b=KFR5dNqEqdHKKOIfc7qGWbzvS BIwY/hScLhqE91/DyGlC3IUljLSM7Ekgo2ZUJjLr1reelMqYgOjYX2Y+rtKrLr/a334tZ2ykaeE+2 imzQ7yKhJCOdDWXABh3yxc0/IglmXR69ah7fr1Yg37daAFgGzLNfqeuP9uSq2Lj4Nq0zWaW9DjWsA VdJL8jQi1U1a09bc6ZIQvgjOcRc8nCoh8PtlM+2QzS3fvt0iPEKkw+vEZvPdM5YIhj1DavXBPB2IL s99VN1HpxhSCUq5/qFu5J9GG6r0cl1mmTv60LucRlSWtzEMqfd3chYKQKYegJXx544BULvIp7QvDQ QFGxkPqcA==; Received: from [2601:1c0:6280:3f0::ed68] by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1iryx6-00068M-9U; Thu, 16 Jan 2020 06:48:24 +0000 Subject: Re: [PATCH v28 11/12] LRNG - add interface for gathering of raw entropy To: Stephan Mueller Cc: Arnd Bergmann , Greg Kroah-Hartman , linux-crypto@vger.kernel.org, LKML , linux-api@vger.kernel.org, "Eric W. Biederman" , "Alexander E. Patrakov" , "Ahmed S. Darwish" , "Theodore Y. Ts'o" , Willy Tarreau , Matthew Garrett , Vito Caputo , Andreas Dilger , Jan Kara , Ray Strode , William Jon McCann , zhangjs , Andy Lutomirski , Florian Weimer , Lennart Poettering , Nicolai Stange , "Peter, Matthias" , Marcelo Henrique Cerri , Roman Drahtmueller , Neil Horman , Julia Lawall , Dan Carpenter References: <6157374.ptSnyUpaCn@positron.chronox.de> <2048458.ADJAtTWDj8@positron.chronox.de> <9116265.6Va6cPe1zF@tauon.chronox.de> From: Randy Dunlap Message-ID: <72a57d93-737a-c6c1-82c4-e14f73054ad5@infradead.org> Date: Wed, 15 Jan 2020 22:48:20 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 MIME-Version: 1.0 In-Reply-To: <9116265.6Va6cPe1zF@tauon.chronox.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/15/20 10:43 PM, Stephan Mueller wrote: > Am Donnerstag, 16. Januar 2020, 01:18:18 CET schrieb Randy Dunlap: > > Hi Randy, > >> On 1/15/20 2:35 AM, Stephan Müller wrote: >>> CC: "Eric W. Biederman" >>> CC: "Alexander E. Patrakov" >>> CC: "Ahmed S. Darwish" >>> CC: "Theodore Y. Ts'o" >>> CC: Willy Tarreau >>> CC: Matthew Garrett >>> CC: Vito Caputo >>> CC: Andreas Dilger >>> CC: Jan Kara >>> CC: Ray Strode >>> CC: William Jon McCann >>> CC: zhangjs >>> CC: Andy Lutomirski >>> CC: Florian Weimer >>> CC: Lennart Poettering >>> CC: Nicolai Stange >>> Reviewed-by: Roman Drahtmueller >>> Tested-by: Roman Drahtmüller >>> Tested-by: Marcelo Henrique Cerri >>> Tested-by: Neil Horman >>> Signed-off-by: Stephan Mueller >>> --- >>> >>> drivers/char/lrng/Kconfig | 16 ++ >>> drivers/char/lrng/Makefile | 1 + >>> drivers/char/lrng/lrng_testing.c | 271 +++++++++++++++++++++++++++++++ >>> 3 files changed, 288 insertions(+) >>> create mode 100644 drivers/char/lrng/lrng_testing.c >>> >>> diff --git a/drivers/char/lrng/lrng_testing.c >>> b/drivers/char/lrng/lrng_testing.c new file mode 100644 >>> index 000000000000..0e287eccd622 >>> --- /dev/null >>> +++ b/drivers/char/lrng/lrng_testing.c >>> @@ -0,0 +1,271 @@ >>> +// SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause >>> +/* >>> + * Linux Random Number Generator (LRNG) Raw entropy collection tool >>> + * >>> + * Copyright (C) 2019 - 2020, Stephan Mueller >>> + */ >>> + >>> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt >>> + >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> + >>> +#include "lrng_internal.h" >>> + >>> +#define LRNG_TESTING_RINGBUFFER_SIZE 1024 >>> +#define LRNG_TESTING_RINGBUFFER_MASK (LRNG_TESTING_RINGBUFFER_SIZE - 1) >>> + >>> +static u32 lrng_testing_rb[LRNG_TESTING_RINGBUFFER_SIZE]; >>> +static u32 lrng_rb_reader = 0; >>> +static u32 lrng_rb_writer = 0; >>> +static atomic_t lrng_testing_enabled = ATOMIC_INIT(0); >>> + >>> +static DECLARE_WAIT_QUEUE_HEAD(lrng_raw_read_wait); >>> +static DEFINE_SPINLOCK(lrng_raw_lock); >>> + >>> +/* >>> + * 0 ==> No boot test, gathering of runtime data allowed >>> + * 1 ==> Boot test enabled and ready for collecting data, gathering >>> runtime + * data is disabled >>> + * 2 ==> Boot test completed and disabled, gathering of runtime data is >>> + * disabled >>> + */ >>> +static u32 boot_test = 0; >>> +module_param(boot_test, uint, 0644); >>> +MODULE_PARM_DESC(boot_test, "Enable gathering boot time entropy of the >>> first" + " entropy events"); >> >> One line for the string, please. > > may I ask the question whether this should be done for all lines with printk > statements? As checkpatch.pl will complain if you have lines larger than 80 > chars and complains about line-broken printk statements, I am always unsure > which way to go. > > All printk statements in the patch series have line-broken printk statements. It's for grep-ability of the strings. grepping for partial strings would work as is, but then one would need to know what partial string to search for. -- ~Randy