Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp877012lqs; Fri, 14 Jun 2024 08:09:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW5qY9IeTRLo4waHTlIiPbUGrkfQvjpinpbOnr5QXo1lsD96HtGgVLzGocJjQTzG1PpjP+LY7vaL7ebjh78lYgqEyJwnW/n7sZPd5ukAw== X-Google-Smtp-Source: AGHT+IGDQFV/k2gDneZAxN7XyQymVnJ1GWwsPp5VU2wuTkqu5mP848WU8efIedno8zA1Pzi03N6f X-Received: by 2002:a05:622a:4cb:b0:440:97b6:c700 with SMTP id d75a77b69052e-442168940a1mr30445371cf.22.1718377744149; Fri, 14 Jun 2024 08:09:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718377744; cv=pass; d=google.com; s=arc-20160816; b=bm5MHWSUiZYwOOF9FVHTPZMEx7sdv3a9t4fleUdD4tm5R+zLK/t8bJ9jxtElsj2ft8 LJCklc7DP7LYfUd5YhXrLnbDCG5iNrv0MBDHKfA+rToyE7ZSpD6g27OH4Yh0wPCR61SW TlCrxAKWhUXxoerlpljpkEn4Jjgd1jJYTAprlSouRpEUeu/yYigpa2YaGJ6Zc7iWAvPf sG78ccrTK2ha4tQT8yzWRmdKn4/DP3686FDacGgjZfdHcPxokkOOtvIv2QktZMvtPr/B 2jsmPmjOjO8qs2tlWs7AW1/kxq8z675PHntC/gLdwNLFeR7exV+eiaEZO0MUjuWtqD7t H+4w== 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=Q4l3DiiQ6R5UswaQsgctfmKg0wlH+kuAu4E5AuZ0iJw=; fh=knouHfhWmUABu+sT2q0nnGKUzC7/WRiZH1KSpGv7uFs=; b=khNOq2pPFhrkgZP/ZMV3yFS16SaKQR7FtRE7dlcEq1HqcpqZ90kt8vJiQxk4y6cdmQ osq1W3ZlYf05cQDOArkQogReysJ7YjcKwXsDXb9ti8sm9sYJBIOuzf+ggloDQx5bF89f X/L6XBOOQhCEIumucGOIjytr/vLKI8bEcnNeSe6q6SzbzAkyjYKtJi4FgtySKl/Y7YTw l2GbW2+HEJbSauqNTZuqvgaSI/NlbHjNCT5z//FgzR0T0SB2hoNFLkilECGRKG/NpdMp t3VCi+7G+6utHi6gmcrbdDcl6sUj9bRqymsgU7Ubog/GKSTPhw/NC83Or7c9+y9Uay3t D5GQ==; 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-215102-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215102-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-441ef3ba038si42778871cf.147.2024.06.14.08.09.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 08:09:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-215102-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; 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-215102-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215102-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 E82EE1C24F69 for ; Fri, 14 Jun 2024 15:08:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D4D041AED38; Fri, 14 Jun 2024 15:03:04 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 13DFD1AED36 for ; Fri, 14 Jun 2024 15:03:02 +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=1718377384; cv=none; b=LxWn6epNMj/FcUkRFd08U6KbB4mBQa5PCtQiRjs7FnWHKIovZQg9m0kd02GdtjJJMd2KGHAh3gBUmIV2p5CIJN2UHygKTgJTKcdy078son1xeda2xx5CfrHJEpidQU9FRgouaf6BWCZkcgj+ddPAF2SXEeR2O2PDZUnBKgty4PY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718377384; c=relaxed/simple; bh=nemEl8gWSj/NvzHh5CdfG1I1++iD+LHZ4tAgmQ+RBgk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gPaD/r0dz9JZ9OgfX4mJwnDSABE3aXsM4VL/CO50SDWMbo90VjE6vHcVA+960b+J3mIFb9dVoqsZKGiCR6ZEsXA1Lu08CzadKJQ1DV76tZBkZO5fMUtRLMhYNidoucYQpoGEMfjn3vZaSCTGTlyg1AR+OYoTMstHLXEKjchhz4I= 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 227F21C00; Fri, 14 Jun 2024 08:03: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 8A18A3F5A1; Fri, 14 Jun 2024 08:02:59 -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 v3 34/38] x86/resctrl: Add end-marker to the resctrl_event_id enum Date: Fri, 14 Jun 2024 15:00:29 +0000 Message-Id: <20240614150033.10454-35-james.morse@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20240614150033.10454-1-james.morse@arm.com> References: <20240614150033.10454-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 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 --- Changes since v2: * This patch is new. --- 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 = 0x03, }; +#define QOS_NUM_EVENTS (QOS_L3_MBM_LOCAL_EVENT_ID + 1) + #endif /* __LINUX_RESCTRL_TYPES_H */ -- 2.39.2