VirtualBox

Changeset 78454 in vbox


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

VMM/CPUM: Nested VMX: bugref:9180 Add CPUM function to figure out if an I/O access cause a nested-guest VM-exit for upcoming changes.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/include/VBox/vmm/cpum.h

    r78371 r78454  
    14721472VMM_INT_DECL(bool)      CPUMIsGuestVmxVirtIntrEnabled(PVMCPU pVCpu, PCCPUMCTX pCtx);
    14731473VMM_INT_DECL(uint32_t)  CPUMGetVmxMsrPermission(void const *pvMsrBitmap, uint32_t idMsr);
     1474VMM_INT_DECL(bool)      CPUMIsGuestVmxIoInterceptSet(PVMCPU pVCpu, uint16_t u16Port, uint8_t cbAccess);
    14741475VMM_INT_DECL(bool)      CPUMGetVmxIoBitmapPermission(void const *pvIoBitmapA, void const *pvIoBitmapB, uint16_t uPort,
    14751476                                                     uint8_t cbAccess);
  • TabularUnified trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp

    r78371 r78454  
    32723272
    32733273/**
     3274 * Checks whether the given I/O access should cause a nested-guest VM-exit.
     3275 *
     3276 * @returns @c true if set, @c false otherwise.
     3277 * @param   pVCpu       The cross context virtual CPU structure of the calling EMT.
     3278 * @param   u16Port     The I/O port being accessed.
     3279 * @param   cbAccess    The size of the I/O access in bytes (1, 2 or 4 bytes).
     3280 */
     3281VMM_INT_DECL(bool) CPUMIsGuestVmxIoInterceptSet(PVMCPU pVCpu, uint16_t u16Port, uint8_t cbAccess)
     3282{
     3283#ifndef IN_RC
     3284    PCCPUMCTX pCtx = &pVCpu->cpum.s.Guest;
     3285    if (CPUMIsGuestVmxProcCtlsSet(pVCpu, pCtx, VMX_PROC_CTLS_UNCOND_IO_EXIT))
     3286        return true;
     3287
     3288    if (CPUMIsGuestVmxProcCtlsSet(pVCpu, pCtx, VMX_PROC_CTLS_USE_IO_BITMAPS))
     3289    {
     3290        uint8_t const *pbIoBitmapA = (uint8_t const *)pCtx->hwvirt.vmx.CTX_SUFF(pvIoBitmap);
     3291        uint8_t const *pbIoBitmapB = (uint8_t const *)pCtx->hwvirt.vmx.CTX_SUFF(pvIoBitmap) + VMX_V_IO_BITMAP_A_SIZE;
     3292        Assert(pbIoBitmapA);
     3293        Assert(pbIoBitmapB);
     3294        return CPUMGetVmxIoBitmapPermission(pbIoBitmapA, pbIoBitmapB, u16Port, cbAccess);
     3295    }
     3296
     3297    return false;
     3298#else
     3299    RT_NOREF3(pVCpu, u16Port, cbAccess);
     3300    return false;
     3301#endif
     3302}
     3303
     3304
     3305/**
    32743306 * Determines whether an IOIO intercept is active for the nested-guest or not.
    32753307 *
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