VirtualBox

Changeset 99360 in vbox for trunk/src


Ignore:
Timestamp:
Apr 10, 2023 5:44:28 AM (22 months ago)
Author:
vboxsync
Message:

VMM/PGM: Nested VMX: bugref:10318 Skip some redundant checks while repeatedly registeration the virtual VMX APIC-access page.

File:
1 edited

Legend:

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

    r99317 r99360  
    339339 * @param   pVM             The cross context VM structure.
    340340 * @param   pPhysHandler    The physical handler.
    341  * @param   GCPhys          The address of the virtual VMX APIC-access page.
     341 * @param   GCPhys          The address of the virtual VMX APIC-access page. Must be
     342 *                          page aligned.
    342343 */
    343344static int pgmHandlerPhysicalRegisterVmxApicAccessPage(PVMCC pVM, PPGMPHYSHANDLER pPhysHandler, RTGCPHYS GCPhys)
     
    454455 *
    455456 * @param   pVM             The cross context VM structure.
    456  * @param   GCPhys          Start physical address.
     457 * @param   GCPhys          The address of the VMX virtual-APIC access page. Must be
     458 *                          page aligned.
    457459 * @param   hType           The handler type registration handle.
    458460 */
     
    461463    PCPGMPHYSHANDLERTYPEINT const pType = pgmHandlerPhysicalTypeHandleToPtr(pVM, hType);
    462464    AssertReturn(pType, VERR_INVALID_HANDLE);
    463     AssertReturn(pType->enmKind == PGMPHYSHANDLERKIND_ALL, VERR_INVALID_HANDLE);
    464     AssertMsgReturn(!(GCPhys & GUEST_PAGE_OFFSET_MASK), ("%RGp\n", GCPhys), VERR_INVALID_PARAMETER);
     465    AssertMsg(!(GCPhys & GUEST_PAGE_OFFSET_MASK), ("%RGp\n", GCPhys));
    465466
    466467    /*
    467468     * Find if the VMX APIC access page has already been registered at this address.
    468469     */
    469     int rc = PGM_LOCK_VOID(pVM);
     470    int rc = PGM_LOCK(pVM);
    470471    AssertRCReturn(rc, rc);
    471472
     
    481482
    482483        /* Check it's the virtual VMX APIC-access page. */
    483         if (   pHandlerType->fNotInHm
    484             && pHandlerType->enmKind == PGMPHYSHANDLERKIND_ALL)
     484        if (pHandlerType->fNotInHm)
     485        {
     486            Assert(pHandlerType->enmKind == PGMPHYSHANDLERKIND_ALL);
    485487            rc = VINF_SUCCESS;
     488        }
    486489        else
    487490        {
     
    494497        return rc;
    495498    }
     499
     500    /*
     501     * Validate the page handler parameters before registering the virtual VMX APIC-access page.
     502     */
     503    AssertReturn(pType->enmKind == PGMPHYSHANDLERKIND_ALL, VERR_INVALID_HANDLE);
     504    AssertReturn(pType->fNotInHm, VERR_PGM_HANDLER_IPE_1);
    496505
    497506    /*
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