Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2899182rdb; Fri, 22 Sep 2023 11:20:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE4TLaCtX4cqPh7vB1CNjlmaFAT6aJxN/QXmWAx9dFRb+ddYYnhU2atehmUWimVSNJfaLvd X-Received: by 2002:a17:902:6941:b0:1c3:758d:32de with SMTP id k1-20020a170902694100b001c3758d32demr261139plt.12.1695406832898; Fri, 22 Sep 2023 11:20:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695406832; cv=none; d=google.com; s=arc-20160816; b=pgkwONFxE/AgFfG8W2L4qSH7d/uGLGEeXWz4ZqjtYAdBuN015tEKret2e7EEwfA72+ y0RYp1estXnoahapfsrx4cpapsKiAwcVIguZnRLR8A2lCxkXnBjWCZClXfu463/mXGkn aXdi3FKp1v3LLrlOo+rfWt4ta8B4OEawvq/M2tHzKC2IGRhPtQklIQPHCLsuHo3rGG2t WsEiGz9WmsjrjTtkiH9UFS0CunYFiVcJ1o+cZu0M2PV0gbGAdI+uMiLAihYzPOYoggD7 Mctw120NLlZ7UiiYdLUMPSpFvd/KrbZi8wfimaZSPsuUsu/QSi8sCleQ1xO6j5vCfHWQ aQHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vZxy5uyeH1qp4gJv5U8IV20z3rvG0a2VroQilZGZ450=; fh=JoGJTBLBX0mCLsj1pwi/CRHCOqwSpQQHNFK25Wueyf0=; b=CqF1TgIuKF61N3OgwGwINFfeia620rNbqFPNP/MTO6qNjP7L/EkNlDZOamk+/DDVue r8pLz5ptOndXJftSjmYzpTUBJXUsBalxZklFq98XDa5YDgH5vaIJTG/pSsI9rOvlvvxU vp6hwb1Bp70xRPqQ/Uwd+6eAM2KVvv978+7FLDF+2kUDv6+gR0Li8+ql/t1K9B33GK9s ags916H7vX7temMRMkDgDvYgLXWP5RP/5A3wE3l96QcyMKiHiSHV+rL3HlZ7ZucvwlLG CmABRwfGVHemanokLZzRSTeOj/HIsXiR1kqtxp04uJDMzPjR9KJ99TO0JrFKHoUQVo0Q s4/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=d3EZUqbL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id u10-20020a17090341ca00b001c32fe6cdf9si4517289ple.386.2023.09.22.11.20.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 11:20:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=d3EZUqbL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 3EE4182C92FF; Fri, 22 Sep 2023 01:49:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232103AbjIVItR (ORCPT + 99 others); Fri, 22 Sep 2023 04:49:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231743AbjIVItQ (ORCPT ); Fri, 22 Sep 2023 04:49:16 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1883BCF for ; Fri, 22 Sep 2023 01:49:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695372551; x=1726908551; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HDKvI3tJnXXkmkhZ0zOyHlDa9Po0UfxOxHzEmvHSAtw=; b=d3EZUqbLgTbofp7NpOi7VLDrjmxBopVdD0JVRpN3MJAAVdCjfq3EVJaX uxTKScVc+a59MbM/aRyVR9vuFuRNT65g7RAfXCpsNq2OTzIoJGHefmc9f pDMwD+7HCkdl2n/BPOS7M0CGF1Tmz1hM+43W+uNmjRCCMmaxtJuGT0QF5 fDLsQ21go8aYQ5nnpEPvMNUxzIgB84eieSQU0TWYqNRAA0e3tKtbj16fq RVqZUnilbpzPD4mF7JionBbIjTpf/OwWVQzzc1AkfHvF16R2RYCkHDAuK q6r9IAVNQXeifHyOgbKwiK69A5trN6pdvmTjuhUIuWBG8Gp9J2j8gWYi4 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10840"; a="383524473" X-IronPort-AV: E=Sophos;i="6.03,167,1694761200"; d="scan'208";a="383524473" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2023 01:49:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10840"; a="750769505" X-IronPort-AV: E=Sophos;i="6.03,167,1694761200"; d="scan'208";a="750769505" Received: from bmatwiej-mobl.ger.corp.intel.com (HELO wieczorr-mobl1.intel.com) ([10.213.8.2]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2023 01:49:07 -0700 From: Maciej Wieczor-Retman 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 v2 2/4] x86/resctrl: Add sparse_masks file in info Date: Fri, 22 Sep 2023 10:48:24 +0200 Message-ID: <3b7f8c61f0f443e303bc9c5075566b89ffdebe7f.1695371055.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: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 22 Sep 2023 01:49:17 -0700 (PDT) From: Fenghua Yu Add the interface in resctrl FS to show if sparse cache allocations 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 --- Changelog v2: - Change bitmap naming convention to bit mask. (Reinette) - Change file name to "sparse_masks". (Reinette) 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/resctrl/rdtgroup.c index 725344048f85..5383169ff982 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; } +static int rdt_has_sparse_bitmaps_show(struct kernfs_open_file *of, + struct seq_file *seq, void *v) +{ + struct resctrl_schema *s = of->kn->parent->priv; + struct rdt_resource *r = 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[] = { .seq_show = rdtgroup_size_show, .fflags = RF_CTRL_BASE, }, + { + .name = "sparse_masks", + .mode = 0444, + .kf_ops = &rdtgroup_kf_single_ops, + .seq_show = rdt_has_sparse_bitmaps_show, + .fflags = RF_CTRL_INFO | RFTYPE_RES_CACHE, + }, }; -- 2.42.0