Changeset 13561 in vbox for trunk/src/VBox/VMM/VMMAll/EMAll.cpp
- Timestamp:
- Oct 24, 2008 4:27:26 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/EMAll.cpp
r13532 r13561 1482 1482 1483 1483 /* Update guest's eflags and finish. */ 1484 pRegFrame->eflags.u32 = (pRegFrame->eflags.u32 & ~(X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_ZF | X86_EFL_SF | X86_EFL_OF))1484 pRegFrame->eflags.u32 = (pRegFrame->eflags.u32 & ~(X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_ZF | X86_EFL_SF | X86_EFL_OF)) 1485 1485 | (eflags & (X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_ZF | X86_EFL_SF | X86_EFL_OF)); 1486 1486 1487 1487 *pcbSize = param2.size; 1488 return VINF_SUCCESS; 1489 } 1490 1491 /* 1492 * [LOCK] CMPXCHG8B emulation. 1493 */ 1494 static int emInterpretCmpXchg8b(PVM pVM, PDISCPUSTATE pCpu, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, uint32_t *pcbSize) 1495 { 1496 Assert(pCpu->mode != CPUMODE_64BIT); /** @todo check */ 1497 OP_PARAMVAL param1; 1498 1499 /* Source to make DISQueryParamVal read the register value - ugly hack */ 1500 int rc = DISQueryParamVal(pRegFrame, pCpu, &pCpu->param1, ¶m1, PARAM_SOURCE); 1501 if(VBOX_FAILURE(rc)) 1502 return VERR_EM_INTERPRETER; 1503 1504 RTGCPTR GCPtrPar1; 1505 void *pvParam1; 1506 uint64_t eflags; 1507 1508 AssertReturn(pCpu->param1.size == 8, VERR_EM_INTERPRETER); 1509 switch(param1.type) 1510 { 1511 case PARMTYPE_ADDRESS: 1512 GCPtrPar1 = param1.val.val64; 1513 GCPtrPar1 = emConvertToFlatAddr(pVM, pRegFrame, pCpu, &pCpu->param1, GCPtrPar1); 1514 1515 rc = PGMPhysGCPtr2HCPtr(pVM, GCPtrPar1, &pvParam1); 1516 if (VBOX_FAILURE(rc)) 1517 { 1518 AssertRC(rc); 1519 return VERR_EM_INTERPRETER; 1520 } 1521 break; 1522 1523 default: 1524 return VERR_EM_INTERPRETER; 1525 } 1526 1527 LogFlow(("%s %VGv=%08x eax=%08x\n", emGetMnemonic(pCpu), pvParam1, pRegFrame->eax)); 1528 1529 if (pCpu->prefix & PREFIX_LOCK) 1530 eflags = EMEmulateLockCmpXchg8b(pvParam1, &pRegFrame->eax, &pRegFrame->edx, pRegFrame->ebx, pRegFrame->ecx); 1531 else 1532 eflags = EMEmulateCmpXchg8b(pvParam1, &pRegFrame->eax, &pRegFrame->edx, pRegFrame->ebx, pRegFrame->ecx); 1533 1534 LogFlow(("%s %VGv=%08x eax=%08x ZF=%d\n", emGetMnemonic(pCpu), pvParam1, pRegFrame->eax, !!(eflags & X86_EFL_ZF))); 1535 1536 /* Update guest's eflags and finish; note that *only* ZF is affected. */ 1537 pRegFrame->eflags.u32 = (pRegFrame->eflags.u32 & ~(X86_EFL_ZF)) 1538 | (eflags & (X86_EFL_ZF)); 1539 1540 *pcbSize = 8; 1488 1541 return VINF_SUCCESS; 1489 1542 } … … 2833 2886 && pCpu->pCurInstr->opcode != OP_OR 2834 2887 && pCpu->pCurInstr->opcode != OP_BTR 2888 && pCpu->pCurInstr->opcode != OP_CMPXCHG 2889 && pCpu->pCurInstr->opcode != OP_CMPXCHG8B 2835 2890 ) 2836 2891 ) … … 2930 2985 #ifdef IN_GC 2931 2986 INTERPRET_CASE(OP_STI,Sti); 2987 INTERPRET_CASE(OP_XADD, XAdd); 2988 #endif 2932 2989 INTERPRET_CASE(OP_CMPXCHG8B, CmpXchg8b); 2933 INTERPRET_CASE(OP_XADD, XAdd);2934 #endif2935 2990 INTERPRET_CASE(OP_HLT,Hlt); 2936 2991 INTERPRET_CASE(OP_IRET,Iret); … … 2938 2993 #ifdef VBOX_WITH_STATISTICS 2939 2994 #ifndef IN_GC 2940 INTERPRET_STAT_CASE(OP_CMPXCHG8B, CmpXchg8b);2941 2995 INTERPRET_STAT_CASE(OP_XADD, XAdd); 2942 2996 #endif
Note:
See TracChangeset
for help on using the changeset viewer.