diff mbox series

[v4,2/3] tcg2: decouple eventlog size from efi

Message ID 20250110215640.892539-2-raymond.mao@linaro.org
State Superseded
Delegated to: Tom Rini
Headers show
Series [v4,1/3] bloblist: add api to get blob with size | expand

Commit Message

Raymond Mao Jan. 10, 2025, 9:56 p.m. UTC
Move default eventlog size from efi to tpm for using in both
modules.

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
---
Changes in v4
- Initial patch.

 include/efi_tcg2.h | 2 --
 include/tpm_tcg2.h | 2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Heinrich Schuchardt Jan. 11, 2025, 12:06 a.m. UTC | #1
Am 10. Januar 2025 22:56:34 MEZ schrieb Raymond Mao <raymond.mao@linaro.org>:
>Move default eventlog size from efi to tpm for using in both
>modules.
>
>Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
>---
>Changes in v4
>- Initial patch.
>
> include/efi_tcg2.h | 2 --
> include/tpm_tcg2.h | 2 ++
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/include/efi_tcg2.h b/include/efi_tcg2.h
>index 8dfb1bc952..7ed8880991 100644
>--- a/include/efi_tcg2.h
>+++ b/include/efi_tcg2.h
>@@ -28,8 +28,6 @@
> #define EFI_TCG2_MAX_PCR_INDEX 23
> #define EFI_TCG2_FINAL_EVENTS_TABLE_VERSION 1
> 
>-#define TPM2_EVENT_LOG_SIZE CONFIG_EFI_TCG2_PROTOCOL_EVENTLOG_SIZE
>-
> typedef u32 efi_tcg_event_log_bitmap;
> typedef u32 efi_tcg_event_log_format;
> typedef u32 efi_tcg_event_algorithm_bitmap;
>diff --git a/include/tpm_tcg2.h b/include/tpm_tcg2.h
>index 6519004cc4..25a31daf65 100644
>--- a/include/tpm_tcg2.h
>+++ b/include/tpm_tcg2.h
>@@ -65,6 +65,8 @@
> #define EFI_DTB_EVENT_STRING \
> 	"DTB DATA"
> 

Please, provide Sphinx style documentation for defines.

>+#define TPM2_EVENT_LOG_SIZE CONFIG_EFI_TCG2_PROTOCOL_EVENTLOG_SIZE

Why would we need such a define at all? Can't we directly use the CONFIG value?

Why should the CONFIG value remain in lib/efi_loader/Kconfig? I would not expect the log size in the non-EFI case to depend on the UEFI subsystem.

Best regards

Heinrich

>+
> /**
>  *  struct TCG_EfiSpecIdEventAlgorithmSize - hashing algorithm information
>  *
Raymond Mao Jan. 13, 2025, 3:13 p.m. UTC | #2
Hi Heinrich,

On Fri, 10 Jan 2025 at 19:06, Heinrich Schuchardt <xypron.glpk@gmx.de>
wrote:

> Am 10. Januar 2025 22:56:34 MEZ schrieb Raymond Mao <
> raymond.mao@linaro.org>:
> >Move default eventlog size from efi to tpm for using in both
> >modules.
> >
> >Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
> >---
> >Changes in v4
> >- Initial patch.
> >
> > include/efi_tcg2.h | 2 --
> > include/tpm_tcg2.h | 2 ++
> > 2 files changed, 2 insertions(+), 2 deletions(-)
> >
> >diff --git a/include/efi_tcg2.h b/include/efi_tcg2.h
> >index 8dfb1bc952..7ed8880991 100644
> >--- a/include/efi_tcg2.h
> >+++ b/include/efi_tcg2.h
> >@@ -28,8 +28,6 @@
> > #define EFI_TCG2_MAX_PCR_INDEX 23
> > #define EFI_TCG2_FINAL_EVENTS_TABLE_VERSION 1
> >
> >-#define TPM2_EVENT_LOG_SIZE CONFIG_EFI_TCG2_PROTOCOL_EVENTLOG_SIZE
> >-
> > typedef u32 efi_tcg_event_log_bitmap;
> > typedef u32 efi_tcg_event_log_format;
> > typedef u32 efi_tcg_event_algorithm_bitmap;
> >diff --git a/include/tpm_tcg2.h b/include/tpm_tcg2.h
> >index 6519004cc4..25a31daf65 100644
> >--- a/include/tpm_tcg2.h
> >+++ b/include/tpm_tcg2.h
> >@@ -65,6 +65,8 @@
> > #define EFI_DTB_EVENT_STRING \
> >       "DTB DATA"
> >
>
> Please, provide Sphinx style documentation for defines.
>
> >+#define TPM2_EVENT_LOG_SIZE CONFIG_EFI_TCG2_PROTOCOL_EVENTLOG_SIZE
>
> Why would we need such a define at all? Can't we directly use the CONFIG
> value?
>
> Why should the CONFIG value remain in lib/efi_loader/Kconfig? I would not
> expect the log size in the non-EFI case to depend on the UEFI subsystem.
>
> This eventlog size should be treated as part of the kconfigs of
TCG2_PROTOCOL but not lower level of TPM2.
We don't have a separate kconfig page for TCG2_PROTOCOL, if my
understanding is correct, all TCG2 stuff are supposed to be used by EFI
only for now.

Regards,
Raymond


> >+
> > /**
> >  *  struct TCG_EfiSpecIdEventAlgorithmSize - hashing algorithm
> information
> >  *
>
>
diff mbox series

Patch

diff --git a/include/efi_tcg2.h b/include/efi_tcg2.h
index 8dfb1bc952..7ed8880991 100644
--- a/include/efi_tcg2.h
+++ b/include/efi_tcg2.h
@@ -28,8 +28,6 @@ 
 #define EFI_TCG2_MAX_PCR_INDEX 23
 #define EFI_TCG2_FINAL_EVENTS_TABLE_VERSION 1
 
-#define TPM2_EVENT_LOG_SIZE CONFIG_EFI_TCG2_PROTOCOL_EVENTLOG_SIZE
-
 typedef u32 efi_tcg_event_log_bitmap;
 typedef u32 efi_tcg_event_log_format;
 typedef u32 efi_tcg_event_algorithm_bitmap;
diff --git a/include/tpm_tcg2.h b/include/tpm_tcg2.h
index 6519004cc4..25a31daf65 100644
--- a/include/tpm_tcg2.h
+++ b/include/tpm_tcg2.h
@@ -65,6 +65,8 @@ 
 #define EFI_DTB_EVENT_STRING \
 	"DTB DATA"
 
+#define TPM2_EVENT_LOG_SIZE CONFIG_EFI_TCG2_PROTOCOL_EVENTLOG_SIZE
+
 /**
  *  struct TCG_EfiSpecIdEventAlgorithmSize - hashing algorithm information
  *