Changeset 54256 in vbox
- Timestamp:
- Feb 17, 2015 11:20:44 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/vm.h
r53795 r54256 117 117 * Only valid when in RC or HMR0 with scheduling disabled. */ 118 118 RTCPUID volatile idHostCpu; /* 56 / 36 */ 119 /** The CPU set index corresponding to idHostCpu, UINT32_MAX if not valid. 120 * @remarks Best to make sure iHostCpuSet shares cache line with idHostCpu! */ 121 uint32_t volatile iHostCpuSet; /* 60 / 40 */ 119 122 120 123 /** Trace groups enable flags. */ 121 uint32_t fTraceGroups; /* 6 0 / 40*/124 uint32_t fTraceGroups; /* 64 / 44 */ 122 125 /** Align the structures below bit on a 64-byte boundary and make sure it starts 123 126 * at the same offset in both 64-bit and 32-bit builds. … … 128 131 * following it (to grow into and align the struct size). 129 132 * */ 130 uint8_t abAlignment1[HC_ARCH_BITS == 64 ? 60 : 16+64];133 uint8_t abAlignment1[HC_ARCH_BITS == 64 ? 56 : 12+64]; 131 134 /** State data for use by ad hoc profiling. */ 132 135 uint32_t uAdHoc; -
trunk/include/VBox/vmm/vm.mac
r53094 r54256 123 123 .hNativeThreadR0 RTR0PTR_RES 1 124 124 .idHostCpu resd 1 125 .iHostCpuSet resd 1 125 126 .fTraceGroups resd 1 126 127 %if HC_ARCH_BITS == 32 127 .abAlignment1 resb 1 6+64128 .abAlignment1 resb 12+64 128 129 %else 129 .abAlignment1 resb 60130 .abAlignment1 resb 56 130 131 %endif 131 132 .uAdHoc resd 1 -
trunk/src/VBox/VMM/VMMR0/VMMR0.cpp
r53632 r54256 566 566 567 567 /* We need to update the VCPU <-> host CPU mapping. */ 568 RTCPUID idHostCpu = RTMpCpuId(); 568 RTCPUID idHostCpu = RTMpCpuId(); 569 pVCpu->iHostCpuSet = RTMpCpuIdToSetIndex(idHostCpu); 569 570 ASMAtomicWriteU32(&pVCpu->idHostCpu, idHostCpu); 570 571 … … 586 587 * have the same host CPU associated with it. 587 588 */ 589 pVCpu->iHostCpuSet = UINT32_MAX; 588 590 ASMAtomicWriteU32(&pVCpu->idHostCpu, NIL_RTCPUID); 589 591 break; … … 867 869 CPUMR0SetLApic(pVCpu, idHostCpu); 868 870 #endif 871 pVCpu->iHostCpuSet = RTMpCpuIdToSetIndex(idHostCpu); 869 872 ASMAtomicWriteU32(&pVCpu->idHostCpu, idHostCpu); 870 873 if (pVM->vmm.s.fUsePeriodicPreemptionTimers) … … 911 914 else 912 915 pVCpu->vmm.s.iLastGZRc = rc; 916 pVCpu->iHostCpuSet = UINT32_MAX; 913 917 ASMAtomicWriteU32(&pVCpu->idHostCpu, NIL_RTCPUID); 914 918 RTThreadPreemptRestore(&PreemptState); … … 926 930 927 931 /* Update the VCPU <-> host CPU mapping before doing anything else. */ 928 ASMAtomicWriteU32(&pVCpu->idHostCpu, RTMpCpuId()); 932 RTCPUID idHostCpu = RTMpCpuId(); 933 pVCpu->iHostCpuSet = RTMpCpuIdToSetIndex(idHostCpu); 934 ASMAtomicWriteU32(&pVCpu->idHostCpu, idHostCpu); 935 929 936 if (pVM->vmm.s.fUsePeriodicPreemptionTimers) 930 937 GVMMR0SchedUpdatePeriodicPreemptionTimer(pVM, pVCpu->idHostCpu, TMCalcHostTimerFrequency(pVM, pVCpu)); … … 1000 1007 1001 1008 /* Clear the VCPU <-> host CPU mapping as we've left HM context. */ 1009 pVCpu->iHostCpuSet = UINT32_MAX; 1002 1010 ASMAtomicWriteU32(&pVCpu->idHostCpu, NIL_RTCPUID); 1003 1011
Note:
See TracChangeset
for help on using the changeset viewer.