Port-amd64 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: rdmsr(MSR_TSC) vs rdtsc



> On Mon, Jan 31, 2011 at 11:21:08AM +0100, Manuel Bouyer wrote:
> 
> > I have a i586 CPU where rdmsr(MSR_TSC) doesn't work but rdtsc does.
> > This is easily visible with cpu_get_tsc_freq(): with the current code
> > I get random values as cpu_cc_freq; if I remplace the calls to
> > rdmsr(MSR_TSC) with cpu_counter() I get the right frequency.
> 
> In case it's not clear, rdmsr(MSR_TSC) is intended to be
> serializing, whereas rdtsc need not be.

rdtscp is serializing, too. 

cpuid reports you when you that instruction available:

cpu0: features3 0xebd3fbff<SYSCALL/SYSRET,NOX,MXX,FFXSR,RDTSCP,LONG,3DNOW2>
cpu0: features3 0xebd3fbff<3DNOW>

Christoph


Home | Main Index | Thread Index | Old Index