diff options
author | Zhang, Chao B <chao.b.zhang@intel.com> | 2018-05-18 16:38:18 +0800 |
---|---|---|
committer | Zhang, Chao B <chao.b.zhang@intel.com> | 2018-05-22 08:48:56 +0800 |
commit | 1ea08a3dcdd61c7481ec78ad8b8037ee6ca45402 (patch) | |
tree | c1ab5431da3ff022b7e9f2de8ec586f599744a6f /SecurityPkg | |
parent | e243dfd12b763f363f5d3b2474efe924867d9e83 (diff) | |
download | edk2-1ea08a3dcdd61c7481ec78ad8b8037ee6ca45402.zip edk2-1ea08a3dcdd61c7481ec78ad8b8037ee6ca45402.tar.gz edk2-1ea08a3dcdd61c7481ec78ad8b8037ee6ca45402.tar.bz2 |
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>
Diffstat (limited to 'SecurityPkg')
-rw-r--r-- | SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c index c3cee83..3e0a689 100644 --- a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c +++ b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c @@ -310,15 +310,17 @@ UpdatePPVersion ( @param[in, out] Table The TPM item in ACPI table.
@param[in] IrqBuffer Input new IRQ buffer.
@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.
**/
EFI_STATUS
UpdatePossibleResource (
- EFI_ACPI_DESCRIPTION_HEADER *Table,
- UINT32 *IrqBuffer,
- UINT32 IrqBuffserSize
+ IN EFI_ACPI_DESCRIPTION_HEADER *Table,
+ IN UINT32 *IrqBuffer,
+ IN UINT32 IrqBuffserSize,
+ OUT BOOLEAN *IsShortFormPkgLength
)
{
UINT8 *DataPtr;
@@ -431,7 +433,7 @@ UpdatePossibleResource ( //
// Notify _PRS to report short formed ResourceTemplate
//
- mTcgNvs->IsShortFormPkgLength = TRUE;
+ *IsShortFormPkgLength = TRUE;
break;
}
@@ -503,7 +505,7 @@ UpdatePossibleResource ( //
// Notify _PRS to report long formed ResourceTemplate
//
- mTcgNvs->IsShortFormPkgLength = FALSE;
+ *IsShortFormPkgLength = FALSE;
break;
}
}
@@ -672,6 +674,9 @@ PublishAcpiTable ( UINTN TableSize;
UINT32 *PossibleIrqNumBuf;
UINT32 PossibleIrqNumBufSize;
+ BOOLEAN IsShortFormPkgLength;
+
+ IsShortFormPkgLength = FALSE;
Status = GetSectionFromFv (
&gEfiCallerIdGuid,
@@ -710,7 +715,7 @@ PublishAcpiTable ( PossibleIrqNumBufSize = (UINT32)PcdGetSize(PcdTpm2PossibleIrqNumBuf);
if (PossibleIrqNumBufSize <= MAX_PRS_INT_BUF_SIZE && (PossibleIrqNumBufSize % sizeof(UINT32)) == 0) {
- Status = UpdatePossibleResource(Table, PossibleIrqNumBuf, PossibleIrqNumBufSize);
+ Status = UpdatePossibleResource(Table, PossibleIrqNumBuf, PossibleIrqNumBufSize, &IsShortFormPkgLength);
DEBUG ((
DEBUG_INFO,
"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));
ASSERT (mTcgNvs != NULL);
mTcgNvs->TpmIrqNum = PcdGet32(PcdTpm2CurrentIrqNum);
- mTcgNvs->IsShortFormPkgLength = FALSE;
+ mTcgNvs->IsShortFormPkgLength = IsShortFormPkgLength;
//
// Publish the TPM ACPI table. Table is re-checksumed.
|