VirtualBox

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


Ignore:
Timestamp:
Oct 14, 2008 2:26:42 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
37882
Message:

Lmsw emulation.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/EM.cpp

    r13160 r13265  
    226226    STAM_REG_USED(pVM, &pStats->StatR3StosWD,               STAMTYPE_COUNTER, "/EM/R3/Interpret/Success/Stoswd",     STAMUNIT_OCCURENCES,   "The number of times STOSWD was successfully interpreted.");
    227227    STAM_REG_USED(pVM, &pStats->StatRZStosWD,               STAMTYPE_COUNTER, "/EM/RZ/Interpret/Success/Stoswd",     STAMUNIT_OCCURENCES,   "The number of times STOSWD was successfully interpreted.");
    228     STAM_REG_USED(pVM, &pStats->StatRZWbInvd,               STAMTYPE_COUNTER, "/EM/RZ/Interpret/Success/WbInvd",     STAMUNIT_OCCURENCES,    "The number of times WBINVD was successfully interpreted.");
    229     STAM_REG_USED(pVM, &pStats->StatR3WbInvd,               STAMTYPE_COUNTER, "/EM/R3/Interpret/Success/WbInvd",     STAMUNIT_OCCURENCES,    "The number of times WBINVD was successfully interpreted.");
     228    STAM_REG_USED(pVM, &pStats->StatRZWbInvd,               STAMTYPE_COUNTER, "/EM/RZ/Interpret/Success/WbInvd",     STAMUNIT_OCCURENCES,   "The number of times WBINVD was successfully interpreted.");
     229    STAM_REG_USED(pVM, &pStats->StatR3WbInvd,               STAMTYPE_COUNTER, "/EM/R3/Interpret/Success/WbInvd",     STAMUNIT_OCCURENCES,   "The number of times WBINVD was successfully interpreted.");
     230    STAM_REG_USED(pVM, &pStats->StatRZLmsw,                 STAMTYPE_COUNTER, "/EM/RZ/Interpret/Success/Lmsw",       STAMUNIT_OCCURENCES,   "The number of times LMSW was successfully interpreted.");
     231    STAM_REG_USED(pVM, &pStats->StatR3Lmsw,                 STAMTYPE_COUNTER, "/EM/R3/Interpret/Success/Lmsw",       STAMUNIT_OCCURENCES,   "The number of times LMSW was successfully interpreted.");
    230232
    231233    STAM_REG(pVM, &pStats->StatRZInterpretFailed,           STAMTYPE_COUNTER, "/EM/RZ/Interpret/Failed",            STAMUNIT_OCCURENCES,    "The number of times an instruction was not interpreted.");
     
    278280    STAM_REG_USED(pVM, &pStats->StatRZFailedWrmsr,          STAMTYPE_COUNTER, "/EM/RZ/Interpret/Failed/Wrmsr",      STAMUNIT_OCCURENCES,    "The number of times WRMSR was not interpreted.");
    279281    STAM_REG_USED(pVM, &pStats->StatR3FailedWrmsr,          STAMTYPE_COUNTER, "/EM/R3/Interpret/Failed/Wrmsr",      STAMUNIT_OCCURENCES,    "The number of times WRMSR was not interpreted.");
     282    STAM_REG_USED(pVM, &pStats->StatRZFailedLmsw,           STAMTYPE_COUNTER, "/EM/RZ/Interpret/Failed/Lmsw",       STAMUNIT_OCCURENCES,    "The number of times LMSW was not interpreted.");
     283    STAM_REG_USED(pVM, &pStats->StatR3FailedLmsw,           STAMTYPE_COUNTER, "/EM/R3/Interpret/Failed/Lmsw",       STAMUNIT_OCCURENCES,    "The number of times LMSW was not interpreted.");
    280284
    281285    STAM_REG_USED(pVM, &pStats->StatRZFailedMisc,           STAMTYPE_COUNTER, "/EM/RZ/Interpret/Failed/Misc",       STAMUNIT_OCCURENCES,    "The number of times some misc instruction was encountered.");
  • trunk/src/VBox/VMM/EMInternal.h

    r13160 r13265  
    146146    STAMCOUNTER             StatRZWbInvd;
    147147    STAMCOUNTER             StatR3WbInvd;
     148    STAMCOUNTER             StatRZLmsw;
     149    STAMCOUNTER             StatR3Lmsw;
    148150
    149151    STAMCOUNTER             StatRZInterpretFailed;
     
    196198    STAMCOUNTER             StatRZFailedRdmsr;
    197199    STAMCOUNTER             StatRZFailedWrmsr;
     200    STAMCOUNTER             StatRZFailedLmsw;
     201    STAMCOUNTER             StatR3FailedLmsw;
    198202
    199203    STAMCOUNTER             StatRZFailedAdd;
  • trunk/src/VBox/VMM/VMMAll/EMAll.cpp

    r13235 r13265  
    420420        case OP_BTS:        return "Bts";
    421421        case OP_BTC:        return "Btc";
     422        case OP_LMSW:       return "Lmsw";
    422423        case OP_CMPXCHG:    return pCpu->prefix & PREFIX_LOCK ? "Lock CmpXchg"   : "CmpXchg";
    423424        case OP_CMPXCHG8B:  return pCpu->prefix & PREFIX_LOCK ? "Lock CmpXchg8b" : "CmpXchg8b";
     
    19351936
    19361937    return CPUMSetGuestCR0(pVM, NewCr0);
     1938}
     1939
     1940/**
     1941 * LMSW Emulation.
     1942 */
     1943static int emInterpretLmsw(PVM pVM, PDISCPUSTATE pCpu, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, uint32_t *pcbSize)
     1944{
     1945    OP_PARAMVAL param1;
     1946    uint32_t    val;
     1947
     1948    int rc = DISQueryParamVal(pRegFrame, pCpu, &pCpu->param1, &param1, PARAM_SOURCE);
     1949    if(VBOX_FAILURE(rc))
     1950        return VERR_EM_INTERPRETER;
     1951
     1952    switch(param1.type)
     1953    {
     1954    case PARMTYPE_IMMEDIATE:
     1955    case PARMTYPE_ADDRESS:
     1956        if(!(param1.flags & (PARAM_VAL32|PARAM_VAL64)))
     1957            return VERR_EM_INTERPRETER;
     1958        val = param1.val.val32;
     1959        break;
     1960
     1961    default:
     1962        return VERR_EM_INTERPRETER;
     1963    }
     1964
     1965    LogFlow(("emInterpretLmsw %x\n", val));
     1966    return EMInterpretLMSW(pVM, val);
    19371967}
    19381968
     
    28732903        INTERPRET_CASE_EX_DUAL_PARAM2(OP_LGDT, LGdt, LIGdt);
    28742904#endif
     2905        INTERPRET_CASE(OP_LMSW,Lmsw);
    28752906        INTERPRET_CASE(OP_CLTS,Clts);
    28762907        INTERPRET_CASE(OP_MONITOR, Monitor);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette