File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -97,6 +97,8 @@ _KeStallExecutionProcessor@4:
9797 * Force the in - order execution of the RDTSC instruction.
9898 * HAL will overwrite this with a no - op instruction on older processors.
9999 * /
100+ PUBLIC _HalpStallExecutionSerialize
101+ _HalpStallExecutionSerialize:
100102 xor eax , eax
101103 cpuid
102104
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ HalpTscCalibrationISR(VOID);
2525
2626extern volatile ULONG TscCalibrationPhase ;
2727extern ULONG64 TscCalibrationArray [NUM_SAMPLES ];
28+ extern UCHAR HalpStallExecutionSerialize ;
2829
2930/* FUNCTIONS *****************************************************************/
3031
@@ -33,7 +34,7 @@ CODE_SEG("INIT")
3334VOID
3435HalpPrepareStallExecution (VOID )
3536{
36- PUCHAR Instruction = ( PUCHAR )(( ULONG_PTR ) KeStallExecutionProcessor + 1 ) ;
37+ PUCHAR Instruction = & HalpStallExecutionSerialize ;
3738 PKPRCB Prcb = KeGetCurrentPrcb ();
3839
3940 /* xor eax, eax; cpuid */
@@ -48,7 +49,7 @@ HalpPrepareStallExecution(VOID)
4849 * Intel "Using the RDTSC Instruction for Performance Monitoring".
4950 *
5051 * Patch the KeStallExecutionProcessor function to remove the serializing instruction
51- * for the Pentium and Pentium MMX processors.
52+ * for the Pentium and Pentium MMX processors because the CPUID instruction is slow .
5253 */
5354 if ((Prcb -> CpuType < 6 ) && !strcmp (Prcb -> VendorString , "GenuineIntel" ))
5455 {
You can’t perform that action at this time.
0 commit comments