- Timestamp:
- Jun 12, 2013 5:05:48 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r46512 r46514 1452 1452 || ( pMixedCtx->reg.Attr.n.u1Granularity \ 1453 1453 ? (pMixedCtx->reg.u32Limit & 0xfff) == 0xfff \ 1454 : pMixedCtx->reg.u32Limit <= 0xfffff), \1454 : pMixedCtx->reg.u32Limit <= UINT32_C(0xfffff)), \ 1455 1455 ("Invalid Segment Attributes %#x %#x %#llx\n", pMixedCtx->reg.u32Limit, 1456 1456 pMixedCtx->reg.Attr.u, pMixedCtx->reg.u64Base)) 1457 1458 HMSVM_ASSERT_SEG_GRANULARITY(cs); 1457 1459 HMSVM_ASSERT_SEG_GRANULARITY(ss); 1458 HMSVM_ASSERT_SEG_GRANULARITY(cs);1459 1460 HMSVM_ASSERT_SEG_GRANULARITY(ds); 1460 1461 HMSVM_ASSERT_SEG_GRANULARITY(es); 1461 1462 HMSVM_ASSERT_SEG_GRANULARITY(fs); 1462 1463 HMSVM_ASSERT_SEG_GRANULARITY(gs); 1464 1463 1465 # undef HMSVM_ASSERT_SEL_GRANULARITY 1464 1466 #endif 1465 1467 1466 1468 /* 1467 * Correct the hidden SS DPL field. It can be wrong on certain CPUs sometimes (seen on 1468 * AMD Fusion CPUs with 64-bit guests). The CPU always uses the CPL field in the VMCB 1469 * instead of the DPL in the hidden SS. See AMD spec. 15.5.1 "Basic operation". 1469 * Sync the hidden SS DPL field. AMD CPUs have a separate CPL field in the VMCB and uses that 1470 * and thus it's possible that when the CPL changes during guest execution that the SS DPL 1471 * isn't updated by AMD-V. Observed on some AMD Fusion CPUs with 64-bit guests. 1472 * See AMD spec. 15.5.1 "Basic operation". 1470 1473 */ 1471 /** @todo Verify this. */1472 1474 Assert(!(pVmcb->guest.u8CPL & ~0x3)); 1473 1475 pMixedCtx->ss.Attr.n.u2Dpl = pVmcb->guest.u8CPL & 0x3; … … 2385 2387 2386 2388 PSVMVMCB pVmcb = (PSVMVMCB)pVCpu->hm.s.svm.pvVmcb; 2387 pVmcb->ctrl.u64VmcbCleanBits = HMSVM_VMCB_CLEAN_ALL; 2389 pVmcb->ctrl.u64VmcbCleanBits = HMSVM_VMCB_CLEAN_ALL; /* Mark the VMCB-state cache as unmodified by VMM. */ 2388 2390 2389 2391 /* Restore host's TSC_AUX if required. */ … … 2395 2397 /** @todo Find a way to fix hardcoding a guestimate. */ 2396 2398 TMCpuTickSetLastSeen(pVCpu, ASMReadTSC() + 2397 pVmcb->ctrl.u64TSCOffset - 0x400 /* guestimate of world switch overhead in clock ticks */);2399 pVmcb->ctrl.u64TSCOffset - 0x400); 2398 2400 } 2399 2401 … … 2405 2407 2406 2408 ASMSetFlags(pSvmTransient->uEFlags); /* Enable interrupts. */ 2409 2407 2410 VMMRZCallRing3SetNotification(pVCpu, hmR0SvmCallRing3Callback, pMixedCtx); 2408 2411 VMMRZCallRing3Enable(pVCpu); /* It is now safe to do longjmps to ring-3!!! */
Note:
See TracChangeset
for help on using the changeset viewer.