Changeset 14875 in vbox for trunk/src/VBox
- Timestamp:
- Dec 1, 2008 4:24:22 PM (16 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/HWACCM.cpp
r14851 r14875 844 844 AssertMsgRCReturn(rc, ("SVMGCVMRun64 -> rc=%Rrc\n", rc), rc); 845 845 846 rc = PDMR3LdrGetSymbolRC(pVM, NULL, "HWACCMSetupFPU64", &pVM->hwaccm.s.pfnS etupFPU64);846 rc = PDMR3LdrGetSymbolRC(pVM, NULL, "HWACCMSetupFPU64", &pVM->hwaccm.s.pfnSaveGuestFPU64); 847 847 AssertMsgRCReturn(rc, ("HWACCMSetupFPU64 -> rc=%Rrc\n", rc), rc); 848 848 849 rc = PDMR3LdrGetSymbolRC(pVM, NULL, "HWACCMSetupDebug64", &pVM->hwaccm.s.pfnS etupDebug64);849 rc = PDMR3LdrGetSymbolRC(pVM, NULL, "HWACCMSetupDebug64", &pVM->hwaccm.s.pfnSaveGuestDebug64); 850 850 AssertMsgRCReturn(rc, ("HWACCMSetupDebug64 -> rc=%Rrc\n", rc), rc); 851 851 } -
trunk/src/VBox/VMM/HWACCMInternal.h
r14851 r14875 167 167 168 168 /** 169 * Switcher function, HC to RC. 170 * 171 * @param pVM The VM handle. 172 * @returns Return code indicating the action to take. 173 */ 174 typedef DECLASMTYPE(int) FNHWACCMSWITCHERHC(PVM pVM); 175 /** Pointer to switcher function. */ 176 typedef FNHWACCMSWITCHERHC *PFNHWACCMSWITCHERHC; 177 178 /** 169 179 * HWACCM VM Instance data. 170 180 * Changes to this must checked against the padding of the cfgm union in VM! … … 202 212 #if HC_ARCH_BITS == 32 203 213 /** 32 to 64 bits switcher entrypoint. */ 204 R TR0PTRpfnHost32ToGuest64R0;214 R0PTRTYPE(PFNHWACCMSWITCHERHC) pfnHost32ToGuest64R0; 205 215 206 216 /* AMD-V 64 bits vmrun handler */ … … 211 221 212 222 /* RC handler to setup the 64 bits FPU state. */ 213 RTRCPTR pfnS etupFPU64;223 RTRCPTR pfnSaveGuestFPU64; 214 224 215 225 /* RC handler to setup the 64 bits debug state. */ 216 RTRCPTR pfnS etupDebug64;226 RTRCPTR pfnSaveGuestDebug64; 217 227 #endif 218 228 … … 442 452 443 453 /** Ring 0 handlers for VT-x. */ 444 DECLR0CALLBACKMEMBER(int, pfnVMRun,(RTHCPHYS pVMCBHostPhys, RTHCPHYS pVMCBPhys, PCPUMCTX pCtx ));454 DECLR0CALLBACKMEMBER(int, pfnVMRun,(RTHCPHYS pVMCBHostPhys, RTHCPHYS pVMCBPhys, PCPUMCTX pCtx, PVM pVM, PVMCPU pVCpu)); 445 455 446 456 } svm; -
trunk/src/VBox/VMM/VMMAll/VMMAll.cpp
r13974 r14875 32 32 33 33 34 #ifndef IN_RING035 34 /** 36 35 * Gets the bottom of the hypervisor stack - RC Ptr. … … 46 45 return (RTRCPTR)pVM->vmm.s.pbEMTStackBottomRC; 47 46 } 48 #endif /* !IN_RING0 */49 47 50 48 -
trunk/src/VBox/VMM/VMMR0/CPUMR0.cpp
r14871 r14875 31 31 #include <VBox/err.h> 32 32 #include <VBox/log.h> 33 #include <VBox/hwaccm.h> 33 34 #include <iprt/assert.h> 34 35 #include <iprt/asm.h> … … 321 322 if (CPUMIsGuestInLongModeEx(pCtx)) 322 323 { 323 HWACCMR0SaveDebugState(pVM, pVCpu, pCtx , fDR6);324 HWACCMR0SaveDebugState(pVM, pVCpu, pCtx); 324 325 } 325 326 else -
trunk/src/VBox/VMM/VMMR0/HWACCMR0.cpp
r14870 r14875 1012 1012 { 1013 1013 if (pVM->hwaccm.s.vmx.fSupported) 1014 { 1015 } 1016 else 1017 { 1018 } 1019 return VINF_SUCCESS; 1014 return VMXR0Execute64BitsHandler(pVM, pVCpu, pCtx, pVM->hwaccm.s.pfnSaveGuestFPU64); 1015 1016 return SVMR0Execute64BitsHandler(pVM, pVCpu, pCtx, pVM->hwaccm.s.pfnSaveGuestFPU64); 1020 1017 } 1021 1018 … … 1027 1024 * @param pVCpu VMCPU handle. 1028 1025 * @param pCtx CPU context 1029 * @param fDR6 Include DR6 or not 1030 */ 1031 VMMR0DECL(int) HWACCMR0SaveDebugState(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx, bool fDR6) 1026 */ 1027 VMMR0DECL(int) HWACCMR0SaveDebugState(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx) 1032 1028 { 1033 1029 if (pVM->hwaccm.s.vmx.fSupported) 1034 { 1035 } 1036 else 1037 { 1038 } 1039 return VINF_SUCCESS; 1040 } 1030 return VMXR0Execute64BitsHandler(pVM, pVCpu, pCtx, pVM->hwaccm.s.pfnSaveGuestDebug64); 1031 1032 return SVMR0Execute64BitsHandler(pVM, pVCpu, pCtx, pVM->hwaccm.s.pfnSaveGuestDebug64); 1033 } 1034 1041 1035 #endif /* HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) */ 1042 1036 -
trunk/src/VBox/VMM/VMMR0/HWACCMR0A.asm
r14804 r14875 1167 1167 ENDPROC VMXR0StartVM64 1168 1168 1169 ;DECLASM(int) SVMR0VMRun(RTHCPHYS pVMCBHostPhys, RTHCPHYS pVMCBPhys, PCPUMCTX pCtx );1169 ;DECLASM(int) SVMR0VMRun(RTHCPHYS pVMCBHostPhys, RTHCPHYS pVMCBPhys, PCPUMCTX pCtx, PVM pVM, PVMCPU pVCpu); 1170 1170 BEGINPROC SVMR0VMRun 1171 1171 cmp byte [NAME(g_fVMXIs64bitHost)], 0 … … 1219 1219 ENDPROC SVMR0VMRun 1220 1220 1221 ; DECLASM(int) SVMR0VMRun64(RTHCPHYS pVMCBHostPhys, RTHCPHYS pVMCBPhys, PCPUMCTX pCtx );1221 ; DECLASM(int) SVMR0VMRun64(RTHCPHYS pVMCBHostPhys, RTHCPHYS pVMCBPhys, PCPUMCTX pCtx, PVM pVM, PVMCPU pVCpu); 1222 1222 BEGINPROC SVMR0VMRun64 1223 1223 cmp byte [NAME(g_fVMXIs64bitHost)], 0 -
trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp
r14862 r14875 1040 1040 #endif 1041 1041 TMNotifyStartOfExecution(pVM); 1042 pVCpu->hwaccm.s.svm.pfnVMRun(pVM->hwaccm.s.svm.pVMCBHostPhys, pVCpu->hwaccm.s.svm.pVMCBPhys, pCtx );1042 pVCpu->hwaccm.s.svm.pfnVMRun(pVM->hwaccm.s.svm.pVMCBHostPhys, pVCpu->hwaccm.s.svm.pVMCBPhys, pCtx, pVM, pVCpu); 1043 1043 TMNotifyEndOfExecution(pVM); 1044 1044 STAM_PROFILE_ADV_STOP(&pVCpu->hwaccm.s.StatInGC, x); … … 2266 2266 } 2267 2267 2268 #if HC_ARCH_BITS == 32 2268 #if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) 2269 2269 /** 2270 2270 * Prepares for and executes VMRUN (64 bits guests from a 32 bits hosts). … … 2274 2274 * @param pVMCBPhys Physical address of the VMCB. 2275 2275 * @param pCtx Guest context. 2276 * @param pVM The VM to operate on. 2277 * @param pVCpu The VMCPU to operate on. 2276 2278 */ 2277 DECLASM(int) SVMR0VMSwitcherRun64(RTHCPHYS pVMCBHostPhys, RTHCPHYS pVMCBPhys, PCPUMCTX pCtx )2279 DECLASM(int) SVMR0VMSwitcherRun64(RTHCPHYS pVMCBHostPhys, RTHCPHYS pVMCBPhys, PCPUMCTX pCtx, PVM pVM, PVMCPU pVCpu) 2278 2280 { 2281 return SVMR0Execute64BitsHandler(pVM, pVCpu, pCtx, pVM->hwaccm.s.pfnVMXGCStartVM64); 2282 } 2283 2284 /** 2285 * Executes the specified handler in 64 mode 2286 * 2287 * @returns VBox status code. 2288 * @param pVM The VM to operate on. 2289 * @param pVCpu The VMCPU to operate on. 2290 * @param pCtx Guest context 2291 * @param pfnHandler RC handler 2292 */ 2293 VMMR0DECL(int) SVMR0Execute64BitsHandler(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx, RTRCPTR pfnHandler) 2294 { 2295 int rc; 2296 RTCCUINTREG uFlags; 2297 2279 2298 /* @todo This code is not guest SMP safe (hyper context) */ 2280 //// AssertReturn(pVM->cCPUs == 1, VERR_ACCESS_DENIED); 2281 return VERR_NOT_IMPLEMENTED; 2299 AssertReturn(pVM->cCPUs == 1, VERR_ACCESS_DENIED); 2300 2301 uFlags = ASMIntDisableFlags(); 2302 2303 CPUMSetHyperESP(pVM, VMMGetStackRC(pVM)); 2304 CPUMSetHyperEIP(pVM, pfnHandler); 2305 2306 /* Call switcher. */ 2307 rc = pVM->hwaccm.s.pfnHost32ToGuest64R0(pVM); 2308 2309 ASMSetFlags(uFlags); 2310 return rc; 2282 2311 } 2283 2312 2284 #endif /* HC_ARCH_BITS == 32 */2313 #endif /* HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) */ -
trunk/src/VBox/VMM/VMMR0/HWSVMR0.h
r14366 r14875 138 138 VMMR0DECL(int) SVMR0LoadGuestState(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx); 139 139 140 #if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) 141 142 /** 143 * Prepares for and executes VMRUN (64 bits guests from a 32 bits hosts). 144 * 145 * @returns VBox status code. 146 * @param pVMCBHostPhys Physical address of host VMCB. 147 * @param pVMCBPhys Physical address of the VMCB. 148 * @param pCtx Guest context. 149 * @param pVM The VM to operate on. 150 * @param pVCpu The VMCPU to operate on. (not used) 151 */ 152 DECLASM(int) SVMR0VMSwitcherRun64(RTHCPHYS pVMCBHostPhys, RTHCPHYS pVMCBPhys, PCPUMCTX pCtx, PVM pVM, PVMCPU pVCpu); 153 154 /** 155 * Executes the specified handler in 64 mode 156 * 157 * @returns VBox status code. 158 * @param pVM The VM to operate on. 159 * @param pVCpu The VMCPU to operate on. 160 * @param pCtx Guest context 161 * @param pfnHandler RC handler 162 */ 163 VMMR0DECL(int) SVMR0Execute64BitsHandler(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx, RTRCPTR pfnHandler); 164 165 #endif /* HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) */ 166 140 167 /** 141 168 * Prepares for and executes VMRUN (32 bits guests). … … 145 172 * @param pVMCBPhys Physical address of the VMCB. 146 173 * @param pCtx Guest context. 174 * @param pVM The VM to operate on. (not used) 175 * @param pVCpu The VMCPU to operate on. (not used) 147 176 */ 148 DECLASM(int) SVMR0VMRun(RTHCPHYS pVMCBHostPhys, RTHCPHYS pVMCBPhys, PCPUMCTX pCtx); 177 DECLASM(int) SVMR0VMRun(RTHCPHYS pVMCBHostPhys, RTHCPHYS pVMCBPhys, PCPUMCTX pCtx, PVM pVM, PVMCPU pVCpu); 178 149 179 150 180 /** … … 155 185 * @param pVMCBPhys Physical address of the VMCB. 156 186 * @param pCtx Guest context. 187 * @param pVM The VM to operate on. (not used) 188 * @param pVCpu The VMCPU to operate on. (not used) 157 189 */ 158 DECLASM(int) SVMR0VMRun64(RTHCPHYS pVMCBHostPhys, RTHCPHYS pVMCBPhys, PCPUMCTX pCtx); 159 160 /** 161 * Prepares for and executes VMRUN (64 bits guests from a 32 bits hosts). 162 * 163 * @returns VBox status code. 164 * @param pVMCBHostPhys Physical address of host VMCB. 165 * @param pVMCBPhys Physical address of the VMCB. 166 * @param pCtx Guest context. 167 */ 168 DECLASM(int) SVMR0VMSwitcherRun64(RTHCPHYS pVMCBHostPhys, RTHCPHYS pVMCBPhys, PCPUMCTX pCtx); 190 DECLASM(int) SVMR0VMRun64(RTHCPHYS pVMCBHostPhys, RTHCPHYS pVMCBPhys, PCPUMCTX pCtx, PVM pVM, PVMCPU pVCpu); 169 191 170 192 /** -
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r14859 r14875 3417 3417 } 3418 3418 3419 #if HC_ARCH_BITS == 32 3419 #if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) 3420 3420 /** 3421 3421 * Prepares for and executes VMLAUNCH (64 bits guest mode) … … 3429 3429 DECLASM(int) VMXR0SwitcherStartVM64(RTHCUINT fResume, PCPUMCTX pCtx, PVM pVM, PVMCPU pVCpu) 3430 3430 { 3431 return VMXR0Execute64BitsHandler(pVM, pVCpu, pCtx, pVM->hwaccm.s.pfnVMXGCStartVM64); 3432 } 3433 3434 /** 3435 * Executes the specified handler in 64 mode 3436 * 3437 * @returns VBox status code. 3438 * @param pVM The VM to operate on. 3439 * @param pVCpu The VMCPU to operate on. 3440 * @param pCtx Guest context 3441 * @param pfnHandler RC handler 3442 */ 3443 VMMR0DECL(int) VMXR0Execute64BitsHandler(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx, RTRCPTR pfnHandler) 3444 { 3431 3445 int rc, rc2; 3432 3446 RTCCUINTREG uFlags; … … 3447 3461 3448 3462 uFlags = ASMIntDisableFlags(); 3463 3464 CPUMSetHyperESP(pVM, VMMGetStackRC(pVM)); 3465 CPUMSetHyperEIP(pVM, pfnHandler); 3466 3449 3467 /* Call switcher. */ 3450 rc = VERR_ACCESS_DENIED;3468 rc = pVM->hwaccm.s.pfnHost32ToGuest64R0(pVM); 3451 3469 3452 3470 ASMSetFlags(uFlags); … … 3468 3486 return rc; 3469 3487 } 3470 #endif 3471 3472 3488 3489 #endif /* HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) */ 3490 3491 -
trunk/src/VBox/VMM/VMMR0/HWVMXR0.h
r14845 r14875 139 139 VMMR0DECL(int) VMXR0RunGuestCode(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx); 140 140 141 142 /** 143 * Executes the specified handler in 64 mode 144 * 145 * @returns VBox status code. 146 * @param pVM The VM to operate on. 147 * @param pVCpu The VMCPU to operate on. 148 * @param pCtx Guest context 149 * @param pfnHandler RC handler 150 */ 151 VMMR0DECL(int) VMXR0Execute64BitsHandler(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx, RTRCPTR pfnHandler); 141 152 142 153 #define VMX_WRITE_SELREG(REG, reg) \
Note:
See TracChangeset
for help on using the changeset viewer.