]> Gentwo Git Trees - linux/.git/commit
KVM: SVM: Move global "avic" variable to avic.c
authorSean Christopherson <seanjc@google.com>
Fri, 19 Sep 2025 21:59:33 +0000 (14:59 -0700)
committerSean Christopherson <seanjc@google.com>
Tue, 23 Sep 2025 15:56:48 +0000 (08:56 -0700)
commitb14665353162db70e445aacdd18b0566edba00c2
tree764351aee3d804aefb52acbcaede3780a5e4a966
parentad65dca2ca4cf8c377135362c0c1e031ad92019d
KVM: SVM: Move global "avic" variable to avic.c

Move "avic" to avic.c so that it's colocated with the other AVIC specific
globals and module params, and so that avic_hardware_setup() is a bit more
self-contained, e.g. similar to sev_hardware_setup().

Deliberately set enable_apicv in svm.c as it's already globally visible
(defined by kvm.ko, not by kvm-amd.ko), and to clearly capture the
dependency on enable_apicv being initialized (svm_hardware_setup() clears
several AVIC-specific hooks when enable_apicv is disabled).

Alternatively, clearing of the hooks (and enable_ipiv) could be moved to
avic_hardware_setup(), but that's not obviously better, e.g. it's helpful
to isolate the setting of enable_apicv when reading code from the generic
x86 side of the world.

No functional change intended.

Acked-by: Naveen N Rao (AMD) <naveen@kernel.org>
Tested-by: Naveen N Rao (AMD) <naveen@kernel.org>
Link: https://lore.kernel.org/r/20250919215934.1590410-7-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/avic.c
arch/x86/kvm/svm/svm.c