Changeset 91305 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Sep 17, 2021 8:56:45 PM (3 years ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp
r91301 r91305 2478 2478 * 2479 2479 * @returns @c true if the I/O port access must cause a VM-exit, @c false otherwise. 2480 * @param p vIoBitmap Pointer to I/O bitmap.2480 * @param pbIoBitmap Pointer to I/O bitmap. 2481 2481 * @param uPort The I/O port being accessed. 2482 2482 * @param cbAccess e size of the I/O access in bytes (1, 2 or 4 bytes). 2483 2483 */ 2484 static bool cpumGetVmxIoBitmapPermission( void const *pvIoBitmap, uint16_t uPort, uint8_t cbAccess)2484 static bool cpumGetVmxIoBitmapPermission(uint8_t const *pbIoBitmap, uint16_t uPort, uint8_t cbAccess) 2485 2485 { 2486 2486 Assert(cbAccess == 1 || cbAccess == 2 || cbAccess == 4); … … 2504 2504 * If any bit corresponding to the I/O access is set, we must cause a VM-exit. 2505 2505 */ 2506 uint8_t const *pbIoBitmap = (uint8_t const *)pvIoBitmap;2507 2506 uint16_t const offPerm = uPort >> 3; /* Byte offset of the port. */ 2508 2507 uint16_t const idxPermBit = uPort - (offPerm << 3); /* Bit offset within byte. */ … … 2513 2512 /* Fetch 8 or 16-bits depending on whether the access spans 8-bit boundary. */ 2514 2513 RTUINT16U uPerm; 2515 uPerm.s.Lo = *(pbIoBitmap + offPerm);2514 uPerm.s.Lo = pbIoBitmap[offPerm]; 2516 2515 if (idxPermBit + cbAccess > 8) 2517 uPerm.s.Hi = *(pbIoBitmap + 1 + offPerm);2516 uPerm.s.Hi = pbIoBitmap[offPerm + 1]; 2518 2517 else 2519 2518 uPerm.s.Hi = 0; … … 2802 2801 2803 2802 if (CPUMIsGuestVmxProcCtlsSet(pCtx, VMX_PROC_CTLS_USE_IO_BITMAPS)) 2804 { 2805 uint8_t const *pbIoBitmap = (uint8_t const *)pCtx->hwvirt.vmx.CTX_SUFF(pvIoBitmap); 2806 Assert(pbIoBitmap); 2807 return cpumGetVmxIoBitmapPermission(pbIoBitmap, u16Port, cbAccess); 2808 } 2803 return cpumGetVmxIoBitmapPermission(pCtx->hwvirt.vmx.abIoBitmap, u16Port, cbAccess); 2809 2804 2810 2805 return false; -
trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h
r91304 r91305 6663 6663 /* Read the IO bitmap A. */ 6664 6664 RTGCPHYS const GCPhysIoBitmapA = pVmcs->u64AddrIoBitmapA.u; 6665 Assert(pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pvIoBitmap)); 6666 int rc = PGMPhysSimpleReadGCPhys(pVCpu->CTX_SUFF(pVM), pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pvIoBitmap), 6665 int rc = PGMPhysSimpleReadGCPhys(pVCpu->CTX_SUFF(pVM), &pVCpu->cpum.GstCtx.hwvirt.vmx.abIoBitmap[0], 6667 6666 GCPhysIoBitmapA, VMX_V_IO_BITMAP_A_SIZE); 6668 6667 if (RT_SUCCESS(rc)) … … 6673 6672 /* Read the IO bitmap B. */ 6674 6673 RTGCPHYS const GCPhysIoBitmapB = pVmcs->u64AddrIoBitmapB.u; 6675 uint8_t *pbIoBitmapB = (uint8_t *)pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pvIoBitmap) + VMX_V_IO_BITMAP_A_SIZE;6676 rc = PGMPhysSimpleReadGCPhys(pVCpu->CTX_SUFF(pVM), pbIoBitmapB,GCPhysIoBitmapB, VMX_V_IO_BITMAP_B_SIZE);6674 rc = PGMPhysSimpleReadGCPhys(pVCpu->CTX_SUFF(pVM), &pVCpu->cpum.GstCtx.hwvirt.vmx.abIoBitmap[VMX_V_IO_BITMAP_A_SIZE], 6675 GCPhysIoBitmapB, VMX_V_IO_BITMAP_B_SIZE); 6677 6676 if (RT_SUCCESS(rc)) 6678 6677 { /* likely */ }
Note:
See TracChangeset
for help on using the changeset viewer.