Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751480AbdGRJQN (ORCPT ); Tue, 18 Jul 2017 05:16:13 -0400 Received: from mail-oi0-f53.google.com ([209.85.218.53]:33838 "EHLO mail-oi0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751334AbdGRJQL (ORCPT ); Tue, 18 Jul 2017 05:16:11 -0400 MIME-Version: 1.0 In-Reply-To: <5156735.IWW3yRWKpB@tauon.chronox.de> References: <3910055.ntkqcq1Chb@positron.chronox.de> <20170718084959.GA25267@kroah.com> <5156735.IWW3yRWKpB@tauon.chronox.de> From: Arnd Bergmann Date: Tue, 18 Jul 2017 11:16:10 +0200 X-Google-Sender-Auth: uSYtmYg0__vytzz7ErTyfte5VCo Message-ID: Subject: Re: [RFC PATCH v12 1/4] crypto: make Jitter RNG directly accessible To: =?UTF-8?Q?Stephan_M=C3=BCller?= Cc: Greg Kroah-Hartman , "Jason A. Donenfeld" , linux-crypto@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v6I9GJAH019618 Content-Length: 848 Lines: 21 On Tue, Jul 18, 2017 at 11:10 AM, Stephan Müller wrote: > Am Dienstag, 18. Juli 2017, 11:02:02 CEST schrieb Arnd Bergmann: > > Hi Arnd, >> >> I can see why the jitterentropy implementation avoids using kernel headers, >> the problem now is that part of it gets moved into a new header, and that >> already violates the original principle. >> >> From my reading of the code, we could probably leave the structure >> definition in the crypto/jitterentropy.c, and have the statically >> allocated instance in the same file when CONFIG_LRNG is >> set, > > That is a very good idea -- I will implement this approach. I guess ideally you just move the inner half of lrng_get_jent(), i.e. everything inside of the spinlock, plus the buffer, into that file. That should keep the low-level side separate from the caller. Arnd