From nobody Mon Feb 9 14:32:49 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DD10E1A4F12 for ; Fri, 17 Jan 2025 15:11:08 +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=1737126670; cv=none; b=mpyNoyYYZAvEIZ+SE15L8OVvH+7bbs3KMg1dg91EHcE5/s+G2efCxV/Eie1V5P/S5YNSkXiWQhGTdxgVCeVqIJP5Ip89hlB+3KsQQRHY5u381jx8ILp0eHO+XeREh8kwnn6yqDCd+9AfGCzkIUGyDN33vGS6iHbtZnwnn8kJgmc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737126670; c=relaxed/simple; bh=0m8BnBfFHglIIJrQhP1M1s20SprA+ngr19EZ58cKUmE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=R6qWfotalxTzx55xu+8u26nyEIfU9qJZ29Qs+G2dEim5QRXxFJ7kzzJhB/1HyY9V/DwojOvzbTYUf2lGrdMrrcOpXBMBoapz8vf8AkL8eYlX6c5bdtXZ6/uvmG2ZK/GrPDnjO+cjozLh8RUmekm1/HJBcOSd/IvOxEmEZYz23GQ= 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 127F62247; Fri, 17 Jan 2025 07:11:37 -0800 (PST) Received: from e133380.cambridge.arm.com (e133380.arm.com [10.1.197.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E81323F73F; Fri, 17 Jan 2025 07:11:07 -0800 (PST) From: Dave Martin To: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Zeng Heng , Shaopeng Tan , James Morse Subject: [RFC PATCH v2 05/11] arm_mpam: resctrl: Implement arch hook to set up the default CLOSID Date: Fri, 17 Jan 2025 15:10:27 +0000 Message-Id: <20250117151033.1517882-18-Dave.Martin@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250117151033.1517882-1-Dave.Martin@arm.com> References: <20250117151033.1517882-1-Dave.Martin@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Since the allocation of CLOSIDs can now depend on parameters such as resctrl filesystem mount options that are not available at arch driver init time, all MPAM resource allocations need to be reprogrammed when resctrl is mounted. Implement resctrl_arch_init_domains() so that resctrl will now reprogram the default CLOSID's resource allocations at filesystem mount time, in the same way as when creating a new resctrl control group. Signed-off-by: Dave Martin --- drivers/platform/arm64/mpam/mpam_resctrl.c | 15 +++++++++++++-- include/linux/arm_mpam.h | 7 +------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/platform/arm64/mpam/mpam_resctrl.c b/drivers/platform/= arm64/mpam/mpam_resctrl.c index 30f2caec11d7..aa8a6c077918 100644 --- a/drivers/platform/arm64/mpam/mpam_resctrl.c +++ b/drivers/platform/arm64/mpam/mpam_resctrl.c @@ -1209,7 +1209,8 @@ int resctrl_arch_update_one(struct rdt_resource *r, s= truct rdt_ctrl_domain *d, } =20 /* TODO: this is IPI heavy */ -int resctrl_arch_update_domains(struct rdt_resource *r, u32 closid) +static int __resctrl_arch_update_domains(struct rdt_resource *r, u32 closi= d, + bool force) { int err =3D 0; enum resctrl_conf_type t; @@ -1222,7 +1223,7 @@ int resctrl_arch_update_domains(struct rdt_resource *= r, u32 closid) list_for_each_entry(d, &r->ctrl_domains, hdr.list) { for (t =3D 0; t < CDP_NUM_TYPES; t++) { cfg =3D &d->staged_config[t]; - if (!cfg->have_new_ctrl) + if (!force && !cfg->have_new_ctrl) continue; =20 err =3D resctrl_arch_update_one(r, d, closid, t, @@ -1235,6 +1236,16 @@ int resctrl_arch_update_domains(struct rdt_resource = *r, u32 closid) return err; } =20 +int resctrl_arch_update_domains(struct rdt_resource *r, u32 closid) +{ + return __resctrl_arch_update_domains(r, closid, false); +} + +int resctrl_arch_init_domains(struct rdt_resource *r, u32 closid) +{ + return __resctrl_arch_update_domains(r, closid, true); +} + void resctrl_arch_reset_resources(void) { int i, idx; diff --git a/include/linux/arm_mpam.h b/include/linux/arm_mpam.h index dd5f18474846..e6b188ab735b 100644 --- a/include/linux/arm_mpam.h +++ b/include/linux/arm_mpam.h @@ -47,12 +47,7 @@ static inline unsigned int resctrl_arch_round_mon_val(un= signed int val) =20 static inline bool resctrl_arch_default_closid_needs_init(void) { - return false; -} - -static inline int resctrl_arch_init_domains(struct rdt_resource *r, u32 cl= osid) -{ - return 0; + return true; } =20 bool resctrl_arch_alloc_capable(void); --=20 2.34.1