From patchwork Wed Oct 11 20:18:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 151541 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp791066vqb; Wed, 11 Oct 2023 13:18:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFECp8cfKBpTHsafJ+ni0AlDei2dIi/bkk/b6Cei6R+e2STcE2IuYVLDcsEFejToKKE/FLo X-Received: by 2002:a17:902:da87:b0:1c6:2902:24f9 with SMTP id j7-20020a170902da8700b001c6290224f9mr25352478plx.1.1697055526522; Wed, 11 Oct 2023 13:18:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697055526; cv=none; d=google.com; s=arc-20160816; b=ukR3mOUO9m17O74f3+Du62PCgSPZ4Jiw8wgBsbhd1CbTu55qejtYvx51ez3IwTDmzV VoY0aHaw38x12jNl8pR4E8990R6lRDpVg1ESqgcQJH3/ycL5nbHCawZJX8+K8H5yZVWn /rHU/FwTJs++DvKW9WphlUNH3J87jy1kZL4Zq6Fwh6Psc7tqTJJhkNo4u5i5TrB8Ho2q DtH8hK7Qrw84BcuDoG+4n2DIgTmM88P7ydFWtYtvVhBSd9nqrTt7QeIWj7vYEb/o2Nz9 N14vWQVOAvTW1d/7KTK77Pgb48SblaC/UhGkaXHCpo0hd+Nfnabx+s1cpWAKjfIYHm46 5y9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=SkG/bnm24Hf8/nUqk6XKFx8MlzHMME0IVARW/kVok2g=; fh=Kbe5RLT0m4MUlZ79F6KM5b4oDf6Yl9+0IRrBJF1KS/g=; b=UoFOsEze4UA0YjRRDzpVV8IC/5tjRMoSXR/ph999sydZ3VCiCFhrZeqxvXzJwST1FH iSrezxtXI4jnskwR4jcLGChsB8URhXVk9QFLxtBvWBvDf7WbZ/Xvfbq5PrDn9TXHqMFu ONy7tD/6+KwP+KHjrCrQ8qUQixHKJLNdg4ymAnkUkhPl29nkELwNy0ocYk6ru1KcEBfJ dCnIUl6aQHeUNj9J1gQXY2BllZ6xXpP+ByaEPJgBwIDgTChn8Vhmj/MeWJxT1ilGSnsw kDlTw9mdc+sIaNz70TLwJvGAFfgDvjPoZpl7fdcp0XE11UkV1jjFJ6ZAGgDS7H6Eb9ZM OLDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Lf0mMr+H; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id u7-20020a170903124700b001c9ad75c067si501596plh.149.2023.10.11.13.18.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 13:18:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Lf0mMr+H; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 12B12805DC69; Wed, 11 Oct 2023 13:18:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376319AbjJKUS1 (ORCPT + 18 others); Wed, 11 Oct 2023 16:18:27 -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=2E1696934?= =?utf-8?q?091=2Egit=2Emaciej=2Ewieczor-retman=40intel=2Ecom=3E?= References: =?utf-8?q?=3C7300535160beba41fd8aa073749ec1ee29b4621f=2E16969340?= =?utf-8?q?91=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 X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email 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 (morse.vger.email [0.0.0.0]); Wed, 11 Oct 2023 13:18:43 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779364920335297006 X-GMAIL-MSGID: 1779491696185588570 The following commit has been merged into the x86/cache branch of tip: Commit-ID: 4dba8f10b8fef9c5b0f9ed83dd1af91a1795ead1 Gitweb: https://git.kernel.org/tip/4dba8f10b8fef9c5b0f9ed83dd1af91a1795ead1 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ärvinen Reviewed-by: Peter Newman Reviewed-by: Reinette Chatre Reviewed-by: Babu Moger Tested-by: Peter Newman Link: https://lore.kernel.org/r/7300535160beba41fd8aa073749ec1ee29b4621f.1696934091.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/resctrl/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) } } +static int rdt_has_sparse_bitmasks_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_bitmasks); + + return 0; +} + /** * __rdtgroup_cbm_overlaps - Does CBM for intended closid overlap with other * @r: Resource to which domain instance @d belongs. @@ -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_bitmasks_show, + .fflags = RF_CTRL_INFO | RFTYPE_RES_CACHE, + }, };