VirtualBox

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


Ignore:
Timestamp:
May 2, 2013 9:30:28 PM (12 years ago)
Author:
vboxsync
Message:

VMM/HMVMXR0: More aggressive state sync.: don't save IDTR, LDTR, GDTR, TR unless needed.

File:
1 edited

Legend:

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

    r45872 r45884  
    52105210    }
    52115211
     5212    return rc;
     5213}
     5214
     5215
     5216/**
     5217 * Saves the guest descriptor table registers and task register from the current
     5218 * VMCS into the guest-CPU context.
     5219 *
     5220 * @returns VBox status code.
     5221 * @param   pVCpu       Pointer to the VMCPU.
     5222 * @param   pMixedCtx   Pointer to the guest-CPU context. The data maybe
     5223 *                      out-of-sync. Make sure to update the required fields
     5224 *                      before using them.
     5225 *
     5226 * @remarks No-long-jump zone!!!
     5227 */
     5228static int hmR0VmxSaveGuestTableRegs(PVMCPU pVCpu, PCPUMCTX pMixedCtx)
     5229{
     5230    int rc = VINF_SUCCESS;
     5231
    52125232    /* Guest LDTR. */
    52135233    if (!(pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_LDTR))
     
    53315351    rc = hmR0VmxSaveGuestSegmentRegs(pVCpu, pMixedCtx);
    53325352    AssertLogRelMsgRCReturn(rc, ("hmR0VmxSaveGuestSegmentRegs failed! rc=%Rrc (pVCpu=%p)\n", rc, pVCpu), rc);
     5353
     5354    rc = hmR0VmxSaveGuestTableRegs(pVCpu, pMixedCtx);
     5355    AssertLogRelMsgRCReturn(rc, ("hmR0VmxSaveGuestTableRegs failed! rc=%Rrc (pVCpu=%p)\n", rc, pVCpu), rc);
    53335356
    53345357    rc = hmR0VmxSaveGuestDebugRegs(pVCpu, pMixedCtx);
     
    61186141            Assert(pVM->hm.s.vmx.pRealModeTSS);
    61196142
    6120             /* Save the required guest state bits from the VMCS. */
     6143            /* We require RIP, RSP, RFLAGS, CS, IDTR. Save the required ones from the VMCS. */
    61216144            rc  = hmR0VmxSaveGuestSegmentRegs(pVCpu, pMixedCtx);
     6145            rc |= hmR0VmxSaveGuestTableRegs(pVCpu, pMixedCtx);
    61226146            rc |= hmR0VmxSaveGuestRipRspRflags(pVCpu, pMixedCtx);
    61236147            AssertRCReturn(rc, rc);
     6148            Assert(pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_RIP);
    61246149
    61256150            /* Check if the interrupt handler is present in the IVT (real-mode IDT). IDT limit is (4N - 1). */
     
    84578482
    84588483    int rc = hmR0VmxReadExitQualificationVmcs(pVCpu, pVmxTransient);
    8459     rc    |= hmR0VmxSaveGuestSegmentRegs(pVCpu, pMixedCtx);
    8460     rc    |= hmR0VmxSaveGuestRflags(pVCpu, pMixedCtx);
    84618484    AssertRCReturn(rc, rc);
    84628485
     
    85148537
    85158538    /* We require CR0 and EFER. EFER is always up-to-date. */
    8516     int rc = hmR0VmxSaveGuestControlRegs(pVCpu, pMixedCtx);
     8539    int rc = hmR0VmxSaveGuestCR0(pVCpu, pMixedCtx);
    85178540    AssertRCReturn(rc, rc);
    85188541
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