VirtualBox

Changeset 52411 in vbox


Ignore:
Timestamp:
Aug 19, 2014 11:00:46 AM (10 years ago)
Author:
vboxsync
Message:

VMM/HMVMXR0: Use unordered atomics for VMMRZCallRing3[Enable|Disable]() and some VT-x nits.

Location:
trunk/src/VBox/VMM
Files:
2 edited

Legend:

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

    r52281 r52411  
    23512351    AssertRCReturn(rc, rc);
    23522352
    2353     /* Update VCPU with the currently set pin-based VM-execution controls. */
    23542353    pVCpu->hm.s.vmx.u32PinCtls = val;
    23552354    return rc;
     
    24752474    AssertRCReturn(rc, rc);
    24762475
    2477     /* Update VCPU with the currently set processor-based VM-execution controls. */
    24782476    pVCpu->hm.s.vmx.u32ProcCtls = val;
    24792477
     
    25342532        AssertRCReturn(rc, rc);
    25352533
    2536         /* Update VCPU with the currently set secondary processor-based VM-execution controls. */
    25372534        pVCpu->hm.s.vmx.u32ProcCtls2 = val;
    25382535    }
     
    27192716    /*
    27202717     * Without UnrestrictedGuest, pRealModeTSS and pNonPagingModeEPTPageTable *must* always be allocated.
    2721      * We no longer support the highly unlikely case of UnrestrictedGuest without pRealModeTSS. See hmR3InitFinalizeR0().
     2718     * We no longer support the highly unlikely case of UnrestrictedGuest without pRealModeTSS. See hmR3InitFinalizeR0Intel().
    27222719     */
    2723     /* -XXX- change hmR3InitFinalizeR0Intel() to fail if pRealModeTSS alloc fails. */
    27242720    if (   !pVM->hm.s.vmx.fUnrestrictedGuest
    27252721        &&  (   !pVM->hm.s.vmx.pNonPagingModeEPTPageTable
     
    33363332        AssertRCReturn(rc, rc);
    33373333
    3338         /* Update VCPU with the currently set VM-exit controls. */
    33393334        pVCpu->hm.s.vmx.u32EntryCtls = val;
    33403335        HMCPU_CF_CLEAR(pVCpu, HM_CHANGED_VMX_ENTRY_CTLS);
     
    34233418        AssertRCReturn(rc, rc);
    34243419
    3425         /* Update VCPU with the currently set VM-exit controls. */
    34263420        pVCpu->hm.s.vmx.u32ExitCtls = val;
    34273421        HMCPU_CF_CLEAR(pVCpu, HM_CHANGED_VMX_EXIT_CTLS);
     
    79857979    Log4Func(("vcpu[%d]\n", pVCpu->idCpu));
    79867980
    7987     /* Clear interrupt-window exiting control. */
    79887981    if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_INT_WINDOW_EXIT)
    79897982    {
     
    79927985    }
    79937986
    7994     /* Clear NMI-window exiting control. */
    79957987    if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_NMI_WINDOW_EXIT)
    79967988    {
     
    80098001#endif
    80108002
    8011     /* Clear the entry-interruption field (including the valid bit). */
    80128003    rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_ENTRY_INTERRUPTION_INFO, 0);
    80138004    AssertRC(rc);
    80148005
    8015     /* Clear the pending debug exception field. */
    80168006    rc = VMXWriteVmcs32(VMX_VMCS_GUEST_PENDING_DEBUG_EXCEPTIONS, 0);
    80178007    AssertRC(rc);
     
    82338223    HMVMX_ASSERT_PREEMPT_SAFE();
    82348224
    8235 #ifdef LOG_ENABLED
    8236     /** @todo r=ramshankar: I'm not able to use VMMRZCallRing3Disable() here,
    8237      *        probably not initialized yet? Anyway this will do for now.
    8238      *
    8239      *  Update: Should be possible once VMXR0LoadGuestState() is removed as an
    8240      *  interface and disable ring-3 calls when thread-context hooks are not
    8241      *  available. */
    8242     bool fCallerDisabledLogFlush = VMMR0IsLogFlushDisabled(pVCpu);
    8243     VMMR0LogFlushDisable(pVCpu);
    8244 #endif
     8225    VMMRZCallRing3Disable(pVCpu);
     8226    Assert(VMMR0IsLogFlushDisabled(pVCpu));
    82458227
    82468228    LogFlowFunc(("pVM=%p pVCpu=%p\n", pVM, pVCpu));
     
    83008282    HMCPU_CF_CLEAR(pVCpu, HM_CHANGED_GUEST_CR2);
    83018283
    8302 #ifdef LOG_ENABLED
    8303     /* Only reenable log-flushing if the caller has it enabled. */
    8304     if (!fCallerDisabledLogFlush)
    8305         VMMR0LogFlushEnable(pVCpu);
    8306 #endif
     8284    VMMRZCallRing3Enable(pVCpu);
    83078285
    83088286    STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatLoadGuestState, x);
  • trunk/src/VBox/VMM/VMMRZ/VMMRZ.cpp

    r51720 r52411  
    134134
    135135    Assert(pVCpu->vmm.s.cCallRing3Disabled < 16);
    136     if (ASMAtomicIncU32(&pVCpu->vmm.s.cCallRing3Disabled) == 1) /** @todo replace with unordered variant (ASMAtomicUoIncU32). */
    137     {                                                           /** @todo See @bugref{6208} comment #36 for impl. diff. */
     136    if (ASMAtomicUoIncU32(&pVCpu->vmm.s.cCallRing3Disabled) == 1)
     137    {
    138138        /** @todo it might make more sense to just disable logging here, then we
    139139         * won't flush away important bits... but that goes both ways really. */
     
    155155
    156156/**
    157  * Counters VMMRZCallRing3Disable and re-enables host calls.
     157 * Counters VMMRZCallRing3Disable() and re-enables host calls.
    158158 *
    159159 * @param   pVCpu               The CPU struct for the calling EMT.
     
    168168
    169169    Assert(pVCpu->vmm.s.cCallRing3Disabled > 0);
    170     if (ASMAtomicDecU32(&pVCpu->vmm.s.cCallRing3Disabled) == 0) /** @todo replace with unordered variant (ASMAtomicUoDecU32). */
     170    if (ASMAtomicUoDecU32(&pVCpu->vmm.s.cCallRing3Disabled) == 0)
    171171    {
    172172#ifdef IN_RC
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