VirtualBox

Changeset 81786 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 12, 2019 4:20:34 AM (5 years ago)
Author:
vboxsync
Message:

VMM: Nested VMX: bugref:9180 Implement VMX-preemption timer for nested-guest. It's still disabled though.

Location:
trunk/src/VBox/VMM
Files:
9 edited

Legend:

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

    r81665 r81786  
    23422342        fMask |= X86_CR4_FSGSBASE;
    23432343    return fMask;
     2344}
     2345
     2346
     2347/**
     2348 * Starts a VMX-preemption timer to expire as specified by the nested hypervisor.
     2349 *
     2350 * @returns VBox status code.
     2351 * @param   pVCpu           The cross context virtual CPU structure of the calling thread.
     2352 * @param   uTimer          The VMCS preemption timer value.
     2353 * @param   cShift          The VMX-preemption timer shift (usually based on guest
     2354 *                          VMX MSR rate).
     2355 * @param   pu64EntryTick   Where to store the current tick when the timer is
     2356 *                          programmed.
     2357 * @thread  EMT(pVCpu)
     2358 */
     2359VMM_INT_DECL(int) CPUMStartGuestVmxPremptTimer(PVMCPUCC pVCpu, uint32_t uTimer, uint8_t cShift, uint64_t *pu64EntryTick)
     2360{
     2361    Assert(uTimer);
     2362    Assert(cShift <= 31);
     2363    Assert(pu64EntryTick);
     2364    VMCPU_ASSERT_EMT(pVCpu);
     2365    uint64_t const cTicksToNext = uTimer << cShift;
     2366    return TMTimerSetRelative(pVCpu->cpum.s.CTX_SUFF(pNestedVmxPreemptTimer), cTicksToNext, pu64EntryTick);
     2367}
     2368
     2369
     2370/**
     2371 * Stops the VMX-preemption timer from firing.
     2372 *
     2373 * @returns VBox status code.
     2374 * @param   pVCpu   The cross context virtual CPU structure of the calling thread.
     2375 * @thread  EMT.
     2376 *
     2377 * @remarks This can be called during VM reset, so we cannot assume it will be on
     2378 *          the EMT corresponding to @c pVCpu.
     2379 */
     2380VMM_INT_DECL(int) CPUMStopGuestVmxPremptTimer(PVMCPUCC pVCpu)
     2381{
     2382    /*
     2383     * CPUM gets initialized before TM, so we defer creation of timers till CPUMR3InitCompleted().
     2384     * However, we still get called during CPUMR3Init() and hence we need to check if we  have
     2385     * a valid timer object before trying to stop it.
     2386     */
     2387    PTMTIMER pTimer = pVCpu->cpum.s.CTX_SUFF(pNestedVmxPreemptTimer);
     2388    if (!pTimer)
     2389        return VERR_NOT_FOUND;
     2390
     2391    int rc = TMTimerLock(pTimer, VERR_IGNORED);
     2392    if (rc == VINF_SUCCESS)
     2393    {
     2394        if (TMTimerIsActive(pTimer))
     2395            TMTimerStop(pTimer);
     2396        TMTimerUnlock(pTimer);
     2397    }
     2398    return rc;
    23442399}
    23452400
  • trunk/src/VBox/VMM/VMMAll/IEMAll.cpp

    r81665 r81786  
    1379213792        {
    1379313793            rcStrict = iemVmxVmexitPreemptTimer(pVCpu);
    13794             if (rcStrict == VINF_VMX_INTERCEPT_NOT_ACTIVE)
    13795                 rcStrict = VINF_SUCCESS;
    13796             else
    13797             {
    13798                 Assert(!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS));
    13799                 Assert(!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_PREEMPT_TIMER));
    13800                 return rcStrict;
    13801             }
     13794            Assert(!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_PREEMPT_TIMER));
    1380213795        }
    13803         else
    13804             rcStrict = VINF_SUCCESS;
    13805 
    1380613796        /*
    1380713797         * Check remaining intercepts.
     
    1381413804         * See Intel spec. 26.7.5 "Interrupt-Window Exiting and Virtual-Interrupt Delivery".
    1381513805         */
    13816         if (   VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_VMX_NMI_WINDOW | VMCPU_FF_VMX_INT_WINDOW)
    13817             && !VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS)
    13818             && !TRPMHasTrap(pVCpu))
     13806        else if (   VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_VMX_NMI_WINDOW | VMCPU_FF_VMX_INT_WINDOW)
     13807                 && !VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS)
     13808                 && !TRPMHasTrap(pVCpu))
    1381913809        {
    1382013810            Assert(CPUMIsGuestVmxInterceptEvents(&pVCpu->cpum.GstCtx));
  • trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h

    r81665 r81786  
    360360        /*    20 */ RT_UOFFSETOF(VMXVVMCS, u32GuestSmBase),
    361361        /*    21 */ RT_UOFFSETOF(VMXVVMCS, u32GuestSysenterCS),
    362         /*    22 */ RT_UOFFSETOF(VMXVVMCS, u32PreemptTimer),
    363         /* 23-25 */ UINT16_MAX, UINT16_MAX, UINT16_MAX
     362        /*    22 */ UINT16_MAX,
     363        /*    23 */ RT_UOFFSETOF(VMXVVMCS, u32PreemptTimer),
     364        /* 24-25 */ UINT16_MAX, UINT16_MAX
    364365    },
    365366    /* VMX_VMCSFIELD_WIDTH_32BIT | VMX_VMCSFIELD_TYPE_HOST_STATE: */
     
    26042605
    26052606    /*
     2607     * Stop any running VMX-preemption timer if necessary.
     2608     */
     2609    if (pVmcs->u32PinCtls & VMX_PIN_CTLS_PREEMPT_TIMER)
     2610        CPUMStopGuestVmxPremptTimer(pVCpu);
     2611
     2612    /*
    26062613     * Clear any pending VMX nested-guest force-flags.
    2607      * These force-flags have no effect on guest execution and will
     2614     * These force-flags have no effect on (outer) guest execution and will
    26082615     * be re-evaluated and setup on the next nested-guest VM-entry.
    26092616     */
    2610     VMCPU_FF_CLEAR_MASK(pVCpu, VMCPU_FF_VMX_PREEMPT_TIMER
    2611                              | VMCPU_FF_VMX_MTF
    2612                              | VMCPU_FF_VMX_APIC_WRITE
    2613                              | VMCPU_FF_VMX_INT_WINDOW
    2614                              | VMCPU_FF_VMX_NMI_WINDOW);
     2617    VMCPU_FF_CLEAR_MASK(pVCpu, VMCPU_FF_VMX_ALL_MASK);
    26152618
    26162619    /* Restore the host (outer guest) state. */
     
    34773480    PVMXVVMCS pVmcs = pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pVmcs);
    34783481    Assert(pVmcs);
    3479 
    3480     /* The VM-exit is subject to "Activate VMX-preemption timer" being set. */
    3481     if (pVmcs->u32PinCtls & VMX_PIN_CTLS_PREEMPT_TIMER)
    3482     {
    3483         /* Import the hardware virtualization state (for nested-guest VM-entry TSC-tick). */
    3484         IEM_CTX_IMPORT_RET(pVCpu, CPUMCTX_EXTRN_HWVIRT);
    3485 
    3486         /*
    3487          * Calculate the current VMX-preemption timer value.
    3488          * Only if the value has reached zero, we cause the VM-exit.
    3489          */
    3490         uint32_t uPreemptTimer = iemVmxCalcPreemptTimer(pVCpu);
    3491         if (!uPreemptTimer)
    3492         {
    3493             /* Save the VMX-preemption timer value (of 0) back in to the VMCS if the CPU supports this feature. */
    3494             if (pVmcs->u32ExitCtls & VMX_EXIT_CTLS_SAVE_PREEMPT_TIMER)
    3495                 pVmcs->u32PreemptTimer = 0;
    3496 
    3497             /* Cause the VMX-preemption timer VM-exit. The Exit qualification MBZ. */
    3498             return iemVmxVmexit(pVCpu, VMX_EXIT_PREEMPT_TIMER, 0 /* u64ExitQual */);
    3499         }
    3500     }
    3501 
    3502     return VINF_VMX_INTERCEPT_NOT_ACTIVE;
     3482    Assert(VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_PREEMPT_TIMER));
     3483    Assert(pVmcs->u32PinCtls & VMX_PIN_CTLS_PREEMPT_TIMER);
     3484
     3485    /* Import the hardware virtualization state (for nested-guest VM-entry TSC-tick). */
     3486    IEM_CTX_IMPORT_RET(pVCpu, CPUMCTX_EXTRN_HWVIRT);
     3487
     3488    /* Save the VMX-preemption timer value (of 0) back in to the VMCS if the CPU supports this feature. */
     3489    if (pVmcs->u32ExitCtls & VMX_EXIT_CTLS_SAVE_PREEMPT_TIMER)
     3490        pVmcs->u32PreemptTimer = 0;
     3491
     3492    /* Cause the VMX-preemption timer VM-exit. The Exit qualification MBZ. */
     3493    return iemVmxVmexit(pVCpu, VMX_EXIT_PREEMPT_TIMER, 0 /* u64ExitQual */);
    35033494}
    35043495
     
    70857076    if (pVmcs->u32PinCtls & VMX_PIN_CTLS_PREEMPT_TIMER)
    70867077    {
    7087         uint64_t const uEntryTick = TMCpuTickGetNoCheck(pVCpu);
     7078        /*
     7079         * If the timer is 0, we must cause a VM-exit before executing the first
     7080         * nested-guest instruction. So we can flag as though the timer has already
     7081         * expired and we will check and cause a VM-exit at the right priority elsewhere
     7082         * in the code.
     7083         */
     7084        uint64_t uEntryTick;
     7085        uint32_t const uPreemptTimer = pVmcs->u32PreemptTimer;
     7086        if (uPreemptTimer)
     7087        {
     7088            int rc = CPUMStartGuestVmxPremptTimer(pVCpu, uPreemptTimer, VMX_V_PREEMPT_TIMER_SHIFT, &uEntryTick);
     7089            AssertRC(rc);
     7090            Log(("%s: VM-entry set up VMX-preemption timer at %#RX64\n", pszInstr, uEntryTick));
     7091        }
     7092        else
     7093        {
     7094            uEntryTick = TMCpuTickGetNoCheck(pVCpu);
     7095            VMCPU_FF_SET(pVCpu, VMCPU_FF_VMX_PREEMPT_TIMER);
     7096            Log(("%s: VM-entry set up VMX-preemption timer at %#RX64 to expire immediately!\n", pszInstr, uEntryTick));
     7097        }
     7098
    70887099        pVCpu->cpum.GstCtx.hwvirt.vmx.uEntryTick = uEntryTick;
    7089         VMCPU_FF_SET(pVCpu, VMCPU_FF_VMX_PREEMPT_TIMER);
    7090 
    7091         Log(("%s: VM-entry set up VMX-preemption timer at %#RX64\n", pszInstr, uEntryTick));
    70927100    }
    70937101    else
     
    72357243     * Any VMCS field which we do not establish on every VM-exit but may potentially
    72367244     * be used on the VM-exit path of a nested hypervisor -and- is not explicitly
    7237      * specified to be undefined needs to be initialized here.
     7245     * specified to be undefined, needs to be initialized here.
    72387246     *
    72397247     * Thus, it is especially important to clear the Exit qualification field
     
    75847592    Assert(uIndex <= VMX_V_VMCS_MAX_INDEX);
    75857593    uint16_t const offField   = g_aoffVmcsMap[uWidthType][uIndex];
    7586     Assert(offField < VMX_V_VMCS_SIZE);
     7594    AssertMsg(offField < VMX_V_VMCS_SIZE, ("%u field=%#RX64 uWidth=%#x uType=%#x uWidthType=%#x uIndex=%u\n", offField, u64VmcsField, uWidth, uType, uWidthType, uIndex));
    75877595    AssertCompile(VMX_V_SHADOW_VMCS_SIZE == VMX_V_VMCS_SIZE);
    75887596
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r81665 r81786  
    76647664 *         to the EM loop.
    76657665 *
    7666  * @param   pVCpu       The cross context virtual CPU structure.
    7667  * @param   fStepping   Whether we are single-stepping the guest using the
    7668  *                      hypervisor debugger.
     7666 * @param   pVCpu           The cross context virtual CPU structure.
     7667 * @param   pVmxTransient   The VMX-transient structure.
     7668 * @param   fStepping       Whether we are single-stepping the guest using the
     7669 *                          hypervisor debugger.
    76697670 *
    76707671 * @remarks This might cause nested-guest VM-exits, caller must check if the guest
    76717672 *          is no longer in VMX non-root mode.
    76727673 */
    7673 static VBOXSTRICTRC hmR0VmxCheckForceFlags(PVMCPUCC pVCpu, bool fStepping)
     7674static VBOXSTRICTRC hmR0VmxCheckForceFlags(PVMCPUCC pVCpu, PCVMXTRANSIENT pVmxTransient, bool fStepping)
    76747675{
    76757676    Assert(VMMRZCallRing3IsEnabled(pVCpu));
     
    77437744
    77447745#ifdef VBOX_WITH_NESTED_HWVIRT_VMX
    7745     /* Pending nested-guest APIC-write (has highest priority among nested-guest FFs). */
    7746     if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_APIC_WRITE))
    7747     {
    7748         Log4Func(("Pending nested-guest APIC-write\n"));
    7749         VBOXSTRICTRC rcStrict = IEMExecVmxVmexitApicWrite(pVCpu);
    7750         Assert(rcStrict != VINF_VMX_INTERCEPT_NOT_ACTIVE);
    7751         return rcStrict;
    7752     }
    7753     /** @todo VMCPU_FF_VMX_MTF, VMCPU_FF_VMX_PREEMPT_TIMER */
     7746    /*
     7747     * Pending nested-guest events.
     7748     *
     7749     * Please note the priority of these events are specified and important.
     7750     * See Intel spec. 29.4.3.2 "APIC-Write Emulation".
     7751     * See Intel spec. 6.9 "Priority Among Simultaneous Exceptions And Interrupts".
     7752     */
     7753    if (pVmxTransient->fIsNestedGuest)
     7754    {
     7755        /* Pending nested-guest APIC-write. */
     7756        if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_APIC_WRITE))
     7757        {
     7758            Log4Func(("Pending nested-guest APIC-write\n"));
     7759            VBOXSTRICTRC rcStrict = IEMExecVmxVmexitApicWrite(pVCpu);
     7760            Assert(rcStrict != VINF_VMX_INTERCEPT_NOT_ACTIVE);
     7761            return rcStrict;
     7762        }
     7763
     7764        /* Pending nested-guest monitor-trap flag (MTF). */
     7765        if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_MTF))
     7766        {
     7767            Log4Func(("Pending nested-guest MTF\n"));
     7768            VBOXSTRICTRC rcStrict = IEMExecVmxVmexit(pVCpu, VMX_EXIT_MTF, 0 /* uExitQual */);
     7769            Assert(rcStrict != VINF_VMX_INTERCEPT_NOT_ACTIVE);
     7770            return rcStrict;
     7771        }
     7772
     7773        /* Pending nested-guest VMX-preemption timer expired. */
     7774        if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_PREEMPT_TIMER))
     7775        {
     7776            Log4Func(("Pending nested-guest MTF\n"));
     7777            VBOXSTRICTRC rcStrict = IEMExecVmxVmexitPreemptTimer(pVCpu);
     7778            Assert(rcStrict != VINF_VMX_INTERCEPT_NOT_ACTIVE);
     7779            return rcStrict;
     7780        }
     7781    }
     7782#else
     7783    NOREF(pVmxTransient);
    77547784#endif
    77557785
     
    1024410274     * Check and process force flag actions, some of which might require us to go back to ring-3.
    1024510275     */
    10246     VBOXSTRICTRC rcStrict = hmR0VmxCheckForceFlags(pVCpu, fStepping);
     10276    VBOXSTRICTRC rcStrict = hmR0VmxCheckForceFlags(pVCpu, pVmxTransient, fStepping);
    1024710277    if (rcStrict == VINF_SUCCESS)
    1024810278    {
  • trunk/src/VBox/VMM/VMMR3/CPUM.cpp

    r81734 r81786  
    14041404    pCtx->hwvirt.vmx.fInVmxNonRootMode = false;
    14051405    /* Don't reset diagnostics here. */
     1406
     1407    /* Stop any VMX-preemption timer. */
     1408    CPUMStopGuestVmxPremptTimer(pVCpu);
     1409
     1410    /* Clear all nested-guest FFs. */
     1411    VMCPU_FF_CLEAR_MASK(pVCpu, VMCPU_FF_VMX_ALL_MASK);
    14061412}
    14071413
     
    18641870    EmuFeat.fVmxNmiExit               = 1;
    18651871    EmuFeat.fVmxVirtNmi               = 0;
    1866     EmuFeat.fVmxPreemptTimer          = 0;  /** @todo NSTVMX: enable this. */
     1872    EmuFeat.fVmxPreemptTimer          = 0;  /* Currently disabled on purpose, see @bugref{9180#c}. */
    18671873    EmuFeat.fVmxPostedInt             = 0;
    18681874    EmuFeat.fVmxIntWindowExit         = 1;
     
    19181924    EmuFeat.fVmxExitSaveEferMsr       = 1;
    19191925    EmuFeat.fVmxExitLoadEferMsr       = 1;
    1920     EmuFeat.fVmxSavePreemptTimer      = 0;
     1926    EmuFeat.fVmxSavePreemptTimer      = 0;  /* Cannot be enabled if VMX-preemption timer is disabled. */
    19211927    EmuFeat.fVmxExitSaveEferLma       = 1;  /* Cannot be disabled if unrestricted guest is enabled. */
    19221928    EmuFeat.fVmxIntelPt               = 0;
     
    19972003    pGuestFeat->fVmxEntryInjectSoftInt    = (pBaseFeat->fVmxEntryInjectSoftInt    & EmuFeat.fVmxEntryInjectSoftInt   );
    19982004
    1999     if (HMIsSubjectToVmxPreemptTimerErratum())
    2000     {
    2001         Log(("CPUM: VMX-preemption timer erratum detected. Cannot expose VMX-preemption timer feature to guests.\n"));
    2002         pGuestFeat->fVmxPreemptTimer = 0;
     2005    if (   !pVM->cpum.s.fNestedVmxPreemptTimer
     2006        || HMIsSubjectToVmxPreemptTimerErratum())
     2007    {
     2008        LogRel(("CPUM: Warning! VMX-preemption timer not exposed to guest due to forced CFGM setting or CPU erratum.\n"));
     2009        pGuestFeat->fVmxPreemptTimer     = 0;
     2010        pGuestFeat->fVmxSavePreemptTimer = 0;
    20032011    }
    20042012
     
    20842092
    20852093/**
     2094 * Callback that fires when the nested VMX-preemption timer expired.
     2095 *
     2096 * @param   pVM     The cross context VM structure.
     2097 * @param   pTimer  Pointer to timer.
     2098 * @param   pvUser  Opaque pointer to the virtual-CPU.
     2099 */
     2100static DECLCALLBACK(void) cpumR3VmxPreemptTimerCallback(PVM pVM, PTMTIMER pTimer, void *pvUser)
     2101{
     2102    RT_NOREF2(pVM, pTimer);
     2103    Assert(pvUser);
     2104
     2105    PVMCPU pVCpu = (PVMCPUR3)pvUser;
     2106    VMCPU_FF_SET(pVCpu, VMCPU_FF_VMX_PREEMPT_TIMER);
     2107}
     2108
     2109
     2110/**
    20862111 * Initializes the CPUM.
    20872112 *
     
    22432268     * This must be done after initializing CPUID/MSR features as we access the
    22442269     * the VMX/SVM guest features below.
     2270     *
     2271     * In the case of nested VT-x, we also need to create the per-VCPU
     2272     * VMX preemption timers.
    22452273     */
    22462274    if (pVM->cpum.s.GuestFeatures.fVmx)
     
    22952323
    22962324    if (pVM->cpum.s.GuestFeatures.fVmx)
     2325    {
     2326        for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++)
     2327        {
     2328            PVMCPU pVCpu = pVM->apCpusR3[idCpu];
     2329            int rc = TMR3TimerDestroy(pVCpu->cpum.s.pNestedVmxPreemptTimerR3); AssertRC(rc);
     2330            pVCpu->cpum.s.pNestedVmxPreemptTimerR0 = NIL_RTR0PTR;
     2331        }
     2332
    22972333        cpumR3FreeVmxHwVirtState(pVM);
     2334    }
    22982335    else if (pVM->cpum.s.GuestFeatures.fSvm)
    22992336        cpumR3FreeSvmHwVirtState(pVM);
     
    45094546            /* Register statistic counters for MSRs. */
    45104547            cpumR3MsrRegStats(pVM);
     4548
     4549            /* Create VMX-preemption timer for nested guests if required. */
     4550            if (pVM->cpum.s.GuestFeatures.fVmx)
     4551            {
     4552                for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++)
     4553                {
     4554                    PVMCPU pVCpu = pVM->apCpusR3[idCpu];
     4555                    int rc = TMR3TimerCreateInternal(pVM, TMCLOCK_VIRTUAL_SYNC, cpumR3VmxPreemptTimerCallback, pVCpu,
     4556                                                     "Nested Guest VMX-preempt. timer", &pVCpu->cpum.s.pNestedVmxPreemptTimerR3);
     4557                    AssertLogRelRCReturn(rc, rc);
     4558                    pVCpu->cpum.s.pNestedVmxPreemptTimerR0 = TMTimerR0Ptr(pVCpu->cpum.s.pNestedVmxPreemptTimerR3);
     4559                }
     4560            }
    45114561            break;
    45124562        }
  • trunk/src/VBox/VMM/VMMR3/CPUMR3CpuId.cpp

    r81613 r81786  
    41834183            pConfig->fNestedHWVirt = false;
    41844184        }
     4185
     4186        /** @cfgm{/CPUM/NestedVmxPreemptTimer, bool, true}
     4187         * Whether to expose the VMX-preemption timer feature to the guest (if also
     4188         * supported by the host hardware). The default is true, and when disabled will
     4189         * prevent exposing the VMX-preemption timer feature to the guest even if the host
     4190         * supports it.
     4191         */
     4192        rc = CFGMR3QueryBoolDef(pCpumCfg, "NestedVmxPreemptTimer", &pVM->cpum.s.fNestedVmxPreemptTimer, true);
     4193        AssertLogRelRCReturn(rc, rc);
    41854194    }
    41864195
  • trunk/src/VBox/VMM/VMMR3/EM.cpp

    r81766 r81786  
    18941894            {
    18951895                rc2 = VBOXSTRICTRC_VAL(IEMExecVmxVmexitPreemptTimer(pVCpu));
    1896                 if (rc2 != VINF_VMX_INTERCEPT_NOT_ACTIVE)
    1897                     UPDATE_RC();
     1896                Assert(rc2 != VINF_VMX_INTERCEPT_NOT_ACTIVE);
     1897                UPDATE_RC();
    18981898            }
    18991899        }
  • trunk/src/VBox/VMM/include/CPUMInternal.h

    r80191 r81786  
    364364    /** The host MXCSR mask (determined at init). */
    365365    uint32_t                fHostMxCsrMask;
    366     uint8_t                 abPadding1[20+8];
     366    /** Nested VMX: Whether to expose VMX-preemption timer to the guest. */
     367    bool                    fNestedVmxPreemptTimer;
     368    uint8_t                 abPadding1[3];
     369
     370    /** Align to 64-byte boundary. */
     371    uint8_t                 abPadding2[20+4];
    367372
    368373    /** Host CPU feature information.
     
    417422    CPUMCTXMSRS             GuestMsrs;
    418423
     424    /** Nested VMX: VMX-preemption timer - R0 ptr. */
     425    PTMTIMERR0              pNestedVmxPreemptTimerR0;
     426    /** Nested VMX: VMX-preemption timer - R3 ptr. */
     427    PTMTIMERR3              pNestedVmxPreemptTimerR3;
     428
    419429    /** Use flags.
    420430     * These flags indicates both what is to be used and what has been used.
     
    454464    bool                    fCpuIdApicFeatureVisible;
    455465
    456     /** Align the next member on a 64-byte boundrary. */
    457     uint8_t                 abPadding2[64 - 16 - 8 - 4 - 1 - 2 + 4];
     466    /** Align the next member on a 64-byte boundary. */
     467    uint8_t                 abPadding2[64 - (16 + 12 + 4 + 8 + 1 + 2)];
    458468
    459469    /** Saved host context.  Only valid while inside RC or HM contexts.
  • trunk/src/VBox/VMM/include/CPUMInternal.mac

    r80191 r81786  
    262262    ; Other stuff.
    263263    ;
     264    .pNestedVmxPreemptTimerR0   RTR0PTR_RES    1
     265    .pNestedVmxPreemptTimerR3   RTR3PTR_RES    1
     266
    264267    .fUseFlags            resd    1
    265268    .fChanged             resd    1
     
    274277%endif
    275278
    276     .fRemEntered          resb    1
    277     .fCpuIdApicFeatureVisible resb 1
    278 
    279     .abPadding2           resb    (64 - 16 - RTR0PTR_CB - 4 - 1 - 2 + 4)
     279    .fRemEntered                resb    1
     280    .fCpuIdApicFeatureVisible   resb    1
     281
     282    .abPadding2           resb    (64 - (RTR0PTR_CB + RTR3PTR_CB + 12 + 4 + RTR0PTR_CB + 1 + 2))
    280283
    281284    ;
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