From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752032AbbJBGxa (ORCPT ); Fri, 2 Oct 2015 02:53:30 -0400 Received: from mga09.intel.com ([134.134.136.24]:49949 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751756AbbJBGwb (ORCPT ); Fri, 2 Oct 2015 02:52:31 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,622,1437462000"; d="scan'208";a="656393915" From: Fenghua Yu To: "H Peter Anvin" , "Ingo Molnar" , "Thomas Gleixner" , "Peter Zijlstra" Cc: "linux-kernel" , "x86" , "Fenghua Yu" , "Vikas Shivappa" Subject: [PATCH V2 4/5] x86/intel_rdt: Hot cpu update for code data prioritization Date: Thu, 1 Oct 2015 23:33:58 -0700 Message-Id: <1443767639-62457-5-git-send-email-fenghua.yu@intel.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1443767639-62457-1-git-send-email-fenghua.yu@intel.com> References: <1443767639-62457-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 Updates hot cpu notification handling for code data prioritization(cdp). The capacity bitmask(cbm) is global for both data and instruction and we need to update the new online package with all the cbms by writing to the IA32_L3_QOS_n MSRs. Signed-off-by: Vikas Shivappa Signed-off-by: Fenghua Yu --- arch/x86/kernel/cpu/intel_rdt.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/cpu/intel_rdt.c b/arch/x86/kernel/cpu/intel_rdt.c index eab9d73..fe4d8e3 100644 --- a/arch/x86/kernel/cpu/intel_rdt.c +++ b/arch/x86/kernel/cpu/intel_rdt.c @@ -501,6 +501,26 @@ static inline bool rdt_cpumask_update(int cpu) return false; } +static void cbm_update_msr(u32 index) +{ + struct rdt_remote_data info; + int dindex; + + dindex = DCBM_TABLE_INDEX(index); + if (cctable[dindex].clos_refcnt) { + + info.msr = CBM_FROM_INDEX(dindex); + info.val = cctable[dindex].l3_cbm; + msr_cpu_update((void *) &info); + + if (cdp_enabled) { + info.msr = __ICBM_MSR_INDEX(index); + info.val = cctable[dindex + 1].l3_cbm; + msr_cpu_update((void *) &info); + } + } +} + /* * cbm_update_msrs() - Updates all the existing IA32_L3_MASK_n MSRs * which are one per CLOSid on the current package. @@ -508,15 +528,10 @@ static inline bool rdt_cpumask_update(int cpu) static void cbm_update_msrs(void *dummy) { int maxid = cconfig.max_closid; - struct rdt_remote_data info; unsigned int i; for (i = 0; i < maxid; i++) { - if (cctable[i].clos_refcnt) { - info.msr = CBM_FROM_INDEX(i); - info.val = cctable[i].l3_cbm; - msr_cpu_update((void *) &info); - } + cbm_update_msr(i); } } -- 1.8.1.2