VirtualBox

Changeset 73726 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Aug 17, 2018 6:00:28 AM (6 years ago)
Author:
vboxsync
Message:

VMM/IEM: Nested VMX: bugref:9180 Check physical address limit on the VMXON region pointer better.

File:
1 edited

Legend:

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

    r73711 r73726  
    3131
    3232/**
    33  * Gets the ModR/M and displacement byte(s) from decoded opcodes given their
     33 * Gets the ModR/M, SIB and displacement byte(s) from decoded opcodes given their
    3434 * relative offsets.
    3535 */
     
    4343#  define IEM_DISP_GET_S32_SX_U64(a_pVCpu, a_u64Disp, a_offDisp)  do { } while (0)
    4444#  define IEM_DISP_GET_S8_SX_U64(a_pVCpu, a_u64Disp, a_offDisp)   do { } while (0)
    45 #  error "Implement me: Getting ModR/M, disp. has to work even when the instruction crosses a page boundary."
     45#  error "Implement me: Getting ModR/M, SIB, displacement needs to work even when instruction crosses a page boundary."
    4646# else  /* !IEM_WITH_CODE_TLB */
    4747#  define IEM_MODRM_GET_U8(a_pVCpu, a_bModRm, a_offModRm) \
     
    564564        }
    565565
     566        /* VMXON physical-address width limits. */
     567        Assert(!VMX_V_VMCS_PHYSADDR_4G_LIMIT);
     568        if (GCPhysVmxon >> IEM_GET_GUEST_CPU_FEATURES(pVCpu)->cMaxPhysAddrWidth)
     569        {
     570            Log(("vmxon: VMXON region pointer extends beyond physical-address width -> VMFailInvalid\n"));
     571            pVCpu->cpum.GstCtx.hwvirt.vmx.enmInstrDiag = kVmxVInstrDiag_Vmxon_PtrWidth;
     572            iemVmxVmFailInvalid(pVCpu);
     573            iemRegAddToRipAndClearRF(pVCpu, cbInstr);
     574            return VINF_SUCCESS;
     575        }
     576
    566577        /* Ensure VMXON region is not MMIO, ROM etc. This is not an Intel requirement but a
    567578           restriction imposed by our implementation. */
     
    583594            pVCpu->cpum.GstCtx.hwvirt.vmx.enmInstrDiag = kVmxVInstrDiag_Vmxon_PtrReadPhys;
    584595            return rc;
    585         }
    586 
    587         /* Physical-address width. */
    588         uint64_t const uMsrBasic = CPUMGetGuestIa32VmxBasic(pVCpu);
    589         if (   RT_BF_GET(uMsrBasic, VMX_BF_BASIC_PHYSADDR_WIDTH)
    590             && RT_HI_U32(GCPhysVmxon))
    591         {
    592             Log(("vmxon: VMXON region pointer extends beyond physical-address width -> VMFailInvalid\n"));
    593             pVCpu->cpum.GstCtx.hwvirt.vmx.enmInstrDiag = kVmxVInstrDiag_Vmxon_PtrWidth;
    594             iemVmxVmFailInvalid(pVCpu);
    595             iemRegAddToRipAndClearRF(pVCpu, cbInstr);
    596             return VINF_SUCCESS;
    597596        }
    598597
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