diff mbox series

Is efi_tpm_eventlog_init calling memblock_reserve correctly for the TPM final log?

Message ID 1d0b01793100651682413ab1e14c1b1d0e9f68f0.camel@redhat.com (mailing list archive)
State New, archived
Headers show
Series Is efi_tpm_eventlog_init calling memblock_reserve correctly for the TPM final log? | expand

Commit Message

Jerry Snitselaar Oct. 7, 2022, 4:50 p.m. UTC
On Wed, 2022-06-22 at 21:26 -0700, Jerry Snitselaar wrote:
> Is this calling memblock_reserve() correctly for the final events
> log?
> 
> For the tpm events log it does:
> 
> memblock_reserve(efi.tpm_log, tbl_size);
> 
> For the final events log it does:
> 
>           memblock_reserve((unsigned long)final_tbl,
>                            tbl_size + sizeof(*final_tbl));
> 
> 
> which ends up with something like:
> 
> [    0.000000] memblock_reserve:
> [0x000000005d7b5018-0x000000005d7b958a]
> efi_tpm_eventlog_init+0x82/0x370
> [    0.000000] memblock_reserve:
> [0xffffffffff2c0000-0xffffffffff2c00e4]
> efi_tpm_eventlog_init+0x324/0x370
> 
> 
> Regards,
> Jerry
> 

Hi Matthew and Jarrko,

Is efi_tpm_eventlog_init() calling memblock_reserve() with the correct
argument for the TPM final log, or should it be the following instead:

Comments

Jarkko Sakkinen Oct. 12, 2022, 8:12 a.m. UTC | #1
On Fri, Oct 07, 2022 at 09:50:49AM -0700, Jerry Snitselaar wrote:
> On Wed, 2022-06-22 at 21:26 -0700, Jerry Snitselaar wrote:
> > Is this calling memblock_reserve() correctly for the final events
> > log?
> > 
> > For the tpm events log it does:
> > 
> > memblock_reserve(efi.tpm_log, tbl_size);
> > 
> > For the final events log it does:
> > 
> >           memblock_reserve((unsigned long)final_tbl,
> >                            tbl_size + sizeof(*final_tbl));
> > 
> > 
> > which ends up with something like:
> > 
> > [    0.000000] memblock_reserve:
> > [0x000000005d7b5018-0x000000005d7b958a]
> > efi_tpm_eventlog_init+0x82/0x370
> > [    0.000000] memblock_reserve:
> > [0xffffffffff2c0000-0xffffffffff2c00e4]
> > efi_tpm_eventlog_init+0x324/0x370
> > 
> > 
> > Regards,
> > Jerry
> > 
> 
> Hi Matthew and Jarrko,
> 
> Is efi_tpm_eventlog_init() calling memblock_reserve() with the correct
> argument for the TPM final log, or should it be the following instead:
> 
> diff --git a/drivers/firmware/efi/tpm.c b/drivers/firmware/efi/tpm.c
> index 8f665678e9e3..e8d69bd548f3 100644
> --- a/drivers/firmware/efi/tpm.c
> +++ b/drivers/firmware/efi/tpm.c
> @@ -97,7 +97,7 @@ int __init efi_tpm_eventlog_init(void)
>  		goto out_calc;
>  	}
>  
> -	memblock_reserve((unsigned long)final_tbl,
> +	memblock_reserve(efi.tpm_final_log,
>  			 tbl_size + sizeof(*final_tbl));
>  	efi_tpm_final_log_size = tbl_size;

With a *long while* since last looked into this, it does look wrong as
'final_tbl' is just transient thing in the fixmap used internally in the
function.

BR, Jarkko
diff mbox series

Patch

diff --git a/drivers/firmware/efi/tpm.c b/drivers/firmware/efi/tpm.c
index 8f665678e9e3..e8d69bd548f3 100644
--- a/drivers/firmware/efi/tpm.c
+++ b/drivers/firmware/efi/tpm.c
@@ -97,7 +97,7 @@  int __init efi_tpm_eventlog_init(void)
 		goto out_calc;
 	}
 
-	memblock_reserve((unsigned long)final_tbl,
+	memblock_reserve(efi.tpm_final_log,
 			 tbl_size + sizeof(*final_tbl));
 	efi_tpm_final_log_size = tbl_size;