Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp587103lqp; Thu, 21 Mar 2024 09:32:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXZaFxqD3iFlVbGc602lfb0iD9HRmIcu4qWh4aC0KHj9ikWE7VYVZ2lPBKQJcZjmDE8HK9ddsAB8rT/ndiYIls88o7xHpgPDtLnurbbOQ== X-Google-Smtp-Source: AGHT+IE4ZcpC3/jlJW1HpEXohl+BQgGbV7CLgmiBtyQf5iMSW3hBG1AUlPnnhrYTOdTqfL4NoTbW X-Received: by 2002:a05:6402:5305:b0:56b:a8ea:964a with SMTP id eo5-20020a056402530500b0056ba8ea964amr4168851edb.9.1711038734512; Thu, 21 Mar 2024 09:32:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711038734; cv=pass; d=google.com; s=arc-20160816; b=mI5xhhBbWeOiVlyIxxJFIacE8H/e55wkwczsxRD3YyYS01xyA8/7NTJR8mVE4xIK2x i1aRyBJN9KOq7GDIGJUBj7rzKdFKnSYYXRbOWDyv+Oobg8tLhr08DXbeIyjDh6Z1RuOl HN15W/t3UyNJl3nDByDpkgPnnoylbYDcQ3wCWwdxWJzXMd6uEZYEJ2xNFrEvKFNXjgq0 L73qk88CaKF6TcWZ9HavimCGqlyypq/4v2eBx69gUOTyb9SV+yw0Pe5PLEiiB1F0ZBeG 2ICYWJezdvgyV+oVu8H8x06oMwHxqUCaq+x/X+IgELNmArBbMQH+Pn568SeFff55OWg+ +cOw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:from:subject:cc:to:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=H/7RBkzYD7h0DjPiLQfKtS5Z1L4j2cIW7fFUAXi0giE=; fh=PnRLxXgmALRNnNZZA/LWNLcm8E6zt8Mcx2+gbZFTJXc=; b=a5Q+tS8dpjWRgsrgOuCI+cCkVj5LkJKAP4we66vJ49UNgWRTLsMyku4MSJ/7BEuYgf BhEeIASdoq3UL2WkVaEhyP8hRHQqJAIyFSUebkyY5mTItbZv0Dlt2ce7fTk3u0fizfqu X2kbVib7++L+zoeWzaoDB9ogCNtdypwWtNPypDDgkdvLItoyCRHwuOy1KA+LLxvo/pjZ 8Zlgv5DxBESyk4ryAnwRpGpXozWDMM/h4ATds+oqVUbakOSGPKil1LRWqSVYt5FVok1R mITe/L6LACdzsXd5JMtdi/6jX3WRm7Wr/EhfjYu3tiQG156OqjxyxiHBMQeh26RpcKjC JJMw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="itLbL/oc"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-110335-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110335-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id e26-20020a50d4da000000b0056b965f7766si49436edj.161.2024.03.21.09.32.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 09:32:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-110335-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="itLbL/oc"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-110335-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110335-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 9971A1F2591F for ; Thu, 21 Mar 2024 16:25:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 38E0F12CDB0; Thu, 21 Mar 2024 16:25:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="itLbL/oc" 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 42C0E12CD9B; Thu, 21 Mar 2024 16:25:02 +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=1711038303; cv=none; b=sPm+KHmszoEWvc5X1CyH77CExdIvPeCnA98ub2ETEAF2MajF/N5UO9HE7QIG9dQHHL1uOp/dlwdUdsrbLFlv67T/8jhIIN2iTUwYCZjqKCOYGxSXQ7ESOW0Jq32yQ/WxB3qr6a72iYDuc+OU/J4xzfOGg4HcN2lkVk+t1JpE7f8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711038303; c=relaxed/simple; bh=Ld70etnbStLyDEyVmPvZO269q61/zWvdOuEcLXgGsW8=; h=Mime-Version:Content-Type:Date:Message-Id:To:Cc:Subject:From: References:In-Reply-To; b=itFkpbLLyG1kokG0Rz54dXjvL3nEA7FfikWZGV2zXlcgMBS7ZMvyLPQDSSH8ISVdZLQ+zj6kyEb6s05XLp5lVjw9+v8UeKeO/JbjRrv7aku/qz/LNwJjUyuNj6pJPZpgNTd8FVnZpq37zeQcB+qeXMS0dZH77gx81Y19GM99w3Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=itLbL/oc; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28F8EC433F1; Thu, 21 Mar 2024 16:24:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711038302; bh=Ld70etnbStLyDEyVmPvZO269q61/zWvdOuEcLXgGsW8=; h=Date:To:Cc:Subject:From:References:In-Reply-To:From; b=itLbL/ocioQSW2qzSRv9JP/IKWnYOiPZfdyiqJm+1JNxt+OOVdI11NUEo636NtlS2 lJjWnOFC5QCgiKfeU6LV8CoT884600fk7mK/z3gzpfW4Shyhuii7T1x85/ZanqyFNS 1t9XbfDDbYlLLaEzCszoUgx8DDj7hlWzZXOeIHQTeJz9v2CqV87gyXnNrfVy22BudT pkoF7fISqQsD9bCdScCT2aFbxCG6cXQpoyp/t1HWE4wzpWZVBApa0tX4+AXe1b8fo1 B0CDHiwlTT3JIJ/oWGgFR4O6Z0/yWlBrpeL3xTKLLtBqw2bxo1Umi8Y61cJFBJ/6Xr dPTWa+pbgUXww== 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: Thu, 21 Mar 2024 18:24:58 +0200 Message-Id: To: "Stefan Berger" , Cc: "Jonathan Corbet" , "Daniel P . Smith" , "Lino Sanfilippo" , "Jason Gunthorpe" , "Peter Huewe" , "James Bottomley" , "Alexander Steffen" , , , , "Randy Dunlap" Subject: Re: [PATCH v2] Documentation: tpm_tis From: "Jarkko Sakkinen" X-Mailer: aerc 0.17.0 References: <20240320085601.40450-1-jarkko@kernel.org> In-Reply-To: On Thu Mar 21, 2024 at 6:09 PM EET, Stefan Berger wrote: > > > On 3/21/24 11:51, Jarkko Sakkinen wrote: > > On Wed Mar 20, 2024 at 6:15 PM EET, Stefan Berger wrote: > >> > >> > >> On 3/20/24 04:56, Jarkko Sakkinen wrote: > >>> Based recent discussions on LKML, provide preliminary bits of tpm_tis= _core > >>> dependent drivers. Includes only bare essentials but can be extended = later > >>> 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 > >>> Cc: Randy Dunlap > >>> Signed-off-by: Jarkko Sakkinen > >>> --- > >>> v2: > >>> - Fixed errors reported by Randy: > >>> https://lore.kernel.org/all/aed28265-d677-491a-a045-24b351854b24@= infradead.org/ > >>> - Improved the text a bit to have a better presentation. > >>> --- > >>> 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/sec= urity/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/s= ecurity/tpm/tpm_tis.rst > >>> new file mode 100644 > >>> index 000000000000..b331813b3c45 > >>> --- /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 > >> > >> FIFO is the type. I am surprised you call it a 'name'. I would say TIS > >> is the 'name'. > >=20 > > It's what the official specification calls it [1]. > >=20 > >=20 > >> > >>> +tpm_tis_core dependent drivers. The prefix "tis" comes from the TPM = Interface > >> > >> tis is a tla -- a three letter *acronym*. You aren't using it as a 'pr= efix'. > >=20 > > I don't know what "tla" means. > >=20 > >> > >>> +Specification, which is the hardware interface specification for TPM= 1.x chips. > >> > >> It's also available for TPM2. > > =20 > > Yes, but TIS is the name used by the legacy specification. > > > The point is that TIS is not just a TPM 1.x interface but also used for= =20 > TPM 2. FIFO interface is what is used in the spec so I'll stick to that. > >=20 > >> > >>> + > >>> +Communication is based on a 5 KiB buffer shared by the TPM chip thro= ugh a > >> > >> I thought it was typically 4 KiB. > >=20 > > You are basing this on table 9 in [1]? > > Yes. See below. > > >=20 > >> > >>> +hardware bus or memory map, depending on the physical wiring. The bu= ffer is > >>> +further split into five equal-size buffers, which provide equivalent= sets of > > If you are referring to the MMIO region between 0xfed4 0000 and 0xfed4=20 > 4fff as a buffer then you are talking about a **20kb** MMIO region=20 > (0x5000) that is **split** into equal-sized MMIO regions, each having=20 > 4kb (0x1000). Yes, that's the 4kb then but there that one is no 5kb=20 > 'further split into five equal-sized buffers' of presumably 1kb each.=20 > Each locality has a 0x1000 sized MMIO region. Oops, true! I'll fix this part thanks, had a blind spot :-) Will fix for v3. BR, Jarkko