Re: MTIME update frequency

Ved Shanbhogue

On Sat, Nov 13, 2021 at 02:09:34AM +0100, Heinrich Schuchardt wrote:

On 11/12/21 20:39, Vedvyas Shanbhogue wrote:
I have a question about this requirement:
"The ACLINT MTIME update frequency (i.e. hardware clock) must be between
10 MHz and 100 MHz, and updates must be strictly monotonic."

I do understand requiring a minimum frequency (10 MHz as stated) but I
am not sure why an implementation should be considered non compliant if
it has a MTIME frequency higher than 100 MHz.
The resolution of the mtime register is defined as 10 ns. The 100 MHz
value is irrelevant and should be deleted from the spec.
I can understand definining a minimum resolution but I do not understand why it needs to be capped to 10ns. I do not think the specification should define a maximum resolution.

(You could check if an mtime increment is needed at a 10 GHz rate. You
still would end up incrementing mtime at a maximum average rate of 100
MHz because the resolution is 10 ns.)

In a number of usages/systems having much higher resolution of time is
important and few hundred instructions may execute before the MTIME tick
advances with a 100 MHz time frequency.  This requirement to not exceed
100 MHz seems to be limiting.
Thinking about side channel attacks like Spectre it might be desirable
not to have a high resolution timer.
Which specter version was most concerning and why is specter mitigated if the resolution is 100 MHz but not higher? I was looking for the rationale for the 100 MHz limit - so could the rationale be shared about why specter is not possible with 100 MHz time?

Which applications do you have in mind where you need the time at higher
resolution and not only the number of cycles in mcycle?

Which resolution would these applications need within the foreseeable
Cycles is not at a fixed frequency and is not useful by itself as a way for timestamping.

Sorry, At this time I am not at liberty to reveal the exact application but having a nanosecond accuracy is important for this application.

I am looking for the reasoning and rationale that is behind mandating 100 MHz as the maximum frequency.


Join { to automatically receive all group messages.