2 X64 processor specific header file to enable SMM profile.
4 Copyright (c) 2012 - 2015, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef _SMM_PROFILE_ARCH_H_
16 #define _SMM_PROFILE_ARCH_H_
20 typedef struct _MSR_DS_AREA_STRUCT
{
23 UINT64 BTSAbsoluteMaximum
;
24 UINT64 BTSInterruptThreshold
;
25 UINT64 PEBSBufferBase
;
27 UINT64 PEBSAbsoluteMaximum
;
28 UINT64 PEBSInterruptThreshold
;
29 UINT64 PEBSCounterReset
[2];
33 typedef struct _BRANCH_TRACE_RECORD
{
34 UINT64 LastBranchFrom
;
37 UINT64 BranchPredicted
: 1;
39 } BRANCH_TRACE_RECORD
;
41 typedef struct _PEBS_RECORD
{
64 #define PHYSICAL_ADDRESS_MASK ((1ull << 52) - SIZE_4KB)
67 Update page table to map the memory correctly in order to make the instruction
68 which caused page fault execute successfully. And it also save the original page
69 table to be restored in single-step exception.
71 @param PageTable PageTable Address.
72 @param PFAddress The memory address which caused page fault exception.
73 @param CpuIndex The index of the processor.
74 @param ErrorCode The Error code of exception.
75 @param IsValidPFAddress The flag indicates if SMM profile data need be added.
79 RestorePageTableAbove4G (
84 BOOLEAN
*IsValidPFAddress
88 Create SMM page table for S3 path.
97 Allocate pages for creating 4KB-page based on 2MB-page when page fault happens.
101 InitPagesForPFHandler (
105 #endif // _SMM_PROFILE_ARCH_H_