Changeset 65316 in vbox
- Timestamp:
- Jan 16, 2017 11:08:45 AM (8 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMR0.cpp
r62869 r65316 1610 1610 * @returns The cpu structure pointer. 1611 1611 */ 1612 VMMR0DECL(PHMGLOBALCPUINFO) HMR0GetCurrentCpu(void)1612 VMMR0DECL(PHMGLOBALCPUINFO) hmR0GetCurrentCpu(void) 1613 1613 { 1614 1614 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); 1615 1615 RTCPUID idCpu = RTMpCpuId(); 1616 Assert(idCpu < RT_ELEMENTS(g_HmR0.aCpuInfo));1617 return &g_HmR0.aCpuInfo[idCpu];1618 }1619 1620 1621 /**1622 * Returns the cpu structure for the current cpu.1623 * Keep in mind that there is no guarantee it will stay the same (long jumps to ring 3!!!).1624 *1625 * @returns The cpu structure pointer.1626 * @param idCpu id of the VCPU.1627 */1628 VMMR0DECL(PHMGLOBALCPUINFO) HMR0GetCurrentCpuEx(RTCPUID idCpu)1629 {1630 1616 Assert(idCpu < RT_ELEMENTS(g_HmR0.aCpuInfo)); 1631 1617 return &g_HmR0.aCpuInfo[idCpu]; … … 1715 1701 1716 1702 /* Ok, disable VT-x. */ 1717 PHMGLOBALCPUINFO pCpu = HMR0GetCurrentCpu();1703 PHMGLOBALCPUINFO pCpu = hmR0GetCurrentCpu(); 1718 1704 AssertReturn(pCpu && pCpu->hMemObj != NIL_RTR0MEMOBJ && pCpu->pvMemObj && pCpu->HCPhysMemObj != NIL_RTHCPHYS, VERR_HM_IPE_2); 1719 1705 … … 1745 1731 Assert(g_HmR0.fGlobalInit); 1746 1732 1747 PHMGLOBALCPUINFO pCpu = HMR0GetCurrentCpu();1733 PHMGLOBALCPUINFO pCpu = hmR0GetCurrentCpu(); 1748 1734 AssertReturnVoid(pCpu && pCpu->hMemObj != NIL_RTR0MEMOBJ && pCpu->pvMemObj && pCpu->HCPhysMemObj != NIL_RTHCPHYS); 1749 1735 -
trunk/src/VBox/VMM/VMMR0/HMR0A.asm
r62478 r65316 795 795 ; load the guest ones when necessary. 796 796 ; 797 ; @cproto DECLASM(int) HMR0VMXStartVM WrapXMM(RTHCUINT fResume, PCPUMCTX pCtx, PVMCSCACHE pCache, PVM pVM, PVMCPU pVCpu, PFNHMVMXSTARTVM pfnStartVM);797 ; @cproto DECLASM(int) HMR0VMXStartVMhmR0DumpDescriptorM(RTHCUINT fResume, PCPUMCTX pCtx, PVMCSCACHE pCache, PVM pVM, PVMCPU pVCpu, PFNHMVMXSTARTVM pfnStartVM); 798 798 ; 799 799 ; @returns eax … … 806 806 ; @param pfnStartVM msc:[rbp+38h] 807 807 ; 808 ; @remarks This is essentially the same code as HMR0SVMRunWrapXMM, only the parameters differ a little bit.808 ; @remarks This is essentially the same code as hmR0SVMRunWrapXMM, only the parameters differ a little bit. 809 809 ; 810 810 ; ASSUMING 64-bit and windows for now. 811 811 ALIGNCODE(16) 812 BEGINPROC HMR0VMXStartVMWrapXMM812 BEGINPROC hmR0VMXStartVMWrapXMM 813 813 push xBP 814 814 mov xBP, xSP … … 957 957 movdqa [r10 + XMM_OFF_IN_X86FXSTATE + 0f0h], xmm15 958 958 jmp .restore_non_volatile_host_xmm_regs 959 ENDPROC HMR0VMXStartVMWrapXMM959 ENDPROC hmR0VMXStartVMWrapXMM 960 960 961 961 ;; … … 963 963 ; load the guest ones when necessary. 964 964 ; 965 ; @cproto DECLASM(int) HMR0SVMRunWrapXMM(RTHCPHYS pVMCBHostPhys, RTHCPHYS pVMCBPhys, PCPUMCTX pCtx, PVM pVM, PVMCPU pVCpu, PFNHMSVMVMRUN pfnVMRun);965 ; @cproto DECLASM(int) hmR0SVMRunWrapXMM(RTHCPHYS pVMCBHostPhys, RTHCPHYS pVMCBPhys, PCPUMCTX pCtx, PVM pVM, PVMCPU pVCpu, PFNHMSVMVMRUN pfnVMRun); 966 966 ; 967 967 ; @returns eax … … 974 974 ; @param pfnVMRun msc:[rbp+38h] 975 975 ; 976 ; @remarks This is essentially the same code as HMR0VMXStartVMWrapXMM, only the parameters differ a little bit.976 ; @remarks This is essentially the same code as hmR0VMXStartVMWrapXMM, only the parameters differ a little bit. 977 977 ; 978 978 ; ASSUMING 64-bit and windows for now. 979 979 ALIGNCODE(16) 980 BEGINPROC HMR0SVMRunWrapXMM980 BEGINPROC hmR0SVMRunWrapXMM 981 981 push xBP 982 982 mov xBP, xSP … … 1125 1125 movdqa [r10 + XMM_OFF_IN_X86FXSTATE + 0f0h], xmm15 1126 1126 jmp .restore_non_volatile_host_xmm_regs 1127 ENDPROC HMR0SVMRunWrapXMM1127 ENDPROC hmR0SVMRunWrapXMM 1128 1128 1129 1129 %endif ; VBOX_WITH_KERNEL_USING_XMM -
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r64874 r65316 885 885 PVM pVM = pVCpu->CTX_SUFF(pVM); 886 886 PSVMVMCB pVmcb = (PSVMVMCB)pVCpu->hm.s.svm.pvVmcb; 887 PHMGLOBALCPUINFO pCpu = HMR0GetCurrentCpu();887 PHMGLOBALCPUINFO pCpu = hmR0GetCurrentCpu(); 888 888 889 889 /* … … 2772 2772 if (rcVMRun == VERR_SVM_INVALID_GUEST_STATE) 2773 2773 { 2774 HMDumpRegs(pVM, pVCpu, pCtx); NOREF(pVM);2774 hmDumpRegs(pVM, pVCpu, pCtx); NOREF(pVM); 2775 2775 #ifdef VBOX_STRICT 2776 2776 Log4(("ctrl.u64VmcbCleanBits %#RX64\n", pVmcb->ctrl.u64VmcbCleanBits)); … … 3145 3145 3146 3146 /* Setup TSC offsetting. */ 3147 RTCPUID idCurrentCpu = HMR0GetCurrentCpu()->idCpu;3147 RTCPUID idCurrentCpu = hmR0GetCurrentCpu()->idCpu; 3148 3148 if ( pSvmTransient->fUpdateTscOffsetting 3149 3149 || idCurrentCpu != pVCpu->hm.s.idLastCpu) … … 3175 3175 ASMAtomicWriteBool(&pVCpu->hm.s.fCheckedTLBFlush, true); /* Used for TLB flushing, set this across the world switch. */ 3176 3176 hmR0SvmFlushTaggedTlb(pVCpu); 3177 Assert( HMR0GetCurrentCpu()->idCpu == pVCpu->hm.s.idLastCpu);3177 Assert(hmR0GetCurrentCpu()->idCpu == pVCpu->hm.s.idLastCpu); 3178 3178 3179 3179 STAM_PROFILE_ADV_STOP_START(&pVCpu->hm.s.StatEntry, &pVCpu->hm.s.StatInGC, x); -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r65280 r65316 5008 5008 /** @todo Add stats for resume vs launch. */ 5009 5009 #ifdef VBOX_WITH_KERNEL_USING_XMM 5010 int rc = HMR0VMXStartVMWrapXMM(fResumeVM, pCtx, &pVCpu->hm.s.vmx.VMCSCache, pVM, pVCpu, pVCpu->hm.s.vmx.pfnStartVM);5010 int rc = hmR0VMXStartVMWrapXMM(fResumeVM, pCtx, &pVCpu->hm.s.vmx.VMCSCache, pVM, pVCpu, pVCpu->hm.s.vmx.pfnStartVM); 5011 5011 #else 5012 5012 int rc = pVCpu->hm.s.vmx.pfnStartVM(fResumeVM, pCtx, &pVCpu->hm.s.vmx.VMCSCache, pVM, pVCpu); … … 5147 5147 { 5148 5148 pDesc = (PCX86DESCHC)(HostGdtr.pGdt + (u32Val & X86_SEL_MASK)); 5149 HMR0DumpDescriptor(pDesc, u32Val, "CS: ");5149 hmR0DumpDescriptor(pDesc, u32Val, "CS: "); 5150 5150 } 5151 5151 … … 5155 5155 { 5156 5156 pDesc = (PCX86DESCHC)(HostGdtr.pGdt + (u32Val & X86_SEL_MASK)); 5157 HMR0DumpDescriptor(pDesc, u32Val, "DS: ");5157 hmR0DumpDescriptor(pDesc, u32Val, "DS: "); 5158 5158 } 5159 5159 … … 5163 5163 { 5164 5164 pDesc = (PCX86DESCHC)(HostGdtr.pGdt + (u32Val & X86_SEL_MASK)); 5165 HMR0DumpDescriptor(pDesc, u32Val, "ES: ");5165 hmR0DumpDescriptor(pDesc, u32Val, "ES: "); 5166 5166 } 5167 5167 … … 5171 5171 { 5172 5172 pDesc = (PCX86DESCHC)(HostGdtr.pGdt + (u32Val & X86_SEL_MASK)); 5173 HMR0DumpDescriptor(pDesc, u32Val, "FS: ");5173 hmR0DumpDescriptor(pDesc, u32Val, "FS: "); 5174 5174 } 5175 5175 … … 5179 5179 { 5180 5180 pDesc = (PCX86DESCHC)(HostGdtr.pGdt + (u32Val & X86_SEL_MASK)); 5181 HMR0DumpDescriptor(pDesc, u32Val, "GS: ");5181 hmR0DumpDescriptor(pDesc, u32Val, "GS: "); 5182 5182 } 5183 5183 … … 5187 5187 { 5188 5188 pDesc = (PCX86DESCHC)(HostGdtr.pGdt + (u32Val & X86_SEL_MASK)); 5189 HMR0DumpDescriptor(pDesc, u32Val, "SS: ");5189 hmR0DumpDescriptor(pDesc, u32Val, "SS: "); 5190 5190 } 5191 5191 … … 5195 5195 { 5196 5196 pDesc = (PCX86DESCHC)(HostGdtr.pGdt + (u32Val & X86_SEL_MASK)); 5197 HMR0DumpDescriptor(pDesc, u32Val, "TR: ");5197 hmR0DumpDescriptor(pDesc, u32Val, "TR: "); 5198 5198 } 5199 5199 … … 5315 5315 #endif 5316 5316 5317 PHMGLOBALCPUINFO pCpu = HMR0GetCurrentCpu();5317 PHMGLOBALCPUINFO pCpu = hmR0GetCurrentCpu(); 5318 5318 RTHCPHYS HCPhysCpuPage = pCpu->HCPhysMemObj; 5319 5319 … … 5376 5376 NOREF(fResume); 5377 5377 5378 PHMGLOBALCPUINFO pCpu = HMR0GetCurrentCpu();5378 PHMGLOBALCPUINFO pCpu = hmR0GetCurrentCpu(); 5379 5379 RTHCPHYS HCPhysCpuPage = pCpu->HCPhysMemObj; 5380 5380 … … 8845 8845 pVmxTransient->u8GuestTpr = pVCpu->hm.s.vmx.pbVirtApic[XAPIC_OFF_TPR]; 8846 8846 8847 PHMGLOBALCPUINFO pCpu = HMR0GetCurrentCpu();8847 PHMGLOBALCPUINFO pCpu = hmR0GetCurrentCpu(); 8848 8848 RTCPUID idCurrentCpu = pCpu->idCpu; 8849 8849 if ( pVmxTransient->fUpdateTscOffsettingAndPreemptTimer … … 11984 11984 #endif 11985 11985 11986 HMDumpRegs(pVCpu->CTX_SUFF(pVM), pVCpu, pMixedCtx);11986 hmDumpRegs(pVCpu->CTX_SUFF(pVM), pVCpu, pMixedCtx); 11987 11987 return VERR_VMX_INVALID_GUEST_STATE; 11988 11988 } -
trunk/src/VBox/VMM/include/HMInternal.h
r65314 r65316 1099 1099 1100 1100 #ifdef IN_RING0 1101 /** @todo r=bird: s/[[:space:]]HM/ hm/ - internal functions starts with a 1102 * lower cased prefix. HMInternal.h is an internal header, so 1103 * everything here must be internal. */ 1104 VMMR0DECL(PHMGLOBALCPUINFO) HMR0GetCurrentCpu(void); 1105 VMMR0DECL(PHMGLOBALCPUINFO) HMR0GetCurrentCpuEx(RTCPUID idCpu); 1106 1101 VMMR0DECL(PHMGLOBALCPUINFO) hmR0GetCurrentCpu(void); 1107 1102 1108 1103 # ifdef VBOX_STRICT 1109 VMMR0DECL(void) HMDumpRegs(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);1110 VMMR0DECL(void) HMR0DumpDescriptor(PCX86DESCHC pDesc, RTSEL Sel, const char *pszMsg);1104 VMMR0DECL(void) hmDumpRegs(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx); 1105 VMMR0DECL(void) hmR0DumpDescriptor(PCX86DESCHC pDesc, RTSEL Sel, const char *pszMsg); 1111 1106 # else 1112 # define HMDumpRegs(a, b ,c) do { } while (0)1113 # define HMR0DumpDescriptor(a, b, c) do { } while (0)1107 # define hmDumpRegs(a, b ,c) do { } while (0) 1108 # define hmR0DumpDescriptor(a, b, c) do { } while (0) 1114 1109 # endif /* VBOX_STRICT */ 1115 1110 1116 1111 # ifdef VBOX_WITH_KERNEL_USING_XMM 1117 DECLASM(int) HMR0VMXStartVMWrapXMM(RTHCUINT fResume, PCPUMCTX pCtx, PVMCSCACHE pCache, PVM pVM, PVMCPU pVCpu, PFNHMVMXSTARTVM pfnStartVM);1118 DECLASM(int) HMR0SVMRunWrapXMM(RTHCPHYS pVmcbHostPhys, RTHCPHYS pVmcbPhys, PCPUMCTX pCtx, PVM pVM, PVMCPU pVCpu, PFNHMSVMVMRUN pfnVMRun);1112 DECLASM(int) hmR0VMXStartVMWrapXMM(RTHCUINT fResume, PCPUMCTX pCtx, PVMCSCACHE pCache, PVM pVM, PVMCPU pVCpu, PFNHMVMXSTARTVM pfnStartVM); 1113 DECLASM(int) hmR0SVMRunWrapXMM(RTHCPHYS pVmcbHostPhys, RTHCPHYS pVmcbPhys, PCPUMCTX pCtx, PVM pVM, PVMCPU pVCpu, PFNHMSVMVMRUN pfnVMRun); 1119 1114 # endif 1120 1115
Note:
See TracChangeset
for help on using the changeset viewer.