Changeset 45641 in vbox for trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
- Timestamp:
- Apr 19, 2013 12:30:57 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r45639 r45641 68 68 * Updated-guest-state flags. 69 69 */ 70 #define HMVMX_UPDATED_GUEST_FPU RT_BIT(0) 71 #define HMVMX_UPDATED_GUEST_RIP RT_BIT(1) 72 #define HMVMX_UPDATED_GUEST_RSP RT_BIT(2) 73 #define HMVMX_UPDATED_GUEST_RFLAGS RT_BIT(3) 74 #define HMVMX_UPDATED_GUEST_CR0 RT_BIT(4) 75 #define HMVMX_UPDATED_GUEST_CR3 RT_BIT(5) 76 #define HMVMX_UPDATED_GUEST_CR4 RT_BIT(6) 77 #define HMVMX_UPDATED_GUEST_GDTR RT_BIT(7) 78 #define HMVMX_UPDATED_GUEST_IDTR RT_BIT(8) 79 #define HMVMX_UPDATED_GUEST_LDTR RT_BIT(9) 80 #define HMVMX_UPDATED_GUEST_TR RT_BIT(10) 81 #define HMVMX_UPDATED_GUEST_SEGMENT_REGS RT_BIT(11) 82 #define HMVMX_UPDATED_GUEST_DEBUG RT_BIT(12) 83 #define HMVMX_UPDATED_GUEST_FS_BASE_MSR RT_BIT(13) 84 #define HMVMX_UPDATED_GUEST_GS_BASE_MSR RT_BIT(14) 85 #define HMVMX_UPDATED_GUEST_SYSENTER_CS_MSR RT_BIT(15) 86 #define HMVMX_UPDATED_GUEST_SYSENTER_EIP_MSR RT_BIT(16) 87 #define HMVMX_UPDATED_GUEST_SYSENTER_ESP_MSR RT_BIT(17) 88 #define HMVMX_UPDATED_GUEST_AUTO_LOAD_STORE_MSRS RT_BIT(18) 89 #define HMVMX_UPDATED_GUEST_ACTIVITY_STATE RT_BIT(19) 90 #define HMVMX_UPDATED_GUEST_APIC_STATE RT_BIT(20) 91 #define HMVMX_UPDATED_GUEST_ALL ( HMVMX_UPDATED_GUEST_FPU \ 92 | HMVMX_UPDATED_GUEST_RIP \ 70 #define HMVMX_UPDATED_GUEST_RIP RT_BIT(0) 71 #define HMVMX_UPDATED_GUEST_RSP RT_BIT(1) 72 #define HMVMX_UPDATED_GUEST_RFLAGS RT_BIT(2) 73 #define HMVMX_UPDATED_GUEST_CR0 RT_BIT(3) 74 #define HMVMX_UPDATED_GUEST_CR3 RT_BIT(4) 75 #define HMVMX_UPDATED_GUEST_CR4 RT_BIT(5) 76 #define HMVMX_UPDATED_GUEST_GDTR RT_BIT(6) 77 #define HMVMX_UPDATED_GUEST_IDTR RT_BIT(7) 78 #define HMVMX_UPDATED_GUEST_LDTR RT_BIT(8) 79 #define HMVMX_UPDATED_GUEST_TR RT_BIT(9) 80 #define HMVMX_UPDATED_GUEST_SEGMENT_REGS RT_BIT(10) 81 #define HMVMX_UPDATED_GUEST_DEBUG RT_BIT(11) 82 #define HMVMX_UPDATED_GUEST_FS_BASE_MSR RT_BIT(12) 83 #define HMVMX_UPDATED_GUEST_GS_BASE_MSR RT_BIT(13) 84 #define HMVMX_UPDATED_GUEST_SYSENTER_CS_MSR RT_BIT(14) 85 #define HMVMX_UPDATED_GUEST_SYSENTER_EIP_MSR RT_BIT(15) 86 #define HMVMX_UPDATED_GUEST_SYSENTER_ESP_MSR RT_BIT(16) 87 #define HMVMX_UPDATED_GUEST_AUTO_LOAD_STORE_MSRS RT_BIT(17) 88 #define HMVMX_UPDATED_GUEST_ACTIVITY_STATE RT_BIT(18) 89 #define HMVMX_UPDATED_GUEST_APIC_STATE RT_BIT(19) 90 #define HMVMX_UPDATED_GUEST_ALL ( HMVMX_UPDATED_GUEST_RIP \ 93 91 | HMVMX_UPDATED_GUEST_RSP \ 94 92 | HMVMX_UPDATED_GUEST_RFLAGS \ … … 370 368 /* 59 VMX_EXIT_VMFUNC */ hmR0VmxExitSetPendingXcptUD 371 369 }; 372 373 370 #endif /* HMVMX_USE_FUNCTION_TABLE */ 374 371 … … 4573 4570 /** 4574 4571 * Determines if an exception is a contributory exception. Contributory 4575 * exceptions are ones which can cause double-faults. 4572 * exceptions are ones which can cause double-faults. Page-fault is 4573 * intentionally not included here as it's a conditional contributory exception. 4576 4574 * 4577 4575 * @returns true if the exception is contributory, false otherwise. … … 4596 4594 4597 4595 /** 4598 * Determines if an exception is a benign exception. Benign exceptions4599 * are ones which cannot cause double-faults.4600 *4601 * @returns true if the exception is benign, false otherwise.4602 * @param uVector The exception vector.4603 */4604 DECLINLINE(bool) hmR0VmxIsBenignXcpt(const uint32_t uVector)4605 {4606 if ( uVector == X86_XCPT_PF4607 || uVector == X86_XCPT_DF)4608 {4609 return false;4610 }4611 4612 bool fIsBenignXcpt = !hmR0VmxIsContributoryXcpt(uVector);4613 #ifdef VBOX_STRICT4614 switch (uVector)4615 {4616 case X86_XCPT_DB:4617 case X86_XCPT_NMI:4618 case X86_XCPT_BP:4619 case X86_XCPT_OF:4620 case X86_XCPT_BR:4621 case X86_XCPT_UD:4622 case X86_XCPT_NM:4623 case X86_XCPT_CO_SEG_OVERRUN:4624 case X86_XCPT_MF:4625 case X86_XCPT_AC:4626 case X86_XCPT_MC:4627 case X86_XCPT_XF:4628 AssertMsg(fIsBenignXcpt, ("%#x\n", uVector));4629 break;4630 default:4631 AssertMsg(!fIsBenignXcpt, ("%#x\n", uVector));4632 break;4633 }4634 #endif4635 return fIsBenignXcpt;4636 }4637 4638 4639 /**4640 4596 * Sets an event as a pending event to be injected into the guest. 4641 4597 * … … 4726 4682 enmReflect = VMXREFLECTXCPT_XCPT; 4727 4683 if ( hmR0VmxIsContributoryXcpt(uIdtVector) 4728 4684 && uExitVector == X86_XCPT_PF) 4729 4685 { 4730 4686 GCPtrFaultAddress = pMixedCtx->cr2; … … 4817 4773 { 4818 4774 int rc = VINF_SUCCESS; 4819 if ( !(pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_CR0) 4820 || !(pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_FPU)) 4775 if (!(pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_CR0)) 4821 4776 { 4822 4777 RTGCUINTREG uVal = 0; … … 4827 4782 uVal = (uShadow & pVCpu->hm.s.vmx.cr0_mask) | (uVal & ~pVCpu->hm.s.vmx.cr0_mask); 4828 4783 CPUMSetGuestCR0(pVCpu, uVal); 4829 pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_CR0 | HMVMX_UPDATED_GUEST_FPU;4784 pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_CR0; 4830 4785 } 4831 4786 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.