VirtualBox

Changeset 45823 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Apr 29, 2013 3:55:06 PM (12 years ago)
Author:
vboxsync
Message:

VMM/HMVMXR0: Resetup preemption timer when the preemption timer expires unconditionally, and other HM bits.

File:
1 edited

Legend:

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

    r45820 r45823  
    18401840
    18411841    /* Set VMCS link pointer. Reserved for future use, must be -1. Intel spec. 24.4 "Guest-State Area". */
    1842     rc |= VMXWriteVmcs64(VMX_VMCS64_GUEST_VMCS_LINK_PTR_FULL, 0xffffffffffffffffULL);
     1842    rc |= VMXWriteVmcs64(VMX_VMCS64_GUEST_VMCS_LINK_PTR_FULL, UINT64_C(0xffffffffffffffff));
    18431843
    18441844    /* Setup debug controls */
     
    28662866            /* Validate. See Intel spec. 28.2.2 "EPT Translation Mechanism" and 24.6.11 "Extended-Page-Table Pointer (EPTP)" */
    28672867            Assert(pVCpu->hm.s.vmx.HCPhysEPTP);
    2868             Assert(!(pVCpu->hm.s.vmx.HCPhysEPTP & 0xfff0000000000000ULL));
     2868            Assert(!(pVCpu->hm.s.vmx.HCPhysEPTP & UINT64_C(0xfff0000000000000)));
    28692869            Assert(!(pVCpu->hm.s.vmx.HCPhysEPTP & 0xfff));
    28702870
    28712871            /* VMX_EPT_MEMTYPE_WB support is already checked in hmR0VmxSetupTaggedTlb(). */
    2872             pVCpu->hm.s.vmx.HCPhysEPTP |=  VMX_EPT_MEMTYPE_WB
    2873                                          | (VMX_EPT_PAGE_WALK_LENGTH_DEFAULT << VMX_EPT_PAGE_WALK_LENGTH_SHIFT);
     2872            pVCpu->hm.s.vmx.HCPhysEPTP |=   VMX_EPT_MEMTYPE_WB
     2873                                          | (VMX_EPT_PAGE_WALK_LENGTH_DEFAULT << VMX_EPT_PAGE_WALK_LENGTH_SHIFT);
    28742874
    28752875            /* Validate. See Intel spec. 26.2.1 "Checks on VMX Controls" */
     
    30513051    if (pVCpu->hm.s.vmx.u32EntryCtls & VMX_VMCS_CTRL_ENTRY_CONTROLS_LOAD_DEBUG)
    30523052    {
    3053         Assert((pMixedCtx->dr[7] & 0xffffffff00000000ULL) == 0);  /* upper 32 bits are reserved (MBZ). */
     3053        Assert(!(pMixedCtx->dr[7] >> 32));                        /* upper 32 bits are reserved (MBZ). */
    30543054        /* Validate. Intel spec. 17.2 "Debug Registers", recompiler paranoia checks. */
    30553055        Assert((pMixedCtx->dr[7] & 0xd800) == 0);                 /* bits 15, 14, 12, 11 are reserved (MBZ). */
     
    34953495        AssertRCReturn(rc, rc);
    34963496
    3497         Assert(!(pMixedCtx->gdtr.cbGdt & 0xffff0000ULL));       /* Bits 31:16 MBZ. */
     3497        Assert(!(pMixedCtx->gdtr.cbGdt & UINT64_C(0xffff0000)));       /* Bits 31:16 MBZ. */
    34983498        Log(("Load: VMX_VMCS_GUEST_GDTR_BASE=%#RX64\n", pMixedCtx->gdtr.pGdt));
    34993499        pVCpu->hm.s.fContextUseFlags &= ~HM_CHANGED_GUEST_GDTR;
     
    35463546        AssertRCReturn(rc, rc);
    35473547
    3548         Assert(!(pMixedCtx->idtr.cbIdt & 0xffff0000ULL));       /* Bits 31:16 MBZ. */
     3548        Assert(!(pMixedCtx->idtr.cbIdt & UINT64_C(0xffff0000)));       /* Bits 31:16 MBZ. */
    35493549        Log(("Load: VMX_VMCS_GUEST_IDTR_BASE=%#RX64\n", pMixedCtx->idtr.pIdt));
    35503550        pVCpu->hm.s.fContextUseFlags &= ~HM_CHANGED_GUEST_IDTR;
     
    51795179    if (!(pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_SEGMENT_REGS))
    51805180    {
    5181         rc = hmR0VmxSaveGuestCR0(pVCpu, pMixedCtx);
     5181        rc  = hmR0VmxSaveGuestCR0(pVCpu, pMixedCtx);
    51825182        rc |= VMXLOCAL_READ_SEG(CS, cs);
    51835183        rc |= VMXLOCAL_READ_SEG(SS, ss);
     
    56365636    STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitXcptNmi, y3);
    56375637    STAM_COUNTER_INC(&pVCpu->hm.s.StatSwitchLongJmpToR3);
     5638    VMCPU_CMPXCHG_STATE(pVCpu, VMCPUSTATE_STARTED_HM, VMCPUSTATE_STARTED_EXEC);
    56385639}
    56395640
     
    60156016        || uVector == X86_XCPT_OF)
    60166017    {
    6017         u32IntrInfo         |= (VMX_EXIT_INTERRUPTION_INFO_TYPE_SW_XCPT << VMX_EXIT_INTERRUPTION_INFO_TYPE_SHIFT);
     6018        u32IntrInfo |= (VMX_EXIT_INTERRUPTION_INFO_TYPE_SW_XCPT << VMX_EXIT_INTERRUPTION_INFO_TYPE_SHIFT);
    60186019    }
    60196020    else
    6020         u32IntrInfo         |= (VMX_EXIT_INTERRUPTION_INFO_TYPE_SW_INT << VMX_EXIT_INTERRUPTION_INFO_TYPE_SHIFT);
     6021        u32IntrInfo |= (VMX_EXIT_INTERRUPTION_INFO_TYPE_SW_INT << VMX_EXIT_INTERRUPTION_INFO_TYPE_SHIFT);
    60216022    STAM_COUNTER_INC(&pVCpu->hm.s.StatIntInject);
    60226023    hmR0VmxSetPendingEvent(pVCpu, u32IntrInfo, cbInstr, 0 /* u32ErrCode */, 0 /* GCPtrFaultAddress */);
     
    64726473        return VINF_EM_RAW_INTERRUPT;
    64736474    }
     6475    VMCPU_ASSERT_STATE(pVCpu, VMCPUSTATE_STARTED_HM);
    64746476    VMCPU_SET_STATE(pVCpu, VMCPUSTATE_STARTED_EXEC);
    64756477#endif
     
    74177419    VMX_VALIDATE_EXIT_HANDLER_PARAMS();
    74187420
    7419     /* If we're saving the preemption-timer value on every VM-exit & we've reached zero, reset it up on next VM-entry. */
    7420     if (pVCpu->hm.s.vmx.u32ExitCtls & VMX_VMCS_CTRL_EXIT_CONTROLS_SAVE_VMX_PREEMPT_TIMER)
    7421         pVmxTransient->fUpdateTscOffsettingAndPreemptTimer = true;
     7421    /* If the preemption-timer has expired, reinitialize the preemption timer on next VM-entry. */
     7422    pVmxTransient->fUpdateTscOffsettingAndPreemptTimer = true;
    74227423
    74237424    /* If there are any timer events pending, fall back to ring-3, otherwise resume guest execution. */
     
    83698370        /* Successfully synced our shadow page tables or emulation MMIO instruction. */
    83708371        STAM_COUNTER_INC(&pVCpu->hm.s.StatExitReasonNpf);
    8371         pVCpu->hm.s.fContextUseFlags |=  HM_CHANGED_GUEST_RIP | HM_CHANGED_GUEST_RSP | HM_CHANGED_GUEST_RFLAGS
    8372                                        | HM_CHANGED_VMX_GUEST_APIC_STATE;
     8372        pVCpu->hm.s.fContextUseFlags |=   HM_CHANGED_GUEST_RIP | HM_CHANGED_GUEST_RSP | HM_CHANGED_GUEST_RFLAGS
     8373                                        | HM_CHANGED_VMX_GUEST_APIC_STATE;
    83738374        return VINF_SUCCESS;
    83748375    }
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