VirtualBox

source: vbox/trunk/include/VBox/vmm/cpum.h@ 107401

Last change on this file since 107401 was 107389, checked in by vboxsync, 7 weeks ago

VMM/CPUM: The CPUMFEATURE structures can't be in target specific headers, since we need them for the host CPU as well. jiraref:VBP-1470

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 63.7 KB
Line 
1/** @file
2 * CPUM - CPU Monitor(/ Manager).
3 */
4
5/*
6 * Copyright (C) 2006-2024 Oracle and/or its affiliates.
7 *
8 * This file is part of VirtualBox base platform packages, as
9 * available from https://www.virtualbox.org.
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation, in version 3 of the
14 * License.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, see <https://www.gnu.org/licenses>.
23 *
24 * The contents of this file may alternatively be used under the terms
25 * of the Common Development and Distribution License Version 1.0
26 * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
27 * in the VirtualBox distribution, in which case the provisions of the
28 * CDDL are applicable instead of those of the GPL.
29 *
30 * You may elect to license modified versions of this file under the
31 * terms and conditions of either the GPL or the CDDL or both.
32 *
33 * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
34 */
35
36#ifndef VBOX_INCLUDED_vmm_cpum_h
37#define VBOX_INCLUDED_vmm_cpum_h
38#ifndef RT_WITHOUT_PRAGMA_ONCE
39# pragma once
40#endif
41
42#include <VBox/types.h>
43#include <VBox/vmm/cpumctx.h>
44#include <VBox/vmm/stam.h>
45#include <VBox/vmm/vmapi.h>
46#include <VBox/vmm/cpum-common.h>
47
48
49/** @defgroup grp_cpum The CPU Monitor / Manager API
50 * @ingroup grp_vmm
51 * @{
52 */
53
54/**
55 * CPU Vendor.
56 */
57typedef enum CPUMCPUVENDOR
58{
59 CPUMCPUVENDOR_INVALID = 0,
60 CPUMCPUVENDOR_INTEL,
61 CPUMCPUVENDOR_AMD,
62 CPUMCPUVENDOR_VIA,
63 CPUMCPUVENDOR_CYRIX,
64 CPUMCPUVENDOR_SHANGHAI,
65 CPUMCPUVENDOR_HYGON,
66 CPUMCPUVENDOR_APPLE, /**< ARM */
67 CPUMCPUVENDOR_UNKNOWN,
68 /** 32bit hackishness. */
69 CPUMCPUVENDOR_32BIT_HACK = 0x7fffffff
70} CPUMCPUVENDOR;
71
72
73/**
74 * CPU architecture.
75 */
76typedef enum CPUMARCH
77{
78 /** Invalid zero value. */
79 kCpumArch_Invalid = 0,
80 /** x86 based architecture (includes 64-bit). */
81 kCpumArch_X86,
82 /** ARM based architecture (includs both AArch32 and AArch64). */
83 kCpumArch_Arm,
84
85 /** @todo RiscV, Mips, ... ;). */
86
87 /*
88 * Unknown.
89 */
90 kCpumArch_Unknown,
91
92 kCpumArch_32BitHack = 0x7fffffff
93} CPUMARCH;
94
95
96/**
97 * CPU microarchitectures and in processor generations.
98 *
99 * @remarks The separation here is sometimes a little bit too finely grained,
100 * and the differences is more like processor generation than micro
101 * arch. This can be useful, so we'll provide functions for getting at
102 * more coarse grained info.
103 */
104typedef enum CPUMMICROARCH
105{
106 kCpumMicroarch_Invalid = 0,
107
108 /*
109 * x86 and AMD64 CPUs.
110 */
111
112 kCpumMicroarch_Intel_First,
113
114 kCpumMicroarch_Intel_8086 = kCpumMicroarch_Intel_First,
115 kCpumMicroarch_Intel_80186,
116 kCpumMicroarch_Intel_80286,
117 kCpumMicroarch_Intel_80386,
118 kCpumMicroarch_Intel_80486,
119 kCpumMicroarch_Intel_P5,
120
121 kCpumMicroarch_Intel_P6_Core_Atom_First,
122 kCpumMicroarch_Intel_P6 = kCpumMicroarch_Intel_P6_Core_Atom_First,
123 kCpumMicroarch_Intel_P6_II,
124 kCpumMicroarch_Intel_P6_III,
125
126 kCpumMicroarch_Intel_P6_M_Banias,
127 kCpumMicroarch_Intel_P6_M_Dothan,
128 kCpumMicroarch_Intel_Core_Yonah, /**< Core, also known as Enhanced Pentium M. */
129
130 kCpumMicroarch_Intel_Core2_First,
131 kCpumMicroarch_Intel_Core2_Merom = kCpumMicroarch_Intel_Core2_First, /**< 65nm, Merom/Conroe/Kentsfield/Tigerton */
132 kCpumMicroarch_Intel_Core2_Penryn, /**< 45nm, Penryn/Wolfdale/Yorkfield/Harpertown */
133 kCpumMicroarch_Intel_Core2_End,
134
135 kCpumMicroarch_Intel_Core7_First,
136 kCpumMicroarch_Intel_Core7_Nehalem = kCpumMicroarch_Intel_Core7_First,
137 kCpumMicroarch_Intel_Core7_Westmere,
138 kCpumMicroarch_Intel_Core7_SandyBridge,
139 kCpumMicroarch_Intel_Core7_IvyBridge,
140 kCpumMicroarch_Intel_Core7_Haswell,
141 kCpumMicroarch_Intel_Core7_Broadwell,
142 kCpumMicroarch_Intel_Core7_Skylake,
143 kCpumMicroarch_Intel_Core7_KabyLake,
144 kCpumMicroarch_Intel_Core7_CoffeeLake,
145 kCpumMicroarch_Intel_Core7_WhiskeyLake,
146 kCpumMicroarch_Intel_Core7_CascadeLake,
147 kCpumMicroarch_Intel_Core7_CannonLake, /**< Limited 10nm. */
148 kCpumMicroarch_Intel_Core7_CometLake, /**< 10th gen, 14nm desktop + high power mobile. */
149 kCpumMicroarch_Intel_Core7_IceLake, /**< 10th gen, 10nm mobile and some Xeons. Actually 'Sunny Cove' march. */
150 kCpumMicroarch_Intel_Core7_SunnyCove = kCpumMicroarch_Intel_Core7_IceLake,
151 kCpumMicroarch_Intel_Core7_RocketLake, /**< 11th gen, 14nm desktop + high power mobile. Aka 'Cypress Cove', backport of 'Willow Cove' to 14nm. */
152 kCpumMicroarch_Intel_Core7_CypressCove = kCpumMicroarch_Intel_Core7_RocketLake,
153 kCpumMicroarch_Intel_Core7_TigerLake, /**< 11th gen, 10nm mobile. Actually 'Willow Cove' march. */
154 kCpumMicroarch_Intel_Core7_WillowCove = kCpumMicroarch_Intel_Core7_TigerLake,
155 kCpumMicroarch_Intel_Core7_AlderLake, /**< 12th gen, 10nm all platforms(?). */
156 kCpumMicroarch_Intel_Core7_SapphireRapids, /**< 12th? gen, 10nm server? */
157 kCpumMicroarch_Intel_Core7_End,
158
159 kCpumMicroarch_Intel_Atom_First,
160 kCpumMicroarch_Intel_Atom_Bonnell = kCpumMicroarch_Intel_Atom_First,
161 kCpumMicroarch_Intel_Atom_Lincroft, /**< Second generation bonnell (44nm). */
162 kCpumMicroarch_Intel_Atom_Saltwell, /**< 32nm shrink of Bonnell. */
163 kCpumMicroarch_Intel_Atom_Silvermont, /**< 22nm */
164 kCpumMicroarch_Intel_Atom_Airmount, /**< 14nm */
165 kCpumMicroarch_Intel_Atom_Goldmont, /**< 14nm */
166 kCpumMicroarch_Intel_Atom_GoldmontPlus, /**< 14nm */
167 kCpumMicroarch_Intel_Atom_Unknown,
168 kCpumMicroarch_Intel_Atom_End,
169
170
171 kCpumMicroarch_Intel_Phi_First,
172 kCpumMicroarch_Intel_Phi_KnightsFerry = kCpumMicroarch_Intel_Phi_First,
173 kCpumMicroarch_Intel_Phi_KnightsCorner,
174 kCpumMicroarch_Intel_Phi_KnightsLanding,
175 kCpumMicroarch_Intel_Phi_KnightsHill,
176 kCpumMicroarch_Intel_Phi_KnightsMill,
177 kCpumMicroarch_Intel_Phi_End,
178
179 kCpumMicroarch_Intel_P6_Core_Atom_End,
180
181 kCpumMicroarch_Intel_NB_First,
182 kCpumMicroarch_Intel_NB_Willamette = kCpumMicroarch_Intel_NB_First, /**< 180nm */
183 kCpumMicroarch_Intel_NB_Northwood, /**< 130nm */
184 kCpumMicroarch_Intel_NB_Prescott, /**< 90nm */
185 kCpumMicroarch_Intel_NB_Prescott2M, /**< 90nm */
186 kCpumMicroarch_Intel_NB_CedarMill, /**< 65nm */
187 kCpumMicroarch_Intel_NB_Gallatin, /**< 90nm Xeon, Pentium 4 Extreme Edition ("Emergency Edition"). */
188 kCpumMicroarch_Intel_NB_Unknown,
189 kCpumMicroarch_Intel_NB_End,
190
191 kCpumMicroarch_Intel_Unknown,
192 kCpumMicroarch_Intel_End,
193
194 kCpumMicroarch_AMD_First,
195 kCpumMicroarch_AMD_Am286 = kCpumMicroarch_AMD_First,
196 kCpumMicroarch_AMD_Am386,
197 kCpumMicroarch_AMD_Am486,
198 kCpumMicroarch_AMD_Am486Enh, /**< Covers Am5x86 as well. */
199 kCpumMicroarch_AMD_K5,
200 kCpumMicroarch_AMD_K6,
201
202 kCpumMicroarch_AMD_K7_First,
203 kCpumMicroarch_AMD_K7_Palomino = kCpumMicroarch_AMD_K7_First,
204 kCpumMicroarch_AMD_K7_Spitfire,
205 kCpumMicroarch_AMD_K7_Thunderbird,
206 kCpumMicroarch_AMD_K7_Morgan,
207 kCpumMicroarch_AMD_K7_Thoroughbred,
208 kCpumMicroarch_AMD_K7_Barton,
209 kCpumMicroarch_AMD_K7_Unknown,
210 kCpumMicroarch_AMD_K7_End,
211
212 kCpumMicroarch_AMD_K8_First,
213 kCpumMicroarch_AMD_K8_130nm = kCpumMicroarch_AMD_K8_First, /**< 130nm Clawhammer, Sledgehammer, Newcastle, Paris, Odessa, Dublin */
214 kCpumMicroarch_AMD_K8_90nm, /**< 90nm shrink */
215 kCpumMicroarch_AMD_K8_90nm_DualCore, /**< 90nm with two cores. */
216 kCpumMicroarch_AMD_K8_90nm_AMDV, /**< 90nm with AMD-V (usually) and two cores (usually). */
217 kCpumMicroarch_AMD_K8_65nm, /**< 65nm shrink. */
218 kCpumMicroarch_AMD_K8_End,
219
220 kCpumMicroarch_AMD_K10,
221 kCpumMicroarch_AMD_K10_Lion,
222 kCpumMicroarch_AMD_K10_Llano,
223 kCpumMicroarch_AMD_Bobcat,
224 kCpumMicroarch_AMD_Jaguar,
225
226 kCpumMicroarch_AMD_15h_First,
227 kCpumMicroarch_AMD_15h_Bulldozer = kCpumMicroarch_AMD_15h_First,
228 kCpumMicroarch_AMD_15h_Piledriver,
229 kCpumMicroarch_AMD_15h_Steamroller, /**< Yet to be released, might have different family. */
230 kCpumMicroarch_AMD_15h_Excavator, /**< Yet to be released, might have different family. */
231 kCpumMicroarch_AMD_15h_Unknown,
232 kCpumMicroarch_AMD_15h_End,
233
234 kCpumMicroarch_AMD_16h_First,
235 kCpumMicroarch_AMD_16h_End,
236
237 kCpumMicroarch_AMD_Zen_First,
238 kCpumMicroarch_AMD_Zen_Ryzen = kCpumMicroarch_AMD_Zen_First,
239 kCpumMicroarch_AMD_Zen_End,
240
241 kCpumMicroarch_AMD_Unknown,
242 kCpumMicroarch_AMD_End,
243
244 kCpumMicroarch_Hygon_First,
245 kCpumMicroarch_Hygon_Dhyana = kCpumMicroarch_Hygon_First,
246 kCpumMicroarch_Hygon_Unknown,
247 kCpumMicroarch_Hygon_End,
248
249 kCpumMicroarch_VIA_First,
250 kCpumMicroarch_Centaur_C6 = kCpumMicroarch_VIA_First,
251 kCpumMicroarch_Centaur_C2,
252 kCpumMicroarch_Centaur_C3,
253 kCpumMicroarch_VIA_C3_M2,
254 kCpumMicroarch_VIA_C3_C5A, /**< 180nm Samuel - Cyrix III, C3, 1GigaPro. */
255 kCpumMicroarch_VIA_C3_C5B, /**< 150nm Samuel 2 - Cyrix III, C3, 1GigaPro, Eden ESP, XP 2000+. */
256 kCpumMicroarch_VIA_C3_C5C, /**< 130nm Ezra - C3, Eden ESP. */
257 kCpumMicroarch_VIA_C3_C5N, /**< 130nm Ezra-T - C3. */
258 kCpumMicroarch_VIA_C3_C5XL, /**< 130nm Nehemiah - C3, Eden ESP, Eden-N. */
259 kCpumMicroarch_VIA_C3_C5P, /**< 130nm Nehemiah+ - C3. */
260 kCpumMicroarch_VIA_C7_C5J, /**< 90nm Esther - C7, C7-D, C7-M, Eden, Eden ULV. */
261 kCpumMicroarch_VIA_Isaiah,
262 kCpumMicroarch_VIA_Unknown,
263 kCpumMicroarch_VIA_End,
264
265 kCpumMicroarch_Shanghai_First,
266 kCpumMicroarch_Shanghai_Wudaokou = kCpumMicroarch_Shanghai_First,
267 kCpumMicroarch_Shanghai_Unknown,
268 kCpumMicroarch_Shanghai_End,
269
270 kCpumMicroarch_Cyrix_First,
271 kCpumMicroarch_Cyrix_5x86 = kCpumMicroarch_Cyrix_First,
272 kCpumMicroarch_Cyrix_M1,
273 kCpumMicroarch_Cyrix_MediaGX,
274 kCpumMicroarch_Cyrix_MediaGXm,
275 kCpumMicroarch_Cyrix_M2,
276 kCpumMicroarch_Cyrix_Unknown,
277 kCpumMicroarch_Cyrix_End,
278
279 kCpumMicroarch_NEC_First,
280 kCpumMicroarch_NEC_V20 = kCpumMicroarch_NEC_First,
281 kCpumMicroarch_NEC_V30,
282 kCpumMicroarch_NEC_End,
283
284 /*
285 * ARM CPUs.
286 */
287 kCpumMicroarch_Apple_First,
288 kCpumMicroarch_Apple_M1 = kCpumMicroarch_Apple_First,
289 kCpumMicroarch_Apple_M2,
290 kCpumMicroarch_Apple_End,
291
292 /*
293 * Unknown.
294 */
295 kCpumMicroarch_Unknown,
296
297 kCpumMicroarch_32BitHack = 0x7fffffff
298} CPUMMICROARCH;
299
300
301/** Predicate macro for catching netburst CPUs. */
302#define CPUMMICROARCH_IS_INTEL_NETBURST(a_enmMicroarch) \
303 ((a_enmMicroarch) >= kCpumMicroarch_Intel_NB_First && (a_enmMicroarch) <= kCpumMicroarch_Intel_NB_End)
304
305/** Predicate macro for catching Core7 CPUs. */
306#define CPUMMICROARCH_IS_INTEL_CORE7(a_enmMicroarch) \
307 ((a_enmMicroarch) >= kCpumMicroarch_Intel_Core7_First && (a_enmMicroarch) <= kCpumMicroarch_Intel_Core7_End)
308
309/** Predicate macro for catching Core 2 CPUs. */
310#define CPUMMICROARCH_IS_INTEL_CORE2(a_enmMicroarch) \
311 ((a_enmMicroarch) >= kCpumMicroarch_Intel_Core2_First && (a_enmMicroarch) <= kCpumMicroarch_Intel_Core2_End)
312
313/** Predicate macro for catching Atom CPUs, Silvermont and upwards. */
314#define CPUMMICROARCH_IS_INTEL_SILVERMONT_PLUS(a_enmMicroarch) \
315 ((a_enmMicroarch) >= kCpumMicroarch_Intel_Atom_Silvermont && (a_enmMicroarch) <= kCpumMicroarch_Intel_Atom_End)
316
317/** Predicate macro for catching AMD Family OFh CPUs (aka K8). */
318#define CPUMMICROARCH_IS_AMD_FAM_0FH(a_enmMicroarch) \
319 ((a_enmMicroarch) >= kCpumMicroarch_AMD_K8_First && (a_enmMicroarch) <= kCpumMicroarch_AMD_K8_End)
320
321/** Predicate macro for catching AMD Family 10H CPUs (aka K10). */
322#define CPUMMICROARCH_IS_AMD_FAM_10H(a_enmMicroarch) ((a_enmMicroarch) == kCpumMicroarch_AMD_K10)
323
324/** Predicate macro for catching AMD Family 11H CPUs (aka Lion). */
325#define CPUMMICROARCH_IS_AMD_FAM_11H(a_enmMicroarch) ((a_enmMicroarch) == kCpumMicroarch_AMD_K10_Lion)
326
327/** Predicate macro for catching AMD Family 12H CPUs (aka Llano). */
328#define CPUMMICROARCH_IS_AMD_FAM_12H(a_enmMicroarch) ((a_enmMicroarch) == kCpumMicroarch_AMD_K10_Llano)
329
330/** Predicate macro for catching AMD Family 14H CPUs (aka Bobcat). */
331#define CPUMMICROARCH_IS_AMD_FAM_14H(a_enmMicroarch) ((a_enmMicroarch) == kCpumMicroarch_AMD_Bobcat)
332
333/** Predicate macro for catching AMD Family 15H CPUs (bulldozer and it's
334 * decendants). */
335#define CPUMMICROARCH_IS_AMD_FAM_15H(a_enmMicroarch) \
336 ((a_enmMicroarch) >= kCpumMicroarch_AMD_15h_First && (a_enmMicroarch) <= kCpumMicroarch_AMD_15h_End)
337
338/** Predicate macro for catching AMD Family 16H CPUs. */
339#define CPUMMICROARCH_IS_AMD_FAM_16H(a_enmMicroarch) \
340 ((a_enmMicroarch) >= kCpumMicroarch_AMD_16h_First && (a_enmMicroarch) <= kCpumMicroarch_AMD_16h_End)
341
342/** Predicate macro for catching AMD Zen Family CPUs. */
343#define CPUMMICROARCH_IS_AMD_FAM_ZEN(a_enmMicroarch) \
344 ((a_enmMicroarch) >= kCpumMicroarch_AMD_Zen_First && (a_enmMicroarch) <= kCpumMicroarch_AMD_Zen_End)
345
346/** Predicate macro for catching Apple (ARM) CPUs. */
347#define CPUMMICROARCH_IS_APPLE(a_enmMicroarch) \
348 ((a_enmMicroarch) >= kCpumMicroarch_Apple_First && (a_enmMicroarch) <= kCpumMicroarch_Apple_End)
349
350
351/**
352 * Common portion of the CPU feature structures.
353 */
354typedef struct CPUMFEATURESCOMMON
355{
356 /** The CPU vendor (CPUMCPUVENDOR). */
357 uint8_t enmCpuVendor;
358 /** The CPU family. */
359 uint8_t uFamily;
360 /** The CPU model. */
361 uint8_t uModel;
362 /** The CPU stepping. */
363 uint8_t uStepping;
364 /** The microarchitecture. */
365#ifndef VBOX_FOR_DTRACE_LIB
366 CPUMMICROARCH enmMicroarch;
367#else
368 uint32_t enmMicroarch;
369#endif
370 /** The maximum physical address width of the CPU. */
371 uint8_t cMaxPhysAddrWidth;
372 /** The maximum linear address width of the CPU. */
373 uint8_t cMaxLinearAddrWidth;
374} CPUMFEATURESCOMMON;
375
376/**
377 * CPU features and quirks for X86.
378 *
379 * This is mostly exploded CPUID info.
380 */
381typedef struct CPUMFEATURESX86
382{
383 /** The CPU vendor (CPUMCPUVENDOR). */
384 uint8_t enmCpuVendor;
385 /** The CPU family. */
386 uint8_t uFamily;
387 /** The CPU model. */
388 uint8_t uModel;
389 /** The CPU stepping. */
390 uint8_t uStepping;
391 /** The microarchitecture. */
392#ifndef VBOX_FOR_DTRACE_LIB
393 CPUMMICROARCH enmMicroarch;
394#else
395 uint32_t enmMicroarch;
396#endif
397 /** The maximum physical address width of the CPU. */
398 uint8_t cMaxPhysAddrWidth;
399 /** The maximum linear address width of the CPU. */
400 uint8_t cMaxLinearAddrWidth;
401 /** Max size of the extended state (or FPU state if no XSAVE). */
402 uint16_t cbMaxExtendedState;
403
404 /** Supports MSRs. */
405 uint32_t fMsr : 1;
406 /** Supports the page size extension (4/2 MB pages). */
407 uint32_t fPse : 1;
408 /** Supports 36-bit page size extension (4 MB pages can map memory above
409 * 4GB). */
410 uint32_t fPse36 : 1;
411 /** Supports physical address extension (PAE). */
412 uint32_t fPae : 1;
413 /** Supports page-global extension (PGE). */
414 uint32_t fPge : 1;
415 /** Page attribute table (PAT) support (page level cache control). */
416 uint32_t fPat : 1;
417 /** Supports the FXSAVE and FXRSTOR instructions. */
418 uint32_t fFxSaveRstor : 1;
419 /** Supports the XSAVE and XRSTOR instructions. */
420 uint32_t fXSaveRstor : 1;
421 /** Supports the XSAVEOPT instruction. */
422 uint32_t fXSaveOpt : 1;
423 /** The XSAVE/XRSTOR bit in CR4 has been set (only applicable for host!). */
424 uint32_t fOpSysXSaveRstor : 1;
425 /** Supports MMX. */
426 uint32_t fMmx : 1;
427 /** Supports AMD extensions to MMX instructions. */
428 uint32_t fAmdMmxExts : 1;
429 /** Supports SSE. */
430 uint32_t fSse : 1;
431 /** Supports SSE2. */
432 uint32_t fSse2 : 1;
433 /** Supports SSE3. */
434 uint32_t fSse3 : 1;
435 /** Supports SSSE3. */
436 uint32_t fSsse3 : 1;
437 /** Supports SSE4.1. */
438 uint32_t fSse41 : 1;
439 /** Supports SSE4.2. */
440 uint32_t fSse42 : 1;
441 /** Supports AVX. */
442 uint32_t fAvx : 1;
443 /** Supports AVX2. */
444 uint32_t fAvx2 : 1;
445 /** Supports AVX512 foundation. */
446 uint32_t fAvx512Foundation : 1;
447 /** Supports RDTSC. */
448 uint32_t fTsc : 1;
449 /** Intel SYSENTER/SYSEXIT support */
450 uint32_t fSysEnter : 1;
451 /** Supports MTRR. */
452 uint32_t fMtrr : 1;
453 /** First generation APIC. */
454 uint32_t fApic : 1;
455 /** Second generation APIC. */
456 uint32_t fX2Apic : 1;
457 /** Hypervisor present. */
458 uint32_t fHypervisorPresent : 1;
459 /** MWAIT & MONITOR instructions supported. */
460 uint32_t fMonitorMWait : 1;
461 /** MWAIT Extensions present. */
462 uint32_t fMWaitExtensions : 1;
463 /** Supports CMPXCHG8B. */
464 uint32_t fCmpXchg8b : 1;
465 /** Supports CMPXCHG16B in 64-bit mode. */
466 uint32_t fCmpXchg16b : 1;
467 /** Supports CLFLUSH. */
468 uint32_t fClFlush : 1;
469 /** Supports CLFLUSHOPT. */
470 uint32_t fClFlushOpt : 1;
471 /** Supports IA32_PRED_CMD.IBPB. */
472 uint32_t fIbpb : 1;
473 /** Supports IA32_SPEC_CTRL.IBRS. */
474 uint32_t fIbrs : 1;
475 /** Supports IA32_SPEC_CTRL.STIBP. */
476 uint32_t fStibp : 1;
477 /** Supports IA32_FLUSH_CMD. */
478 uint32_t fFlushCmd : 1;
479 /** Supports IA32_ARCH_CAP. */
480 uint32_t fArchCap : 1;
481 /** Supports MD_CLEAR functionality (VERW, IA32_FLUSH_CMD). */
482 uint32_t fMdsClear : 1;
483 /** Supports PCID. */
484 uint32_t fPcid : 1;
485 /** Supports INVPCID. */
486 uint32_t fInvpcid : 1;
487 /** Supports read/write FSGSBASE instructions. */
488 uint32_t fFsGsBase : 1;
489 /** Supports BMI1 instructions (ANDN, BEXTR, BLSI, BLSMSK, BLSR, and TZCNT). */
490 uint32_t fBmi1 : 1;
491 /** Supports BMI2 instructions (BZHI, MULX, PDEP, PEXT, RORX, SARX, SHRX,
492 * and SHLX). */
493 uint32_t fBmi2 : 1;
494 /** Supports POPCNT instruction. */
495 uint32_t fPopCnt : 1;
496 /** Supports RDRAND instruction. */
497 uint32_t fRdRand : 1;
498 /** Supports RDSEED instruction. */
499 uint32_t fRdSeed : 1;
500 /** Supports Hardware Lock Elision (HLE). */
501 uint32_t fHle : 1;
502 /** Supports Restricted Transactional Memory (RTM - XBEGIN, XEND, XABORT). */
503 uint32_t fRtm : 1;
504 /** Supports PCLMULQDQ instruction. */
505 uint32_t fPclMul : 1;
506 /** Supports AES-NI (six AESxxx instructions). */
507 uint32_t fAesNi : 1;
508 /** Support MOVBE instruction. */
509 uint32_t fMovBe : 1;
510 /** Support SHA instructions. */
511 uint32_t fSha : 1;
512 /** Support ADX instructions. */
513 uint32_t fAdx : 1;
514 /** Supports FMA. */
515 uint32_t fFma : 1;
516 /** Supports F16C. */
517 uint32_t fF16c : 1;
518
519 /** Supports AMD 3DNow instructions. */
520 uint32_t f3DNow : 1;
521 /** Supports the 3DNow/AMD64 prefetch instructions (could be nops). */
522 uint32_t f3DNowPrefetch : 1;
523
524 /** AMD64: Supports long mode. */
525 uint32_t fLongMode : 1;
526 /** AMD64: SYSCALL/SYSRET support. */
527 uint32_t fSysCall : 1;
528 /** AMD64: No-execute page table bit. */
529 uint32_t fNoExecute : 1;
530 /** AMD64: Supports LAHF & SAHF instructions in 64-bit mode. */
531 uint32_t fLahfSahf : 1;
532 /** AMD64: Supports RDTSCP. */
533 uint32_t fRdTscP : 1;
534 /** AMD64: Supports MOV CR8 in 32-bit code (lock prefix hack). */
535 uint32_t fMovCr8In32Bit : 1;
536 /** AMD64: Supports XOP (similar to VEX3/AVX). */
537 uint32_t fXop : 1;
538 /** AMD64: Supports ABM, i.e. the LZCNT instruction. */
539 uint32_t fAbm : 1;
540 /** AMD64: Supports TBM (BEXTR, BLCFILL, BLCI, BLCIC, BLCMSK, BLCS,
541 * BLSFILL, BLSIC, T1MSKC, and TZMSK). */
542 uint32_t fTbm : 1;
543
544 /** Indicates that FPU instruction and data pointers may leak.
545 * This generally applies to recent AMD CPUs, where the FPU IP and DP pointer
546 * is only saved and restored if an exception is pending. */
547 uint32_t fLeakyFxSR : 1;
548
549 /** Supports VEX instruction encoding (AVX, BMI, etc.). */
550 uint32_t fVex : 1;
551
552 /** AMD64: Supports AMD SVM. */
553 uint32_t fSvm : 1;
554
555 /** Support for Intel VMX. */
556 uint32_t fVmx : 1;
557
558 /** Indicates that speculative execution control CPUID bits and MSRs are exposed.
559 * The details are different for Intel and AMD but both have similar
560 * functionality. */
561 uint32_t fSpeculationControl : 1;
562
563 /** MSR_IA32_ARCH_CAPABILITIES: RDCL_NO (bit 0).
564 * @remarks Only safe use after CPUM ring-0 init! */
565 uint32_t fArchRdclNo : 1;
566 /** MSR_IA32_ARCH_CAPABILITIES: IBRS_ALL (bit 1).
567 * @remarks Only safe use after CPUM ring-0 init! */
568 uint32_t fArchIbrsAll : 1;
569 /** MSR_IA32_ARCH_CAPABILITIES: RSB Override (bit 2).
570 * @remarks Only safe use after CPUM ring-0 init! */
571 uint32_t fArchRsbOverride : 1;
572 /** MSR_IA32_ARCH_CAPABILITIES: RSB Override (bit 3).
573 * @remarks Only safe use after CPUM ring-0 init! */
574 uint32_t fArchVmmNeedNotFlushL1d : 1;
575 /** MSR_IA32_ARCH_CAPABILITIES: MDS_NO (bit 4).
576 * @remarks Only safe use after CPUM ring-0 init! */
577 uint32_t fArchMdsNo : 1;
578
579 /** Alignment padding / reserved for future use (96 bits total, plus 12 bytes
580 * prior to the bit fields -> total of 24 bytes) */
581 uint32_t fPadding0 : 19;
582
583
584 /** @name SVM
585 * @{ */
586 /** SVM: Supports Nested-paging. */
587 uint32_t fSvmNestedPaging : 1;
588 /** SVM: Support LBR (Last Branch Record) virtualization. */
589 uint32_t fSvmLbrVirt : 1;
590 /** SVM: Supports SVM lock. */
591 uint32_t fSvmSvmLock : 1;
592 /** SVM: Supports Next RIP save. */
593 uint32_t fSvmNextRipSave : 1;
594 /** SVM: Supports TSC rate MSR. */
595 uint32_t fSvmTscRateMsr : 1;
596 /** SVM: Supports VMCB clean bits. */
597 uint32_t fSvmVmcbClean : 1;
598 /** SVM: Supports Flush-by-ASID. */
599 uint32_t fSvmFlusbByAsid : 1;
600 /** SVM: Supports decode assist. */
601 uint32_t fSvmDecodeAssists : 1;
602 /** SVM: Supports Pause filter. */
603 uint32_t fSvmPauseFilter : 1;
604 /** SVM: Supports Pause filter threshold. */
605 uint32_t fSvmPauseFilterThreshold : 1;
606 /** SVM: Supports AVIC (Advanced Virtual Interrupt Controller). */
607 uint32_t fSvmAvic : 1;
608 /** SVM: Supports Virtualized VMSAVE/VMLOAD. */
609 uint32_t fSvmVirtVmsaveVmload : 1;
610 /** SVM: Supports VGIF (Virtual Global Interrupt Flag). */
611 uint32_t fSvmVGif : 1;
612 /** SVM: Supports GMET (Guest Mode Execute Trap Extension). */
613 uint32_t fSvmGmet : 1;
614 /** SVM: Supports AVIC in x2APIC mode. */
615 uint32_t fSvmX2Avic : 1;
616 /** SVM: Supports SSSCheck (SVM Supervisor Shadow Stack). */
617 uint32_t fSvmSSSCheck : 1;
618 /** SVM: Supports SPEC_CTRL virtualization. */
619 uint32_t fSvmSpecCtrl : 1;
620 /** SVM: Supports Read-Only Guest Page Table feature. */
621 uint32_t fSvmRoGpt : 1;
622 /** SVM: Supports HOST_MCE_OVERRIDE. */
623 uint32_t fSvmHostMceOverride : 1;
624 /** SVM: Supports TlbiCtl (INVLPGB/TLBSYNC in VMCB and TLBSYNC intercept). */
625 uint32_t fSvmTlbiCtl : 1;
626 /** SVM: Supports NMI virtualization. */
627 uint32_t fSvmVNmi : 1;
628 /** SVM: Supports IBS virtualizaiton. */
629 uint32_t fSvmIbsVirt : 1;
630 /** SVM: Supports Extended LVT AVIC access changes. */
631 uint32_t fSvmExtLvtAvicAccessChg : 1;
632 /** SVM: Supports Guest VMCB address check. */
633 uint32_t fSvmNstVirtVmcbAddrChk : 1;
634 /** SVM: Supports Bus Lock Threshold. */
635 uint32_t fSvmBusLockThreshold : 1;
636 /** SVM: Padding / reserved for future features (64 bits total w/ max ASID). */
637 uint32_t fSvmPadding0 : 7;
638 /** SVM: Maximum supported ASID. */
639 uint32_t uSvmMaxAsid;
640 /** @} */
641
642
643 /** VMX: Maximum physical address width. */
644 uint32_t cVmxMaxPhysAddrWidth : 8;
645
646 /** @name VMX basic controls.
647 * @{ */
648 /** VMX: Supports INS/OUTS VM-exit instruction info. */
649 uint32_t fVmxInsOutInfo : 1;
650 /** @} */
651
652 /** @name VMX Pin-based controls.
653 * @{ */
654 /** VMX: Supports external interrupt VM-exit. */
655 uint32_t fVmxExtIntExit : 1;
656 /** VMX: Supports NMI VM-exit. */
657 uint32_t fVmxNmiExit : 1;
658 /** VMX: Supports Virtual NMIs. */
659 uint32_t fVmxVirtNmi : 1;
660 /** VMX: Supports preemption timer. */
661 uint32_t fVmxPreemptTimer : 1;
662 /** VMX: Supports posted interrupts. */
663 uint32_t fVmxPostedInt : 1;
664 /** @} */
665
666 /** @name VMX Processor-based controls.
667 * @{ */
668 /** VMX: Supports Interrupt-window exiting. */
669 uint32_t fVmxIntWindowExit : 1;
670 /** VMX: Supports TSC offsetting. */
671 uint32_t fVmxTscOffsetting : 1;
672 /** VMX: Supports HLT exiting. */
673 uint32_t fVmxHltExit : 1;
674 /** VMX: Supports INVLPG exiting. */
675 uint32_t fVmxInvlpgExit : 1;
676 /** VMX: Supports MWAIT exiting. */
677 uint32_t fVmxMwaitExit : 1;
678 /** VMX: Supports RDPMC exiting. */
679 uint32_t fVmxRdpmcExit : 1;
680 /** VMX: Supports RDTSC exiting. */
681 uint32_t fVmxRdtscExit : 1;
682 /** VMX: Supports CR3-load exiting. */
683 uint32_t fVmxCr3LoadExit : 1;
684 /** VMX: Supports CR3-store exiting. */
685 uint32_t fVmxCr3StoreExit : 1;
686 /** VMX: Supports tertiary processor-based VM-execution controls. */
687 uint32_t fVmxTertiaryExecCtls : 1;
688 /** VMX: Supports CR8-load exiting. */
689 uint32_t fVmxCr8LoadExit : 1;
690 /** VMX: Supports CR8-store exiting. */
691 uint32_t fVmxCr8StoreExit : 1;
692 /** VMX: Supports TPR shadow. */
693 uint32_t fVmxUseTprShadow : 1;
694 /** VMX: Supports NMI-window exiting. */
695 uint32_t fVmxNmiWindowExit : 1;
696 /** VMX: Supports Mov-DRx exiting. */
697 uint32_t fVmxMovDRxExit : 1;
698 /** VMX: Supports Unconditional I/O exiting. */
699 uint32_t fVmxUncondIoExit : 1;
700 /** VMX: Supportgs I/O bitmaps. */
701 uint32_t fVmxUseIoBitmaps : 1;
702 /** VMX: Supports Monitor Trap Flag. */
703 uint32_t fVmxMonitorTrapFlag : 1;
704 /** VMX: Supports MSR bitmap. */
705 uint32_t fVmxUseMsrBitmaps : 1;
706 /** VMX: Supports MONITOR exiting. */
707 uint32_t fVmxMonitorExit : 1;
708 /** VMX: Supports PAUSE exiting. */
709 uint32_t fVmxPauseExit : 1;
710 /** VMX: Supports secondary processor-based VM-execution controls. */
711 uint32_t fVmxSecondaryExecCtls : 1;
712 /** @} */
713
714 /** @name VMX Secondary processor-based controls.
715 * @{ */
716 /** VMX: Supports virtualize-APIC access. */
717 uint32_t fVmxVirtApicAccess : 1;
718 /** VMX: Supports EPT (Extended Page Tables). */
719 uint32_t fVmxEpt : 1;
720 /** VMX: Supports descriptor-table exiting. */
721 uint32_t fVmxDescTableExit : 1;
722 /** VMX: Supports RDTSCP. */
723 uint32_t fVmxRdtscp : 1;
724 /** VMX: Supports virtualize-x2APIC mode. */
725 uint32_t fVmxVirtX2ApicMode : 1;
726 /** VMX: Supports VPID. */
727 uint32_t fVmxVpid : 1;
728 /** VMX: Supports WBIND exiting. */
729 uint32_t fVmxWbinvdExit : 1;
730 /** VMX: Supports Unrestricted guest. */
731 uint32_t fVmxUnrestrictedGuest : 1;
732 /** VMX: Supports APIC-register virtualization. */
733 uint32_t fVmxApicRegVirt : 1;
734 /** VMX: Supports virtual-interrupt delivery. */
735 uint32_t fVmxVirtIntDelivery : 1;
736 /** VMX: Supports Pause-loop exiting. */
737 uint32_t fVmxPauseLoopExit : 1;
738 /** VMX: Supports RDRAND exiting. */
739 uint32_t fVmxRdrandExit : 1;
740 /** VMX: Supports INVPCID. */
741 uint32_t fVmxInvpcid : 1;
742 /** VMX: Supports VM functions. */
743 uint32_t fVmxVmFunc : 1;
744 /** VMX: Supports VMCS shadowing. */
745 uint32_t fVmxVmcsShadowing : 1;
746 /** VMX: Supports RDSEED exiting. */
747 uint32_t fVmxRdseedExit : 1;
748 /** VMX: Supports PML. */
749 uint32_t fVmxPml : 1;
750 /** VMX: Supports EPT-violations \#VE. */
751 uint32_t fVmxEptXcptVe : 1;
752 /** VMX: Supports conceal VMX from PT. */
753 uint32_t fVmxConcealVmxFromPt : 1;
754 /** VMX: Supports XSAVES/XRSTORS. */
755 uint32_t fVmxXsavesXrstors : 1;
756 /** VMX: Supports PASID translation. */
757 uint32_t fVmxPasidTranslate : 1;
758 /** VMX: Supports mode-based execute control for EPT. */
759 uint32_t fVmxModeBasedExecuteEpt : 1;
760 /** VMX: Supports sub-page write permissions for EPT. */
761 uint32_t fVmxSppEpt : 1;
762 /** VMX: Supports Intel PT to output guest-physical addresses for EPT. */
763 uint32_t fVmxPtEpt : 1;
764 /** VMX: Supports TSC scaling. */
765 uint32_t fVmxUseTscScaling : 1;
766 /** VMX: Supports TPAUSE, UMONITOR, or UMWAIT. */
767 uint32_t fVmxUserWaitPause : 1;
768 /** VMX: Supports PCONFIG. */
769 uint32_t fVmxPconfig : 1;
770 /** VMX: Supports enclave (ENCLV) exiting. */
771 uint32_t fVmxEnclvExit : 1;
772 /** VMX: Supports VMM bus-lock detection. */
773 uint32_t fVmxBusLockDetect : 1;
774 /** VMX: Supports instruction timeout. */
775 uint32_t fVmxInstrTimeout : 1;
776 /** @} */
777
778 /** @name VMX Tertiary processor-based controls.
779 * @{ */
780 /** VMX: Supports LOADIWKEY exiting. */
781 uint32_t fVmxLoadIwKeyExit : 1;
782 /** VMX: Supports hypervisor-managed linear address translation (HLAT). */
783 uint32_t fVmxHlat : 1;
784 /** VMX: Supports EPT paging-write control. */
785 uint32_t fVmxEptPagingWrite : 1;
786 /** VMX: Supports Guest-paging verification. */
787 uint32_t fVmxGstPagingVerify : 1;
788 /** VMX: Supports IPI virtualization. */
789 uint32_t fVmxIpiVirt : 1;
790 /** VMX: Supports virtualize IA32_SPEC_CTRL. */
791 uint32_t fVmxVirtSpecCtrl : 1;
792 /** @} */
793
794 /** @name VMX VM-entry controls.
795 * @{ */
796 /** VMX: Supports load-debug controls on VM-entry. */
797 uint32_t fVmxEntryLoadDebugCtls : 1;
798 /** VMX: Supports IA32e mode guest. */
799 uint32_t fVmxIa32eModeGuest : 1;
800 /** VMX: Supports load guest EFER MSR on VM-entry. */
801 uint32_t fVmxEntryLoadEferMsr : 1;
802 /** VMX: Supports load guest PAT MSR on VM-entry. */
803 uint32_t fVmxEntryLoadPatMsr : 1;
804 /** @} */
805
806 /** @name VMX VM-exit controls.
807 * @{ */
808 /** VMX: Supports save debug controls on VM-exit. */
809 uint32_t fVmxExitSaveDebugCtls : 1;
810 /** VMX: Supports host-address space size. */
811 uint32_t fVmxHostAddrSpaceSize : 1;
812 /** VMX: Supports acknowledge external interrupt on VM-exit. */
813 uint32_t fVmxExitAckExtInt : 1;
814 /** VMX: Supports save guest PAT MSR on VM-exit. */
815 uint32_t fVmxExitSavePatMsr : 1;
816 /** VMX: Supports load hsot PAT MSR on VM-exit. */
817 uint32_t fVmxExitLoadPatMsr : 1;
818 /** VMX: Supports save guest EFER MSR on VM-exit. */
819 uint32_t fVmxExitSaveEferMsr : 1;
820 /** VMX: Supports load host EFER MSR on VM-exit. */
821 uint32_t fVmxExitLoadEferMsr : 1;
822 /** VMX: Supports save VMX preemption timer on VM-exit. */
823 uint32_t fVmxSavePreemptTimer : 1;
824 /** VMX: Supports secondary VM-exit controls. */
825 uint32_t fVmxSecondaryExitCtls : 1;
826 /** @} */
827
828 /** @name VMX Miscellaneous data.
829 * @{ */
830 /** VMX: Supports storing EFER.LMA into IA32e-mode guest field on VM-exit. */
831 uint32_t fVmxExitSaveEferLma : 1;
832 /** VMX: Whether Intel PT (Processor Trace) is supported in VMX mode or not. */
833 uint32_t fVmxPt : 1;
834 /** VMX: Supports VMWRITE to any valid VMCS field incl. read-only fields, otherwise
835 * VMWRITE cannot modify read-only VM-exit information fields. */
836 uint32_t fVmxVmwriteAll : 1;
837 /** VMX: Supports injection of software interrupts, ICEBP on VM-entry for zero
838 * length instructions. */
839 uint32_t fVmxEntryInjectSoftInt : 1;
840 /** @} */
841
842 /** VMX: Padding / reserved for future features. */
843 uint32_t fVmxPadding0 : 7;
844 /** VMX: Padding / reserved for future, making it a total of 128 bits. */
845 uint32_t fVmxPadding1;
846} CPUMFEATURESX86;
847#ifndef VBOX_FOR_DTRACE_LIB
848AssertCompileSize(CPUMFEATURESX86, 48);
849AssertCompileMembersAtSameOffset(CPUMFEATURESCOMMON, enmCpuVendor, CPUMFEATURESX86, enmCpuVendor);
850AssertCompileMembersAtSameOffset(CPUMFEATURESCOMMON, uFamily, CPUMFEATURESX86, uFamily);
851AssertCompileMembersAtSameOffset(CPUMFEATURESCOMMON, uModel, CPUMFEATURESX86, uModel);
852AssertCompileMembersAtSameOffset(CPUMFEATURESCOMMON, uStepping, CPUMFEATURESX86, uStepping);
853AssertCompileMembersAtSameOffset(CPUMFEATURESCOMMON, enmMicroarch, CPUMFEATURESX86, enmMicroarch);
854AssertCompileMembersAtSameOffset(CPUMFEATURESCOMMON, cMaxPhysAddrWidth, CPUMFEATURESX86, cMaxPhysAddrWidth);
855AssertCompileMembersAtSameOffset(CPUMFEATURESCOMMON, cMaxLinearAddrWidth, CPUMFEATURESX86, cMaxLinearAddrWidth);
856#endif
857
858/**
859 * CPU features and quirks for ARMv8.
860 *
861 * This is mostly exploded CPU feature register info.
862 */
863typedef struct CPUMFEATURESARMV8
864{
865 /** The CPU vendor (CPUMCPUVENDOR). */
866 uint8_t enmCpuVendor;
867 /** The CPU family. */
868 uint8_t uFamily;
869 /** The CPU model. */
870 uint8_t uModel;
871 /** The CPU stepping. */
872 uint8_t uStepping;
873 /** The microarchitecture. */
874#ifndef VBOX_FOR_DTRACE_LIB
875 CPUMMICROARCH enmMicroarch;
876#else
877 uint32_t enmMicroarch;
878#endif
879 /** The maximum physical address width of the CPU. */
880 uint8_t cMaxPhysAddrWidth;
881 /** The maximum linear address width of the CPU. */
882 uint8_t cMaxLinearAddrWidth;
883 uint16_t uPadding;
884
885 /** @name Granule sizes supported.
886 * @{ */
887 /** 4KiB translation granule size supported. */
888 uint32_t fTGran4K : 1;
889 /** 16KiB translation granule size supported. */
890 uint32_t fTGran16K : 1;
891 /** 64KiB translation granule size supported. */
892 uint32_t fTGran64K : 1;
893 /** @} */
894
895 /** @name pre-2020 Architecture Extensions.
896 * @{ */
897 /** Supports Advanced SIMD Extension (FEAT_AdvSIMD). */
898 uint32_t fAdvSimd : 1;
899 /** Supports Advanced SIMD AES instructions (FEAT_AES). */
900 uint32_t fAes : 1;
901 /** Supports Advanced SIMD PMULL instructions (FEAT_PMULL). */
902 uint32_t fPmull : 1;
903 /** Supports CP15Disable2 (FEAT_CP15DISABLE2). */
904 uint32_t fCp15Disable2 : 1;
905 /** Supports Cache Speculation Variant 2 (FEAT_CSV2). */
906 uint32_t fCsv2 : 1;
907 /** Supports Cache Speculation Variant 2, version 1.1 (FEAT_CSV2_1p1). */
908 uint32_t fCsv21p1 : 1;
909 /** Supports Cache Speculation Variant 2, version 1.2 (FEAT_CSV2_1p2). */
910 uint32_t fCsv21p2 : 1;
911 /** Supports Cache Speculation Variant 3 (FEAT_CSV3). */
912 uint32_t fCsv3 : 1;
913 /** Supports Data Gahtering Hint (FEAT_DGH). */
914 uint32_t fDgh : 1;
915 /** Supports Double Lock (FEAT_DoubleLock). */
916 uint32_t fDoubleLock : 1;
917 /** Supports Enhanced Translation Synchronization (FEAT_ETS2). */
918 uint32_t fEts2 : 1;
919 /** Supports Floating Point Extensions (FEAT_FP). */
920 uint32_t fFp : 1;
921 /** Supports IVIPT Extensions (FEAT_IVIPT). */
922 uint32_t fIvipt : 1;
923 /** Supports PC Sample-based Profiling Extension (FEAT_PCSRv8). */
924 uint32_t fPcsrV8 : 1;
925 /** Supports Speculation Restrictions instructions (FEAT_SPECRES). */
926 uint32_t fSpecres : 1;
927 /** Supports Reliability, Availability, and Serviceability (RAS) Extension (FEAT_RAS). */
928 uint32_t fRas : 1;
929 /** Supports Speculation Barrier (FEAT_SB). */
930 uint32_t fSb : 1;
931 /** Supports Advanced SIMD SHA1 instructions (FEAT_SHA1). */
932 uint32_t fSha1 : 1;
933 /** Supports Advanced SIMD SHA256 instructions (FEAT_SHA256). */
934 uint32_t fSha256 : 1;
935 /** Supports Speculation Store Bypass Safe (FEAT_SSBS). */
936 uint32_t fSsbs : 1;
937 /** Supports MRS and MSR instructions for Speculation Store Bypass Safe version 2 (FEAT_SSBS2). */
938 uint32_t fSsbs2 : 1;
939 /** Supports CRC32 instructions (FEAT_CRC32). */
940 uint32_t fCrc32 : 1;
941 /** Supports Intermediate chacing of trnslation table walks (FEAT_nTLBPA). */
942 uint32_t fNTlbpa : 1;
943 /** Supports debug with VHE (FEAT_Debugv8p1). */
944 uint32_t fDebugV8p1 : 1;
945 /** Supports Hierarchical permission disables in translation tables (FEAT_HPDS). */
946 uint32_t fHpds : 1;
947 /** Supports Limited ordering regions (FEAT_LOR). */
948 uint32_t fLor : 1;
949 /** Supports Lare Systems Extensons (FEAT_LSE). */
950 uint32_t fLse : 1;
951 /** Supports Privileged access never (FEAT_PAN). */
952 uint32_t fPan : 1;
953 /** Supports Armv8.1 PMU extensions (FEAT_PMUv3p1). */
954 uint32_t fPmuV3p1 : 1;
955 /** Supports Advanced SIMD rouding double multiply accumulate instructions (FEAT_RDM). */
956 uint32_t fRdm : 1;
957 /** Supports hardware management of the Access flag and dirty state (FEAT_HAFDBS). */
958 uint32_t fHafdbs : 1;
959 /** Supports Virtualization Host Extensions (FEAT_VHE). */
960 uint32_t fVhe : 1;
961 /** Supports 16-bit VMID (FEAT_VMID16). */
962 uint32_t fVmid16 : 1;
963 /** Supports AArch32 BFloat16 instructions (FEAT_AA32BF16). */
964 uint32_t fAa32Bf16 : 1;
965 /** Supports AArch32 Hierarchical permission disables (FEAT_AA32HPD). */
966 uint32_t fAa32Hpd : 1;
967 /** Supports AArch32 Int8 matrix multiplication instructions (FEAT_AA32I8MM). */
968 uint32_t fAa32I8mm : 1;
969 /** Supports AT S1E1R and AT S1E1W instruction variants affected by PSTATE.PAN (FEAT_PAN2). */
970 uint32_t fPan2 : 1;
971 /** Supports AArch64 BFloat16 instructions (FEAT_BF16). */
972 uint32_t fBf16 : 1;
973 /** Supports DC CVADP instruction (FEAT_DPB2). */
974 uint32_t fDpb2 : 1;
975 /** Supports DC VAP instruction (FEAT_DPB). */
976 uint32_t fDpb : 1;
977 /** Supports Debug v8.2 (FEAT_Debugv8p2). */
978 uint32_t fDebugV8p2 : 1;
979 /** Supports Advanced SIMD dot product instructions (FEAT_DotProd). */
980 uint32_t fDotProd : 1;
981 /** Supports Enhanced Virtualization Traps (FEAT_EVT). */
982 uint32_t fEvt : 1;
983 /** Supports Single precision Matrix Multiplication (FEAT_F32MM). */
984 uint32_t fF32mm : 1;
985 /** Supports Double precision Matrix Multiplication (FEAT_F64MM). */
986 uint32_t fF64mm : 1;
987 /** Supports Floating-point half precision multiplication instructions (FEAT_FHM). */
988 uint32_t fFhm : 1;
989 /** Supports Half-precision floating point data processing (FEAT_FP16). */
990 uint32_t fFp16 : 1;
991 /** Supports AArch64 Int8 matrix multiplication instructions (FEAT_I8MM). */
992 uint32_t fI8mm : 1;
993 /** Supports Implicit Error Synchronization event (FEAT_IESB). */
994 uint32_t fIesb : 1;
995 /** Supports Large PA and IPA support (FEAT_LPA). */
996 uint32_t fLpa : 1;
997 /** Supports AArch32 Load/Store Multiple instructions atomicity and ordering controls (FEAT_LSMAOC). */
998 uint32_t fLsmaoc : 1;
999 /** Supports Large VA support (FEAT_LVA). */
1000 uint32_t fLva : 1;
1001 /** Supports Memory Partitioning and Monitoring Extension (FEAT_MPAM). */
1002 uint32_t fMpam : 1;
1003 /** Supports PC Sample-based Profiling Extension, version 8.2 (FEAT_PCSRv8p2). */
1004 uint32_t fPcsrV8p2 : 1;
1005 /** Supports Advanced SIMD SHA3 instructions (FEAT_SHA3). */
1006 uint32_t fSha3 : 1;
1007 /** Supports Advanced SIMD SHA512 instructions (FEAT_SHA512). */
1008 uint32_t fSha512 : 1;
1009 /** Supports Advanced SIMD SM3 instructions (FEAT_SM3). */
1010 uint32_t fSm3 : 1;
1011 /** Supports Advanced SIMD SM4 instructions (FEAT_SM4). */
1012 uint32_t fSm4 : 1;
1013 /** Supports Statistical Profiling Extension (FEAT_SPE). */
1014 uint32_t fSpe : 1;
1015 /** Supports Scalable Vector Extension (FEAT_SVE). */
1016 uint32_t fSve : 1;
1017 /** Supports Translation Table Common not private translations (FEAT_TTCNP). */
1018 uint32_t fTtcnp : 1;
1019 /** Supports Hierarchical permission disables, version 2 (FEAT_HPDS2). */
1020 uint32_t fHpds2 : 1;
1021 /** Supports Translation table stage 2 Unprivileged Execute-never (FEAT_XNX). */
1022 uint32_t fXnx : 1;
1023 /** Supports Unprivileged Access Override control (FEAT_UAO). */
1024 uint32_t fUao : 1;
1025 /** Supports VMID-aware PIPT instruction cache (FEAT_VPIPT). */
1026 uint32_t fVpipt : 1;
1027 /** Supports Extended cache index (FEAT_CCIDX). */
1028 uint32_t fCcidx : 1;
1029 /** Supports Floating-point complex number instructions (FEAT_FCMA). */
1030 uint32_t fFcma : 1;
1031 /** Supports Debug over Powerdown (FEAT_DoPD). */
1032 uint32_t fDopd : 1;
1033 /** Supports Enhanced pointer authentication (FEAT_EPAC). */
1034 uint32_t fEpac : 1;
1035 /** Supports Faulting on AUT* instructions (FEAT_FPAC). */
1036 uint32_t fFpac : 1;
1037 /** Supports Faulting on combined pointer euthentication instructions (FEAT_FPACCOMBINE). */
1038 uint32_t fFpacCombine : 1;
1039 /** Supports JavaScript conversion instructions (FEAT_JSCVT). */
1040 uint32_t fJscvt : 1;
1041 /** Supports Load-Acquire RCpc instructions (FEAT_LRCPC). */
1042 uint32_t fLrcpc : 1;
1043 /** Supports Nexted Virtualization (FEAT_NV). */
1044 uint32_t fNv : 1;
1045 /** Supports QARMA5 pointer authentication algorithm (FEAT_PACQARMA5). */
1046 uint32_t fPacQarma5 : 1;
1047 /** Supports implementation defined pointer authentication algorithm (FEAT_PACIMP). */
1048 uint32_t fPacImp : 1;
1049 /** Supports Pointer authentication (FEAT_PAuth). */
1050 uint32_t fPAuth : 1;
1051 /** Supports Enhancements to pointer authentication (FEAT_PAuth2). */
1052 uint32_t fPAuth2 : 1;
1053 /** Supports Statistical Profiling Extensions version 1.1 (FEAT_SPEv1p1). */
1054 uint32_t fSpeV1p1 : 1;
1055 /** Supports Activity Monitor Extension, version 1 (FEAT_AMUv1). */
1056 uint32_t fAmuV1 : 1;
1057 /** Supports Generic Counter Scaling (FEAT_CNTSC). */
1058 uint32_t fCntsc : 1;
1059 /** Supports Debug v8.4 (FEAT_Debugv8p4). */
1060 uint32_t fDebugV8p4 : 1;
1061 /** Supports Double Fault Extension (FEAT_DoubleFault). */
1062 uint32_t fDoubleFault : 1;
1063 /** Supports Data Independent Timing instructions (FEAT_DIT). */
1064 uint32_t fDit : 1;
1065 /** Supports Condition flag manipulation isntructions (FEAT_FlagM). */
1066 uint32_t fFlagM : 1;
1067 /** Supports ID space trap handling (FEAT_IDST). */
1068 uint32_t fIdst : 1;
1069 /** Supports Load-Acquire RCpc instructions version 2 (FEAT_LRCPC2). */
1070 uint32_t fLrcpc2 : 1;
1071 /** Supports Large Sytem Extensions version 2 (FEAT_LSE2). */
1072 uint32_t fLse2 : 1;
1073 /** Supports Enhanced nested virtualization support (FEAT_NV2). */
1074 uint32_t fNv2 : 1;
1075 /** Supports Armv8.4 PMU Extensions (FEAT_PMUv3p4). */
1076 uint32_t fPmuV3p4 : 1;
1077 /** Supports RAS Extension v1.1 (FEAT_RASv1p1). */
1078 uint32_t fRasV1p1 : 1;
1079 /** Supports RAS Extension v1.1 System Architecture (FEAT_RASSAv1p1). */
1080 uint32_t fRassaV1p1 : 1;
1081 /** Supports Stage 2 forced Write-Back (FEAT_S2FWB). */
1082 uint32_t fS2Fwb : 1;
1083 /** Supports Secure El2 (FEAT_SEL2). */
1084 uint32_t fSecEl2 : 1;
1085 /** Supports TLB invalidate instructions on Outer Shareable domain (FEAT_TLBIOS). */
1086 uint32_t fTlbios : 1;
1087 /** Supports TLB invalidate range instructions (FEAT_TLBIRANGE). */
1088 uint32_t fTlbirange : 1;
1089 /** Supports Self-hosted Trace Extensions (FEAT_TRF). */
1090 uint32_t fTrf : 1;
1091 /** Supports Translation Table Level (FEAT_TTL). */
1092 uint32_t fTtl : 1;
1093 /** Supports Translation table break-before-make levels (FEAT_BBM). */
1094 uint32_t fBbm : 1;
1095 /** Supports Small translation tables (FEAT_TTST). */
1096 uint32_t fTtst : 1;
1097 /** Supports Branch Target Identification (FEAT_BTI). */
1098 uint32_t fBti : 1;
1099 /** Supports Enhancements to flag manipulation instructions (FEAT_FlagM2). */
1100 uint32_t fFlagM2 : 1;
1101 /** Supports Context synchronization and exception handling (FEAT_ExS). */
1102 uint32_t fExs : 1;
1103 /** Supports Preenting EL0 access to halves of address maps (FEAT_E0PD). */
1104 uint32_t fE0Pd : 1;
1105 /** Supports Floating-point to integer instructions (FEAT_FRINTTS). */
1106 uint32_t fFrintts : 1;
1107 /** Supports Guest translation granule size (FEAT_GTG). */
1108 uint32_t fGtg : 1;
1109 /** Supports Instruction-only Memory Tagging Extension (FEAT_MTE). */
1110 uint32_t fMte : 1;
1111 /** Supports memory Tagging Extension version 2 (FEAT_MTE2). */
1112 uint32_t fMte2 : 1;
1113 /** Supports Armv8.5 PMU Extensions (FEAT_PMUv3p5). */
1114 uint32_t fPmuV3p5 : 1;
1115 /** Supports Random number generator (FEAT_RNG). */
1116 uint32_t fRng : 1;
1117 /** Supports AMU Extensions version 1.1 (FEAT_AMUv1p1). */
1118 uint32_t fAmuV1p1 : 1;
1119 /** Supports Enhanced Counter Virtualization (FEAT_ECV). */
1120 uint32_t fEcv : 1;
1121 /** Supports Fine Grain Traps (FEAT_FGT). */
1122 uint32_t fFgt : 1;
1123 /** Supports Memory Partitioning and Monitoring version 0.1 (FEAT_MPAMv0p1). */
1124 uint32_t fMpamV0p1 : 1;
1125 /** Supports Memory Partitioning and Monitoring version 1.1 (FEAT_MPAMv1p1). */
1126 uint32_t fMpamV1p1 : 1;
1127 /** Supports Multi-threaded PMU Extensions (FEAT_MTPMU). */
1128 uint32_t fMtPmu : 1;
1129 /** Supports Delayed Trapping of WFE (FEAT_TWED). */
1130 uint32_t fTwed : 1;
1131 /** Supports Embbedded Trace Macrocell version 4 (FEAT_ETMv4). */
1132 uint32_t fEtmV4 : 1;
1133 /** Supports Embbedded Trace Macrocell version 4.1 (FEAT_ETMv4p1). */
1134 uint32_t fEtmV4p1 : 1;
1135 /** Supports Embbedded Trace Macrocell version 4.2 (FEAT_ETMv4p2). */
1136 uint32_t fEtmV4p2 : 1;
1137 /** Supports Embbedded Trace Macrocell version 4.3 (FEAT_ETMv4p3). */
1138 uint32_t fEtmV4p3 : 1;
1139 /** Supports Embbedded Trace Macrocell version 4.4 (FEAT_ETMv4p4). */
1140 uint32_t fEtmV4p4 : 1;
1141 /** Supports Embbedded Trace Macrocell version 4.5 (FEAT_ETMv4p5). */
1142 uint32_t fEtmV4p5 : 1;
1143 /** Supports Embbedded Trace Macrocell version 4.6 (FEAT_ETMv4p6). */
1144 uint32_t fEtmV4p6 : 1;
1145 /** Supports Generic Interrupt Controller version 3 (FEAT_GICv3). */
1146 uint32_t fGicV3 : 1;
1147 /** Supports Generic Interrupt Controller version 3.1 (FEAT_GICv3p1). */
1148 uint32_t fGicV3p1 : 1;
1149 /** Supports Trapping Non-secure EL1 writes to ICV_DIR (FEAT_GICv3_TDIR). */
1150 uint32_t fGicV3Tdir : 1;
1151 /** Supports Generic Interrupt Controller version 4 (FEAT_GICv4). */
1152 uint32_t fGicV4 : 1;
1153 /** Supports Generic Interrupt Controller version 4.1 (FEAT_GICv4p1). */
1154 uint32_t fGicV4p1 : 1;
1155 /** Supports PMU extension, version 3 (FEAT_PMUv3). */
1156 uint32_t fPmuV3 : 1;
1157 /** Supports Embedded Trace Extension (FEAT_ETE). */
1158 uint32_t fEte : 1;
1159 /** Supports Embedded Trace Extension, version 1.1 (FEAT_ETEv1p1). */
1160 uint32_t fEteV1p1 : 1;
1161 /** Supports Embedded Trace Extension, version 1.2 (FEAT_ETEv1p2). */
1162 uint32_t fEteV1p2 : 1;
1163 /** Supports Scalable Vector Extension version 2 (FEAT_SVE2). */
1164 uint32_t fSve2 : 1;
1165 /** Supports Scalable Vector AES instructions (FEAT_SVE_AES). */
1166 uint32_t fSveAes : 1;
1167 /** Supports Scalable Vector PMULL instructions (FEAT_SVE_PMULL128). */
1168 uint32_t fSvePmull128 : 1;
1169 /** Supports Scalable Vector Bit Permutes instructions (FEAT_SVE_BitPerm). */
1170 uint32_t fSveBitPerm : 1;
1171 /** Supports Scalable Vector SHA3 instructions (FEAT_SVE_SHA3). */
1172 uint32_t fSveSha3 : 1;
1173 /** Supports Scalable Vector SM4 instructions (FEAT_SVE_SM4). */
1174 uint32_t fSveSm4 : 1;
1175 /** Supports Transactional Memory Extension (FEAT_TME). */
1176 uint32_t fTme : 1;
1177 /** Supports Trace Buffer Extension (FEAT_TRBE). */
1178 uint32_t fTrbe : 1;
1179 /** Supports Scalable Matrix Extension (FEAT_SME). */
1180 uint32_t fSme : 1;
1181 /** @} */
1182
1183 /** @name 2020 Architecture Extensions.
1184 * @{ */
1185 /** Supports Alternate floating-point behavior (FEAT_AFP). */
1186 uint32_t fAfp : 1;
1187 /** Supports HCRX_EL2 register (FEAT_HCX). */
1188 uint32_t fHcx : 1;
1189 /** Supports Larger phsical address for 4KiB and 16KiB translation granules (FEAT_LPA2). */
1190 uint32_t fLpa2 : 1;
1191 /** Supports 64 byte loads and stores without return (FEAT_LS64). */
1192 uint32_t fLs64 : 1;
1193 /** Supports 64 byte stores with return (FEAT_LS64_V). */
1194 uint32_t fLs64V : 1;
1195 /** Supports 64 byte EL0 stores with return (FEAT_LS64_ACCDATA). */
1196 uint32_t fLs64Accdata : 1;
1197 /** Supports MTE Asymmetric Fault Handling (FEAT_MTE3). */
1198 uint32_t fMte3 : 1;
1199 /** Supports SCTLR_ELx.EPAN (FEAT_PAN3). */
1200 uint32_t fPan3 : 1;
1201 /** Supports Armv8.7 PMU extensions (FEAT_PMUv3p7). */
1202 uint32_t fPmuV3p7 : 1;
1203 /** Supports Increased precision of Reciprocal Extimate and Reciprocal Square Root Estimate (FEAT_RPRES). */
1204 uint32_t fRpres : 1;
1205 /** Supports Realm Management Extension (FEAT_RME). */
1206 uint32_t fRme : 1;
1207 /** Supports Full A64 instruction set support in Streaming SVE mode (FEAT_SME_FA64). */
1208 uint32_t fSmeFA64 : 1;
1209 /** Supports Double-precision floating-point outer product instructions (FEAT_SME_F64F64). */
1210 uint32_t fSmeF64F64 : 1;
1211 /** Supports 16-bit to 64-bit integer widening outer product instructions (FEAT_SME_I16I64). */
1212 uint32_t fSmeI16I64 : 1;
1213 /** Supports Statistical Profiling Extensions version 1.2 (FEAT_SPEv1p2). */
1214 uint32_t fSpeV1p2 : 1;
1215 /** Supports AArch64 Extended BFloat16 instructions (FEAT_EBF16). */
1216 uint32_t fEbf16 : 1;
1217 /** Supports WFE and WFI instructions with timeout (FEAT_WFxT). */
1218 uint32_t fWfxt : 1;
1219 /** Supports XS attribute (FEAT_XS). */
1220 uint32_t fXs : 1;
1221 /** Supports branch Record Buffer Extension (FEAT_BRBE). */
1222 uint32_t fBrbe : 1;
1223 /** @} */
1224
1225 /** @name 2021 Architecture Extensions.
1226 * @{ */
1227 /** Supports Control for cache maintenance permission (FEAT_CMOW). */
1228 uint32_t fCmow : 1;
1229 /** Supports PAC algorithm enhancement (FEAT_CONSTPACFIELD). */
1230 uint32_t fConstPacField : 1;
1231 /** Supports Debug v8.8 (FEAT_Debugv8p8). */
1232 uint32_t fDebugV8p8 : 1;
1233 /** Supports Hinted conditional branches (FEAT_HBC). */
1234 uint32_t fHbc : 1;
1235 /** Supports Setting of MDCR_EL2.HPMN to zero (FEAT_HPMN0). */
1236 uint32_t fHpmn0 : 1;
1237 /** Supports Non-Maskable Interrupts (FEAT_NMI). */
1238 uint32_t fNmi : 1;
1239 /** Supports GIC Non-Maskable Interrupts (FEAT_GICv3_NMI). */
1240 uint32_t fGicV3Nmi : 1;
1241 /** Supports Standardization of memory operations (FEAT_MOPS). */
1242 uint32_t fMops : 1;
1243 /** Supports Pointer authentication - QARMA3 algorithm (FEAT_PACQARMA3). */
1244 uint32_t fPacQarma3 : 1;
1245 /** Supports Event counting threshold (FEAT_PMUv3_TH). */
1246 uint32_t fPmuV3Th : 1;
1247 /** Supports Armv8.8 PMU extensions (FEAT_PMUv3p8). */
1248 uint32_t fPmuV3p8 : 1;
1249 /** Supports 64-bit external interface to the Performance Monitors (FEAT_PMUv3_EXT64). */
1250 uint32_t fPmuV3Ext64 : 1;
1251 /** Supports 32-bit external interface to the Performance Monitors (FEAT_PMUv3_EXT32). */
1252 uint32_t fPmuV3Ext32 : 1;
1253 /** Supports External interface to the Performance Monitors (FEAT_PMUv3_EXT). */
1254 uint32_t fPmuV3Ext : 1;
1255 /** Supports Trapping support for RNDR/RNDRRS (FEAT_RNG_TRAP). */
1256 uint32_t fRngTrap : 1;
1257 /** Supports Statistical Profiling Extension version 1.3 (FEAT_SPEv1p3). */
1258 uint32_t fSpeV1p3 : 1;
1259 /** Supports EL0 use of IMPLEMENTATION DEFINEd functionality (FEAT_TIDCP1). */
1260 uint32_t fTidcp1 : 1;
1261 /** Supports Branch Record Buffer Extension version 1.1 (FEAT_BRBEv1p1). */
1262 uint32_t fBrbeV1p1 : 1;
1263 /** @} */
1264
1265 /** @name 2022 Architecture Extensions.
1266 * @{ */
1267 /** Supports Address Breakpoint Linking Extenions (FEAT_ABLE). */
1268 uint32_t fAble : 1;
1269 /** Supports Asynchronous Device error exceptions (FEAT_ADERR). */
1270 uint32_t fAderr : 1;
1271 /** Supports Memory Attribute Index Enhancement (FEAT_AIE). */
1272 uint32_t fAie : 1;
1273 /** Supports Asynchronous Normal error exception (FEAT_ANERR). */
1274 uint32_t fAnerr : 1;
1275 /** Supports Breakpoint Mismatch and Range Extension (FEAT_BWE). */
1276 uint32_t fBwe : 1;
1277 /** Supports Clear Branch History instruction (FEAT_CLRBHB). */
1278 uint32_t fClrBhb : 1;
1279 /** Supports Check Feature Status (FEAT_CHK). */
1280 uint32_t fChk : 1;
1281 /** Supports Common Short Sequence Compression instructions (FEAT_CSSC). */
1282 uint32_t fCssc : 1;
1283 /** Supports Cache Speculation Variant 2 version 3 (FEAT_CSV2_3). */
1284 uint32_t fCsv2v3 : 1;
1285 /** Supports 128-bit Translation Tables, 56 bit PA (FEAT_D128). */
1286 uint32_t fD128 : 1;
1287 /** Supports Debug v8.9 (FEAT_Debugv8p9). */
1288 uint32_t fDebugV8p9 : 1;
1289 /** Supports Enhancements to the Double Fault Extension (FEAT_DoubleFault2). */
1290 uint32_t fDoubleFault2 : 1;
1291 /** Supports Exception based Event Profiling (FEAT_EBEP). */
1292 uint32_t fEbep : 1;
1293 /** Supports Exploitative control using branch history information (FEAT_ECBHB). */
1294 uint32_t fEcBhb : 1;
1295 /** Supports for EDHSR (FEAT_EDHSR). */
1296 uint32_t fEdhsr : 1;
1297 /** Supports Embedded Trace Extension version 1.3 (FEAT_ETEv1p3). */
1298 uint32_t fEteV1p3 : 1;
1299 /** Supports Fine-grained traps 2 (FEAT_FGT2). */
1300 uint32_t fFgt2 : 1;
1301 /** Supports Guarded Control Stack Extension (FEAT_GCS). */
1302 uint32_t fGcs : 1;
1303 /** Supports Hardware managed Access Flag for Table descriptors (FEAT_HAFT). */
1304 uint32_t fHaft : 1;
1305 /** Supports Instrumentation Extension (FEAT_ITE). */
1306 uint32_t fIte : 1;
1307 /** Supports Load-Acquire RCpc instructions version 3 (FEAT_LRCPC3). */
1308 uint32_t fLrcpc3 : 1;
1309 /** Supports 128-bit atomics (FEAT_LSE128). */
1310 uint32_t fLse128 : 1;
1311 /** Supports 56-bit VA (FEAT_LVA3). */
1312 uint32_t fLva3 : 1;
1313 /** Supports Memory Encryption Contexts (FEAT_MEC). */
1314 uint32_t fMec : 1;
1315 /** Supports Enhanced Memory Tagging Extension (FEAT_MTE4). */
1316 uint32_t fMte4 : 1;
1317 /** Supports Canoncial Tag checking for untagged memory (FEAT_MTE_CANONCIAL_TAGS). */
1318 uint32_t fMteCanonicalTags : 1;
1319 /** Supports FAR_ELx on a Tag Check Fault (FEAT_MTE_TAGGED_FAR). */
1320 uint32_t fMteTaggedFar : 1;
1321 /** Supports Store only Tag checking (FEAT_MTE_STORE_ONLY). */
1322 uint32_t fMteStoreOnly : 1;
1323 /** Supports Memory tagging with Address tagging disabled (FEAT_MTE_NO_ADDRESS_TAGS). */
1324 uint32_t fMteNoAddressTags : 1;
1325 /** Supports Memory tagging asymmetric faults (FEAT_MTE_ASYM_FAULT). */
1326 uint32_t fMteAsymFault : 1;
1327 /** Supports Memory Tagging asynchronous faulting (FEAT_MTE_ASYNC). */
1328 uint32_t fMteAsync : 1;
1329 /** Supports Allocation tag access permission (FEAT_MTE_PERM_S1). */
1330 uint32_t fMtePermS1 : 1;
1331 /** Supports Armv8.9 PC Sample-based Profiling Extension (FEAT_PCSRv8p9). */
1332 uint32_t fPcsrV8p9 : 1;
1333 /** Supports Permission model enhancements (FEAT_S1PIE). */
1334 uint32_t fS1Pie : 1;
1335 /** Supports Permission model enhancements (FEAT_S2PIE). */
1336 uint32_t fS2Pie : 1;
1337 /** Supports Permission model enhancements (FEAT_S1POE). */
1338 uint32_t fS1Poe : 1;
1339 /** Supports Permission model enhancements (FEAT_S2POE). */
1340 uint32_t fS2Poe : 1;
1341 /** Supports Physical Fault Address Registers (FEAT_PFAR). */
1342 uint32_t fPfar : 1;
1343 /** Supports Armv8.9 PMU extensions (FEAT_PMUv3p9). */
1344 uint32_t fPmuV3p9 : 1;
1345 /** Supports PMU event edge detection (FEAT_PMUv3_EDGE). */
1346 uint32_t fPmuV3Edge : 1;
1347 /** Supports Fixed-function instruction counter (FEAT_PMUv3_ICNTR). */
1348 uint32_t fPmuV3Icntr : 1;
1349 /** Supports PMU Snapshot Extension (FEAT_PMUv3_SS). */
1350 uint32_t fPmuV3Ss : 1;
1351 /** Supports SLC traget for PRFM instructions (FEAT_PRFMSLC). */
1352 uint32_t fPrfmSlc : 1;
1353 /** Supports RAS version 2 (FEAT_RASv2). */
1354 uint32_t fRasV2 : 1;
1355 /** Supports RAS version 2 System Architecture (FEAT_RASSAv2). */
1356 uint32_t fRasSaV2 : 1;
1357 /** Supports for Range Prefetch Memory instruction (FEAT_RPRFM). */
1358 uint32_t fRprfm : 1;
1359 /** Supports extensions to SCTLR_ELx (FEAT_SCTLR2). */
1360 uint32_t fSctlr2 : 1;
1361 /** Supports Synchronous Exception-based Event Profiling (FEAT_SEBEP). */
1362 uint32_t fSebep : 1;
1363 /** Supports non-widening half-precision FP16 to FP16 arithmetic for SME2.1 (FEAT_SME_F16F16). */
1364 uint32_t fSmeF16F16 : 1;
1365 /** Supports Scalable Matrix Extension version 2 (FEAT_SME2). */
1366 uint32_t fSme2 : 1;
1367 /** Supports Scalable Matrix Extension version 2.1 (FEAT_SME2p1). */
1368 uint32_t fSme2p1 : 1;
1369 /** Supports Enhanced speculation restriction instructions (FEAT_SPECRES2). */
1370 uint32_t fSpecres2 : 1;
1371 /** Supports System Performance Monitors Extension (FEAT_SPMU). */
1372 uint32_t fSpmu : 1;
1373 /** Supports Statistical profiling Extension version 1.4 (FEAT_SPEv1p4). */
1374 uint32_t fSpeV1p4 : 1;
1375 /** Supports Call Return Branch Records (FEAT_SPE_CRR). */
1376 uint32_t fSpeCrr : 1;
1377 /** Supports Data Source Filtering (FEAT_SPE_FDS). */
1378 uint32_t fSpeFds : 1;
1379 /** Supports Scalable Vector Extension version SVE2.1 (FEAT_SVE2p1). */
1380 uint32_t fSve2p1 : 1;
1381 /** Supports Non-widening BFloat16 to BFloat16 arithmetic for SVE (FEAT_SVE_B16B16). */
1382 uint32_t fSveB16B16 : 1;
1383 /** Supports 128-bit System instructions (FEAT_SYSINSTR128). */
1384 uint32_t fSysInstr128 : 1;
1385 /** Supports 128-bit System registers (FEAT_SYSREG128). */
1386 uint32_t fSysReg128 : 1;
1387 /** Supports Extension to TCR_ELx (FEAT_TCR2). */
1388 uint32_t fTcr2 : 1;
1389 /** Supports Translation Hardening Extension (FEAT_THE). */
1390 uint32_t fThe : 1;
1391 /** Supports Trace Buffer external mode (FEAT_TRBE_EXT). */
1392 uint32_t fTrbeExt : 1;
1393 /** Supports Trace Buffer MPAM extension (FEAT_TRBE_MPAM). */
1394 uint32_t fTrbeMpam : 1;
1395 /** @} */
1396
1397 /** Padding to the required size to match CPUMFEATURES for x86/amd64. */
1398 uint8_t abPadding[4];
1399} CPUMFEATURESARMV8;
1400#ifndef VBOX_FOR_DTRACE_LIB
1401AssertCompileSize(CPUMFEATURESARMV8, 48);
1402AssertCompileMembersAtSameOffset(CPUMFEATURESCOMMON, enmCpuVendor, CPUMFEATURESARMV8, enmCpuVendor);
1403AssertCompileMembersAtSameOffset(CPUMFEATURESCOMMON, uFamily, CPUMFEATURESARMV8, uFamily);
1404AssertCompileMembersAtSameOffset(CPUMFEATURESCOMMON, uModel, CPUMFEATURESARMV8, uModel);
1405AssertCompileMembersAtSameOffset(CPUMFEATURESCOMMON, uStepping, CPUMFEATURESARMV8, uStepping);
1406AssertCompileMembersAtSameOffset(CPUMFEATURESCOMMON, enmMicroarch, CPUMFEATURESARMV8, enmMicroarch);
1407AssertCompileMembersAtSameOffset(CPUMFEATURESCOMMON, cMaxPhysAddrWidth, CPUMFEATURESARMV8, cMaxPhysAddrWidth);
1408AssertCompileMembersAtSameOffset(CPUMFEATURESCOMMON, cMaxLinearAddrWidth, CPUMFEATURESARMV8, cMaxLinearAddrWidth);
1409#endif
1410
1411
1412/**
1413 * Chameleon wrapper structure for the host CPU features.
1414 *
1415 * This is used for the globally readable g_CpumHostFeatures variable, which is
1416 * initialized once during VMMR0 load for ring-0 and during CPUMR3Init in
1417 * ring-3. To reflect this immutability after load/init, we use this wrapper
1418 * structure to switch it between const and non-const depending on the context.
1419 * Only two files sees it as non-const (CPUMR0.cpp and CPUM.cpp).
1420 */
1421typedef union CPUHOSTFEATURES
1422{
1423 /** Fields common to all CPU types. */
1424 CPUMFEATURESCOMMON Common;
1425 /** The host specific structure. */
1426#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
1427 CPUMFEATURESX86
1428#elif defined(RT_ARCH_ARM64)
1429 CPUMFEATURESARMV8
1430#else
1431# error "port me"
1432#endif
1433#ifndef CPUM_WITH_NONCONST_HOST_FEATURES
1434 const
1435#endif
1436 s;
1437} CPUHOSTFEATURES;
1438/** Pointer to a const host CPU feature structure. */
1439typedef CPUHOSTFEATURES const *PCCPUHOSTFEATURES;
1440
1441/** Host CPU features.
1442 * @note In ring-3, only valid after CPUMR3Init. In ring-0, valid after
1443 * module init. */
1444extern CPUHOSTFEATURES g_CpumHostFeatures;
1445
1446
1447/** The target CPU feature structure.
1448 * @todo this should have a chameleon wrapper as well (ring-0). */
1449#ifndef VBOX_VMM_TARGET_ARMV8
1450typedef CPUMFEATURESX86 CPUMFEATURES;
1451#else
1452typedef CPUMFEATURESARMV8 CPUMFEATURES;
1453#endif
1454/** Pointer to a CPU feature structure. */
1455typedef CPUMFEATURES *PCPUMFEATURES;
1456/** Pointer to a const CPU feature structure. */
1457typedef CPUMFEATURES const *PCCPUMFEATURES;
1458
1459
1460/*
1461 * Include the target specific header.
1462 * This uses several of the above types, so it must be postponed till here.
1463 */
1464#ifndef VBOX_VMM_TARGET_ARMV8
1465# include <VBox/vmm/cpum-x86-amd64.h>
1466#else
1467# include <VBox/vmm/cpum-armv8.h>
1468#endif
1469
1470
1471
1472RT_C_DECLS_BEGIN
1473
1474#ifndef VBOX_FOR_DTRACE_LIB
1475
1476VMMDECL(void) CPUMSetChangedFlags(PVMCPU pVCpu, uint32_t fChangedAdd);
1477VMMDECL(PCPUMCTX) CPUMQueryGuestCtxPtr(PVMCPU pVCpu);
1478VMMDECL(CPUMMODE) CPUMGetGuestMode(PVMCPU pVCpu);
1479VMMDECL(uint32_t) CPUMGetGuestCodeBits(PVMCPU pVCpu);
1480VMMDECL(DISCPUMODE) CPUMGetGuestDisMode(PVMCPU pVCpu);
1481
1482/** @name Guest Register Getters.
1483 * @{ */
1484VMMDECL(uint64_t) CPUMGetGuestFlatPC(PVMCPU pVCpu);
1485VMMDECL(uint64_t) CPUMGetGuestFlatSP(PVMCPU pVCpu);
1486VMMDECL(CPUMCPUVENDOR) CPUMGetGuestCpuVendor(PVM pVM);
1487VMMDECL(CPUMARCH) CPUMGetGuestArch(PCVM pVM);
1488VMMDECL(CPUMMICROARCH) CPUMGetGuestMicroarch(PCVM pVM);
1489VMMDECL(void) CPUMGetGuestAddrWidths(PCVM pVM, uint8_t *pcPhysAddrWidth, uint8_t *pcLinearAddrWidth);
1490/** @} */
1491
1492/** @name Misc Guest Predicate Functions.
1493 * @{ */
1494VMMDECL(bool) CPUMIsGuestIn64BitCode(PCVMCPU pVCpu);
1495/** @} */
1496
1497VMMDECL(CPUMCPUVENDOR) CPUMGetHostCpuVendor(PVM pVM);
1498VMMDECL(CPUMARCH) CPUMGetHostArch(PCVM pVM);
1499VMMDECL(CPUMMICROARCH) CPUMGetHostMicroarch(PCVM pVM);
1500
1501#ifdef IN_RING3
1502/** @defgroup grp_cpum_r3 The CPUM ring-3 API
1503 * @{
1504 */
1505
1506VMMR3DECL(int) CPUMR3Init(PVM pVM);
1507VMMR3DECL(int) CPUMR3InitCompleted(PVM pVM, VMINITCOMPLETED enmWhat);
1508VMMR3DECL(void) CPUMR3LogCpuIdAndMsrFeatures(PVM pVM);
1509VMMR3DECL(void) CPUMR3Relocate(PVM pVM);
1510VMMR3DECL(int) CPUMR3Term(PVM pVM);
1511VMMR3DECL(void) CPUMR3Reset(PVM pVM);
1512VMMR3DECL(void) CPUMR3ResetCpu(PVM pVM, PVMCPU pVCpu);
1513VMMDECL(bool) CPUMR3IsStateRestorePending(PVM pVM);
1514VMMDECL(const char *) CPUMMicroarchName(CPUMMICROARCH enmMicroarch);
1515VMMR3DECL(const char *) CPUMCpuVendorName(CPUMCPUVENDOR enmVendor);
1516
1517VMMR3DECL(uint32_t) CPUMR3DbGetEntries(void);
1518/** Pointer to CPUMR3DbGetEntries. */
1519typedef DECLCALLBACKPTR(uint32_t, PFNCPUMDBGETENTRIES, (void));
1520VMMR3DECL(PCCPUMDBENTRY) CPUMR3DbGetEntryByIndex(uint32_t idxCpuDb);
1521/** Pointer to CPUMR3DbGetEntryByIndex. */
1522typedef DECLCALLBACKPTR(PCCPUMDBENTRY, PFNCPUMDBGETENTRYBYINDEX, (uint32_t idxCpuDb));
1523VMMR3DECL(PCCPUMDBENTRY) CPUMR3DbGetEntryByName(const char *pszName);
1524/** Pointer to CPUMR3DbGetEntryByName. */
1525typedef DECLCALLBACKPTR(PCCPUMDBENTRY, PFNCPUMDBGETENTRYBYNAME, (const char *pszName));
1526
1527VMMR3_INT_DECL(void) CPUMR3NemActivateGuestDebugState(PVMCPUCC pVCpu);
1528VMMR3_INT_DECL(void) CPUMR3NemActivateHyperDebugState(PVMCPUCC pVCpu);
1529/** @} */
1530#endif /* IN_RING3 */
1531
1532#endif /* !VBOX_FOR_DTRACE_LIB */
1533/** @} */
1534RT_C_DECLS_END
1535
1536
1537#endif /* !VBOX_INCLUDED_vmm_cpum_h */
1538
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette