VirtualBox

Ignore:
Timestamp:
Feb 12, 2008 8:44:35 PM (17 years ago)
Author:
vboxsync
Message:

Converted MM_RAM_FLAGS_VIRTUAL_HANDLER, MM_RAM_FLAGS_VIRTUAL_WRITE
and MM_RAM_FLAGS_VIRTUAL_ALL into a two bit state variable in PGMPAGE.
I've checked this trice because, like last time, bugs may have odd
sideeffects and hide for a while before showing up. Hope I got this
right (unlike for phys).

Fixed a regression from the MM_RAM_FLAGS_PHYSICAL in the physical read/write code.

File:
1 edited

Legend:

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

    r6913 r6927  
    9393
    9494# if PGM_WITH_PAGING(PGM_GST_TYPE)
    95     /* Determine current privilege level */
    96     uint32_t cpl = CPUMGetGuestCPL(pVM, pRegFrame);
    97 
    9895#  ifdef PGM_SYNC_DIRTY_BIT
    9996    /*
     
    345342                         * In case of write access continue to the GC write handler.
    346343                         */
    347                         if (    (pPage->HCPhys & (MM_RAM_FLAGS_VIRTUAL_WRITE | MM_RAM_FLAGS_VIRTUAL_ALL)) == MM_RAM_FLAGS_VIRTUAL_WRITE /** @todo PAGE FLAGS */
     344                        if (    PGM_PAGE_GET_HNDL_VIRT_STATE(pPage) < PGM_PAGE_HNDL_PHYS_STATE_ALL
    348345                            && !(uErr & X86_TRAP_PF_P))
    349346                        {
     
    439436                    STAM_COUNTER_INC(&pVM->pgm.s.StatHandlersUnhandled);
    440437
    441                     if (    !(pPage->HCPhys & (MM_RAM_FLAGS_VIRTUAL_ALL)) /** @todo PAGE FLAGS */
    442                         &&  PGM_PAGE_GET_HNDL_PHYS_STATE(pPage) < PGM_PAGE_HNDL_PHYS_STATE_ALL
     438                    if (    !PGM_PAGE_HAVE_ACTIVE_ALL_HANDLERS(pPage)
    443439                        &&  !(uErr & X86_TRAP_PF_P))
    444440                    {
     
    539535
    540536#  if PGM_WITH_PAGING(PGM_GST_TYPE) && !defined(IN_RING0)
    541                 if (cpl == 0)
     537                if (CPUMGetGuestCPL(pVM, pRegFrame) == 0)
    542538                {
    543539                    uint64_t fPageGst;
     
    11281124            const RTHCPHYS HCPhys = pPage->HCPhys; /** @todo FLAGS */
    11291125            SHWPTE PteDst;
    1130             if (    PGM_PAGE_GET_HNDL_PHYS_STATE(pPage) >= PGM_PAGE_HNDL_PHYS_STATE_WRITE
    1131                 ||  (HCPhys & (MM_RAM_FLAGS_VIRTUAL_ALL | MM_RAM_FLAGS_VIRTUAL_WRITE)))
     1126            if (PGM_PAGE_HAVE_ACTIVE_HANDLERS(pPage))
    11321127            {
    11331128                /** @todo r=bird: Are we actually handling dirty and access bits for pages with access handlers correctly? No. */
    1134                 if (    PGM_PAGE_GET_HNDL_PHYS_STATE(pPage) <= PGM_PAGE_HNDL_PHYS_STATE_WRITE
    1135                     &&  !(HCPhys & MM_RAM_FLAGS_VIRTUAL_ALL))
     1129                if (!PGM_PAGE_HAVE_ACTIVE_ALL_HANDLERS(pPage))
    11361130                    PteDst.u = (PteSrc.u & ~(X86_PTE_PAE_PG_MASK | X86_PTE_AVL_MASK | X86_PTE_PAT | X86_PTE_PCD | X86_PTE_PWT | X86_PTE_RW))
    11371131                             | (HCPhys & X86_PTE_PAE_PG_MASK);
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