From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757133AbbCCQEs (ORCPT ); Tue, 3 Mar 2015 11:04:48 -0500 Received: from mga09.intel.com ([134.134.136.24]:8582 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756857AbbCCQEG (ORCPT ); Tue, 3 Mar 2015 11:04:06 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,682,1418112000"; d="scan'208";a="535460326" From: kan.liang@intel.com To: a.p.zijlstra@chello.nl, acme@kernel.org, linux-kernel@vger.kernel.org Cc: ak@linux.intel.com, Kan Liang Subject: [PATCH 5/5] perf/x86/intel/uncore: do not implicitly set uncore event cpu Date: Tue, 3 Mar 2015 03:54:46 -0500 Message-Id: <1425372886-33397-5-git-send-email-kan.liang@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1425372886-33397-1-git-send-email-kan.liang@intel.com> References: <1425372886-33397-1-git-send-email-kan.liang@intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kan Liang There is cpumask exposed to the uncore pmu sysfs directory. User should set the cpu according to the cpumask. Kernel should not implicitly change the event->cpu. Signed-off-by: Kan Liang --- arch/x86/kernel/cpu/perf_event_intel_uncore.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c index c635b8b..cd80731 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c +++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c @@ -621,9 +621,8 @@ static int uncore_pmu_event_init(struct perf_event *event) if (event->cpu < 0) return -EINVAL; box = uncore_pmu_to_box(pmu, event->cpu); - if (!box || box->cpu < 0) + if (!box || box->cpu < 0 || (box->cpu != event->cpu)) return -EINVAL; - event->cpu = box->cpu; event->hw.idx = -1; event->hw.last_tag = ~0ULL; -- 1.8.3.1