VirtualBox

Changeset 20003 in vbox


Ignore:
Timestamp:
May 25, 2009 2:38:49 PM (16 years ago)
Author:
vboxsync
Message:

Enabled the IO-APIC optimizations for VT-x in the 32 bits guest case. (both nested and normal shadow paging)

File:
1 edited

Legend:

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

    r20001 r20003  
    24842484                TRPMSetFaultAddress(pVCpu, exitQualification);
    24852485
     2486                /* Shortcut for APIC TPR reads and writes; 32 bits guests only */
     2487                if (    (exitQualification & 0xfff) == 0x080
     2488                    &&  !(errCode & X86_TRAP_PF_P)  /* not present */
     2489                    &&  fSetupTPRCaching
     2490                    &&  !CPUMIsGuestInLongModeEx(pCtx))
     2491                {
     2492                    RTGCPHYS GCPhysApicBase, GCPhys;
     2493                    PDMApicGetBase(pVM, &GCPhysApicBase);   /* @todo cache this */
     2494                    GCPhysApicBase &= PAGE_BASE_GC_MASK;
     2495
     2496                    rc = PGMGstGetPage(pVCpu, (RTGCPTR)exitQualification, NULL, &GCPhys);
     2497                    if (    rc == VINF_SUCCESS
     2498                        &&  GCPhys == GCPhysApicBase)
     2499                    {
     2500                        Log(("Enable VT-x virtual APIC access filtering\n"));
     2501                        pVCpu->hwaccm.s.vmx.proc_ctls2 |= VMX_VMCS_CTRL_PROC_EXEC2_VIRT_APIC;
     2502                        rc = VMXWriteVMCS(VMX_VMCS_CTRL_PROC_EXEC_CONTROLS2, pVCpu->hwaccm.s.vmx.proc_ctls2);
     2503                        AssertRC(rc);
     2504
     2505                        rc = IOMMMIOMapMMIOHCPage(pVM, GCPhysApicBase, pVM->hwaccm.s.vmx.pAPICPhys, X86_PTE_RW | X86_PTE_P);
     2506                        AssertRC(rc);
     2507                    }
     2508                }
     2509
    24862510                /* Forward it to our trap handler first, in case our shadow pages are out of sync. */
    24872511                rc = PGMTrap0eHandler(pVCpu, errCode, CPUMCTX2CORE(pCtx), (RTGCPTR)exitQualification);
     
    29412965            errCode |= X86_TRAP_PF_P;
    29422966        }
    2943 #if 0
    29442967        else {
    29452968            /* Shortcut for APIC TPR reads and writes; 32 bits guests only */
     
    29472970                &&  GCPhys > 0x1000000   /* to skip VGA frame buffer accesses */
    29482971                &&  !CPUMIsGuestInLongModeEx(pCtx)
    2949                 &&  (pVM->hwaccm.s.vmx.msr.vmx_proc_ctls2.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC2_VIRT_APIC))
     2972                &&  fSetupTPRCaching)
    29502973            {
    29512974                RTGCPHYS GCPhysApicBase;
     
    29642987            }
    29652988        }
    2966 #endif
    29672989        Log(("EPT Page fault %x at %RGp error code %x\n", (uint32_t)exitQualification, GCPhys, errCode));
    29682990
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