VirtualBox

Changeset 96958 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Sep 30, 2022 9:15:44 PM (2 years ago)
Author:
vboxsync
Message:

VMM/PGM: Made the APIC access page related optimizations for nested VMs configurable via PGM_WITH_NESTED_APIC_ACCESS_PAGE define in PGMInternal.h, leaving it disabled for now till things are working. bugref:10092

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/PGMAllBth.h

    r96879 r96958  
    17861786            )
    17871787    {
    1788 #   if defined(VBOX_WITH_NESTED_HWVIRT_VMX) && PGM_SHW_TYPE == PGM_TYPE_EPT
     1788#   if defined(VBOX_WITH_NESTED_HWVIRT_VMX) && PGM_SHW_TYPE == PGM_TYPE_EPT && defined(PGM_WITH_NESTED_APIC_ACCESS_PAGE)
    17891789        /*
    17901790         * If an "ALL" access handler has been registered for the VMX APIC-access page,
     
    25772577    SHWPTE Pte;
    25782578    uint64_t const fGstShwPteFlags = pGstWalkAll->u.Ept.Pte.u & pVCpu->pgm.s.fGstEptShadowedPteMask;
    2579     if (PGM_PAGE_HAS_ACTIVE_HANDLERS(pPage))
    2580     {
     2579    if (!PGM_PAGE_HAS_ACTIVE_HANDLERS(pPage))
     2580    {
     2581        Pte.u = PGM_PAGE_GET_HCPHYS(pPage) | fGstShwPteFlags;
     2582Log7Func(("regular page (%R[pgmpage]) at %RGp -> %RX64\n", pPage, GCPhysPage, Pte.u));
     2583    }
     2584    else if (!PGM_PAGE_HAS_ACTIVE_ALL_HANDLERS(pPage))
     2585    {
     2586        /** @todo access bit. */
     2587        Pte.u = PGM_PAGE_GET_HCPHYS(pPage) | (fGstShwPteFlags & ~EPT_E_WRITE);
     2588        Log7Func(("monitored page (%R[pgmpage]) at %RGp -> %RX64\n", pPage, GCPhysPage, Pte.u));
     2589    }
     2590    else
     2591    {
     2592# if defined(PGM_WITH_NESTED_APIC_ACCESS_PAGE)
    25812593        if (CPUMIsGuestVmxApicAccessPageAddr(pVCpu, GCPhysPage))
    25822594        {
     
    25842596            Log7Func(("APIC-access page at %RGp -> shadowing nested-hypervisor %RX64 (%RGp)\n", GCPhysPage, fGstShwPteFlags, pShwPage->GCPhys));
    25852597        }
     2598#  if 0 /** @todo r=bird: What on earth is the rational for this? */
    25862599        else if (!PGM_PAGE_HAS_ACTIVE_ALL_HANDLERS(pPage))
    25872600        {
    2588             Assert(!CPUMIsGuestVmxApicAccessPageAddr(pVCpu, GCPhysPage));
    25892601            if (fGstShwPteFlags & EPT_E_WRITE)
    25902602            {
     
    25952607            Log7Func(("monitored page (%R[pgmpage]) at %RGp -> shadowing nested-hypervisor %RX64\n", pPage, GCPhysPage, fGstShwPteFlags));
    25962608        }
     2609#  endif
    25972610        else
    2598         {
     2611# endif
     2612        {
     2613# if defined(PGM_WITH_NESTED_APIC_ACCESS_PAGE)
    25992614            /** @todo Track using fVirtVmxApicAccess bit in PGMPHYSHANDLER and maybe in PGMPAGE
    26002615             *        too? */
     2616            /** @todo r=bird: this is wrong for device passthru among other scenarios.   */
    26012617            PGMHandlerPhysicalDeregister(pVCpu->CTX_SUFF(pVM), GCPhysPage);
    26022618            Pte.u = PGM_PAGE_GET_HCPHYS(pPage) | fGstShwPteFlags;
    26032619            Log7Func(("MMIO at %RGp potentially former VMX APIC-access page -> unregistered\n", GCPhysPage));
    2604         }
    2605     }
    2606     else
    2607         Pte.u = PGM_PAGE_GET_HCPHYS(pPage) | fGstShwPteFlags;
     2620# else
     2621            /** @todo Do MMIO optimizations here too? */
     2622            Log7Func(("mmio page (%R[pgmpage]) at %RGp -> 0\n", pPage, GCPhysPage));
     2623            Pte.u = 0;
     2624# endif
     2625        }
     2626    }
    26082627
    26092628    /* Make sure only allocated pages are mapped writable. */
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