Skip to contentSkip to conversation

efi/tpm: Pass correct address to memblock_reserve

PATCH In review Jerry Snitselaar 3 participants 3 messages Oct 22, 2022 – Oct 24, 2022 EFI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi/tpm: Pass correct address to memblock_reserve

memblock_reserve() expects a physical address, but the address being passed for the TPM final events log is what was returned from early_memremap(). This results in something like the following:

[    0.000000] memblock_reserve: [0xffffffffff2c0000-0xffffffffff2c00e4] efi_tpm_eventlog_init+0x324/0x370

Pass the address from efi like what is done for the TPM events log.

Fixes c46f3405692d ("tpm: Reserve the TPM final events table")
Cc Matthew Garrett <[email protected]>
Cc Jarkko Sakkinen <[email protected]>
Cc Bartosz Szczepanek <[email protected]>
Cc Ard Biesheuvel <[email protected]>
---
 drivers/firmware/efi/tpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/efi/tpm.c +1 -1
index 8f665678e9e3..e8d69bd548f3 100644
@@ -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;
 
Signature · 1 line
2.37.2
Acked-by on v1 1/1
#1 lore raw
Quoted 34 lines · Jerry Snitselaar

memblock_reserve() expects a physical address, but the address being passed for the TPM final events log is what was returned from early_memremap(). This results in something like the following:

[    0.000000] memblock_reserve: [0xffffffffff2c0000-0xffffffffff2c00e4] efi_tpm_eventlog_init+0x324/0x370

Pass the address from efi like what is done for the TPM events log.

Fixes c46f3405692d ("tpm: Reserve the TPM final events table")
Cc Matthew Garrett <[email protected]>
Cc Jarkko Sakkinen <[email protected]>
Cc Bartosz Szczepanek <[email protected]>
Cc Ard Biesheuvel <[email protected]>
---
 drivers/firmware/efi/tpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/efi/tpm.c +1 -1
index 8f665678e9e3..e8d69bd548f3 100644
@@ -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;
 
Signature · 1 line
2.37.2

BR, Jarkko

maintainer
#2 lore raw
Quoted 33 lines · Jarkko Sakkinen
Quoted 31 lines · Jerry Snitselaar

memblock_reserve() expects a physical address, but the address being passed for the TPM final events log is what was returned from early_memremap(). This results in something like the following:

[    0.000000] memblock_reserve: [0xffffffffff2c0000-0xffffffffff2c00e4] efi_tpm_eventlog_init+0x324/0x370

Pass the address from efi like what is done for the TPM events log.

Fixes c46f3405692d ("tpm: Reserve the TPM final events table")
Cc Matthew Garrett <[email protected]>
Cc Jarkko Sakkinen <[email protected]>
Cc Bartosz Szczepanek <[email protected]>
Cc Ard Biesheuvel <[email protected]>
---
 drivers/firmware/efi/tpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/efi/tpm.c +1 -1
index 8f665678e9e3..e8d69bd548f3 100644
@@ -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;
 
Quoted 7 lines
Quoted 3 lines

--
2.37.2

Queued as a fix,

Thanks all,