From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753999AbdK1UTH (ORCPT ); Tue, 28 Nov 2017 15:19:07 -0500 Received: from mga07.intel.com ([134.134.136.100]:30952 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752495AbdK1UTF (ORCPT ); Tue, 28 Nov 2017 15:19:05 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,468,1505804400"; d="scan'208";a="7321048" Date: Tue, 28 Nov 2017 22:19:03 +0200 From: Jarkko Sakkinen To: Leendert van Doorn Cc: Mimi Zohar , Nayna Jain , "Alexander.Steffen@infineon.com" , "linux-integrity@vger.kernel.org" , "linux-security-module@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "peterhuewe@gmx.de" , "tpmdd@selhorst.net" , "patrickc@us.ibm.com" , "Safford, David (GE Global Research, US)" Subject: Re: [PATCH v4 2/4] tpm: ignore burstcount to improve tpm_tis send() performance Message-ID: <20171128201903.ndd4j3xw3ubfaa4y@linux.intel.com> References: <20171017203232.2262-1-nayna@linux.vnet.ibm.com> <20171017203232.2262-3-nayna@linux.vnet.ibm.com> <5ef60315f2254b3b8bcc217a572280e5@infineon.com> <3ff12c6536de4379aa61cb09ebc9d105@infineon.com> <20171123144742.GC8862@swastik> <20171126152218.c5fsr7uhs3ipwwha@linux.intel.com> <1511714261.4361.13.camel@linux.vnet.ibm.com> <694703AB-68E1-4026-937C-61DBBE08DB4B@paramecium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <694703AB-68E1-4026-937C-61DBBE08DB4B@paramecium.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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 Mon, Nov 27, 2017 at 07:08:51AM +0000, Leendert van Doorn wrote: > Hmm, this is almost 20 years old code ( > > I think the original code did a burst write and didn't check for error > conditions until the very last byte write. I seem to remember that > there was some text in the original standard to that effect (this may > have gone back as far as IBM's ESS spec). > > The current code does check for error conditions after each write > byte(s) so I don't think there is any reason for this anymore. > Changing the while condition to count < len and setting burstcnt = > min_t(int, burstcnt, len - count) and remove the > tpm_tis_write8/wait_for_tpm_stat/tpm_tis_status clauses after the > while loop should be sufficient. Thank you for sharing this! > Leendert /Jarkko From mboxrd@z Thu Jan 1 00:00:00 1970 From: jarkko.sakkinen@linux.intel.com (Jarkko Sakkinen) Date: Tue, 28 Nov 2017 22:19:03 +0200 Subject: [PATCH v4 2/4] tpm: ignore burstcount to improve tpm_tis send() performance In-Reply-To: <694703AB-68E1-4026-937C-61DBBE08DB4B@paramecium.org> References: <20171017203232.2262-1-nayna@linux.vnet.ibm.com> <20171017203232.2262-3-nayna@linux.vnet.ibm.com> <5ef60315f2254b3b8bcc217a572280e5@infineon.com> <3ff12c6536de4379aa61cb09ebc9d105@infineon.com> <20171123144742.GC8862@swastik> <20171126152218.c5fsr7uhs3ipwwha@linux.intel.com> <1511714261.4361.13.camel@linux.vnet.ibm.com> <694703AB-68E1-4026-937C-61DBBE08DB4B@paramecium.org> Message-ID: <20171128201903.ndd4j3xw3ubfaa4y@linux.intel.com> To: linux-security-module@vger.kernel.org List-Id: linux-security-module.vger.kernel.org On Mon, Nov 27, 2017 at 07:08:51AM +0000, Leendert van Doorn wrote: > Hmm, this is almost 20 years old code ( > > I think the original code did a burst write and didn't check for error > conditions until the very last byte write. I seem to remember that > there was some text in the original standard to that effect (this may > have gone back as far as IBM's ESS spec). > > The current code does check for error conditions after each write > byte(s) so I don't think there is any reason for this anymore. > Changing the while condition to count < len and setting burstcnt = > min_t(int, burstcnt, len - count) and remove the > tpm_tis_write8/wait_for_tpm_stat/tpm_tis_status clauses after the > while loop should be sufficient. Thank you for sharing this! > Leendert /Jarkko -- 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 Return-Path: Received: from mga07.intel.com ([134.134.136.100]:30952 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752495AbdK1UTF (ORCPT ); Tue, 28 Nov 2017 15:19:05 -0500 Date: Tue, 28 Nov 2017 22:19:03 +0200 From: Jarkko Sakkinen To: Leendert van Doorn Cc: Mimi Zohar , Nayna Jain , "Alexander.Steffen@infineon.com" , "linux-integrity@vger.kernel.org" , "linux-security-module@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "peterhuewe@gmx.de" , "tpmdd@selhorst.net" , "patrickc@us.ibm.com" , "Safford, David (GE Global Research, US)" Subject: Re: [PATCH v4 2/4] tpm: ignore burstcount to improve tpm_tis send() performance Message-ID: <20171128201903.ndd4j3xw3ubfaa4y@linux.intel.com> References: <20171017203232.2262-1-nayna@linux.vnet.ibm.com> <20171017203232.2262-3-nayna@linux.vnet.ibm.com> <5ef60315f2254b3b8bcc217a572280e5@infineon.com> <3ff12c6536de4379aa61cb09ebc9d105@infineon.com> <20171123144742.GC8862@swastik> <20171126152218.c5fsr7uhs3ipwwha@linux.intel.com> <1511714261.4361.13.camel@linux.vnet.ibm.com> <694703AB-68E1-4026-937C-61DBBE08DB4B@paramecium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <694703AB-68E1-4026-937C-61DBBE08DB4B@paramecium.org> Sender: linux-integrity-owner@vger.kernel.org List-ID: On Mon, Nov 27, 2017 at 07:08:51AM +0000, Leendert van Doorn wrote: > Hmm, this is almost 20 years old code ( > > I think the original code did a burst write and didn't check for error > conditions until the very last byte write. I seem to remember that > there was some text in the original standard to that effect (this may > have gone back as far as IBM's ESS spec). > > The current code does check for error conditions after each write > byte(s) so I don't think there is any reason for this anymore. > Changing the while condition to count < len and setting burstcnt = > min_t(int, burstcnt, len - count) and remove the > tpm_tis_write8/wait_for_tpm_stat/tpm_tis_status clauses after the > while loop should be sufficient. Thank you for sharing this! > Leendert /Jarkko