VirtualBox

Changeset 79764 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jul 14, 2019 4:13:40 AM (5 years ago)
Author:
vboxsync
Message:

VMM/HMVMXR0: Nested VMX: bugref:9180 Fix hmR0VmxRemoveProcCtlsVmcs (use the parameter rather than copy/paste bug hardcoding VMX_PROC_CTLS_RDTSC_EXIT). Added doxygen for hmR0VmxFixUnusableSegRegAttr.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r79760 r79764  
    974974static void hmR0VmxRemoveProcCtlsVmcs(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient, uint32_t uProcCtls)
    975975{
     976    PVMXVMCSINFO pVmcsInfo = pVmxTransient->pVmcsInfo;
     977    if (pVmcsInfo->u32ProcCtls & uProcCtls)
     978    {
    976979#ifdef VBOX_WITH_NESTED_HWVIRT_VMX
    977     bool const fRemoveCtls = !pVmxTransient->fIsNestedGuest
    978                            ? true
    979                            : !CPUMIsGuestVmxProcCtlsSet(pVCpu, &pVCpu->cpum.GstCtx, VMX_PROC_CTLS_RDTSC_EXIT);
     980        bool const fRemoveCtls = !pVmxTransient->fIsNestedGuest
     981                               ? true
     982                               : !CPUMIsGuestVmxProcCtlsSet(pVCpu, &pVCpu->cpum.GstCtx, uProcCtls);
    980983#else
    981     NOREF(pVCpu);
    982     bool const fRemoveCtls = true;
     984        NOREF(pVCpu);
     985        bool const fRemoveCtls = true;
    983986#endif
    984     PVMXVMCSINFO pVmcsInfo = pVmxTransient->pVmcsInfo;
    985     if (   fRemoveCtls
    986         && (pVmcsInfo->u32ProcCtls & uProcCtls))
    987     {
    988         pVmcsInfo->u32ProcCtls &= ~uProcCtls;
    989         int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pVmcsInfo->u32ProcCtls);
    990         AssertRC(rc);
     987        if (fRemoveCtls)
     988        {
     989            pVmcsInfo->u32ProcCtls &= ~uProcCtls;
     990            int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pVmcsInfo->u32ProcCtls);
     991            AssertRC(rc);
     992        }
    991993    }
    992994}
     
    77287730
    77297731
     7732/**
     7733 * Fixes up attributes for the specified segment register.
     7734 *
     7735 * @param   pVCpu       The cross context virtual CPU structure.
     7736 * @param   pSelReg     The segment register that needs fixing.
     7737 * @param   idxSel      The VMCS field for the corresponding segment register.
     7738 */
    77307739static void hmR0VmxFixUnusableSegRegAttr(PVMCPU pVCpu, PCPUMSELREG pSelReg, uint32_t idxSel)
    77317740{
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