Changeset 19993 in vbox for trunk/src/VBox
- Timestamp:
- May 25, 2009 12:12:06 PM (16 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp
r19992 r19993 1043 1043 * @param uErrorCode CPU Error code. 1044 1044 * @param pCtxCore Trap register frame. 1045 * @param pvFault The fault address (cr2).1046 1045 * @param GCPhysFault The GC physical address corresponding to pvFault. 1047 1046 * @param pvUser Pointer to the MMIO ring-3 range entry. 1048 1047 */ 1049 VMMDECL(int) IOMMMIOHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pCtxCore, RTGCPTR pvFault, RTGCPHYS GCPhysFault, void *pvUser)1048 int iomMMIOHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pCtxCore, RTGCPHYS GCPhysFault, void *pvUser) 1050 1049 { 1051 1050 /* Take the IOM lock before performing any MMIO. */ … … 1058 1057 1059 1058 STAM_PROFILE_START(&pVM->iom.s.StatRZMMIOHandler, a); 1060 Log((" IOMMMIOHandler: GCPhys=%RGp uErr=%#x pvFault=%RGv rip=%RGv\n",1061 GCPhysFault, (uint32_t)uErrorCode, pvFault,(RTGCPTR)pCtxCore->rip));1059 Log(("iomMMIOHandler: GCPhys=%RGp uErr=%#x pvFault=%RGv rip=%RGv\n", 1060 GCPhysFault, (uint32_t)uErrorCode, (RTGCPTR)pCtxCore->rip)); 1062 1061 1063 1062 PIOMMMIORANGE pRange = (PIOMMMIORANGE)pvUser; … … 1244 1243 } 1245 1244 1245 /** 1246 * \#PF Handler callback for MMIO ranges. 1247 * 1248 * @returns VBox status code (appropriate for GC return). 1249 * @param pVM VM Handle. 1250 * @param uErrorCode CPU Error code. 1251 * @param pCtxCore Trap register frame. 1252 * @param pvFault The fault address (cr2). 1253 * @param GCPhysFault The GC physical address corresponding to pvFault. 1254 * @param pvUser Pointer to the MMIO ring-3 range entry. 1255 */ 1256 VMMDECL(int) IOMMMIOHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pCtxCore, RTGCPTR pvFault, RTGCPHYS GCPhysFault, void *pvUser) 1257 { 1258 LogFlow(("IOMMMIOHandler: GCPhys=%RGp uErr=%#x pvFault=%RGv rip=%RGv\n", 1259 GCPhysFault, (uint32_t)uErrorCode, pvFault, (RTGCPTR)pCtxCore->rip)); 1260 return iomMMIOHandler(pVM, uErrorCode, pCtxCore, GCPhysFault, pvUser); 1261 } 1262 1263 /** 1264 * Physical access handler for MMIO ranges. 1265 * 1266 * @returns VBox status code (appropriate for GC return). 1267 * @param pVM VM Handle. 1268 * @param uErrorCode CPU Error code. 1269 * @param pCtxCore Trap register frame. 1270 * @param GCPhysFault The GC physical address. 1271 */ 1272 VMMDECL(int) IOMMMIOPhysHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pCtxCore, RTGCPHYS GCPhysFault) 1273 { 1274 return iomMMIOHandler(pVM, uErrorCode, pCtxCore, GCPhysFault, iomMMIOGetRange(&pVM->iom.s, GCPhysFault)); 1275 } 1246 1276 1247 1277 #ifdef IN_RING3 -
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r19992 r19993 2929 2929 { 2930 2930 errCode |= X86_TRAP_PF_P; 2931 2931 } 2932 2932 #if 0 2933 else { 2933 2934 /* Shortcut for APIC TPR reads and writes; 32 bits guests only */ 2934 2935 if ( (GCPhys & 0xfff) == 0x080 2935 && GCPhys > 0x1000000 /* to skip VGA frame buffer accesses */2936 && GCPhys > 0x1000000 /* to skip VGA frame buffer accesses */ 2936 2937 && !CPUMIsGuestInLongModeEx(pCtx) 2937 2938 && (pVM->hwaccm.s.vmx.msr.vmx_proc_ctls2.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC2_VIRT_APIC)) … … 2939 2940 RTGCPHYS GCPhysApicBase; 2940 2941 PDMApicGetBase(pVM, &GCPhysApicBase); /* @todo cache this */ 2942 GCPhysApicBase &= PAGE_BASE_GC_MASK; 2941 2943 if (GCPhys == GCPhysApicBase + 0x80) 2942 2944 { 2945 Log(("Enable VT-x virtual APIC access filtering\n")); 2943 2946 pVCpu->hwaccm.s.vmx.proc_ctls2 |= VMX_VMCS_CTRL_PROC_EXEC2_VIRT_APIC; 2944 rc = VMXWriteVMCS(VMX_VMCS_CTRL_PROC_EXEC_CONTROLS2, val); 2947 rc = VMXWriteVMCS(VMX_VMCS_CTRL_PROC_EXEC_CONTROLS2, pVCpu->hwaccm.s.vmx.proc_ctls2); 2948 AssertRC(rc); 2949 2950 rc = IOMMMIOMapMMIOHCPage(pVM, GCPhysApicBase, pVM->hwaccm.s.vmx.pAPICPhys, X86_PTE_RW | X86_PTE_P); 2945 2951 AssertRC(rc); 2946 2952 } 2947 2953 } 2948 #endif 2949 } 2950 Log Flow(("EPT Page fault %x at %RGp error code %x\n", (uint32_t)exitQualification, GCPhys, errCode));2954 } 2955 #endif 2956 Log(("EPT Page fault %x at %RGp error code %x\n", (uint32_t)exitQualification, GCPhys, errCode)); 2951 2957 2952 2958 /* GCPhys contains the guest physical address of the page fault. */ … … 3409 3415 { 3410 3416 LogFlow(("VMX_EXIT_APIC_ACCESS\n")); 3411 3412 switch(VMX_EXIT_QUALIFICATION_APIC_ACCESS_TYPE(exitQualification)) 3417 unsigned uAccessType = VMX_EXIT_QUALIFICATION_APIC_ACCESS_TYPE(exitQualification); 3418 3419 switch(uAccessType) 3413 3420 { 3414 3421 case VMX_APIC_ACCESS_TYPE_LINEAR_READ: … … 3420 3427 3421 3428 Log(("Apic access at %RGp\n", GCPhys)); 3422 rc = VINF_EM_RAW_EMULATE_INSTR; 3429 rc = IOMMMIOPhysHandler(pVM, (uAccessType == VMX_APIC_ACCESS_TYPE_LINEAR_READ) ? 0 : X86_TRAP_PF_RW, CPUMCTX2CORE(pCtx), GCPhys); 3430 if (rc == VINF_SUCCESS) 3431 goto ResumeExecution; /* rip already updated */ 3432 3423 3433 break; 3424 3434 }
Note:
See TracChangeset
for help on using the changeset viewer.