VirtualBox

Changeset 1269 in vbox


Ignore:
Timestamp:
Mar 6, 2007 12:48:07 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
19215
Message:

Completed hwaccm world switch test

File:
1 edited

Legend:

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

    r1258 r1269  
    29382938    int      rc;
    29392939    PCPUMCTX pHyperCtx, pGuestCtx;
     2940    RTGCPHYS CR3Phys = 0x0; /* fake address */
    29402941
    29412942    if (!HWACCMR3IsAllowed(pVM))
     
    29532954    /* Enable mapping of the hypervisor into the shadow page table. */
    29542955    PGMR3ChangeShwPDMappings(pVM, true);
     2956
     2957    CPUMQueryHyperCtxPtr(pVM, &pHyperCtx);
     2958
     2959    pHyperCtx->cr0 = X86_CR0_PE | X86_CR0_WP | X86_CR0_PG | X86_CR0_TS | X86_CR0_ET | X86_CR0_NE | X86_CR0_MP;
     2960    pHyperCtx->cr4 = X86_CR4_PGE | X86_CR4_OSFSXR | X86_CR4_OSXMMEEXCPT;
     2961    PGMChangeMode(pVM, pHyperCtx->cr0, pHyperCtx->cr4, 0);
     2962    PGMSyncCR3(pVM, pHyperCtx->cr0, CR3Phys, pHyperCtx->cr4, true);
    29552963
    29562964    VM_FF_CLEAR(pVM, VM_FF_TO_R3);
    29572965    VM_FF_CLEAR(pVM, VM_FF_TIMER);
    29582966    VM_FF_CLEAR(pVM, VM_FF_REQUEST);
    2959 
    2960     CPUMQueryHyperCtxPtr(pVM, &pHyperCtx);
    2961 
    2962     pHyperCtx->cr0 = X86_CR0_PE | X86_CR0_WP | X86_CR0_PG | X86_CR0_TS | X86_CR0_ET | X86_CR0_NE | X86_CR0_MP;
    2963     pHyperCtx->cr4 = X86_CR4_PGE | X86_CR4_OSFSXR | X86_CR4_OSXMMEEXCPT;
    29642967
    29652968    /*
     
    30083011            /* Copy the hypervisor context to make sure we have a valid guest context. */
    30093012            *pGuestCtx = *pHyperCtx;
    3010 
    3011             pGuestCtx->csHid.u32Base  = 0;
    3012             pGuestCtx->csHid.u32Limit = 0xffffffff;
     3013            pGuestCtx->cr3 = CR3Phys;
     3014
     3015            VM_FF_CLEAR(pVM, VM_FF_TO_R3);
     3016            VM_FF_CLEAR(pVM, VM_FF_TIMER);
    30133017
    30143018            uint64_t TickThisStart = ASMReadTSC();
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette