x86: retrieve and log CPU frequency information
authorJan Beulich <jbeulich@suse.com>
Fri, 15 May 2020 14:16:29 +0000 (16:16 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 15 May 2020 14:16:29 +0000 (16:16 +0200)
commitf6b6517cd5dbd7b2cdb3cfc4cda9751d1db19a1a
tree0e86de45116d52abdacc8734fce997bec8306280
parenta6d1b558471fa12db7037a9d055258adf4e7b6e2
x86: retrieve and log CPU frequency information

While from just a single Skylake system it is already clear that we
can't base any of our logic on CPUID leaf 15 [1] (leaf 16 is
documented to be used for display purposes only anyway), logging this
information may still give us some reference in case of problems as well
as for future work. Additionally on the AMD side it is unclear whether
the deviation between reported and measured frequencies is because of us
not doing well, or because of nominal and actual frequencies being quite
far apart.

The chosen variable naming in amd_log_freq() has pointed out a naming
problem in rdmsr_safe(), which is being taken care of at the same time.
Symmetrically wrmsr_safe(), being an inline function, also gets an
unnecessary underscore dropped from one of its local variables.

[1] With a core crystal clock of 24MHz and a ratio of 216/2, the
    reported frequency nevertheless is 2600MHz, rather than the to be
    expected (and calibrated by both us and Linux) 2592MHz.

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/cpu/amd.c
xen/arch/x86/cpu/cpu.h
xen/arch/x86/cpu/hygon.c
xen/arch/x86/cpu/intel.c
xen/include/asm-x86/msr.h