From mboxrd@z Thu Jan 1 00:00:00 1970 From: jgunthorpe@obsidianresearch.com (Jason Gunthorpe) Date: Tue, 20 Jun 2017 13:31:52 -0600 Subject: [PATCH] tpm: consolidate the TPM startup code In-Reply-To: <20170620181334.28363-1-jarkko.sakkinen@linux.intel.com> References: <20170620181334.28363-1-jarkko.sakkinen@linux.intel.com> Message-ID: <20170620193152.GA3368@obsidianresearch.com> To: linux-security-module@vger.kernel.org List-Id: linux-security-module.vger.kernel.org On Tue, Jun 20, 2017 at 08:13:34PM +0200, Jarkko Sakkinen wrote: > Consolidated all the "manual" TPM startup code to a single function > in order to make code flows a bit cleaner and migrate to tpm_buf. > > Signed-off-by: Jarkko Sakkinen > drivers/char/tpm/tpm-interface.c | 67 +++++++++++++++++++++++++--------------- > drivers/char/tpm/tpm.h | 6 +--- > drivers/char/tpm/tpm2-cmd.c | 32 +------------------ > 3 files changed, 44 insertions(+), 61 deletions(-) Makes sense to me > diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c > index d2b4df6d9894..fbef47d8bd06 100644 > +++ b/drivers/char/tpm/tpm-interface.c > @@ -540,6 +540,47 @@ ssize_t tpm_transmit_cmd(struct tpm_chip *chip, struct tpm_space *space, > } > EXPORT_SYMBOL_GPL(tpm_transmit_cmd); > > +#define TPM_ORD_STARTUP 153 > +#define TPM_ST_CLEAR 1 We should really have a tpm1.h and tpm2.h that has all these various constants and things instead of open coding them randomly all over.. Jason -- To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Gunthorpe Subject: Re: [PATCH] tpm: consolidate the TPM startup code Date: Tue, 20 Jun 2017 13:31:52 -0600 Message-ID: <20170620193152.GA3368@obsidianresearch.com> References: <20170620181334.28363-1-jarkko.sakkinen@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20170620181334.28363-1-jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tpmdd-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Jarkko Sakkinen Cc: linux-security-module-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, open list List-Id: tpmdd-devel@lists.sourceforge.net On Tue, Jun 20, 2017 at 08:13:34PM +0200, Jarkko Sakkinen wrote: > Consolidated all the "manual" TPM startup code to a single function > in order to make code flows a bit cleaner and migrate to tpm_buf. > > Signed-off-by: Jarkko Sakkinen > drivers/char/tpm/tpm-interface.c | 67 +++++++++++++++++++++++++--------------- > drivers/char/tpm/tpm.h | 6 +--- > drivers/char/tpm/tpm2-cmd.c | 32 +------------------ > 3 files changed, 44 insertions(+), 61 deletions(-) Makes sense to me > diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c > index d2b4df6d9894..fbef47d8bd06 100644 > +++ b/drivers/char/tpm/tpm-interface.c > @@ -540,6 +540,47 @@ ssize_t tpm_transmit_cmd(struct tpm_chip *chip, struct tpm_space *space, > } > EXPORT_SYMBOL_GPL(tpm_transmit_cmd); > > +#define TPM_ORD_STARTUP 153 > +#define TPM_ST_CLEAR 1 We should really have a tpm1.h and tpm2.h that has all these various constants and things instead of open coding them randomly all over.. Jason ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751866AbdFTTcG (ORCPT ); Tue, 20 Jun 2017 15:32:06 -0400 Received: from quartz.orcorp.ca ([184.70.90.242]:58687 "EHLO quartz.orcorp.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751093AbdFTTcE (ORCPT ); Tue, 20 Jun 2017 15:32:04 -0400 Date: Tue, 20 Jun 2017 13:31:52 -0600 From: Jason Gunthorpe To: Jarkko Sakkinen Cc: tpmdd-devel@lists.sourceforge.net, linux-security-module@vger.kernel.org, Peter Huewe , Marcel Selhorst , open list Subject: Re: [PATCH] tpm: consolidate the TPM startup code Message-ID: <20170620193152.GA3368@obsidianresearch.com> References: <20170620181334.28363-1-jarkko.sakkinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170620181334.28363-1-jarkko.sakkinen@linux.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Broken-Reverse-DNS: no host name found for IP address 10.0.0.156 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 20, 2017 at 08:13:34PM +0200, Jarkko Sakkinen wrote: > Consolidated all the "manual" TPM startup code to a single function > in order to make code flows a bit cleaner and migrate to tpm_buf. > > Signed-off-by: Jarkko Sakkinen > drivers/char/tpm/tpm-interface.c | 67 +++++++++++++++++++++++++--------------- > drivers/char/tpm/tpm.h | 6 +--- > drivers/char/tpm/tpm2-cmd.c | 32 +------------------ > 3 files changed, 44 insertions(+), 61 deletions(-) Makes sense to me > diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c > index d2b4df6d9894..fbef47d8bd06 100644 > +++ b/drivers/char/tpm/tpm-interface.c > @@ -540,6 +540,47 @@ ssize_t tpm_transmit_cmd(struct tpm_chip *chip, struct tpm_space *space, > } > EXPORT_SYMBOL_GPL(tpm_transmit_cmd); > > +#define TPM_ORD_STARTUP 153 > +#define TPM_ST_CLEAR 1 We should really have a tpm1.h and tpm2.h that has all these various constants and things instead of open coding them randomly all over.. Jason