From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A087E276038 for ; Tue, 9 Dec 2025 15:57:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765295831; cv=none; b=bLW9prr9xEpFk1PkkHlJPYhOu0c8wwzlQBiS8zc2rBiZQBhnhDsQXVjZs3QyQqmJwDCgL6lilaWrWPqZEdesmjj5BdKfJq+s/S0ssgOcw3MwUzRgu4mAZV9xFYnEZSTpGW61pJh/TathT6hDKNVkgPBNJvGWye05FpbUyknwO5U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765295831; c=relaxed/simple; bh=UUGl/5Mf/acB7RR83keNAyCyveU37j24Rhp7hqv+jTo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=nkztZ3QDNF5dHdNa5Xc48VtEj+N1j/wRSbti9/6b53nlAaUXs+GxypPehwd7+eTSNWxHJL5J/ix93/TRxV9hyERh2IcsuaWL1L9NLQJ2YSeIZDwgRcp+5FJlHiSZUKniyZqf4HPs+nCUYKblDpMk0Eytq7Ye4bi6MZpk8fpLFt4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4CB5A175D; Tue, 9 Dec 2025 07:57:01 -0800 (PST) Received: from [10.1.196.46] (e134344.arm.com [10.1.196.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 40BE83F73B; Tue, 9 Dec 2025 07:57:05 -0800 (PST) Message-ID: Date: Tue, 9 Dec 2025 15:57:03 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH 08/38] arm_mpam: resctrl: Pick the caches we will use as resctrl resources To: James Morse , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: D Scott Phillips OS , carl@os.amperecomputing.com, lcherian@marvell.com, bobo.shaobowang@huawei.com, tan.shaopeng@fujitsu.com, baolin.wang@linux.alibaba.com, Jamie Iles , Xin Hao , peternewman@google.com, dfustini@baylibre.com, amitsinght@marvell.com, David Hildenbrand , Dave Martin , Koba Ko , Shanker Donthineni , fenghuay@nvidia.com, baisheng.gao@unisoc.com, Jonathan Cameron , Gavin Shan , rohit.mathew@arm.com, reinette.chatre@intel.com, Punit Agrawal References: <20251205215901.17772-1-james.morse@arm.com> <20251205215901.17772-9-james.morse@arm.com> From: Ben Horgan Content-Language: en-US In-Reply-To: <20251205215901.17772-9-james.morse@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi James, On 12/5/25 21:58, James Morse wrote: > Systems with MPAM support may have a variety of control types at any > point of their system layout. We can only expose certain types of > control, and only if they exist at particular locations. > > Start with the well-know caches. These have to be depth 2 or 3 > and support MPAM's cache portion bitmap controls, with a number > of portions fewer than resctrl's limit. > > Signed-off-by: James Morse > --- > drivers/resctrl/mpam_resctrl.c | 91 +++++++++++++++++++++++++++++++++- > 1 file changed, 89 insertions(+), 2 deletions(-) > > diff --git a/drivers/resctrl/mpam_resctrl.c b/drivers/resctrl/mpam_resctrl.c > index 320cebbd37ce..ceaf11af4fc1 100644 > --- a/drivers/resctrl/mpam_resctrl.c > +++ b/drivers/resctrl/mpam_resctrl.c > @@ -60,10 +60,96 @@ struct rdt_resource *resctrl_arch_get_resource(enum resctrl_res_level l) > return &mpam_resctrl_controls[l].resctrl_res; > } > > +static bool cache_has_usable_cpor(struct mpam_class *class) > +{ > + struct mpam_props *cprops = &class->props; > + > + if (!mpam_has_feature(mpam_feat_cpor_part, cprops)) > + return false; > + > + /* resctrl uses u32 for all bitmap configurations */ > + return (class->props.cpbm_wd <= 32); > +} cpbm_wd > 32 is not support properly in mpam_devices.c (e.g. reset and config value are limited to 32 bits.) and so we should consider just not adding the feature to the class in that case. Thanks, Ben