From nobody Mon Feb 9 15:10:00 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 697B027D76F for ; Fri, 28 Feb 2025 20:02:09 +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=1740772930; cv=none; b=ASIPOGJp4wlEFpneEE/EmcKcGtc5IEsIuBw4bu9lGnwrQ2gjj+yAaI2OtyMzsLItQgt3yKZFr4q4Y58BkM3Lz9RXPBFP6UwJ60t8ElSr8653sfOzAiepT8EUC/fxi8H5IMZo0bKrjZ7stAWdb8BBlEfVmpjBUM1gf9zfilvTUks= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740772930; c=relaxed/simple; bh=aStm/9YUAhw8CJtSkgJtzhB1FuIe77g8WVZMH6PtBHg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DF8BVvV/786Sq+b0etp0hYGCeoeVHbqHEhDIgwVw9aunIkpWGmzcJk7wylyBCFT5LPtkOIoWY9Pmki3MACIflxaHCJQ+AFkBaO0TLHpuT0bqgQ2H5zoB98RX2LR4xAjv6fO4x8ShQzMMfXyDh1cHl2r+Ee0mSV4eJLuQjA8bNOw= 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 269A5150C; Fri, 28 Feb 2025 12:02:24 -0800 (PST) Received: from merodach.members.linode.com (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id ABA3C3F5A1; Fri, 28 Feb 2025 12:02:05 -0800 (PST) From: James Morse To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: 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 , Koba Ko , Shanker Donthineni , fenghuay@nvidia.com, Shaopeng Tan , Tony Luck Subject: [PATCH v7 36/49] x86/resctrl: Add end-marker to the resctrl_event_id enum Date: Fri, 28 Feb 2025 19:59:00 +0000 Message-Id: <20250228195913.24895-37-james.morse@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20250228195913.24895-1-james.morse@arm.com> References: <20250228195913.24895-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: quoted-printable Content-Type: text/plain; charset="utf-8" The resctrl_event_id enum gives names to the counter event numbers on x86. These are used directly by resctrl. To allow the MPAM driver to keep an array of these the size of the enum needs to be known. Add a 'num_events' define which can be used to size an array. This isn't a member of the enum to avoid updating switch statements that would otherwise be missing a case. Signed-off-by: James Morse Tested-by: Carl Worth # arm64 Tested-by: Shaopeng Tan Reviewed-by: Shaopeng Tan Reviewed-by: Tony Luck Reviewed-by: Reinette Chatre Reviewed-by: Fenghua Yu --- include/linux/resctrl_types.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/resctrl_types.h b/include/linux/resctrl_types.h index f26450b3326b..654323066174 100644 --- a/include/linux/resctrl_types.h +++ b/include/linux/resctrl_types.h @@ -51,4 +51,6 @@ enum resctrl_event_id { QOS_L3_MBM_LOCAL_EVENT_ID =3D 0x03, }; =20 +#define QOS_NUM_EVENTS (QOS_L3_MBM_LOCAL_EVENT_ID + 1) + #endif /* __LINUX_RESCTRL_TYPES_H */ --=20 2.39.5