All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Thirupathaiah Annapureddy <thiruan@linux.microsoft.com>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Simon Glass <sjg@chromium.org>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>
Subject: [PATCH 5/9] sandbox: tpm: Finish comments for struct sandbox_tpm2
Date: Mon,  5 Jul 2021 09:48:45 -0600	[thread overview]
Message-ID: <20210705154849.2083972-6-sjg@chromium.org> (raw)
In-Reply-To: <20210705154849.2083972-1-sjg@chromium.org>

Tidy up the missing comments for this struct.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 drivers/tpm/tpm2_tis_sandbox.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/drivers/tpm/tpm2_tis_sandbox.c b/drivers/tpm/tpm2_tis_sandbox.c
index 24c804a5645..5e0bd304699 100644
--- a/drivers/tpm/tpm2_tis_sandbox.c
+++ b/drivers/tpm/tpm2_tis_sandbox.c
@@ -45,19 +45,31 @@ static const u8 sandbox_extended_once_pcr[] = {
 	0xea, 0x98, 0x31, 0xa9, 0x27, 0x59, 0xfb, 0x4b,
 };
 
+/*
+ * Information about our TPM emulation. This is preserved in the sandbox
+ * state file if enabled.
+ *
+ * @init_done: true if open() has been called
+ * @startup_done: true if TPM2_CC_STARTUP has been processed
+ * @tests_done: true if TPM2_CC_SELF_TEST has be processed
+ * @pw: TPM password per hierarchy
+ * @pw_sz: Size of each password in bytes
+ * @properties: TPM properties
+ * @pcr: TPM Platform Configuration Registers. Each of these holds a hash and
+ *	can be 'extended' a number of times, meaning another hash is added into
+ *	its value (initial value all zeroes)
+ * @pcr_extensions: Number of times each PCR has been extended (starts at 0)
+ * @nvdata: non-volatile data, used to store important things for the platform
+ */
 struct sandbox_tpm2 {
 	/* TPM internal states */
 	bool init_done;
 	bool startup_done;
 	bool tests_done;
-	/* TPM password per hierarchy */
 	char pw[TPM2_HIERARCHY_NB][TPM2_DIGEST_LEN + 1];
 	int pw_sz[TPM2_HIERARCHY_NB];
-	/* TPM properties */
 	u32 properties[TPM2_PROPERTY_NB];
-	/* TPM PCRs */
 	u8 pcr[SANDBOX_TPM_PCR_NB][TPM2_DIGEST_LEN];
-	/* TPM PCR extensions */
 	u32 pcr_extensions[SANDBOX_TPM_PCR_NB];
 };
 
-- 
2.32.0.93.g670b81a890-goog


  parent reply	other threads:[~2021-07-05 15:49 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-05 15:48 [PATCH 0/9] tpm: Enhance sandbox tpm2 emulation Simon Glass
2021-07-05 15:48 ` [PATCH 1/9] sandbox: tpm: Split out common nvdata code Simon Glass
2021-07-05 15:48 ` [PATCH 2/9] sandbox: tpm: Tidy up reading and writing of device state Simon Glass
2021-07-05 15:48 ` [PATCH 3/9] sandbox: tpm: Support the define-space command Simon Glass
2021-07-05 15:48 ` [PATCH 4/9] sandbox: tpm: Correct handling of get-capability Simon Glass
2021-07-15 18:07   ` Ilias Apalodimas
2021-07-05 15:48 ` Simon Glass [this message]
2021-07-15 18:09   ` [PATCH 5/9] sandbox: tpm: Finish comments for struct sandbox_tpm2 Ilias Apalodimas
2021-07-05 15:48 ` [PATCH 6/9] sandbox: tpm: Track whether the state is valid Simon Glass
2021-07-05 15:48 ` [PATCH 7/9] sandbox: tpm: Support nvdata in TPM2 Simon Glass
2021-07-05 15:48 ` [PATCH 8/9] sandbox: tpm: Support storing device state in tpm2 Simon Glass
2021-07-05 15:48 ` [PATCH 9/9] sandbox: tpm: Support extending a PCR multiple times Simon Glass
2021-07-15 19:04   ` Ilias Apalodimas
2021-07-15 19:20     ` Ilias Apalodimas
2021-07-20 18:33       ` Simon Glass
2021-07-14 19:51 ` [PATCH 0/9] tpm: Enhance sandbox tpm2 emulation Simon Glass
2021-07-14 21:07   ` Ilias Apalodimas
2021-07-14 22:16     ` Simon Glass

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=20210705154849.2083972-6-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=thiruan@linux.microsoft.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.