2 TCG2 SMM driver that updates TPM2 items in ACPI table and registers
3 SMI2 callback functions for Tcg2 physical presence, ClearMemory, and
4 sample for dTPM StartMethod.
6 Caution: This module requires additional review when modified.
7 This driver will have external input - variable and ACPINvs data in SMM mode.
8 This external input must be validated carefully to avoid security issue.
10 PhysicalPresenceCallback() and MemoryClearCallback() will receive untrusted input and do some check.
12 Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
13 Copyright (c) Microsoft Corporation.
14 SPDX-License-Identifier: BSD-2-Clause-Patent
19 #include <Library/UefiBootServicesTableLib.h>
20 #include <Library/SmmMemLib.h>
23 Notify the system that the SMM variable driver is ready.
34 Status
= gBS
->InstallProtocolInterface (
36 &gTcg2MmSwSmiRegisteredGuid
,
40 ASSERT_EFI_ERROR (Status
);
44 This function is an abstraction layer for implementation specific Mm buffer validation routine.
46 @param Buffer The buffer start address to be checked.
47 @param Length The buffer length to be checked.
49 @retval TRUE This buffer is valid per processor architecture and not overlap with SMRAM.
50 @retval FALSE This buffer is not valid per processor architecture or overlap with SMRAM.
53 IsBufferOutsideMmValid (
54 IN EFI_PHYSICAL_ADDRESS Buffer
,
58 return SmmIsBufferOutsideSmmValid (Buffer
, Length
);
62 The driver's entry point.
64 It install callbacks for TPM physical presence and MemoryClear, and locate
65 SMM variable to be used in the callback function.
67 @param[in] ImageHandle The firmware allocated handle for the EFI image.
68 @param[in] SystemTable A pointer to the EFI System Table.
70 @retval EFI_SUCCESS The entry point is executed successfully.
71 @retval Others Some error occurs when executing this entry point.
77 IN EFI_HANDLE ImageHandle
,
78 IN EFI_SYSTEM_TABLE
*SystemTable
81 return InitializeTcgCommon ();