VirtualBox

Changeset 74061 in vbox for trunk/src


Ignore:
Timestamp:
Sep 4, 2018 9:43:57 AM (6 years ago)
Author:
vboxsync
Message:

VMM: Nested VMX: bugref:9180 vmlaunch/vmresume bits.

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

Legend:

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

    r74054 r74061  
    137137    VMX_INSTR_DIAG_DESC(kVmxVInstrDiag_Vmentry_Cpl                      , "Cpl"                     ),
    138138    VMX_INSTR_DIAG_DESC(kVmxVInstrDiag_Vmentry_Cr3TargetCount           , "Cr3TargetCount"          ),
     139    VMX_INSTR_DIAG_DESC(kVmxVInstrDiag_Vmentry_ExitCtlsAllowed1         , "ExitCtlsAllowed1"        ),
     140    VMX_INSTR_DIAG_DESC(kVmxVInstrDiag_Vmentry_ExitCtlsDisallowed0      , "ExitCtlsDisallowed0"     ),
    139141    VMX_INSTR_DIAG_DESC(kVmxVInstrDiag_Vmentry_LongModeCS               , "LongModeCS"              ),
    140142    VMX_INSTR_DIAG_DESC(kVmxVInstrDiag_Vmentry_NmiWindowExit            , "NmiWindowExit"           ),
     
    148150    VMX_INSTR_DIAG_DESC(kVmxVInstrDiag_Vmentry_PtrReadPhys              , "PtrReadPhys"             ),
    149151    VMX_INSTR_DIAG_DESC(kVmxVInstrDiag_Vmentry_RealOrV86Mode            , "RealOrV86Mode"           ),
     152    VMX_INSTR_DIAG_DESC(kVmxVInstrDiag_Vmentry_SavePreemptTimer         , "SavePreemptTimer"        ),
    150153    VMX_INSTR_DIAG_DESC(kVmxVInstrDiag_Vmentry_Success                  , "Success"                 ),
    151154    VMX_INSTR_DIAG_DESC(kVmxVInstrDiag_Vmentry_TprThreshold             , "TprThreshold"            ),
  • trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h

    r74055 r74061  
    434434 *
    435435 * @param   pVCpu           The cross context virtual CPU structure.
    436  * @param   uFieldEnc       The VMCS field encoding.
     436 * @param   u64FieldEnc     The VMCS field encoding.
    437437 *
    438438 * @remarks This takes into account the CPU features exposed to the guest.
    439439 */
    440 IEM_STATIC bool iemVmxIsVmcsFieldValid(PVMCPU pVCpu, uint32_t uFieldEnc)
    441 {
     440IEM_STATIC bool iemVmxIsVmcsFieldValid(PVMCPU pVCpu, uint64_t u64FieldEnc)
     441{
     442    uint32_t const uFieldEncHi = RT_HI_U32(u64FieldEnc);
     443    uint32_t const uFieldEncLo = RT_LO_U32(u64FieldEnc);
     444    if (!uFieldEncHi)
     445    { /* likely */ }
     446    else
     447        return false;
     448
    442449    PCCPUMFEATURES pFeat = IEM_GET_GUEST_CPU_FEATURES(pVCpu);
    443     switch (uFieldEnc)
     450    switch (uFieldEncLo)
    444451    {
    445452        /*
     
    11281135 * @param   pu64Dst         Where to write the VMCS value (only updated when
    11291136 *                          VINF_SUCCESS is returned).
    1130  * @param   uFieldEnc       The VMCS field encoding.
     1137 * @param   u64FieldEnc     The VMCS field encoding.
    11311138 * @param   pExitInfo       Pointer to the VM-exit information struct. Optional, can
    11321139 *                          be NULL.
    11331140 */
    1134 IEM_STATIC VBOXSTRICTRC iemVmxVmreadCommon(PVMCPU pVCpu, uint8_t cbInstr, uint64_t *pu64Dst, uint32_t uFieldEnc,
     1141IEM_STATIC VBOXSTRICTRC iemVmxVmreadCommon(PVMCPU pVCpu, uint8_t cbInstr, uint64_t *pu64Dst, uint64_t u64FieldEnc,
    11351142                                           PCVMXVEXITINFO pExitInfo)
    11361143{
     
    11731180
    11741181    /* Supported VMCS field. */
    1175     if (!iemVmxIsVmcsFieldValid(pVCpu, uFieldEnc))
    1176     {
    1177         Log(("vmread: VMCS field %#x invalid -> VMFail\n", uFieldEnc));
     1182    if (iemVmxIsVmcsFieldValid(pVCpu, u64FieldEnc))
     1183    {
     1184        Log(("vmread: VMCS field %#RX64 invalid -> VMFail\n", u64FieldEnc));
    11781185        pVCpu->cpum.GstCtx.hwvirt.vmx.enmInstrDiag = kVmxVInstrDiag_Vmread_FieldInvalid;
    11791186        iemVmxVmFail(pVCpu, VMXINSTRERR_VMREAD_INVALID_COMPONENT);
     
    11921199    Assert(pbVmcs);
    11931200
    1194     PCVMXVMCSFIELDENC pFieldEnc = (PCVMXVMCSFIELDENC)&uFieldEnc;
    1195     uint8_t  const uWidth     = pFieldEnc->n.u2Width;
    1196     uint8_t  const uType      = pFieldEnc->n.u2Type;
     1201    VMXVMCSFIELDENC FieldEnc;
     1202    FieldEnc.u = RT_LO_U32(u64FieldEnc);
     1203    uint8_t  const uWidth     = FieldEnc.n.u2Width;
     1204    uint8_t  const uType      = FieldEnc.n.u2Type;
    11971205    uint8_t  const uWidthType = (uWidth << 2) | uType;
    1198     uint8_t  const uIndex     = pFieldEnc->n.u8Index;
     1206    uint8_t  const uIndex     = FieldEnc.n.u8Index;
    11991207    AssertRCReturn(uIndex <= VMX_V_VMCS_MAX_INDEX, VERR_IEM_IPE_2);
    1200     uint16_t const offField  = g_aoffVmcsMap[uWidthType][uIndex];
     1208    uint16_t const offField   = g_aoffVmcsMap[uWidthType][uIndex];
    12011209
    12021210    /*
     
    12111219     */
    12121220    uint8_t      *pbField = pbVmcs + offField;
    1213     uint8_t const uEffWidth = HMVmxGetVmcsFieldWidthEff(uFieldEnc);
     1221    uint8_t const uEffWidth = HMVmxGetVmcsFieldWidthEff(FieldEnc.u);
    12141222    switch (uEffWidth)
    12151223    {
     
    12291237 * @param   cbInstr         The instruction length.
    12301238 * @param   pu64Dst         Where to store the VMCS field's value.
    1231  * @param   uFieldEnc       The VMCS field encoding.
     1239 * @param   u64FieldEnc     The VMCS field encoding.
    12321240 * @param   pExitInfo       Pointer to the VM-exit information struct. Optional, can
    12331241 *                          be NULL.
    12341242 */
    1235 IEM_STATIC VBOXSTRICTRC iemVmxVmreadReg64(PVMCPU pVCpu, uint8_t cbInstr, uint64_t *pu64Dst, uint32_t uFieldEnc,
     1243IEM_STATIC VBOXSTRICTRC iemVmxVmreadReg64(PVMCPU pVCpu, uint8_t cbInstr, uint64_t *pu64Dst, uint64_t u64FieldEnc,
    12361244                                          PCVMXVEXITINFO pExitInfo)
    12371245{
    1238     VBOXSTRICTRC rcStrict = iemVmxVmreadCommon(pVCpu, cbInstr, pu64Dst, uFieldEnc, pExitInfo);
     1246    VBOXSTRICTRC rcStrict = iemVmxVmreadCommon(pVCpu, cbInstr, pu64Dst, u64FieldEnc, pExitInfo);
    12391247    if (rcStrict == VINF_SUCCESS)
    12401248    {
     
    12541262 * @param   cbInstr         The instruction length.
    12551263 * @param   pu32Dst         Where to store the VMCS field's value.
    1256  * @param   uFieldEnc       The VMCS field encoding.
     1264 * @param   u32FieldEnc     The VMCS field encoding.
    12571265 * @param   pExitInfo       Pointer to the VM-exit information struct. Optional, can
    12581266 *                          be NULL.
    12591267 */
    1260 IEM_STATIC VBOXSTRICTRC iemVmxVmreadReg32(PVMCPU pVCpu, uint8_t cbInstr, uint32_t *pu32Dst, uint32_t uFieldEnc,
     1268IEM_STATIC VBOXSTRICTRC iemVmxVmreadReg32(PVMCPU pVCpu, uint8_t cbInstr, uint32_t *pu32Dst, uint64_t u32FieldEnc,
    12611269                                          PCVMXVEXITINFO pExitInfo)
    12621270{
    12631271    uint64_t u64Dst;
    1264     VBOXSTRICTRC rcStrict = iemVmxVmreadCommon(pVCpu, cbInstr, &u64Dst, uFieldEnc, pExitInfo);
     1272    VBOXSTRICTRC rcStrict = iemVmxVmreadCommon(pVCpu, cbInstr, &u64Dst, u32FieldEnc, pExitInfo);
    12651273    if (rcStrict == VINF_SUCCESS)
    12661274    {
     
    12861294 * @param   GCPtrDst        The guest linear address to store the VMCS field's
    12871295 *                          value.
    1288  * @param   uFieldEnc       The VMCS field encoding.
     1296 * @param   u64FieldEnc     The VMCS field encoding.
    12891297 * @param   pExitInfo       Pointer to the VM-exit information struct. Optional, can
    12901298 *                          be NULL.
    12911299 */
    12921300IEM_STATIC VBOXSTRICTRC iemVmxVmreadMem(PVMCPU pVCpu, uint8_t cbInstr, uint8_t iEffSeg, IEMMODE enmEffAddrMode,
    1293                                         RTGCPTR GCPtrDst, uint32_t uFieldEnc, PCVMXVEXITINFO pExitInfo)
     1301                                        RTGCPTR GCPtrDst, uint64_t u64FieldEnc, PCVMXVEXITINFO pExitInfo)
    12941302{
    12951303    uint64_t u64Dst;
    1296     VBOXSTRICTRC rcStrict = iemVmxVmreadCommon(pVCpu, cbInstr, &u64Dst, uFieldEnc, pExitInfo);
     1304    VBOXSTRICTRC rcStrict = iemVmxVmreadCommon(pVCpu, cbInstr, &u64Dst, u64FieldEnc, pExitInfo);
    12971305    if (rcStrict == VINF_SUCCESS)
    12981306    {
     
    13391347 *                          value), @a iEffSeg will indicate if it's a memory
    13401348 *                          operand.
    1341  * @param   uFieldEnc       The VMCS field encoding.
     1349 * @param   u64FieldEnc     The VMCS field encoding.
    13421350 * @param   pExitInfo       Pointer to the VM-exit information struct. Optional, can
    13431351 *                          be NULL.
    13441352 */
    13451353IEM_STATIC VBOXSTRICTRC iemVmxVmwrite(PVMCPU pVCpu, uint8_t cbInstr, uint8_t iEffSeg, IEMMODE enmEffAddrMode, uint64_t u64Val,
    1346                                       uint32_t uFieldEnc, PCVMXVEXITINFO pExitInfo)
     1354                                      uint64_t u64FieldEnc, PCVMXVEXITINFO pExitInfo)
    13471355{
    13481356    if (IEM_IS_VMX_NON_ROOT_MODE(pVCpu))
     
    14121420
    14131421    /* Supported VMCS field. */
    1414     if (!iemVmxIsVmcsFieldValid(pVCpu, uFieldEnc))
    1415     {
    1416         Log(("vmwrite: VMCS field %#x invalid -> VMFail\n", uFieldEnc));
     1422    if (!iemVmxIsVmcsFieldValid(pVCpu, u64FieldEnc))
     1423    {
     1424        Log(("vmwrite: VMCS field %#RX64 invalid -> VMFail\n", u64FieldEnc));
    14171425        pVCpu->cpum.GstCtx.hwvirt.vmx.enmInstrDiag = kVmxVInstrDiag_Vmwrite_FieldInvalid;
    14181426        iemVmxVmFail(pVCpu, VMXINSTRERR_VMWRITE_INVALID_COMPONENT);
     
    14221430
    14231431    /* Read-only VMCS field. */
    1424     bool const fReadOnlyField = HMVmxIsVmcsFieldReadOnly(uFieldEnc);
     1432    bool const fReadOnlyField = HMVmxIsVmcsFieldReadOnly(u64FieldEnc);
    14251433    if (   fReadOnlyField
    14261434        && !IEM_GET_GUEST_CPU_FEATURES(pVCpu)->fVmxVmwriteAll)
    14271435    {
    1428         Log(("vmwrite: Write to read-only VMCS component %#x -> VMFail\n", uFieldEnc));
     1436        Log(("vmwrite: Write to read-only VMCS component %#RX64 -> VMFail\n", u64FieldEnc));
    14291437        pVCpu->cpum.GstCtx.hwvirt.vmx.enmInstrDiag = kVmxVInstrDiag_Vmwrite_FieldRo;
    14301438        iemVmxVmFail(pVCpu, VMXINSTRERR_VMWRITE_RO_COMPONENT);
     
    14431451    Assert(pbVmcs);
    14441452
    1445     PCVMXVMCSFIELDENC pFieldEnc = (PCVMXVMCSFIELDENC)&uFieldEnc;
    1446     uint8_t  const uWidth     = pFieldEnc->n.u2Width;
    1447     uint8_t  const uType      = pFieldEnc->n.u2Type;
     1453    VMXVMCSFIELDENC FieldEnc;
     1454    FieldEnc.u = RT_LO_U32(u64FieldEnc);
     1455    uint8_t  const uWidth     = FieldEnc.n.u2Width;
     1456    uint8_t  const uType      = FieldEnc.n.u2Type;
    14481457    uint8_t  const uWidthType = (uWidth << 2) | uType;
    1449     uint8_t  const uIndex     = pFieldEnc->n.u8Index;
     1458    uint8_t  const uIndex     = FieldEnc.n.u8Index;
    14501459    AssertRCReturn(uIndex <= VMX_V_VMCS_MAX_INDEX, VERR_IEM_IPE_2);
    1451     uint16_t const offField  = g_aoffVmcsMap[uWidthType][uIndex];
     1460    uint16_t const offField   = g_aoffVmcsMap[uWidthType][uIndex];
    14521461
    14531462    /*
     
    14581467     */
    14591468    uint8_t      *pbField = pbVmcs + offField;
    1460     uint8_t const uEffWidth = HMVmxGetVmcsFieldWidthEff(uFieldEnc);
     1469    uint8_t const uEffWidth = HMVmxGetVmcsFieldWidthEff(FieldEnc.u);
    14611470    switch (uEffWidth)
    14621471    {
     
    19491958
    19501959/**
    1951  * Checks VM-execution controls fields as part of VM-entry.
     1960 * Checks VM-exit controls fields as part of VM-entry.
     1961 * See Intel spec. 26.2.1.2 "VM-Exit Control Fields".
    19521962 *
    19531963 * @returns VBox status code.
     
    19551965 * @param   pszInstr        The VMX instruction name (for logging purposes).
    19561966 */
     1967IEM_STATIC VBOXSTRICTRC iemVmxVmentryCheckExitCtls(PVMCPU pVCpu, const char *pszInstr)
     1968{
     1969    PCVMXVVMCS pVmcs = pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pVmcs);
     1970
     1971    /* VM-exit controls. */
     1972    VMXCTLSMSR ExitCtls;
     1973    ExitCtls.u = CPUMGetGuestIa32VmxExitCtls(pVCpu);
     1974    if (~pVmcs->u32ExitCtls & ExitCtls.n.disallowed0)
     1975    {
     1976        Log(("%s: Invalid ExitCtls %#RX32 (disallowed0) -> VMFail\n", pszInstr, pVmcs->u32ExitCtls));
     1977        pVCpu->cpum.GstCtx.hwvirt.vmx.enmInstrDiag = kVmxVInstrDiag_Vmentry_ExitCtlsDisallowed0;
     1978        return VERR_VMX_VMENTRY_FAILED;
     1979    }
     1980    if (pVmcs->u32ExitCtls & ~ExitCtls.n.allowed1)
     1981    {
     1982        Log(("%s: Invalid ExitCtls %#RX32 (allowed1) -> VMFail\n", pszInstr, pVmcs->u32ExitCtls));
     1983        pVCpu->cpum.GstCtx.hwvirt.vmx.enmInstrDiag = kVmxVInstrDiag_Vmentry_ExitCtlsAllowed1;
     1984        return VERR_VMX_VMENTRY_FAILED;
     1985    }
     1986
     1987    /* Save preemption timer without activating it. */
     1988    if (   !(pVmcs->u32PinCtls & VMX_PIN_CTLS_PREEMPT_TIMER)
     1989        && (pVmcs->u32ProcCtls & VMX_EXIT_CTLS_SAVE_PREEMPT_TIMER))
     1990    {
     1991        Log(("%s: Save Preempt-Timer without activate Preempt timer -> VMFail\n", pszInstr, pVmcs->u32ExitCtls));
     1992        pVCpu->cpum.GstCtx.hwvirt.vmx.enmInstrDiag = kVmxVInstrDiag_Vmentry_SavePreemptTimer;
     1993        return VERR_VMX_VMENTRY_FAILED;
     1994    }
     1995
     1996    /** @todo NSTVMX: rest of exit ctls. */
     1997
     1998    NOREF(pszInstr);
     1999    return VINF_SUCCESS;
     2000}
     2001
     2002
     2003/**
     2004 * Checks VM-execution controls fields as part of VM-entry.
     2005 * See Intel spec. 26.2.1.1 "VM-Execution Control Fields".
     2006 *
     2007 * @returns VBox status code.
     2008 * @param   pVCpu           The cross context virtual CPU structure.
     2009 * @param   pszInstr        The VMX instruction name (for logging purposes).
     2010 */
    19572011IEM_STATIC VBOXSTRICTRC iemVmxVmentryCheckExecCtls(PVMCPU pVCpu, const char *pszInstr)
    19582012{
    1959     /*
    1960      * Check VM-execution controls.
    1961      * See Intel spec. 26.2.1.1 "VM-Execution Control Fields".
    1962      */
    19632013    PVMXVVMCS pVmcs = pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pVmcs);
    1964 
    19652014    /* Pin-based VM-execution controls. */
    19662015    {
     
    22312280        }
    22322281
    2233         /** @todo NSTVMX: Read VMREAD-bitmap, VMWRITE-bitmap. */
     2282        /* Read the VMREAD-bitmap. */
     2283        int rc = PGMPhysSimpleReadGCPhys(pVCpu->CTX_SUFF(pVM), pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pvVmreadBitmap),
     2284                                         GCPhysVmreadBitmap, VMX_V_VMREAD_VMWRITE_BITMAP_SIZE);
     2285        if (RT_FAILURE(rc))
     2286        {
     2287            Log(("%s: Failed to read VMREAD-bitmap at %#RGp, rc=%Rrc\n", pszInstr, GCPhysVmreadBitmap, rc));
     2288            pVCpu->cpum.GstCtx.hwvirt.vmx.enmInstrDiag = kVmxVInstrDiag_Vmentry_VmreadBitmapPtrReadPhys;
     2289            return rc;
     2290        }
     2291
     2292        /* Read the VMWRITE-bitmap. */
     2293        rc = PGMPhysSimpleReadGCPhys(pVCpu->CTX_SUFF(pVM), pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pvVmwriteBitmap),
     2294                                     GCPhysVmwriteBitmap, VMX_V_VMREAD_VMWRITE_BITMAP_SIZE);
     2295        if (RT_FAILURE(rc))
     2296        {
     2297            Log(("%s: Failed to read VMWRITE-bitmap at %#RGp, rc=%Rrc\n", pszInstr, GCPhysVmwriteBitmap, rc));
     2298            pVCpu->cpum.GstCtx.hwvirt.vmx.enmInstrDiag = kVmxVInstrDiag_Vmentry_VmwriteBitmapPtrReadPhys;
     2299            return rc;
     2300        }
    22342301    }
    22352302
     
    23452412    }
    23462413
    2347 #if 0
    23482414    /*
    23492415     * Check VM-exit fields.
     
    23582424        return VINF_SUCCESS;
    23592425    }
    2360 #endif
    23612426
    23622427    pVCpu->cpum.GstCtx.hwvirt.vmx.enmInstrDiag = kVmxVInstrDiag_Vmentry_Success;
     
    24812546 * Implements 'VMWRITE' register.
    24822547 */
    2483 IEM_CIMPL_DEF_2(iemCImpl_vmwrite_reg, uint64_t, u64Val, uint32_t, uFieldEnc)
    2484 {
    2485     return iemVmxVmwrite(pVCpu, cbInstr, UINT8_MAX /* iEffSeg */, IEMMODE_64BIT /* N/A */, u64Val, uFieldEnc,
     2548IEM_CIMPL_DEF_2(iemCImpl_vmwrite_reg, uint64_t, u64Val, uint64_t, u64FieldEnc)
     2549{
     2550    return iemVmxVmwrite(pVCpu, cbInstr, UINT8_MAX /* iEffSeg */, IEMMODE_64BIT /* N/A */, u64Val, u64FieldEnc,
    24862551                         NULL /* pExitInfo */);
    24872552}
     
    24912556 * Implements 'VMWRITE' memory.
    24922557 */
    2493 IEM_CIMPL_DEF_4(iemCImpl_vmwrite_mem, uint8_t, iEffSeg, IEMMODE, enmEffAddrMode, RTGCPTR, GCPtrVal, uint32_t, uFieldEnc)
    2494 {
    2495     return iemVmxVmwrite(pVCpu, cbInstr, iEffSeg, enmEffAddrMode, GCPtrVal, uFieldEnc,  NULL /* pExitInfo */);
     2558IEM_CIMPL_DEF_4(iemCImpl_vmwrite_mem, uint8_t, iEffSeg, IEMMODE, enmEffAddrMode, RTGCPTR, GCPtrVal, uint32_t, u64FieldEnc)
     2559{
     2560    return iemVmxVmwrite(pVCpu, cbInstr, iEffSeg, enmEffAddrMode, GCPtrVal, u64FieldEnc,  NULL /* pExitInfo */);
    24962561}
    24972562
     
    25002565 * Implements 'VMREAD' 64-bit register.
    25012566 */
    2502 IEM_CIMPL_DEF_2(iemCImpl_vmread64_reg, uint64_t *, pu64Dst, uint32_t, uFieldEnc)
    2503 {
    2504     return iemVmxVmreadReg64(pVCpu, cbInstr, pu64Dst, uFieldEnc, NULL /* pExitInfo */);
     2567IEM_CIMPL_DEF_2(iemCImpl_vmread64_reg, uint64_t *, pu64Dst, uint64_t, u64FieldEnc)
     2568{
     2569    return iemVmxVmreadReg64(pVCpu, cbInstr, pu64Dst, u64FieldEnc, NULL /* pExitInfo */);
    25052570}
    25062571
     
    25092574 * Implements 'VMREAD' 32-bit register.
    25102575 */
    2511 IEM_CIMPL_DEF_2(iemCImpl_vmread32_reg, uint32_t *, pu32Dst, uint32_t, uFieldEnc)
    2512 {
    2513     return iemVmxVmreadReg32(pVCpu, cbInstr, pu32Dst, uFieldEnc, NULL /* pExitInfo */);
     2576IEM_CIMPL_DEF_2(iemCImpl_vmread32_reg, uint32_t *, pu32Dst, uint32_t, u32FieldEnc)
     2577{
     2578    return iemVmxVmreadReg32(pVCpu, cbInstr, pu32Dst, u32FieldEnc, NULL /* pExitInfo */);
    25142579}
    25152580
     
    25182583 * Implements 'VMREAD' memory.
    25192584 */
    2520 IEM_CIMPL_DEF_4(iemCImpl_vmread_mem, uint8_t, iEffSeg, IEMMODE, enmEffAddrMode, RTGCPTR, GCPtrDst, uint32_t, uFieldEnc)
    2521 {
    2522     return iemVmxVmreadMem(pVCpu, cbInstr, iEffSeg, enmEffAddrMode, GCPtrDst, uFieldEnc, NULL /* pExitInfo */);
     2585IEM_CIMPL_DEF_4(iemCImpl_vmread_mem, uint8_t, iEffSeg, IEMMODE, enmEffAddrMode, RTGCPTR, GCPtrDst, uint32_t, u64FieldEnc)
     2586{
     2587    return iemVmxVmreadMem(pVCpu, cbInstr, iEffSeg, enmEffAddrMode, GCPtrDst, u64FieldEnc, NULL /* pExitInfo */);
    25232588}
    25242589
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r74047 r74061  
    33783378        /* Enable saving of the VMX preemption timer value on VM-exit. */
    33793379        if (    pVM->hm.s.vmx.fUsePreemptTimer
    3380             && (pVM->hm.s.vmx.Msrs.ExitCtls.n.allowed1 & VMX_EXIT_CTLS_SAVE_VMX_PREEMPT_TIMER))
    3381             fVal |= VMX_EXIT_CTLS_SAVE_VMX_PREEMPT_TIMER;
     3380            && (pVM->hm.s.vmx.Msrs.ExitCtls.n.allowed1 & VMX_EXIT_CTLS_SAVE_PREEMPT_TIMER))
     3381            fVal |= VMX_EXIT_CTLS_SAVE_PREEMPT_TIMER;
    33823382
    33833383        if ((fVal & fZap) != fVal)
  • trunk/src/VBox/VMM/VMMR3/CPUM.cpp

    r74054 r74061  
    921921            pVCpu->cpum.s.Guest.hwvirt.vmx.pvVirtApicPageR3 = NULL;
    922922        }
     923        if (pVCpu->cpum.s.Guest.hwvirt.vmx.pvVmreadBitmapR3)
     924        {
     925            SUPR3PageFreeEx(pVCpu->cpum.s.Guest.hwvirt.vmx.pvVmreadBitmapR3, VMX_V_VMREAD_VMWRITE_BITMAP_PAGES);
     926            pVCpu->cpum.s.Guest.hwvirt.vmx.pvVmreadBitmapR3 = NULL;
     927        }
     928        if (pVCpu->cpum.s.Guest.hwvirt.vmx.pvVmwriteBitmapR3)
     929        {
     930            SUPR3PageFreeEx(pVCpu->cpum.s.Guest.hwvirt.vmx.pvVmwriteBitmapR3, VMX_V_VMREAD_VMWRITE_BITMAP_PAGES);
     931            pVCpu->cpum.s.Guest.hwvirt.vmx.pvVmwriteBitmapR3 = NULL;
     932        }
    923933    }
    924934}
     
    967977            LogRel(("CPUM%u: Failed to alloc %u pages for the nested-guest's Virtual-APIC page\n", pVCpu->idCpu,
    968978                    VMX_V_VIRT_APIC_PAGES));
     979            break;
     980        }
     981
     982        /*
     983         * Allocate the VMREAD-bitmap.
     984         */
     985        Assert(!pVCpu->cpum.s.Guest.hwvirt.vmx.pvVmreadBitmapR3);
     986        rc = SUPR3PageAllocEx(VMX_V_VMREAD_VMWRITE_BITMAP_PAGES, 0 /* fFlags */, &pVCpu->cpum.s.Guest.hwvirt.vmx.pvVmreadBitmapR3,
     987                              &pVCpu->cpum.s.Guest.hwvirt.vmx.pvVmreadBitmapR0, NULL /* paPages */);
     988        if (RT_FAILURE(rc))
     989        {
     990            Assert(!pVCpu->cpum.s.Guest.hwvirt.vmx.pvVmreadBitmapR3);
     991            LogRel(("CPUM%u: Failed to alloc %u pages for the nested-guest's VMREAD-bitmap\n", pVCpu->idCpu,
     992                    VMX_V_VMREAD_VMWRITE_BITMAP_PAGES));
     993            break;
     994        }
     995
     996        /*
     997         * Allocatge the VMWRITE-bitmap.
     998         */
     999        Assert(!pVCpu->cpum.s.Guest.hwvirt.vmx.pvVmwriteBitmapR3);
     1000        rc = SUPR3PageAllocEx(VMX_V_VMREAD_VMWRITE_BITMAP_PAGES, 0 /* fFlags */,
     1001                              &pVCpu->cpum.s.Guest.hwvirt.vmx.pvVmwriteBitmapR3,
     1002                              &pVCpu->cpum.s.Guest.hwvirt.vmx.pvVmwriteBitmapR0, NULL /* paPages */);
     1003        if (RT_FAILURE(rc))
     1004        {
     1005            Assert(!pVCpu->cpum.s.Guest.hwvirt.vmx.pvVmwriteBitmapR3);
     1006            LogRel(("CPUM%u: Failed to alloc %u pages for the nested-guest's VMWRITE-bitmap\n", pVCpu->idCpu,
     1007                    VMX_V_VMREAD_VMWRITE_BITMAP_PAGES));
    9691008            break;
    9701009        }
     
    11731212        pHostFeat->fVmxExitSaveEferMsr       = RT_BOOL(fExitCtls & VMX_EXIT_CTLS_SAVE_EFER_MSR);
    11741213        pHostFeat->fVmxExitLoadEferMsr       = RT_BOOL(fExitCtls & VMX_EXIT_CTLS_LOAD_EFER_MSR);
    1175         pHostFeat->fVmxSavePreemptTimer      = RT_BOOL(fExitCtls & VMX_EXIT_CTLS_SAVE_VMX_PREEMPT_TIMER);
     1214        pHostFeat->fVmxSavePreemptTimer      = RT_BOOL(fExitCtls & VMX_EXIT_CTLS_SAVE_PREEMPT_TIMER);
    11761215
    11771216        /* Miscellaneous data. */
  • trunk/src/VBox/VMM/VMMR3/HM.cpp

    r74054 r74061  
    15521552    HMVMX_REPORT_FEAT(val, zap, "SAVE_EFER_MSR",          VMX_EXIT_CTLS_SAVE_EFER_MSR);
    15531553    HMVMX_REPORT_FEAT(val, zap, "LOAD_EFER_MSR",          VMX_EXIT_CTLS_LOAD_EFER_MSR);
    1554     HMVMX_REPORT_FEAT(val, zap, "SAVE_VMX_PREEMPT_TIMER", VMX_EXIT_CTLS_SAVE_VMX_PREEMPT_TIMER);
     1554    HMVMX_REPORT_FEAT(val, zap, "SAVE_PREEMPT_TIMER",     VMX_EXIT_CTLS_SAVE_PREEMPT_TIMER);
    15551555}
    15561556
     
    31723172                        HMVMX_LOGREL_FEAT(u32Val, VMX_EXIT_CTLS_SAVE_EFER_MSR         );
    31733173                        HMVMX_LOGREL_FEAT(u32Val, VMX_EXIT_CTLS_LOAD_EFER_MSR         );
    3174                         HMVMX_LOGREL_FEAT(u32Val, VMX_EXIT_CTLS_SAVE_VMX_PREEMPT_TIMER);
     3174                        HMVMX_LOGREL_FEAT(u32Val, VMX_EXIT_CTLS_SAVE_PREEMPT_TIMER    );
    31753175                    }
    31763176                    LogRel(("HM: CPU[%u] HCPhysMsrBitmap  %#RHp\n",  i, pVCpu->hm.s.vmx.HCPhysMsrBitmap));
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