|
|
|
|
|
by jasonzemos
2306 days ago
|
|
Specifically, the Intel manual makes the following important points, one involving an `mfence;lfence` combo: * If software requires RDTSC to be executed only after all previous instructions have executed and all previous loads are globally visible, it can execute LFENCE immediately before RDTSC. * If software requires RDTSC to be executed only after all previous instructions have executed and all previous loads and stores are globally visible, it can execute the sequence MFENCE;LFENCE immediately before RDTSC. * If software requires RDTSC to be executed prior to execution of any subsequent instruction (including any memory accesses), it can execute the sequence LFENCE immediately after RDTSC. This instruction was introduced by the Pentium processor. rdtscp is usually a bit more disruptive, and cpuid is probably 100 or 1000 times more disruptive. |
|