Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp607007lqp; Thu, 21 Mar 2024 10:04:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVaOJf4GG0+OJTPu/BxXmWHLHf9B8DYrTVi0TLMGC36oLlGwUecXcYQt5b3bATbjCO5CgBieMwr5FPGntDmhepZiX4luwo9F68fZ5y2BA== X-Google-Smtp-Source: AGHT+IEgy2FDpu/6O0zH+fvH1XSgUg5QV8lsK3/AnkgCHlgob+xk7nru+VJVcWM+eufJ21Mln+bL X-Received: by 2002:a17:906:7187:b0:a46:301:dd98 with SMTP id h7-20020a170906718700b00a460301dd98mr94415ejk.13.1711040661663; Thu, 21 Mar 2024 10:04:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711040661; cv=pass; d=google.com; s=arc-20160816; b=BrST3+eynhTb3r0k4ekIM4nwW21qHQ0vMoPkajm2QrC8Fz3UDRVfW/2sMFItnaCok6 G7Azml9ClwrzKhgzULBOlI2MR3ekj3IUpZ/pdj4MBuyePeF5SZJhM+68eolu+iX6US4H qfvpXUmIKOogH3zGssaKRTg2p/f4/C/nY1/kIhcwjQHehB4uetACEdO0er+YSVYRVcV8 FKqYFbdWjWtu82+lRDfuh5Og/lOFj3WT1fR5oFuXSov6jxqbqsnv4M/s2OBhNNK9Gkac dRc3hj2lVd+v7cMJvRBs/Z8WSasqwittRVduh/n/Z/x+ieDWMr8VRudRgksKnmHssP2i qDKw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=ZHkESLBW74ywaFEQEjqepQazfA5iXregBXVR4EoFrKo=; fh=knouHfhWmUABu+sT2q0nnGKUzC7/WRiZH1KSpGv7uFs=; b=JaCE/WQRj8vNHoVHRXWdhE/MDRbiwVxbJcYLQODXuYmNEp49J8P5K2iPmX7GYPJIWu WcQTbrl3IoNH4L8BsIz5IE17P8SttlVcMKzk6z8axYpHZaZa7dEhWx9E4OjAGxlLYbmN Q1/1vNjtLxr8iyOrqwo4VUOH/UbKaNU/hm7N8+9OMzxzEiean4tHuAiHXHAka6hOvTHn e7Fbab2jspinc1pJNwoCmI2q0tDMt63AyVYGU0MvhggvCB5KfuMfMv2IIcM56T2OFroq UbZO1a3EGzS2HcJf2d5GaAerpy12Sh7NgQGs3FaauwONNUq7NPKwG0VTD45C7qwawsTi JSvA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-110443-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110443-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id bl23-20020a170906c25700b00a464a1f3cd2si92119ejb.314.2024.03.21.10.04.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 10:04:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-110443-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-110443-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110443-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 510661F231C8 for ; Thu, 21 Mar 2024 17:04:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F3768142636; Thu, 21 Mar 2024 16:52:55 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2CB2B142621 for ; Thu, 21 Mar 2024 16:52:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711039975; cv=none; b=Gn/p4kHmXlBU+tfdeq+zEXMn7a+bk9higeRga/X2K9Ks1tu7045IfxjAKJogqVm09Q9nspy8kWgOwIDlDmlx2mKDvttHZ3tZmTWE1nxHLfjppzTFGDXGyKxEx/0nXTiasLuKSN1pd2FbRwJfIgQvcIYLAzldEnN4n15iE+PtufA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711039975; c=relaxed/simple; bh=vE8ObtSbNXXuQbtQiG9u6MeSrab/F7HqkgTUdTMXcBI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GbsXkv46qpnBuhSC5pCnDjTD/NwPTlM8OLJLWlQ0CLonFUCtNfgak1IPqn0ihx1rUgNjB28ESFJjzJ4tA8iz/icHhBIXAMh3qieNNHLbOU2t77VQGSmrAvCuh9EsfdcecTaKkYSaIQEB7hlLpyZ7cXN604kIFzfPLG/MuzbPOFE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 18508168F; Thu, 21 Mar 2024 09:53:28 -0700 (PDT) Received: from merodach.members.linode.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CEF593F67D; Thu, 21 Mar 2024 09:52:50 -0700 (PDT) From: James Morse To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: Fenghua Yu , Reinette Chatre , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Babu Moger , James Morse , shameerali.kolothum.thodi@huawei.com, D Scott Phillips OS , carl@os.amperecomputing.com, lcherian@marvell.com, bobo.shaobowang@huawei.com, tan.shaopeng@fujitsu.com, baolin.wang@linux.alibaba.com, Jamie Iles , Xin Hao , peternewman@google.com, dfustini@baylibre.com, amitsinght@marvell.com, David Hildenbrand , Rex Nie , Dave Martin Subject: [PATCH v1 26/31] x86/resctrl: Describe resctrl's bitmap size assumptions Date: Thu, 21 Mar 2024 16:51:01 +0000 Message-Id: <20240321165106.31602-27-james.morse@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20240321165106.31602-1-james.morse@arm.com> References: <20240321165106.31602-1-james.morse@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit resctrl operates on configuration bitmaps and a bitmap of allocated CLOSID, both are stored in a u32. MPAM supports configuration/portion bitmaps and PARTIDs larger than will fit in a u32. Add some preprocessor values that make it clear why MPAM clamps some of these values. This will make it easier to find code related to these values if this resctrl behaviour ever changes. Signed-off-by: James Morse --- include/linux/resctrl.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h index 84420253dc05..f463fb949677 100644 --- a/include/linux/resctrl.h +++ b/include/linux/resctrl.h @@ -26,6 +26,17 @@ int proc_resctrl_show(struct seq_file *m, /* max value for struct rdt_domain's mbps_val */ #define MBA_MAX_MBPS U32_MAX +/* + * Resctrl uses a u32 as a closid bitmap. The maximum closid is 32. + */ +#define RESCTRL_MAX_CLOSID 32 + +/* + * Resctrl uses u32 to hold the user-space config. The maximum bitmap size is + * 32. + */ +#define RESCTRL_MAX_CBM 32 + /** * struct pseudo_lock_region - pseudo-lock region information * @s: Resctrl schema for the resource to which this -- 2.39.2