]> git.proxmox.com Git - mirror_edk2.git/blame - SecurityPkg/Tcg/Tcg2Smm/Tcg2StandaloneMm.c
SecurityPkg: Apply uncrustify changes
[mirror_edk2.git] / SecurityPkg / Tcg / Tcg2Smm / Tcg2StandaloneMm.c
CommitLineData
8802583c
KQ
1/** @file\r
2 TCG2 Standalone MM driver that updates TPM2 items in ACPI table and registers\r
3 SMI2 callback functions for Tcg2 physical presence, ClearMemory, and\r
4 sample for dTPM StartMethod.\r
5\r
6 Caution: This module requires additional review when modified.\r
7 This driver will have external input - variable and ACPINvs data in SMM mode.\r
8 This external input must be validated carefully to avoid security issue.\r
9\r
10 PhysicalPresenceCallback() and MemoryClearCallback() will receive untrusted input and do some check.\r
11\r
12Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
13Copyright (c) Microsoft Corporation.\r
14SPDX-License-Identifier: BSD-2-Clause-Patent\r
15\r
16**/\r
17\r
18#include "Tcg2Smm.h"\r
19#include <Library/StandaloneMmMemLib.h>\r
20\r
21/**\r
22 Notify the system that the SMM variable driver is ready.\r
23**/\r
24VOID\r
25Tcg2NotifyMmReady (\r
26 VOID\r
27 )\r
28{\r
29 // Do nothing\r
30}\r
31\r
32/**\r
33 This function is an abstraction layer for implementation specific Mm buffer validation routine.\r
34\r
35 @param Buffer The buffer start address to be checked.\r
36 @param Length The buffer length to be checked.\r
37\r
38 @retval TRUE This buffer is valid per processor architecture and not overlap with SMRAM.\r
39 @retval FALSE This buffer is not valid per processor architecture or overlap with SMRAM.\r
40**/\r
41BOOLEAN\r
42IsBufferOutsideMmValid (\r
43 IN EFI_PHYSICAL_ADDRESS Buffer,\r
44 IN UINT64 Length\r
45 )\r
46{\r
47 return MmIsBufferOutsideMmValid (Buffer, Length);\r
48}\r
49\r
50/**\r
51 The driver's entry point.\r
52\r
53 It install callbacks for TPM physical presence and MemoryClear, and locate\r
54 SMM variable to be used in the callback function.\r
55\r
56 @param[in] ImageHandle The firmware allocated handle for the EFI image.\r
57 @param[in] SystemTable A pointer to the EFI System Table.\r
58\r
59 @retval EFI_SUCCESS The entry point is executed successfully.\r
60 @retval Others Some error occurs when executing this entry point.\r
61\r
62**/\r
63EFI_STATUS\r
64EFIAPI\r
65InitializeTcgStandaloneMm (\r
c411b485
MK
66 IN EFI_HANDLE ImageHandle,\r
67 IN EFI_MM_SYSTEM_TABLE *SystemTable\r
8802583c
KQ
68 )\r
69{\r
70 return InitializeTcgCommon ();\r
71}\r