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
arturkow2 committed Sep 10, 2024
1 parent 1f42592 commit fd05f33
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(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(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(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(mPpi, sizeof(QEMU_TPM_PPI));

return TCG_PP_SUBMIT_REQUEST_TO_PREOS_SUCCESS;
}
Expand Down

0 comments on commit fd05f33

Please sign in to comment.