From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751970AbdJXSEy (ORCPT ); Tue, 24 Oct 2017 14:04:54 -0400 Received: from mail-io0-f195.google.com ([209.85.223.195]:46083 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751550AbdJXSEt (ORCPT ); Tue, 24 Oct 2017 14:04:49 -0400 X-Google-Smtp-Source: ABhQp+R+l9R+oCaGwVw5xVihCym9VmOiK6gPTRy07Ho85awYxKEnLA2bW5aJzghsn/dA0VjeCJld1g== Date: Tue, 24 Oct 2017 11:04:44 -0700 From: Dmitry Torokhov To: Jason Gunthorpe Cc: PrasannaKumar Muralidharan , Jarkko Sakkinen , Stefan Berger , linux-integrity@vger.kernel.org, David Howells , Herbert Xu , "open list:INTEGRITY MEASUREMENT ARCHITECTURE IMA" , Dmitry Kasatkin , open list , linux-security-module@vger.kernel.org, "moderated list:TPM DEVICE DRIVER" , "open list:KEYS-TRUSTED" , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , James Morris , Matt Mackall , "open list:INTEGRITY MEASUREMENT ARCHITECTURE IMA" , David Safford , Mimi Zohar , "Serge E. Hallyn" Subject: Re: [tpmdd-devel] [PATCH] tpm: remove chip_num parameter from in-kernel API Message-ID: <20171024180444.aewqwgglfmb46h22@dtor-ws> References: <20171023123817.18559-1-jarkko.sakkinen@linux.intel.com> <20171023163139.GA17394@obsidianresearch.com> <20171024154440.3jeupmus43jcgbbz@linux.intel.com> <20171024155526.GA32250@obsidianresearch.com> <20171024161118.GA348@obsidianresearch.com> <20171024173757.GA1806@obsidianresearch.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171024173757.GA1806@obsidianresearch.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 24, 2017 at 11:37:57AM -0600, Jason Gunthorpe wrote: > On Tue, Oct 24, 2017 at 10:02:00AM -0700, Dmitry Torokhov wrote: > > tpm-rng is abomination that should be kicked out as soon as possible. > > It wrecks havoc with the power management (TPM chip drivers may go > > into suspend state, but tpm_rng does not do any power management and > > happily forwards requests to suspended hardware) and may be available > > when there is no TPM at all yet (the drivers have not been probed yet, > > or have gotten a deferral, etc). > > Makes sense > > > TPM core should register HWRNGs when chips are ready. > > The main thing I've wanted from the TPM RNG is > 'add_early_randomness'.. I see... However you can't add any randomness if hardware is not quite there yet. > > We can certainly provide a TPM interface to hwrng, it seems > reasonable. > > Excep that we already have a user api in /dev/tpm to access the > tpm RNG, is the duplication a problem? If we already have userspace API we have to maintain this, even if it is duplicate, there is no way around it. I'd expect most of the users will use unified random API, while some TPM-oriented users may still go via /dev/tpm to use the same API as all other their requests. Thanks. -- Dmitry