Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1354573rdb; Mon, 19 Feb 2024 12:33:13 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWCQEWGU7BADvat5zVXLbH2TKzR9cIflVOr2ZcoSaF8rBqmOQ5/aTyTURitPMaNqr2DPRBKrqw0kAndUc0L+lxXJgIHdwSUdfXwRMaF5A== X-Google-Smtp-Source: AGHT+IGURR/B+Mc9GMU6Q1hryHvhShB2tpPlU3iBPSsI83Mxgi2ZLOiAV5unKQ+Vpk/CY3GQJVeI X-Received: by 2002:a92:c54d:0:b0:365:1563:c4e5 with SMTP id a13-20020a92c54d000000b003651563c4e5mr13079238ilj.9.1708374793523; Mon, 19 Feb 2024 12:33:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708374793; cv=pass; d=google.com; s=arc-20160816; b=XL/WWeKZ54y0yQbdCTRqVJW8XjZYEsu3XAnpsMdXxoLaSL+V3kxAFrQX2hNZojPeVo 01HNDqfCHjGt5p7O5RPdD9UhC75KKRlFNCaiCCB5ChHXw/xZnC3R3ygiTixNmyOvkVl5 0UJ3TEvRtuwmcNsncg8r5ttLmBB1RgyB7sOPMPKnqoYi8wHWUUdHJUTHIDGF2+Prxj7C 6m3VVVyHhDwGwSuzcyoEzCXxXg7SV2B6xQlThwxyBPch4z8a4FcuybrKK0yAF7+EshCP DkEkK4tkGBmXoL7oTHD+rMGM5+o5+u4DersauYYqDimC4Nv8ApDm56Wf9tenm3oxbxew VvXw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:message-id:to:from:subject:cc:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=ZMCiFt5yT1LMUzDSJxbzF/sidzXpeWQp9rPs6KiK+Os=; fh=0LGOGv8m9N6YSoMwtksfBXcGmpdmbLOZ0lUp8onzq/c=; b=WHzCAvMpbxbauFGnsc/cBF2IaN0JNnTeVfeLLnd/UOr6fL4zNiJXLY1wqWpsTU1rxh 1NJeJPtS6peOB6YTf0lyb1Zdi5+stbSEQ26QCDwMIUsYC0BMSIitMEwzwZujsX5HLT9Q WMwmPrKOkYlLPdgLJrDu5+W8/6x4AoEwcN0zLVyj/isu23Cwvjui2vExaCxsW4o+WuK7 wOG/jin9yhRcKLDed2zGGKy2Mc4XLW/V2+AkyLXll/ILJWg/hi6mc+I0Ie3M+RoqThwg YHUYjV1Wpa+rWmivTx2nnr0m0P+isXTF4whSAffDg5be/IdpM8tA2E+XrshJm7NZiknI 4eCg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kKptZ0kS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-71951-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71951-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 s22-20020a639256000000b005dc4f8a376asi4980918pgn.884.2024.02.19.12.33.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 12:33:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71951-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=kKptZ0kS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-71951-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71951-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 7309CB255C4 for ; Mon, 19 Feb 2024 20:18:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8D255537F0; Mon, 19 Feb 2024 20:17:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kKptZ0kS" 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 B137050267; Mon, 19 Feb 2024 20:17:46 +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=1708373866; cv=none; b=pRotuprmbZFF75k5JHtu9FMyHtE3EZlTS1ZyjFvD6ZfrD5QXGSyrTWGYgu9LDKpkYEG5rxUEOiCy3JqRh/xxQATOEQooEjYLrgLbQRoCY7qV5ZwKCM7D9gijh2w+QNpTxkAUinJ3uzqaTyik3GvGzGrm8VkmaNfV0f57Ky/tgv8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708373866; c=relaxed/simple; bh=KOY1ANOS2dFuGqiw0GK0ZhMjCXxy3Anhz2OyOJ9uGUE=; h=Mime-Version:Content-Type:Date:Cc:Subject:From:To:Message-Id: References:In-Reply-To; b=WXMGtBFcyZQ4BzbESjhKb8WQ1tEBbS+5Ac+7Nq+jV9nda/cTAoQGp6n2d53814j3ziG7/BK/abUf0LpJhKssNoBucH+jxHpsvjeE3T+2EU4xsjyl7Hv4v7zLqUkg9+LaCmkrOD2S7Ca+zE9RRgIRK7pbaUobRh68VnODTs/9Mp4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kKptZ0kS; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C70D6C43399; Mon, 19 Feb 2024 20:17:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708373866; bh=KOY1ANOS2dFuGqiw0GK0ZhMjCXxy3Anhz2OyOJ9uGUE=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=kKptZ0kS+bowyvnKt9qKLKHsDmqdCQwopy3H7CldGeuH8WbWvlJKYpOB93RAF9YSb tbCGK/Kfhl2ndzjcBcf5SMB9wHX/9VL/SPo6OO7M4yZrXrDWS2352HqEQcqgONqmDi /yuygcM25TDg4LbKU8yxvj+4jHMSS7fAD7RLZe67HYJ/Xj9KE1VkbNZxAQU5oqhBkq d0z3pYuveMroI4HkIEHt+GtxrGjxMf/0FA7Hz6xPhZl1hUZ2MoXwBbO76TQwzzBARF K7hvzeQ6Ki7G5C/n3zUCbSAmu5SWBil/OSLkQraLpkx7wHVz+kf99+U/U9dA/1NrX7 dKNcys4K8WxZg== 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, 19 Feb 2024 20:17:42 +0000 Cc: "Ross Philipson" , "Peter Huewe" Subject: Re: [PATCH 2/3] tpm: ensure tpm is in known state at startup From: "Jarkko Sakkinen" To: "Daniel P. Smith" , "Jason Gunthorpe" , , Message-Id: X-Mailer: aerc 0.15.2 References: <20240131170824.6183-1-dpsmith@apertussolutions.com> <20240131170824.6183-3-dpsmith@apertussolutions.com> <2dd76ebf-b25d-447f-8abe-30e3423c4cdb@apertussolutions.com> In-Reply-To: <2dd76ebf-b25d-447f-8abe-30e3423c4cdb@apertussolutions.com> On Mon Feb 19, 2024 at 7:17 PM UTC, Daniel P. Smith wrote: > On 2/1/24 17:33, Jarkko Sakkinen wrote: > > On Wed Jan 31, 2024 at 7:08 PM EET, Daniel P. Smith wrote: > >> When tis core initializes, it assumes all localities are closed. There > > ~~~~~~~~ > > tpm_tis_core > >=20 > >> are cases when this may not be the case. This commit addresses this by > >> ensuring all localities are closed before initializing begins. > >=20 > > Remove the last sentence and replace with this paragraph: > >=20 > > "Address this by ensuring all the localities are closed in the beginnin= g > > of tpm_tis_core_init(). There are environments, like Intel TXT, which > > may leave a locality open. Close all localities to start from a known > > state." > > okay. > > > BTW, why we should motivated to take this patch anyway? > > Without this change, in this scenario the driver is unnecessarily=20 > thrashing the TPM with locality requests/relinquishes pairs for which=20 > will never take effect and that the TPM must do state change tracking.=20 > While I am confident that TPM chips are resilient to such abuse, I do=20 > not think it would be good form to knowingly allow such behavior to occur= . This would a factor better motivation part for the commit. I can=20 buy this argument instead the one right now, thanks :-) BR, Jarkko