- Timestamp:
- Aug 6, 2012 11:17:02 PM (12 years ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r42633 r42641 7384 7384 #if 1 /* NT4SP1 - xadd early boot. */ 7385 7385 || (pOrgCtx->cs.Sel == 8 && pOrgCtx->rip == 0x8019cf0f) 7386 #endif 7387 #if 1 /* NT4SP1 - wrmsr (intel MSR). */ 7388 || (pOrgCtx->cs.Sel == 8 && pOrgCtx->rip == 0x8011a6d4) 7386 7389 #endif 7387 7390 ) -
trunk/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h
r42621 r42641 3694 3694 3695 3695 /** 3696 * Implements WRMSR. 3697 */ 3698 IEM_CIMPL_DEF_0(iemCImpl_wrmsr) 3699 { 3700 PCPUMCTX pCtx = pIemCpu->CTX_SUFF(pCtx); 3701 3702 /* 3703 * Check preconditions. 3704 */ 3705 if (!IEM_IS_INTEL_CPUID_FEATURE_PRESENT_EDX(X86_CPUID_FEATURE_EDX_MSR)) 3706 return iemRaiseUndefinedOpcode(pIemCpu); 3707 if (pIemCpu->uCpl != 0) 3708 return iemRaiseGeneralProtectionFault0(pIemCpu); 3709 3710 /* 3711 * Do the job. 3712 */ 3713 RTUINT64U uValue; 3714 uValue.au32[0] = pCtx->eax; 3715 uValue.au32[1] = pCtx->edx; 3716 3717 int rc = CPUMSetGuestMsr(IEMCPU_TO_VMCPU(pIemCpu), pCtx->ecx, uValue.u); 3718 if (rc != VINF_SUCCESS) 3719 { 3720 AssertMsgReturn(rc == VERR_CPUM_RAISE_GP_0, ("%Rrc\n", rc), VERR_IPE_UNEXPECTED_STATUS); 3721 return iemRaiseGeneralProtectionFault0(pIemCpu); 3722 } 3723 3724 iemRegAddToRip(pIemCpu, cbInstr); 3725 return VINF_SUCCESS; 3726 } 3727 3728 3729 /** 3696 3730 * Implements 'IN eAX, port'. 3697 3731 * -
trunk/src/VBox/VMM/VMMAll/IEMAllInstructions.cpp.h
r42633 r42641 1488 1488 /** Opcode 0x0f 0x2f. */ 1489 1489 FNIEMOP_STUB(iemOp_comiss_Vss_Wss__comisd_Vsd_Wsd); 1490 1491 1490 1492 /** Opcode 0x0f 0x30. */ 1491 FNIEMOP_STUB(iemOp_wrmsr); 1493 FNIEMOP_DEF(iemOp_wrmsr) 1494 { 1495 IEMOP_MNEMONIC("wrmsr"); 1496 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 1497 return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_wrmsr); 1498 } 1492 1499 1493 1500 … … 1496 1503 { 1497 1504 IEMOP_MNEMONIC("rdtsc"); 1498 IEMOP_HLP_ NO_LOCK_PREFIX();1505 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 1499 1506 return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_rdtsc); 1500 1507 } … … 1505 1512 { 1506 1513 IEMOP_MNEMONIC("rdmsr"); 1507 IEMOP_HLP_ NO_LOCK_PREFIX();1514 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 1508 1515 return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_rdmsr); 1509 1516 } … … 4603 4610 IEM_MC_ARG(uint32_t *, pEFlags, 2); 4604 4611 4605 IEM_MC_REF_GREG_U8(pu8Dst, ( (bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) | pIemCpu->uRexReg);4606 IEM_MC_REF_GREG_U8(pu8Reg, ( bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB);4612 IEM_MC_REF_GREG_U8(pu8Dst, (bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB); 4613 IEM_MC_REF_GREG_U8(pu8Reg, ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) | pIemCpu->uRexReg); 4607 4614 IEM_MC_REF_EFLAGS(pEFlags); 4608 4615 IEM_MC_CALL_VOID_AIMPL_3(iemAImpl_xadd_u8, pu8Dst, pu8Reg, pEFlags); … … 4625 4632 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm); 4626 4633 IEM_MC_MEM_MAP(pu8Dst, IEM_ACCESS_DATA_RW, pIemCpu->iEffSeg, GCPtrEffDst, 0 /*arg*/); 4627 IEM_MC_FETCH_GREG_U8(u8RegCopy, ( bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB);4634 IEM_MC_FETCH_GREG_U8(u8RegCopy, ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) | pIemCpu->uRexReg); 4628 4635 IEM_MC_REF_LOCAL(pu8Reg, u8RegCopy); 4629 4636 IEM_MC_FETCH_EFLAGS(EFlags); … … 4635 4642 IEM_MC_MEM_COMMIT_AND_UNMAP(pu8Dst, IEM_ACCESS_DATA_RW); 4636 4643 IEM_MC_COMMIT_EFLAGS(EFlags); 4637 IEM_MC_STORE_GREG_U8(( bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, u8RegCopy);4644 IEM_MC_STORE_GREG_U8(((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) | pIemCpu->uRexReg, u8RegCopy); 4638 4645 IEM_MC_ADVANCE_RIP(); 4639 4646 IEM_MC_END(); … … 4665 4672 IEM_MC_ARG(uint32_t *, pEFlags, 2); 4666 4673 4667 IEM_MC_REF_GREG_U16(pu16Dst, ( (bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) | pIemCpu->uRexReg);4668 IEM_MC_REF_GREG_U16(pu16Reg, ( bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB);4674 IEM_MC_REF_GREG_U16(pu16Dst, (bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB); 4675 IEM_MC_REF_GREG_U16(pu16Reg, ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) | pIemCpu->uRexReg); 4669 4676 IEM_MC_REF_EFLAGS(pEFlags); 4670 4677 IEM_MC_CALL_VOID_AIMPL_3(iemAImpl_xadd_u16, pu16Dst, pu16Reg, pEFlags); … … 4680 4687 IEM_MC_ARG(uint32_t *, pEFlags, 2); 4681 4688 4682 IEM_MC_REF_GREG_U32(pu32Dst, ( (bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) | pIemCpu->uRexReg);4683 IEM_MC_REF_GREG_U32(pu32Reg, ( bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB);4689 IEM_MC_REF_GREG_U32(pu32Dst, (bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB); 4690 IEM_MC_REF_GREG_U32(pu32Reg, ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) | pIemCpu->uRexReg); 4684 4691 IEM_MC_REF_EFLAGS(pEFlags); 4685 4692 IEM_MC_CALL_VOID_AIMPL_3(iemAImpl_xadd_u32, pu32Dst, pu32Reg, pEFlags); … … 4695 4702 IEM_MC_ARG(uint32_t *, pEFlags, 2); 4696 4703 4697 IEM_MC_REF_GREG_U64(pu64Dst, ( (bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) | pIemCpu->uRexReg);4698 IEM_MC_REF_GREG_U64(pu64Reg, ( bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB);4704 IEM_MC_REF_GREG_U64(pu64Dst, (bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB); 4705 IEM_MC_REF_GREG_U64(pu64Reg, ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) | pIemCpu->uRexReg); 4699 4706 IEM_MC_REF_EFLAGS(pEFlags); 4700 4707 IEM_MC_CALL_VOID_AIMPL_3(iemAImpl_xadd_u64, pu64Dst, pu64Reg, pEFlags); … … 4724 4731 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm); 4725 4732 IEM_MC_MEM_MAP(pu16Dst, IEM_ACCESS_DATA_RW, pIemCpu->iEffSeg, GCPtrEffDst, 0 /*arg*/); 4726 IEM_MC_FETCH_GREG_U16(u16RegCopy, ( bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB);4733 IEM_MC_FETCH_GREG_U16(u16RegCopy, ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) | pIemCpu->uRexReg); 4727 4734 IEM_MC_REF_LOCAL(pu16Reg, u16RegCopy); 4728 4735 IEM_MC_FETCH_EFLAGS(EFlags); … … 4734 4741 IEM_MC_MEM_COMMIT_AND_UNMAP(pu16Dst, IEM_ACCESS_DATA_RW); 4735 4742 IEM_MC_COMMIT_EFLAGS(EFlags); 4736 IEM_MC_STORE_GREG_U16(( bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, u16RegCopy);4743 IEM_MC_STORE_GREG_U16(((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) | pIemCpu->uRexReg, u16RegCopy); 4737 4744 IEM_MC_ADVANCE_RIP(); 4738 4745 IEM_MC_END(); … … 4749 4756 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm); 4750 4757 IEM_MC_MEM_MAP(pu32Dst, IEM_ACCESS_DATA_RW, pIemCpu->iEffSeg, GCPtrEffDst, 0 /*arg*/); 4751 IEM_MC_FETCH_GREG_U32(u32RegCopy, ( bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB);4758 IEM_MC_FETCH_GREG_U32(u32RegCopy, ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) | pIemCpu->uRexReg); 4752 4759 IEM_MC_REF_LOCAL(pu32Reg, u32RegCopy); 4753 4760 IEM_MC_FETCH_EFLAGS(EFlags); … … 4759 4766 IEM_MC_MEM_COMMIT_AND_UNMAP(pu32Dst, IEM_ACCESS_DATA_RW); 4760 4767 IEM_MC_COMMIT_EFLAGS(EFlags); 4761 IEM_MC_STORE_GREG_U32(( bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, u32RegCopy);4768 IEM_MC_STORE_GREG_U32(((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) | pIemCpu->uRexReg, u32RegCopy); 4762 4769 IEM_MC_ADVANCE_RIP(); 4763 4770 IEM_MC_END(); … … 4774 4781 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm); 4775 4782 IEM_MC_MEM_MAP(pu64Dst, IEM_ACCESS_DATA_RW, pIemCpu->iEffSeg, GCPtrEffDst, 0 /*arg*/); 4776 IEM_MC_FETCH_GREG_U64(u64RegCopy, ( bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB);4783 IEM_MC_FETCH_GREG_U64(u64RegCopy, ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) | pIemCpu->uRexReg); 4777 4784 IEM_MC_REF_LOCAL(pu64Reg, u64RegCopy); 4778 4785 IEM_MC_FETCH_EFLAGS(EFlags); … … 4784 4791 IEM_MC_MEM_COMMIT_AND_UNMAP(pu64Dst, IEM_ACCESS_DATA_RW); 4785 4792 IEM_MC_COMMIT_EFLAGS(EFlags); 4786 IEM_MC_STORE_GREG_U64(( bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, u64RegCopy);4793 IEM_MC_STORE_GREG_U64(((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) | pIemCpu->uRexReg, u64RegCopy); 4787 4794 IEM_MC_ADVANCE_RIP(); 4788 4795 IEM_MC_END();
Note:
See TracChangeset
for help on using the changeset viewer.