TianoCore EDK2 master
Loading...
Searching...
No Matches
LimitCpuIdMaxval.c
Go to the documentation of this file.
1
9#include "CpuCommonFeatures.h"
10
27BOOLEAN
28EFIAPI
30 IN UINTN ProcessorNumber,
32 IN VOID *ConfigData OPTIONAL
33 )
34{
35 UINT32 Eax;
36
38 return (Eax > 2);
39}
40
58RETURN_STATUS
59EFIAPI
61 IN UINTN ProcessorNumber,
63 IN VOID *ConfigData OPTIONAL,
64 IN BOOLEAN State
65 )
66{
67 //
68 // The scope of LimitCpuidMaxval bit in the MSR_IA32_MISC_ENABLE is core for below
69 // processor type, only program MSR_IA32_MISC_ENABLE for thread 0 in each core.
70 //
71 if (IS_PENTIUM_4_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) ||
72 IS_SILVERMONT_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) ||
73 IS_GOLDMONT_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) ||
74 IS_CORE_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) ||
75 IS_CORE2_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel))
76 {
77 if (CpuInfo->ProcessorInfo.Location.Thread != 0) {
78 return RETURN_SUCCESS;
79 }
80 }
81
83 ProcessorNumber,
84 Msr,
87 Bits.LimitCpuidMaxval,
88 (State) ? 1 : 0
89 );
90 return RETURN_SUCCESS;
91}
UINT64 UINTN
#define IS_CORE2_PROCESSOR(DisplayFamily, DisplayModel)
Definition: Core2Msr.h:32
#define IS_CORE_PROCESSOR(DisplayFamily, DisplayModel)
Definition: CoreMsr.h:32
#define IS_GOLDMONT_PROCESSOR(DisplayFamily, DisplayModel)
Definition: GoldmontMsr.h:32
BOOLEAN EFIAPI LimitCpuidMaxvalSupport(IN UINTN ProcessorNumber, IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo, IN VOID *ConfigData OPTIONAL)
RETURN_STATUS EFIAPI LimitCpuidMaxvalInitialize(IN UINTN ProcessorNumber, IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo, IN VOID *ConfigData OPTIONAL, IN BOOLEAN State)
#define NULL
Definition: Base.h:319
#define RETURN_SUCCESS
Definition: Base.h:1066
#define IN
Definition: Base.h:279
#define MSR_IA32_MISC_ENABLE
#define CPUID_SIGNATURE
Definition: Cpuid.h:45
UINT32 EFIAPI AsmCpuid(IN UINT32 Index, OUT UINT32 *RegisterEax OPTIONAL, OUT UINT32 *RegisterEbx OPTIONAL, OUT UINT32 *RegisterEcx OPTIONAL, OUT UINT32 *RegisterEdx OPTIONAL)
Definition: CpuId.c:36
#define IS_PENTIUM_4_PROCESSOR(DisplayFamily, DisplayModel)
Definition: Pentium4Msr.h:32
#define CPU_REGISTER_TABLE_WRITE_FIELD(ProcessorNumber, RegisterType, Index, Type, Field, Value)
#define IS_SILVERMONT_PROCESSOR(DisplayFamily, DisplayModel)
Definition: SilvermontMsr.h:32