VirtualBox

Ignore:
Timestamp:
Apr 3, 2008 4:30:35 PM (17 years ago)
Author:
vboxsync
Message:

Added CPUMSet/GetGuestEFER.
Corrected NX bit handling.

File:
1 edited

Legend:

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

    r7728 r7730  
    16221622PGM_BTH_DECL(int, CheckPageFault)(PVM pVM, uint32_t uErr, PSHWPDE pPdeDst, PGSTPDE pPdeSrc, RTGCUINTPTR GCPtrPage)
    16231623{
    1624     bool fWriteProtect   = !!(CPUMGetGuestCR0(pVM) & X86_CR0_WP);
    1625     bool fUserLevelFault = !!(uErr & X86_TRAP_PF_US);
    1626     bool fWriteFault     = !!(uErr & X86_TRAP_PF_RW);
     1624    bool fWriteProtect      = !!(CPUMGetGuestCR0(pVM) & X86_CR0_WP);
     1625    bool fUserLevelFault    = !!(uErr & X86_TRAP_PF_US);
     1626    bool fWriteFault        = !!(uErr & X86_TRAP_PF_RW);
     1627# if PGM_WITH_NX(PGM_GST_TYPE)
     1628    bool fNoExecuteBitValid = !!(CPUMGetGuestEFER(pVM) & MSR_K6_EFER_NXE);
     1629# endif
    16271630
    16281631    STAM_PROFILE_START(&pVM->pgm.s.CTXMID(Stat, DirtyBitTracking), a);
     
    16391642    if (    (uErr & X86_TRAP_PF_RSVD)
    16401643        ||  !pPdpeSrc->n.u1Present
    1641         ||  ((uErr & X86_TRAP_PF_ID) &&  pPdpeSrc->n.u1NoExecute)
     1644# if PGM_WITH_NX(PGM_GST_TYPE)
     1645        ||  (fNoExecuteBitValid && (uErr & X86_TRAP_PF_ID) &&  pPdpeSrc->n.u1NoExecute)
     1646# endif
    16421647        ||  (fWriteFault && !pPdpeSrc->n.u1Write && (fUserLevelFault || fWriteProtect))
    16431648        ||  (fUserLevelFault && !pPdpeSrc->n.u1User) )
     
    16851690    if (    (uErr & X86_TRAP_PF_RSVD)
    16861691        ||  !pPdeSrc->n.u1Present
    1687 #  if PGM_WITH_NX(PGM_GST_TYPE)
    1688         ||  ((uErr & X86_TRAP_PF_ID) &&  pPdeSrc->n.u1NoExecute)
    1689 #  endif
     1692# if PGM_WITH_NX(PGM_GST_TYPE)
     1693        ||  (fNoExecuteBitValid && (uErr & X86_TRAP_PF_ID) &&  pPdeSrc->n.u1NoExecute)
     1694# endif
    16901695        ||  (fWriteFault && !pPdeSrc->n.u1Write && (fUserLevelFault || fWriteProtect))
    16911696        ||  (fUserLevelFault && !pPdeSrc->n.u1User) )
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