[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200313151800.GA142269@linux.intel.com>
Date: Fri, 13 Mar 2020 17:18:00 +0200
From: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
To: Stefan Berger <stefanb@...ux.vnet.ibm.com>
Cc: linux-integrity@...r.kernel.org, aik@...abs.ru,
david@...son.dropbear.id.au, linux-kernel@...r.kernel.org,
nayna@...ux.vnet.ibm.com, gcwilson@...ux.ibm.com, jgg@...pe.ca,
Stefan Berger <stefanb@...ux.ibm.com>,
Nayna Jain <nayna@...ux.ibm.com>
Subject: Re: [PATCH v7 1/3] tpm: of: Handle IBM,vtpm20 case when getting log
parameters
On Thu, Mar 12, 2020 at 11:53:30AM -0400, Stefan Berger wrote:
> From: Stefan Berger <stefanb@...ux.ibm.com>
>
> A vTPM 2.0 is identified by 'IBM,vtpm20' in the 'compatible' node in
> the device tree. Handle it in the same way as 'IBM,vtpm'.
>
> The vTPM 2.0's log is written in little endian format so that for this
> aspect we can rely on existing code.
>
> Signed-off-by: Stefan Berger <stefanb@...ux.ibm.com>
> Acked-by: Nayna Jain <nayna@...ux.ibm.com>
> Tested-by: Nayna Jain <nayna@...ux.ibm.com>
> ---
> drivers/char/tpm/eventlog/of.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/char/tpm/eventlog/of.c b/drivers/char/tpm/eventlog/of.c
> index af347c190819..a9ce66d09a75 100644
> --- a/drivers/char/tpm/eventlog/of.c
> +++ b/drivers/char/tpm/eventlog/of.c
> @@ -51,7 +51,8 @@ int tpm_read_log_of(struct tpm_chip *chip)
> * endian format. For this reason, vtpm doesn't need conversion
> * but physical tpm needs the conversion.
> */
> - if (of_property_match_string(np, "compatible", "IBM,vtpm") < 0) {
> + if (of_property_match_string(np, "compatible", "IBM,vtpm") < 0 &&
> + of_property_match_string(np, "compatible", "IBM,vtpm20") < 0) {
> size = be32_to_cpup((__force __be32 *)sizep);
> base = be64_to_cpup((__force __be64 *)basep);
> } else {
> --
> 2.23.0
>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
/Jarkko
Powered by blists - more mailing lists