From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031643AbbKECT4 (ORCPT ); Wed, 4 Nov 2015 21:19:56 -0500 Received: from mail-pa0-f42.google.com ([209.85.220.42]:35820 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031477AbbKECTy (ORCPT ); Wed, 4 Nov 2015 21:19:54 -0500 From: David Carrillo-Cisneros To: Fenghua Yu Cc: Stephane Eranian , Paul Turner , linux-kernel@vger.kernel.org, David Carrillo-Cisneros Subject: [PATCH 1/2] x86/intel_rdt,intel_cqm: Remove build dependency of RDT code on CQM code. Date: Wed, 4 Nov 2015 18:19:28 -0800 Message-Id: <1446689969-67703-1-git-send-email-davidcc@google.com> X-Mailer: git-send-email 2.6.0.rc2.230.g3dd15c0 In-Reply-To: <1443766185-61618-1-git-send-email-fenghua.yu@intel.com> References: <1443766185-61618-1-git-send-email-fenghua.yu@intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Minor code move to remove build dependency of RDT code on perf_event_intel_cqm.c . Signed-off-by: David Carrillo-Cisneros --- arch/x86/include/asm/pqr_common.h | 3 +++ arch/x86/kernel/cpu/Makefile | 6 +++++- arch/x86/kernel/cpu/perf_event_intel_cqm.c | 8 -------- arch/x86/kernel/cpu/pqr_common.c | 10 ++++++++++ 4 files changed, 18 insertions(+), 9 deletions(-) create mode 100644 arch/x86/kernel/cpu/pqr_common.c diff --git a/arch/x86/include/asm/pqr_common.h b/arch/x86/include/asm/pqr_common.h index 11e985c..228e943 100644 --- a/arch/x86/include/asm/pqr_common.h +++ b/arch/x86/include/asm/pqr_common.h @@ -1,6 +1,9 @@ #ifndef _X86_RDT_H_ #define _X86_RDT_H_ +#include +#include + #define MSR_IA32_PQR_ASSOC 0x0c8f /** diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile index b3292a4..5eb0f6e 100644 --- a/arch/x86/kernel/cpu/Makefile +++ b/arch/x86/kernel/cpu/Makefile @@ -39,7 +39,8 @@ obj-$(CONFIG_CPU_SUP_AMD) += perf_event_amd_iommu.o endif obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_p6.o perf_event_knc.o perf_event_p4.o obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_intel_lbr.o perf_event_intel_ds.o perf_event_intel.o -obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_intel_rapl.o perf_event_intel_cqm.o +obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_intel_rapl.o +obj-$(CONFIG_CPU_SUP_INTEL) += pqr_common.o perf_event_intel_cqm.o obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_intel_pt.o perf_event_intel_bts.o obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_intel_cstate.o @@ -49,6 +50,9 @@ obj-$(CONFIG_PERF_EVENTS_INTEL_UNCORE) += perf_event_intel_uncore.o \ perf_event_intel_uncore_nhmex.o obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_msr.o obj-$(CONFIG_CPU_SUP_AMD) += perf_event_msr.o + +else +obj-$(CONFIG_INTEL_RDT) += pqr_common.o endif obj-$(CONFIG_INTEL_RDT) += intel_rdt.o diff --git a/arch/x86/kernel/cpu/perf_event_intel_cqm.c b/arch/x86/kernel/cpu/perf_event_intel_cqm.c index 04a696f..eee960d 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_cqm.c +++ b/arch/x86/kernel/cpu/perf_event_intel_cqm.c @@ -17,14 +17,6 @@ static u32 cqm_max_rmid = -1; static unsigned int cqm_l3_scale; /* supposedly cacheline size */ /* - * The cached intel_pqr_state is strictly per CPU and can never be - * updated from a remote CPU. Both functions which modify the state - * (intel_cqm_event_start and intel_cqm_event_stop) are called with - * interrupts disabled, which is sufficient for the protection. - */ -DEFINE_PER_CPU(struct intel_pqr_state, pqr_state); - -/* * Protects cache_cgroups and cqm_rmid_free_lru and cqm_rmid_limbo_lru. * Also protects event->hw.cqm_rmid * diff --git a/arch/x86/kernel/cpu/pqr_common.c b/arch/x86/kernel/cpu/pqr_common.c new file mode 100644 index 0000000..abcb432 --- /dev/null +++ b/arch/x86/kernel/cpu/pqr_common.c @@ -0,0 +1,10 @@ +#include + +/* + * The cached intel_pqr_state is strictly per CPU and can never be + * updated from a remote CPU. Both functions which modify the state + * (intel_cqm_event_start and intel_cqm_event_stop) are called with + * interrupts disabled, which is sufficient for the protection. + */ +DEFINE_PER_CPU(struct intel_pqr_state, pqr_state); + -- 2.6.0.rc2.230.g3dd15c0