From nobody Fri Jan 2 11:57:33 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2FC5CDB47E for ; Wed, 11 Oct 2023 20:18:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376354AbjJKUS2 (ORCPT ); Wed, 11 Oct 2023 16:18:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235108AbjJKUSY (ORCPT ); Wed, 11 Oct 2023 16:18:24 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BCB8C9; Wed, 11 Oct 2023 13:18:22 -0700 (PDT) Date: Wed, 11 Oct 2023 20:18:19 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1697055500; 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: in-reply-to:in-reply-to:references:references; bh=SkG/bnm24Hf8/nUqk6XKFx8MlzHMME0IVARW/kVok2g=; b=Lf0mMr+HPwHyU0lLCwezhTOWxP0z7SqbfYenrArRECCyZtUs3MPxAReFbTFEmryvrRLt1a djwQs99VAIW862LEv00eHe6rWG7NRHfusttE0SDH6yib3sHeOQI1xPb6wHsh80UNOaPyJo OMMkPI1IsLmvmRrEcWhr9MN24G5HlMoWPrj26GA9YeJ8FCeODxpPTCbUi+Ulnzalkm8U+A ri8BecTncl2T91uO+AajJAtECSvmll/+E6L9VNPK44vzdgYXWjdUCADv1JikankNDuTJ3i QzAOibH+hZwGvuBMrIOSEv80lWsiqiKVbtULmNFcQWshwHnV9rStin/Gp0+klg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1697055500; 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: in-reply-to:in-reply-to:references:references; bh=SkG/bnm24Hf8/nUqk6XKFx8MlzHMME0IVARW/kVok2g=; b=k/OiAgHc/xyYYjuZYCMlxcNmAqJZjKxReBr4q32Upu8a1pRNawSGUmjk6f1EJLs9I3miv3 WF49kmZP8oMmqhBA== From: "tip-bot2 for Fenghua Yu" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/cache] x86/resctrl: Add sparse_masks file in info Cc: Fenghua Yu , "Maciej Wieczor-Retman" , "Borislav Petkov (AMD)" , ilpo.jarvinen@linux.intel.com, Peter Newman , Reinette Chatre , Babu Moger , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: =?utf-8?q?=3C7300535160beba41fd8aa073749ec1ee29b4621f=2E16969?= =?utf-8?q?34091=2Egit=2Emaciej=2Ewieczor-retman=40intel=2Ecom=3E?= References: =?utf-8?q?=3C7300535160beba41fd8aa073749ec1ee29b4621f=2E169693?= =?utf-8?q?4091=2Egit=2Emaciej=2Ewieczor-retman=40intel=2Ecom=3E?= MIME-Version: 1.0 Message-ID: <169705549952.3135.4936488804307486003.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/cache branch of tip: Commit-ID: 4dba8f10b8fef9c5b0f9ed83dd1af91a1795ead1 Gitweb: https://git.kernel.org/tip/4dba8f10b8fef9c5b0f9ed83dd1af91a1= 795ead1 Author: Fenghua Yu AuthorDate: Tue, 10 Oct 2023 12:42:38 +02:00 Committer: Borislav Petkov (AMD) CommitterDate: Wed, 11 Oct 2023 21:51:24 +02:00 x86/resctrl: Add sparse_masks file in info Add the interface in resctrl FS to show if sparse cache allocation bit masks are supported on the platform. Reading the file returns either a "1" if non-contiguous 1s are supported and "0" otherwise. The file path is /sys/fs/resctrl/info/{resource}/sparse_masks, where {resource} can be either "L2" or "L3". Signed-off-by: Fenghua Yu Signed-off-by: Maciej Wieczor-Retman Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Ilpo J=C3=A4rvinen Reviewed-by: Peter Newman Reviewed-by: Reinette Chatre Reviewed-by: Babu Moger Tested-by: Peter Newman Link: https://lore.kernel.org/r/7300535160beba41fd8aa073749ec1ee29b4621f.16= 96934091.git.maciej.wieczor-retman@intel.com --- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/r= esctrl/rdtgroup.c index a52cdf9..09848ff 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -1117,6 +1117,17 @@ static enum resctrl_conf_type resctrl_peer_type(enum= resctrl_conf_type my_type) } } =20 +static int rdt_has_sparse_bitmasks_show(struct kernfs_open_file *of, + struct seq_file *seq, void *v) +{ + struct resctrl_schema *s =3D of->kn->parent->priv; + struct rdt_resource *r =3D s->res; + + seq_printf(seq, "%u\n", r->cache.arch_has_sparse_bitmasks); + + return 0; +} + /** * __rdtgroup_cbm_overlaps - Does CBM for intended closid overlap with oth= er * @r: Resource to which domain instance @d belongs. @@ -1839,6 +1850,13 @@ static struct rftype res_common_files[] =3D { .seq_show =3D rdtgroup_size_show, .fflags =3D RF_CTRL_BASE, }, + { + .name =3D "sparse_masks", + .mode =3D 0444, + .kf_ops =3D &rdtgroup_kf_single_ops, + .seq_show =3D rdt_has_sparse_bitmasks_show, + .fflags =3D RF_CTRL_INFO | RFTYPE_RES_CACHE, + }, =20 }; =20