VirtualBox

Changeset 46514 in vbox for trunk/src


Ignore:
Timestamp:
Jun 12, 2013 5:05:48 PM (12 years ago)
Author:
vboxsync
Message:

VMM/HMSVMR0: AMD-V bits.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp

    r46512 r46514  
    14521452              || (   pMixedCtx->reg.Attr.n.u1Granularity \
    14531453                  ? (pMixedCtx->reg.u32Limit & 0xfff) == 0xfff \
    1454                   :  pMixedCtx->reg.u32Limit <= 0xfffff), \
     1454                  :  pMixedCtx->reg.u32Limit <= UINT32_C(0xfffff)), \
    14551455              ("Invalid Segment Attributes %#x %#x %#llx\n", pMixedCtx->reg.u32Limit,
    14561456              pMixedCtx->reg.Attr.u, pMixedCtx->reg.u64Base))
     1457
     1458    HMSVM_ASSERT_SEG_GRANULARITY(cs);
    14571459    HMSVM_ASSERT_SEG_GRANULARITY(ss);
    1458     HMSVM_ASSERT_SEG_GRANULARITY(cs);
    14591460    HMSVM_ASSERT_SEG_GRANULARITY(ds);
    14601461    HMSVM_ASSERT_SEG_GRANULARITY(es);
    14611462    HMSVM_ASSERT_SEG_GRANULARITY(fs);
    14621463    HMSVM_ASSERT_SEG_GRANULARITY(gs);
     1464
    14631465# undef HMSVM_ASSERT_SEL_GRANULARITY
    14641466#endif
    14651467
    14661468    /*
    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".
    14701473     */
    1471     /** @todo Verify this. */
    14721474    Assert(!(pVmcb->guest.u8CPL & ~0x3));
    14731475    pMixedCtx->ss.Attr.n.u2Dpl = pVmcb->guest.u8CPL & 0x3;
     
    23852387
    23862388    PSVMVMCB pVmcb = (PSVMVMCB)pVCpu->hm.s.svm.pvVmcb;
    2387     pVmcb->ctrl.u64VmcbCleanBits = HMSVM_VMCB_CLEAN_ALL;             /* Mark the VMCB-state cache as unmodified by VMM. */
     2389    pVmcb->ctrl.u64VmcbCleanBits = HMSVM_VMCB_CLEAN_ALL;        /* Mark the VMCB-state cache as unmodified by VMM. */
    23882390
    23892391    /* Restore host's TSC_AUX if required. */
     
    23952397        /** @todo Find a way to fix hardcoding a guestimate.  */
    23962398        TMCpuTickSetLastSeen(pVCpu, ASMReadTSC() +
    2397                              pVmcb->ctrl.u64TSCOffset - 0x400 /* guestimate of world switch overhead in clock ticks */);
     2399                             pVmcb->ctrl.u64TSCOffset - 0x400);
    23982400    }
    23992401
     
    24052407
    24062408    ASMSetFlags(pSvmTransient->uEFlags);                        /* Enable interrupts. */
     2409
    24072410    VMMRZCallRing3SetNotification(pVCpu, hmR0SvmCallRing3Callback, pMixedCtx);
    24082411    VMMRZCallRing3Enable(pVCpu);                                /* It is now safe to do longjmps to ring-3!!! */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette