]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
cpupower: Fix coredump on VMWare
authorPrarit Bhargava <prarit@redhat.com>
Mon, 8 Oct 2018 15:06:19 +0000 (11:06 -0400)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:56:31 +0000 (19:56 -0600)
commit121bd94399a8eefe471bc5388d892beeb67a317d
tree9f29dd5cee9ee0efc47116887bb8a0319977f75e
parent27a903602b0fe7f53559cba68b592bc184e651a0
cpupower: Fix coredump on VMWare

BugLink: https://bugs.launchpad.net/bugs/1836802
[ Upstream commit f69ffc5d3db8f1f03fd6d1df5930f9a1fbd787b6 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
tools/power/cpupower/utils/cpufreq-info.c
tools/power/cpupower/utils/helpers/amd.c