devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Stefan Berger <stefanb@linux.ibm.com>
Cc: kexec@lists.infradead.org, devicetree@vger.kernel.org,
	linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org, nayna@linux.ibm.com,
	nasastry@in.ibm.com, mpe@ellerman.id.au,
	Jason Gunthorpe <jgg@ziepe.ca>, Rob Herring <robh+dt@kernel.org>,
	Frank Rowand <frowand.list@gmail.com>
Subject: Re: [PATCH v5 4/6] tpm: of: Make of-tree specific function commonly available
Date: Thu, 28 Jul 2022 10:40:28 +0300	[thread overview]
Message-ID: <YuI9bLmqGsZwn4n6@kernel.org> (raw)
In-Reply-To: <3a9196b3-c510-0c32-8b70-572d9c4fe69d@linux.ibm.com>

On Fri, Jul 15, 2022 at 12:01:36PM -0400, Stefan Berger wrote:
> 
> 
> On 7/10/22 23:04, Jarkko Sakkinen wrote:
> > On Wed, Jul 06, 2022 at 11:23:27AM -0400, Stefan Berger wrote:
> > > Simplify tpm_read_log_of() by moving reusable parts of the code into
> > > an inline function that makes it commonly available so it can be
> > > used also for kexec support. Call the new of_tpm_get_sml_parameters()
> > > function from the TPM Open Firmware driver.
> > > 
> > > Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
> > > Cc: Jarkko Sakkinen <jarkko@kernel.org>
> > > Cc: Jason Gunthorpe <jgg@ziepe.ca>
> > > Cc: Rob Herring <robh+dt@kernel.org>
> > > Cc: Frank Rowand <frowand.list@gmail.com>
> > > 
> > > ---
> > > v4:
> > >   - converted to inline function
> > > ---
> > >   drivers/char/tpm/eventlog/of.c | 31 +++++--------------------------
> > >   include/linux/tpm.h            | 27 +++++++++++++++++++++++++++
> > >   2 files changed, 32 insertions(+), 26 deletions(-)
> > > 
> > > diff --git a/drivers/char/tpm/eventlog/of.c b/drivers/char/tpm/eventlog/of.c
> > > index a9ce66d09a75..f9462d19632e 100644
> > > --- a/drivers/char/tpm/eventlog/of.c
> > > +++ b/drivers/char/tpm/eventlog/of.c
> > > @@ -12,6 +12,7 @@
> > >   #include <linux/slab.h>
> > >   #include <linux/of.h>
> > > +#include <linux/tpm.h>
> > >   #include <linux/tpm_eventlog.h>
> > >   #include "../tpm.h"
> > > @@ -20,11 +21,10 @@
> > >   int tpm_read_log_of(struct tpm_chip *chip)
> > >   {
> > >   	struct device_node *np;
> > > -	const u32 *sizep;
> > > -	const u64 *basep;
> > >   	struct tpm_bios_log *log;
> > >   	u32 size;
> > >   	u64 base;
> > > +	int ret;
> > >   	log = &chip->log;
> > >   	if (chip->dev.parent && chip->dev.parent->of_node)
> > > @@ -35,30 +35,9 @@ int tpm_read_log_of(struct tpm_chip *chip)
> > >   	if (of_property_read_bool(np, "powered-while-suspended"))
> > >   		chip->flags |= TPM_CHIP_FLAG_ALWAYS_POWERED;
> > > -	sizep = of_get_property(np, "linux,sml-size", NULL);
> > > -	basep = of_get_property(np, "linux,sml-base", NULL);
> > > -	if (sizep == NULL && basep == NULL)
> > > -		return -ENODEV;
> > > -	if (sizep == NULL || basep == NULL)
> > > -		return -EIO;
> > > -
> > > -	/*
> > > -	 * For both vtpm/tpm, firmware has log addr and log size in big
> > > -	 * endian format. But in case of vtpm, there is a method called
> > > -	 * sml-handover which is run during kernel init even before
> > > -	 * device tree is setup. This sml-handover function takes care
> > > -	 * of endianness and writes to sml-base and sml-size in little
> > > -	 * endian format. For this reason, vtpm doesn't need conversion
> > > -	 * but physical tpm needs the conversion.
> > > -	 */
> 
> 
> Jarkko,
> 
>  can I apply your R-b tag after putting this lost comment back into the
> inline function?
>    Stefan

If there's a change I want to see the updated patch first.

BR, Jarkko

  reply	other threads:[~2022-07-28  7:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-06 15:23 [PATCH v5 0/6] tpm: Preserve TPM measurement log across kexec (ppc64) Stefan Berger
2022-07-06 15:23 ` [PATCH v5 1/6] of: check previous kernel's ima-kexec-buffer against memory bounds Stefan Berger
2022-07-06 15:23 ` [PATCH v5 2/6] drivers: of: kexec ima: Support 32-bit platforms Stefan Berger
2022-07-06 15:23 ` [PATCH v5 3/6] x86/kexec: Carry forward IMA measurement log on kexec Stefan Berger
2022-07-06 15:23 ` [PATCH v5 4/6] tpm: of: Make of-tree specific function commonly available Stefan Berger
2022-07-11  3:04   ` Jarkko Sakkinen
2022-07-15 16:01     ` Stefan Berger
2022-07-28  7:40       ` Jarkko Sakkinen [this message]
2022-07-06 15:23 ` [PATCH v5 5/6] of: kexec: Refactor IMA buffer related functions to make them reusable Stefan Berger
2022-07-07 14:47   ` Jonathan McDowell
2022-07-07 16:10     ` Stefan Berger
2022-07-06 15:23 ` [PATCH v5 6/6] tpm/kexec: Duplicate TPM measurement log in of-tree for kexec Stefan Berger
2022-07-07  4:25   ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YuI9bLmqGsZwn4n6@kernel.org \
    --to=jarkko@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=jgg@ziepe.ca \
    --cc=kexec@lists.infradead.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=nasastry@in.ibm.com \
    --cc=nayna@linux.ibm.com \
    --cc=robh+dt@kernel.org \
    --cc=stefanb@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).