]>
Commit | Line | Data |
---|---|---|
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 | |
12 | Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r | |
13 | Copyright (c) Microsoft Corporation.\r | |
14 | SPDX-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 | |
24 | VOID\r | |
25 | Tcg2NotifyMmReady (\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 | |
41 | BOOLEAN\r | |
42 | IsBufferOutsideMmValid (\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 | |
63 | EFI_STATUS\r | |
64 | EFIAPI\r | |
65 | InitializeTcgStandaloneMm (\r | |
66 | IN EFI_HANDLE ImageHandle,\r | |
67 | IN EFI_MM_SYSTEM_TABLE *SystemTable\r | |
68 | )\r | |
69 | {\r | |
70 | return InitializeTcgCommon ();\r | |
71 | }\r |