TianoCore EDK2 master
|
#include <Protocol/SmmReadyToLock.h>
#include <Library/CpuLib.h>
#include <IndustryStandard/Acpi.h>
#include "SmmProfileArch.h"
Go to the source code of this file.
Data Structures | |
struct | MEMORY_RANGE |
struct | MEMORY_PROTECTION_RANGE |
struct | SMM_PROFILE_HEADER |
struct | SMM_PROFILE_ENTRY |
Macros | |
#define | SMM_PROFILE_DTS_SIZE (4 * 1024 * 1024) |
#define | MAX_PF_PAGE_COUNT 0x2 |
#define | PEBS_RECORD_NUMBER 0x2 |
#define | MAX_PF_ENTRY_COUNT 10 |
#define | IA32_PF_EC_ID (1u << 4) |
#define | SMM_PROFILE_NAME L"SmmProfileData" |
#define | MSR_EFER_XD 0x800 |
#define | CPUID1_EDX_BTS_AVAILABLE 0x200000 |
#define | DR6_SINGLE_STEP 0x4000 |
#define | MSR_DS_AREA 0x600 |
#define | HEAP_GUARD_NONSTOP_MODE ((PcdGet8 (PcdHeapGuardPropertyMask) & (BIT6|BIT3|BIT2)) > BIT6) |
#define | NULL_DETECTION_NONSTOP_MODE ((PcdGet8 (PcdNullPointerDetectionPropertyMask) & (BIT6|BIT1)) > BIT6) |
Functions | |
VOID | InitIdtr (VOID) |
BOOLEAN | IsAddressSplit (IN EFI_PHYSICAL_ADDRESS Address) |
BOOLEAN | IsSmmProfilePFAddressAbove4GValid (IN EFI_PHYSICAL_ADDRESS Address, OUT BOOLEAN *Nx) |
UINT64 | AllocPage (VOID) |
VOID | SmmProfileMapPFAddress (VOID) |
VOID | ClearTrapFlag (IN OUT EFI_SYSTEM_CONTEXT SystemContext) |
Variables | |
UINTN | gSmiExceptionHandlers [] |
BOOLEAN | mXdSupported |
X86_ASSEMBLY_PATCH_LABEL | gPatchXdSupported |
X86_ASSEMBLY_PATCH_LABEL | gPatchMsrIa32MiscEnableSupported |
UINTN * | mPFEntryCount |
UINT64(* | mLastPFEntryValue )[MAX_PF_ENTRY_COUNT] |
UINT64 *(* | mLastPFEntryPointer )[MAX_PF_ENTRY_COUNT] |
SMM profile internal header file.
Copyright (c) 2012 - 2024, Intel Corporation. All rights reserved.
Copyright (c) 2020, AMD Incorporated. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file SmmProfileInternal.h.
#define CPUID1_EDX_BTS_AVAILABLE 0x200000 |
Definition at line 44 of file SmmProfileInternal.h.
#define DR6_SINGLE_STEP 0x4000 |
Definition at line 46 of file SmmProfileInternal.h.
#define HEAP_GUARD_NONSTOP_MODE ((PcdGet8 (PcdHeapGuardPropertyMask) & (BIT6|BIT3|BIT2)) > BIT6) |
Definition at line 50 of file SmmProfileInternal.h.
#define IA32_PF_EC_ID (1u << 4) |
Definition at line 35 of file SmmProfileInternal.h.
#define MAX_PF_ENTRY_COUNT 10 |
Definition at line 28 of file SmmProfileInternal.h.
#define MAX_PF_PAGE_COUNT 0x2 |
Definition at line 24 of file SmmProfileInternal.h.
#define MSR_DS_AREA 0x600 |
Definition at line 48 of file SmmProfileInternal.h.
#define MSR_EFER_XD 0x800 |
Definition at line 42 of file SmmProfileInternal.h.
#define NULL_DETECTION_NONSTOP_MODE ((PcdGet8 (PcdNullPointerDetectionPropertyMask) & (BIT6|BIT1)) > BIT6) |
Definition at line 53 of file SmmProfileInternal.h.
#define PEBS_RECORD_NUMBER 0x2 |
Definition at line 26 of file SmmProfileInternal.h.
#define SMM_PROFILE_DTS_SIZE (4 * 1024 * 1024) |
Definition at line 22 of file SmmProfileInternal.h.
#define SMM_PROFILE_NAME L"SmmProfileData" |
Definition at line 37 of file SmmProfileInternal.h.
UINT64 AllocPage | ( | VOID | ) |
VOID ClearTrapFlag | ( | IN OUT EFI_SYSTEM_CONTEXT | SystemContext | ) |
Clear TF in FLAGS.
SystemContext | A pointer to the processor context when the interrupt occurred on the processor. |
Definition at line 73 of file SmmProfileArch.c.
VOID InitIdtr | ( | VOID | ) |
Update IDT table to replace page fault handler and INT 1 handler.
Replace INT1 exception handler to restore page table to absent/execute-disable state in order to trigger page fault again to save SMM profile data..
Definition at line 1394 of file SmmProfile.c.
BOOLEAN IsAddressSplit | ( | IN EFI_PHYSICAL_ADDRESS | Address | ) |
Check if the memory address will be mapped by 4KB-page.
Address | The address of Memory. |
Definition at line 356 of file SmmProfile.c.
BOOLEAN IsSmmProfilePFAddressAbove4GValid | ( | IN EFI_PHYSICAL_ADDRESS | Address, |
OUT BOOLEAN * | Nx | ||
) |
Check if the SMM profile page fault address above 4GB is in protected range or not.
[in] | Address | The address of Memory. |
[out] | Nx | The flag indicates if the memory is execute-disable. |
TRUE | The input address is in protected range. |
FALSE | The input address is not in protected range. |
Definition at line 328 of file SmmProfile.c.
VOID SmmProfileMapPFAddress | ( | VOID | ) |
Create new entry in page table for page fault address in SmmProfilePFHandler.
Definition at line 85 of file SmmProfileArch.c.
X86_ASSEMBLY_PATCH_LABEL gPatchMsrIa32MiscEnableSupported |
Definition at line 92 of file SmmProfileInternal.h.
X86_ASSEMBLY_PATCH_LABEL gPatchXdSupported |
Definition at line 91 of file SmmProfileInternal.h.
|
extern |
Definition at line 99 of file CpuPageTable.c.
|
extern |
Definition at line 63 of file SmmProfile.c.
|
extern |
Definition at line 98 of file CpuPageTable.c.
|
extern |
Definition at line 31 of file SmmProfile.c.