From nobody Mon Feb 9 20:36:22 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 21EB7CA0FE6 for ; Fri, 1 Sep 2023 08:56:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348671AbjIAI4s (ORCPT ); Fri, 1 Sep 2023 04:56:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348664AbjIAI4o (ORCPT ); Fri, 1 Sep 2023 04:56:44 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26AF910D7 for ; Fri, 1 Sep 2023 01:56:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1693558602; x=1725094602; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=c/D8+l4Mqu2fxn77jMbYJEecLUZHRiY1giSI4dGMx40=; b=hkMnpF1bxm+6CDykFT4GknxZ7yXJ3mGSPS3v/1X2Gjrk7JNESAmTUw5S BN9jXqdZuIirz8GytIybI78jEIE3wyrnL97NvFI1ffUIc/+0OSPlQoYoe LkVkHwYID1KDfwy8p9mHLXykaubSziKVsFBAAC+IStbr3Poe++Ua4dQ9g fnGBHXjYXM2r2qdPGKZcYfuvWeAf6txQi1Y/H1XWHzGrnTThzra8dNyPu /NKbvYlsb3nus+TUb+jQJTUKACeCxKnlIIsuuiyHrMj/F2jJ3pv3WLq4L XC4lgf/SuCfG7bGBQcGaAoQD00R6v5d8ukIa1mWUIDVdUphlSWkA8HEsz A==; X-IronPort-AV: E=McAfee;i="6600,9927,10819"; a="440151908" X-IronPort-AV: E=Sophos;i="6.02,219,1688454000"; d="scan'208";a="440151908" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2023 01:56:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10819"; a="769133618" X-IronPort-AV: E=Sophos;i="6.02,219,1688454000"; d="scan'208";a="769133618" Received: from akoczor-mobl1.ger.corp.intel.com (HELO wieczorr-mobl1.intel.com) ([10.213.14.236]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2023 01:56:38 -0700 From: "Wieczor-Retman, Maciej" To: Fenghua Yu , Reinette Chatre , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" Cc: linux-kernel@vger.kernel.org Subject: [PATCH 2/3] x86/resctrl: Add sparse_bitmaps file in info Date: Fri, 1 Sep 2023 10:55:38 +0200 Message-ID: <27fc083358bc215676354818ad5a7abebd00e332.1693557919.git.maciej.wieczor-retman@intel.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Fenghua Yu Add the interface in resctrl FS to show if sparse CAT bitmaps 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_bitmaps, where {resource} can be either "L2" or "L3" depending on their support in the CAT feature. Signed-off-by: Fenghua Yu Signed-off-by: Wieczor-Retman, Maciej --- 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 725344048f85..4d27354f3f30 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -895,6 +895,17 @@ static int rdt_shareable_bits_show(struct kernfs_open_= file *of, return 0; } =20 +static int rdt_has_sparse_bitmaps_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_bitmaps); + + return 0; +} + /** * rdt_bit_usage_show - Display current usage of resources * @@ -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_bitmaps", + .mode =3D 0444, + .kf_ops =3D &rdtgroup_kf_single_ops, + .seq_show =3D rdt_has_sparse_bitmaps_show, + .fflags =3D RF_CTRL_INFO | RFTYPE_RES_CACHE, + }, =20 }; =20 --=20 2.42.0