]> git.baikalelectronics.ru Git - kernel.git/commitdiff
KVM: x86: SVM: use vmcb01 in init_vmcb
authorMaxim Levitsky <mlevitsk@redhat.com>
Tue, 22 Mar 2022 17:24:43 +0000 (18:24 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 2 Apr 2022 09:41:21 +0000 (05:41 -0400)
Clarify that this function is not used to initialize any part of
the vmcb02.  No functional change intended.

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/avic.c
arch/x86/kvm/svm/svm.c
arch/x86/kvm/svm/svm.h

index a1cf9c31273b7c9176ea0f243a91d3725b28d4f3..b7dabc01d6449bd49a71164902ad8bddcc744251 100644 (file)
@@ -165,9 +165,8 @@ free_avic:
        return err;
 }
 
-void avic_init_vmcb(struct vcpu_svm *svm)
+void avic_init_vmcb(struct vcpu_svm *svm, struct vmcb *vmcb)
 {
-       struct vmcb *vmcb = svm->vmcb;
        struct kvm_svm *kvm_svm = to_kvm_svm(svm->vcpu.kvm);
        phys_addr_t bpa = __sme_set(page_to_phys(svm->avic_backing_page));
        phys_addr_t lpa = __sme_set(page_to_phys(kvm_svm->avic_logical_id_table_page));
index 462f691fb61465db3ab6b5ec966e4fa53df71228..dd2abed455110f77c640c68b27e1b2796927b576 100644 (file)
@@ -984,8 +984,9 @@ static inline void init_vmcb_after_set_cpuid(struct kvm_vcpu *vcpu)
 static void init_vmcb(struct kvm_vcpu *vcpu)
 {
        struct vcpu_svm *svm = to_svm(vcpu);
-       struct vmcb_control_area *control = &svm->vmcb->control;
-       struct vmcb_save_area *save = &svm->vmcb->save;
+       struct vmcb *vmcb = svm->vmcb01.ptr;
+       struct vmcb_control_area *control = &vmcb->control;
+       struct vmcb_save_area *save = &vmcb->save;
 
        svm_set_intercept(svm, INTERCEPT_CR0_READ);
        svm_set_intercept(svm, INTERCEPT_CR3_READ);
@@ -1109,7 +1110,7 @@ static void init_vmcb(struct kvm_vcpu *vcpu)
                set_msr_interception(vcpu, svm->msrpm, MSR_IA32_SPEC_CTRL, 1, 1);
 
        if (kvm_vcpu_apicv_active(vcpu))
-               avic_init_vmcb(svm);
+               avic_init_vmcb(svm, vmcb);
 
        if (vgif) {
                svm_clr_intercept(svm, INTERCEPT_STGI);
@@ -1127,10 +1128,10 @@ static void init_vmcb(struct kvm_vcpu *vcpu)
                }
        }
 
-       svm_hv_init_vmcb(svm->vmcb);
+       svm_hv_init_vmcb(vmcb);
        init_vmcb_after_set_cpuid(vcpu);
 
-       vmcb_mark_all_dirty(svm->vmcb);
+       vmcb_mark_all_dirty(vmcb);
 
        enable_gif(svm);
 }
index 468f149556ddda803167bc578124f3909a29aa77..57bde9569902b812a679acef15be3c67ff67d5ed 100644 (file)
@@ -580,7 +580,7 @@ extern struct kvm_x86_nested_ops svm_nested_ops;
 int avic_ga_log_notifier(u32 ga_tag);
 void avic_vm_destroy(struct kvm *kvm);
 int avic_vm_init(struct kvm *kvm);
-void avic_init_vmcb(struct vcpu_svm *svm);
+void avic_init_vmcb(struct vcpu_svm *svm, struct vmcb *vmcb);
 int avic_incomplete_ipi_interception(struct kvm_vcpu *vcpu);
 int avic_unaccelerated_access_interception(struct kvm_vcpu *vcpu);
 int avic_init_vcpu(struct vcpu_svm *svm);