VirtualBox

Changeset 80170 in vbox


Ignore:
Timestamp:
Aug 7, 2019 4:59:59 AM (5 years ago)
Author:
vboxsync
Message:

VMM/HMVMXR0: Nested VMX: bugref:9180 APIC-access/virtual-APIC page nits.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/HMVMXAll.cpp

    r80161 r80170  
    13271327    pVCpu->hm.s.vmx.fSwitchedNstGstFlushTlb = true;
    13281328
     1329    /** @todo Handle releasing of the page-mapping lock later. */
     1330#if 0
    13291331    if (pVCpu->hm.s.vmx.fVirtApicPageLocked)
    13301332    {
     
    13321334        pVCpu->hm.s.vmx.fVirtApicPageLocked = false;
    13331335    }
     1336#endif
    13341337}
    13351338
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r80151 r80170  
    1001310013
    1001410014        /** @todo NSTVMX: This is not really correct but currently is required to make
    10015          *        things work. We need to re-register the page handler when we fallback to
     10015         *        things work. We need to re-enable the page handler when we fallback to
    1001610016         *        IEM execution of the nested-guest! */
    10017         PGMHandlerPhysicalDeregister(pVM, GCPhysApicAccess);
    10018 
    10019         void *pvPage;
    10020         PGMPAGEMAPLOCK PgMapLockApicAccess;
    10021         int rc = PGMPhysGCPhys2CCPtr(pVM, GCPhysApicAccess, &pvPage, &PgMapLockApicAccess);
     10017        PGMHandlerPhysicalPageTempOff(pVM, GCPhysApicAccess, GCPhysApicAccess);
     10018
     10019        void          *pvPage;
     10020        PGMPAGEMAPLOCK PgLockApicAccess;
     10021        int rc = PGMPhysGCPhys2CCPtr(pVM, GCPhysApicAccess, &pvPage, &PgLockApicAccess);
    1002210022        if (RT_SUCCESS(rc))
    1002310023        {
     
    1002510025            AssertMsgRCReturn(rc, ("Failed to get host-physical address for APIC-access page at %#RGp\n", GCPhysApicAccess), rc);
    1002610026
    10027             /*
    10028              * We can release the page lock here because the APIC-access page is never read or
    10029              * written to but merely serves as a placeholder in the shadow/nested page tables
    10030              * to cause VM-exits or re-direct the access to the virtual-APIC page.
    10031              */
    10032             PGMPhysReleasePageMappingLock(pVCpu->CTX_SUFF(pVM), &PgMapLockApicAccess);
     10027            /** @todo Handle proper releasing of page-mapping lock later. */
     10028            PGMPhysReleasePageMappingLock(pVCpu->CTX_SUFF(pVM), &PgLockApicAccess);
    1003310029        }
    1003410030        else
     
    1004710043    {
    1004810044        Assert(pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_PROC_CTLS_USE_TPR_SHADOW);
    10049 
    10050         void *pvPage;
    1005110045        RTGCPHYS const GCPhysVirtApic = pVmcsNstGst->u64AddrVirtApic.u;
    10052         int rc = PGMPhysGCPhys2CCPtr(pVM, GCPhysVirtApic, &pvPage, &pVCpu->hm.s.vmx.PgMapLockVirtApic);
    10053         AssertMsgRCReturn(rc, ("Failed to get current-context pointer for virtual-APIC page at %#RGp\n", GCPhysVirtApic), rc);
    10054 
    10055         rc = PGMPhysGCPhys2HCPhys(pVM, GCPhysVirtApic, &HCPhysVirtApic);
    10056         AssertMsgRCReturn(rc, ("Failed to get host-physical address for virtual-APIC page at %#RGp\n", GCPhysVirtApic), rc);
    10057         pVCpu->hm.s.vmx.fVirtApicPageLocked = true;
     10046
     10047        void          *pvPage;
     10048        PGMPAGEMAPLOCK PgLockVirtApic;
     10049        int rc = PGMPhysGCPhys2CCPtr(pVM, GCPhysVirtApic, &pvPage, &PgLockVirtApic);
     10050        if (RT_SUCCESS(rc))
     10051        {
     10052            rc = PGMPhysGCPhys2HCPhys(pVM, GCPhysVirtApic, &HCPhysVirtApic);
     10053            AssertMsgRCReturn(rc, ("Failed to get host-physical address for virtual-APIC page at %#RGp\n", GCPhysVirtApic), rc);
     10054
     10055            /** @todo Handle proper releasing of page-mapping lock later. */
     10056            PGMPhysReleasePageMappingLock(pVCpu->CTX_SUFF(pVM), &PgLockVirtApic);
     10057        }
     10058        else
     10059            return rc;
    1005810060
    1005910061        u32TprThreshold = pVmcsNstGst->u32TprThreshold;
     
    1672516727    Assert(CPUMIsGuestVmxProcCtls2Set(pVCpu, &pVCpu->cpum.GstCtx, VMX_PROC_CTLS2_VIRT_APIC_ACCESS));
    1672616728
     16729    Log4Func(("at offset %#x type=%u\n", VMX_EXIT_QUAL_APIC_ACCESS_OFFSET(pVmxTransient->uExitQual),
     16730              VMX_EXIT_QUAL_APIC_ACCESS_TYPE(pVmxTransient->uExitQual)));
     16731
    1672716732    VMXVEXITINFO ExitInfo;
    1672816733    RT_ZERO(ExitInfo);
  • trunk/src/VBox/VMM/include/HMInternal.h

    r80152 r80170  
    912912             *  nested-geust. */
    913913            bool                        fSwitchedNstGstFlushTlb;
    914 
    915             bool                        fVirtApicPageLocked;
    916914            /** Alignment. */
    917             bool                        afAlignment0[3];
     915            bool                        afAlignment0[4];
    918916            /** Cached guest APIC-base MSR for identifying when to map the APIC-access page. */
    919917            uint64_t                    u64GstMsrApicBase;
    920             PGMPAGEMAPLOCK              PgMapLockVirtApic;
    921918            /** @} */
    922919
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