Changeset 49002 in vbox
- Timestamp:
- Oct 9, 2013 1:15:43 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 89727
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r49000 r49002 124 124 #define HMVMX_UPDATED_TRANSIENT_EXIT_INTERRUPTION_INFO RT_BIT(4) 125 125 #define HMVMX_UPDATED_TRANSIENT_EXIT_INTERRUPTION_ERROR_CODE RT_BIT(5) 126 #define HMVMX_UPDATED_TRANSIENT_EXIT_INSTR_INFO RT_BIT(6) 126 127 /** @} */ 127 128 … … 237 238 struct 238 239 { 239 uint32_t u6Reserved0 : 6;240 uint32_t u6Reserved0 : 7; 240 241 /** The address size; 0=16-bit, 1=32-bit, 2=64-bit, rest undefined. */ 241 242 uint32_t u3AddrSize : 3; … … 660 661 DECLINLINE(int) hmR0VmxReadExitInstrInfoVmcs(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient) 661 662 { 662 if (!(pVmxTransient->fVmcsFieldsRead & HMVMX_UPDATED_TRANSIENT_EXIT_INSTR_ LEN))663 { 664 int rc = VMXReadVmcs32(VMX_VMCS32_RO_EXIT_INSTR_INFO, &pVmxTransient-> cbInstr);663 if (!(pVmxTransient->fVmcsFieldsRead & HMVMX_UPDATED_TRANSIENT_EXIT_INSTR_INFO)) 664 { 665 int rc = VMXReadVmcs32(VMX_VMCS32_RO_EXIT_INSTR_INFO, &pVmxTransient->ExitInstrInfo.u); 665 666 AssertRCReturn(rc, rc); 666 pVmxTransient->fVmcsFieldsRead |= HMVMX_UPDATED_TRANSIENT_EXIT_INSTR_ LEN;667 pVmxTransient->fVmcsFieldsRead |= HMVMX_UPDATED_TRANSIENT_EXIT_INSTR_INFO; 667 668 } 668 669 return VINF_SUCCESS; … … 9635 9636 Log4(("CRX CR0 write rc=%d CR0=%#RX64\n", rc, pMixedCtx->cr0)); 9636 9637 break; 9637 case 2: /* C 2 **/9638 case 2: /* CR2 */ 9638 9639 /* Nothing to do here, CR2 it's not part of the VMCS. */ 9639 9640 break; … … 9771 9772 * interpreting the instruction. 9772 9773 */ 9773 #if 0 /* Not quite ready, seem iSegReg assertion trigger once... Do we perhaps need to always read that in longjmp / preempt scenario? */9774 9774 Log4(("CS:RIP=%04x:%#RX64 %#06x/%u %c str\n", pMixedCtx->cs.Sel, pMixedCtx->rip, uIOPort, cbValue, fIOWrite ? 'w' : 'r')); 9775 9775 AssertReturn(pMixedCtx->dx == uIOPort, VERR_HMVMX_IPE_2); 9776 9776 if (MSR_IA32_VMX_BASIC_INFO_VMCS_INS_OUTS(pVM->hm.s.vmx.Msrs.u64BasicInfo)) 9777 9777 { 9778 rc2 = hmR0VmxReadExitIn trInfoVmcs(pVCpu, pVmxTransient);9778 rc2 = hmR0VmxReadExitInstrInfoVmcs(pVCpu, pVmxTransient); 9779 9779 /** @todo optimize this, IEM should request the additional state if it needs it (GP, PF, ++). */ 9780 9780 rc2 |= hmR0VmxSaveGuestState(pVCpu, pMixedCtx); … … 9788 9788 rcStrict = IEMExecStringIoWrite(pVCpu, cbValue, enmAddrMode, fRep, cbInstr, 9789 9789 pVmxTransient->ExitInstrInfo.StrIo.iSegReg); 9790 //if (rcStrict == VINF_IOM_R3_IOPORT_WRITE)9791 // hmR0SavePendingIOPortWriteStr(pVCpu, pMixedCtx->rip, cbValue, enmAddrMode, fRep, cbInstr,9792 // pVmxTransient->ExitInstrInfo.StrIo.iSegReg);9793 9790 } 9794 9791 else 9795 9792 { 9796 AssertMsgReturn(pVmxTransient->ExitInstrInfo.StrIo.iSegReg == X86_SREG_ES, 9797 ("%#x (%#llx)\n", pVmxTransient->ExitInstrInfo.StrIo.iSegReg, pVmxTransient->ExitInstrInfo.u), 9798 VERR_HMVMX_IPE_4); 9793 /* 9794 * The segment prefix for INS cannot be overridden and is always ES. We can safely assume X86_SREG_ES. 9795 * Hence "iSegReg" field is undefined in the instruction-information field in VT-x for INS. 9796 * See Intel Instruction spec. for "INS". 9797 * See Intel spec. Table 27-8 "Format of the VM-Exit Instruction-Information Field as Used for INS and OUTS". 9798 */ 9799 9799 rcStrict = IEMExecStringIoRead(pVCpu, cbValue, enmAddrMode, fRep, cbInstr); 9800 //if (rcStrict == VINF_IOM_R3_IOPORT_READ)9801 // hmR0SavePendingIOPortReadStr(pVCpu, pMixedCtx->rip, cbValue, enmAddrMode, fRep, cbInstr);9802 9800 } 9803 9801 } … … 9812 9810 VMCPU_HMCF_SET(pVCpu, HM_CHANGED_GUEST_RIP); 9813 9811 fUpdateRipAlready = true; 9814 #else9815 PDISCPUSTATE pDis = &pVCpu->hm.s.DisState;9816 rcStrict = EMInterpretDisasCurrent(pVM, pVCpu, pDis, NULL);9817 if (RT_SUCCESS(rcStrict))9818 {9819 if (fIOWrite)9820 {9821 rcStrict = IOMInterpretOUTSEx(pVM, pVCpu, CPUMCTX2CORE(pMixedCtx), uIOPort, pDis->fPrefix,9822 (DISCPUMODE)pDis->uAddrMode, cbValue);9823 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitIOStringWrite);9824 }9825 else9826 {9827 rcStrict = IOMInterpretINSEx(pVM, pVCpu, CPUMCTX2CORE(pMixedCtx), uIOPort, pDis->fPrefix,9828 (DISCPUMODE)pDis->uAddrMode, cbValue);9829 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitIOStringRead);9830 }9831 }9832 else9833 {9834 AssertMsg(rcStrict == VERR_EM_INTERPRETER, ("rcStrict=%Rrc RIP %#RX64\n", VBOXSTRICTRC_VAL(rcStrict), pMixedCtx->rip));9835 rcStrict = VINF_EM_RAW_EMULATE_INSTR;9836 }9837 #endif9838 9812 } 9839 9813 else
Note:
See TracChangeset
for help on using the changeset viewer.