Re: [PATCH AUTOSEL 4.19 022/146] cpupower: Fix coredump on VMWare

From: Sasha Levin
Date: Thu Nov 01 2018 - 11:47:21 EST


On Thu, Nov 01, 2018 at 07:43:35AM -0400, Prarit Bhargava wrote:


On 10/31/2018 07:03 PM, Sasha Levin wrote:
From: Prarit Bhargava <prarit@xxxxxxxxxx>

[ 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.


Hi Sasha,

This patch, f69ffc5d3db8, depends on 8c22e2f69592 ("cpupower: Fix AMD Family
0x17 msr_pstate size"). Without 8c22e2f69592 the patch below will always read a
value of "0" and not output the correct data.

8c22e2f69592 must be applied to any stable branch that f69ffc5d3db8 is applied to.

I'll grab it too, thank you.

--
Thanks,
Sasha