Changeset 107650 in vbox for trunk/include/VBox/vmm/cpum.h
- Timestamp:
- Jan 10, 2025 1:42:28 PM (8 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/cpum.h
r107389 r107650 354 354 typedef struct CPUMFEATURESCOMMON 355 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 356 /** The microarchitecture. */ 365 357 #ifndef VBOX_FOR_DTRACE_LIB … … 368 360 uint32_t enmMicroarch; 369 361 #endif 362 /** The CPU vendor (CPUMCPUVENDOR). */ 363 uint8_t enmCpuVendor; 370 364 /** The maximum physical address width of the CPU. */ 371 365 uint8_t cMaxPhysAddrWidth; … … 381 375 typedef struct CPUMFEATURESX86 382 376 { 377 /** The microarchitecture. */ 378 #ifndef VBOX_FOR_DTRACE_LIB 379 CPUMMICROARCH enmMicroarch; 380 #else 381 uint32_t enmMicroarch; 382 #endif 383 383 /** The CPU vendor (CPUMCPUVENDOR). */ 384 384 uint8_t enmCpuVendor; 385 /** The maximum physical address width of the CPU. */ 386 uint8_t cMaxPhysAddrWidth; 387 /** The maximum linear address width of the CPU. */ 388 uint8_t cMaxLinearAddrWidth; 389 385 390 /** The CPU family. */ 386 391 uint8_t uFamily; … … 389 394 /** The CPU stepping. */ 390 395 uint8_t uStepping; 391 /** The microarchitecture. */392 #ifndef VBOX_FOR_DTRACE_LIB393 CPUMMICROARCH enmMicroarch;394 #else395 uint32_t enmMicroarch;396 #endif397 /** 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 396 /** Max size of the extended state (or FPU state if no XSAVE). */ 402 397 uint16_t cbMaxExtendedState; … … 844 839 /** VMX: Padding / reserved for future, making it a total of 128 bits. */ 845 840 uint32_t fVmxPadding1; 841 uint32_t auPadding[4]; 846 842 } CPUMFEATURESX86; 847 843 #ifndef VBOX_FOR_DTRACE_LIB 848 AssertCompileSize(CPUMFEATURESX86, 48);844 AssertCompileSize(CPUMFEATURESX86, 64); 849 845 AssertCompileMembersAtSameOffset(CPUMFEATURESCOMMON, enmCpuVendor, CPUMFEATURESX86, enmCpuVendor); 850 AssertCompileMembersAtSameOffset(CPUMFEATURESCOMMON, uFamily, CPUMFEATURESX86, uFamily);851 AssertCompileMembersAtSameOffset(CPUMFEATURESCOMMON, uModel, CPUMFEATURESX86, uModel);852 AssertCompileMembersAtSameOffset(CPUMFEATURESCOMMON, uStepping, CPUMFEATURESX86, uStepping);853 846 AssertCompileMembersAtSameOffset(CPUMFEATURESCOMMON, enmMicroarch, CPUMFEATURESX86, enmMicroarch); 854 847 AssertCompileMembersAtSameOffset(CPUMFEATURESCOMMON, cMaxPhysAddrWidth, CPUMFEATURESX86, cMaxPhysAddrWidth); … … 863 856 typedef struct CPUMFEATURESARMV8 864 857 { 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 858 /** The microarchitecture. */ 874 859 #ifndef VBOX_FOR_DTRACE_LIB … … 877 862 uint32_t enmMicroarch; 878 863 #endif 864 /** The CPU vendor (CPUMCPUVENDOR). */ 865 uint8_t enmCpuVendor; 879 866 /** The maximum physical address width of the CPU. */ 880 867 uint8_t cMaxPhysAddrWidth; 881 868 /** The maximum linear address width of the CPU. */ 882 869 uint8_t cMaxLinearAddrWidth; 883 uint16_t uPadding; 870 871 /** The CPU implementer value (from MIDR_EL1). */ 872 uint8_t uImplementeter; 873 /** The CPU part number (from MIDR_EL1). */ 874 uint16_t uPartNum; 875 /** The CPU variant (from MIDR_EL1). */ 876 uint8_t uVariant; 877 /** The CPU revision (from MIDR_EL1). */ 878 uint8_t uRevision; 884 879 885 880 /** @name Granule sizes supported. … … 1395 1390 /** @} */ 1396 1391 1397 /** Padding to the required size to match CPUMFEATURES for x86/amd64. */1398 uint 8_t abPadding[4];1392 /** Padding to the required size to match CPUMFEATURESX86. */ 1393 uint32_t auPadding[5]; 1399 1394 } CPUMFEATURESARMV8; 1400 1395 #ifndef VBOX_FOR_DTRACE_LIB 1401 AssertCompileSize(CPUMFEATURESARMV8, 48); 1396 AssertCompileSize(CPUMFEATURESARMV8, 64); 1397 AssertCompileMembersAtSameOffset(CPUMFEATURESCOMMON, enmMicroarch, CPUMFEATURESARMV8, enmMicroarch); 1402 1398 AssertCompileMembersAtSameOffset(CPUMFEATURESCOMMON, enmCpuVendor, CPUMFEATURESARMV8, enmCpuVendor); 1403 AssertCompileMembersAtSameOffset(CPUMFEATURESCOMMON, uFamily, CPUMFEATURESARMV8, uFamily);1404 AssertCompileMembersAtSameOffset(CPUMFEATURESCOMMON, uModel, CPUMFEATURESARMV8, uModel);1405 AssertCompileMembersAtSameOffset(CPUMFEATURESCOMMON, uStepping, CPUMFEATURESARMV8, uStepping);1406 AssertCompileMembersAtSameOffset(CPUMFEATURESCOMMON, enmMicroarch, CPUMFEATURESARMV8, enmMicroarch);1407 1399 AssertCompileMembersAtSameOffset(CPUMFEATURESCOMMON, cMaxPhysAddrWidth, CPUMFEATURESARMV8, cMaxPhysAddrWidth); 1408 1400 AssertCompileMembersAtSameOffset(CPUMFEATURESCOMMON, cMaxLinearAddrWidth, CPUMFEATURESARMV8, cMaxLinearAddrWidth); … … 1436 1428 s; 1437 1429 } CPUHOSTFEATURES; 1430 #ifndef VBOX_FOR_DTRACE_LIB 1431 AssertCompileSize(CPUHOSTFEATURES, 64); 1432 #endif 1438 1433 /** Pointer to a const host CPU feature structure. */ 1439 1434 typedef CPUHOSTFEATURES const *PCCPUHOSTFEATURES; … … 1458 1453 1459 1454 1455 1456 /** 1457 * ARMv8 CPU ID registers. 1458 */ 1459 typedef struct CPUMARMV8IDREGS 1460 { 1461 /** Content of the ID_AA64PFR0_EL1 register. */ 1462 uint64_t u64RegIdAa64Pfr0El1; 1463 /** Content of the ID_AA64PFR1_EL1 register. */ 1464 uint64_t u64RegIdAa64Pfr1El1; 1465 /** Content of the ID_AA64DFR0_EL1 register. */ 1466 uint64_t u64RegIdAa64Dfr0El1; 1467 /** Content of the ID_AA64DFR1_EL1 register. */ 1468 uint64_t u64RegIdAa64Dfr1El1; 1469 /** Content of the ID_AA64AFR0_EL1 register. */ 1470 uint64_t u64RegIdAa64Afr0El1; 1471 /** Content of the ID_AA64AFR1_EL1 register. */ 1472 uint64_t u64RegIdAa64Afr1El1; 1473 /** Content of the ID_AA64ISAR0_EL1 register. */ 1474 uint64_t u64RegIdAa64Isar0El1; 1475 /** Content of the ID_AA64ISAR1_EL1 register. */ 1476 uint64_t u64RegIdAa64Isar1El1; 1477 /** Content of the ID_AA64ISAR2_EL1 register. */ 1478 uint64_t u64RegIdAa64Isar2El1; 1479 /** Content of the ID_AA64MMFR0_EL1 register. */ 1480 uint64_t u64RegIdAa64Mmfr0El1; 1481 /** Content of the ID_AA64MMFR1_EL1 register. */ 1482 uint64_t u64RegIdAa64Mmfr1El1; 1483 /** Content of the ID_AA64MMFR2_EL1 register. */ 1484 uint64_t u64RegIdAa64Mmfr2El1; 1485 /** Content of the CLIDR_EL1 register. */ 1486 uint64_t u64RegClidrEl1; 1487 /** Content of the CTR_EL0 register. */ 1488 uint64_t u64RegCtrEl0; 1489 /** Content of the DCZID_EL0 register. */ 1490 uint64_t u64RegDczidEl0; 1491 /** @todo we need MIDR_EL1 here, possibly also MPIDR_EL1 and REVIDR_EL1. */ 1492 } CPUMARMV8IDREGS; 1493 /** Pointer to CPU ID registers. */ 1494 typedef CPUMARMV8IDREGS *PCPUMARMV8IDREGS; 1495 /** Pointer to a const CPU ID registers structure. */ 1496 typedef CPUMARMV8IDREGS const *PCCPUMARMV8IDREGS; 1497 1498 1460 1499 /* 1461 1500 * Include the target specific header. … … 1499 1538 VMMDECL(CPUMMICROARCH) CPUMGetHostMicroarch(PCVM pVM); 1500 1539 1540 VMMDECL(const char *) CPUMMicroarchName(CPUMMICROARCH enmMicroarch); 1541 VMMDECL(const char *) CPUMCpuVendorName(CPUMCPUVENDOR enmVendor); 1542 1543 VMMDECL(CPUMCPUVENDOR) CPUMCpuIdDetectX86VendorEx(uint32_t uEAX, uint32_t uEBX, uint32_t uECX, uint32_t uEDX); 1544 #if defined(RT_ARCH_X86) || defined(RT_ARCH_AMD64) 1545 VMMDECL(int) CPUMCpuIdCollectLeavesFromX86Host(PCPUMCPUIDLEAF *ppaLeaves, uint32_t *pcLeaves); 1546 #endif 1547 #if defined(RT_ARCH_ARM64) 1548 VMMDECL(int) CPUMCpuIdCollectIdRegistersFromArmV8Host(PCPUMARMV8IDREGS pIdRegs); 1549 #endif 1550 1501 1551 #ifdef IN_RING3 1502 1552 /** @defgroup grp_cpum_r3 The CPUM ring-3 API … … 1512 1562 VMMR3DECL(void) CPUMR3ResetCpu(PVM pVM, PVMCPU pVCpu); 1513 1563 VMMDECL(bool) CPUMR3IsStateRestorePending(PVM pVM); 1514 VMMDECL(const char *) CPUMMicroarchName(CPUMMICROARCH enmMicroarch);1515 VMMR3DECL(const char *) CPUMCpuVendorName(CPUMCPUVENDOR enmVendor);1516 1564 1517 1565 VMMR3DECL(uint32_t) CPUMR3DbGetEntries(void);
Note:
See TracChangeset
for help on using the changeset viewer.