Changeset 45919 in vbox for trunk/src/VBox/VMM
- Timestamp:
- May 6, 2013 4:01:47 PM (12 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/HM.cpp
r45916 r45919 731 731 HM_REG_COUNTER(&pVCpu->hm.s.StatLoadFull, "/HM/CPU%d/Load/Full", "VM-entry loading more of the state."); 732 732 733 HM_REG_COUNTER(&pVCpu->hm.s.StatVmxCheckBadRmSelBase, "/HM/CPU%d/VMXCheck/RMSelBase", "Could not use VMX due to unsuitable real-mode selector base."); 734 HM_REG_COUNTER(&pVCpu->hm.s.StatVmxCheckBadRmSelLimit, "/HM/CPU%d/VMXCheck/RMSelLimit", "Could not use VMX due to unsuitable real-mode selector limit."); 735 HM_REG_COUNTER(&pVCpu->hm.s.StatVmxCheckRmOk, "/HM/CPU%d/VMXCheck/VMX_RM", "VMX execution in real (V86) mode OK."); 736 737 HM_REG_COUNTER(&pVCpu->hm.s.StatVmxCheckBadSel, "/HM/CPU%d/VMXCheck/Selector", "Could not use VMX due to unsuitable selector."); 738 HM_REG_COUNTER(&pVCpu->hm.s.StatVmxCheckBadRpl, "/HM/CPU%d/VMXCheck/RPL", "Could not use VMX due to unsuitable RPL."); 739 HM_REG_COUNTER(&pVCpu->hm.s.StatVmxCheckBadLdt, "/HM/CPU%d/VMXCheck/LDT", "Could not use VMX due to unsuitable LDT."); 740 HM_REG_COUNTER(&pVCpu->hm.s.StatVmxCheckBadTr, "/HM/CPU%d/VMXCheck/TR", "Could not use VMX due to unsuitable TR."); 741 HM_REG_COUNTER(&pVCpu->hm.s.StatVmxCheckPmOk, "/HM/CPU%d/VMXCheck/VMX_PM", "VMX execution in protected mode OK."); 742 733 743 #if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL) 734 744 HM_REG_COUNTER(&pVCpu->hm.s.StatFpu64SwitchBack, "/HM/CPU%d/Switch64/Fpu", "Saving guest FPU/XMM state."); … … 2525 2535 || pCtx->ss.Sel != (pCtx->ss.u64Base >> 4) 2526 2536 || pCtx->fs.Sel != (pCtx->fs.u64Base >> 4) 2527 || pCtx->gs.Sel != (pCtx->gs.u64Base >> 4) 2528 || (pCtx->cs.u32Limit != 0xffff) 2537 || pCtx->gs.Sel != (pCtx->gs.u64Base >> 4)) 2538 { 2539 STAM_COUNTER_INC(&pVCpu->hm.s.StatVmxCheckBadRmSelBase); 2540 return false; 2541 } 2542 if ( (pCtx->cs.u32Limit != 0xffff) 2529 2543 || (pCtx->ds.u32Limit != 0xffff) 2530 2544 || (pCtx->es.u32Limit != 0xffff) … … 2533 2547 || (pCtx->gs.u32Limit != 0xffff)) 2534 2548 { 2549 STAM_COUNTER_INC(&pVCpu->hm.s.StatVmxCheckBadRmSelLimit); 2535 2550 return false; 2536 2551 } 2552 STAM_COUNTER_INC(&pVCpu->hm.s.StatVmxCheckRmOk); 2537 2553 } 2538 2554 else … … 2557 2573 || (pCtx->gs.Sel & X86_SEL_RPL) 2558 2574 || (pCtx->ss.Sel & X86_SEL_RPL)) 2575 { 2576 STAM_COUNTER_INC(&pVCpu->hm.s.StatVmxCheckBadSel); 2577 return false; 2578 } 2559 2579 #else 2560 if ( ((pCtx->cs.Sel & X86_SEL_RPL) != (pCtx->ss.Sel & X86_SEL_RPL)) 2561 || !hmR3IsCodeSelectorOkForVmx(&pCtx->cs, pCtx->ss.Attr.n.u2Dpl) 2580 if ((pCtx->cs.Sel & X86_SEL_RPL) != (pCtx->ss.Sel & X86_SEL_RPL)) 2581 { 2582 STAM_COUNTER_INC(&pVCpu->hm.s.StatVmxCheckBadRpl); 2583 return false; 2584 } 2585 if ( !hmR3IsCodeSelectorOkForVmx(&pCtx->cs, pCtx->ss.Attr.n.u2Dpl) 2562 2586 || !hmR3IsDataSelectorOkForVmx(&pCtx->ds) 2563 2587 || !hmR3IsDataSelectorOkForVmx(&pCtx->es) … … 2565 2589 || !hmR3IsDataSelectorOkForVmx(&pCtx->gs) 2566 2590 || !hmR3IsStackSelectorOkForVmx(&pCtx->ss)) 2591 { 2592 STAM_COUNTER_INC(&pVCpu->hm.s.StatVmxCheckBadSel); 2593 return false; 2594 } 2567 2595 #endif 2596 } 2597 /* VT-x also chokes on invalid tr or ldtr selectors (minix) */ 2598 if (pCtx->gdtr.cbGdt) 2599 { 2600 if (pCtx->tr.Sel > pCtx->gdtr.cbGdt) 2568 2601 { 2602 STAM_COUNTER_INC(&pVCpu->hm.s.StatVmxCheckBadTr); 2603 return false; 2604 } 2605 else if (pCtx->ldtr.Sel > pCtx->gdtr.cbGdt) 2606 { 2607 STAM_COUNTER_INC(&pVCpu->hm.s.StatVmxCheckBadLdt); 2569 2608 return false; 2570 2609 } 2571 2610 } 2572 /* VT-x also chokes on invalid tr or ldtr selectors (minix) */ 2573 if ( pCtx->gdtr.cbGdt 2574 && ( pCtx->tr.Sel > pCtx->gdtr.cbGdt 2575 || pCtx->ldtr.Sel > pCtx->gdtr.cbGdt)) 2576 { 2577 return false; 2578 } 2611 STAM_COUNTER_INC(&pVCpu->hm.s.StatVmxCheckPmOk); 2579 2612 } 2580 2613 } -
trunk/src/VBox/VMM/include/HMInternal.h
r45845 r45919 885 885 STAMCOUNTER StatLoadFull; 886 886 887 STAMCOUNTER StatVmxCheckBadRmSelBase; 888 STAMCOUNTER StatVmxCheckBadRmSelLimit; 889 STAMCOUNTER StatVmxCheckRmOk; 890 891 STAMCOUNTER StatVmxCheckBadSel; 892 STAMCOUNTER StatVmxCheckBadRpl; 893 STAMCOUNTER StatVmxCheckBadLdt; 894 STAMCOUNTER StatVmxCheckBadTr; 895 STAMCOUNTER StatVmxCheckPmOk; 896 887 897 #if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL) 888 898 STAMCOUNTER StatFpu64SwitchBack;
Note:
See TracChangeset
for help on using the changeset viewer.