TianoCore EDK2 master
|
#include <Register/Intel/Cpuid.h>
#include <Register/Intel/Msr.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/CpuLib.h>
#include <Library/BaseLib.h>
#include <Guid/MigratedFvInfo.h>
#include "CpuMpPei.h"
Go to the source code of this file.
Macros | |
#define | PAGING_4K_ADDRESS_MASK_64 0x000FFFFFFFFFF000ull |
Functions | |
BOOLEAN | IsIa32PaeSupported (VOID) |
VOID * | AllocatePageTableMemory (IN UINTN Pages) |
RETURN_STATUS | ConvertMemoryPageToNotPresent (IN PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length) |
EFI_STATUS | EnablePaePageTable (VOID) |
VOID EFIAPI | GetStackBase (IN OUT VOID *Buffer) |
VOID | SetupStackGuardPage (VOID) |
EFI_STATUS EFIAPI | MemoryDiscoveredPpiNotifyCallback (IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi) |
Variables | |
EFI_PEI_NOTIFY_DESCRIPTOR | mPostMemNotifyList [] |
Basic paging support for the CPU to enable Stack Guard.
Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file CpuPaging.c.
#define PAGING_4K_ADDRESS_MASK_64 0x000FFFFFFFFFF000ull |
Definition at line 18 of file CpuPaging.c.
This API provides a way to allocate memory for page table.
Pages | The number of 4 KB pages to allocate. |
Definition at line 63 of file CpuPaging.c.
This function modifies the page attributes for the memory region specified by BaseAddress and Length to not present. This function only change page table, but not flush TLB. Caller have the responsbility to flush TLB.
Caller should make sure BaseAddress and Length is at page boundary.
[in] | BaseAddress | Start address of a memory region. |
[in] | Length | Size in bytes of the memory region. |
RETURN_SUCCESS | The memory region is changed to not present. |
RETURN_OUT_OF_RESOURCES | There are not enough system resources to modify the attributes. |
RETURN_UNSUPPORTED | Cannot modify the attributes of given memory. |
Definition at line 94 of file CpuPaging.c.
EFI_STATUS EnablePaePageTable | ( | VOID | ) |
Enable PAE Page Table.
EFI_SUCCESS | The PAE Page Table was enabled successfully. |
EFI_OUT_OF_RESOURCES | The PAE Page Table could not be enabled due to lack of available memory. |
Definition at line 182 of file CpuPaging.c.
Get the base address of current AP's stack.
This function is called in AP's context and assumes that whole calling stacks (till this function) consumed by AP's wakeup procedure will not exceed 4KB.
PcdCpuApStackSize must be configured with value taking the Guard page into account.
[in,out] | Buffer | The pointer to private data buffer. |
Definition at line 265 of file CpuPaging.c.
BOOLEAN IsIa32PaeSupported | ( | VOID | ) |
The function will check if IA32 PAE is supported.
TRUE | IA32 PAE is supported. |
FALSE | IA32 PAE is not supported. |
Definition at line 36 of file CpuPaging.c.
EFI_STATUS EFIAPI MemoryDiscoveredPpiNotifyCallback | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN EFI_PEI_NOTIFY_DESCRIPTOR * | NotifyDescriptor, | ||
IN VOID * | Ppi | ||
) |
Enable/setup stack guard for each processor if PcdCpuStackGuard is set to TRUE.
Doing this in the memory-discovered callback is to make sure the Stack Guard feature to cover as most PEI code as possible.
[in] | PeiServices | General purpose services available to every PEIM. |
[in] | NotifyDescriptor | The notification structure this PEIM registered on install. |
[in] | Ppi | The memory discovered PPI. Not used. |
EFI_SUCCESS | The function completed successfully. |
others | There's error in MP initialization. |
Definition at line 372 of file CpuPaging.c.
VOID SetupStackGuardPage | ( | VOID | ) |
Setup stack Guard page at the stack base of each processor. BSP and APs have different way to get stack base address.
Definition at line 287 of file CpuPaging.c.
EFI_PEI_NOTIFY_DESCRIPTOR mPostMemNotifyList[] |
Definition at line 20 of file CpuPaging.c.