- Timestamp:
- May 14, 2013 6:00:02 PM (12 years ago)
- Location:
- trunk/src/VBox/VMM/VMMR0
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r46041 r46076 183 183 uint32_t uExitIntrErrorCode; 184 184 /** The VM-exit exit qualification. */ 185 RTGCUINTPTR uExitQualification; 186 #if GC_ARCH_BITS == 32 187 /** Alignment. */ 188 uint32_t u32Alignment1; 189 #endif 185 uint64_t uExitQualification; 190 186 191 187 /** The VM-exit interruption-information field. */ … … 3910 3906 3911 3907 /* Guest bits. */ 3912 RTGCUINTREG uGCReg; 3913 rc = VMXReadVmcsGstN(VMX_VMCS_GUEST_RIP, &uGCReg); AssertRC(rc); 3914 Log(("Old Guest Rip %#RGv New %#RGv\n", (RTGCPTR)pCtx->rip, (RTGCPTR)uGCReg)); 3915 rc = VMXReadVmcsGstN(VMX_VMCS_GUEST_RSP, &uGCReg); AssertRC(rc); 3916 Log(("Old Guest Rsp %#RGv New %#RGv\n", (RTGCPTR)pCtx->rsp, (RTGCPTR)uGCReg)); 3908 rc = VMXReadVmcsGstN(VMX_VMCS_GUEST_RIP, &u64Val); AssertRC(rc); 3909 Log(("Old Guest Rip %#RX64 New %#RX64\n", pCtx->rip, u64Val)); 3910 rc = VMXReadVmcsGstN(VMX_VMCS_GUEST_RSP, &u64Val); AssertRC(rc); 3911 Log(("Old Guest Rsp %#RX64 New %#RX64\n", pCtx->rsp, u64Val)); 3917 3912 rc = VMXReadVmcs32(VMX_VMCS_GUEST_RFLAGS, &u32Val); AssertRC(rc); 3918 3913 Log(("Old Guest Rflags %#RX32 New %#RX32\n", pCtx->eflags.u32, u32Val)); … … 4666 4661 && uExitVector == X86_XCPT_PF) 4667 4662 { 4668 Log(("IDT: Contributory #PF uCR2=%#R Gv\n", pMixedCtx->cr2));4663 Log(("IDT: Contributory #PF uCR2=%#RX64\n", pMixedCtx->cr2)); 4669 4664 } 4670 4665 #endif … … 4673 4668 { 4674 4669 pVmxTransient->fVectoringPF = true; 4675 Log(("IDT: Vectoring #PF uCR2=%#R Gv\n", pMixedCtx->cr2));4670 Log(("IDT: Vectoring #PF uCR2=%#RX64\n", pMixedCtx->cr2)); 4676 4671 } 4677 4672 else if ( (pVCpu->hm.s.vmx.u32XcptBitmap & HMVMX_CONTRIBUTORY_XCPT_MASK) … … 4820 4815 if (!(pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_RIP)) 4821 4816 { 4822 RTGCUINTREGuVal = 0;4817 uint64_t uVal = 0; 4823 4818 rc = VMXReadVmcsGstN(VMX_VMCS_GUEST_RIP, &uVal); 4824 4819 AssertRCReturn(rc, rc); … … 4847 4842 if (!(pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_RSP)) 4848 4843 { 4849 RTGCUINTREGuVal = 0;4844 uint64_t uVal = 0; 4850 4845 rc = VMXReadVmcsGstN(VMX_VMCS_GUEST_RSP, &uVal); 4851 4846 AssertRCReturn(rc, rc); … … 4982 4977 } 4983 4978 4984 RTGCUINTREGuGCVal = 0;4979 uint64_t uGCVal = 0; 4985 4980 if (!(pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_SYSENTER_EIP_MSR)) 4986 4981 { … … 5016 5011 if (!(pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_FS_BASE_MSR)) 5017 5012 { 5018 RTGCUINTREGuVal = 0;5013 uint64_t uVal = 0; 5019 5014 rc = VMXReadVmcsGstN(VMX_VMCS_GUEST_FS_BASE, &uVal); AssertRCReturn(rc, rc); 5020 5015 pMixedCtx->fs.u64Base = uVal; … … 5042 5037 if (!(pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_GS_BASE_MSR)) 5043 5038 { 5044 RTGCUINTREGuVal = 0;5039 uint64_t uVal = 0; 5045 5040 rc = VMXReadVmcsGstN(VMX_VMCS_GUEST_GS_BASE, &uVal); AssertRCReturn(rc, rc); 5046 5041 pMixedCtx->gs.u64Base = uVal; … … 5130 5125 && CPUMIsGuestPagingEnabledEx(pMixedCtx))) 5131 5126 { 5132 RTGCUINTREGuVal = 0;5127 uint64_t uVal = 0; 5133 5128 rc = VMXReadVmcsGstN(VMX_VMCS_GUEST_CR3, &uVal); 5134 5129 if (pMixedCtx->cr3 != uVal) … … 5224 5219 pSelReg->u32Limit = u32Val; 5225 5220 5226 RTGCUINTREG uGCVal = 0;5227 rc = VMXReadVmcsGstNByIdxVal(idxBase, &u GCVal);5221 uint64_t u64Val = 0; 5222 rc = VMXReadVmcsGstNByIdxVal(idxBase, &u64Val); 5228 5223 AssertRCReturn(rc, rc); 5229 pSelReg->u64Base = u GCVal;5224 pSelReg->u64Base = u64Val; 5230 5225 5231 5226 rc = VMXReadVmcs32(idxAccess, &u32Val); … … 5325 5320 5326 5321 /* Guest GDTR. */ 5327 RTGCUINTREG uGCVal = 0;5328 uint32_t 5322 uint64_t u64Val = 0; 5323 uint32_t u32Val = 0; 5329 5324 if (!(pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_GDTR)) 5330 5325 { 5331 rc = VMXReadVmcsGstN(VMX_VMCS_GUEST_GDTR_BASE, &u GCVal); AssertRCReturn(rc, rc);5326 rc = VMXReadVmcsGstN(VMX_VMCS_GUEST_GDTR_BASE, &u64Val); AssertRCReturn(rc, rc); 5332 5327 rc = VMXReadVmcs32(VMX_VMCS32_GUEST_GDTR_LIMIT, &u32Val); AssertRCReturn(rc, rc); 5333 pMixedCtx->gdtr.pGdt = u GCVal;5328 pMixedCtx->gdtr.pGdt = u64Val; 5334 5329 pMixedCtx->gdtr.cbGdt = u32Val; 5335 5330 pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_GDTR; … … 5339 5334 if (!(pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_IDTR)) 5340 5335 { 5341 rc = VMXReadVmcsGstN(VMX_VMCS_GUEST_IDTR_BASE, &u GCVal); AssertRCReturn(rc, rc);5336 rc = VMXReadVmcsGstN(VMX_VMCS_GUEST_IDTR_BASE, &u64Val); AssertRCReturn(rc, rc); 5342 5337 rc = VMXReadVmcs32(VMX_VMCS32_GUEST_IDTR_LIMIT, &u32Val); AssertRCReturn(rc, rc); 5343 pMixedCtx->idtr.pIdt = u GCVal;5338 pMixedCtx->idtr.pIdt = u64Val; 5344 5339 pMixedCtx->idtr.cbIdt = u32Val; 5345 5340 pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_IDTR; … … 6348 6343 pMixedCtx->cr2 = GCPtrFaultAddress; 6349 6344 } 6350 Log(("Injecting u32IntrInfo=%#x u32ErrCode=%#x cbInstr=%#x uCR2=%#R Gv\n", u32IntrInfo, u32ErrCode, cbInstr, pMixedCtx->cr2));6345 Log(("Injecting u32IntrInfo=%#x u32ErrCode=%#x cbInstr=%#x uCR2=%#RX64\n", u32IntrInfo, u32ErrCode, cbInstr, pMixedCtx->cr2)); 6351 6346 6352 6347 AssertRCReturn(rc, rc); … … 7372 7367 else 7373 7368 { 7374 AssertMsg(rc == VERR_EM_INTERPRETER, ("hmR0VmxExitInvlpg: EMInterpretInvlpg %#R Gvfailed with %Rrc\n",7369 AssertMsg(rc == VERR_EM_INTERPRETER, ("hmR0VmxExitInvlpg: EMInterpretInvlpg %#RX64 failed with %Rrc\n", 7375 7370 pVmxTransient->uExitQualification, rc)); 7376 7371 } … … 7921 7916 { 7922 7917 case 0: /* CR0 */ 7923 Log(("CRX CR0 write rc=%d CR0=%#R Gv\n", rc, pMixedCtx->cr0));7918 Log(("CRX CR0 write rc=%d CR0=%#RX64\n", rc, pMixedCtx->cr0)); 7924 7919 pVCpu->hm.s.fContextUseFlags |= HM_CHANGED_GUEST_CR0; 7925 7920 break; … … 7929 7924 case 3: /* CR3 */ 7930 7925 Assert(!pVM->hm.s.fNestedPaging || !CPUMIsGuestPagingEnabledEx(pMixedCtx)); 7931 Log(("CRX CR3 write rc=%d CR3=%#R Gv\n", rc, pMixedCtx->cr3));7926 Log(("CRX CR3 write rc=%d CR3=%#RX64\n", rc, pMixedCtx->cr3)); 7932 7927 pVCpu->hm.s.fContextUseFlags |= HM_CHANGED_GUEST_CR3; 7933 7928 break; 7934 7929 case 4: /* CR4 */ 7935 Log(("CRX CR4 write rc=%d CR4=%#R Gv\n", rc, pMixedCtx->cr4));7930 Log(("CRX CR4 write rc=%d CR4=%#RX64\n", rc, pMixedCtx->cr4)); 7936 7931 pVCpu->hm.s.fContextUseFlags |= HM_CHANGED_GUEST_CR4; 7937 7932 break; … … 8034 8029 /* EFER also required for longmode checks in EMInterpretDisasCurrent(), but it's always up-to-date. */ 8035 8030 AssertRCReturn(rc, rc); 8036 Log(("CS:RIP=%04x:%#R Gv\n", pMixedCtx->cs.Sel, pMixedCtx->rip));8031 Log(("CS:RIP=%04x:%#RX64\n", pMixedCtx->cs.Sel, pMixedCtx->rip)); 8037 8032 8038 8033 /* Refer Intel spec. 27-5. "Exit Qualifications for I/O Instructions" for the format. */ … … 8300 8295 GCPhys += VMX_EXIT_QUALIFICATION_APIC_ACCESS_OFFSET(pVmxTransient->uExitQualification); 8301 8296 PVM pVM = pVCpu->CTX_SUFF(pVM); 8302 Log(("ApicAccess uAccessType=%#x GCPhys=% RGpOff=%#x\n", uAccessType, GCPhys,8297 Log(("ApicAccess uAccessType=%#x GCPhys=%#RGv Off=%#x\n", uAccessType, GCPhys, 8303 8298 VMX_EXIT_QUALIFICATION_APIC_ACCESS_OFFSET(pVmxTransient->uExitQualification))); 8304 8299 … … 8447 8442 VBOXSTRICTRC rc2 = PGMR0Trap0eHandlerNPMisconfig(pVM, pVCpu, PGMMODE_EPT, CPUMCTX2CORE(pMixedCtx), GCPhys, UINT32_MAX); 8448 8443 rc = VBOXSTRICTRC_VAL(rc2); 8449 Log(("EPT misconfig at %#RGv RIP=%#R Gvrc=%d\n", GCPhys, pMixedCtx->rip, rc));8444 Log(("EPT misconfig at %#RGv RIP=%#RX64 rc=%d\n", GCPhys, pMixedCtx->rip, rc)); 8450 8445 if ( rc == VINF_SUCCESS 8451 8446 || rc == VERR_PAGE_TABLE_NOT_PRESENT … … 8490 8485 8491 8486 /* Intel spec. Table 27-7 "Exit Qualifications for EPT violations". */ 8492 AssertMsg(((pVmxTransient->uExitQualification >> 7) & 3) != 2, ("%#R Gv", pVmxTransient->uExitQualification));8487 AssertMsg(((pVmxTransient->uExitQualification >> 7) & 3) != 2, ("%#RX64", pVmxTransient->uExitQualification)); 8493 8488 8494 8489 RTGCUINT uErrorCode = 0; … … 8502 8497 TRPMAssertXcptPF(pVCpu, GCPhys, uErrorCode); 8503 8498 8504 Log(("EPT violation %#x at %#R Gv ErrorCode %#x CS:EIP=%04x:%#RX64\n", (uint32_t)pVmxTransient->uExitQualification, GCPhys,8499 Log(("EPT violation %#x at %#RX64 ErrorCode %#x CS:EIP=%04x:%#RX64\n", pVmxTransient->uExitQualification, GCPhys, 8505 8500 uErrorCode, pMixedCtx->cs.Sel, pMixedCtx->rip)); 8506 8501 … … 8693 8688 rc |= hmR0VmxSaveGuestState(pVCpu, pMixedCtx); 8694 8689 AssertRCReturn(rc, rc); 8695 Log(("#GP Gst: RIP %#RX64 ErrorCode=%#x CR0=%#R GvCPL=%u\n", pMixedCtx->rip, pVmxTransient->uExitIntrErrorCode,8690 Log(("#GP Gst: RIP %#RX64 ErrorCode=%#x CR0=%#RX64 CPL=%u\n", pMixedCtx->rip, pVmxTransient->uExitIntrErrorCode, 8696 8691 pMixedCtx->cr0, CPUMGetGuestCPL(pVCpu))); 8697 8692 hmR0VmxSetPendingEvent(pVCpu, VMX_VMCS_CTRL_ENTRY_IRQ_INFO_FROM_EXIT_INT_INFO(pVmxTransient->uExitIntrInfo), … … 8778 8773 break; 8779 8774 } 8780 Log(("POPF %x -> %#R Gvmask=%x RIP=%#RX64\n", uEflags.u, pMixedCtx->rsp, uMask, pMixedCtx->rip));8775 Log(("POPF %x -> %#RX64 mask=%x RIP=%#RX64\n", uEflags.u, pMixedCtx->rsp, uMask, pMixedCtx->rip)); 8781 8776 pMixedCtx->eflags.u32 = (pMixedCtx->eflags.u32 & ~(X86_EFL_POPF_BITS & uMask)) 8782 8777 | (uEflags.u32 & X86_EFL_POPF_BITS & uMask); … … 9004 8999 AssertRCReturn(rc, rc); 9005 9000 9006 Log(("#PF: cr2=%#R Gv cs:rip=%#04x:%#RGv uErrCode %#RX32 cr3=%#RGv\n", pVmxTransient->uExitQualification, pMixedCtx->cs.Sel,9001 Log(("#PF: cr2=%#RX64 cs:rip=%#04x:%#RX64 uErrCode %#RX32 cr3=%#RX64\n", pVmxTransient->uExitQualification, pMixedCtx->cs.Sel, 9007 9002 pMixedCtx->rip, pVmxTransient->uExitIntrErrorCode, pMixedCtx->cr3)); 9008 9003 -
trunk/src/VBox/VMM/VMMR0/HWVMXR0.h
r45904 r46076 74 74 VMXReadVmcs64(idxField, pVal) \ 75 75 : VMXReadVmcs32(idxField, (uint32_t *)pVal) 76 # define VMXReadVmcsGstN(idxField, pVal) (pVCpu->CTX_SUFF(pVM)->hm.s.fAllow64BitGuests) ? \ 77 VMXReadVmcs64(idxField, pVal) \ 78 : VMXReadVmcs32(idxField, (uint32_t *)pVal) 79 # define VMXReadVmcsGstNByIdxVal(idxField, pVal) VMXReadVmcsGstN(idxField, pVal) 76 # define VMXReadVmcsGstN VMXReadVmcsHstN 77 # define VMXReadVmcsGstNByIdxVal VMXReadVmcsHstN 80 78 # elif HC_ARCH_BITS == 32 81 79 # define VMXReadVmcsHstN VMXReadVmcs32
Note:
See TracChangeset
for help on using the changeset viewer.