Received: by 2002:ab2:1c04:0:b0:1f7:53ba:1ebe with SMTP id f4csp41179lqg; Fri, 26 Apr 2024 08:15:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXqAZ9VriJZthXlgnPQlhZu91UszG7VLUwKL3IEdnJp0ccvFRYPdcmZOEoADDy7DgX3Q4qoJfvb0UpM+6/42pfRwMfRdqnOYhlV7WbHbw== X-Google-Smtp-Source: AGHT+IE8yA+JTkj7qeUMB6b+aoz3IZx7MYc2DTD8BHGvZ25K0duQI4zqRqScDQaJi0ZyI8ldtryZ X-Received: by 2002:a67:f8cb:0:b0:47b:b95a:3ee2 with SMTP id c11-20020a67f8cb000000b0047bb95a3ee2mr3048075vsp.7.1714144535530; Fri, 26 Apr 2024 08:15:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714144535; cv=pass; d=google.com; s=arc-20160816; b=eGxvVqMEEGmo3azNMgWGHzUABc6B7CXVmibB8LX1dLmV7yHihhiufpj0bwrk2g8esA YqUSQkEJB/vgbl4By/3kGO3mCkb24vtrdHOLM3z7Ojb1wkGsqdS+HmQGi+vOzu49A+bo IqTEFRBEDofZHBVomGKPduWm8cPOFa+XX5fZfdTTrecHupEFUGqPjzzDOOewN4I8XuqQ 2BJ+Mpwi60YTFjaQ3isZ3itDucnKS/Kcrr6tdUyruVe43svHzRmYeGTWM7Oh/+UwbNLg tgNlmVBBk9HMxlcaSSslSB//p1n1dJo0J6JgXd9wNJ/scoV+d7gq6j9vz55dKvOj1mDP D0mg== 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=olHRqblpYE+FMYNMUj99bnc0ECDz9fyEc097o45oAaI=; fh=Vo4MxA0u7CmSKYL/GjcyKHwusyvU+nKR43bqJem+vcY=; b=yCs5BoR59Uu2pvNtZ80kQQcQcyqlbC6FPwfx9hMtbYAIki/slynzXvgJeZfwUE8Btw Cz3CYSvpClPudyaeQN0R8J6HNbs3ko0yZdQSyAoLlgjO0OJFW+UJX992L9Psq66SIiWu 8825s1upfX2v7eXqfXWUKj/kz+sUoHDn0J7MdD5ndTdzk8MnHP2mtwYgRZhI05vNFBrA 4aUethvwlzpZ4rVSbX5PEGQGRS4Fd52FHpv8gnHbS4GpzvVY4vsMlchCHoITWHeoZdVN WGK3FfpYm5jJeCjCZ7ANnLfnylWe11WnRPwMUfVwNxKHpevUPTrIAuj+5cuuaDodRBWM EjhA==; 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-160244-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160244-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id j30-20020a056102001e00b0047a3c3e9badsi3533413vsp.164.2024.04.26.08.15.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 08:15:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160244-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; 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-160244-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160244-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3A6081C2390C for ; Fri, 26 Apr 2024 15:15:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 45A39171655; Fri, 26 Apr 2024 15:10:36 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7BF1717166E for ; Fri, 26 Apr 2024 15:10:34 +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=1714144235; cv=none; b=bX4k+ohdcIgb+K+7L9DZrGY58QneLkNWuWKmsi4RuBPOOMjRGcnqEHWot3BKKqP8X6HpOWNq89IpU1aTR3irp2P+Bf9jft6FVZVHUv8GX7S2PXVXLuDwTfSVo0aohQj9N/P6f8fwQKjIEft399qk3SQU0UVUp3k6Pu7/PqTaMRY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714144235; c=relaxed/simple; bh=YXzv6BIFhmVbewGmDyJE9WdD4nU/nqy4oI/DvekPYS0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=X7h0+DGTs/kmb5M6sqr06+nxlRPt/On23DvgvISgWKYt1+4sOWLsz+Y3/dTCt7mOIdbOw4e5eCgaaVXLd+iAREbIcPfBX4TCXKHvDezWGqEOSZ3S40ubcFYxIagYFO6LAsH1vHk/qqG1TGwqk4okPLe8yk7L++fJVTneEozoVQ0= 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 D5BAD168F; Fri, 26 Apr 2024 08:11:01 -0700 (PDT) Received: from e133380.cambridge.arm.com (e133380.arm.com [10.1.197.52]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F0E0B3F73F; Fri, 26 Apr 2024 08:10:30 -0700 (PDT) From: Dave Martin To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: James Morse , Fenghua Yu , Reinette Chatre , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Babu Moger , shameerali.kolothum.thodi@huawei.com, D Scott Phillips OS , carl@os.amperecomputing.com, lcherian@marvell.com, bobo.shaobowang@huawei.com, "Shaopeng Tan (Fujitsu)" , baolin.wang@linux.alibaba.com, Jamie Iles , Xin Hao , Peter Newman , dfustini@baylibre.com, amitsinght@marvell.com, David Hildenbrand , Rex Nie Subject: [PATCH v2 26/35] x86/resctrl: Describe resctrl's bitmap size assumptions Date: Fri, 26 Apr 2024 16:08:55 +0100 Message-Id: <20240426150904.8854-26-Dave.Martin@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240426150904.8854-1-Dave.Martin@arm.com> References: <20240426150537.8094-1-Dave.Martin@arm.com> <20240426150904.8854-1-Dave.Martin@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 From: James Morse 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 be004dc2ec79..329f68db38e1 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.34.1