TianoCore EDK2 master
Loading...
Searching...
No Matches
SmmProfileArch.h File Reference

Go to the source code of this file.

Data Structures

struct  _MSR_DS_AREA_STRUCT
 
struct  _BRANCH_TRACE_RECORD
 
struct  _PEBS_RECORD
 

Macros

#define PHYSICAL_ADDRESS_MASK   ((1ull << 52) - SIZE_4KB)
 

Typedefs

typedef struct _MSR_DS_AREA_STRUCT MSR_DS_AREA_STRUCT
 
typedef struct _BRANCH_TRACE_RECORD BRANCH_TRACE_RECORD
 
typedef struct _PEBS_RECORD PEBS_RECORD
 

Functions

VOID RestorePageTableAbove4G (UINT64 *PageTable, UINT64 PFAddress, UINTN CpuIndex, UINTN ErrorCode, BOOLEAN *IsValidPFAddress)
 
VOID InitSmmS3Cr3 (OUT UINTN *Cr3)
 
VOID InitPagesForPFHandler (VOID)
 
VOID SetSubEntriesNum (IN OUT UINT64 *Entry, IN UINT64 SubEntryNum)
 
UINT64 GetSubEntriesNum (IN UINT64 *Entry)
 
UINT64 AllocPage (VOID)
 
VOID SetAccNum (IN OUT UINT64 *Entry, IN UINT64 Acc)
 

Variables

BOOLEAN m1GPageTableSupport
 

Detailed Description

X64 processor specific header file to enable SMM profile.

Copyright (c) 2012 - 2024, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file SmmProfileArch.h.

Macro Definition Documentation

◆ PHYSICAL_ADDRESS_MASK

#define PHYSICAL_ADDRESS_MASK   ((1ull << 52) - SIZE_4KB)

Definition at line 60 of file SmmProfileArch.h.

Function Documentation

◆ AllocPage()

UINT64 AllocPage ( VOID  )

Allocate free Page for PageFault handler use.

Returns
Page address.

Definition at line 76 of file PageTbl.c.

◆ GetSubEntriesNum()

UINT64 GetSubEntriesNum ( IN UINT64 *  Entry)

Return sub-entries number in entry.

Parameters
[in]EntryPointer to entry
Returns
Sub-entries number based on 0: 0 means there is 1 sub-entry under this entry 0x1ff means there is 512 sub-entries under this entry

Definition at line 126 of file PageTbl.c.

◆ InitPagesForPFHandler()

VOID InitPagesForPFHandler ( VOID  )

Allocate pages for creating 4KB-page based on 2MB-page when page fault happens.

Allocate pages for creating 4KB-page based on 2MB-page when page fault happens. 32-bit firmware does not need it.

Definition at line 36 of file SmmProfileArch.c.

◆ InitSmmS3Cr3()

VOID InitSmmS3Cr3 ( OUT UINTN Cr3)

Create SMM page table for S3 path.

Parameters
[out]Cr3The base address of the page tables.

Definition at line 19 of file SmmProfileArch.c.

◆ RestorePageTableAbove4G()

VOID RestorePageTableAbove4G ( UINT64 *  PageTable,
UINT64  PFAddress,
UINTN  CpuIndex,
UINTN  ErrorCode,
BOOLEAN *  IsValidPFAddress 
)

Update page table to map the memory correctly in order to make the instruction which caused page fault execute successfully. And it also save the original page table to be restored in single-step exception.

Parameters
PageTablePageTable Address.
PFAddressThe memory address which caused page fault exception.
CpuIndexThe index of the processor.
ErrorCodeThe Error code of exception.
IsValidPFAddressThe flag indicates if SMM profile data need be added.

Update page table to map the memory correctly in order to make the instruction which caused page fault execute successfully. And it also save the original page table to be restored in single-step exception. 32-bit firmware does not need it.

Parameters
PageTablePageTable Address.
PFAddressThe memory address which caused page fault exception.
CpuIndexThe index of the processor.
ErrorCodeThe Error code of exception.
IsValidPFAddressThe flag indicates if SMM profile data need be added.

Definition at line 55 of file SmmProfileArch.c.

◆ SetAccNum()

VOID SetAccNum ( IN OUT UINT64 *  Entry,
IN UINT64  Acc 
)

Set access record in entry.

Parameters
[in,out]EntryPointer to entry
[in]AccAccess record value

Definition at line 333 of file PageTbl.c.

◆ SetSubEntriesNum()

VOID SetSubEntriesNum ( IN OUT UINT64 *  Entry,
IN UINT64  SubEntryNum 
)

Set sub-entries number in entry.

Parameters
[in,out]EntryPointer to entry
[in]SubEntryNumSub-entries number based on 0: 0 means there is 1 sub-entry under this entry 0x1ff means there is 512 sub-entries under this entry

Definition at line 105 of file PageTbl.c.

Variable Documentation

◆ m1GPageTableSupport

BOOLEAN m1GPageTableSupport
extern

Definition at line 17 of file PageTbl.c.