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 | PublishTpm2 (VOID) |
EFI_STATUS EFIAPI | InitializeTcgSmm (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
Variables | |
EFI_TPM2_ACPI_TABLE | mTpm2AcpiTemplate |
EFI_SMM_VARIABLE_PROTOCOL * | mSmmVariable |
TCG_NVS * | mTcgNvs |
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) 2015, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
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. |
References AML_OP_REGION_32_8::BytePrefix, AML_OP_REGION_32_8::DWordPrefix, EFI_STATUS(), AML_OP_REGION_32_8::NameString, AML_OP_REGION_32_8::OpRegionOp, AML_OP_REGION_32_8::RegionLen, AML_OP_REGION_32_8::RegionOffset, and UINTN().
Referenced by PublishAcpiTable().
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. |
References EFI_STATUS(), gEfiTpmDeviceInstanceTpm20DtpmGuid, TCG_NVS::MemoryClear, MemoryClearCallback(), TCG_NVS::PhysicalPresence, PhysicalPresenceCallback(), PublishAcpiTable(), PublishTpm2(), MEMORY_CLEAR_NVS::SoftwareSmi, PHYSICAL_PRESENCE_NVS::SoftwareSmi, and UINTN().
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. |
References ACPI_FUNCTION_DSM_MEMORY_CLEAR_INTERFACE, ACPI_FUNCTION_PTS_CLEAR_MOR_BIT, EFI_STATUS(), TCG_NVS::MemoryClear, MOR_REQUEST_GENERAL_FAILURE, MOR_REQUEST_SUCCESS, MEMORY_CLEAR_NVS::Parameter, MEMORY_CLEAR_NVS::Request, MEMORY_CLEAR_NVS::ReturnCode, and UINTN().
Referenced by InitializeTcgSmm().
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. |
References PHYSICAL_PRESENCE_NVS::LastRequest, PHYSICAL_PRESENCE_NVS::Parameter, TCG_NVS::PhysicalPresence, PHYSICAL_PRESENCE_NVS::Request, PHYSICAL_PRESENCE_NVS::RequestParameter, PHYSICAL_PRESENCE_NVS::Response, PHYSICAL_PRESENCE_NVS::ReturnCode, Tcg2PhysicalPresenceLibGetUserConfirmationStatusFunction(), Tcg2PhysicalPresenceLibReturnOperationResponseToOsFunction(), and Tcg2PhysicalPresenceLibSubmitRequestToPreOSFunction().
Referenced by InitializeTcgSmm().
EFI_STATUS PublishAcpiTable | ( | VOID | ) |
Initialize and publish TPM items in ACPI table.
EFI_SUCCESS | The TCG ACPI table is published successfully. | |
Others | The TCG ACPI table is not published. |
References AssignOpRegion(), EFI_STATUS(), TpmMeasureAndLogData(), and UINTN().
Referenced by InitializeTcgSmm().
EFI_STATUS PublishTpm2 | ( | VOID | ) |
Publish TPM2 ACPI table
EFI_SUCCESS | The TPM2 ACPI table is published successfully. | |
Others | The TPM2 ACPI table is not published. |
References EFI_STATUS(), mTpm2AcpiTemplate, TpmMeasureAndLogData(), and UINTN().
Referenced by InitializeTcgSmm().
EFI_SMM_VARIABLE_PROTOCOL* mSmmVariable |
EFI_TPM2_ACPI_TABLE mTpm2AcpiTemplate |
Initial value:
{ { EFI_ACPI_5_0_TRUSTED_COMPUTING_PLATFORM_2_TABLE_SIGNATURE, sizeof (mTpm2AcpiTemplate), EFI_TPM2_ACPI_TABLE_REVISION, }, 0, 0, EFI_TPM2_ACPI_TABLE_START_METHOD_TIS, }
Referenced by PublishTpm2().