Changeset 46557 in vbox
- Timestamp:
- Jun 14, 2013 12:47:59 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/hm_svm.h
r46551 r46557 259 259 /** MONITOR instruction. */ 260 260 #define SVM_EXIT_MONITOR 0x8A 261 /** MWAIT instruction uncond. */262 #define SVM_EXIT_MWAIT _UNCOND0x8B263 /** MWAIT instruction when armed. */261 /** MWAIT instruction. */ 262 #define SVM_EXIT_MWAIT 0x8B 263 /** MWAIT instruction, when armed. */ 264 264 #define SVM_EXIT_MWAIT_ARMED 0x8C 265 265 /** Nested paging: host-level page fault occurred (EXITINFO1 contains fault errorcode; EXITINFO2 contains the guest physical address causing the fault). */ … … 394 394 #define SVM_CTRL2_INTERCEPT_MONITOR RT_BIT(10) 395 395 /** 11 Intercept MWAIT instruction unconditionally. */ 396 #define SVM_CTRL2_INTERCEPT_MWAIT _UNCONDRT_BIT(11)396 #define SVM_CTRL2_INTERCEPT_MWAIT RT_BIT(11) 397 397 /** 12 Intercept MWAIT instruction when armed. */ 398 398 #define SVM_CTRL2_INTERCEPT_MWAIT_ARMED RT_BIT(12) -
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r46551 r46557 575 575 | SVM_CTRL2_INTERCEPT_WBINVD /* WBINVD causes a VM-exit. */ 576 576 | SVM_CTRL2_INTERCEPT_MONITOR /* MONITOR causes a VM-exit. */ 577 | SVM_CTRL2_INTERCEPT_MWAIT _UNCOND;/* MWAIT causes a VM-exit. */577 | SVM_CTRL2_INTERCEPT_MWAIT; /* MWAIT causes a VM-exit. */ 578 578 579 579 /* CR0, CR4 reads must be intercepted, our shadow values are not necessarily the same as the guest's. */ … … 2632 2632 switch (pSvmTransient->u64ExitCode) 2633 2633 { 2634 case SVM_EXIT_CPUID: 2635 return hmR0SvmExitCpuid(pVCpu, pCtx, pSvmTransient); 2636 2637 case SVM_EXIT_RDTSC: 2638 return hmR0SvmExitRdtsc(pVCpu, pCtx, pSvmTransient); 2639 2640 case SVM_EXIT_RDTSCP: 2641 return hmR0SvmExitRdtscp(pVCpu, pCtx, pSvmTransient); 2642 2643 case SVM_EXIT_MONITOR: 2644 return hmR0SvmExitMonitor(pVCpu, pCtx, pSvmTransient); 2645 2646 case SVM_EXIT_MWAIT: 2647 return hmR0SvmExitMwait(pVCpu, pCtx, pSvmTransient); 2648 2634 2649 case SVM_EXIT_WRITE_CR0: 2635 2650 case SVM_EXIT_WRITE_CR3: … … 2657 2672 case SVM_EXIT_INVD: 2658 2673 return hmR0SvmExitInvd(pVCpu, pCtx, pSvmTransient); 2674 2675 case SVM_EXIT_RDPMC: 2676 return hmR0SvmExitRdpmc(pVCpu, pCtx, pSvmTransient); 2677 2678 case SVM_EXIT_READ_DR0: case SVM_EXIT_READ_DR1: case SVM_EXIT_READ_DR2: case SVM_EXIT_READ_DR3: 2679 case SVM_EXIT_READ_DR6: case SVM_EXIT_READ_DR7: case SVM_EXIT_READ_DR8: case SVM_EXIT_READ_DR9: 2680 case SVM_EXIT_READ_DR10: case SVM_EXIT_READ_DR11: case SVM_EXIT_READ_DR12: case SVM_EXIT_READ_DR13: 2681 case SVM_EXIT_READ_DR14: case SVM_EXIT_READ_DR15: 2682 return hmR0SvmExitReadDRx(pVCpu, pCtx, pSvmTransient); 2683 2684 case SVM_EXIT_WRITE_DR0: case SVM_EXIT_WRITE_DR1: case SVM_EXIT_WRITE_DR2: case SVM_EXIT_WRITE_DR3: 2685 case SVM_EXIT_WRITE_DR6: case SVM_EXIT_WRITE_DR7: case SVM_EXIT_WRITE_DR8: case SVM_EXIT_WRITE_DR9: 2686 case SVM_EXIT_WRITE_DR10: case SVM_EXIT_WRITE_DR11: case SVM_EXIT_WRITE_DR12: case SVM_EXIT_WRITE_DR13: 2687 case SVM_EXIT_WRITE_DR14: case SVM_EXIT_WRITE_DR15: 2688 return hmR0SvmExitWriteDRx(pVCpu, pCtx, pSvmTransient); 2659 2689 2660 2690 default: … … 2670 2700 return hmR0SvmExitSetPendingXcptUD(pVCpu, pCtx, pSvmTransient); 2671 2701 2672 case SVM_EXIT_MWAIT_ARMED:2673 case SVM_EXIT_PAUSE:2674 case SVM_EXIT_IDTR_READ:2675 case SVM_EXIT_GDTR_READ:2676 case SVM_EXIT_LDTR_READ:2677 case SVM_EXIT_TR_READ:2678 case SVM_EXIT_IDTR_WRITE:2679 case SVM_EXIT_GDTR_WRITE:2680 case SVM_EXIT_LDTR_WRITE:2681 case SVM_EXIT_TR_WRITE:2682 case SVM_EXIT_CR0_SEL_WRITE:2683 case SVM_EXIT_READ_CR1: case SVM_EXIT_WRITE_CR1:2684 case SVM_EXIT_READ_CR2: case SVM_EXIT_WRITE_CR2:2685 case SVM_EXIT_READ_CR5: case SVM_EXIT_WRITE_CR5:2686 case SVM_EXIT_READ_CR6: case SVM_EXIT_WRITE_CR6:2687 case SVM_EXIT_READ_CR7: case SVM_EXIT_WRITE_CR7:2688 case SVM_EXIT_READ_CR8:2689 case SVM_EXIT_READ_CR9: case SVM_EXIT_WRITE_CR9:2690 case SVM_EXIT_READ_CR10: case SVM_EXIT_WRITE_CR10:2691 case SVM_EXIT_READ_CR11: case SVM_EXIT_WRITE_CR11:2692 case SVM_EXIT_READ_CR12: case SVM_EXIT_WRITE_CR12:2693 case SVM_EXIT_READ_CR13: case SVM_EXIT_WRITE_CR13:2694 case SVM_EXIT_READ_CR14: case SVM_EXIT_WRITE_CR14:2695 case SVM_EXIT_READ_CR15: case SVM_EXIT_WRITE_CR15:2696 2702 default: 2697 2703 { … … 2741 2747 * 2742 2748 * @return VBox status code. 2743 * @param pVCpu Pointer to the VMCPU.2749 * @param pVCpu hmR0SvmExitReadDRx Pointer to the VMCPU. 2744 2750 * @param pCpu Pointer to the disassembler state. 2745 2751 * @param pRegFrame Pointer to the register frame. … … 2914 2920 * #VMEXIT handler for RDTSCP (SVM_EXIT_RDTSCP). Conditional #VMEXIT. 2915 2921 */ 2916 HMSVM_EXIT_DECL hmR0SvmExitRdtsc (PVMCPU pVCpu, PCPUMCTX pCtx, PSVMTRANSIENT pSvmTransient)2922 HMSVM_EXIT_DECL hmR0SvmExitRdtscp(PVMCPU pVCpu, PCPUMCTX pCtx, PSVMTRANSIENT pSvmTransient) 2917 2923 { 2918 2924 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(); … … 2998 3004 2999 3005 /** 3000 * #VMEXIT handler for MWAIT (SVM_EXIT_MWAIT _UNCOND). Conditional #VMEXIT.3001 */ 3002 HMSVM_EXIT_DECL hmR0SvmExitM onitor(PVMCPU pVCpu, PCPUMCTX pCtx, PSVMTRANSIENT pSvmTransient)3006 * #VMEXIT handler for MWAIT (SVM_EXIT_MWAIT). Conditional #VMEXIT. 3007 */ 3008 HMSVM_EXIT_DECL hmR0SvmExitMwait(PVMCPU pVCpu, PCPUMCTX pCtx, PSVMTRANSIENT pSvmTransient) 3003 3009 { 3004 3010 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(); … … 3150 3156 3151 3157 3158 /** 3159 * #VMEXIT handler for DRx read (SVM_EXIT_READ_DRx). Conditional #VMEXIT. 3160 */ 3161 HMSVM_EXIT_DECL hmR0SvmExitReadDRx(PVMCPU pVCpu, PCPUMCTX pCtx, PSVMTRANSIENT pSvmTransient) 3162 { 3163 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(); 3164 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitDRxRead); 3165 3166 /* We should -not- get this VM-exit if the guest is debugging. */ 3167 if (CPUMIsGuestDebugStateActive(pVCpu)) 3168 { 3169 AssertMsgFailed(("hmR0SvmExitReadDRx: Unexpected exit. pVCpu=%p pCtx=%p\n", pVCpu, pCtx)); 3170 return VERR_SVM_UNEXPECTED_EXIT; 3171 } 3172 3173 if ( !DBGFIsStepping(pVCpu) 3174 && !CPUMIsHyperDebugStateActive(pVCpu)) 3175 { 3176 /* Don't intercept DRx read and writes. */ 3177 PSVMVMCB pVmcb = (PSVMVMCB)pVCpu->hm.s.svm.pvVmcb; 3178 pVmcb->ctrl.u16InterceptRdDRx = 0; 3179 pVmcb->ctrl.u16InterceptWrDRx = 0; 3180 pVmcb->ctrl.u64VmcbCleanBits &= ~HMSVM_VMCB_CLEAN_INTERCEPTS; 3181 3182 /* Save the host & load the guest debug state, restart execution of the MOV DRx instruction. */ 3183 PVM pVM = pVCpu->CTX_SUFF(pVM); 3184 rc = CPUMR0LoadGuestDebugState(pVM, pVCpu, pCtx, true /* include DR6 */); 3185 AssertRC(rc); 3186 Assert(CPUMIsGuestDebugStateActive(pVCpu)); 3187 3188 STAM_COUNTER_INC(&pVCpu->hm.s.StatDRxContextSwitch); 3189 return VINF_SUCCESS; 3190 } 3191 3192 /** @todo Decode assist. */ 3193 int rc = EMInterpretInstruction(pVCpu, CPUMCTX2CORE(pCtx), 0 /* pvFault */); 3194 if (RT_LIKELY(rc == VINF_SUCCESS)) 3195 { 3196 /* Not necessary for read accesses but whatever doesn't hurt for now, will be fixed with decode assist. */ 3197 pVCpu->hm.s.fContextUseFlags |= HM_CHANGED_GUEST_DEBUG; 3198 } 3199 else 3200 Assert(c == VERR_EM_INTERPRETER); 3201 return rc; 3202 } 3203 3204 3205 /** 3206 * #VMEXIT handler for DRx write (SVM_EXIT_WRITE_DRx). Conditional #VMEXIT. 3207 */ 3208 HMSVM_EXIT_DECL hmR0SvmExitWriteDRx(PVMCPU pVCpu, PCPUMCTX pCtx, PSVMTRANSIENT pSvmTransient) 3209 { 3210 /* For now it's the same since we interpret the instruction anyway. Will change when using of Decode Assist is implemented. */ 3211 int rc = hmR0SvmExitReadDRx(pVCpu, pCtx, pSvmTransient); 3212 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitDRxWrite); 3213 STAM_COUNTER_DEC(&pVCpu->hm.s.StatExitDRxRead); 3214 return rc; 3215 } 3216 3217 -
trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp
r46444 r46557 394 394 | SVM_CTRL2_INTERCEPT_WBINVD 395 395 | SVM_CTRL2_INTERCEPT_MONITOR 396 | SVM_CTRL2_INTERCEPT_MWAIT _UNCOND;/* don't execute mwait or else we'll idle inside the396 | SVM_CTRL2_INTERCEPT_MWAIT; /* don't execute mwait or else we'll idle inside the 397 397 guest (host thinks the cpu load is high) */ 398 398 … … 2618 2618 break; 2619 2619 2620 case SVM_EXIT_MWAIT _UNCOND:2620 case SVM_EXIT_MWAIT: 2621 2621 Log2(("SVM: mwait\n")); 2622 2622 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitMwait); -
trunk/src/VBox/VMM/VMMR3/HM.cpp
r46379 r46557 252 252 EXIT_REASON(SVM_EXIT_MSR ,124, "RDMSR or WRMSR access to protected MSR."), 253 253 EXIT_REASON(SVM_EXIT_TASK_SWITCH ,125, "Task switch."), 254 EXIT_REASON(SVM_EXIT_FERR_FREEZE ,126, " FP legacy handling enabled, andprocessor is frozen in an x87/mmx instruction waiting for an interrupt"),254 EXIT_REASON(SVM_EXIT_FERR_FREEZE ,126, "Legacy FPU handling enabled; processor is frozen in an x87/mmx instruction waiting for an interrupt"), 255 255 EXIT_REASON(SVM_EXIT_SHUTDOWN ,127, "Shutdown."), 256 256 EXIT_REASON(SVM_EXIT_VMRUN ,128, "VMRUN instruction."), … … 265 265 EXIT_REASON(SVM_EXIT_WBINVD ,137, "WBINVD instruction."), 266 266 EXIT_REASON(SVM_EXIT_MONITOR ,138, "MONITOR instruction."), 267 EXIT_REASON(SVM_EXIT_MWAIT _UNCOND ,139, "MWAIT instruction unconditional."),267 EXIT_REASON(SVM_EXIT_MWAIT ,139, "MWAIT instruction."), 268 268 EXIT_REASON(SVM_EXIT_MWAIT_ARMED ,140, "MWAIT instruction when armed."), 269 269 EXIT_REASON(SVM_EXIT_NPF ,1024, "Nested paging: host-level page fault occurred (EXITINFO1 contains fault errorcode; EXITINFO2 contains the guest physical address causing the fault)."),
Note:
See TracChangeset
for help on using the changeset viewer.