Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp38688lqs; Mon, 4 Mar 2024 14:15:02 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU3iRNO0b8ef7+hhRtLLc4FyvQCZ5BqGYECKeI1P5S8hlEPeF30HS02fE+YxUQA0nnDz2bSIsRfiKKxqGXCnFd63wx+NNvh2YxQCUjlYg== X-Google-Smtp-Source: AGHT+IEPyq8aT4zkuSHwvJ2IxOtkzYVoOFrs7SxOQCoNtZXQqR1Raq9yYHeyjSVsInbUC8y5z71+ X-Received: by 2002:a05:6a20:918a:b0:1a1:4fce:8ee9 with SMTP id v10-20020a056a20918a00b001a14fce8ee9mr36396pzd.9.1709590502229; Mon, 04 Mar 2024 14:15:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709590502; cv=pass; d=google.com; s=arc-20160816; b=qh/fj/jUJjEaQGe6xPE7xPUaoHW5dZyT2J4KL6nrlJIpZdzbVvq87ShMb8r6vToB6z w4r4/6jktDKqIao/2iSJrtbwdYCmpCFvhHuiOzCpsG8PWQvcWOrM5Qs8mFCklfNj+PRF vv9Q9ylp9cC5fLsZhZ7i1kqS+m0IfSVozafpfx94xNCYSXPvMd0agPBiCoAc4yFJgaAM lmb52pUHRwLj7lG4S863uzlvHbnB/m4vGZkxwWq0o+gWzWzDP7RK2AM5xNMGBUWJAc57 QtYl/cV4DV+XZBQDTjXzec+BTzMUinsQ/3mhrrZj5C3B9kU6OOh/CQ9sIrSHRlcy2cTM WFwg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=iKYIlAtHOAPFQBfatGPrIct4rjMH1QtUt0yHpxhJMOM=; fh=cCO9BDGNK8zSUYj3T0ra8zmzUZDxY/hkAdz9TugJx3w=; b=GDaoYaN4apCjTgHsjEv3rdbUZzyT6rlS/0mKlpz6ZORG4rBm3VhbL1445uCpik2IL/ eT6iPPo18gqbDyZo4GDCk4poOnFciP2u8JNPR5radYUYYljEUXADoXp/o8w4KAxrN82y d/P1NuzYe4e8/bl9ll5R+lGTgUoP5/dE2uEX2dSd40EmWbe+84JFoIzjzzXvCKb+UbrA FHhMI2UR+b4a88lzSTW1sDt178iWJkLTBognwxQyqCbolvZQCGMuRyI8KeT5fU+qk1L2 6x+0DGrysEDvVPGEJK4vc1yhFbo6RX6KdJ/ZM9EB0rqYRdJf4CjCvyTx7AVj3zrpi4ir yJew==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jLaWZax0; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-91332-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91332-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id v11-20020a63480b000000b005d8bb0cd282si8953416pga.126.2024.03.04.14.15.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 14:15:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-91332-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jLaWZax0; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-91332-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91332-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id EC36CB2356B for ; Mon, 4 Mar 2024 21:58:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5CA507B3C3; Mon, 4 Mar 2024 21:57:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jLaWZax0" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7BF2E46BA0; Mon, 4 Mar 2024 21:57:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709589475; cv=none; b=bM2+k4eOFnJ2OaIViXXjJwW2cvO0rHaKomH1sDyobUFk5PWY9bZvvqJB5+iNXwlWxVpURV/qs7B+paDbblFyXPri3BGNbNlhTLelfSyUtoIQLwSpo0taZ4XhxQZKTAaffzUPEg+QeVS3uNpmA2KV85X44yAykujTL6m/hMXl2JI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709589475; c=relaxed/simple; bh=KiOKGu0IBKEf+hGEnUTRKLVdRvMzwj+gIS9cVh5qs2s=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=rV77SlctP0GJuQtGjuUWPAAmKMKziAm2gzBOLTRN0RZJ7YMjZOeTm3haZqVeHxoNi3HqDa0Fn4PmJz5M9kEYUcaW5Bp4xkwqxZVl367dvlkCtx3Er3JCY7YfgGEuL/j2OpJGugsaU+DHk5okToI+w+nM4f5Gd5iz1L/A19P4qS0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jLaWZax0; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1513C433C7; Mon, 4 Mar 2024 21:57:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709589475; bh=KiOKGu0IBKEf+hGEnUTRKLVdRvMzwj+gIS9cVh5qs2s=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=jLaWZax0tddgv9Oni6Ktxklh+0fqbjyk2BAcfSTyqSxKtfO6WlhzmsTQ4to+ccTB2 ZAMHUTorWlLHe7plKIiyoECCZhAp1PZA6wKdf/j7fxx0rf3hDGWujZwk5igp+XxI5o DTOtZNmiq6EW57op2GHUcAvc3uGbi6T9LMOn4DlswDCbSboJsl9maWRnyTqSXnhKpy OaA/zqmm97Xm3rIDtDrDQqyWr001R8WJkVvSQsUuhRP0Wvi5TXUt6zZ96qi2uVHGVp YkfwuMJeISK3JmRU7XvA9apl30kPJVuECf836TJxAwQFfOKkbz3y3jSutX3nYsUIAd WhIjG0vexvxKA== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 04 Mar 2024 23:57:50 +0200 Message-Id: Cc: "Jonathan Corbet" , "Daniel P . Smith" , "Lino Sanfilippo" , "Jason Gunthorpe" , "Peter Huewe" , "James Bottomley" , "Alexander Steffen" , , , Subject: Re: [PATCH] Documentation: tpm_tis From: "Jarkko Sakkinen" To: "Jarkko Sakkinen" , X-Mailer: aerc 0.17.0 References: <20240304212734.43213-1-jarkko@kernel.org> In-Reply-To: <20240304212734.43213-1-jarkko@kernel.org> Some remarks below that I noticed after sending this. On Mon Mar 4, 2024 at 11:27 PM EET, Jarkko Sakkinen wrote: > Based recent discussions on LKML, provide preliminary bits of tpm_tis_cor= e s/Based/ Based on/ > dependent drivers. Includes only bare essentials but can be extended late= r > on case by case. This way some people may even want to read it later on. > > Cc: Jonathan Corbet > CC: Daniel P. Smith > Cc: Lino Sanfilippo > Cc: Jason Gunthorpe > Cc: Peter Huewe > Cc: James Bottomley > Cc: Alexander Steffen > Cc: keyrings@vger.kernel.org > Cc: linux-doc@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Cc: linux-integrity@vger.kernel.org > Signed-off-by: Jarkko Sakkinen > --- > Documentation/security/tpm/index.rst | 1 + > Documentation/security/tpm/tpm_tis.rst | 30 ++++++++++++++++++++++++++ > 2 files changed, 31 insertions(+) > create mode 100644 Documentation/security/tpm/tpm_tis.rst > > diff --git a/Documentation/security/tpm/index.rst b/Documentation/securit= y/tpm/index.rst > index fc40e9f23c85..f27a17f60a96 100644 > --- a/Documentation/security/tpm/index.rst > +++ b/Documentation/security/tpm/index.rst > @@ -5,6 +5,7 @@ Trusted Platform Module documentation > .. toctree:: > =20 > tpm_event_log > + tpm_tis > tpm_vtpm_proxy > xen-tpmfront > tpm_ftpm_tee > diff --git a/Documentation/security/tpm/tpm_tis.rst b/Documentation/secur= ity/tpm/tpm_tis.rst > new file mode 100644 > index 000000000000..3cec0216a169 > --- /dev/null > +++ b/Documentation/security/tpm/tpm_tis.rst > @@ -0,0 +1,30 @@ > +.. SPDX-License-Identifier: GPL-2.0 > + > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > +TPM FIFO interface Driver > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > + > +FIFO (First-In-First-Out) is the name of the hardware interface used by = the > +`tpm_tis_core` dependent drivers. The prefix "tis" is named after TPM > +Interface Specification, which is the hardware interface specification f= or > +TPM 1.x chips. > + > +Communication is based on a 5 KiB buffer shared by the TPM chip through = a > +hardware bus or memory map. The buffer is further split to five equal si= ze s/to/into/ > +buffers, which provide equivalent sets of registers for communication > +between CPU and TPM. The communication end points are called *localities= * > +in the TCG terminology. > + > +When a kernel wants to send a commands to the TPM chip, it first reserve= s s/a kernel/kernel/ s/a commands/commands/ > +locality 0 by setting `requestUse` bit in `TPM_ACCESS` register. The bit= is > +cleared by the chip when the access is granted. Once completed its > +communication, it sets `activeLocity` bit in the same register. s/it sets/kernel relinquishes reservation by setting/ > + > +Pending localities are served in order by the chip descending orderm and > +one at a time: "Pending localities are served in descending order and one at a time:" > + > +- Locality 0 has the lowest priority. > +- Locality 5 has the highest priotiy. > + > +Further information on purpose and meaning of the localities can be foun= d > +from section 3.2 of TCG PC Client Platform TPM Profile Specification. s/on purpose/on the purpose/ BR, Jarkko