VirtualBox

Changeset 46681 in vbox


Ignore:
Timestamp:
Jun 19, 2013 5:01:34 PM (11 years ago)
Author:
vboxsync
Message:

VMM/HMSVMR0: AMD-V bits.

File:
1 edited

Legend:

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

    r46678 r46681  
    727727
    728728/**
     729 * Invalidates a guest page by guest virtual address.
     730 *
     731 * @returns VBox status code.
     732 * @param   pVM         Pointer to the VM.
     733 * @param   pVCpu       Pointer to the VMCPU.
     734 * @param   GCVirt      Guest virtual address of the page to invalidate.
     735 */
     736VMMR0DECL(int) SVMR0InvalidatePage(PVM pVM, PVMCPU pVCpu, RTGCPTR GCVirt)
     737{
     738    bool fFlushPending = pVM->hm.s.svm.fAlwaysFlushTLB | VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_TLB_FLUSH);
     739
     740    /* Skip it if a TLB flush is already pending. */
     741    if (!fFlushPending)
     742    {
     743        Log4(("SVMR0InvalidatePage %RGv\n", GCVirt));
     744        AssertReturn(pVM, VERR_INVALID_PARAMETER);
     745        Assert(pVM->hm.s.svm.fSupported);
     746
     747        PSVMVMCB pVmcb = (PSVMVMCB)pVCpu->hm.s.svm.pvVmcb;
     748        AssertMsgReturn(pVmcb, ("Invalid pVmcb!\n"), VERR_SVM_INVALID_PVMCB);
     749
     750#if HC_ARCH_BITS == 32
     751        /* If we get a flush in 64-bit guest mode, then force a full TLB flush. INVLPGA takes only 32-bit addresses. */
     752        if (CPUMIsGuestInLongMode(pVCpu))
     753            VMCPU_FF_SET(pVCpu, VMCPU_FF_TLB_FLUSH);
     754        else
     755#endif
     756        {
     757            SVMR0InvlpgA(GCVirt, pVmcb->ctrl.TLBCtrl.n.u32ASID);
     758            STAM_COUNTER_INC(&pVCpu->hm.s.StatFlushTlbInvlpgVirt);
     759        }
     760    }
     761    return VINF_SUCCESS;
     762}
     763
     764
     765/**
    729766 * Flushes the appropriate tagged-TLB entries.
    730767 *
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