- Timestamp:
- Apr 12, 2013 11:23:56 AM (12 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r45513 r45517 997 997 998 998 uint64_t descriptor[2]; 999 descriptor[0] = pVCpu->hm.s.vmx. GCPhysEPTP;999 descriptor[0] = pVCpu->hm.s.vmx.HCPhysEPTP; 1000 1000 descriptor[1] = 0; /* MBZ. Intel spec. 33.3 "VMX Instructions" */ 1001 1001 1002 1002 int rc = VMXR0InvEPT(enmFlush, &descriptor[0]); 1003 AssertMsg(rc == VINF_SUCCESS, ("VMXR0InvEPT %#x %RGv failed with %Rrc\n", enmFlush, pVCpu->hm.s.vmx. GCPhysEPTP, rc));1003 AssertMsg(rc == VINF_SUCCESS, ("VMXR0InvEPT %#x %RGv failed with %Rrc\n", enmFlush, pVCpu->hm.s.vmx.HCPhysEPTP, rc)); 1004 1004 STAM_COUNTER_INC(&pVCpu->hm.s.StatFlushNestedPaging); 1005 1005 } … … 2813 2813 if (pVM->hm.s.fNestedPaging) 2814 2814 { 2815 pVCpu->hm.s.vmx. GCPhysEPTP = PGMGetHyperCR3(pVCpu);2815 pVCpu->hm.s.vmx.HCPhysEPTP = PGMGetHyperCR3(pVCpu); 2816 2816 2817 2817 /* Validate. See Intel spec. 28.2.2 "EPT Translation Mechanism" and 24.6.11 "Extended-Page-Table Pointer (EPTP)" */ 2818 Assert(pVCpu->hm.s.vmx. GCPhysEPTP);2819 Assert(!(pVCpu->hm.s.vmx. GCPhysEPTP & 0xfff0000000000000ULL));2820 Assert(!(pVCpu->hm.s.vmx. GCPhysEPTP & 0xfff));2818 Assert(pVCpu->hm.s.vmx.HCPhysEPTP); 2819 Assert(!(pVCpu->hm.s.vmx.HCPhysEPTP & 0xfff0000000000000ULL)); 2820 Assert(!(pVCpu->hm.s.vmx.HCPhysEPTP & 0xfff)); 2821 2821 2822 2822 /* VMX_EPT_MEMTYPE_WB support is already checked in hmR0VmxSetupTaggedTlb(). */ 2823 pVCpu->hm.s.vmx. GCPhysEPTP |= VMX_EPT_MEMTYPE_WB2823 pVCpu->hm.s.vmx.HCPhysEPTP |= VMX_EPT_MEMTYPE_WB 2824 2824 | (VMX_EPT_PAGE_WALK_LENGTH_DEFAULT << VMX_EPT_PAGE_WALK_LENGTH_SHIFT); 2825 2825 2826 2826 /* Validate. See Intel spec. 26.2.1 "Checks on VMX Controls" */ 2827 AssertMsg( ((pVCpu->hm.s.vmx. GCPhysEPTP >> 3) & 0x07) == 3 /* Bits 3:5 (EPT page walk length - 1) must be 3. */2828 && ((pVCpu->hm.s.vmx. GCPhysEPTP >> 6) & 0x3f) == 0, /* Bits 6:11 MBZ. */2829 ("EPTP %#RX64\n", pVCpu->hm.s.vmx. GCPhysEPTP));2830 2831 rc = VMXWriteVmcs64(VMX_VMCS64_CTRL_EPTP_FULL, pVCpu->hm.s.vmx. GCPhysEPTP);2827 AssertMsg( ((pVCpu->hm.s.vmx.HCPhysEPTP >> 3) & 0x07) == 3 /* Bits 3:5 (EPT page walk length - 1) must be 3. */ 2828 && ((pVCpu->hm.s.vmx.HCPhysEPTP >> 6) & 0x3f) == 0, /* Bits 6:11 MBZ. */ 2829 ("EPTP %#RX64\n", pVCpu->hm.s.vmx.HCPhysEPTP)); 2830 2831 rc = VMXWriteVmcs64(VMX_VMCS64_CTRL_EPTP_FULL, pVCpu->hm.s.vmx.HCPhysEPTP); 2832 2832 AssertRCReturn(rc, rc); 2833 Log(("VMX_VMCS64_CTRL_EPTP_FULL=%#RX64\n", pVCpu->hm.s.vmx. GCPhysEPTP));2833 Log(("VMX_VMCS64_CTRL_EPTP_FULL=%#RX64\n", pVCpu->hm.s.vmx.HCPhysEPTP)); 2834 2834 2835 2835 if ( pVM->hm.s.vmx.fUnrestrictedGuest … … 7660 7660 { 7661 7661 VMX_VALIDATE_EXIT_HANDLER_PARAMS(); 7662 STAM_PROFILE_ADV_START(&pVCpu->hm.s.StatExitMovCRx, y2); 7662 7663 int rc = hmR0VmxReadExitQualificationVmcs(pVCpu, pVmxTransient); 7663 7664 AssertRCReturn(rc, rc); … … 7766 7767 { 7767 7768 AssertMsgFailed(("Invalid access-type in Mov CRx exit qualification %#x\n", uAccessType)); 7768 r eturnVERR_VMX_UNEXPECTED_EXCEPTION;7769 rc = VERR_VMX_UNEXPECTED_EXCEPTION; 7769 7770 } 7770 7771 } 7771 7772 7772 7773 /* Validate possible error codes. */ 7773 Assert(rc == VINF_SUCCESS || rc == VINF_PGM_CHANGE_MODE || rc == VERR_EM_INTERPRETER || rc == VINF_PGM_SYNC_CR3); 7774 Assert(rc == VINF_SUCCESS || rc == VINF_PGM_CHANGE_MODE || rc == VERR_EM_INTERPRETER || rc == VINF_PGM_SYNC_CR3 7775 || rc == VERR_VMX_UNEXPECTED_EXCEPTION); 7774 7776 if (RT_SUCCESS(rc)) 7775 7777 { … … 7778 7780 } 7779 7781 7782 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitMovCRx, y2); 7780 7783 return rc; 7781 7784 } … … 7789 7792 { 7790 7793 VMX_VALIDATE_EXIT_HANDLER_PARAMS(); 7794 STAM_PROFILE_ADV_START(&pVCpu->hm.s.StatExitIO, y1); 7791 7795 7792 7796 int rc = hmR0VmxReadExitQualificationVmcs(pVCpu, pVmxTransient); … … 7948 7952 #endif 7949 7953 7954 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitIO, y1); 7950 7955 return rc; 7951 7956 } -
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r45503 r45517 2216 2216 { 2217 2217 Assert(PGMGetHyperCR3(pVCpu)); 2218 pVCpu->hm.s.vmx. GCPhysEPTP = PGMGetHyperCR3(pVCpu);2219 2220 Assert(!(pVCpu->hm.s.vmx. GCPhysEPTP & 0xfff));2218 pVCpu->hm.s.vmx.HCPhysEPTP = PGMGetHyperCR3(pVCpu); 2219 2220 Assert(!(pVCpu->hm.s.vmx.HCPhysEPTP & 0xfff)); 2221 2221 /** @todo Check the IA32_VMX_EPT_VPID_CAP MSR for other supported memory types. */ 2222 pVCpu->hm.s.vmx. GCPhysEPTP |= VMX_EPT_MEMTYPE_WB2222 pVCpu->hm.s.vmx.HCPhysEPTP |= VMX_EPT_MEMTYPE_WB 2223 2223 | (VMX_EPT_PAGE_WALK_LENGTH_DEFAULT << VMX_EPT_PAGE_WALK_LENGTH_SHIFT); 2224 2224 2225 rc = VMXWriteVmcs64(VMX_VMCS64_CTRL_EPTP_FULL, pVCpu->hm.s.vmx. GCPhysEPTP);2225 rc = VMXWriteVmcs64(VMX_VMCS64_CTRL_EPTP_FULL, pVCpu->hm.s.vmx.HCPhysEPTP); 2226 2226 AssertRC(rc); 2227 2227 … … 3531 3531 break; 3532 3532 } 3533 STAM_PROFILE_ADV_START(&pVCpu->hm.s.StatExit 2Sub3, y3);3533 STAM_PROFILE_ADV_START(&pVCpu->hm.s.StatExitXcptNmi, y3); 3534 3534 switch (VMX_EXIT_INTERRUPTION_INFO_TYPE(intInfo)) 3535 3535 { … … 3567 3567 pVCpu->hm.s.fContextUseFlags |= HM_CHANGED_GUEST_CR0; 3568 3568 3569 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExit 2Sub3, y3);3569 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitXcptNmi, y3); 3570 3570 goto ResumeExecution; 3571 3571 } … … 3576 3576 cbInstr, 0); 3577 3577 AssertRC(rc2); 3578 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExit 2Sub3, y3);3578 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitXcptNmi, y3); 3579 3579 goto ResumeExecution; 3580 3580 } … … 3601 3601 AssertRC(rc2); 3602 3602 3603 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExit 2Sub3, y3);3603 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitXcptNmi, y3); 3604 3604 goto ResumeExecution; 3605 3605 } … … 3674 3674 3675 3675 TRPMResetTrap(pVCpu); 3676 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExit 2Sub3, y3);3676 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitXcptNmi, y3); 3677 3677 goto ResumeExecution; 3678 3678 } … … 3696 3696 AssertRC(rc2); 3697 3697 3698 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExit 2Sub3, y3);3698 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitXcptNmi, y3); 3699 3699 goto ResumeExecution; 3700 3700 } … … 3727 3727 AssertRC(rc2); 3728 3728 3729 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExit 2Sub3, y3);3729 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitXcptNmi, y3); 3730 3730 goto ResumeExecution; 3731 3731 } … … 3779 3779 AssertRC(rc2); 3780 3780 3781 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExit 2Sub3, y3);3781 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitXcptNmi, y3); 3782 3782 goto ResumeExecution; 3783 3783 } … … 3797 3797 cbInstr, errCode); 3798 3798 AssertRC(rc2); 3799 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExit 2Sub3, y3);3799 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitXcptNmi, y3); 3800 3800 goto ResumeExecution; 3801 3801 } 3802 3802 if (rc == VINF_SUCCESS) 3803 3803 { 3804 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExit 2Sub3, y3);3804 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitXcptNmi, y3); 3805 3805 goto ResumeExecution; 3806 3806 } … … 3823 3823 cbInstr, errCode); 3824 3824 AssertRC(rc2); 3825 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExit 2Sub3, y3);3825 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitXcptNmi, y3); 3826 3826 goto ResumeExecution; 3827 3827 } … … 4055 4055 4056 4056 /* Only resume if successful. */ 4057 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExit 2Sub3, y3);4057 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitXcptNmi, y3); 4058 4058 goto ResumeExecution; 4059 4059 } … … 4088 4088 AssertRC(rc2); 4089 4089 4090 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExit 2Sub3, y3);4090 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitXcptNmi, y3); 4091 4091 goto ResumeExecution; 4092 4092 } … … 4109 4109 } 4110 4110 4111 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExit 2Sub3, y3);4111 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitXcptNmi, y3); 4112 4112 goto ResumeExecution; 4113 4113 } … … 4125 4125 } 4126 4126 4127 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExit 2Sub3, y3);4127 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitXcptNmi, y3); 4128 4128 break; 4129 4129 } … … 4416 4416 case VMX_EXIT_MOV_CRX: /* 28 Control-register accesses. */ 4417 4417 { 4418 STAM_PROFILE_ADV_START(&pVCpu->hm.s.StatExit 2Sub2, y2);4418 STAM_PROFILE_ADV_START(&pVCpu->hm.s.StatExitMovCRx, y2); 4419 4419 4420 4420 switch (VMX_EXIT_QUALIFICATION_CRX_ACCESS(exitQualification)) … … 4499 4499 { 4500 4500 /* Only resume if successful. */ 4501 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExit 2Sub2, y2);4501 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitMovCRx, y2); 4502 4502 goto ResumeExecution; 4503 4503 } 4504 4504 Assert(rc == VERR_EM_INTERPRETER || rc == VINF_PGM_CHANGE_MODE || rc == VINF_PGM_SYNC_CR3); 4505 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExit 2Sub2, y2);4505 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitMovCRx, y2); 4506 4506 break; 4507 4507 } … … 4579 4579 case VMX_EXIT_IO_INSTR: /* 30 I/O instruction. */ 4580 4580 { 4581 STAM_PROFILE_ADV_START(&pVCpu->hm.s.StatExit 2Sub1, y1);4581 STAM_PROFILE_ADV_START(&pVCpu->hm.s.StatExitIO, y1); 4582 4582 uint32_t uPort; 4583 4583 uint32_t uIOWidth = VMX_EXIT_QUALIFICATION_IO_WIDTH(exitQualification); … … 4593 4593 { 4594 4594 rc = fIOWrite ? VINF_IOM_R3_IOPORT_WRITE : VINF_IOM_R3_IOPORT_READ; 4595 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExit 2Sub1, y1);4595 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitIO, y1); 4596 4596 break; 4597 4597 } … … 4720 4720 AssertRC(rc2); 4721 4721 4722 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExit 2Sub1, y1);4722 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitIO, y1); 4723 4723 goto ResumeExecution; 4724 4724 } 4725 4725 } 4726 4726 } 4727 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExit 2Sub1, y1);4727 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitIO, y1); 4728 4728 goto ResumeExecution; 4729 4729 } 4730 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExit 2Sub1, y1);4730 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitIO, y1); 4731 4731 break; 4732 4732 } … … 4745 4745 } 4746 4746 #endif 4747 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExit 2Sub1, y1);4747 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitIO, y1); 4748 4748 break; 4749 4749 } … … 5152 5152 LogFlow(("hmR0VmxFlushEPT %d\n", enmFlush)); 5153 5153 Assert(pVM->hm.s.fNestedPaging); 5154 descriptor[0] = pVCpu->hm.s.vmx. GCPhysEPTP;5154 descriptor[0] = pVCpu->hm.s.vmx.HCPhysEPTP; 5155 5155 descriptor[1] = 0; /* MBZ. Intel spec. 33.3 VMX Instructions */ 5156 5156 int rc = VMXR0InvEPT(enmFlush, &descriptor[0]); 5157 AssertMsg(rc == VINF_SUCCESS, ("VMXR0InvEPT %x %RGv failed with %d\n", enmFlush, pVCpu->hm.s.vmx. GCPhysEPTP, rc));5157 AssertMsg(rc == VINF_SUCCESS, ("VMXR0InvEPT %x %RGv failed with %d\n", enmFlush, pVCpu->hm.s.vmx.HCPhysEPTP, rc)); 5158 5158 #ifdef VBOX_WITH_STATISTICS 5159 5159 STAM_COUNTER_INC(&pVCpu->hm.s.StatFlushNestedPaging); -
trunk/src/VBox/VMM/VMMR3/HM.cpp
r45500 r45517 495 495 "/PROF/CPU%d/HM/SwitchFromGC_2", i); 496 496 AssertRC(rc); 497 # ifdef VBOX_WITH_OLD_VTX_CODE 498 /* temporary for tracking down darwin holdup. */ 499 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatExit2Sub1, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, 500 "Temporary - I/O", 501 "/PROF/CPU%d/HM/SwitchFromGC_2/Sub1", i); 497 498 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatExitIO, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, 499 "I/O", 500 "/PROF/CPU%d/HM/SwitchFromGC_2/IO", i); 502 501 AssertRC(rc); 503 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatExit 2Sub2, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL,504 " Temporary - CRx RWs",505 "/PROF/CPU%d/HM/SwitchFromGC_2/ Sub2", i);502 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatExitMovCRx, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, 503 "MOV CRx", 504 "/PROF/CPU%d/HM/SwitchFromGC_2/MovCRx", i); 506 505 AssertRC(rc); 507 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatExit 2Sub3, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL,508 " Temporary - Exceptions",509 "/PROF/CPU%d/HM/SwitchFromGC_2/ Sub3", i);506 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatExitXcptNmi, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, 507 "Exceptions, NMIs", 508 "/PROF/CPU%d/HM/SwitchFromGC_2/XcptNmi", i); 510 509 AssertRC(rc); 511 # endif 510 512 511 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatLoadGuestState, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, 513 512 "Profiling of VMXR0LoadGuestState", -
trunk/src/VBox/VMM/include/HMInternal.h
r45503 r45517 628 628 uint32_t fUpdatedGuestState; 629 629 /** Current EPTP. */ 630 RTHCPHYS GCPhysEPTP;630 RTHCPHYS HCPhysEPTP; 631 631 632 632 /** Physical address of the MSR bitmap. */ … … 793 793 STAMPROFILEADV StatExit1; 794 794 STAMPROFILEADV StatExit2; 795 #ifdef VBOX_WITH_OLD_VTX_CODE /* "temporary" for tracking down darwin issues. */ 796 STAMPROFILEADV StatExit2Sub1; 797 STAMPROFILEADV StatExit2Sub2; 798 STAMPROFILEADV StatExit2Sub3; 799 #endif 795 STAMPROFILEADV StatExitIO; 796 STAMPROFILEADV StatExitMovCRx; 797 STAMPROFILEADV StatExitXcptNmi; 800 798 STAMPROFILEADV StatLoadGuestState; 801 799 STAMPROFILEADV StatInGC;
Note:
See TracChangeset
for help on using the changeset viewer.