x86: Add a turbo mode helper
authorBarret Rhoden <brho@cs.berkeley.edu>
Sat, 7 Oct 2017 18:59:58 +0000 (14:59 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 26 Oct 2017 17:06:54 +0000 (13:06 -0400)
commita4b5db6c46fd417d87110689087f0f03b3aae8a1
tree73a31c324230901561692230bd9e06b07972d859
parent9c08b207ee4e2d973b9163d32bf8cce7ea9fd8ad
x86: Add a turbo mode helper

This commands disables or enables Turbo mode, or deals with the turbo
ratio.

The ratio of APERF/MPERF is the amount of turbo mode boosting a processor
received while *unhalted*.  Since we're doing the two MSR reads with a
large gap in between, this will only be accurate over a larger time scale.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/arch/x86/devarch.c
tests/turbo.c [new file with mode: 0644]