TianoCore EDK2 master
|
#include "PiSmmCpuCommon.h"
Go to the source code of this file.
Macros | |
#define | PAGE_TABLE_PAGES 8 |
#define | ACC_MAX_BIT BIT3 |
Functions | |
BOOLEAN | Is1GPageSupport (VOID) |
BOOLEAN | Is5LevelPagingNeeded (VOID) |
VOID | SetSubEntriesNum (IN OUT UINT64 *Entry, IN UINT64 SubEntryNum) |
UINT64 | GetSubEntriesNum (IN UINT64 *Entry) |
UINT8 | CalculateMaximumSupportAddress (BOOLEAN Is5LevelPagingNeeded) |
UINT32 | SmmInitPageTable (VOID) |
VOID | SetAccNum (IN OUT UINT64 *Entry, IN UINT64 Acc) |
UINT64 | GetAccNum (IN UINT64 *Entry) |
UINT64 | GetAndUpdateAccNum (IN OUT UINT64 *Entry) |
VOID | ReclaimPages (VOID) |
UINT64 | AllocPage (VOID) |
VOID EFIAPI | SmiPFHandler (IN EFI_EXCEPTION_TYPE InterruptType, IN EFI_SYSTEM_CONTEXT SystemContext) |
VOID | SaveCr2 (OUT UINTN *Cr2) |
VOID | RestoreCr2 (IN UINTN Cr2) |
Variables | |
LIST_ENTRY | mPagePool = INITIALIZE_LIST_HEAD_VARIABLE (mPagePool) |
BOOLEAN | m1GPageTableSupport = FALSE |
X86_ASSEMBLY_PATCH_LABEL | gPatch5LevelPagingNeeded |
Page Fault (#PF) handler for X64 processors
Copyright (c) 2009 - 2024, Intel Corporation. All rights reserved.
Copyright (c) 2017, AMD Incorporated. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file PageTbl.c.
UINT64 AllocPage | ( | VOID | ) |
UINT8 CalculateMaximumSupportAddress | ( | BOOLEAN | Is5LevelPagingNeeded | ) |
UINT64 GetAccNum | ( | IN UINT64 * | Entry | ) |
UINT64 GetSubEntriesNum | ( | IN UINT64 * | Entry | ) |
BOOLEAN Is1GPageSupport | ( | VOID | ) |
BOOLEAN Is5LevelPagingNeeded | ( | VOID | ) |
The routine returns TRUE when CPU supports it (CPUID[7,0].ECX.BIT[16] is set) and the max physical address bits is bigger than 48. Because 4-level paging can support to address physical address up to 2^48 - 1, there is no need to enable 5-level paging with max physical address bits <= 48.
TRUE | 5-level paging enabling is needed. |
FALSE | 5-level paging enabling is not needed. |
VOID ReclaimPages | ( | VOID | ) |
Reclaim free pages for PageFault handler.
Search the whole entries tree to find the leaf entry that has the smallest access record value. Insert the page pointed by this leaf entry into the page pool. And check its upper entries if need to be inserted into the page pool or not.
VOID EFIAPI SmiPFHandler | ( | IN EFI_EXCEPTION_TYPE | InterruptType, |
IN EFI_SYSTEM_CONTEXT | SystemContext | ||
) |
ThePage Fault handler wrapper for SMM use.
InterruptType | Defines the type of interrupt or exception that occurred on the processor.This parameter is processor architecture specific. |
SystemContext | A pointer to the processor context when the interrupt occurred on the processor. |
UINT32 SmmInitPageTable | ( | VOID | ) |
LIST_ENTRY mPagePool = INITIALIZE_LIST_HEAD_VARIABLE (mPagePool) |