From nobody Sat Jun 13 08:47:02 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB81B33F58C; Fri, 8 May 2026 10:56:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778237801; cv=none; b=CjNuvuSAU24voWjlC0lBv0olt+e1n05fp4fcoIW+zRtk4gRLTd7K5DDAhoquSGz7ZXtVbTuHrGf+2NeGLeDAXmmFTlfP+fpetp+wyqFJJD4QKvMdI6KlDfcHsIUZ+QhSJ1PLtvmksfNfnax6EHYKIyLGnLt4/9NTLQLaqQUIkiI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778237801; c=relaxed/simple; bh=1wLEKwc+eMB0ZXBlSzUpq/Qc1+vRtxCN2jZoFVnKAb4=; h=Date:From:To:Subject:Cc:MIME-Version:Message-ID:Content-Type; b=YOzg4OcQutars9pixuarhKyCUJeamtGMsdnt9bDcYz0MG/RAhq6XC29lti+A365UdRmpBB6TxWCQT5ZCQup4MNuF54ZuXDrUk6BjgwP4zgSJMsPJomYMAeuelHv1llsOS1NtXjY1Rj2njcECUaT338IkK3RB4KvmK05CTPBUjvI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=uozFoRUM; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=sIX8cBjA; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="uozFoRUM"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="sIX8cBjA" Date: Fri, 08 May 2026 10:56:36 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1778237798; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WxL2QqZrqpD8qbPh1wEi3Np6fjkIp18/rO71nYinOqI=; b=uozFoRUMDSX7UEGjFcNY+Sin0fj2nspRfY5Pb5LviZvY4fGBzvbEtg7PHtL1q7EYAuOaql irZcBgOhVoUH6RE7zngil+MLbrlC+HqGjwxV+/4Gu0tLcXqP08xEpZyAZ1AIz2/5zBrTiN un/d8/jXvvlAbBRO7yhiFl0vTJGH4rqpoc2Uw/8ZJ5iVy6IjiP4+fkOutkz1d1f3kY8NWb /8Jyqey+wxjgdGRTC2zQnB+Q+2VSHdjlA0vImhccTRLxU1Vd7alUG1iGVRsN0Tl4Pgn0T3 Svz9JyJnSGtye+Qsnuua2z7QDevSmC7PFLKCDi3XsXRyrkzLdxMPiPlQuvlmcA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1778237798; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WxL2QqZrqpD8qbPh1wEi3Np6fjkIp18/rO71nYinOqI=; b=sIX8cBjAnoKB33WOrkAfpSxFLuXzz9lpSoFvB00V5FuIVFtlHgXlKTMaq0ntHN83hnNObW O9sWXh5aRlKltiDA== From: "tip-bot2 for Ben Horgan" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/cache] fs/resctrl: Disallow the software controller when MBM counters are assignable Cc: Ben Horgan , "Borislav Petkov (AMD)" , Reinette Chatre , Babu Moger , x86@kernel.org, linux-kernel@vger.kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177823779690.864.14952202402689381480.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the x86/cache branch of tip: Commit-ID: f52abe6502413450b8d0ecaad2555bbe4c6242eb Gitweb: https://git.kernel.org/tip/f52abe6502413450b8d0ecaad2555bbe4= c6242eb Author: Ben Horgan AuthorDate: Wed, 06 May 2026 09:28:51 +01:00 Committer: Borislav Petkov (AMD) CommitterDate: Wed, 06 May 2026 19:06:57 +02:00 fs/resctrl: Disallow the software controller when MBM counters are assignab= le The software controller requires that there is one MBM counter per monitor group that is assigned to the event backing the software controller, as per mba_MBps_event. When mbm_event mode is in use, it is not guaranteed that any particular event will have an assigned counter. Currently, only AMD systems support counter assignment, but the MBA delay is non-linear and so the software controller is never supported anyway. On MPAM systems, the MBA delay is linear and so the software controller could be supported. The MPAM driver, unless a need arises, will not support the 'default' mbm_assign_mode and will always use the 'mbm_event' mode for memory bandwidth monitoring. Rather than develop a way to guarantee the counter assignment requirements needed by the software controller, take the pragmatic approach. Don't allow the software controller to be used at the same time as 'mbm_event' mode. As MPAM is the only relevant architecture and it will use 'mbm_event' mode whenever there are assignable MBM counters, for simplicity's sake, don't allow the software controller when the MBM counters are assignable. Implement this by failing the mount if the user requests the software controller, the mba_MBps option, and the MBM counters are assignable. Signed-off-by: Ben Horgan Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Reinette Chatre Reviewed-by: Babu Moger Tested-by: Babu Moger Link: https://lore.kernel.org/20260506082855.3694761-1-ben.horgan@arm.com --- fs/resctrl/rdtgroup.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c index 7d800b3..af2cbab 100644 --- a/fs/resctrl/rdtgroup.c +++ b/fs/resctrl/rdtgroup.c @@ -2516,10 +2516,13 @@ static void mba_sc_domain_destroy(struct rdt_resour= ce *r, } =20 /* - * MBA software controller is supported only if - * MBM is supported and MBA is in linear scale, - * and the MBM monitor scope is the same as MBA - * control scope. + * The MBA software controller is supported only if MBM is supported and M= BA is + * in linear scale, and the MBM monitor scope is the same as MBA control s= cope. + * + * The software controller cannot be supported when the MBM counters are + * assignable. There is no guarantee that MBM counters are assigned to the + * event backing the software controller in all monitoring domains of all + * monitoring groups. */ static bool supports_mba_mbps(void) { @@ -2528,7 +2531,8 @@ static bool supports_mba_mbps(void) =20 return (resctrl_is_mbm_enabled() && r->alloc_capable && is_mba_linear() && - r->ctrl_scope =3D=3D rmbm->mon_scope); + r->ctrl_scope =3D=3D rmbm->mon_scope && + !rmbm->mon.mbm_cntr_assignable); } =20 /* @@ -2943,7 +2947,7 @@ static int rdt_parse_param(struct fs_context *fc, str= uct fs_parameter *param) ctx->enable_cdpl2 =3D true; return 0; case Opt_mba_mbps: - msg =3D "mba_MBps requires MBM and linear scale MBA at L3 scope"; + msg =3D "mba_MBps requires MBM (mbm_event mode not supported) and linear= scale MBA at L3 scope"; if (!supports_mba_mbps()) return invalfc(fc, msg); ctx->enable_mba_mbps =3D true;