- Timestamp:
- Jul 31, 2020 12:41:14 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/cpum.h
r85352 r85573 1374 1374 1375 1375 1376 /** 1377 * CPU database entry. 1378 */ 1379 typedef struct CPUMDBENTRY 1380 { 1381 /** The CPU name. */ 1382 const char *pszName; 1383 /** The full CPU name. */ 1384 const char *pszFullName; 1385 /** The CPU vendor (CPUMCPUVENDOR). */ 1386 uint8_t enmVendor; 1387 /** The CPU family. */ 1388 uint8_t uFamily; 1389 /** The CPU model. */ 1390 uint8_t uModel; 1391 /** The CPU stepping. */ 1392 uint8_t uStepping; 1393 /** The microarchitecture. */ 1394 CPUMMICROARCH enmMicroarch; 1395 /** Scalable bus frequency used for reporting other frequencies. */ 1396 uint64_t uScalableBusFreq; 1397 /** Flags - CPUMDB_F_XXX. */ 1398 uint32_t fFlags; 1399 /** The maximum physical address with of the CPU. This should correspond to 1400 * the value in CPUID leaf 0x80000008 when present. */ 1401 uint8_t cMaxPhysAddrWidth; 1402 /** The MXCSR mask. */ 1403 uint32_t fMxCsrMask; 1404 /** Pointer to an array of CPUID leaves. */ 1405 PCCPUMCPUIDLEAF paCpuIdLeaves; 1406 /** The number of CPUID leaves in the array paCpuIdLeaves points to. */ 1407 uint32_t cCpuIdLeaves; 1408 /** The method used to deal with unknown CPUID leaves. */ 1409 CPUMUNKNOWNCPUID enmUnknownCpuId; 1410 /** The default unknown CPUID value. */ 1411 CPUMCPUID DefUnknownCpuId; 1412 1413 /** MSR mask. Several microarchitectures ignore the higher bits of ECX in 1414 * the RDMSR and WRMSR instructions. */ 1415 uint32_t fMsrMask; 1416 1417 /** The number of ranges in the table pointed to b paMsrRanges. */ 1418 uint32_t cMsrRanges; 1419 /** MSR ranges for this CPU. */ 1420 PCCPUMMSRRANGE paMsrRanges; 1421 } CPUMDBENTRY; 1422 /** Pointer to a const CPU database entry. */ 1423 typedef CPUMDBENTRY const *PCCPUMDBENTRY; 1424 1425 /** @name CPUMDB_F_XXX - CPUDBENTRY::fFlags 1426 * @{ */ 1427 /** Should execute all in IEM. 1428 * @todo Implement this - currently done in Main... */ 1429 #define CPUMDB_F_EXECUTE_ALL_IN_IEM RT_BIT_32(0) 1430 /** @} */ 1431 1432 1433 1376 1434 #ifndef VBOX_FOR_DTRACE_LIB 1377 1435 … … 2317 2375 Assert(pVmcs); 2318 2376 2319 uint32_t const fGstHostMask = pVmcs->u64Cr0Mask.u;2320 uint32_t const fReadShadow = pVmcs->u64Cr0ReadShadow.u;2377 uint32_t const fGstHostMask = (uint32_t)pVmcs->u64Cr0Mask.u; 2378 uint32_t const fReadShadow = (uint32_t)pVmcs->u64Cr0ReadShadow.u; 2321 2379 2322 2380 /* … … 2648 2706 VMMR3DECL(int) CPUMR3MsrRangesInsert(PVM pVM, PCCPUMMSRRANGE pNewRange); 2649 2707 2708 VMMR3DECL(uint32_t) CPUMR3DbGetEntries(void); 2709 /** Pointer to CPUMR3DbGetEntries. */ 2710 typedef DECLCALLBACKPTR(uint32_t, PFNCPUMDBGETENTRIES, (void)); 2711 VMMR3DECL(PCCPUMDBENTRY) CPUMR3DbGetEntryByIndex(uint32_t idxCpuDb); 2712 /** Pointer to CPUMR3DbGetEntryByIndex. */ 2713 typedef DECLCALLBACKPTR(PCCPUMDBENTRY, PFNCPUMDBGETENTRYBYINDEX, (uint32_t idxCpuDb)); 2714 VMMR3DECL(PCCPUMDBENTRY) CPUMR3DbGetEntryByName(const char *pszName); 2715 /** Pointer to CPUMR3DbGetEntryByName. */ 2716 typedef DECLCALLBACKPTR(PCCPUMDBENTRY, PFNCPUMDBGETENTRYBYNAME, (const char *pszName)); 2650 2717 /** @} */ 2651 2718 #endif /* IN_RING3 */ -
trunk/src/VBox/VMM/VMMR3/CPUMR3Db.cpp
r85354 r85573 33 33 34 34 /********************************************************************************************************************************* 35 * Structures and Typedefs *36 *********************************************************************************************************************************/37 typedef struct CPUMDBENTRY38 {39 /** The CPU name. */40 const char *pszName;41 /** The full CPU name. */42 const char *pszFullName;43 /** The CPU vendor (CPUMCPUVENDOR). */44 uint8_t enmVendor;45 /** The CPU family. */46 uint8_t uFamily;47 /** The CPU model. */48 uint8_t uModel;49 /** The CPU stepping. */50 uint8_t uStepping;51 /** The microarchitecture. */52 CPUMMICROARCH enmMicroarch;53 /** Scalable bus frequency used for reporting other frequencies. */54 uint64_t uScalableBusFreq;55 /** Flags - CPUDB_F_XXX. */56 uint32_t fFlags;57 /** The maximum physical address with of the CPU. This should correspond to58 * the value in CPUID leaf 0x80000008 when present. */59 uint8_t cMaxPhysAddrWidth;60 /** The MXCSR mask. */61 uint32_t fMxCsrMask;62 /** Pointer to an array of CPUID leaves. */63 PCCPUMCPUIDLEAF paCpuIdLeaves;64 /** The number of CPUID leaves in the array paCpuIdLeaves points to. */65 uint32_t cCpuIdLeaves;66 /** The method used to deal with unknown CPUID leaves. */67 CPUMUNKNOWNCPUID enmUnknownCpuId;68 /** The default unknown CPUID value. */69 CPUMCPUID DefUnknownCpuId;70 71 /** MSR mask. Several microarchitectures ignore the higher bits of ECX in72 * the RDMSR and WRMSR instructions. */73 uint32_t fMsrMask;74 75 /** The number of ranges in the table pointed to b paMsrRanges. */76 uint32_t cMsrRanges;77 /** MSR ranges for this CPU. */78 PCCPUMMSRRANGE paMsrRanges;79 } CPUMDBENTRY;80 81 82 /*********************************************************************************************************************************83 35 * Defined Constants And Macros * 84 36 *********************************************************************************************************************************/ 85 /** @name CPUDB_F_XXX - CPUDBENTRY::fFlags86 * @{ */87 /** Should execute all in IEM.88 * @todo Implement this - currently done in Main... */89 #define CPUDB_F_EXECUTE_ALL_IN_IEM RT_BIT_32(0)90 /** @} */91 92 93 37 /** @def NULL_ALONE 94 38 * For eliminating an unnecessary data dependency in standalone builds (for … … 331 275 332 276 277 /** 278 * Returns the number of entries in the CPU database. 279 * 280 * @returns Number of entries. 281 * @sa PFNCPUMDBGETENTRIES 282 */ 283 VMMR3DECL(uint32_t) CPUMR3DbGetEntries(void) 284 { 285 return RT_ELEMENTS(g_apCpumDbEntries); 286 } 287 288 289 /** 290 * Returns CPU database entry for the given index. 291 * 292 * @returns Pointer the CPU database entry, NULL if index is out of bounds. 293 * @param idxCpuDb The index (0..CPUMR3DbGetEntries). 294 * @sa PFNCPUMDBGETENTRYBYINDEX 295 */ 296 VMMR3DECL(PCCPUMDBENTRY) CPUMR3DbGetEntryByIndex(uint32_t idxCpuDb) 297 { 298 AssertReturn(idxCpuDb <= RT_ELEMENTS(g_apCpumDbEntries), NULL); 299 return g_apCpumDbEntries[idxCpuDb]; 300 } 301 302 303 /** 304 * Returns CPU database entry with the given name. 305 * 306 * @returns Pointer the CPU database entry, NULL if not found. 307 * @param idxCpuDb The name of the profile to return. 308 * @sa PFNCPUMDBGETENTRYBYNAME 309 */ 310 VMMR3DECL(PCCPUMDBENTRY) CPUMR3DbGetEntryByName(const char *pszName) 311 { 312 AssertPtrReturn(pszName, NULL); 313 AssertReturn(*pszName, NULL); 314 for (size_t i = 0; i < RT_ELEMENTS(g_apCpumDbEntries); i++) 315 if (strcmp(g_apCpumDbEntries[i]->pszName, pszName) == 0) 316 return g_apCpumDbEntries[i]; 317 return NULL; 318 } 319 320 333 321 334 322 /** -
trunk/src/VBox/VMM/VMMR3/cpus/Intel_80186.h
r82968 r85573 60 60 /*.enmMicroarch = */ kCpumMicroarch_Intel_80186, 61 61 /*.uScalableBusFreq = */ CPUM_SBUSFREQ_UNKNOWN, 62 /*.fFlags = */ CPU DB_F_EXECUTE_ALL_IN_IEM,62 /*.fFlags = */ CPUMDB_F_EXECUTE_ALL_IN_IEM, 63 63 /*.cMaxPhysAddrWidth= */ 20, 64 64 /*.fMxCsrMask = */ 0, -
trunk/src/VBox/VMM/VMMR3/cpus/Intel_80286.h
r82968 r85573 60 60 /*.enmMicroarch = */ kCpumMicroarch_Intel_80286, 61 61 /*.uScalableBusFreq = */ CPUM_SBUSFREQ_UNKNOWN, 62 /*.fFlags = */ CPU DB_F_EXECUTE_ALL_IN_IEM,62 /*.fFlags = */ CPUMDB_F_EXECUTE_ALL_IN_IEM, 63 63 /*.cMaxPhysAddrWidth= */ 24, 64 64 /*.fMxCsrMask = */ 0, -
trunk/src/VBox/VMM/VMMR3/cpus/Intel_80386.h
r82968 r85573 60 60 /*.enmMicroarch = */ kCpumMicroarch_Intel_80386, 61 61 /*.uScalableBusFreq = */ CPUM_SBUSFREQ_UNKNOWN, 62 /*.fFlags = */ CPU DB_F_EXECUTE_ALL_IN_IEM,62 /*.fFlags = */ CPUMDB_F_EXECUTE_ALL_IN_IEM, 63 63 /*.cMaxPhysAddrWidth= */ 24, 64 64 /*.fMxCsrMask = */ 0, -
trunk/src/VBox/VMM/VMMR3/cpus/Intel_8086.h
r82968 r85573 60 60 /*.enmMicroarch = */ kCpumMicroarch_Intel_8086, 61 61 /*.uScalableBusFreq = */ CPUM_SBUSFREQ_UNKNOWN, 62 /*.fFlags = */ CPU DB_F_EXECUTE_ALL_IN_IEM,62 /*.fFlags = */ CPUMDB_F_EXECUTE_ALL_IN_IEM, 63 63 /*.cMaxPhysAddrWidth= */ 20, 64 64 /*.fMxCsrMask = */ 0,
Note:
See TracChangeset
for help on using the changeset viewer.