KVM: SVM: Fix an off-by-one typo in the comment for enabling AVIC by default
Sean Christopherson
maintainerPATCH v2 1/1 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.
---
v2: Update the code to precisely match the comment. [Naveen]
v1: https://lore.kernel.org/all/[email protected]
arch/x86/kvm/svm/avic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kvm/svm/avic.c +2 -2
@@ -1224,13 +1224,13 @@ static bool __init avic_want_avic_enabled(void)* In "auto" mode, enable AVIC by default for Zen4+ if x2AVIC is * supported (to avoid enabling partial support by default, and because * x2AVIC should be supported by all Zen4+ CPUs). Explicitly check for -* family 0x19 and later (Zen5+), as the kernel's synthetic ZenX flags +* family 0x1A and later (Zen5+), as the kernel's synthetic ZenX flags * aren't inclusive of previous generations, i.e. the kernel will set * at most one ZenX feature flag. */ if (avic ==AVIC_AUTO_MODE ) avic =boot_cpu_has (X86_FEATURE_X2AVIC ) && - (boot_cpu_data.x86 >0x19 ||cpu_feature_enabled (X86_FEATURE_ZEN4 )); + (cpu_feature_enabled (X86_FEATURE_ZEN4 ) || boot_cpu_data.x86 >=0x1A );if (!avic || !npt_enabled)return false;
base-commit: 9448598b22c50c8a5bb77a9103e2d49f134c9578
Signature · 1 line
2.52.0.457.g6b5491de43-goog
Quoted 10 lines · Sean Christopherson
Fix a goof in the comment that documents KVM's logic for enabling AVIC by default to reference Zen5+ as family
0x1A(Zen5), not family0x19(Zen4). The code is correct (checks for _greater_ than0x19), 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+.[...]
Applied to kvm-x86 svm, thanks!
[1/1] KVM: SVM: Fix an off-by-one typo in the comment for enabling AVIC by default
https://github.com/kvm-x86/linux/commit/69555130dccb