Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3332201iob; Mon, 16 May 2022 19:42:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIB2Ce38wVDTW09csVUINCX+uVd/g8fpVEzGqWIbDAAsr7zWdBa7FdyqMeIxAezqwKbIoq X-Received: by 2002:a63:5f07:0:b0:3db:8691:f66e with SMTP id t7-20020a635f07000000b003db8691f66emr17467333pgb.567.1652755378353; Mon, 16 May 2022 19:42:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652755378; cv=none; d=google.com; s=arc-20160816; b=lbO+7dZ44T265DqNF794k6uIZRcFh9w8c/sVi+hA1ITmBqwmFABfuVmdUFhB2IngjF bnRkJ+I4pipgScmGHW5MZFtApLKg3iRqk2ajmLLP+Uu/nJxNVOA394MfkMFTPHm2v26Z lF7tHA21xUcpoXE/ormvRyUFMbreg8Woo0Rfa2bt/4LibI0PoJ3pdOBmGRWOexGlmETF nv/rZh75y3JgPPdQ5EBI5zWXvRUUoKrc3tyRkt0yw6u9yrzg5kgex2FM8QAuK0mXPNOs 8g5kIe1tjlwuPl9ReYZGakmSiIcXYrDaoIcqEmJlW524PEGvQlRakvW7tc8NNzRFeYB9 ncyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=VyC8QyX7sgHGkbS2NC9o44wpKoZY8u3jPyic5oGJCMQ=; b=N8pbAhBgSfxIQD1Ibdg67qXKUjz0s5/8ICD0sQqgc50aDYHBzFnY6ClVY/NKpLbHYQ Y7/M7ru0qZiPTNNmU5h2WP4HowLWi2FlYCy9jHhOPabJW/LVV+cadtkN105jcYXFzS5o JG+ulWUtW0GkKbc9ExoLlWq0o1KAWv5bRPQI/mlgdJFCeo46kXnYMca6ylaxbw09zCan bHpDLR2jKs6qTsLPIVwKlX0MKdCI2XdOnZOvDWnGBs7cLWfL4YRdBl236qhDN8hrZ+KS jPbvu+lujDcDtB8Gucdf8wNX0DDZ9B1eK4pEvMkqLNphrJOGht+MntgHtaAhjdf6+dh3 rbbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=JyBETNYb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p52-20020a056a0026f400b0050dde3c0d4csi13014366pfw.284.2022.05.16.19.42.47; Mon, 16 May 2022 19:42:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=JyBETNYb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241360AbiEPUsX (ORCPT + 99 others); Mon, 16 May 2022 16:48:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349840AbiEPUr0 (ORCPT ); Mon, 16 May 2022 16:47:26 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6849052E64; Mon, 16 May 2022 13:24:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1652732635; bh=VyC8QyX7sgHGkbS2NC9o44wpKoZY8u3jPyic5oGJCMQ=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=JyBETNYbIOmIJ5k91O/YftGATrJceuQGpYWiOf1JVU5j8qd1Ux21s5W1ZQJpuy8m4 +R71LdUkh1lPkfT0JaKvsjkXhuuLhKXXOmjkjzcGFMnjwy6SQgrnBOUr+tFPQtgJp4 NSxQODiDkouq+oLlixY0/0pljgt8tXEwDolUY/ZU= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.0.33] ([46.223.3.15]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MEm6F-1o5mDZ3Jrn-00GJ3d; Mon, 16 May 2022 22:23:54 +0200 Subject: Re: [PATCH v4 2/6] tpm, tpm_tis: Claim and release locality only once To: Jarkko Sakkinen Cc: peterhuewe@gmx.de, jgg@ziepe.ca, stefanb@linux.vnet.ibm.com, linux@mniewoehner.de, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, lukas@wunner.de, p.rosenberger@kunbus.com, Lino Sanfilippo References: <20220509080559.4381-1-LinoSanfilippo@gmx.de> <20220509080559.4381-3-LinoSanfilippo@gmx.de> From: Lino Sanfilippo Message-ID: Date: Mon, 16 May 2022 22:23:54 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:JdiFnnuOr3j3Ay6gbINZHdqdAYvdcIMcjwV6Y8CZubJGyCOvXcG LxHhyCxIr5DETHRXDa8lrpYY6lY3U9DFsy3cXik+2AZIexUNoTygxdsGsQ1T4JdeNmKYTFN tYAbG0cP/4zIUMmiar0Ot5sJEf1q703fZ20lLMRT3M3TiUyeEYj19V8xbcVWy5+aTQTKg9F opuJnXKjx5wfeu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iv7qxmYy6TfMVwkn2DxjO/yXymP+ Q9HXJ/dbCQF9rkYDgfSC2/yYEb8To+WviTOE31OTuOMIeEN6uNwdUkjLvFpgU6YaEF/lEace6 xVXJZJflRl27QJiWxcNxuFe9f6WSLUJLd907Ofx1mH7nI3sdaegk3D/Pg== X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13.05.22 at 19:59, Jarkko Sakkinen wrote: > On Wed, May 11, 2022 at 09:29:57PM +0200, Lino Sanfilippo wrote: >> >> >> On 11.05.22 at 13:27, Jarkko Sakkinen wrote: >>> On Mon, May 09, 2022 at 10:05:55AM +0200, Lino Sanfilippo wrote: >>>> From: Lino Sanfilippo >>>> >>>> It is not necessary to claim and release the default locality for eac= h TPM >>>> command. Instead claim the locality once at driver startup and releas= e it >>>> at driver shutdown. >>>> >>>> Signed-off-by: Lino Sanfilippo >>> >>> We are doing what we're being because of Intel TXT: >>> >>> https://lore.kernel.org/tpmdd-devel/20170315055738.11088-1-jarkko.sakk= inen@iki.fi/ >>> >>> Unfortunately cannot accept this change. >>> >> >> I do not see how the patch affects the crb code since the only changes = concern the >> tpm_class_ops of the tis core. AFAICS crb uses its own set of tpm_class= _ops >> which are still used to claim and release the locality. >> >> Or do I miss something? > > Ugh, yes breaking everything when TXT is used with tpm_tis. > >> Regards, >> Lino > > BR, Jarkko > Ok, I got it now. The idea of this patch was to maintain the locality 0 fo= r the whole driver lifetime, so that we can always be sure that the locality is alread= y claimed when the interrupt status register is read or written in the interrupt han= dler. But of course this does not work if some other instance like TXT also want= s to claim localities. I will try another approach to make sure that the locality is already take= n when the irq handler is called and only released after the handler has finished. Regards, Lino