From mboxrd@z Thu Jan 1 00:00:00 1970 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 63AE419BBA; Sat, 2 Nov 2024 14:07:09 +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=1730556429; cv=none; b=kjxJs7g6yyCzYPP5yHHdlhEgkKpoL2iUYXnF9szTnsWD41MLHo2OLfgCtbRu/eByIyaKlvmkJu7qKrw19UZo27JiHZhcwcZ3yPtXj2gv+3NxkHNZEgxSwAylr9skuSd7+bRTKemioNdZuVJrNAzZJzWeuxNv9DubvAikSesI3O0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730556429; c=relaxed/simple; bh=Q821xsKXoJpJAxa6aZg5/VMu9xAoqVqBnQJhUqyV72k=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=jgsV+QGuMQjPNiEiIkMXj6ZLk/3Q8RmxsU8ERcu33bK6fUlfd0Yr0/nWUHec34xLtJPMgajo4HLcGQAey4KZ/DarIhWIBnUPcxXej2cejZ8hMtZviL3a5ZnrZg13yh2pS+sTyd5Ehin2EHOCgd6ZQ3np2h6hEFVsq4WxGT66iwo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IOcQWZtR; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IOcQWZtR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56207C4CEC3; Sat, 2 Nov 2024 14:07:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730556429; bh=Q821xsKXoJpJAxa6aZg5/VMu9xAoqVqBnQJhUqyV72k=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=IOcQWZtRAPtxYRkzOQxHHSquppDz8lzAFNi0f/YvjS7tasWa59/bNiUZYoNhNkaX2 yiReHqnCuWv9KDvpJLznhKnSsAM/GWuiXTf6mS0qOY6QPIHUAoKFMBOSI4jV0K4Qjd tHv7ujaIKeF+1aJbmQy7dIifP3mYPQtwAWb5Lo23Etmo8Xzwx8681roOg5DpJ2F05/ 27dvBPeEX5Ez7GkT+sorULpAYaC2bfUN5oyUPyyrhbqCrxQCayb1kxPUiu7RScXEiw YZ9L3gwbDqvznQ5inQSWLuVdcZoJwqQHEi48Do7mIljbZSCjNNRjtznzvIilf0QzQZ 6pbXxvUPnwrlA== Precedence: bulk X-Mailing-List: linux-crypto@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: Sat, 02 Nov 2024 16:07:04 +0200 Message-Id: Cc: "Jonathan Corbet" , "Peter Huewe" , "Jason Gunthorpe" , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [RFC PATCH v2 1/2] tpm, tpm_tis: Introduce TPM_IOC_SET_LOCALITY From: "Jarkko Sakkinen" To: "Jarkko Sakkinen" , "Ard Biesheuvel" X-Mailer: aerc 0.18.2 References: <20241102062259.2521361-1-jarkko@kernel.org> In-Reply-To: On Sat Nov 2, 2024 at 3:39 PM EET, Jarkko Sakkinen wrote: > int tpm_chip_set_locality(struct tpm_chip *chip, u8 locality) > { > int ret; > > if (locality >=3D TPM_MAX_LOCALITY) > return false; > > ret =3D tpm_try_get_ops(chip); > if (ret) > return ret; > > chip->default_locality =3D locality; > > tpm_put_ops(chip); > return 0; > } > EXPORT_SYMBOL_GPL(tpm_chip_set_locality); Other things to take from 1/2 of my RFC to this: 1. Must be one-shot. 2. Must be only for tpm_tis as this is made to work only with that driver. E.g. 15/20 is only for tpm_tis. I guess that is the main target anyway here. Future patch sets can extend this to other drivers. TPM_CHIP_FLAG_SET_LOCALITY_ENABLED use in 1/2 can be referenced for a solution. Kernel command-line parameter: I agree not having it if no need for ioctl, so that is addressed too. BR, Jarkko