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 4577C1B3925 for ; Tue, 16 Dec 2025 10:14:43 +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=1765880086; cv=none; b=kKTVINTRVwgLwZbxzE2zVv9oraCCSL5sbUyQkr21BSS/s+XpVGNlA94BuNDrKOhVRNfrO5+RG1Uq2BQqNp4y0/SeQb5aMQJupGTHZNWoHjf+zrH+D7ae0Wt8aGhh831ltP24k5qF2PCtWjiNtZd/uJrKXZoOWznTW1HWSeYEkKU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765880086; c=relaxed/simple; bh=V9IZjPIlImQ5XlZ6YrkFDmFq4HxCNB9qonIeNyXhuII=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=iMc494EXuNBjrpeYZrx/UU7PnBFgT8jsw9eC5bda95qOJIfeYmFFGpn8I6DyW9BRDyi+P/n7/VQa6IQe4/lnAZXPO9rD/Gz1X1uf6DUSej8EMZwSz8HVcHDBz4s+309oVZ/3e9J7v/baEIrtpMAsJchDyLihlQbSwQ0P9Q9er7Q= 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 65716FEC; Tue, 16 Dec 2025 02:14:35 -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 43D923F694; Tue, 16 Dec 2025 02:14:39 -0800 (PST) Message-ID: Date: Tue, 16 Dec 2025 10:14:37 +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 From: Ben Horgan 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> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 12/9/25 15:57, Ben Horgan wrote: > 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. I'll keep this as is because the value still needs to be reset correctly by mpam_devices.c even if it is not usable by resctrl. > > Thanks, > > Ben > > Thanks, Ben