public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Naveen N Rao <naveen@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: SVM: Fix an off-by-one typo in the comment for enabling AVIC by default
Date: Thu, 8 Jan 2026 09:06:52 -0800	[thread overview]
Message-ID: <aV_kLHFQzu7taPS_@google.com> (raw)
In-Reply-To: <aV-GPYoKB5HIzcs3@blrnaveerao1>

On Thu, Jan 08, 2026, Naveen N Rao wrote:
> On Wed, Jan 07, 2026 at 12:45:46PM -0800, Sean Christopherson wrote:
> > 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.
> 
> I had thought that the comment was correct and that you wanted to 
> reference Zen4 there. That is:
> 	family 0x19 (Zen4) and later (Zen5+),
> 
> Though family 0x19 also includes Zen3 :/
> 
> I think it would be better to update the code as well, just so it is 
> easier to correlate the comment and the code?
> 
>         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);

This thought crossed my mind as well.  I'll send a v2 with this, I especially
like the idea of swapping the ordering so that the checks are "ascending".

      reply	other threads:[~2026-01-08 17:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-07 20:45 [PATCH] KVM: SVM: Fix an off-by-one typo in the comment for enabling AVIC by default Sean Christopherson
2026-01-08 10:36 ` Naveen N Rao
2026-01-08 17:06   ` Sean Christopherson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aV_kLHFQzu7taPS_@google.com \
    --to=seanjc@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=naveen@kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox