summaryrefslogtreecommitdiffstats
path: root/SecurityPkg/Tcg
diff options
context:
space:
mode:
authorJohn Strange <johnstra@microsoft.com>2024-07-04 08:49:55 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-09-04 01:43:32 +0000
commita4245b265de78dd0640004263f0b39da7d5a0506 (patch)
tree65271558c77beef8e32987cbd4119b68dd22cb54 /SecurityPkg/Tcg
parent559affab2e82aba4e0819d299d5a8de03e276af6 (diff)
downloadedk2-a4245b265de78dd0640004263f0b39da7d5a0506.tar.gz
edk2-a4245b265de78dd0640004263f0b39da7d5a0506.tar.bz2
edk2-a4245b265de78dd0640004263f0b39da7d5a0506.zip
SecurityPkg: Tcg2Smm: Remove Memory Clear SMI Handler
Remove unused MemoryClear SMI Handler, which is no longer used due to _DSM Memory Clear no longer being used. _DSM Memory Clear was deprecated in 2019 by TCG PC Client Platform Reset Attack Mitigation Spec Version 1.10 revision 17 Family "2.0". Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
Diffstat (limited to 'SecurityPkg/Tcg')
-rw-r--r--SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c85
1 files changed, 0 insertions, 85 deletions
diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
index 0c2799b42a..d4a4149ae4 100644
--- a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
+++ b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
@@ -171,81 +171,6 @@ PhysicalPresenceCallback (
}
/**
- Software SMI callback for MemoryClear which is called from ACPI method.
-
- Caution: This function may receive untrusted input.
- Variable and ACPINvs are external input, so this function will validate
- its data structure to be valid value.
-
- @param[in] DispatchHandle The unique handle assigned to this handler by SmiHandlerRegister().
- @param[in] Context Points to an optional handler context which was specified when the
- handler was registered.
- @param[in, out] CommBuffer A pointer to a collection of data in memory that will
- be conveyed from a non-SMM environment into an SMM environment.
- @param[in, out] CommBufferSize The size of the CommBuffer.
-
- @retval EFI_SUCCESS The interrupt was handled successfully.
-
-**/
-EFI_STATUS
-EFIAPI
-MemoryClearCallback (
- IN EFI_HANDLE DispatchHandle,
- IN CONST VOID *Context,
- IN OUT VOID *CommBuffer,
- IN OUT UINTN *CommBufferSize
- )
-{
- EFI_STATUS Status;
- UINTN DataSize;
- UINT8 MorControl;
-
- mTcgNvs->MemoryClear.ReturnCode = MOR_REQUEST_SUCCESS;
- if (mTcgNvs->MemoryClear.Parameter == ACPI_FUNCTION_DSM_MEMORY_CLEAR_INTERFACE) {
- MorControl = (UINT8)mTcgNvs->MemoryClear.Request;
- } else if (mTcgNvs->MemoryClear.Parameter == ACPI_FUNCTION_PTS_CLEAR_MOR_BIT) {
- DataSize = sizeof (UINT8);
- Status = mSmmVariable->SmmGetVariable (
- MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME,
- &gEfiMemoryOverwriteControlDataGuid,
- NULL,
- &DataSize,
- &MorControl
- );
- if (EFI_ERROR (Status)) {
- mTcgNvs->MemoryClear.ReturnCode = MOR_REQUEST_GENERAL_FAILURE;
- DEBUG ((DEBUG_ERROR, "[TPM] Get MOR variable failure! Status = %r\n", Status));
- return EFI_SUCCESS;
- }
-
- if (MOR_CLEAR_MEMORY_VALUE (MorControl) == 0x0) {
- return EFI_SUCCESS;
- }
-
- MorControl &= ~MOR_CLEAR_MEMORY_BIT_MASK;
- } else {
- mTcgNvs->MemoryClear.ReturnCode = MOR_REQUEST_GENERAL_FAILURE;
- DEBUG ((DEBUG_ERROR, "[TPM] MOR Parameter error! Parameter = %x\n", mTcgNvs->MemoryClear.Parameter));
- return EFI_SUCCESS;
- }
-
- DataSize = sizeof (UINT8);
- Status = mSmmVariable->SmmSetVariable (
- MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME,
- &gEfiMemoryOverwriteControlDataGuid,
- EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
- DataSize,
- &MorControl
- );
- if (EFI_ERROR (Status)) {
- mTcgNvs->MemoryClear.ReturnCode = MOR_REQUEST_GENERAL_FAILURE;
- DEBUG ((DEBUG_ERROR, "[TPM] Set MOR variable failure! Status = %r\n", Status));
- }
-
- return EFI_SUCCESS;
-}
-
-/**
Notification for SMM ReadyToLock protocol.
@param[in] Protocol Points to the protocol's unique identifier.
@@ -337,16 +262,6 @@ InitializeTcgCommon (
mPpSoftwareSmi = SwContext.SwSmiInputValue;
- SwContext.SwSmiInputValue = (UINTN)-1;
- Status = SwDispatch->Register (SwDispatch, MemoryClearCallback, &SwContext, &McSwHandle);
- ASSERT_EFI_ERROR (Status);
- if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "[%a] Failed to register MC callback as SW MM handler - %r!\n", __func__, Status));
- goto Cleanup;
- }
-
- mMcSoftwareSmi = SwContext.SwSmiInputValue;
-
//
// Locate SmmVariableProtocol.
//