Changeset 46310 in vbox for trunk/src/VBox/VMM
- Timestamp:
- May 29, 2013 12:52:37 PM (12 years ago)
- Location:
- trunk/src/VBox/VMM/VMMR0
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r46304 r46310 20 20 *******************************************************************************/ 21 21 22 #ifdef DEBUG_ramshankar 23 # define HMSVM_ALWAYS_TRAP_ALL_XCPTS 24 # define HMSVM_ALWAYS_TRAP_PF 25 #endif 22 26 23 27 /******************************************************************************* … … 211 215 VMMR0DECL(int) SVMR0InitVM(PVM pVM) 212 216 { 213 int rc ;217 int rc = VERR_INTERNAL_ERROR_5; 214 218 215 219 /* Check for an AMD CPU erratum which requires us to flush the TLB before every world-switch. */ … … 241 245 242 246 pVCpu->hm.s.svm.pvVmcbHost = RTR0MemObjAddress(pVCpu->hm.s.svm.hMemObjVmcbHost); 243 pVCpu->hm.s.svm.HCPhysVmcbHost = RTR0MemObjGetPagePhysAddr(pVCpu->hm.s.svm.hMemObjVmcbHost, 0 );247 pVCpu->hm.s.svm.HCPhysVmcbHost = RTR0MemObjGetPagePhysAddr(pVCpu->hm.s.svm.hMemObjVmcbHost, 0 /* iPage */); 244 248 Assert(pVCpu->hm.s.svm.HCPhysVmcbHost < _4G); 245 249 ASMMemZeroPage(pVCpu->hm.s.svm.pvVmcbHost); … … 251 255 252 256 pVCpu->hm.s.svm.pvVmcb = RTR0MemObjAddress(pVCpu->hm.s.svm.hMemObjVmcb); 253 pVCpu->hm.s.svm.HCPhysVmcb = RTR0MemObjGetPagePhysAddr(pVCpu->hm.s.svm.hMemObjVmcb, 0 );257 pVCpu->hm.s.svm.HCPhysVmcb = RTR0MemObjGetPagePhysAddr(pVCpu->hm.s.svm.hMemObjVmcb, 0 /* iPage */); 254 258 Assert(pVCpu->hm.s.svm.HCPhysVmcb < _4G); 255 259 ASMMemZeroPage(pVCpu->hm.s.svm.pvVmcb); … … 261 265 262 266 pVCpu->hm.s.svm.pvMsrBitmap = RTR0MemObjAddress(pVCpu->hm.s.svm.hMemObjMsrBitmap); 263 pVCpu->hm.s.svm.HCPhysMsrBitmap = RTR0MemObjGetPagePhysAddr(pVCpu->hm.s.svm.hMemObjMsrBitmap, 0 );267 pVCpu->hm.s.svm.HCPhysMsrBitmap = RTR0MemObjGetPagePhysAddr(pVCpu->hm.s.svm.hMemObjMsrBitmap, 0 /* iPage */); 264 268 /* Set all bits to intercept all MSR accesses. */ 265 269 ASMMemFill32(pVCpu->hm.s.svm.pvMsrBitmap, 2 << PAGE_SHIFT, 0xffffffff); … … 287 291 288 292 289 293 /** 294 * Sets up AMD-V for the specified VM. 295 * This function is only called once per-VM during initalization. 296 * 297 * @returns VBox status code. 298 * @param pVM Pointer to the VM. 299 */ 300 VMMR0DECL(int) SVMR0SetupVM(PVM pVM) 301 { 302 int rc = VINF_SUCCESS; 303 304 AssertReturn(pVM, VERR_INVALID_PARAMETER); 305 Assert(pVM->hm.s.svm.fSupported); 306 307 for (uint32_t i = 0; i < pVM->cCpus; i++) 308 { 309 PVMCPU pVCpu = &pVM->aCpus[i]; 310 PSVMVMCB pVmcb = (PSVMVMCB)pVM->aCpus[i].hm.s.svm.pvVmcb; 311 312 AssertMsgReturn(pVmcb, ("Invalid pVmcb\n"), VERR_SVM_INVALID_PVMCB); 313 314 /* Intercept traps. */ 315 #ifdef HMSVM_ALWAYS_TRAP_PF 316 pVmcb->ctrl.u32InterceptException |= RT_BIT(X86_XCPT_PF); 317 #endif 318 #ifdef HMSVM_ALWAYS_TRAP_ALL_XCPTS 319 pVmcb->ctrl.u32InterceptException |= RT_BIT(X86_XCPT_BP) 320 | RT_BIT(X86_XCPT_DB) 321 | RT_BIT(X86_XCPT_DE) 322 | RT_BIT(X86_XCPT_UD) 323 | RT_BIT(X86_XCPT_NP) 324 | RT_BIT(X86_XCPT_SS) 325 | RT_BIT(X86_XCPT_GP) 326 | RT_BIT(X86_XCPT_MF) 327 | RT_BIT(X86_XCPT_PF); 328 #endif 329 330 /* -XXX- todo. */ 331 } 332 333 return rc; 334 } 335 -
trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp
r46304 r46310 1584 1584 Log(("ctrl.IntCtrl.u3Reserved %x\n", pVmcb->ctrl.IntCtrl.n.u3Reserved)); 1585 1585 Log(("ctrl.IntCtrl.u1VIrqMasking %x\n", pVmcb->ctrl.IntCtrl.n.u1VIrqMasking)); 1586 Log(("ctrl.IntCtrl.u 7Reserved2 %x\n", pVmcb->ctrl.IntCtrl.n.u7Reserved2));1586 Log(("ctrl.IntCtrl.u6Reserved %x\n", pVmcb->ctrl.IntCtrl.n.u6Reserved)); 1587 1587 Log(("ctrl.IntCtrl.u8VIrqVector %x\n", pVmcb->ctrl.IntCtrl.n.u8VIrqVector)); 1588 1588 Log(("ctrl.IntCtrl.u24Reserved %x\n", pVmcb->ctrl.IntCtrl.n.u24Reserved));
Note:
See TracChangeset
for help on using the changeset viewer.