From: tip-bot for Prarit Bhargava <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: kan.liang@intel.com, mingo@kernel.org,
linux-kernel@vger.kernel.org, prarit@redhat.com, bp@suse.de,
harish.chegondi@intel.com, hpa@zytor.com, peterz@infradead.org,
tglx@linutronix.de
Subject: [tip:x86/urgent] perf/x86/intel/uncore: Do not use hard coded physical package id 0
Date: Wed, 11 Jan 2017 02:33:54 -0800 [thread overview]
Message-ID: <tip-42433049c51e326baa1f45c834af9572fdb65b35@git.kernel.org> (raw)
In-Reply-To: <1483471471-14450-1-git-send-email-prarit@redhat.com>
Commit-ID: 42433049c51e326baa1f45c834af9572fdb65b35
Gitweb: http://git.kernel.org/tip/42433049c51e326baa1f45c834af9572fdb65b35
Author: Prarit Bhargava <prarit@redhat.com>
AuthorDate: Tue, 3 Jan 2017 14:24:31 -0500
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 11 Jan 2017 11:29:37 +0100
perf/x86/intel/uncore: Do not use hard coded physical package id 0
hswep_uncore_cpu_init() uses a hardcoded physical package id 0 for the boot
cpu. This works as long as the boot CPU is actually on the physical package
0, which is normaly the case after power on / reboot.
But it fails with a NULL pointer dereference when a kdump kernel is started
on a secondary socket which has a different physical package id because the
locigal package translation for physical package 0 does not exist.
Use the physical package id of the boot cpu instead of hard coded 0.
[ tglx: Rewrote changelog once more ]
commit cf6d445f6897 ("perf/x86/uncore: Track packages, not per CPU data")
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Harish Chegondi <harish.chegondi@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/1483471471-14450-1-git-send-email-prarit@redhat.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
arch/x86/events/intel/uncore_snbep.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index e6832be..b5fbb59 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -2686,7 +2686,7 @@ static struct intel_uncore_type *hswep_msr_uncores[] = {
void hswep_uncore_cpu_init(void)
{
- int pkg = topology_phys_to_logical_pkg(0);
+ int pkg = topology_phys_to_logical_pkg(boot_cpu_data.phys_proc_id);
if (hswep_uncore_cbox.num_boxes > boot_cpu_data.x86_max_cores)
hswep_uncore_cbox.num_boxes = boot_cpu_data.x86_max_cores;
next prev parent reply other threads:[~2017-01-11 10:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-03 19:24 [PATCH] perf/x86/intel/uncore: Initialize with correct logical package ID Prarit Bhargava
2017-01-03 23:44 ` Prarit Bhargava
2017-01-11 10:29 ` Thomas Gleixner
2017-01-11 10:33 ` tip-bot for Prarit Bhargava [this message]
2017-01-11 11:02 ` [tip:x86/urgent] perf/x86/intel/uncore: Do not use hard coded physical package id 0 Prarit Bhargava
2017-01-11 11:10 ` Thomas Gleixner
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=tip-42433049c51e326baa1f45c834af9572fdb65b35@git.kernel.org \
--to=tipbot@zytor.com \
--cc=bp@suse.de \
--cc=harish.chegondi@intel.com \
--cc=hpa@zytor.com \
--cc=kan.liang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=prarit@redhat.com \
--cc=tglx@linutronix.de \
/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
Powered by JetHome