VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/FirmwareNew/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmmProfileArch.h@ 109019

Last change on this file since 109019 was 108794, checked in by vboxsync, 4 weeks ago

Devices/EFI/FirmwareNew: Merge edk2-stable202502 from the vendor branch and make it build for the important platforms, bugref:4643

  • Property svn:eol-style set to native
File size: 2.1 KB
Line 
1/** @file
2IA-32 processor specific header file to enable SMM profile.
3
4Copyright (c) 2012 - 2024, Intel Corporation. All rights reserved.<BR>
5SPDX-License-Identifier: BSD-2-Clause-Patent
6
7**/
8
9#ifndef _SMM_PROFILE_ARCH_H_
10#define _SMM_PROFILE_ARCH_H_
11
12#pragma pack (1)
13
14typedef struct _MSR_DS_AREA_STRUCT {
15 UINT32 BTSBufferBase;
16 UINT32 BTSIndex;
17 UINT32 BTSAbsoluteMaximum;
18 UINT32 BTSInterruptThreshold;
19 UINT32 PEBSBufferBase;
20 UINT32 PEBSIndex;
21 UINT32 PEBSAbsoluteMaximum;
22 UINT32 PEBSInterruptThreshold;
23 UINT32 PEBSCounterReset[4];
24 UINT32 Reserved;
25} MSR_DS_AREA_STRUCT;
26
27typedef struct _BRANCH_TRACE_RECORD {
28 UINT32 LastBranchFrom;
29 UINT32 LastBranchTo;
30 UINT32 Rsvd0 : 4;
31 UINT32 BranchPredicted : 1;
32 UINT32 Rsvd1 : 27;
33} BRANCH_TRACE_RECORD;
34
35typedef struct _PEBS_RECORD {
36 UINT32 Eflags;
37 UINT32 LinearIP;
38 UINT32 Eax;
39 UINT32 Ebx;
40 UINT32 Ecx;
41 UINT32 Edx;
42 UINT32 Esi;
43 UINT32 Edi;
44 UINT32 Ebp;
45 UINT32 Esp;
46} PEBS_RECORD;
47
48#pragma pack ()
49
50#define PHYSICAL_ADDRESS_MASK ((1ull << 32) - SIZE_4KB)
51
52/**
53 Update page table to map the memory correctly in order to make the instruction
54 which caused page fault execute successfully. And it also save the original page
55 table to be restored in single-step exception. 32-bit firmware does not need it.
56
57 @param PageTable PageTable Address.
58 @param PFAddress The memory address which caused page fault exception.
59 @param CpuIndex The index of the processor.
60 @param ErrorCode The Error code of exception.
61 @param IsValidPFAddress The flag indicates if SMM profile data need be added.
62
63**/
64VOID
65RestorePageTableAbove4G (
66 UINT64 *PageTable,
67 UINT64 PFAddress,
68 UINTN CpuIndex,
69 UINTN ErrorCode,
70 BOOLEAN *IsValidPFAddress
71 );
72
73/**
74 Create SMM page table for S3 path.
75
76 @param[out] Cr3 The base address of the page tables.
77
78**/
79VOID
80InitSmmS3Cr3 (
81 OUT UINTN *Cr3
82 );
83
84/**
85 Allocate pages for creating 4KB-page based on 2MB-page when page fault happens.
86
87**/
88VOID
89InitPagesForPFHandler (
90 VOID
91 );
92
93#endif // _SMM_PROFILE_ARCH_H_
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette