Commit 6cfe7b83 authored by Sean Christopherson's avatar Sean Christopherson Committed by Paolo Bonzini

KVM: SVM: Drop redundant writes to vmcb->save.cr4 at RESET/INIT

Drop direct writes to vmcb->save.cr4 during vCPU RESET/INIT, as the
values being written are fully redundant with respect to
svm_set_cr4(vcpu, 0) a few lines earlier.  Note, svm_set_cr4() also
correctly forces X86_CR4_PAE when NPT is disabled.

No functional change intended.
Reviewed-by: default avatarReiji Watanabe <reijiw@google.com>
Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
Message-Id: <20210713163324.627647-32-seanjc@google.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent ef8a0fa5
...@@ -1256,8 +1256,6 @@ static void init_vmcb(struct kvm_vcpu *vcpu) ...@@ -1256,8 +1256,6 @@ static void init_vmcb(struct kvm_vcpu *vcpu)
kvm_set_rflags(vcpu, X86_EFLAGS_FIXED); kvm_set_rflags(vcpu, X86_EFLAGS_FIXED);
vcpu->arch.regs[VCPU_REGS_RIP] = 0x0000fff0; vcpu->arch.regs[VCPU_REGS_RIP] = 0x0000fff0;
save->cr4 = X86_CR4_PAE;
if (npt_enabled) { if (npt_enabled) {
/* Setup VMCB for Nested Paging */ /* Setup VMCB for Nested Paging */
control->nested_ctl |= SVM_NESTED_CTL_NP_ENABLE; control->nested_ctl |= SVM_NESTED_CTL_NP_ENABLE;
...@@ -1267,7 +1265,6 @@ static void init_vmcb(struct kvm_vcpu *vcpu) ...@@ -1267,7 +1265,6 @@ static void init_vmcb(struct kvm_vcpu *vcpu)
svm_clr_intercept(svm, INTERCEPT_CR3_WRITE); svm_clr_intercept(svm, INTERCEPT_CR3_WRITE);
save->g_pat = vcpu->arch.pat; save->g_pat = vcpu->arch.pat;
save->cr3 = 0; save->cr3 = 0;
save->cr4 = 0;
} }
svm->current_vmcb->asid_generation = 0; svm->current_vmcb->asid_generation = 0;
svm->asid = 0; svm->asid = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment