public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Rafael David Tinoco <rafael.tinoco@linaro.org>
Cc: Sasha Levin <sashal@kernel.org>,
	stable@vger.kernel.org, linux-kernel@vger.kernel.org,
	Prarit Bhargava <prarit@redhat.com>,
	Shuah Khan <shuah@kernel.org>, Stafford Horne <shorne@gmail.com>
Subject: Re: [PATCH AUTOSEL 4.4 07/32] cpupower: Fix coredump on VMWare
Date: Mon, 12 Nov 2018 05:32:43 -0800	[thread overview]
Message-ID: <20181112133243.GA22022@kroah.com> (raw)
In-Reply-To: <a5f213e5-a671-d587-5329-5b919965134e@linaro.org>

On Mon, Nov 12, 2018 at 08:29:27AM -0200, Rafael David Tinoco wrote:
> On 10/31/18 9:11 PM, Sasha Levin wrote:
> > From: Prarit Bhargava <prarit@redhat.com>
> > 
> > [ 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>
> > ---
> >   tools/power/cpupower/utils/cpufreq-info.c | 2 ++
> >   tools/power/cpupower/utils/helpers/amd.c  | 5 +++++
> >   2 files changed, 7 insertions(+)
> > 
> > diff --git a/tools/power/cpupower/utils/cpufreq-info.c b/tools/power/cpupower/utils/cpufreq-info.c
> > index 0e6764330241..f9b064ac8d94 100644
> > --- a/tools/power/cpupower/utils/cpufreq-info.c
> > +++ b/tools/power/cpupower/utils/cpufreq-info.c
> > @@ -200,6 +200,8 @@ static int get_boost_mode(unsigned int cpu)
> >   		printf(_("    Boost States: %d\n"), b_states);
> >   		printf(_("    Total States: %d\n"), pstate_no);
> >   		for (i = 0; i < pstate_no; i++) {
> > +			if (!pstates[i])
> > +				continue;
> >   			if (i < b_states)
> >   				printf(_("    Pstate-Pb%d: %luMHz (boost state)"
> >   					 "\n"), i, pstates[i]);
> > diff --git a/tools/power/cpupower/utils/helpers/amd.c b/tools/power/cpupower/utils/helpers/amd.c
> > index 6437ef39aeea..82adfb33d7a5 100644
> > --- a/tools/power/cpupower/utils/helpers/amd.c
> > +++ b/tools/power/cpupower/utils/helpers/amd.c
> > @@ -103,6 +103,11 @@ int decode_pstates(unsigned int cpu, unsigned int cpu_family,
> >   		}
> >   		if (read_msr(cpu, MSR_AMD_PSTATE + i, &pstate.val))
> >   			return -1;
> > +		if ((cpu_family == 0x17) && (!pstate.fam17h_bits.en))
> > +			continue;
> > +		else if (!pstate.bits.en)
> > +			continue;
> > +
> >   		pstates[i] = get_cof(cpu_family, pstate);
> >   	}
> >   	*no = i;
> > 
> 
> Sasha,
> 
> This commit is causing:
> 
> $ make V=1 -C tools/power/cpupower all
> 
> gcc -fPIC -DVERSION=\"4.4.163.99.g0d9e7b\" -DPACKAGE=\"cpupower\"
> -DPACKAGE_BUGREPORT=\"linux-pm@vger.kernel.org\" -D_GNU_SOURCE -pipe -DNLS
> -Wall -Wchar-subscripts -Wpointer-arith -Wsign-compare -Wno-pointer-sign
> -Wdeclaration-after-statement -Wshadow -O1 -g -DDEBUG -I./lib -I ./utils -o
> utils/helpers/amd.o -c utils/helpers/amd.c
> utils/helpers/amd.c: In function ‘decode_pstates’:
> utils/helpers/amd.c:106:39: error: ‘union msr_pstate’ has no member named
> ‘fam17h_bits’
>    if ((cpu_family == 0x17) && (!pstate.fam17h_bits.en))
> 
> I think it should be dropped from v4.4 and v4.9 RCs, since this is a fix for
> a CPU that isn't supported for those 2.

Now dropped from both queues now.  Thanks for testing and finding these.

greg k-h

  reply	other threads:[~2018-11-12 13:32 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-31 23:11 [PATCH AUTOSEL 4.4 01/32] locking/lockdep: Fix debug_locks off performance problem Sasha Levin
2018-10-31 23:11 ` [PATCH AUTOSEL 4.4 02/32] ataflop: fix error handling during setup Sasha Levin
2018-10-31 23:11 ` [PATCH AUTOSEL 4.4 03/32] swim: fix cleanup on setup error Sasha Levin
2018-10-31 23:11 ` [PATCH AUTOSEL 4.4 04/32] tun: Consistently configure generic netdev params via rtnetlink Sasha Levin
2018-10-31 23:11 ` [PATCH AUTOSEL 4.4 05/32] perf tools: Free temporary 'sys' string in read_event_files() Sasha Levin
2018-10-31 23:11 ` [PATCH AUTOSEL 4.4 06/32] perf tools: Cleanup trace-event-info 'tdata' leak Sasha Levin
2018-10-31 23:11 ` [PATCH AUTOSEL 4.4 07/32] cpupower: Fix coredump on VMWare Sasha Levin
2018-11-12 10:29   ` Rafael David Tinoco
2018-11-12 13:32     ` Greg KH [this message]
2018-10-31 23:11 ` [PATCH AUTOSEL 4.4 08/32] mmc: sdhci-pci-o2micro: Add quirk for O2 Micro dev 0x8620 rev 0x01 Sasha Levin
2018-10-31 23:11 ` [PATCH AUTOSEL 4.4 09/32] x86/olpc: Indicate that legacy PC XO-1 platform should not register RTC Sasha Levin
2018-10-31 23:11 ` [PATCH AUTOSEL 4.4 10/32] regulator: fixed: Default enable high on DT regulators Sasha Levin
2018-10-31 23:11 ` [PATCH AUTOSEL 4.4 11/32] Bluetooth: btbcm: Add entry for BCM4335C0 UART bluetooth Sasha Levin
2018-10-31 23:11 ` [PATCH AUTOSEL 4.4 12/32] x86: boot: Fix EFI stub alignment Sasha Levin
2018-10-31 23:11 ` [PATCH AUTOSEL 4.4 13/32] pinctrl: qcom: spmi-mpp: Fix err handling of pmic_mpp_set_mux Sasha Levin
2018-10-31 23:11 ` [PATCH AUTOSEL 4.4 14/32] kprobes: Return error if we fail to reuse kprobe instead of BUG_ON() Sasha Levin
2018-10-31 23:11 ` [PATCH AUTOSEL 4.4 15/32] ACPI / LPSS: Add alternative ACPI HIDs for Cherry Trail DMA controllers Sasha Levin
2018-10-31 23:11 ` [PATCH AUTOSEL 4.4 16/32] pinctrl: qcom: spmi-mpp: Fix drive strength setting Sasha Levin
2018-10-31 23:11 ` [PATCH AUTOSEL 4.4 17/32] pinctrl: spmi-mpp: Fix pmic_mpp_config_get() to be compliant Sasha Levin
2018-10-31 23:11 ` [PATCH AUTOSEL 4.4 18/32] pinctrl: ssbi-gpio: Fix pm8xxx_pin_config_get() " Sasha Levin
2018-10-31 23:11 ` [PATCH AUTOSEL 4.4 19/32] ath10k: schedule hardware restart if WMI command times out Sasha Levin
2018-10-31 23:11 ` [PATCH AUTOSEL 4.4 20/32] scsi: esp_scsi: Track residual for PIO transfers Sasha Levin
2018-10-31 23:11 ` [PATCH AUTOSEL 4.4 21/32] scsi: megaraid_sas: fix a missing-check bug Sasha Levin
2018-10-31 23:11 ` [PATCH AUTOSEL 4.4 22/32] tpm: suppress transmit cmd error logs when TPM 1.2 is disabled/deactivated Sasha Levin
2018-10-31 23:11 ` [PATCH AUTOSEL 4.4 23/32] Drivers: hv: kvp: Fix two "this statement may fall through" warnings Sasha Levin
2018-10-31 23:11 ` [PATCH AUTOSEL 4.4 24/32] ext4: fix argument checking in EXT4_IOC_MOVE_EXT Sasha Levin
2018-10-31 23:11 ` [PATCH AUTOSEL 4.4 25/32] MD: fix invalid stored role for a disk Sasha Levin
2018-10-31 23:11 ` [PATCH AUTOSEL 4.4 26/32] usb: chipidea: Prevent unbalanced IRQ disable Sasha Levin
2018-10-31 23:11 ` [PATCH AUTOSEL 4.4 27/32] driver/dma/ioat: Call del_timer_sync() without holding prep_lock Sasha Levin
2018-10-31 23:11 ` [PATCH AUTOSEL 4.4 28/32] uio: ensure class is registered before devices Sasha Levin
2018-10-31 23:11 ` [PATCH AUTOSEL 4.4 29/32] scsi: lpfc: Correct soft lockup when running mds diagnostics Sasha Levin
2018-10-31 23:11 ` [PATCH AUTOSEL 4.4 30/32] signal: Always deliver the kernel's SIGKILL and SIGSTOP to a pid namespace init Sasha Levin
2018-10-31 23:11 ` [PATCH AUTOSEL 4.4 31/32] dmaengine: dma-jz4780: Return error if not probed from DT Sasha Levin
2018-10-31 23:11 ` [PATCH AUTOSEL 4.4 32/32] ALSA: hda: Check the non-cached stream buffers more explicitly Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181112133243.GA22022@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=prarit@redhat.com \
    --cc=rafael.tinoco@linaro.org \
    --cc=sashal@kernel.org \
    --cc=shorne@gmail.com \
    --cc=shuah@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox