From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756110AbcBVWUa (ORCPT ); Mon, 22 Feb 2016 17:20:30 -0500 Received: from www.linutronix.de ([62.245.132.108]:36739 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755617AbcBVWU0 (ORCPT ); Mon, 22 Feb 2016 17:20:26 -0500 Message-Id: <20160222220733.632098221@linutronix.de> User-Agent: quilt/0.63-1 Date: Mon, 22 Feb 2016 22:19:07 -0000 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , x86@kernel.org, Borislav Petkov , Stephane Eranian , Harish Chegondi , Kan Liang , Andi Kleen , Jacob Pan Subject: [patch V3 00/28] x86/perf/intel/uncore|rapl: Fix error handling and sanitize pmu management X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series addresses the following issues: - Add proper error handling to uncore and rapl drivers - Get rid of the pseudo per cpuness of these drivers and do a proper per package storage - Allow them to be modular In order to do proper per package storage I added a facility which sanity checks the physical package id of the processors which is supplied by bios and does a logical package id translation. That allows drivers to do allocations for the maximum number of possible packages independent of possible BIOS creativity. The module patches are optional. Andi pointed out that they miss the proper auto loading/probing machinery, but I kept them and let Peter decide what to do with them. Changes vs. V2: - Change export to GPL - Fix the leftover while loop - Fix the snb pmu_private bogosity - Explain in the changelogs why we want to keep pmu_private - Drop the proc/cpuinfo change - Add an explanation to the Kconfig help text why selecting 'm' might break existing setups. Delta patch below. Thanks, tglx --- --- a/arch/x86/Kconfig.perf +++ b/arch/x86/Kconfig.perf @@ -8,6 +8,9 @@ config PERF_EVENTS_INTEL_UNCORE Include support for Intel uncore performance events. These are available on NehalemEX and more modern processors. + Note: Selecting 'm' might break existing setups as the drivers + lack the autoprobe/load magic. If you need them select: y. + If unsure say y. config PERF_EVENTS_INTEL_RAPL @@ -18,6 +21,9 @@ config PERF_EVENTS_INTEL_RAPL Include support for Intel rapl performance events for power monitoring on modern processors. + Note: Selecting 'm' might break existing setups as the drivers + lack the autoprobe/load magic. If you need them select: y. + If unsure say y. endmenu --- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c +++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c @@ -774,9 +774,9 @@ static void __uncore_exit_boxes(struct i static void uncore_exit_boxes(void *dummy) { - struct intel_uncore_type **types = uncore_msr_uncores; + struct intel_uncore_type **types; - while (*types) + for (types = uncore_msr_uncores; *types; types++) __uncore_exit_boxes(*types++, smp_processor_id()); } --- a/arch/x86/kernel/cpu/perf_event_intel_uncore_snb.c +++ b/arch/x86/kernel/cpu/perf_event_intel_uncore_snb.c @@ -313,7 +313,7 @@ static int snb_uncore_imc_event_init(str return -EINVAL; event->cpu = box->cpu; - event->pmu_private = pmu; + event->pmu_private = box; event->hw.idx = -1; event->hw.last_tag = ~0ULL; --- a/arch/x86/kernel/cpu/proc.c +++ b/arch/x86/kernel/cpu/proc.c @@ -12,7 +12,6 @@ static void show_cpuinfo_core(struct seq { #ifdef CONFIG_SMP seq_printf(m, "physical id\t: %d\n", c->phys_proc_id); - seq_printf(m, "logical id\t: %d\n", c->logical_proc_id); seq_printf(m, "siblings\t: %d\n", cpumask_weight(topology_core_cpumask(cpu))); seq_printf(m, "core id\t\t: %d\n", c->cpu_core_id); --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -9335,7 +9335,7 @@ ssize_t perf_event_sysfs_show(struct dev return 0; } -EXPORT_SYMBOL(perf_event_sysfs_show); +EXPORT_SYMBOL_GPL(perf_event_sysfs_show); static int __init perf_event_sysfs_init(void) {