Changeset 50584 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Feb 25, 2014 4:06:26 PM (11 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/CPUMAllMsrs.cpp
r50158 r50584 1571 1571 *puValue = ((uint32_t)uTsc133MHz << 8) /* TSC invariant frequency. */ 1572 1572 | ((uint64_t)uTsc133MHz << 40); /* The max turbo frequency. */ 1573 return VINF_SUCCESS; 1574 } 1575 1576 1577 /** @callback_method_impl{FNCPUMRDMSR} */ 1578 static DECLCALLBACK(int) cpumMsrRd_IntelFlexRatio100MHz(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t *puValue) 1579 { 1580 uint64_t uValue = pRange->uValue & ~UINT64_C(0x1ff00); 1581 1582 uint64_t uTscHz = TMCpuTicksPerSecond(pVCpu->CTX_SUFF(pVM)); 1583 uint8_t uTsc100MHz = (uint8_t)(uTscHz / UINT32_C(100000000)); 1584 uValue |= (uint32_t)uTsc100MHz << 8; 1585 1586 *puValue = uValue; 1587 return VINF_SUCCESS; 1588 } 1589 1590 1591 /** @callback_method_impl{FNCPUMWRMSR} */ 1592 static DECLCALLBACK(int) cpumMsrWr_IntelFlexRatio100MHz(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t uValue, uint64_t uRawValue) 1593 { 1594 /** @todo implement writing MSR_FLEX_RATIO. */ 1595 return VINF_SUCCESS; 1596 } 1597 1598 1599 /** @callback_method_impl{FNCPUMRDMSR} */ 1600 static DECLCALLBACK(int) cpumMsrRd_IntelFlexRatio133MHz(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t *puValue) 1601 { 1602 uint64_t uValue = pRange->uValue & ~UINT64_C(0x1ff00); 1603 1604 uint64_t uTscHz = TMCpuTicksPerSecond(pVCpu->CTX_SUFF(pVM)); 1605 uint8_t uTsc133MHz = (uint8_t)(uTscHz / UINT32_C(133333333)); 1606 uValue |= (uint32_t)uTsc133MHz << 8; 1607 1608 *puValue = uValue; 1609 return VINF_SUCCESS; 1610 } 1611 1612 1613 /** @callback_method_impl{FNCPUMWRMSR} */ 1614 static DECLCALLBACK(int) cpumMsrWr_IntelFlexRatio133MHz(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t uValue, uint64_t uRawValue) 1615 { 1616 /** @todo implement writing MSR_FLEX_RATIO. */ 1573 1617 return VINF_SUCCESS; 1574 1618 } … … 4346 4390 cpumMsrRd_IntelPlatformInfo100MHz, 4347 4391 cpumMsrRd_IntelPlatformInfo133MHz, 4392 cpumMsrRd_IntelFlexRatio100MHz, 4393 cpumMsrRd_IntelFlexRatio133MHz, 4348 4394 cpumMsrRd_IntelPkgCStConfigControl, 4349 4395 cpumMsrRd_IntelPmgIoCaptureBase, … … 4581 4627 cpumMsrWr_IntelP4EbcSoftPowerOn, 4582 4628 cpumMsrWr_IntelP4EbcFrequencyId, 4629 cpumMsrWr_IntelFlexRatio100MHz, 4630 cpumMsrWr_IntelFlexRatio133MHz, 4583 4631 cpumMsrWr_IntelPkgCStConfigControl, 4584 4632 cpumMsrWr_IntelPmgIoCaptureBase, … … 5032 5080 CPUM_ASSERT_RD_MSR_FN(IntelPlatformInfo100MHz); 5033 5081 CPUM_ASSERT_RD_MSR_FN(IntelPlatformInfo133MHz); 5082 CPUM_ASSERT_RD_MSR_FN(IntelFlexRatio100MHz); 5083 CPUM_ASSERT_RD_MSR_FN(IntelFlexRatio133MHz); 5034 5084 CPUM_ASSERT_RD_MSR_FN(IntelPkgCStConfigControl); 5035 5085 CPUM_ASSERT_RD_MSR_FN(IntelPmgIoCaptureBase); … … 5256 5306 CPUM_ASSERT_WR_MSR_FN(IntelP4EbcSoftPowerOn); 5257 5307 CPUM_ASSERT_WR_MSR_FN(IntelP4EbcFrequencyId); 5308 CPUM_ASSERT_WR_MSR_FN(IntelFlexRatio100MHz); 5309 CPUM_ASSERT_WR_MSR_FN(IntelFlexRatio133MHz); 5258 5310 CPUM_ASSERT_WR_MSR_FN(IntelPkgCStConfigControl); 5259 5311 CPUM_ASSERT_WR_MSR_FN(IntelPmgIoCaptureBase); … … 5400 5452 5401 5453 5454 /** 5455 * Gets the bus frequency. 5456 * 5457 * The bus frequency is used as a base in several MSRs that gives the CPU and 5458 * other frequency ratios. 5459 * 5460 * @returns Bus frequency in Hz. 5461 * @param pVM Pointer to the shared VM structure. 5462 */ 5463 VMMDECL(uint64_t) CPUMGetGuestBusFrequency(PVM pVM) 5464 { 5465 if (CPUMMICROARCH_IS_INTEL_CORE7(pVM->cpum.s.GuestFeatures.enmMicroarch)) 5466 { 5467 return pVM->cpum.s.GuestFeatures.enmMicroarch >= kCpumMicroarch_Intel_Core7_SandyBridge 5468 ? UINT64_C(100000000) /* 100MHz */ 5469 : UINT64_C(133333333); /* 133MHz */ 5470 } 5471 5472 /* 133MHz */ 5473 return UINT64_C(133333333); 5474 } 5475 5476 5402 5477 #ifdef IN_RING0 5403 5478 -
trunk/src/VBox/VMM/VMMR3/cpus/Intel_Core_i5_3570.h
r49922 r50584 78 78 MFO(0x0000009b, "IA32_SMM_MONITOR_CTL", Ia32SmmMonitorCtl), /* value=0x0 */ 79 79 RSN(0x000000c1, 0x000000c8, "IA32_PMCn", Ia32PmcN, Ia32PmcN, 0x0, ~(uint64_t)UINT32_MAX, 0), 80 M VO(0x000000ce, "P6_UNK_0000_00ce", UINT64_C(0x81010e0012200)),80 MFO(0x000000ce, "MSR_PLATFORM_INFO", IntelPlatformInfo100MHz), /* value=0x81010'e0012200*/ 81 81 MFX(0x000000e2, "MSR_PKG_CST_CONFIG_CONTROL", IntelPkgCStConfigControl, IntelPkgCStConfigControl, 0, 0, UINT64_C(0xffffffffe1ffffff)), /* value=0x1e008403 */ 82 82 MFX(0x000000e4, "MSR_PMG_IO_CAPTURE_BASE", IntelPmgIoCaptureBase, IntelPmgIoCaptureBase, 0, 0, UINT64_C(0xfffffffffff80000)), /* value=0x10414 */ … … 99 99 MFX(0x0000017a, "IA32_MCG_STATUS", Ia32McgStatus, Ia32McgStatus, 0, 0, UINT64_C(0xfffffffffffffff8)), /* value=0x0 */ 100 100 RSN(0x00000186, 0x0000018d, "IA32_PERFEVTSELn", Ia32PerfEvtSelN, Ia32PerfEvtSelN, 0x0, 0, UINT64_C(0xffffffff00080000)), 101 M VX(0x00000194, "CLOCK_FLEX_MAX", 0x190000, 0x1e00ff, UINT64_C(0xffffffffffe00000)),101 MFX(0x00000194, "CLOCK_FLEX_MAX", IntelFlexRatio100MHz, IntelFlexRatio100MHz, 0x190000, 0x1e00ff, UINT64_C(0xffffffffffe00000)), 102 102 MFX(0x00000198, "IA32_PERF_STATUS", Ia32PerfStatus, ReadOnly, UINT64_C(0x1d2400001000), 0, 0), /* value=0x1d24`00001000 */ 103 103 MFX(0x00000199, "IA32_PERF_CTL", Ia32PerfCtl, Ia32PerfCtl, 0x1000, 0, 0), /* Might bite. value=0x1000 */ -
trunk/src/VBox/VMM/VMMR3/cpus/Intel_Core_i7_3960X.h
r49922 r50584 86 86 MFO(0x0000009b, "IA32_SMM_MONITOR_CTL", Ia32SmmMonitorCtl), /* value=0x0 */ 87 87 RSN(0x000000c1, 0x000000c4, "IA32_PMCn", Ia32PmcN, Ia32PmcN, 0x0, ~(uint64_t)UINT32_MAX, 0), 88 M VO(0x000000ce, "P6_UNK_0000_00ce", UINT64_C(0xc0070012100)),88 MFO(0x000000ce, "MSR_PLATFORM_INFO", IntelPlatformInfo100MHz), /* value=0xc00'70012100*/ 89 89 MFX(0x000000e2, "MSR_PKG_CST_CONFIG_CONTROL", IntelPkgCStConfigControl, IntelPkgCStConfigControl, 0, 0, UINT64_C(0xffffffffe1ffffff)), /* value=0x1e008400 */ 90 90 MFX(0x000000e4, "MSR_PMG_IO_CAPTURE_BASE", IntelPmgIoCaptureBase, IntelPmgIoCaptureBase, 0, 0, UINT64_C(0xfffffffffff80000)), /* value=0x20414 */ … … 103 103 MFX(0x0000017f, "I7_SB_ERROR_CONTROL", IntelI7SandyErrorControl, IntelI7SandyErrorControl, 0, 0xc, UINT64_C(0xffffffffffffffe1)), /* value=0x0 */ 104 104 RSN(0x00000186, 0x00000189, "IA32_PERFEVTSELn", Ia32PerfEvtSelN, Ia32PerfEvtSelN, 0x0, 0, UINT64_C(0xffffffff00080000)), 105 M VX(0x00000194, "CLOCK_FLEX_MAX", 0xf2100, 0xe0000, UINT64_C(0xfffffffffff00000)),105 MFX(0x00000194, "CLOCK_FLEX_MAX", IntelFlexRatio100MHz, IntelFlexRatio100MHz, 0xf2100, 0xe0000, UINT64_C(0xfffffffffff00000)), 106 106 MFX(0x00000198, "IA32_PERF_STATUS", Ia32PerfStatus, ReadOnly, UINT64_C(0x288300002400), 0, 0), /* value=0x2883`00002400 */ 107 107 MFX(0x00000199, "IA32_PERF_CTL", Ia32PerfCtl, Ia32PerfCtl, 0x2700, 0, 0), /* Might bite. value=0x2700 */ -
trunk/src/VBox/VMM/include/CPUMInternal.h
r49977 r50584 211 211 kCpumMsrRdFn_IntelPlatformInfo100MHz, 212 212 kCpumMsrRdFn_IntelPlatformInfo133MHz, 213 kCpumMsrRdFn_IntelFlexRatio100MHz, /**< Takes real value as reference. */ 214 kCpumMsrRdFn_IntelFlexRatio133MHz, /**< Takes real value as reference. */ 213 215 kCpumMsrRdFn_IntelPkgCStConfigControl, 214 216 kCpumMsrRdFn_IntelPmgIoCaptureBase, … … 454 456 kCpumMsrWrFn_IntelP4EbcSoftPowerOn, 455 457 kCpumMsrWrFn_IntelP4EbcFrequencyId, 458 kCpumMsrWrFn_IntelFlexRatio100MHz, 459 kCpumMsrWrFn_IntelFlexRatio133MHz, 456 460 kCpumMsrWrFn_IntelPkgCStConfigControl, 457 461 kCpumMsrWrFn_IntelPmgIoCaptureBase, -
trunk/src/VBox/VMM/tools/VBoxCpuReport.cpp
r49993 r50584 695 695 case 0x000000c8: return g_enmMicroarch >= kCpumMicroarch_Intel_Core7_First ? "IA32_PMC7" : NULL; 696 696 case 0x000000cd: return "P6_UNK_0000_00cd"; /* P6_M_Dothan. */ 697 case 0x000000ce: return "P6_UNK_0000_00ce"; /* P6_M_Dothan. */697 case 0x000000ce: return g_enmMicroarch >= kCpumMicroarch_Intel_Core7_First ? "IA32_PLATFORM_INFO" : "P6_UNK_0000_00ce"; /* P6_M_Dothan. */ 698 698 case 0x000000cf: return "C2_UNK_0000_00cf"; /* Core2_Penryn. */ 699 699 case 0x000000e0: return "C2_UNK_0000_00e0"; /* Core2_Penryn. */ … … 1843 1843 return NULL; 1844 1844 1845 case 0x000000ce: return CPUMMICROARCH_IS_INTEL_CORE7(g_enmMicroarch) 1846 ? (g_enmMicroarch >= kCpumMicroarch_Intel_Core7_SandyBridge 1847 ? "IntelPlatformInfo100MHz" : "IntelPlatformInfo133MHz") 1848 : NULL; 1849 1845 1850 case 0x000000e2: return "IntelPkgCStConfigControl"; 1846 1851 case 0x000000e3: return "IntelCore2SmmCStMiscInfo"; … … 1877 1882 case 0x00000187: return "Ia32PerfEvtSelN"; 1878 1883 case 0x00000193: return /*g_fIntelNetBurst ? NULL :*/ NULL /* Core2_Penryn. */; 1884 case 0x00000194: 1885 if (g_fIntelNetBurst) 1886 break; 1887 *pfTakesValue = true; 1888 return CPUMMICROARCH_IS_INTEL_CORE7(g_enmMicroarch) && g_enmMicroarch >= kCpumMicroarch_Intel_Core7_SandyBridge 1889 ? "IntelFlexRatio100MHz" : "IntelFlexRatio133MHz"; 1879 1890 case 0x00000198: *pfTakesValue = true; return "Ia32PerfStatus"; 1880 1891 case 0x00000199: *pfTakesValue = true; return "Ia32PerfCtl";
Note:
See TracChangeset
for help on using the changeset viewer.