[NTOS:KE/X64] Move initialization of keFeatureBits

This commit is contained in:
Timo Kreuzer
2025-05-04 02:14:01 +03:00
parent 55b3e641ef
commit f4fd842be1
2 changed files with 5 additions and 6 deletions

View File

@@ -346,7 +346,7 @@ KiInitializeKernelMachineDependent(
IN PKPRCB Prcb,
IN PLOADER_PARAMETER_BLOCK LoaderBlock)
{
ULONG64 FeatureBits;
ULONG64 FeatureBits = KeFeatureBits;
/* Set boot-level flags */
KeI386CpuType = Prcb->CpuType;
@@ -356,8 +356,6 @@ KiInitializeKernelMachineDependent(
if (Prcb->CpuID)
KeProcessorRevision = Prcb->CpuStep;
FeatureBits = Prcb->FeatureBits | (ULONG64)Prcb->FeatureBitsHigh << 32;
/* Set basic CPU Features that user mode can read */
SharedUserData->ProcessorFeatures[PF_FLOATING_POINT_PRECISION_ERRATA] = FALSE;
SharedUserData->ProcessorFeatures[PF_FLOATING_POINT_EMULATED] = FALSE;
@@ -522,6 +520,10 @@ KiSystemStartup(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
/* Initial setup for the boot CPU */
if (Cpu == 0)
{
/* Set global feature bits */
KeFeatureBits = (ULONG64)Pcr->Prcb.FeatureBitsHigh << 32 |
Pcr->Prcb.FeatureBits;
/* Initialize the module list (ntos, hal, kdcom) */
KiInitModuleList(LoaderBlock);

View File

@@ -232,9 +232,6 @@ KiInitializeKernel(IN PKPROCESS InitProcess,
PVOID DpcStack;
ULONG i;
/* Set boot-level flags */
KeFeatureBits = Prcb->FeatureBits | (ULONG64)Prcb->FeatureBitsHigh << 32;
/* Initialize 8/16 bit SList support */
RtlpUse16ByteSLists = (KeFeatureBits & KF_CMPXCHG16B) ? TRUE : FALSE;