KiRestoreFeatureBits
VOID __stdcall KiRestoreFeatureBits(){
struct _KPRCB *CurrentPrcb;
char v1;
unsigned __int64 v2;
unsigned __int64 v3;
CurrentPrcb = KeGetCurrentPrcb();
if( *((_BYTE *)CurrentPrcb + 141) == 2 )
__writemsr(0x1A0u, KiIa32MiscEnable);
if( (*((_QWORD *)CurrentPrcb + 4276) & 0x400000000i64) != 0 )
__writemsr(
0xC0000103,
*((unsigned __int8 *)CurrentPrcb + 209) | ((unsigned __int64)*((unsigned __int8 *)CurrentPrcb + 208) << 8));
if( *((_BYTE *)CurrentPrcb + 250) || (KeFeatureBits2 & 0x600) != 0 )
__writemsr(0x48u, *((unsigned __int8 *)CurrentPrcb + 250));
if( (KeFeatureBits2 & 0x8000) != 0 )
__writemsr(0x122u, *((_QWORD *)CurrentPrcb + 1440));
KeInitializeCatRegisters();
__writemsr(0x174u, 0i64);
__writemsr(0x176u, 0i64);
__writemsr(0x175u, 0i64);
if( *((_BYTE *)CurrentPrcb + 141) == 1 )
{
v1 = *((_BYTE *)CurrentPrcb + 64);
if( v1 > 15 && v1 != 17 && !(unsigned __int8)HviIsAnyHypervisorPresent() )
__writemsr(0xC0011029, __readmsr(0xC0011029) | 2);
}
if( KiFlushPcid && !VslVsmEnabled )
{
v2 = __readcr3();
__writecr3(v2 | 2);
}
KiCheckMicrocode((INT64)CurrentPrcb);
if( KiUserCetAllowed )
{
v3 = __readcr4();
__writecr4(v3 | 0x800000);
}
}Referenced by:
KeRestoreProcessorSpecificFeatures