Changeset 45487 in vbox for trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
- Timestamp:
- Apr 11, 2013 4:01:22 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r45481 r45487 2426 2426 Assert(!(u32TprThreshold & 0xfffffff0)); /* Bits 31:4 MBZ. */ 2427 2427 2428 Log(("Getting TPR=%d Threshold=%u\n", pVCpu->hm.s.vmx.pbVirtApic[0x80], u32TprThreshold));2429 2428 rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_TPR_THRESHOLD, u32TprThreshold); 2430 2429 AssertRCReturn(rc, rc); … … 3442 3441 /* The unusable bit is specific to VT-x, if it's a null selector mark it as an unusable segment. */ 3443 3442 uint32_t u32Access = 0; 3444 if (! (pCtx->ldtr.Attr.u & VMX_SEL_UNUSABLE))3443 if (!pCtx->ldtr.Attr.u) 3445 3444 u32Access = VMX_SEL_UNUSABLE; 3446 3445 else … … 5559 5558 break; 5560 5559 } 5560 Log(("Converting pending HM event to TRPM trap uVector=%#x enmTrapType=%d\n", uVector, enmTrapType)); 5561 5561 int rc = TRPMAssertTrap(pVCpu, uVector, enmTrapType); 5562 5562 AssertRC(rc); 5563 5563 if (fErrorCodeValid) 5564 5564 TRPMSetErrorCode(pVCpu, uErrorCode); 5565 5566 /* Clear the VT-x state bits now that TRPM has the information. */ 5565 AssertRC(rc); 5567 5566 pVCpu->hm.s.Event.fPending = false; 5568 rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_ENTRY_INTERRUPTION_INFO, 0); 5569 AssertRC(rc); 5570 } 5567 } 5568 5569 /* Clear the VT-x state bits to prevent any stale injection. */ 5570 int rc2 = VMXWriteVmcs32(VMX_VMCS32_CTRL_ENTRY_INTERRUPTION_INFO, 0); 5571 AssertRC(rc2); 5571 5572 } 5572 5573 … … 5786 5787 if (pVCpu->hm.s.Event.fPending) 5787 5788 { 5789 Log(("Pending event\n")); 5788 5790 int rc = hmR0VmxInjectEventVmcs(pVM, pVCpu, pMixedCtx, pVCpu->hm.s.Event.u64IntrInfo, 0 /* cbInstr */, 5789 5791 pVCpu->hm.s.Event.u32ErrCode); … … 5803 5805 uIntrInfo |= (1 << VMX_EXIT_INTERRUPTION_INFO_VALID_SHIFT); 5804 5806 uIntrInfo |= (VMX_EXIT_INTERRUPTION_INFO_TYPE_NMI << VMX_EXIT_INTERRUPTION_INFO_TYPE_SHIFT); 5807 Log(("Injecting NMI\n")); 5805 5808 int rc = hmR0VmxInjectEventVmcs(pVM, pVCpu, pMixedCtx, uIntrInfo, 0 /* cbInstr */, 0 /* u32ErrCode */); 5806 5809 AssertRCReturn(rc, rc); … … 5829 5832 if (RT_SUCCESS(rc)) 5830 5833 { 5834 Log(("PDMGetInterrupt: u8Interrupt=%#x\n", u8Interrupt)); 5831 5835 /* Convert pending interrupt from PIC/APIC into TRPM and handle it below. */ 5832 5836 rc = TRPMAssertTrap(pVCpu, u8Interrupt, TRPM_HARDWARE_INT); … … 5857 5861 && TRPMHasTrap(pVCpu)) 5858 5862 { 5863 Log(("Injecting TRPM trap\n")); 5859 5864 rc = hmR0VmxInjectTRPMTrap(pVM, pVCpu, pMixedCtx); 5865 Assert(!TRPMHasTrap(pVCpu)); 5860 5866 AssertRCReturn(rc, rc); 5861 5867 } … … 6446 6452 /* Load the required guest state bits (for guest-state changes in the inner execution loop). */ 6447 6453 Assert(!(pVCpu->hm.s.fContextUseFlags & HM_CHANGED_HOST_CONTEXT)); 6448 Log (("LoadFlags=%#RX32\n", pVCpu->hm.s.fContextUseFlags));6454 Log4(("LoadFlags=%#RX32\n", pVCpu->hm.s.fContextUseFlags)); 6449 6455 int rc = VINF_SUCCESS; 6450 6456 if (pVCpu->hm.s.fContextUseFlags == HM_CHANGED_GUEST_RIP) … … 6581 6587 && pVmxTransient->u8GuestTpr != pVCpu->hm.s.vmx.pbVirtApic[0x80]) 6582 6588 { 6583 Log(("Setting TPR=%d\n", pVCpu->hm.s.vmx.pbVirtApic[0x80]));6584 6589 rc = PDMApicSetTPR(pVCpu, pVCpu->hm.s.vmx.pbVirtApic[0x80]); 6585 6590 AssertRC(rc); … … 7671 7676 pVCpu->hm.s.fContextUseFlags |= HM_CHANGED_GUEST_CR0; 7672 7677 break; 7673 case 2: /* CR2 */7674 Log(("CR2 write rc=%d\n", rc));7675 break;7676 7678 case 3: /* CR3 */ 7677 7679 Assert(!pVM->hm.s.fNestedPaging || !CPUMIsGuestPagingEnabledEx(pMixedCtx)); … … 8036 8038 CPUMCTX2CORE(pMixedCtx), GCPhys); 8037 8039 rc = VBOXSTRICTRC_VAL(rc2); 8038 Log(("ApicAccess %RGp %#x\n", GCPhys, VMX_EXIT_QUALIFICATION_APIC_ACCESS_OFFSET(pVmxTransient->uExitQualification))); 8040 Log(("ApicAccess %RGp %#x rc=%d\n", GCPhys, 8041 VMX_EXIT_QUALIFICATION_APIC_ACCESS_OFFSET(pVmxTransient->uExitQualification), rc)); 8039 8042 if ( rc == VINF_SUCCESS 8040 8043 || rc == VERR_PAGE_TABLE_NOT_PRESENT … … 8315 8318 } 8316 8319 8317 Assert(rc == VINF_SUCCESS || rc == VINF_EM_RESET );8320 Assert(rc == VINF_SUCCESS || rc == VINF_EM_RESET || rc == VINF_EM_RAW_GUEST_TRAP || rc == VINF_EM_DBG_BREAKPOINT); 8318 8321 return rc; 8319 8322 } … … 8428 8431 rc |= hmR0VmxReadExitIntrErrorCodeVmcs(pVCpu, pVmxTransient); 8429 8432 rc |= hmR0VmxReadExitInstrLenVmcs(pVCpu, pVmxTransient); 8433 rc |= hmR0VmxSaveGuestRip(pVM, pVCpu, pMixedCtx); 8434 Log(("#GP Gst: RIP %#RX64\n", pMixedCtx->rip)); 8430 8435 rc |= hmR0VmxInjectEventVmcs(pVM, pVCpu, pMixedCtx, 8431 8436 VMX_VMCS_CTRL_ENTRY_IRQ_INFO_FROM_EXIT_INT_INFO(pVmxTransient->uExitIntrInfo),
Note:
See TracChangeset
for help on using the changeset viewer.