On 2/21/2022 9:19 AM, Suravee Suthikulpanit wrote:
.... diff --git a/arch/x86/kvm/svm/avic.c b/arch/x86/kvm/svm/avic.c index 3543b7a4514a..3306b74f1d8b 100644 --- a/arch/x86/kvm/svm/avic.c +++ b/arch/x86/kvm/svm/avic.c @@ -79,6 +79,50 @@ static inline enum avic_modes avic_get_vcpu_apic_mode(struct vcpu_svm *svm) .. +void avic_activate_vmcb(struct vcpu_svm *svm)
This should be static void.
+{ + struct vmcb *vmcb = svm->vmcb01.ptr; + + vmcb->control.int_ctl |= AVIC_ENABLE_MASK; + + if (svm->x2apic_enabled) { + vmcb->control.int_ctl |= X2APIC_MODE_MASK; + vmcb->control.avic_physical_id &= ~X2AVIC_MAX_PHYSICAL_ID; + vmcb->control.avic_physical_id |= X2AVIC_MAX_PHYSICAL_ID; + /* Disabling MSR intercept for x2APIC registers */ + avic_set_x2apic_msr_interception(svm, false); + } else { + vmcb->control.avic_physical_id &= ~AVIC_MAX_PHYSICAL_ID; + vmcb->control.avic_physical_id |= AVIC_MAX_PHYSICAL_ID; + /* Enabling MSR intercept for x2APIC registers */ + avic_set_x2apic_msr_interception(svm, true); + } +} + +void avic_deactivate_vmcb(struct vcpu_svm *svm)
This should be static void. Reported-by: kernel test robot <lkp@xxxxxxxxx> Regards, Suravee