[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5659e538b806c64cd738b13d89663890034447d0.camel@kernel.org>
Date: Tue, 14 Sep 2021 00:10:26 +0300
From: Jarkko Sakkinen <jarkko@...nel.org>
To: amirmizi6@...il.com, Eyal.Cohen@...oton.com,
oshrialkoby85@...il.com, alexander.steffen@...ineon.com,
robh+dt@...nel.org, mark.rutland@....com, peterhuewe@....de,
jgg@...pe.ca, arnd@...db.de, gregkh@...uxfoundation.org,
benoit.houyere@...com, eajames@...ux.ibm.com, joel@....id.au
Cc: devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-integrity@...r.kernel.org, oshri.alkoby@...oton.com,
tmaimon77@...il.com, gcwilson@...ibm.com, kgoldman@...ibm.com,
Dan.Morav@...oton.com, oren.tanami@...oton.com,
shmulik.hager@...oton.com, amir.mizinski@...oton.com
Subject: Re: [PATCH v14 2/7] tpm: tpm_tis: Fix expected bit handling and
send all bytes in one shot without last byte in exception
On Mon, 2021-09-13 at 17:43 +0300, amirmizi6@...il.com wrote:
> From: Amir Mizinski <amirmizi6@...il.com>
>
> Detected an incorrect implementation of the send command.
> Currently, the driver polls the TPM_STS.stsValid field until TRUE; then it
> reads TPM_STS register again to verify only that TPM_STS.expect field is
> FALSE (i.e., it ignores TPM_STS.stsValid).
> Since TPM_STS.stsValid represents the TPM_STS.expect validity, both fields
> fields should be checked in the same TPM_STS register read value.
>
> This fix modifies the signature of 'wait_for_tpm_stat()', adding an
> additional "mask_result" parameter to its call and renaming it to
> 'tpm_tis_wait_for_stat()' for better alignment with other naming.
> 'tpm_tis_wait_for_stat()' is now polling the TPM_STS with a mask and waits
> for the value in mask_result. The fix adds the ability to check if certain
> TPM_STS bits have been cleared.
Use imprative form, e.g. "Modify the signature...".
>
> This change is also aligned to verifying the CRC on I2C TPM. The CRC
> verification should be done after the TPM_STS.expect field is cleared
> (TPM received all expected command bytes and set the calculated CRC value
> in the register).
What does it mean when you "align to verifying"?
> In addition, the send command was changed to comply with
> TCG_DesignPrinciples_TPM2p0Driver_vp24_pubrev.pdf as follows:
> - send all command bytes in one loop
> - remove special handling of the last byte
>
> Suggested-by: Benoit Houyere <benoit.houyere@...com>
> Signed-off-by: Amir Mizinski <amirmizi6@...il.com>
I don't think the rename is important enough to be done, and it
definitely should not be melded into another patch.
/Jarkko
Powered by blists - more mailing lists