From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934827AbdBVU40 (ORCPT ); Wed, 22 Feb 2017 15:56:26 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:46865 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934812AbdBVU4R (ORCPT ); Wed, 22 Feb 2017 15:56:17 -0500 Subject: Re: [tpmdd-devel] [PATCH v2 4/7] tpm: infrastructure for TPM spaces References: <20170216192529.25467-1-jarkko.sakkinen@linux.intel.com> <20170216192529.25467-5-jarkko.sakkinen@linux.intel.com> <58AC85F2.5000406@linux.vnet.ibm.com> <1487785159.2376.27.camel@HansenPartnership.com> From: Ken Goldman To: tpmdd-devel@lists.sourceforge.net, linux-security-module@vger.kernel.org, open list Date: Wed, 22 Feb 2017 15:56:12 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <1487785159.2376.27.camel@HansenPartnership.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17022220-0056-0000-0000-000002D5EA33 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006664; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000204; SDB=6.00825653; UDB=6.00404293; IPR=6.00603108; BA=6.00005166; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00014399; XFM=3.00000011; UTC=2017-02-22 20:56:13 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17022220-0057-0000-0000-0000070AF644 Message-Id: <213d0ff2-e9c1-da0f-2eb5-c0ded070009d@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-02-22_13:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702220189 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/22/2017 12:39 PM, James Bottomley wrote: > > Right at the moment the kernel use of tpm2 looks like > > acquire chip->tpm_mutex > load key > process key > unload key > release chip->tpm_mutex The advantage to context save/ context load over load / flush is that load requires the parent(s). The parent chain may be long, a parent may require authorization, or authorization may be impossible because PCRs are no longer in the correct state. In TPM 1.2, there was a performance difference because load was an asymmetric key operation, but it's symmetric in TPM 2.0. > When the kernel needs to use resources that persisted beyond it > dropping the chip->tpm_mutex (say using policy or audit sessions), > then it would need to become a customer of the RM. BTW, use of an EK private key requires a policy session.