mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-26 23:24:03 +02:00
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>
This commit is contained in:
parent
559affab2e
commit
a4245b265d
@ -170,81 +170,6 @@ PhysicalPresenceCallback (
|
|||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
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.
|
Notification for SMM ReadyToLock protocol.
|
||||||
|
|
||||||
@ -337,16 +262,6 @@ InitializeTcgCommon (
|
|||||||
|
|
||||||
mPpSoftwareSmi = SwContext.SwSmiInputValue;
|
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.
|
// Locate SmmVariableProtocol.
|
||||||
//
|
//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user