VirtualBox

Changeset 91343 in vbox


Ignore:
Timestamp:
Sep 23, 2021 8:01:24 AM (3 years ago)
Author:
vboxsync
Message:

VMM/HM: Add tertiary processor-based VM-execution controls to VMCSINFO and some minor cleanups.

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

Legend:

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

    r91306 r91343  
    26612661    AssertRC(rc);
    26622662    AssertMsgReturnStmt(pVmcsInfo->u32EntryCtls == u32Val,
    2663                         ("%s controls mismatch: Cache=%#RX32 VMCS=%#RX32\n", pcszVmcs, pVmcsInfo->u32EntryCtls, u32Val),
     2663                        ("%s entry controls mismatch: Cache=%#RX32 VMCS=%#RX32\n", pcszVmcs, pVmcsInfo->u32EntryCtls, u32Val),
    26642664                        pVCpu->hm.s.u32HMError = VMX_VCI_CTRL_ENTRY,
    26652665                        VERR_VMX_VMCS_FIELD_CACHE_INVALID);
     
    26682668    AssertRC(rc);
    26692669    AssertMsgReturnStmt(pVmcsInfo->u32ExitCtls == u32Val,
    2670                         ("%s controls mismatch: Cache=%#RX32 VMCS=%#RX32\n", pcszVmcs, pVmcsInfo->u32ExitCtls, u32Val),
     2670                        ("%s exit controls mismatch: Cache=%#RX32 VMCS=%#RX32\n", pcszVmcs, pVmcsInfo->u32ExitCtls, u32Val),
    26712671                        pVCpu->hm.s.u32HMError = VMX_VCI_CTRL_EXIT,
    26722672                        VERR_VMX_VMCS_FIELD_CACHE_INVALID);
     
    26752675    AssertRC(rc);
    26762676    AssertMsgReturnStmt(pVmcsInfo->u32PinCtls == u32Val,
    2677                         ("%s controls mismatch: Cache=%#RX32 VMCS=%#RX32\n", pcszVmcs, pVmcsInfo->u32PinCtls, u32Val),
     2677                        ("%s pin controls mismatch: Cache=%#RX32 VMCS=%#RX32\n", pcszVmcs, pVmcsInfo->u32PinCtls, u32Val),
    26782678                        pVCpu->hm.s.u32HMError = VMX_VCI_CTRL_PIN_EXEC,
    26792679                        VERR_VMX_VMCS_FIELD_CACHE_INVALID);
     
    26822682    AssertRC(rc);
    26832683    AssertMsgReturnStmt(pVmcsInfo->u32ProcCtls == u32Val,
    2684                         ("%s controls mismatch: Cache=%#RX32 VMCS=%#RX32\n", pcszVmcs, pVmcsInfo->u32ProcCtls, u32Val),
     2684                        ("%s proc controls mismatch: Cache=%#RX32 VMCS=%#RX32\n", pcszVmcs, pVmcsInfo->u32ProcCtls, u32Val),
    26852685                        pVCpu->hm.s.u32HMError = VMX_VCI_CTRL_PROC_EXEC,
    26862686                        VERR_VMX_VMCS_FIELD_CACHE_INVALID);
     
    26912691        AssertRC(rc);
    26922692        AssertMsgReturnStmt(pVmcsInfo->u32ProcCtls2 == u32Val,
    2693                             ("%s controls mismatch: Cache=%#RX32 VMCS=%#RX32\n", pcszVmcs, pVmcsInfo->u32ProcCtls2, u32Val),
     2693                            ("%s proc2 controls mismatch: Cache=%#RX32 VMCS=%#RX32\n", pcszVmcs, pVmcsInfo->u32ProcCtls2, u32Val),
    26942694                            pVCpu->hm.s.u32HMError = VMX_VCI_CTRL_PROC_EXEC2,
     2695                            VERR_VMX_VMCS_FIELD_CACHE_INVALID);
     2696    }
     2697
     2698    uint64_t u64Val;
     2699    if (pVmcsInfo->u32ProcCtls & VMX_PROC_CTLS_USE_TERTIARY_CTLS)
     2700    {
     2701        rc = VMXReadVmcs64(VMX_VMCS64_CTRL_PROC_EXEC3_FULL, &u64Val);
     2702        AssertRC(rc);
     2703        AssertMsgReturnStmt(pVmcsInfo->u64ProcCtls3 == u64Val,
     2704                            ("%s proc3 controls mismatch: Cache=%#RX32 VMCS=%#RX64\n", pcszVmcs, pVmcsInfo->u64ProcCtls3, u64Val),
     2705                            pVCpu->hm.s.u32HMError = VMX_VCI_CTRL_PROC_EXEC3,
    26952706                            VERR_VMX_VMCS_FIELD_CACHE_INVALID);
    26962707    }
     
    27032714                        VERR_VMX_VMCS_FIELD_CACHE_INVALID);
    27042715
    2705     uint64_t u64Val;
    27062716    rc = VMXReadVmcs64(VMX_VMCS64_CTRL_TSC_OFFSET_FULL, &u64Val);
    27072717    AssertRC(rc);
  • trunk/src/VBox/VMM/VMMR3/HM.cpp

    r91342 r91343  
    501501     * Workaround for mesa vmsvga 3d driver making incorrect assumptions about
    502502     * the hypervisor it is running under. */
    503     bool f;
    504     rc = CFGMR3QueryBoolDef(pCfgHm, "LovelyMesaDrvWorkaround", &f, false);
     503    bool fMesaWorkaround;
     504    rc = CFGMR3QueryBoolDef(pCfgHm, "LovelyMesaDrvWorkaround", &fMesaWorkaround, false);
    505505    AssertLogRelRCReturn(rc, rc);
    506506    for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++)
    507507    {
    508508        PVMCPU pVCpu = pVM->apCpusR3[idCpu];
    509         pVCpu->hm.s.fTrapXcptGpForLovelyMesaDrv = f;
     509        pVCpu->hm.s.fTrapXcptGpForLovelyMesaDrv = fMesaWorkaround;
    510510    }
    511511
     
    591591            {
    592592                case VERR_UNSUPPORTED_CPU:          pszMsg = "Unknown CPU, VT-x or AMD-v features cannot be ascertained"; break;
    593                 case VERR_VMX_NO_VMX:               pszMsg = "VT-x is not available"; break;
    594                 case VERR_VMX_MSR_VMX_DISABLED:     pszMsg = "VT-x is disabled in the BIOS"; break;
    595                 case VERR_VMX_MSR_ALL_VMX_DISABLED: pszMsg = "VT-x is disabled in the BIOS for all CPU modes"; break;
    596                 case VERR_VMX_MSR_LOCKING_FAILED:   pszMsg = "Failed to enable and lock VT-x features"; break;
    597                 case VERR_SVM_NO_SVM:               pszMsg = "AMD-V is not available"; break;
    598                 case VERR_SVM_DISABLED:             pszMsg = "AMD-V is disabled in the BIOS (or by the host OS)"; break;
     593                case VERR_VMX_NO_VMX:               pszMsg = "VT-x is not available";                                     break;
     594                case VERR_VMX_MSR_VMX_DISABLED:     pszMsg = "VT-x is disabled in the BIOS";                              break;
     595                case VERR_VMX_MSR_ALL_VMX_DISABLED: pszMsg = "VT-x is disabled in the BIOS for all CPU modes";            break;
     596                case VERR_VMX_MSR_LOCKING_FAILED:   pszMsg = "Failed to enable and lock VT-x features";                   break;
     597                case VERR_SVM_NO_SVM:               pszMsg = "AMD-V is not available";                                    break;
     598                case VERR_SVM_DISABLED:             pszMsg = "AMD-V is disabled in the BIOS (or by the host OS)";         break;
    599599                default:
    600600                    return VMSetError(pVM, rc, RT_SRC_POS, "SUPR3QueryVTCaps failed with %Rrc", rc);
  • trunk/src/VBox/VMM/include/HMInternal.h

    r91323 r91343  
    909909    /** Secondary processor-based VM-execution controls. */
    910910    uint32_t                    u32ProcCtls2;
     911    /** Tertiary processor-based VM-execution controls. */
     912    uint64_t                    u64ProcCtls3;
    911913    /** VM-entry controls. */
    912914    uint32_t                    u32EntryCtls;
  • trunk/src/VBox/VMM/include/HMInternal.mac

    r87754 r91343  
    5454    .u32ProcCtls                    resd    1
    5555    .u32ProcCtls2                   resd    1
     56    .u64ProcCtls3                   resq    1
    5657    .u32EntryCtls                   resd    1
    5758    .u32ExitCtls                    resd    1
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