From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938630AbcJQRGU (ORCPT ); Mon, 17 Oct 2016 13:06:20 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:37957 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758388AbcJQRFO (ORCPT ); Mon, 17 Oct 2016 13:05:14 -0400 Date: Mon, 17 Oct 2016 19:02:19 +0200 (CEST) From: Thomas Gleixner To: Fenghua Yu cc: "H. Peter Anvin" , Ingo Molnar , Tony Luck , Peter Zijlstra , Stephane Eranian , Borislav Petkov , Dave Hansen , Nilay Vaish , Shaohua Li , David Carrillo-Cisneros , Ravi V Shankar , Sai Prakhya , Vikas Shivappa , linux-kernel , x86 Subject: Re: [PATCH v4 08/18] x86/intel_rdt: Pick up L3/L2 RDT parameters from CPUID In-Reply-To: <20161017180655.GB8999@linux.intel.com> Message-ID: References: <1476497548-11169-1-git-send-email-fenghua.yu@intel.com> <1476497548-11169-9-git-send-email-fenghua.yu@intel.com> <20161017180655.GB8999@linux.intel.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 17 Oct 2016, Fenghua Yu wrote: > On Mon, Oct 17, 2016 at 03:45:32PM +0200, Thomas Gleixner wrote: > > I wonder whether this is the proper abstraction level. We might as well do > > the following: > > > > rdtresources[] = { > > { > > .name = "L3", > > }, > > { > > .name = "L3Data", > > }, > > { > > .name = "L3Code", > > }, > > > > and enable either L3 or L3Data+L3Code. Not sure if that makes things > > simpler, but it's definitely worth a thought or two. > > This way will be better than having cdp_enabled/capable for L3 and not > for L2. So you need to change the struct to have capable and enabled > > static void rdt_get_config(int idx, struct rdt_resource *r) > > { > > union cpuid_0x10_1_eax eax; > > union cpuid_0x10_1_edx edx; > > u32 ebx, ecx; > > > > cpuid_count(0x00000010, idx, &eax.full, &ebx, &ecx, &edx.full); > > r->max_closid = edx.split.cos_max + 1; > > r->num_closid = r->max_closid; > > r->cbm_len = eax.split.cbm_len + 1; > > r->max_cbm = BIT_MASK(eax.split.cbm_len + 1) - 1; > > r->enabled = true; And set r->capable = true; here instead of r->enabled and set r->enabled at mount time for the resources depending on the mount flags. Thanks, tglx