VirtualBox

Changeset 15181 in vbox


Ignore:
Timestamp:
Dec 9, 2008 2:52:36 PM (16 years ago)
Author:
vboxsync
Message:

Restrict instruction emulation for 64 bits guests on 32 bits hosts.

File:
1 edited

Legend:

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

    r15161 r15181  
    707707{
    708708    OP_PARAMVAL param1, param2;
     709
    709710    int rc = DISQueryParamVal(pRegFrame, pCpu, &pCpu->param1, &param1, PARAM_DEST);
    710711    if(RT_FAILURE(rc))
     
    801802{
    802803    void *pvParam1;
    803 
    804804    OP_PARAMVAL param1, param2;
     805
     806#ifdef HC_ARCH_BITS == 32
     807    Assert(pCpu->param1.size <= 4);
     808#endif
     809
    805810    int rc = DISQueryParamVal(pRegFrame, pCpu, &pCpu->param1, &param1, PARAM_DEST);
    806811    if(RT_FAILURE(rc))
     
    14101415{
    14111416    OP_PARAMVAL param1, param2;
     1417
     1418#ifdef HC_ARCH_BITS == 32
     1419    Assert(pCpu->param1.size <= 4);
     1420#endif
    14121421
    14131422    /* Source to make DISQueryParamVal read the register value - ugly hack */
     
    29202929    }
    29212930
     2931#ifdef HC_ARCH_BITS == 32
     2932    if (CPUMIsGuestIn64BitCode(pVM, pRegFrame))
     2933    {
     2934        /* Unable to emulate in 32 bits mode.
     2935         * Whitelisted instructions are safe.
     2936         */
     2937        if (    pCpu->param1.size > 4
     2938            &&  pCpu->pCurInstr->opcode != OP_STOSWD
     2939            &&  pCpu->pCurInstr->opcode != OP_MOV
     2940            &&  pCpu->pCurInstr->opcode != OP_CMPXCHG8B)
     2941            return VERR_EM_INTERPRETER;
     2942    }
     2943#endif
     2944
    29222945    int rc;
    29232946#if (defined(VBOX_STRICT) || defined(LOG_ENABLED))
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