Changeset 10572 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Jul 13, 2008 1:24:51 AM (17 years ago)
- Location:
- trunk/src/VBox/VMM/VMMR0
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HWACCMR0.cpp
r10537 r10572 140 140 memset(&HWACCMR0Globals, 0, sizeof(HWACCMR0Globals)); 141 141 HWACCMR0Globals.enmHwAccmState = HWACCMSTATE_UNINITIALIZED; 142 for (unsigned i = 0; i < RT_ELEMENTS(HWACCMR0Globals.aCpuInfo); i++) 143 HWACCMR0Globals.aCpuInfo[i].pMemObj = NIL_RTR0MEMOBJ; 142 144 143 145 /* Fill in all callbacks with placeholders. */ … … 350 352 HWACCMR0Globals.pfnSetupVM = VMXR0SetupVM; 351 353 } 352 else 354 else 353 355 if (HWACCMR0Globals.svm.fSupported) 354 356 { … … 415 417 { 416 418 AssertMsg(VBOX_SUCCESS(aRc[i]), ("HWACCMR0DisableCPU failed for cpu %d with rc=%d\n", i, aRc[i])); 417 if (HWACCMR0Globals.aCpuInfo[i].pMemObj )419 if (HWACCMR0Globals.aCpuInfo[i].pMemObj != NIL_RTR0MEMOBJ) 418 420 { 419 421 RTR0MemObjFree(HWACCMR0Globals.aCpuInfo[i].pMemObj, false); 420 HWACCMR0Globals.aCpuInfo[i].pMemObj = N ULL;422 HWACCMR0Globals.aCpuInfo[i].pMemObj = NIL_RTR0MEMOBJ; 421 423 } 422 424 } … … 529 531 void *pvR0 = RTR0MemObjAddress(HWACCMR0Globals.aCpuInfo[i].pMemObj); 530 532 Assert(pvR0); 531 memset(pvR0, 0, PAGE_SIZE);533 ASMMemZeroPage(pvR0); 532 534 533 535 #ifdef LOG_ENABLED -
trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp
r10566 r10572 120 120 int rc; 121 121 122 pVM->hwaccm.s.svm.pMemObjVMCB = NIL_RTR0MEMOBJ; 123 pVM->hwaccm.s.svm.pMemObjVMCBHost = NIL_RTR0MEMOBJ; 124 pVM->hwaccm.s.svm.pMemObjIOBitmap = NIL_RTR0MEMOBJ; 125 pVM->hwaccm.s.svm.pMemObjMSRBitmap = NIL_RTR0MEMOBJ; 126 127 122 128 /* Allocate one page for the VM control block (VMCB). */ 123 129 rc = RTR0MemObjAllocCont(&pVM->hwaccm.s.svm.pMemObjVMCB, 1 << PAGE_SHIFT, true /* executable R0 mapping */); … … 127 133 pVM->hwaccm.s.svm.pVMCB = RTR0MemObjAddress(pVM->hwaccm.s.svm.pMemObjVMCB); 128 134 pVM->hwaccm.s.svm.pVMCBPhys = RTR0MemObjGetPagePhysAddr(pVM->hwaccm.s.svm.pMemObjVMCB, 0); 129 ASMMemZero 32(pVM->hwaccm.s.svm.pVMCB, PAGE_SIZE);135 ASMMemZeroPage(pVM->hwaccm.s.svm.pVMCB); 130 136 131 137 /* Allocate one page for the host context */ … … 136 142 pVM->hwaccm.s.svm.pVMCBHost = RTR0MemObjAddress(pVM->hwaccm.s.svm.pMemObjVMCBHost); 137 143 pVM->hwaccm.s.svm.pVMCBHostPhys = RTR0MemObjGetPagePhysAddr(pVM->hwaccm.s.svm.pMemObjVMCBHost, 0); 138 ASMMemZero 32(pVM->hwaccm.s.svm.pVMCBHost, PAGE_SIZE);144 ASMMemZeroPage(pVM->hwaccm.s.svm.pVMCBHost); 139 145 140 146 /* Allocate 12 KB for the IO bitmap (doesn't seem to be a way to convince SVM not to use it) */ … … 202 208 HWACCMR0DECL(int) SVMR0TermVM(PVM pVM) 203 209 { 204 if (pVM->hwaccm.s.svm.pMemObjVMCB )210 if (pVM->hwaccm.s.svm.pMemObjVMCB != NIL_RTR0MEMOBJ) 205 211 { 206 212 RTR0MemObjFree(pVM->hwaccm.s.svm.pMemObjVMCB, false); 207 213 pVM->hwaccm.s.svm.pVMCB = 0; 208 214 pVM->hwaccm.s.svm.pVMCBPhys = 0; 209 pVM->hwaccm.s.svm.pMemObjVMCB = 0;210 } 211 if (pVM->hwaccm.s.svm.pMemObjVMCBHost )215 pVM->hwaccm.s.svm.pMemObjVMCB = NIL_RTR0MEMOBJ; 216 } 217 if (pVM->hwaccm.s.svm.pMemObjVMCBHost != NIL_RTR0MEMOBJ) 212 218 { 213 219 RTR0MemObjFree(pVM->hwaccm.s.svm.pMemObjVMCBHost, false); 214 220 pVM->hwaccm.s.svm.pVMCBHost = 0; 215 221 pVM->hwaccm.s.svm.pVMCBHostPhys = 0; 216 pVM->hwaccm.s.svm.pMemObjVMCBHost = 0;217 } 218 if (pVM->hwaccm.s.svm.pMemObjIOBitmap )222 pVM->hwaccm.s.svm.pMemObjVMCBHost = NIL_RTR0MEMOBJ; 223 } 224 if (pVM->hwaccm.s.svm.pMemObjIOBitmap != NIL_RTR0MEMOBJ) 219 225 { 220 226 RTR0MemObjFree(pVM->hwaccm.s.svm.pMemObjIOBitmap, false); 221 227 pVM->hwaccm.s.svm.pIOBitmap = 0; 222 228 pVM->hwaccm.s.svm.pIOBitmapPhys = 0; 223 pVM->hwaccm.s.svm.pMemObjIOBitmap = 0;224 } 225 if (pVM->hwaccm.s.svm.pMemObjMSRBitmap )229 pVM->hwaccm.s.svm.pMemObjIOBitmap = NIL_RTR0MEMOBJ; 230 } 231 if (pVM->hwaccm.s.svm.pMemObjMSRBitmap != NIL_RTR0MEMOBJ) 226 232 { 227 233 RTR0MemObjFree(pVM->hwaccm.s.svm.pMemObjMSRBitmap, false); 228 234 pVM->hwaccm.s.svm.pMSRBitmap = 0; 229 235 pVM->hwaccm.s.svm.pMSRBitmapPhys = 0; 230 pVM->hwaccm.s.svm.pMemObjMSRBitmap = 0;236 pVM->hwaccm.s.svm.pMemObjMSRBitmap = NIL_RTR0MEMOBJ; 231 237 } 232 238 return VINF_SUCCESS; … … 320 326 pVMCB->ctrl.IntCtrl.n.u1VIrqMasking = 1; 321 327 /* Ignore the priority in the TPR; just deliver it when we tell it to. */ 322 pVMCB->ctrl.IntCtrl.n.u1IgnoreTPR = 1; 328 pVMCB->ctrl.IntCtrl.n.u1IgnoreTPR = 1; 323 329 324 330 /* Set IO and MSR bitmap addresses. */ … … 883 889 Log(("Force TLB flush due to changed TLB flush count (%x vs %x)\n", pVM->hwaccm.s.svm.cTLBFlushes, pCpu->cTLBFlushes)); 884 890 } 885 if (pCpu->fFlushTLB) 891 if (pCpu->fFlushTLB) 886 892 Log(("Force TLB flush: first time cpu %d is used -> flush\n", pCpu->idCpu)); 887 893 #endif -
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r10566 r10572 139 139 SUPR0Printf("VMXR0InitVM %x\n", pVM); 140 140 #endif 141 pVM->hwaccm.s.vmx.pMemObjVMCS = NIL_RTR0MEMOBJ; 142 pVM->hwaccm.s.vmx.pMemObjAPIC = NIL_RTR0MEMOBJ; 143 pVM->hwaccm.s.vmx.pMemObjRealModeTSS = NIL_RTR0MEMOBJ; 144 141 145 142 146 /* Allocate one page for the VM control structure (VMCS). */ … … 199 203 HWACCMR0DECL(int) VMXR0TermVM(PVM pVM) 200 204 { 201 if (pVM->hwaccm.s.vmx.pMemObjVMCS )205 if (pVM->hwaccm.s.vmx.pMemObjVMCS != NIL_RTR0MEMOBJ) 202 206 { 203 207 RTR0MemObjFree(pVM->hwaccm.s.vmx.pMemObjVMCS, false); 204 pVM->hwaccm.s.vmx.pMemObjVMCS = 0;208 pVM->hwaccm.s.vmx.pMemObjVMCS = NIL_RTR0MEMOBJ; 205 209 pVM->hwaccm.s.vmx.pVMCS = 0; 206 210 pVM->hwaccm.s.vmx.pVMCSPhys = 0; 207 211 } 208 if (pVM->hwaccm.s.vmx.pMemObjRealModeTSS )212 if (pVM->hwaccm.s.vmx.pMemObjRealModeTSS != NIL_RTR0MEMOBJ) 209 213 { 210 214 RTR0MemObjFree(pVM->hwaccm.s.vmx.pMemObjRealModeTSS, false); 211 pVM->hwaccm.s.vmx.pMemObjRealModeTSS = 0;215 pVM->hwaccm.s.vmx.pMemObjRealModeTSS = NIL_RTR0MEMOBJ; 212 216 pVM->hwaccm.s.vmx.pRealModeTSS = 0; 213 217 pVM->hwaccm.s.vmx.pRealModeTSSPhys = 0; 214 218 } 215 if (pVM->hwaccm.s.vmx.pMemObjAPIC )219 if (pVM->hwaccm.s.vmx.pMemObjAPIC != NIL_RTR0MEMOBJ) 216 220 { 217 221 RTR0MemObjFree(pVM->hwaccm.s.vmx.pMemObjAPIC, false); 218 pVM->hwaccm.s.vmx.pMemObjAPIC = 0;222 pVM->hwaccm.s.vmx.pMemObjAPIC = NIL_RTR0MEMOBJ; 219 223 pVM->hwaccm.s.vmx.pAPIC = 0; 220 224 pVM->hwaccm.s.vmx.pAPICPhys = 0; … … 2068 2072 case VMX_EXIT_PORT_IO: /* 30 I/O instruction. */ 2069 2073 /* already handled above */ 2070 AssertMsg( rc == VINF_PGM_CHANGE_MODE 2071 || rc == VINF_EM_RAW_INTERRUPT 2072 || rc == VERR_EM_INTERPRETER 2073 || rc == VINF_EM_RAW_EMULATE_INSTR 2074 || rc == VINF_PGM_SYNC_CR3 2075 || rc == VINF_IOM_HC_IOPORT_READ 2074 AssertMsg( rc == VINF_PGM_CHANGE_MODE 2075 || rc == VINF_EM_RAW_INTERRUPT 2076 || rc == VERR_EM_INTERPRETER 2077 || rc == VINF_EM_RAW_EMULATE_INSTR 2078 || rc == VINF_PGM_SYNC_CR3 2079 || rc == VINF_IOM_HC_IOPORT_READ 2076 2080 || rc == VINF_IOM_HC_IOPORT_WRITE 2077 || rc == VINF_EM_RAW_GUEST_TRAP 2078 || rc == VINF_TRPM_XCPT_DISPATCHED 2079 || rc == VINF_EM_RESCHEDULE_REM, 2081 || rc == VINF_EM_RAW_GUEST_TRAP 2082 || rc == VINF_TRPM_XCPT_DISPATCHED 2083 || rc == VINF_EM_RESCHEDULE_REM, 2080 2084 ("rc = %d\n", rc)); 2081 2085 break; 2082 2086 2083 case VMX_EXIT_TPR: /* 43 TPR below threshold. Guest software executed MOV to CR8. */ 2087 case VMX_EXIT_TPR: /* 43 TPR below threshold. Guest software executed MOV to CR8. */ 2084 2088 case VMX_EXIT_RDMSR: /* 31 RDMSR. Guest software attempted to execute RDMSR. */ 2085 2089 case VMX_EXIT_WRMSR: /* 32 WRMSR. Guest software attempted to execute WRMSR. */
Note:
See TracChangeset
for help on using the changeset viewer.