Skip to content

Commit

Permalink
OvmfPkg: DxeTcg2PhysicalPresenceLib: fix changing of PCR banks
Browse files Browse the repository at this point in the history
Tcg2PhysicalPresenceLibSubmitRequestToPreOSFunction writes to TPM2
physical presence PPI provided by coreboot (a memory region preserved
across reboots). CPU caches must be explicitly flushed prior to platform
reboot or request written to PPI will be lost.

Signed-off-by: Artur Kowalski <[email protected]>
  • Loading branch information
arturkow2000 authored and miczyg1 committed Sep 4, 2024
1 parent ad2124e commit 1f42592
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/CacheMaintenanceLib.h>

#include <Library/Tcg2PhysicalPresenceLib.h>

Expand Down Expand Up @@ -902,6 +903,7 @@ Tcg2PhysicalPresenceLibSubmitRequestToPreOSFunction (

mPpi->Request = OperationRequest;
mPpi->RequestParameter = RequestParameter;
WriteBackDataCache();

return TCG_PP_SUBMIT_REQUEST_TO_PREOS_SUCCESS;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
UefiLib
UefiRuntimeServicesTableLib
Tcg2PhysicalPresencePlatformLib
CacheMaintenanceLib

[Protocols]
gEfiTcg2ProtocolGuid ## SOMETIMES_CONSUMES
Expand Down

0 comments on commit 1f42592

Please sign in to comment.