3 ms·
Just masking the lower bits is not enough: you can easily reconstruct a high-precision timer from that by observing the clock edges (waiting until rtdsc increas
by bennofs 9y ago
Just masking the lower bits is not enough: you can easily reconstruct a high-precision timer from that by observing the clock edges (waiting until rtdsc increases): wait for clock edge, do your experiment, increase counter until next clode edge in busy loop. the counter now correlates strongly with the amount of time taken for the experiment.
Also, while cache flushes are the easiest way to trigger this, I am not convinced that there aren't other ways to do it. For example, you could attempt to clear the cache by spamming it with new data to cache, or you could try to use one of the other sidechannels (I've seen ALU ports being mentioned as one alternative: instead of accessing cache lines, you do some heavy math operations that will cause the ALU ports of the cpu to be used and then you observe how long ALU operations take in userspace)