]> Gentwo Git Trees - linux/.git/commit
KVM: SVM: Enable AVIC by default for Zen4+ if x2AVIC is support
authorNaveen N Rao <naveen@kernel.org>
Fri, 19 Sep 2025 21:59:34 +0000 (14:59 -0700)
committerSean Christopherson <seanjc@google.com>
Tue, 23 Sep 2025 15:56:49 +0000 (08:56 -0700)
commitca2967de5a5b098b43c5ad665672945ce7e7d4f7
treef34f191b8c259b5ce834c0d76cbcf369fdf61739
parentb14665353162db70e445aacdd18b0566edba00c2
KVM: SVM: Enable AVIC by default for Zen4+ if x2AVIC is support

AVIC and x2AVIC are fully functional since Zen 4, with no known hardware
errata.  Enable AVIC and x2AVIC by default on Zen4+ so long as x2AVIC is
supported (to avoid enabling partial support for APIC virtualization by
default).

Internally, convert "avic" to an integer so that KVM can identify if the
user has asked to explicitly enable or disable AVIC, i.e. so that KVM
doesn't override an explicit 'y' from the user.  Arbitrarily use -1 to
denote auto-mode, and accept the string "auto" for the module param in
addition to standard boolean values, i.e. continue to allow the user to
configure the "avic" module parameter to explicitly enable/disable AVIC.

To again maintain backward compatibility with a standard boolean param,
set KERNEL_PARAM_OPS_FL_NOARG, which tells the params infrastructure to
allow empty values for %true, i.e. to interpret a bare "avic" as "avic=y".
Take care to check for a NULL @val when looking for "auto"!

Lastly, always print "avic" as a boolean, since auto-mode is resolved
during module initialization, i.e. the user should never see "auto" in
sysfs.

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