VirtualBox

Changeset 55292 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 15, 2015 3:31:51 PM (10 years ago)
Author:
vboxsync
Message:

HM,CPUM,IEM: XSETBV fixes and adjustments.

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

Legend:

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

    r55289 r55292  
    21642164    {
    21652165        pVCpu->cpum.s.Guest.aXcr[0] = uNewValue;
    2166         pVCpu->cpum.s.Guest.fXStateMask = uNewValue;
     2166        pVCpu->cpum.s.Guest.fXStateMask |= uNewValue;
    21672167        return VINF_SUCCESS;
    21682168    }
  • trunk/src/VBox/VMM/VMMAll/IEMAll.cpp

    r55289 r55292  
    1101611016
    1101711017
     11018/**
     11019 * Macro used by the IEMExec* method to check the given instruction length.
     11020 *
     11021 * Will return on failure!
     11022 *
     11023 * @param   a_cbInstr   The given instruction length.
     11024 * @param   a_cbMin     The minimum length.
     11025 */
     11026#define IEMEXEC_ASSERT_INSTR_LEN_RETURN(a_cbInstr, a_cbMin) \
     11027    AssertMsgReturn((unsigned)(a_cbInstr) - (unsigned)(a_cbMin) <= (unsigned)15 - (unsigned)(a_cbMin), \
     11028                    ("cbInstr=%u cbMin=%u\n", (a_cbInstr), (a_cbMin)), VERR_IEM_INVALID_INSTR_LENGTH)
     11029
    1101811030
    1101911031/**
     
    1103711049{
    1103811050    AssertMsgReturn(iEffSeg < X86_SREG_COUNT, ("%#x\n", iEffSeg), VERR_IEM_INVALID_EFF_SEG);
    11039     AssertReturn(cbInstr - 1U <= 14U, VERR_IEM_INVALID_INSTR_LENGTH);
     11051    IEMEXEC_ASSERT_INSTR_LEN_RETURN(cbInstr, 1);
    1104011052
    1104111053    /*
     
    1115411166                                               bool fRepPrefix, uint8_t cbInstr)
    1115511167{
    11156     AssertReturn(cbInstr - 1U <= 14U, VERR_IEM_INVALID_INSTR_LENGTH);
     11168    IEMEXEC_ASSERT_INSTR_LEN_RETURN(cbInstr, 1);
    1115711169
    1115811170    /*
     
    1126711279VMM_INT_DECL(VBOXSTRICTRC) IEMExecDecodedMovCRxWrite(PVMCPU pVCpu, uint8_t cbInstr, uint8_t iCrReg, uint8_t iGReg)
    1126811280{
    11269     AssertReturn(cbInstr - 2U <= 15U - 2U, VERR_IEM_INVALID_INSTR_LENGTH);
     11281    IEMEXEC_ASSERT_INSTR_LEN_RETURN(cbInstr, 2);
    1127011282    Assert(iCrReg < 16);
    1127111283    Assert(iGReg < 16);
     
    1129111303VMM_INT_DECL(VBOXSTRICTRC) IEMExecDecodedMovCRxRead(PVMCPU pVCpu, uint8_t cbInstr, uint8_t iGReg, uint8_t iCrReg)
    1129211304{
    11293     AssertReturn(cbInstr - 2U <= 15U - 2U, VERR_IEM_INVALID_INSTR_LENGTH);
     11305    IEMEXEC_ASSERT_INSTR_LEN_RETURN(cbInstr, 2);
    1129411306    Assert(iCrReg < 16);
    1129511307    Assert(iGReg < 16);
     
    1131311325VMM_INT_DECL(VBOXSTRICTRC) IEMExecDecodedClts(PVMCPU pVCpu, uint8_t cbInstr)
    1131411326{
    11315     AssertReturn(cbInstr - 2U <= 15U - 2U, VERR_IEM_INVALID_INSTR_LENGTH);
     11327    IEMEXEC_ASSERT_INSTR_LEN_RETURN(cbInstr, 2);
    1131611328
    1131711329    PIEMCPU pIemCpu = &pVCpu->iem.s;
     
    1133411346VMM_INT_DECL(VBOXSTRICTRC) IEMExecDecodedLmsw(PVMCPU pVCpu, uint8_t cbInstr, uint16_t uValue)
    1133511347{
    11336     AssertReturn(cbInstr - 3U <= 15U - 3U, VERR_IEM_INVALID_INSTR_LENGTH);
     11348    IEMEXEC_ASSERT_INSTR_LEN_RETURN(cbInstr, 3);
    1133711349
    1133811350    PIEMCPU pIemCpu = &pVCpu->iem.s;
     
    1135711369VMM_INT_DECL(VBOXSTRICTRC) IEMExecDecodedXsetbv(PVMCPU pVCpu, uint8_t cbInstr)
    1135811370{
    11359     AssertReturn(cbInstr - 3U <= 15U - 3U, VERR_IEM_INVALID_INSTR_LENGTH);
     11371    IEMEXEC_ASSERT_INSTR_LEN_RETURN(cbInstr, 3);
    1136011372
    1136111373    PIEMCPU pIemCpu = &pVCpu->iem.s;
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r55290 r55292  
    1064210642    HMVMX_VALIDATE_EXIT_HANDLER_PARAMS();
    1064310643
    10644     int rc = hmR0VmxReadEntryInstrLenVmcs(pVmxTransient);
     10644    int rc = hmR0VmxReadExitInstrLenVmcs(pVmxTransient);
    1064510645    rc |= hmR0VmxSaveGuestRegsForIemExec(pVCpu, pMixedCtx, false /*fMemory*/, false /*fNeedRsp*/);
    1064610646    rc |= hmR0VmxSaveGuestCR4(pVCpu, pMixedCtx);
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