]> git.baikalelectronics.ru Git - kernel.git/commit
cpupower: Fix coredump on VMWare
authorPrarit Bhargava <prarit@redhat.com>
Mon, 8 Oct 2018 15:06:19 +0000 (11:06 -0400)
committerShuah Khan (Samsung OSG) <shuah@kernel.org>
Mon, 8 Oct 2018 15:19:15 +0000 (09:19 -0600)
commit14a0fa081c95e9ac3c6f61c8f5bc8749d01692cd
tree6b408f9218d26353c21bb09d2832fd3405464c5d
parentff3126cdd3300dc4a948c8a511cf49386e56e096
cpupower: Fix coredump on VMWare

cpupower crashes on VMWare guests.  The guests have the AMD PStateDef MSR
(0xC0010064 + state number) set to zero.  As a result fid and did are zero
and the crash occurs because of a divide by zero (cof = fid/did).  This
can be prevented by checking the enable bit in the PStateDef MSR before
calculating cof.  By doing this the value of pstate[i] remains zero and
the value can be tested before displaying the active Pstates.

Check the enable bit in the PstateDef register for all supported families
and only print out enabled Pstates.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Stafford Horne <shorne@gmail.com>
Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
tools/power/cpupower/utils/cpufreq-info.c
tools/power/cpupower/utils/helpers/amd.c