]> git.proxmox.com Git - mirror_edk2.git/blame - UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmmProfileArch.c
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / UefiCpuPkg / PiSmmCpuDxeSmm / Ia32 / SmmProfileArch.c
CommitLineData
7947da3c
MK
1/** @file\r
2IA-32 processor specific functions to enable SMM profile.\r
3\r
717fb604 4Copyright (c) 2012 - 2016, Intel Corporation. All rights reserved.<BR>\r
0acd8697 5SPDX-License-Identifier: BSD-2-Clause-Patent\r
7947da3c
MK
6\r
7**/\r
8\r
9#include "PiSmmCpuDxeSmm.h"\r
10#include "SmmProfileInternal.h"\r
11\r
12/**\r
13 Create SMM page table for S3 path.\r
14\r
15**/\r
16VOID\r
17InitSmmS3Cr3 (\r
18 VOID\r
19 )\r
20{\r
717fb604 21 mSmmS3ResumeState->SmmS3Cr3 = Gen4GPageTable (TRUE);\r
7947da3c 22\r
053e878b 23 return;\r
7947da3c
MK
24}\r
25\r
26/**\r
27 Allocate pages for creating 4KB-page based on 2MB-page when page fault happens.\r
28 32-bit firmware does not need it.\r
29\r
30**/\r
31VOID\r
32InitPagesForPFHandler (\r
33 VOID\r
34 )\r
35{\r
36}\r
37\r
38/**\r
39 Update page table to map the memory correctly in order to make the instruction\r
40 which caused page fault execute successfully. And it also save the original page\r
41 table to be restored in single-step exception. 32-bit firmware does not need it.\r
42\r
43 @param PageTable PageTable Address.\r
44 @param PFAddress The memory address which caused page fault exception.\r
45 @param CpuIndex The index of the processor.\r
46 @param ErrorCode The Error code of exception.\r
47 @param IsValidPFAddress The flag indicates if SMM profile data need be added.\r
48\r
49**/\r
50VOID\r
51RestorePageTableAbove4G (\r
053e878b
MK
52 UINT64 *PageTable,\r
53 UINT64 PFAddress,\r
54 UINTN CpuIndex,\r
55 UINTN ErrorCode,\r
56 BOOLEAN *IsValidPFAddress\r
7947da3c
MK
57 )\r
58{\r
59}\r
60\r
61/**\r
62 Clear TF in FLAGS.\r
63\r
64 @param SystemContext A pointer to the processor context when\r
65 the interrupt occurred on the processor.\r
66\r
67**/\r
68VOID\r
69ClearTrapFlag (\r
053e878b 70 IN OUT EFI_SYSTEM_CONTEXT SystemContext\r
7947da3c
MK
71 )\r
72{\r
73 SystemContext.SystemContextIa32->Eflags &= (UINTN) ~BIT8;\r
74}\r