|
@@ -1293,7 +1293,7 @@ static void init_vmcb(struct vcpu_svm *svm)
|
|
|
|
|
|
if (npt_enabled) {
|
|
|
/* Setup VMCB for Nested Paging */
|
|
|
- control->nested_ctl = 1;
|
|
|
+ control->nested_ctl |= SVM_NESTED_CTL_NP_ENABLE;
|
|
|
clr_intercept(svm, INTERCEPT_INVLPG);
|
|
|
clr_exception_intercept(svm, PF_VECTOR);
|
|
|
clr_cr_intercept(svm, INTERCEPT_CR3_READ);
|
|
@@ -2918,7 +2918,8 @@ static bool nested_vmcb_checks(struct vmcb *vmcb)
|
|
|
if (vmcb->control.asid == 0)
|
|
|
return false;
|
|
|
|
|
|
- if (vmcb->control.nested_ctl && !npt_enabled)
|
|
|
+ if ((vmcb->control.nested_ctl & SVM_NESTED_CTL_NP_ENABLE) &&
|
|
|
+ !npt_enabled)
|
|
|
return false;
|
|
|
|
|
|
return true;
|
|
@@ -2932,7 +2933,7 @@ static void enter_svm_guest_mode(struct vcpu_svm *svm, u64 vmcb_gpa,
|
|
|
else
|
|
|
svm->vcpu.arch.hflags &= ~HF_HIF_MASK;
|
|
|
|
|
|
- if (nested_vmcb->control.nested_ctl) {
|
|
|
+ if (nested_vmcb->control.nested_ctl & SVM_NESTED_CTL_NP_ENABLE) {
|
|
|
kvm_mmu_unload(&svm->vcpu);
|
|
|
svm->nested.nested_cr3 = nested_vmcb->control.nested_cr3;
|
|
|
nested_svm_init_mmu_context(&svm->vcpu);
|