> Date: Sat, 10 Dec 2022 09:43:32 -0600
> From: Scott Cheloha <[email protected]>
> 
> On Sat, Dec 10, 2022 at 03:14:37PM +0100, Mark Kettenis wrote:
> > > Date: Fri, 9 Dec 2022 16:27:59 -0600
> > > From: Scott Cheloha <[email protected]>
> > > 
> > > The UltraSPARC IIe's %TICK register has a variable frequency.  See
> > > section 2.3 in this document here:
> > > 
> > > https://web.archive.org/web/20221028065731/https://www.oracle.com/technetwork/server-storage/sun-sparc-enterprise/documentation/ultrasparc-iie-2516664.pdf
> > > 
> > > Timecounters need to have a constant frequency, so we should not
> > > install tick_timecounter if the implementation is an UltraSPARC IIe
> > > ("Hummingbird").
> > > 
> > > As far as I know this issue is unique to the IIe.  I can't find any
> > > reference to a varying %TICK frequency in the documentation for the
> > > IIi or the UltraSPARC III.
> > > 
> > > miod@ confirmed that the problem is real.
> > > 
> > > ok?
> > 
> > I don't think so.
> > 
> > IIRC, UltraSPARC IIi and UltraSPARC IIIi also have a potentially
> > varying %tick frequency.
> 
> Where would this be written down?  And how do we know that later
> revisions have a fixed %tick frequency?
> 
> > Those chips implement %sys_tick though and
> > since we give the associated timecounter a higher quality, it wins.
> 
> Gotcha.

Not sure if it is documented anywhere.  But my interpretation has
always been that %sys_tick was introduced when Sun started building
SPARCv9 CPUs that had clock frequencies that could be changed.  The
UltraSPARC-IIe processor was part of that transition.  A timecounter
that didn't scale with the CPU frequency was introduced in the
hardware, but the %sys_tick ASR wasn't added to the instruction set
yet.

Anyway, I think one has to assume that when %sys_tick exists, %tick
may not run at a constant frequency.

> > With your diff UltraSPARC IIe will end up without a timecounter.  That
> > would bad isn't it?
> 
> We have a stick_timecounter in dev/psycho.c that uses stick().  Is
> that sufficient?

Ah, wait, that's the one that gets used.  I probably wrote that code.
I'm getting old.

So really the question is whether we should register the "tick"
timecounter if we also provide the "stick" or "sys_tick" timecounter.

Personaly I think the code we currently have is fine.  If you make the
sconscious decision to use "tick" on a system that provides "stick" or
"sys_tick" you'd better make the conscious decision not to use the CPU
frequency scaling stuff.

Reply via email to