Changeset 70413 in vbox for trunk/src/VBox/VMM/VMMR0
- Timestamp:
- Jan 2, 2018 7:22:26 AM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 120018
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r70412 r70413 166 166 | SVM_CTRL_INTERCEPT_VMRUN \ 167 167 | SVM_CTRL_INTERCEPT_VMMCALL \ 168 | SVM_CTRL_INTERCEPT_VMLOAD \169 | SVM_CTRL_INTERCEPT_VMSAVE \170 168 | SVM_CTRL_INTERCEPT_STGI \ 171 169 | SVM_CTRL_INTERCEPT_CLGI \ … … 817 815 bool const fUseLbrVirt = fLbrVirt; /** @todo CFGM etc. */ 818 816 817 bool const fVirtVmsaveVmload = RT_BOOL(pVM->hm.s.svm.u32Features & X86_CPUID_SVM_FEATURE_EDX_VIRT_VMSAVE_VMLOAD); 818 bool const fUseVirtVmsaveVmload = fVirtVmsaveVmload && pVM->hm.s.svm.fVirtVmsaveVmload && pVM->hm.s.fNestedPaging; 819 819 820 for (VMCPUID i = 0; i < pVM->cCpus; i++) 820 821 { … … 885 886 else 886 887 Assert(pVmcb->ctrl.LbrVirt.n.u1LbrVirt == 0); 888 889 /* Virtualized VMSAVE/VMLOAD. */ 890 pVmcb->ctrl.LbrVirt.n.u1VirtVmsaveVmload = fUseVirtVmsaveVmload; 891 if (!fUseVirtVmsaveVmload) 892 { 893 pVmcb->ctrl.u64InterceptCtrl |= SVM_CTRL_INTERCEPT_VMSAVE 894 | SVM_CTRL_INTERCEPT_VMLOAD; 895 } 887 896 888 897 /* Initially all VMCB clean bits MBZ indicating that everything should be loaded from the VMCB in memory. */ … … 1906 1915 pVmcbNstGst->ctrl.u64InterceptCtrl |= pVmcb->ctrl.u64InterceptCtrl 1907 1916 | HMSVM_MANDATORY_GUEST_CTRL_INTERCEPTS; 1908 1909 1917 /* 1910 1918 * Remove control intercepts that we don't need while executing the nested-guest. … … 1913 1921 * other SVM instructions like VMSAVE when not intercept can cause havoc on the 1914 1922 * host as they can write to any location in physical memory, hence they always 1915 * need to be intercepted ( they are included in HMSVM_MANDATORY_GUEST_CTRL_INTERCEPTS).1923 * need to be intercepted (see below). 1916 1924 */ 1917 1925 Assert( (pVmcbNstGst->ctrl.u64InterceptCtrl & HMSVM_MANDATORY_GUEST_CTRL_INTERCEPTS) 1918 1926 == HMSVM_MANDATORY_GUEST_CTRL_INTERCEPTS); 1919 1927 pVmcbNstGst->ctrl.u64InterceptCtrl &= ~SVM_CTRL_INTERCEPT_VMMCALL; 1928 1929 /* 1930 * If we don't expose Virtualized-VMSAVE/VMLOAD feature to the outer guest, we 1931 * need to intercept VMSAVE/VMLOAD instructions executed by the nested-guest. 1932 */ 1933 if (!pVCpu->CTX_SUFF(pVM)->cpum.ro.GuestFeatures.fSvmVirtVmsaveVmload) 1934 { 1935 pVmcbNstGst->ctrl.u64InterceptCtrl |= SVM_CTRL_INTERCEPT_VMSAVE 1936 | SVM_CTRL_INTERCEPT_VMLOAD; 1937 } 1920 1938 1921 1939 /* Finally, update the VMCB clean bits. */ … … 7563 7581 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(); 7564 7582 7583 #ifdef VBOX_STRICT 7584 PCSVMVMCB pVmcb = hmR0SvmGetCurrentVmcb(pVCpu, pCtx); 7585 Assert(pVmcb); 7586 Assert(!pVmcb->ctrl.LbrVirt.n.u1VirtVmsaveVmload); 7587 RT_NOREF(pVmcb); 7588 #endif 7589 7565 7590 /** @todo Stat. */ 7566 7591 /* STAM_COUNTER_INC(&pVCpu->hm.s.StatExitVmload); */ … … 7584 7609 { 7585 7610 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(); 7611 7612 #ifdef VBOX_STRICT 7613 PCSVMVMCB pVmcb = hmR0SvmGetCurrentVmcb(pVCpu, pCtx); 7614 Assert(pVmcb); 7615 Assert(!pVmcb->ctrl.LbrVirt.n.u1VirtVmsaveVmload); 7616 RT_NOREF(pVmcb); 7617 #endif 7586 7618 7587 7619 /** @todo Stat. */
Note:
See TracChangeset
for help on using the changeset viewer.