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 83A9229D29F for ; Mon, 2 Mar 2026 10:02:40 +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=1772445762; cv=none; b=Bdu0e/GT2oCCnbATIefOeQwehiQW4jygMXUIfR3NqW9GhRl3iKYGZoakOH+w0GCWGtFkOaKKNBSMwzaiTtERjbQxIZ9ukZSEt2xuDgkxYlZx5MBt9kIV1mL93vl8/YgXY106MYN7EdzlfK9AS6WmbOcwZeaAByk79QY+gsmHCjs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772445762; c=relaxed/simple; bh=kciVII6KXoCwPozcFcIz7MtLhC+iVr52JD69mtU2BO0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=oWG/sUTs/0ybw37+kw+EdBE5bCESueocCw3Q390SgOo++Wq7hqZFg2ZqAyEh7aSMIgzQFjfrULmTYreOgzSwvpQ9i7fJFhdvwb0Pewz2cX5R6M1K4ebaHMQLmd5Sy14WlVpKZJSeiRot2CG32IBJFnHEseL1QlI5jJwpJ9qkvtY= 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 9B17814BF; Mon, 2 Mar 2026 02:02:33 -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 E4C643F73B; Mon, 2 Mar 2026 02:02:38 -0800 (PST) Message-ID: <9b2c1318-3f59-4d21-8b15-922bdac8114c@arm.com> Date: Mon, 2 Mar 2026 10:02: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: [PATCH v4] fs/resctrl: Add CONFIG_RESCTRL_ASSIGN_FIXED Kconfig entry To: Borislav Petkov Cc: linux-kernel@vger.kernel.org, tony.luck@intel.com, reinette.chatre@intel.com, Dave.Martin@arm.com, james.morse@arm.com, babu.moger@amd.com References: <20260204161952.685921-1-ben.horgan@arm.com> <20260301104918.GCaaQZrlomC0Bw-wM3@fat_crate.local> Content-Language: en-US From: Ben Horgan In-Reply-To: <20260301104918.GCaaQZrlomC0Bw-wM3@fat_crate.local> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Boris, On 3/1/26 10:49, Borislav Petkov wrote: > On Wed, Feb 04, 2026 at 04:19:52PM +0000, Ben Horgan wrote: >> diff --git a/fs/resctrl/monitor.c b/fs/resctrl/monitor.c >> index 572a9925bd6c..4e9f55ee3267 100644 >> --- a/fs/resctrl/monitor.c >> +++ b/fs/resctrl/monitor.c >> @@ -1451,6 +1451,12 @@ ssize_t resctrl_mbm_assign_mode_write(struct kernfs_open_file *of, char *buf, >> } >> >> if (enable != resctrl_arch_mbm_cntr_assign_enabled(r)) { >> + if (IS_ENABLED(CONFIG_RESCTRL_ASSIGN_FIXED)) { > > Does it need to be a Kconfig entry or you can figure out programatically from > the architecture that that is the case and avoid yet another CONFIG_ knob? > > From reading this, I'm thinking > > if (IS ARM64) { > > should do or...? Yes, we don't necessarily need the Kconfig and we don't necessarily need this condition at all in resctrl_mbm_assign_mode_write(), we do need the existing one in resctrl_mbm_assign_mode_show() though. The Kconfig was effectively added in: commit 3b497c3f4f04 ("fs/resctrl: Introduce the interface to display monitoring modes") and I was just filling in the missing piece. Most arch specific things in resctrl seem to be dealt with using resctrl_arch_* hooks. Would it be preferable to create a new one of these? It could be resctrl_arch_mbm_cntr_assign_fixed() although we seem to be getting too many of these too. Perhaps we could extend the meaning of another hook, resctrl_arch_mbm_assign_set() could return -EOPNOTSUPP to indicate to resctrl that the counter assignment mode is not configurable. > >> + ret = -EINVAL; >> + rdt_last_cmd_puts("Counter assignment mode is not configurable\n"); >> + goto out_unlock; >> + } >> + >> ret = resctrl_arch_mbm_cntr_assign_set(r, enable); >> if (ret) >> goto out_unlock; > Thanks, Ben