Skip to content

Commit 6955513

Browse files
committed
KVM: SVM: Fix an off-by-one typo in the comment for enabling AVIC by default
Fix a goof in the comment that documents KVM's logic for enabling AVIC by default to reference Zen5+ as family 0x1A (Zen5), not family 0x19 (Zen4). The code is correct (checks for _greater_ than 0x19), only the comment is flawed. Opportunistically tweak the check too, even though it's already correct, so that both the comment and the code reference 0x1A, and so that the checks are "ascending", i.e. check Zen4 and then Zen5+. No functional change intended. Fixes: ca2967d ("KVM: SVM: Enable AVIC by default for Zen4+ if x2AVIC is support") Acked-by: Naveen N Rao (AMD) <naveen@kernel.org> Link: https://patch.msgid.link/20260109035037.1015073-1-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent d6c20d1 commit 6955513

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

arch/x86/kvm/svm/avic.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,13 +1224,13 @@ static bool __init avic_want_avic_enabled(void)
12241224
* In "auto" mode, enable AVIC by default for Zen4+ if x2AVIC is
12251225
* supported (to avoid enabling partial support by default, and because
12261226
* x2AVIC should be supported by all Zen4+ CPUs). Explicitly check for
1227-
* family 0x19 and later (Zen5+), as the kernel's synthetic ZenX flags
1227+
* family 0x1A and later (Zen5+), as the kernel's synthetic ZenX flags
12281228
* aren't inclusive of previous generations, i.e. the kernel will set
12291229
* at most one ZenX feature flag.
12301230
*/
12311231
if (avic == AVIC_AUTO_MODE)
12321232
avic = boot_cpu_has(X86_FEATURE_X2AVIC) &&
1233-
(boot_cpu_data.x86 > 0x19 || cpu_feature_enabled(X86_FEATURE_ZEN4));
1233+
(cpu_feature_enabled(X86_FEATURE_ZEN4) || boot_cpu_data.x86 >= 0x1A);
12341234

12351235
if (!avic || !npt_enabled)
12361236
return false;

0 commit comments

Comments
 (0)