-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
efi: call get_event_log before ExitBootServices
With TPM 2.0 specification, the event logs may only be accessible by calling an EFI Boot Service. Modify the EFI stub to copy the log area to a new Linux-specific EFI configuration table so it remains accessible once booted. When calling this service, it is possible to specify the expected format of the logs: TPM 1.2 (SHA1) or TPM 2.0 ("Crypto Agile"). For now, only the first format is retrieved. Signed-off-by: Thiebaud Weksteen <tweek@google.com> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Tested-by: Javier Martinez Canillas <javierm@redhat.com> Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
- Loading branch information
Thiebaud Weksteen
authored and
Jarkko Sakkinen
committed
Jan 8, 2018
1 parent
4d01d29
commit 33b6d03
Showing
7 changed files
with
174 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright (C) 2017 Google, Inc. | ||
* Thiebaud Weksteen <tweek@google.com> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
|
||
#include <linux/efi.h> | ||
#include <linux/init.h> | ||
#include <linux/memblock.h> | ||
|
||
#include <asm/early_ioremap.h> | ||
|
||
/* | ||
* Reserve the memory associated with the TPM Event Log configuration table. | ||
*/ | ||
int __init efi_tpm_eventlog_init(void) | ||
{ | ||
struct linux_efi_tpm_eventlog *log_tbl; | ||
unsigned int tbl_size; | ||
|
||
if (efi.tpm_log == EFI_INVALID_TABLE_ADDR) | ||
return 0; | ||
|
||
log_tbl = early_memremap(efi.tpm_log, sizeof(*log_tbl)); | ||
if (!log_tbl) { | ||
pr_err("Failed to map TPM Event Log table @ 0x%lx\n", | ||
efi.tpm_log); | ||
efi.tpm_log = EFI_INVALID_TABLE_ADDR; | ||
return -ENOMEM; | ||
} | ||
|
||
tbl_size = sizeof(*log_tbl) + log_tbl->size; | ||
memblock_reserve(efi.tpm_log, tbl_size); | ||
early_memunmap(log_tbl, sizeof(*log_tbl)); | ||
return 0; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters