tsc: AMD Family 17h, 19h: compute frequency from Core::X86::Msr:PStateDef
authorcheloha <cheloha@openbsd.org>
Mon, 24 Oct 2022 00:56:33 +0000 (00:56 +0000)
committercheloha <cheloha@openbsd.org>
Mon, 24 Oct 2022 00:56:33 +0000 (00:56 +0000)
commit8cc9615794e40e0af7194d606ce26e2632e0829a
treeddd937395d473b233a766471de6c3896487493b5
parentcfac8e34c1bf89a9feaa77cc4f2e409c3ee998b3
tsc: AMD Family 17h, 19h: compute frequency from Core::X86::Msr:PStateDef

Compute the TSC frequency on AMD family 17h and 19h CPUs using the
PStateDef MSRs.

   Link 1: https://marc.info/?l=openbsd-tech&m=166394236029484&w=2
   Link 2: https://marc.info/?l=openbsd-tech&m=166446065916283&w=2
Test list: https://marc.info/?l=openbsd-tech&m=166646389821326&w=2

Reviewed by kettenis@ using the AMD documents cited in the comments.
Maybe reviewed by mlarkin@?  I can't remember.  He seemed supportive
of the idea at least.

ok kettenis@
sys/arch/amd64/amd64/tsc.c
sys/arch/amd64/include/specialreg.h