Thank you very much for this! 

# sysctl hw.cpuspeed sysctl hw.setperf
hw.cpuspeed=601
hw.setperf=0
# sysctl hw.setperf=100 && sysctl hw.cpuspeed hw.setperf
hw.setperf: 0 -> 100
hw.cpuspeed=1600
hw.setperf=100

(net6501-70)

Mitja

> -----Original Message-----
> From: owner-source-chan...@openbsd.org [mailto:owner-source-
> chan...@openbsd.org] On Behalf Of Marcus Glocker
> Sent: Saturday, November 10, 2012 10:45 AM
> To: source-chan...@cvs.openbsd.org
> Subject: CVS: cvs.openbsd.org: src
> 
> CVSROOT:      /cvs
> Module name:  src
> Changes by:   mgloc...@cvs.openbsd.org        2012/11/10 02:45:06
> 
> Modified files:
>       sys/arch/amd64/amd64: identcpu.c locore.S
>       sys/arch/amd64/include: cpu.h specialreg.h
>       sys/arch/i386/i386: locore.s machdep.c
>       sys/arch/i386/include: cpu.h specialreg.h
>       sys/arch/i386/isa: clock.c
> 
> Log message:
> Recent x86 CPUs come with a constant time stamp counter.  If this is
> the case we verify if the CPU supports a specific version of the
> architectural performance monitoring feature and read out the current
> frequency from the fixed-function performance counter of the unhalted
> core.
> 
> My initial motivation to implement this was the Soekris net6501-70
> which comes with an Intel Atom E6xx 1.60GHz CPU.  It has a constant
> time stamp counter plus speed step support and boots on the lowest
> frequency of 600MHz.  This caused hw.cpuspeed and hw.setperf to
> reflect the wrong values.
> 
> The diff is a cooperation work with jsg@.  The fixed-function
> performance counter read code comes from a former diff of him.
> 
> OK jsg@

Reply via email to