xref: /xnu-11417.121.6/osfmk/arm/arm_features.inc (revision a1e26a70f38d1d7daa7b49b258e2f8538ad81650)
1/*
2 * Copyright (c) 2024 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29/**
30 * Enumerated ARM optional features to be exported to userspace. These are to be
31 * enumerated using the official feature name from the ARM ARM. They are grouped
32 * below based on the MSR that will be used to populate the data.
33 */
34
35/* Features from: ID_AA64ISAR0_EL1 */
36ARM_FEATURE_FLAG(FEAT_CRC32);
37ARM_FEATURE_FLAG(FEAT_FlagM);
38ARM_FEATURE_FLAG(FEAT_FlagM2);
39ARM_FEATURE_FLAG(FEAT_FHM);
40ARM_FEATURE_FLAG(FEAT_DotProd);
41ARM_FEATURE_FLAG(FEAT_SHA3);
42ARM_FEATURE_FLAG(FEAT_RDM);
43ARM_FEATURE_FLAG(FEAT_LSE);
44ARM_FEATURE_FLAG(FEAT_SHA256);
45ARM_FEATURE_FLAG(FEAT_SHA512);
46ARM_FEATURE_FLAG(FEAT_SHA1);
47ARM_FEATURE_FLAG(FEAT_AES);
48ARM_FEATURE_FLAG(FEAT_PMULL);
49
50/* Features from: ID_AA64ISAR1_EL1 */
51ARM_FEATURE_FLAG(FEAT_SPECRES);
52ARM_FEATURE_FLAG(FEAT_SPECRES2);
53ARM_FEATURE_FLAG(FEAT_SB);
54ARM_FEATURE_FLAG(FEAT_FRINTTS);
55ARM_FEATURE_FLAG(FEAT_PACIMP);
56ARM_FEATURE_FLAG(FEAT_LRCPC);
57ARM_FEATURE_FLAG(FEAT_LRCPC2);
58ARM_FEATURE_FLAG(FEAT_FCMA);
59ARM_FEATURE_FLAG(FEAT_JSCVT);
60ARM_FEATURE_FLAG(FEAT_PAuth);
61ARM_FEATURE_FLAG(FEAT_PAuth2);
62ARM_FEATURE_FLAG(FEAT_FPAC);
63ARM_FEATURE_FLAG(FEAT_FPACCOMBINE);
64ARM_FEATURE_FLAG(FEAT_DPB);
65ARM_FEATURE_FLAG(FEAT_DPB2);
66ARM_FEATURE_FLAG(FEAT_BF16);
67ARM_FEATURE_FLAG(FEAT_EBF16);
68ARM_FEATURE_FLAG(FEAT_I8MM);
69
70/* Features from: ID_AA64ISAR2_EL1 */
71ARM_FEATURE_FLAG(FEAT_WFxT);
72ARM_FEATURE_FLAG(FEAT_RPRES);
73ARM_FEATURE_FLAG(FEAT_CSSC);
74ARM_FEATURE_FLAG(FEAT_HBC);
75
76/* Features from: ID_AA64MMFR0_EL1 */
77ARM_FEATURE_FLAG(FEAT_ECV);
78
79/* Features from: ID_AA64MMFR1_EL1 */
80ARM_FEATURE_FLAG(FEAT_AFP);
81
82/* Features from: ID_AA64MMFR2_EL1 */
83ARM_FEATURE_FLAG(FEAT_LSE2);
84
85/* Features from: ID_AA64PFR0_EL1 */
86ARM_FEATURE_FLAG(FEAT_CSV2);
87ARM_FEATURE_FLAG(FEAT_CSV3);
88ARM_FEATURE_FLAG(FEAT_DIT);
89ARM_FEATURE_FLAG(AdvSIMD);
90ARM_FEATURE_FLAG(AdvSIMD_HPFPCvt);
91ARM_FEATURE_FLAG(FEAT_FP16);
92
93/* Features from: ID_AA64PFR1_EL1 */
94ARM_FEATURE_FLAG(FEAT_SSBS);
95ARM_FEATURE_FLAG(FEAT_BTI);
96ARM_FEATURE_FLAG(FEAT_SME);
97ARM_FEATURE_FLAG(FEAT_SME2);
98
99/* Features from: ID_AA64PFR2_EL1 */
100
101/* Features from: ID_AA64SMFR0_EL1 */
102ARM_FEATURE_FLAG(SME_F32F32);
103ARM_FEATURE_FLAG(SME_BI32I32);
104ARM_FEATURE_FLAG(SME_B16F32);
105ARM_FEATURE_FLAG(SME_F16F32);
106ARM_FEATURE_FLAG(SME_I8I32);
107ARM_FEATURE_FLAG(SME_I16I32);
108ARM_FEATURE_FLAG(FEAT_SME_F64F64);
109ARM_FEATURE_FLAG(FEAT_SME_I16I64);
110
111/* Features from: FPCR */
112ARM_FEATURE_FLAG(FP_SyncExceptions);
113
114/* Features derived from other feature flags */
115