Skip to content

Commit

Permalink
OvmfPkg: DxeTcg2PhysicalPresenceLib: fix bootloop
Browse files Browse the repository at this point in the history
Flush cache not only when placing request in PPI, but also after
clearing old request from PPI.

Signed-off-by: Artur Kowalski <[email protected]>
  • Loading branch information
arturkow2000 committed Sep 11, 2024
1 parent 1f42592 commit 2dfe3b2
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,8 @@ Tcg2ExecutePendingTpmRequest (
mPpi->LastRequest = mPpi->Request;
mPpi->Request = TCG2_PHYSICAL_PRESENCE_NO_ACTION;
mPpi->RequestParameter = 0;

WriteBackDataCacheRange((VOID*)mPpi, sizeof(QEMU_TPM_PPI));
return;
}

Expand Down Expand Up @@ -763,6 +765,7 @@ Tcg2ExecutePendingTpmRequest (
mPpi->RequestParameter = 0;

if (mPpi->Response == TCG_PP_OPERATION_RESPONSE_USER_ABORT) {
WriteBackDataCacheRange((VOID*)mPpi, sizeof(QEMU_TPM_PPI));
return;
}

Expand Down Expand Up @@ -791,6 +794,7 @@ Tcg2ExecutePendingTpmRequest (
}

Print (L"Rebooting system to make TPM2 settings in effect\n");
WriteBackDataCacheRange((VOID*)mPpi, sizeof(QEMU_TPM_PPI));
gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
ASSERT (FALSE);
}
Expand Down Expand Up @@ -903,7 +907,7 @@ Tcg2PhysicalPresenceLibSubmitRequestToPreOSFunction (

mPpi->Request = OperationRequest;
mPpi->RequestParameter = RequestParameter;
WriteBackDataCache();
WriteBackDataCacheRange((VOID*)mPpi, sizeof(QEMU_TPM_PPI));

return TCG_PP_SUBMIT_REQUEST_TO_PREOS_SUCCESS;
}
Expand Down

0 comments on commit 2dfe3b2

Please sign in to comment.