VirtualBox

Changeset 28123 in vbox


Ignore:
Timestamp:
Apr 9, 2010 8:02:25 AM (15 years ago)
Author:
vboxsync
Message:

Simplified hypervisor conflict check

Location:
trunk/src/VBox/VMM/VMMAll
Files:
2 edited

Legend:

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

    r28094 r28123  
    153153     * where our hypervisor is currently mapped, then we'll create a #PF storm in the guest.
    154154     */
    155     if ((uErr & (X86_TRAP_PF_P | X86_TRAP_PF_RW)) == (X86_TRAP_PF_P | X86_TRAP_PF_RW))
    156     {
    157         pgmLock(pVM);
    158 #  if PGM_SHW_TYPE == PGM_TYPE_32BIT
    159         const unsigned  iPDDst = pvFault >> SHW_PD_SHIFT;
    160         PX86PD          pPDDst = pgmShwGet32BitPDPtr(&pVCpu->pgm.s);
    161 #  else /* PGM_SHW_TYPE == PGM_TYPE_PAE */
    162         const unsigned  iPDDst = (pvFault >> SHW_PD_SHIFT) & SHW_PD_MASK;   /* pPDDst index, not used with the pool. */
    163 
    164         PX86PDPAE       pPDDst;
    165 #   if PGM_GST_TYPE != PGM_TYPE_PAE
    166         X86PDPE         PdpeSrc;
    167 
    168         /* Fake PDPT entry; access control handled on the page table level, so allow everything. */
    169         PdpeSrc.u  = X86_PDPE_P;   /* rw/us are reserved for PAE pdpte's; accessed bit causes invalid VT-x guest state errors */
    170 #   endif
    171         rc = pgmShwSyncPaePDPtr(pVCpu, pvFault, &PdpeSrc, &pPDDst);
    172         if (rc != VINF_SUCCESS)
    173         {
    174             pgmUnlock(pVM);
    175             AssertRC(rc);
    176             return rc;
    177         }
    178         Assert(pPDDst);
    179 #  endif
    180         if (pPDDst->a[iPDDst].u & PGM_PDFLAGS_MAPPING)
    181         {
    182             pgmUnlock(pVM);
    183             /* Force a CR3 sync to check for conflicts and emulate the instruction. */
    184             VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3);
    185             return VINF_EM_RAW_EMULATE_INSTR;
    186         }
    187         pgmUnlock(pVM);
     155    if (    (uErr & (X86_TRAP_PF_P | X86_TRAP_PF_RW)) == (X86_TRAP_PF_P | X86_TRAP_PF_RW)
     156        &&  MMHyperIsInsideArea(pVM, pvFault))
     157    {
     158        /* Force a CR3 sync to check for conflicts and emulate the instruction. */
     159        VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3);
     160        return VINF_EM_RAW_EMULATE_INSTR;
    188161    }
    189162# endif
  • trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp

    r27775 r28123  
    11501150
    11511151    /*
    1152      * Incremental page table updates should weight more than random ones.
     1152     * Incremental page table updates should weigh more than random ones.
    11531153     * (Only applies when started from offset 0)
    11541154     */
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