From nobody Thu Nov 28 04:33:46 2024 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 780AE220804 for ; Fri, 4 Oct 2024 18:06:58 +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=1728065219; cv=none; b=h6ukEr7fILqjcImw2ppkOF0CJuJMd3Pc7yoqu00g019EGXLHzT3PPAHKCln9+Ax95qPjIpgnRvI6pVGoeUFkqm/07ZPJbnJSWU8MPVqSVVa1+iPMh+dZ3tdbcqi/wusMZqEqsCKYs/dtDjeEzYT4UZaNiEJSaP319EHEHpv1TIQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728065219; c=relaxed/simple; bh=lnm3989ZkVwht/pQMI9xO6goYm9YUuDr77D5AmSfj20=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CaVudxOzzoCtz/yGJC6RQJy/BBzgRgmOS45kc0BwQDNJpC002yJGfsCp8yPTQimxmrygHbkO6Jw3IAJcRZeZAIgAO6s+VJy+Ww3G/vnOHNLrSf6IFJxBFlKyi+QDb1azTBTlubwWXvLFfmJmM2vbeiZ3BaVb5wdkIWtVFUca+UM= 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 59AD31063; Fri, 4 Oct 2024 11:07:27 -0700 (PDT) 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 B80893F58B; Fri, 4 Oct 2024 11:06:54 -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 , Shaopeng Tan Subject: [PATCH v5 35/40] x86/resctrl: Add end-marker to the resctrl_event_id enum Date: Fri, 4 Oct 2024 18:03:42 +0000 Message-Id: <20241004180347.19985-36-james.morse@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20241004180347.19985-1-james.morse@arm.com> References: <20241004180347.19985-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 --- 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 51c51a1aabfb..70226f5ab3e3 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.2