mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-23 05:34:31 +02:00
SecurityPkg:Tcg2Smm: Update TcgNvs info after memory is allocated
Update package format info in _PRS to TcgNvs after memory is allocated. Change-Id: Icfadb350e60d3ed2df332e92c257ce13309c0018 Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yao Jiewen <jiewen.yao@intel.com> Cc: Long Qin <qin.long@intel.com> Signed-off-by: Zhang, Chao B <chao.b.zhang@intel.com> Reviewed-by: Long Qin <qin.long@intel.com>
This commit is contained in:
parent
e243dfd12b
commit
1ea08a3dcd
@ -310,15 +310,17 @@ UpdatePPVersion (
|
|||||||
@param[in, out] Table The TPM item in ACPI table.
|
@param[in, out] Table The TPM item in ACPI table.
|
||||||
@param[in] IrqBuffer Input new IRQ buffer.
|
@param[in] IrqBuffer Input new IRQ buffer.
|
||||||
@param[in] IrqBuffserSize Input new IRQ buffer size.
|
@param[in] IrqBuffserSize Input new IRQ buffer size.
|
||||||
|
@param[out] IsShortFormPkgLength If _PRS returns Short length Package(ACPI spec 20.2.4).
|
||||||
|
|
||||||
@return patch status.
|
@return patch status.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
UpdatePossibleResource (
|
UpdatePossibleResource (
|
||||||
EFI_ACPI_DESCRIPTION_HEADER *Table,
|
IN EFI_ACPI_DESCRIPTION_HEADER *Table,
|
||||||
UINT32 *IrqBuffer,
|
IN UINT32 *IrqBuffer,
|
||||||
UINT32 IrqBuffserSize
|
IN UINT32 IrqBuffserSize,
|
||||||
|
OUT BOOLEAN *IsShortFormPkgLength
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINT8 *DataPtr;
|
UINT8 *DataPtr;
|
||||||
@ -431,7 +433,7 @@ UpdatePossibleResource (
|
|||||||
//
|
//
|
||||||
// Notify _PRS to report short formed ResourceTemplate
|
// Notify _PRS to report short formed ResourceTemplate
|
||||||
//
|
//
|
||||||
mTcgNvs->IsShortFormPkgLength = TRUE;
|
*IsShortFormPkgLength = TRUE;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -503,7 +505,7 @@ UpdatePossibleResource (
|
|||||||
//
|
//
|
||||||
// Notify _PRS to report long formed ResourceTemplate
|
// Notify _PRS to report long formed ResourceTemplate
|
||||||
//
|
//
|
||||||
mTcgNvs->IsShortFormPkgLength = FALSE;
|
*IsShortFormPkgLength = FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -672,6 +674,9 @@ PublishAcpiTable (
|
|||||||
UINTN TableSize;
|
UINTN TableSize;
|
||||||
UINT32 *PossibleIrqNumBuf;
|
UINT32 *PossibleIrqNumBuf;
|
||||||
UINT32 PossibleIrqNumBufSize;
|
UINT32 PossibleIrqNumBufSize;
|
||||||
|
BOOLEAN IsShortFormPkgLength;
|
||||||
|
|
||||||
|
IsShortFormPkgLength = FALSE;
|
||||||
|
|
||||||
Status = GetSectionFromFv (
|
Status = GetSectionFromFv (
|
||||||
&gEfiCallerIdGuid,
|
&gEfiCallerIdGuid,
|
||||||
@ -710,7 +715,7 @@ PublishAcpiTable (
|
|||||||
PossibleIrqNumBufSize = (UINT32)PcdGetSize(PcdTpm2PossibleIrqNumBuf);
|
PossibleIrqNumBufSize = (UINT32)PcdGetSize(PcdTpm2PossibleIrqNumBuf);
|
||||||
|
|
||||||
if (PossibleIrqNumBufSize <= MAX_PRS_INT_BUF_SIZE && (PossibleIrqNumBufSize % sizeof(UINT32)) == 0) {
|
if (PossibleIrqNumBufSize <= MAX_PRS_INT_BUF_SIZE && (PossibleIrqNumBufSize % sizeof(UINT32)) == 0) {
|
||||||
Status = UpdatePossibleResource(Table, PossibleIrqNumBuf, PossibleIrqNumBufSize);
|
Status = UpdatePossibleResource(Table, PossibleIrqNumBuf, PossibleIrqNumBufSize, &IsShortFormPkgLength);
|
||||||
DEBUG ((
|
DEBUG ((
|
||||||
DEBUG_INFO,
|
DEBUG_INFO,
|
||||||
"UpdatePossibleResource status - %x. TPM2 service may not ready in OS.\n",
|
"UpdatePossibleResource status - %x. TPM2 service may not ready in OS.\n",
|
||||||
@ -743,7 +748,7 @@ PublishAcpiTable (
|
|||||||
mTcgNvs = AssignOpRegion (Table, SIGNATURE_32 ('T', 'N', 'V', 'S'), (UINT16) sizeof (TCG_NVS));
|
mTcgNvs = AssignOpRegion (Table, SIGNATURE_32 ('T', 'N', 'V', 'S'), (UINT16) sizeof (TCG_NVS));
|
||||||
ASSERT (mTcgNvs != NULL);
|
ASSERT (mTcgNvs != NULL);
|
||||||
mTcgNvs->TpmIrqNum = PcdGet32(PcdTpm2CurrentIrqNum);
|
mTcgNvs->TpmIrqNum = PcdGet32(PcdTpm2CurrentIrqNum);
|
||||||
mTcgNvs->IsShortFormPkgLength = FALSE;
|
mTcgNvs->IsShortFormPkgLength = IsShortFormPkgLength;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Publish the TPM ACPI table. Table is re-checksumed.
|
// Publish the TPM ACPI table. Table is re-checksumed.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user