Changeset 49755 in vbox for trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
- Timestamp:
- Dec 3, 2013 2:09:51 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r49752 r49755 2541 2541 { 2542 2542 /* Initially the guest-state is up-to-date as there is nothing in the VMCS. */ 2543 pVCpu->hm.s.vmx.fUpdatedGuestState = HMVMX_UPDATED_GUEST_ALL;2543 HMVMXCPU_GST_RESET_TO(pVCpu, HMVMX_UPDATED_GUEST_ALL); 2544 2544 return VINF_SUCCESS; 2545 2545 } … … 3262 3262 { 3263 3263 /* If inhibition is active, RIP & RFLAGS should've been accessed (i.e. read previously from the VMCS or from ring-3). */ 3264 AssertMsg( (pVCpu->hm.s.vmx.fUpdatedGuestState & (HMVMX_UPDATED_GUEST_RIP | HMVMX_UPDATED_GUEST_RFLAGS))3265 == (HMVMX_UPDATED_GUEST_RIP | HMVMX_UPDATED_GUEST_RFLAGS), ("%#x\n", pVCpu->hm.s.vmx.fUpdatedGuestState));3264 AssertMsg(HMVMXCPU_GST_IS_SET(pVCpu, HMVMX_UPDATED_GUEST_RIP | HMVMX_UPDATED_GUEST_RFLAGS), 3265 ("%#x\n", HMVMXCPU_GST_VALUE(pVCpu))); 3266 3266 if (pMixedCtx->rip != EMGetInhibitInterruptsPC(pVCpu)) 3267 3267 { … … 5578 5578 NOREF(pMixedCtx); 5579 5579 5580 if (!(pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_CR0)) 5580 /* Since this can be called from our preemption hook it's safer to make the guest-CR0 update non-preemptible. */ 5581 VMMRZCallRing3Disable(pVCpu); 5582 HM_DISABLE_PREEMPT_IF_NEEDED(); 5583 5584 if (!HMVMXCPU_GST_IS_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_CR0)) 5581 5585 { 5582 5586 uint32_t uVal = 0; … … 5590 5594 uVal = (uShadow & pVCpu->hm.s.vmx.u32CR0Mask) | (uVal & ~pVCpu->hm.s.vmx.u32CR0Mask); 5591 5595 CPUMSetGuestCR0(pVCpu, uVal); 5592 pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_CR0; 5593 } 5596 HMVMXCPU_GST_SET_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_CR0); 5597 } 5598 5599 HM_RESTORE_PREEMPT_IF_NEEDED(); 5600 VMMRZCallRing3Enable(pVCpu); 5601 5594 5602 return VINF_SUCCESS; 5595 5603 } … … 5612 5620 5613 5621 int rc = VINF_SUCCESS; 5614 if (! (pVCpu->hm.s.vmx.fUpdatedGuestState &HMVMX_UPDATED_GUEST_CR4))5622 if (!HMVMXCPU_GST_IS_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_CR4)) 5615 5623 { 5616 5624 uint32_t uVal = 0; … … 5623 5631 uVal = (uShadow & pVCpu->hm.s.vmx.u32CR4Mask) | (uVal & ~pVCpu->hm.s.vmx.u32CR4Mask); 5624 5632 CPUMSetGuestCR4(pVCpu, uVal); 5625 pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_CR4;5633 HMVMXCPU_GST_SET_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_CR4); 5626 5634 } 5627 5635 return rc; … … 5643 5651 { 5644 5652 int rc = VINF_SUCCESS; 5645 if (! (pVCpu->hm.s.vmx.fUpdatedGuestState &HMVMX_UPDATED_GUEST_RIP))5653 if (!HMVMXCPU_GST_IS_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_RIP)) 5646 5654 { 5647 5655 uint64_t u64Val = 0; … … 5650 5658 5651 5659 pMixedCtx->rip = u64Val; 5652 pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_RIP;5660 HMVMXCPU_GST_SET_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_RIP); 5653 5661 } 5654 5662 return rc; … … 5670 5678 { 5671 5679 int rc = VINF_SUCCESS; 5672 if (! (pVCpu->hm.s.vmx.fUpdatedGuestState &HMVMX_UPDATED_GUEST_RSP))5680 if (!HMVMXCPU_GST_IS_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_RSP)) 5673 5681 { 5674 5682 uint64_t u64Val = 0; … … 5677 5685 5678 5686 pMixedCtx->rsp = u64Val; 5679 pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_RSP;5687 HMVMXCPU_GST_SET_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_RSP); 5680 5688 } 5681 5689 return rc; … … 5696 5704 static int hmR0VmxSaveGuestRflags(PVMCPU pVCpu, PCPUMCTX pMixedCtx) 5697 5705 { 5698 if (! (pVCpu->hm.s.vmx.fUpdatedGuestState &HMVMX_UPDATED_GUEST_RFLAGS))5706 if (!HMVMXCPU_GST_IS_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_RFLAGS)) 5699 5707 { 5700 5708 uint32_t uVal = 0; … … 5712 5720 } 5713 5721 5714 pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_RFLAGS;5722 HMVMXCPU_GST_SET_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_RFLAGS); 5715 5723 } 5716 5724 return VINF_SUCCESS; … … 5780 5788 NOREF(pMixedCtx); 5781 5789 /* Nothing to do for now until we make use of different guest-CPU activity state. Just update the flag. */ 5782 pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_ACTIVITY_STATE;5790 HMVMXCPU_GST_SET_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_ACTIVITY_STATE); 5783 5791 return VINF_SUCCESS; 5784 5792 } … … 5800 5808 { 5801 5809 int rc = VINF_SUCCESS; 5802 if (! (pVCpu->hm.s.vmx.fUpdatedGuestState &HMVMX_UPDATED_GUEST_SYSENTER_CS_MSR))5810 if (!HMVMXCPU_GST_IS_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_SYSENTER_CS_MSR)) 5803 5811 { 5804 5812 uint32_t u32Val = 0; 5805 5813 rc = VMXReadVmcs32(VMX_VMCS32_GUEST_SYSENTER_CS, &u32Val); AssertRCReturn(rc, rc); 5806 5814 pMixedCtx->SysEnter.cs = u32Val; 5807 pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_SYSENTER_CS_MSR;5815 HMVMXCPU_GST_SET_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_SYSENTER_CS_MSR); 5808 5816 } 5809 5817 5810 5818 uint64_t u64Val = 0; 5811 if (! (pVCpu->hm.s.vmx.fUpdatedGuestState &HMVMX_UPDATED_GUEST_SYSENTER_EIP_MSR))5819 if (!HMVMXCPU_GST_IS_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_SYSENTER_EIP_MSR)) 5812 5820 { 5813 5821 rc = VMXReadVmcsGstN(VMX_VMCS_GUEST_SYSENTER_EIP, &u64Val); AssertRCReturn(rc, rc); 5814 5822 pMixedCtx->SysEnter.eip = u64Val; 5815 pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_SYSENTER_EIP_MSR;5816 } 5817 if (! (pVCpu->hm.s.vmx.fUpdatedGuestState &HMVMX_UPDATED_GUEST_SYSENTER_ESP_MSR))5823 HMVMXCPU_GST_SET_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_SYSENTER_EIP_MSR); 5824 } 5825 if (!HMVMXCPU_GST_IS_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_SYSENTER_ESP_MSR)) 5818 5826 { 5819 5827 rc = VMXReadVmcsGstN(VMX_VMCS_GUEST_SYSENTER_ESP, &u64Val); AssertRCReturn(rc, rc); 5820 5828 pMixedCtx->SysEnter.esp = u64Val; 5821 pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_SYSENTER_ESP_MSR;5829 HMVMXCPU_GST_SET_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_SYSENTER_ESP_MSR); 5822 5830 } 5823 5831 return rc; … … 5842 5850 if (pVCpu->CTX_SUFF(pVM)->hm.s.fAllow64BitGuests) 5843 5851 { 5844 /* We should not get preempted to a different CPU at this point while reading the MSRs. */5852 /* Since this can be called from our preemption hook it's safer to make the guest-MSRs update non-preemptible. */ 5845 5853 VMMRZCallRing3Disable(pVCpu); 5846 5854 HM_DISABLE_PREEMPT_IF_NEEDED(); 5847 5855 5848 5856 /* Doing the check here ensures we don't overwrite already-saved guest MSRs from a preemption hook. */ 5849 if (! (pVCpu->hm.s.vmx.fUpdatedGuestState &HMVMX_UPDATED_GUEST_LAZY_MSRS))5857 if (!HMVMXCPU_GST_IS_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_LAZY_MSRS)) 5850 5858 { 5851 5859 hmR0VmxLazySaveGuestMsrs(pVCpu, pMixedCtx); 5852 pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_LAZY_MSRS;5860 HMVMXCPU_GST_SET_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_LAZY_MSRS); 5853 5861 } 5854 5862 … … 5857 5865 } 5858 5866 else 5859 pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_LAZY_MSRS;5867 HMVMXCPU_GST_SET_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_LAZY_MSRS); 5860 5868 #else 5861 5869 NOREF(pMixedCtx); 5862 pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_LAZY_MSRS;5870 HMVMXCPU_GST_SET_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_LAZY_MSRS); 5863 5871 #endif 5864 5872 … … 5881 5889 static int hmR0VmxSaveGuestAutoLoadStoreMsrs(PVMCPU pVCpu, PCPUMCTX pMixedCtx) 5882 5890 { 5883 if ( pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_AUTO_LOAD_STORE_MSRS)5891 if (HMVMXCPU_GST_IS_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_AUTO_LOAD_STORE_MSRS)) 5884 5892 return VINF_SUCCESS; 5885 5893 … … 5904 5912 } 5905 5913 5906 pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_AUTO_LOAD_STORE_MSRS;5914 HMVMXCPU_GST_SET_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_AUTO_LOAD_STORE_MSRS); 5907 5915 return VINF_SUCCESS; 5908 5916 } … … 5933 5941 /* Guest CR2 - updated always during the world-switch or in #PF. */ 5934 5942 /* Guest CR3. Only changes with Nested Paging. This must be done -after- saving CR0 and CR4 from the guest! */ 5935 if (! (pVCpu->hm.s.vmx.fUpdatedGuestState &HMVMX_UPDATED_GUEST_CR3))5936 { 5937 Assert( pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_CR0);5938 Assert( pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_CR4);5943 if (!HMVMXCPU_GST_IS_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_CR3)) 5944 { 5945 Assert(HMVMXCPU_GST_IS_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_CR0)); 5946 Assert(HMVMXCPU_GST_IS_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_CR4)); 5939 5947 5940 5948 PVM pVM = pVCpu->CTX_SUFF(pVM); … … 5981 5989 } 5982 5990 5983 pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_CR3;5991 HMVMXCPU_GST_SET_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_CR3); 5984 5992 } 5985 5993 … … 6117 6125 { 6118 6126 /* Guest segment registers. */ 6119 if (! (pVCpu->hm.s.vmx.fUpdatedGuestState &HMVMX_UPDATED_GUEST_SEGMENT_REGS))6127 if (!HMVMXCPU_GST_IS_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_SEGMENT_REGS)) 6120 6128 { 6121 6129 int rc = hmR0VmxSaveGuestCR0(pVCpu, pMixedCtx); AssertRCReturn(rc, rc); … … 6137 6145 pMixedCtx->gs.Attr.u = pVCpu->hm.s.vmx.RealMode.AttrGS.u; 6138 6146 } 6139 pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_SEGMENT_REGS;6147 HMVMXCPU_GST_SET_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_SEGMENT_REGS); 6140 6148 } 6141 6149 … … 6161 6169 6162 6170 /* Guest LDTR. */ 6163 if (! (pVCpu->hm.s.vmx.fUpdatedGuestState &HMVMX_UPDATED_GUEST_LDTR))6171 if (!HMVMXCPU_GST_IS_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_LDTR)) 6164 6172 { 6165 6173 rc = VMXLOCAL_READ_SEG(LDTR, ldtr); 6166 6174 AssertRCReturn(rc, rc); 6167 pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_LDTR;6175 HMVMXCPU_GST_SET_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_LDTR); 6168 6176 } 6169 6177 … … 6171 6179 uint64_t u64Val = 0; 6172 6180 uint32_t u32Val = 0; 6173 if (! (pVCpu->hm.s.vmx.fUpdatedGuestState &HMVMX_UPDATED_GUEST_GDTR))6181 if (!HMVMXCPU_GST_IS_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_GDTR)) 6174 6182 { 6175 6183 rc = VMXReadVmcsGstN(VMX_VMCS_GUEST_GDTR_BASE, &u64Val); AssertRCReturn(rc, rc); … … 6177 6185 pMixedCtx->gdtr.pGdt = u64Val; 6178 6186 pMixedCtx->gdtr.cbGdt = u32Val; 6179 pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_GDTR;6187 HMVMXCPU_GST_SET_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_GDTR); 6180 6188 } 6181 6189 6182 6190 /* Guest IDTR. */ 6183 if (! (pVCpu->hm.s.vmx.fUpdatedGuestState &HMVMX_UPDATED_GUEST_IDTR))6191 if (!HMVMXCPU_GST_IS_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_IDTR)) 6184 6192 { 6185 6193 rc = VMXReadVmcsGstN(VMX_VMCS_GUEST_IDTR_BASE, &u64Val); AssertRCReturn(rc, rc); … … 6187 6195 pMixedCtx->idtr.pIdt = u64Val; 6188 6196 pMixedCtx->idtr.cbIdt = u32Val; 6189 pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_IDTR;6197 HMVMXCPU_GST_SET_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_IDTR); 6190 6198 } 6191 6199 6192 6200 /* Guest TR. */ 6193 if (! (pVCpu->hm.s.vmx.fUpdatedGuestState &HMVMX_UPDATED_GUEST_TR))6201 if (!HMVMXCPU_GST_IS_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_TR)) 6194 6202 { 6195 6203 rc = hmR0VmxSaveGuestCR0(pVCpu, pMixedCtx); … … 6202 6210 AssertRCReturn(rc, rc); 6203 6211 } 6204 pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_TR;6212 HMVMXCPU_GST_SET_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_TR); 6205 6213 } 6206 6214 return rc; … … 6224 6232 static int hmR0VmxSaveGuestDR7(PVMCPU pVCpu, PCPUMCTX pMixedCtx) 6225 6233 { 6226 if (! (pVCpu->hm.s.vmx.fUpdatedGuestState &HMVMX_UPDATED_GUEST_DEBUG))6234 if (!HMVMXCPU_GST_IS_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_DEBUG)) 6227 6235 { 6228 6236 if (!pVCpu->hm.s.fUsingHyperDR7) … … 6234 6242 } 6235 6243 6236 pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_DEBUG;6244 HMVMXCPU_GST_SET_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_DEBUG); 6237 6245 } 6238 6246 return VINF_SUCCESS; … … 6256 6264 6257 6265 /* Updating TPR is already done in hmR0VmxPostRunGuest(). Just update the flag. */ 6258 pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_APIC_STATE;6266 HMVMXCPU_GST_SET_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_APIC_STATE); 6259 6267 return VINF_SUCCESS; 6260 6268 } … … 6276 6284 Assert(pMixedCtx); 6277 6285 6278 if ( pVCpu->hm.s.vmx.fUpdatedGuestState== HMVMX_UPDATED_GUEST_ALL)6286 if (HMVMXCPU_GST_VALUE(pVCpu) == HMVMX_UPDATED_GUEST_ALL) 6279 6287 return VINF_SUCCESS; 6280 6288 … … 6317 6325 AssertLogRelMsgRCReturn(rc, ("hmR0VmxSaveGuestApicState failed! rc=%Rrc (pVCpu=%p)\n", rc, pVCpu), rc); 6318 6326 6319 AssertMsg( pVCpu->hm.s.vmx.fUpdatedGuestState== HMVMX_UPDATED_GUEST_ALL,6320 ("Missed guest state bits while saving state; residue %RX32\n", pVCpu->hm.s.vmx.fUpdatedGuestState));6327 AssertMsg(HMVMXCPU_GST_VALUE(pVCpu) == HMVMX_UPDATED_GUEST_ALL, 6328 ("Missed guest state bits while saving state; residue %RX32\n", HMVMXCPU_GST_VALUE(pVCpu))); 6321 6329 6322 6330 if (VMMRZCallRing3IsEnabled(pVCpu)) … … 6589 6597 /* Save the guest state if necessary. */ 6590 6598 if ( fSaveGuestState 6591 && pVCpu->hm.s.vmx.fUpdatedGuestState!= HMVMX_UPDATED_GUEST_ALL)6599 && HMVMXCPU_GST_VALUE(pVCpu) != HMVMX_UPDATED_GUEST_ALL) 6592 6600 { 6593 6601 int rc = hmR0VmxSaveGuestState(pVCpu, pMixedCtx); 6594 6602 AssertRCReturn(rc, rc); 6595 Assert( pVCpu->hm.s.vmx.fUpdatedGuestState== HMVMX_UPDATED_GUEST_ALL);6603 Assert(HMVMXCPU_GST_VALUE(pVCpu) == HMVMX_UPDATED_GUEST_ALL); 6596 6604 } 6597 6605 … … 6642 6650 AssertRCReturn(rc, rc); 6643 6651 } 6644 Assert( pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_LAZY_MSRS);6652 Assert(HMVMXCPU_GST_IS_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_LAZY_MSRS)); 6645 6653 hmR0VmxLazyRestoreHostMsrs(pVCpu); 6646 6654 Assert(!pVCpu->hm.s.vmx.fRestoreHostMsrs); … … 6796 6804 | CPUM_CHANGED_TR 6797 6805 | CPUM_CHANGED_HIDDEN_SEL_REGS); 6798 Assert( pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_CR0);6806 Assert(HMVMXCPU_GST_IS_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_CR0)); 6799 6807 if ( pVM->hm.s.fNestedPaging 6800 6808 && CPUMIsGuestPagingEnabledEx(pMixedCtx)) … … 6938 6946 bool fBlockSti = RT_BOOL(uIntrState & VMX_VMCS_GUEST_INTERRUPTIBILITY_STATE_BLOCK_STI); 6939 6947 6940 Assert(!fBlockSti || (pVCpu->hm.s.vmx.fUpdatedGuestState &HMVMX_UPDATED_GUEST_RFLAGS));6948 Assert(!fBlockSti || HMVMXCPU_GST_IS_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_RFLAGS)); 6941 6949 Assert( !(uIntrState & VMX_VMCS_GUEST_INTERRUPTIBILITY_STATE_BLOCK_NMI) /* We don't support block-by-NMI and SMI yet.*/ 6942 6950 && !(uIntrState & VMX_VMCS_GUEST_INTERRUPTIBILITY_STATE_BLOCK_SMI)); … … 7020 7028 bool fBlockSti = RT_BOOL(uIntrState & VMX_VMCS_GUEST_INTERRUPTIBILITY_STATE_BLOCK_STI); 7021 7029 7022 Assert(!fBlockSti || (pVCpu->hm.s.vmx.fUpdatedGuestState &HMVMX_UPDATED_GUEST_RFLAGS));7030 Assert(!fBlockSti || HMVMXCPU_GST_IS_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_RFLAGS)); 7023 7031 Assert( !(uIntrState & VMX_VMCS_GUEST_INTERRUPTIBILITY_STATE_BLOCK_NMI) /* We don't support block-by-NMI and SMI yet.*/ 7024 7032 && !(uIntrState & VMX_VMCS_GUEST_INTERRUPTIBILITY_STATE_BLOCK_SMI)); … … 7333 7341 rc |= hmR0VmxSaveGuestRipRspRflags(pVCpu, pMixedCtx); 7334 7342 AssertRCReturn(rc, rc); 7335 Assert( pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_RIP);7343 Assert(HMVMXCPU_GST_IS_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_RIP)); 7336 7344 7337 7345 /* Check if the interrupt handler is present in the IVT (real-mode IDT). IDT limit is (4N - 1). */ … … 8046 8054 { 8047 8055 CPUMR0LoadGuestFPU(pVM, pVCpu, pMixedCtx); 8048 Assert( pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_CR0);8056 Assert(HMVMXCPU_GST_IS_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_CR0)); 8049 8057 HMCPU_CF_SET(pVCpu, HM_CHANGED_GUEST_CR0); 8050 8058 } … … 8129 8137 int rc2 = hmR0VmxSaveGuestAutoLoadStoreMsrs(pVCpu, pMixedCtx); 8130 8138 AssertRC(rc2); 8131 Assert( pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_AUTO_LOAD_STORE_MSRS);8139 Assert(HMVMXCPU_GST_IS_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_AUTO_LOAD_STORE_MSRS)); 8132 8140 uint64_t u64GuestTscAuxMsr; 8133 8141 rc2 = CPUMQueryGuestMsr(pVCpu, MSR_K8_TSC_AUX, &u64GuestTscAuxMsr); … … 8169 8177 ASMAtomicWriteBool(&pVCpu->hm.s.fCheckedTLBFlush, false); /* See HMInvalidatePageOnAllVCpus(): used for TLB-shootdowns. */ 8170 8178 ASMAtomicIncU32(&pVCpu->hm.s.cWorldSwitchExits); /* Initialized in vmR3CreateUVM(): used for TLB-shootdowns. */ 8171 pVCpu->hm.s.vmx.fUpdatedGuestState = 0;/* Exits/longjmps to ring-3 requires saving the guest state. */8179 HMVMXCPU_GST_RESET_TO(pVCpu, 0); /* Exits/longjmps to ring-3 requires saving the guest state. */ 8172 8180 pVmxTransient->fVmcsFieldsRead = 0; /* Transient fields need to be read from the VMCS. */ 8173 8181 pVmxTransient->fVectoringPF = false; /* Vectoring page-fault needs to be determined later. */ … … 8427 8435 { 8428 8436 Assert(VMMRZCallRing3IsEnabled(pVCpu)); 8429 Assert( pVCpu->hm.s.vmx.fUpdatedGuestState== HMVMX_UPDATED_GUEST_ALL);8437 Assert(HMVMXCPU_GST_VALUE(pVCpu) == HMVMX_UPDATED_GUEST_ALL); 8430 8438 HMVMX_ASSERT_PREEMPT_SAFE(); 8431 8439
Note:
See TracChangeset
for help on using the changeset viewer.