Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp1271673rdb; Fri, 19 Jan 2024 13:46:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IEjWYkNiqnwUyUW5PuhvvgYwxzLhe4VG+cyoJfnGDiZ/z2/BooxeQjwDzQqJV6zBp5Amm68 X-Received: by 2002:a17:902:74cc:b0:1d6:ff4a:3acc with SMTP id f12-20020a17090274cc00b001d6ff4a3accmr555161plt.13.1705700805719; Fri, 19 Jan 2024 13:46:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705700805; cv=pass; d=google.com; s=arc-20160816; b=bizBgy0zCBFXHR1BY0kH0HW78mLp6p3FHHs/AAbzKK8byT34MGg56/LKWe84PN0jp0 NottX++dfWq7kH6ZyrqibC7sdYF6M7gC1nuTiKmdmdlgVbcZ6HvQkyhJNL1eNvegWS64 HVJqbmmeKwjazreVMQ2ZEiSUYt2xn7L81+6xF7B1GNRE0xyeqaAsGpEULKTU0N0LqtRU /AgBM4nKCVekEOMBzCiKoYZxS8hEXhVLIDezx2PprTnLGM+Gzi1WEge3YHRPSuq2eMYx xmUNMXAZYmWPdAGyBbreGI2/Z6EUsN5asAo3EMddXD7G6PNn//vURUnjUvYl/OlBIK9p VjKA== 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=s8jIqE+vW+iYqMRnNiKZlbFoWO7EWkMJg5CQzYRn9bk=; fh=yLLckcRTOWdWw3H4qjlxesUeH9Bl4INMD/Q0SVhI04s=; b=XJiH0rIyYoS3Dkmwy180tI4GBO3na4OIw2/7GfTW/G8X9p3PIbYN4iofQAHlE0kId6 +qb5krDLK2XXleFMTo/Khr0QLScbOKoXDu0RytvZU+QBaM7zka/TBii+UPaLuvoEfqof D3eODr58yzL31YWrnuhWhLC7TV4Rha95CzNhYzuvq4OwLTgCHxViW3iNGsarwRCanA5N +LtyFchV9FIYK/EzSoINOnTlpL2w2Ir82ztv26WoFUKgf0TDCQmaKbCGXUZH0oM0kGTE +EbjwmDeGhITUo2gxGVoEe72jOVVO1x+FQ7pGo+vSmLDB4bJ58/GRDEviTFmVlzviJQc +Pxg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VgzZunqF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-31583-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31583-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id t17-20020a170902e85100b001d71b7c1693si2221292plg.624.2024.01.19.13.46.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 13:46:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-31583-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VgzZunqF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-31583-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31583-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 22EC8286A58 for ; Fri, 19 Jan 2024 21:38:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 501E95821B; Fri, 19 Jan 2024 21:38:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VgzZunqF" 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 763EA57888; Fri, 19 Jan 2024 21:38:36 +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=1705700316; cv=none; b=T0j4G6DnL6j3rWu8LnGhtKjJBzQxDzqgsNYqnRT90QvqYbrur/q4C5Mqtukgal+JpTT7u/CpDUeX4UurhglC2IZgaP0jnxQOqVBIT3CnTJCnbvwWpHtjYTXPuve0k8LmY6c6oWQ4NTl8WOcyDr1NaP2K+W86jP0I7wK4ezzrNdY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705700316; c=relaxed/simple; bh=s8jIqE+vW+iYqMRnNiKZlbFoWO7EWkMJg5CQzYRn9bk=; h=Mime-Version:Content-Type:Date:Message-Id:To:Cc:Subject:From: References:In-Reply-To; b=OZ0IiROoFyXaYP0CiXu3hkdw7UqdgWzaN9zWYf6jII21hCozYD4z6X19nqeNT7J4jKvPXNqe8p2FKqCfPQkWSJaDuDDoarQJNbwdcqroGaPIV5K7/YBYVV7rXUOY4eMR5Qa/xZocYIL8KFoAMUjmrCoxoo08J0RRU0ldPjt8krE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VgzZunqF; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id F093EC433C7; Fri, 19 Jan 2024 21:38:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705700315; bh=s8jIqE+vW+iYqMRnNiKZlbFoWO7EWkMJg5CQzYRn9bk=; h=Date:To:Cc:Subject:From:References:In-Reply-To:From; b=VgzZunqFSQAJW/Qgk7hSaAYMCU33W/15xkyyRu/F7jsuzVfx5pNO4SJcpxwGSq7Cw Afym3p8UxCBp5oLhqtzsOoo4uHOq9kCQEhceK0QSJLLMVM2QLTLKxk+2UwbO/kJzmX svOZUAMU4gJh8O3BVj/l6iGh4WQor6SptG0Oju/hTgWY9u1yUBN0wiCnGceFClMBFo YmjI9d7jevRwCF6G3gOq9ONkQ6vvVOchbA9l39rGYp94bLoPMHf8E72PkqKJiiplPM Dr9o/sqnpXjPWZXS9Gq2D8CW35c83wOSCssicjuezHUhtQQMjsbKFN6EvAJMMXWjN4 NYTeDEacBYtEw== 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: Fri, 19 Jan 2024 21:38:32 +0000 Message-Id: To: "Alexander Steffen" , "Daniel P. Smith" , "Jason Gunthorpe" , "Lino Sanfilippo" , "Sasha Levin" , , Cc: "Ross Philipson" , "Kanth Ghatraju" , "Peter Huewe" Subject: Re: [PATCH] tpm: make locality handling resilient From: "Jarkko Sakkinen" X-Mailer: aerc 0.15.2 References: <20240115011546.21193-1-dpsmith@apertussolutions.com> <711d659f-3f57-48e4-b5b3-efbc2fe236c8@infineon.com> In-Reply-To: <711d659f-3f57-48e4-b5b3-efbc2fe236c8@infineon.com> On Wed Jan 17, 2024 at 8:44 AM UTC, Alexander Steffen wrote: > On 15.01.2024 02:15, Daniel P. Smith wrote: > > Commit 933bfc5ad213 introduced the use of a locality counter to control= when > > locality request was actually sent to the TPM. This locality counter cr= eated a > > hard enforcement that the TPM had no active locality at the time of the= driver > > initialization. The reality is that this may not always be the case cou= pled > > with the fact that the commit indiscriminately decremented the counter = created > > the condition for integer underflow of the counter. The underflow was t= riggered > > by the first pair of request/relinquish calls made in tpm_tis_init_core= and all > > subsequent calls to request/relinquished calls would have the counter f= lipping > > between the underflow value and 0. The result is that it appeared all c= alls to > > request/relinquish were successful, but they were not. The end result i= s that > > the locality that was active when the driver loaded would always remain= active, > > to include after the driver shutdown. This creates a significant issue = when > > using Intel TXT and Locality 2 is active at boot. After the GETSEC[SEXI= T] > > instruction is called, the PCH will close access to Locality 2 MMIO add= ress > > space, leaving the TPM locked in Locality 2 with no means to relinquish= the > > locality until system reset. > >=20 > > The commit seeks to address this situation through three changes. > > Could you split this up into multiple patches then, so that they can be= =20 > discussed separately? I have to agree with you ttly. Yeah also the text above is not exactly in the ballpark. I did not understand what I read. I had to read the code change instead to get an idea. A huge pile of text does not equal to stronger story. Like for any essay, scientific paper or a kernel message one should do also few edit rounds. The commit message is more important than the code change itself in bug fixes... There is trigger (TXT) and solution. A great commit message should have motivation and implementation parts and somewhat concise story where things lead to another. It should essentially make *any* reader who knows the basics of kernel code base convinced, not confused. This is at leat a good aim even tho sometimes unreachable. BR, Jarkko