TianoCore EDK2 master
|
#include "TcgSmm.h"
Go to the source code of this file.
Functions | |
EFI_STATUS EFIAPI | PhysicalPresenceCallback (IN EFI_HANDLE DispatchHandle, IN CONST VOID *Context, IN OUT VOID *CommBuffer, IN OUT UINTN *CommBufferSize) |
EFI_STATUS EFIAPI | MemoryClearCallback (IN EFI_HANDLE DispatchHandle, IN CONST VOID *Context, IN OUT VOID *CommBuffer, IN OUT UINTN *CommBufferSize) |
VOID * | AssignOpRegion (EFI_ACPI_DESCRIPTION_HEADER *Table, UINT32 Name, UINT16 Size) |
EFI_STATUS | PublishAcpiTable (VOID) |
EFI_STATUS EFIAPI | InitializeTcgSmm (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
Variables | |
EFI_SMM_VARIABLE_PROTOCOL * | mSmmVariable |
TCG_NVS * | mTcgNvs |
It updates TPM items in ACPI table and registers SMI callback functions for physical presence and ClearMemory.
Caution: This module requires additional review when modified. This driver will have external input - variable and ACPINvs data in SMM mode. This external input must be validated carefully to avoid security issue.
PhysicalPresenceCallback() and MemoryClearCallback() will receive untrusted input and do some check.
Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file TcgSmm.c.
VOID * AssignOpRegion | ( | EFI_ACPI_DESCRIPTION_HEADER * | Table, |
UINT32 | Name, | ||
UINT16 | Size | ||
) |
Find the operation region in TCG ACPI table by given Name and Size, and initialize it if the region is found.
[in,out] | Table | The TPM item in ACPI table. |
[in] | Name | The name string to find in TPM table. |
[in] | Size | The size of the region to find. |
EFI_STATUS EFIAPI InitializeTcgSmm | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
The driver's entry point.
It install callbacks for TPM physical presence and MemoryClear, and locate SMM variable to be used in the callback function.
[in] | ImageHandle | The firmware allocated handle for the EFI image. |
[in] | SystemTable | A pointer to the EFI System Table. |
EFI_SUCCESS | The entry point is executed successfully. |
Others | Some error occurs when executing this entry point. |
EFI_STATUS EFIAPI MemoryClearCallback | ( | IN EFI_HANDLE | DispatchHandle, |
IN CONST VOID * | Context, | ||
IN OUT VOID * | CommBuffer, | ||
IN OUT UINTN * | CommBufferSize | ||
) |
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.
[in] | DispatchHandle | The unique handle assigned to this handler by SmiHandlerRegister(). |
[in] | Context | Points to an optional handler context which was specified when the handler was registered. |
[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. |
[in,out] | CommBufferSize | The size of the CommBuffer. |
EFI_SUCCESS | The interrupt was handled successfully. |
EFI_STATUS EFIAPI PhysicalPresenceCallback | ( | IN EFI_HANDLE | DispatchHandle, |
IN CONST VOID * | Context, | ||
IN OUT VOID * | CommBuffer, | ||
IN OUT UINTN * | CommBufferSize | ||
) |
Software SMI callback for TPM physical presence 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.
[in] | DispatchHandle | The unique handle assigned to this handler by SmiHandlerRegister(). |
[in] | Context | Points to an optional handler context which was specified when the handler was registered. |
[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. |
[in,out] | CommBufferSize | The size of the CommBuffer. |
EFI_SUCCESS | The interrupt was handled successfully. |
EFI_STATUS PublishAcpiTable | ( | VOID | ) |
EFI_SMM_VARIABLE_PROTOCOL* mSmmVariable |