- Timestamp:
- Aug 7, 2012 11:43:32 PM (12 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r42662 r42670 5096 5096 * Check the input and figure out which mapping entry to use. 5097 5097 */ 5098 Assert(cbMem <= 32 || cbMem == 512 );5098 Assert(cbMem <= 32 || cbMem == 512 || cbMem == 108 || cbMem == 94); 5099 5099 Assert(~(fAccess & ~(IEM_ACCESS_TYPE_MASK | IEM_ACCESS_WHAT_MASK))); 5100 5100 … … 7396 7396 #if 0 /* NT4SP1 - fnstsw + 2 (AMD). */ 7397 7397 || (pOrgCtx->cs.Sel == 8 && pOrgCtx->rip == 0x801c6b88+2) 7398 #endif 7399 #if 0 /* NT4SP1 - iret to v8086 -- too generic a place? (N/A with GAs installed) */ 7400 || (pOrgCtx->cs.Sel == 8 && pOrgCtx->rip == 0x8013bd5d) 7401 7402 #endif 7403 #if 1 /* NT4SP1 - iret to v8086 (executing edlin) */ 7404 || (pOrgCtx->cs.Sel == 8 && pOrgCtx->rip == 0x8013b609) 7405 7406 #endif 7407 #if 0 /* NT4SP1 - frstor [ecx] */ 7408 || (pOrgCtx->cs.Sel == 8 && pOrgCtx->rip == 0x8013d11f) 7398 7409 #endif 7399 7410 ) -
trunk/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h
r42666 r42670 4065 4065 pCtx->fpu.FPUDP = 0; 4066 4066 pCtx->fpu.DS = 0; //?? 4067 pCtx->fpu.Rsrvd2= 0; 4067 4068 pCtx->fpu.FPUIP = 0; 4068 4069 pCtx->fpu.CS = 0; //?? 4070 pCtx->fpu.Rsrvd1= 0; 4069 4071 pCtx->fpu.FOP = 0; 4070 4072 } … … 4373 4375 pCtx->fpu.FOP = uPtr.pu16[4] & UINT16_C(0x07ff); 4374 4376 pCtx->fpu.CS = 0; 4377 pCtx->fpu.Rsrvd1= 0; 4375 4378 pCtx->fpu.DS = 0; 4379 pCtx->fpu.Rsrvd2= 0; 4376 4380 } 4377 4381 else … … 4379 4383 pCtx->fpu.FPUIP = uPtr.pu16[3]; 4380 4384 pCtx->fpu.CS = uPtr.pu16[4]; 4385 pCtx->fpu.Rsrvd1= 0; 4381 4386 pCtx->fpu.FPUDP = uPtr.pu16[5]; 4382 4387 pCtx->fpu.DS = uPtr.pu16[6]; 4388 pCtx->fpu.Rsrvd2= 0; 4383 4389 /** @todo Testcase: Is FOP cleared when doing 16-bit protected mode fldenv? */ 4384 4390 } … … 4395 4401 pCtx->fpu.FPUDP = uPtr.pu16[5*2] | ((uPtr.pu32[6] & UINT32_C(0x0ffff000)) << 4); 4396 4402 pCtx->fpu.CS = 0; 4403 pCtx->fpu.Rsrvd1= 0; 4397 4404 pCtx->fpu.DS = 0; 4405 pCtx->fpu.Rsrvd2= 0; 4398 4406 } 4399 4407 else … … 4401 4409 pCtx->fpu.FPUIP = uPtr.pu32[3]; 4402 4410 pCtx->fpu.CS = uPtr.pu16[4*2]; 4411 pCtx->fpu.Rsrvd1= 0; 4403 4412 pCtx->fpu.FOP = uPtr.pu16[4*2+1]; 4404 4413 pCtx->fpu.FPUDP = uPtr.pu32[5]; 4405 4414 pCtx->fpu.DS = uPtr.pu16[6*2]; 4415 pCtx->fpu.Rsrvd2= 0; 4406 4416 } 4407 4417 } … … 4445 4455 4446 4456 /** 4457 * Implements 'FNSAVE'. 4458 * 4459 * @param GCPtrEffDst The address of the image. 4460 * @param enmEffOpSize The operand size. 4461 */ 4462 IEM_CIMPL_DEF_3(iemCImpl_fnsave, IEMMODE, enmEffOpSize, uint8_t, iEffSeg, RTGCPTR, GCPtrEffDst) 4463 { 4464 PCPUMCTX pCtx = pIemCpu->CTX_SUFF(pCtx); 4465 RTPTRUNION uPtr; 4466 VBOXSTRICTRC rcStrict = iemMemMap(pIemCpu, &uPtr.pv, enmEffOpSize == IEMMODE_16BIT ? 94 : 108, 4467 iEffSeg, GCPtrEffDst, IEM_ACCESS_DATA_W | IEM_ACCESS_PARTIAL_WRITE); 4468 if (rcStrict != VINF_SUCCESS) 4469 return rcStrict; 4470 4471 iemCImplCommonFpuStoreEnv(pIemCpu, enmEffOpSize, uPtr, pCtx); 4472 PRTFLOAT80U paRegs = (PRTFLOAT80U)(uPtr.pu8 + (enmEffOpSize == IEMMODE_16BIT ? 14 : 28)); 4473 for (uint32_t i = 0; i < RT_ELEMENTS(pCtx->fpu.aRegs); i++) 4474 { 4475 paRegs[i].au32[0] = pCtx->fpu.aRegs[i].au32[0]; 4476 paRegs[i].au32[1] = pCtx->fpu.aRegs[i].au32[1]; 4477 paRegs[i].au16[4] = pCtx->fpu.aRegs[i].au16[4]; 4478 } 4479 4480 rcStrict = iemMemCommitAndUnmap(pIemCpu, uPtr.pv, IEM_ACCESS_DATA_W | IEM_ACCESS_PARTIAL_WRITE); 4481 if (rcStrict != VINF_SUCCESS) 4482 return rcStrict; 4483 4484 /* 4485 * Re-initialize the FPU. 4486 */ 4487 pCtx->fpu.FCW = 0x37f; 4488 pCtx->fpu.FSW = 0; 4489 pCtx->fpu.FTW = 0xffff; /* 11 - empty */ 4490 pCtx->fpu.FPUDP = 0; 4491 pCtx->fpu.DS = 0; 4492 pCtx->fpu.Rsrvd2= 0; 4493 pCtx->fpu.FPUIP = 0; 4494 pCtx->fpu.CS = 0; 4495 pCtx->fpu.Rsrvd1= 0; 4496 pCtx->fpu.FOP = 0; 4497 4498 4499 /* Note: C0, C1, C2 and C3 are documented as undefined, we leave them untouched! */ 4500 iemRegAddToRip(pIemCpu, cbInstr); 4501 return VINF_SUCCESS; 4502 } 4503 4504 4505 4506 /** 4447 4507 * Implements 'FLDENV'. 4448 4508 * … … 4461 4521 4462 4522 iemCImplCommonFpuRestoreEnv(pIemCpu, enmEffOpSize, uPtr, pCtx); 4523 4524 rcStrict = iemMemCommitAndUnmap(pIemCpu, (void *)uPtr.pv, IEM_ACCESS_DATA_R); 4525 if (rcStrict != VINF_SUCCESS) 4526 return rcStrict; 4527 4528 iemRegAddToRip(pIemCpu, cbInstr); 4529 return VINF_SUCCESS; 4530 } 4531 4532 4533 /** 4534 * Implements 'FRSTOR'. 4535 * 4536 * @param GCPtrEffSrc The address of the image. 4537 * @param enmEffOpSize The operand size. 4538 */ 4539 IEM_CIMPL_DEF_3(iemCImpl_frstor, IEMMODE, enmEffOpSize, uint8_t, iEffSeg, RTGCPTR, GCPtrEffSrc) 4540 { 4541 PCPUMCTX pCtx = pIemCpu->CTX_SUFF(pCtx); 4542 RTCPTRUNION uPtr; 4543 VBOXSTRICTRC rcStrict = iemMemMap(pIemCpu, (void **)&uPtr.pv, enmEffOpSize == IEMMODE_16BIT ? 94 : 108, 4544 iEffSeg, GCPtrEffSrc, IEM_ACCESS_DATA_R); 4545 if (rcStrict != VINF_SUCCESS) 4546 return rcStrict; 4547 4548 iemCImplCommonFpuRestoreEnv(pIemCpu, enmEffOpSize, uPtr, pCtx); 4549 PCRTFLOAT80U paRegs = (PCRTFLOAT80U)(uPtr.pu8 + (enmEffOpSize == IEMMODE_16BIT ? 14 : 28)); 4550 for (uint32_t i = 0; i < RT_ELEMENTS(pCtx->fpu.aRegs); i++) 4551 { 4552 pCtx->fpu.aRegs[i].au32[0] = paRegs[i].au32[0]; 4553 pCtx->fpu.aRegs[i].au32[1] = paRegs[i].au32[1]; 4554 pCtx->fpu.aRegs[i].au32[2] = paRegs[i].au16[4]; 4555 pCtx->fpu.aRegs[i].au32[3] = 0; 4556 } 4463 4557 4464 4558 rcStrict = iemMemCommitAndUnmap(pIemCpu, (void *)uPtr.pv, IEM_ACCESS_DATA_R); -
trunk/src/VBox/VMM/VMMAll/IEMAllInstructions.cpp.h
r42660 r42670 11723 11723 FNIEMOP_DEF_1(iemOp_fnstenv, uint8_t, bRm) 11724 11724 { 11725 IEMOP_MNEMONIC("fstenv m14/ 28byte");11725 IEMOP_MNEMONIC("fstenv m14/m28byte"); 11726 11726 IEM_MC_BEGIN(3, 0); 11727 11727 IEM_MC_ARG_CONST(IEMMODE, enmEffOpSize, /*=*/ pIemCpu->enmEffOpSize, 0); … … 11747 11747 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 11748 11748 IEM_MC_MAYBE_RAISE_DEVICE_NOT_AVAILABLE(); 11749 IEM_MC_FETCH_F SW(u16Fcw);11749 IEM_MC_FETCH_FCW(u16Fcw); 11750 11750 IEM_MC_STORE_MEM_U16(pIemCpu->iEffSeg, GCPtrEffDst, u16Fcw); 11751 11751 IEM_MC_ADVANCE_RIP(); /* C0-C3 are documented as undefined, we leave them unmodified. */ … … 13545 13545 13546 13546 /** Opcode 0xdd !11/0. */ 13547 FNIEMOP_STUB_1(iemOp_frstor, uint8_t, bRm); 13547 FNIEMOP_DEF_1(iemOp_frstor, uint8_t, bRm) 13548 { 13549 IEMOP_MNEMONIC("fxrstor m94/108byte"); 13550 IEM_MC_BEGIN(3, 0); 13551 IEM_MC_ARG_CONST(IEMMODE, enmEffOpSize, /*=*/ pIemCpu->enmEffOpSize, 0); 13552 IEM_MC_ARG_CONST(uint8_t, iEffSeg, /*=*/ pIemCpu->iEffSeg, 1); 13553 IEM_MC_ARG(RTGCPTR, GCPtrEffSrc, 2); 13554 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffSrc, bRm); 13555 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 13556 IEM_MC_MAYBE_RAISE_DEVICE_NOT_AVAILABLE(); 13557 IEM_MC_CALL_CIMPL_3(iemCImpl_frstor, enmEffOpSize, iEffSeg, GCPtrEffSrc); 13558 IEM_MC_END(); 13559 return VINF_SUCCESS; 13560 } 13561 13548 13562 13549 13563 /** Opcode 0xdd !11/0. */ 13550 FNIEMOP_STUB_1(iemOp_fnsave, uint8_t, bRm); 13551 13564 FNIEMOP_DEF_1(iemOp_fnsave, uint8_t, bRm) 13565 { 13566 IEMOP_MNEMONIC("fnsave m94/108byte"); 13567 IEM_MC_BEGIN(3, 0); 13568 IEM_MC_ARG_CONST(IEMMODE, enmEffOpSize, /*=*/ pIemCpu->enmEffOpSize, 0); 13569 IEM_MC_ARG_CONST(uint8_t, iEffSeg, /*=*/ pIemCpu->iEffSeg, 1); 13570 IEM_MC_ARG(RTGCPTR, GCPtrEffDst, 2); 13571 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm); 13572 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 13573 IEM_MC_MAYBE_RAISE_DEVICE_NOT_AVAILABLE(); 13574 IEM_MC_CALL_CIMPL_3(iemCImpl_fnsave, enmEffOpSize, iEffSeg, GCPtrEffDst); 13575 IEM_MC_END(); 13576 return VINF_SUCCESS; 13577 13578 } 13552 13579 13553 13580 /** Opcode 0xdd !11/0. */ -
trunk/src/VBox/VMM/testcase/tstIEMCheckMc.cpp
r42621 r42670 365 365 #define IEM_MC_FETCH_EFLAGS_U8(a_EFlags) do { (a_EFlags) = 0; CHK_TYPE(uint8_t, a_EFlags); } while (0) 366 366 #define IEM_MC_FETCH_FSW(a_u16Fsw) do { (a_u16Fsw) = 0; CHK_TYPE(uint16_t, a_u16Fsw); } while (0) 367 #define IEM_MC_FETCH_FCW(a_u16Fcw) do { (a_u16Fcw) = 0; CHK_TYPE(uint16_t, a_u16Fcw); } while (0) 367 368 #define IEM_MC_STORE_GREG_U8(a_iGReg, a_u8Value) do { CHK_TYPE(uint8_t, a_u8Value); } while (0) 368 369 #define IEM_MC_STORE_GREG_U16(a_iGReg, a_u16Value) do { CHK_TYPE(uint16_t, a_u16Value); } while (0)
Note:
See TracChangeset
for help on using the changeset viewer.