VirtualBox

Changeset 78455 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 9, 2019 8:36:06 AM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
130464
Message:

VMM/IEM: Nested VMX: bugref:9180 Use the CPUM function for determining VMX I/O intercepts.

File:
1 edited

Legend:

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

    r78453 r78455  
    30313031
    30323032/**
    3033  * Checks whether an I/O instruction for the given port is intercepted (causes a
    3034  * VM-exit)  or not.
    3035  *
    3036  * @returns @c true if the instruction is intercepted, @c false otherwise.
    3037  * @param   pVCpu       The cross context virtual CPU structure.
    3038  * @param   u16Port     The I/O port being accessed by the instruction.
    3039  * @param   cbAccess    The size of the I/O access in bytes (1, 2 or 4 bytes).
    3040  */
    3041 IEM_STATIC bool iemVmxIsIoInterceptSet(PCVMCPU pVCpu, uint16_t u16Port, uint8_t cbAccess)
    3042 {
    3043     PCVMXVVMCS pVmcs = pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pVmcs);
    3044     Assert(pVmcs);
    3045 
    3046     /*
    3047      * Check whether the I/O instruction must cause a VM-exit or not.
    3048      * See Intel spec. 25.1.3 "Instructions That Cause VM Exits Conditionally".
    3049      */
    3050     if (pVmcs->u32ProcCtls & VMX_PROC_CTLS_UNCOND_IO_EXIT)
    3051         return true;
    3052 
    3053     if (pVmcs->u32ProcCtls & VMX_PROC_CTLS_USE_IO_BITMAPS)
    3054     {
    3055         uint8_t const *pbIoBitmapA = (uint8_t const *)pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pvIoBitmap);
    3056         uint8_t const *pbIoBitmapB = (uint8_t const *)pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pvIoBitmap) + VMX_V_IO_BITMAP_A_SIZE;
    3057         Assert(pbIoBitmapA);
    3058         Assert(pbIoBitmapB);
    3059         return CPUMGetVmxIoBitmapPermission(pbIoBitmapA, pbIoBitmapB, u16Port, cbAccess);
    3060     }
    3061 
    3062     return false;
    3063 }
    3064 
    3065 
    3066 /**
    30673033 * VMX VM-exit handler for VM-exits due to INVLPG.
    30683034 *
     
    35353501    Assert(cbAccess == 1 || cbAccess == 2 || cbAccess == 4);
    35363502
    3537     bool const fIntercept = iemVmxIsIoInterceptSet(pVCpu, u16Port, cbAccess);
     3503    bool const fIntercept = CPUMIsGuestVmxIoInterceptSet(pVCpu, u16Port, cbAccess);
    35383504    if (fIntercept)
    35393505    {
     
    35773543    Assert(uInstrId != VMXINSTRID_IO_INS || ExitInstrInfo.StrIo.iSegReg == X86_SREG_ES);
    35783544
    3579     bool const fIntercept = iemVmxIsIoInterceptSet(pVCpu, u16Port, cbAccess);
     3545    bool const fIntercept = CPUMIsGuestVmxIoInterceptSet(pVCpu, u16Port, cbAccess);
    35803546    if (fIntercept)
    35813547    {
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