VirtualBox

Changeset 78840 in vbox for trunk/include/VBox/vmm


Ignore:
Timestamp:
May 29, 2019 9:04:26 AM (6 years ago)
Author:
vboxsync
Message:

VMM/CPUM: Nested VMX: bugref:9180 Make CPUMIsGuestVmx[Phys|Virt]IntrEnabled() inline.

File:
1 edited

Legend:

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

    r78775 r78840  
    14761476VMM_INT_DECL(uint64_t)  CPUMApplyNestedGuestTscOffset(PVMCPU pVCpu, uint64_t uTicks);
    14771477VMM_INT_DECL(uint64_t)  CPUMRemoveNestedGuestTscOffset(PVMCPU pVCpu, uint64_t uTicks);
    1478 VMM_INT_DECL(bool)      CPUMIsGuestVmxPhysIntrEnabled(PVMCPU pVCpu, PCCPUMCTX pCtx);
    1479 VMM_INT_DECL(bool)      CPUMIsGuestVmxVirtIntrEnabled(PVMCPU pVCpu, PCCPUMCTX pCtx);
    14801478VMM_INT_DECL(uint32_t)  CPUMGetVmxMsrPermission(void const *pvMsrBitmap, uint32_t idMsr);
    14811479VMM_INT_DECL(bool)      CPUMIsGuestVmxIoInterceptSet(PVMCPU pVCpu, uint16_t u16Port, uint8_t cbAccess);
     
    21962194}
    21972195
    2198 
    21992196/**
    22002197 * Checks whether the LMSW access causes a VM-exit or not.
     
    22442241    return false;
    22452242}
    2246 
    22472243
    22482244/**
     
    22932289
    22942290# endif /* !IN_RC */
     2291
     2292/**
     2293 * Checks whether the VMX nested-guest is in a state to receive physical (APIC)
     2294 * interrupts.
     2295 *
     2296 * @returns VBox status code.
     2297 * @retval  true if it's ready, false otherwise.
     2298 *
     2299 * @param   pVCpu   The cross context virtual CPU structure of the calling EMT.
     2300 * @param   pCtx    The guest-CPU context.
     2301 */
     2302DECLINLINE(bool) CPUMIsGuestVmxPhysIntrEnabled(PVMCPU pVCpu, PCCPUMCTX pCtx)
     2303{
     2304#ifdef IN_RC
     2305    RT_NOREF2(pVCpu, pCtx);
     2306    AssertReleaseFailedReturn(false);
     2307#else
     2308    RT_NOREF(pVCpu);
     2309    Assert(CPUMIsGuestInVmxNonRootMode(pCtx));
     2310    return RT_BOOL(pCtx->eflags.u & X86_EFL_IF);
     2311#endif
     2312}
     2313
     2314/**
     2315 * Checks whether the VMX nested-guest is in a state to receive virtual interrupts
     2316 * (those injected with the "virtual-interrupt delivery" feature).
     2317 *
     2318 * @returns VBox status code.
     2319 * @retval  true if it's ready, false otherwise.
     2320 *
     2321 * @param   pVCpu   The cross context virtual CPU structure of the calling EMT.
     2322 * @param   pCtx    The guest-CPU context.
     2323 */
     2324DECLINLINE(bool) CPUMIsGuestVmxVirtIntrEnabled(PVMCPU pVCpu, PCCPUMCTX pCtx)
     2325{
     2326#ifdef IN_RC
     2327    RT_NOREF2(pVCpu, pCtx);
     2328    AssertReleaseFailedReturn(false);
     2329#else
     2330    RT_NOREF(pVCpu);
     2331    Assert(CPUMIsGuestInVmxNonRootMode(pCtx));
     2332
     2333    if (   (pCtx->eflags.u & X86_EFL_IF)
     2334        && !CPUMIsGuestVmxProcCtlsSet(pVCpu, pCtx, VMX_PROC_CTLS_INT_WINDOW_EXIT))
     2335        return true;
     2336    return false;
     2337#endif
     2338}
    22952339
    22962340#endif /* IPRT_WITHOUT_NAMED_UNIONS_AND_STRUCTS */
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