2 ms·
Besides the fact that now all AMD Zen 4 CPUs have AVX-512, there is one mistake in the text. It is claimed that the only MSR (model-specific register) that can
by adrian_b 3y ago
Besides the fact that now all AMD Zen 4 CPUs have AVX-512, there is one mistake in the text.
It is claimed that the only MSR (model-specific register) that can be read by non-privileged code is the TSC (time-stamp counter). This is wrong. Since Pentium Pro (1995), there is also the non-privileged instruction RDPMC (Read Performance-Monitoring Counters) which reads any of the MSRs that are performance counters, i.e. which are used for benchmarks or for profiling the code.
Moreover, the instruction RDTSCP, already mentioned there (introduced initially in an AMD Opteron family), reads not only the TSC, but also a second MSR, which normally contains a number that identifies the hardware core/thread on which the code is run. This other MSR can also be read separately with the non-privileged instruction RDPID (Read Processor ID).
Recent CPUs may also provide non-privileged access to a few other MSRs, e.g. with RDFSBASE/RDGSBASE (Read FS/GS Segment Base), WRFSBASE/WRGSBASE (Write FS/GS Segment Base), RDPKRU (Read Protection Key Rights for User Pages), WRPKRU (Write Data to User Page Key Register) and others.