Do not read the status MSR before setting performance adjustment mode.
authortb <tb@openbsd.org>
Wed, 11 Aug 2021 18:31:48 +0000 (18:31 +0000)
committertb <tb@openbsd.org>
Wed, 11 Aug 2021 18:31:48 +0000 (18:31 +0000)
commit04a8cccc8570b51bcf508309bfd188a2c7f8a197
treeff7018ffc9c5bb611439f4b3e7b9ea0d3112c680
parent086aa750ab8f1698a6c6eaafe1458279776ce66d
Do not read the status MSR before setting performance adjustment mode.
This makes modifying hw.setperf and apmd -A work on robert's laptop.
Previously, it would sometimes be impossible to set hw.setperf to any
value on this machine.

Keep a delay loop that waits for the MSR write to take effect before
setting hw.cpuspeed to the new value since this is apparently needed
for some pre-ryzen processors.

Debugging, initial diff & test by robert

ok brynet
sys/arch/amd64/amd64/k1x-pstate.c