]> git.proxmox.com Git - mirror_edk2.git/blame - UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.h
UefiCpuPkg/PiSmmCpuDxeSmm: Check XD/BTS features in SMM relocation
[mirror_edk2.git] / UefiCpuPkg / PiSmmCpuDxeSmm / SmmProfile.h
CommitLineData
529a5a86
MK
1/** @file\r
2SMM profile header file.\r
3\r
d691abec 4Copyright (c) 2012 - 2016, Intel Corporation. All rights reserved.<BR>\r
529a5a86
MK
5This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef _SMM_PROFILE_H_\r
16#define _SMM_PROFILE_H_\r
17\r
18#include "SmmProfileInternal.h"\r
19\r
529a5a86
MK
20//\r
21// External functions\r
22//\r
23\r
24/**\r
25 Initialize processor environment for SMM profile.\r
26\r
27 @param CpuIndex The index of the processor.\r
28\r
29**/\r
30VOID\r
31ActivateSmmProfile (\r
32 IN UINTN CpuIndex\r
33 );\r
34\r
35/**\r
36 Initialize SMM profile in SMM CPU entry point.\r
37\r
38 @param[in] Cr3 The base address of the page tables to use in SMM.\r
39\r
40**/\r
41VOID\r
42InitSmmProfile (\r
43 UINT32 Cr3\r
44 );\r
45\r
46/**\r
47 Increase SMI number in each SMI entry.\r
48\r
49**/\r
50VOID\r
51SmmProfileRecordSmiNum (\r
52 VOID\r
53 );\r
54\r
55/**\r
56 The Page fault handler to save SMM profile data.\r
57\r
58 @param Rip The RIP when exception happens.\r
59 @param ErrorCode The Error code of exception.\r
60\r
61**/\r
62VOID\r
63SmmProfilePFHandler (\r
64 UINTN Rip,\r
65 UINTN ErrorCode\r
66 );\r
67\r
68/**\r
69 Updates page table to make some memory ranges (like system memory) absent\r
70 and make some memory ranges (like MMIO) present and execute disable. It also\r
71 update 2MB-page to 4KB-page for some memory ranges.\r
72\r
73**/\r
74VOID\r
75SmmProfileStart (\r
76 VOID\r
77 );\r
78\r
79/**\r
80 Page fault IDT handler for SMM Profile.\r
81\r
82**/\r
83VOID\r
84EFIAPI\r
85PageFaultIdtHandlerSmmProfile (\r
86 VOID\r
87 );\r
88\r
89\r
90/**\r
91 Check if XD feature is supported by a processor.\r
92\r
d691abec
MK
93 @param[in,out] Buffer The pointer to private data buffer.\r
94\r
529a5a86
MK
95**/\r
96VOID\r
d691abec 97EFIAPI\r
529a5a86 98CheckFeatureSupported (\r
d691abec 99 IN OUT VOID *Buffer\r
529a5a86
MK
100 );\r
101\r
102/**\r
103 Enable XD feature.\r
104\r
105**/\r
106VOID\r
107ActivateXd (\r
108 VOID\r
109 );\r
110\r
111/**\r
112 Update page table according to protected memory ranges and the 4KB-page mapped memory ranges.\r
113\r
114**/\r
115VOID\r
116InitPaging (\r
117 VOID\r
118 );\r
119\r
120/**\r
121 Check if XD and BTS features are supported by all processors.\r
122\r
123**/\r
124VOID\r
125CheckProcessorFeature (\r
126 VOID\r
127 );\r
128\r
129extern BOOLEAN mXdSupported;\r
130extern BOOLEAN mXdEnabled;\r
131\r
132#endif // _SMM_PROFILE_H_\r