From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763449AbdAKKeh (ORCPT ); Wed, 11 Jan 2017 05:34:37 -0500 Received: from terminus.zytor.com ([198.137.202.10]:43562 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759924AbdAKKef (ORCPT ); Wed, 11 Jan 2017 05:34:35 -0500 Date: Wed, 11 Jan 2017 02:33:54 -0800 From: tip-bot for Prarit Bhargava Message-ID: 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 Reply-To: bp@suse.de, prarit@redhat.com, hpa@zytor.com, harish.chegondi@intel.com, peterz@infradead.org, tglx@linutronix.de, kan.liang@intel.com, mingo@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <1483471471-14450-1-git-send-email-prarit@redhat.com> References: <1483471471-14450-1-git-send-email-prarit@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] perf/x86/intel/uncore: Do not use hard coded physical package id 0 Git-Commit-ID: 42433049c51e326baa1f45c834af9572fdb65b35 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 42433049c51e326baa1f45c834af9572fdb65b35 Gitweb: http://git.kernel.org/tip/42433049c51e326baa1f45c834af9572fdb65b35 Author: Prarit Bhargava AuthorDate: Tue, 3 Jan 2017 14:24:31 -0500 Committer: Thomas Gleixner 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 Cc: Peter Zijlstra Cc: Kan Liang Cc: Harish Chegondi Cc: Borislav Petkov 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 --- 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;