Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What platforms disable rdtsc for userspace? What accuracy issues do you think it has?


rdtsc instruction access is gated by a permission bit. Sometimes it's allowed from userspace, sometimes it's not. There were issues with it in the past, I forget which off the top of my head.

It's also not as accurate as a the High Precision timer (HPET). I'm not sure which platforms gate/expose which these days but it's a grab bag.


Personally I'm not aware of any platform blocking rdtsc, so I was curious to learn which ones do.


> It's also not as accurate as a the High Precision timer (HPET)

This hasn't been true for about 10 years.


You're right, I was thinking about the interrupt precision over the default APIC timer.

My point about it being disabled on some platforms has historically been true, however.


I think you're confusing this and the kernel's blacklisting of the TSC for timekeeping if it is not synchronized across CPUs; but while there's a knob to block userspace's access to the TSC, I am not sure that has been used anywhere except for debugging reasons (e.g. record/replay).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: