public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Mario Limonciello <superm1@kernel.org>
To: Naveen N Rao <naveen@kernel.org>,
	Sean Christopherson <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	kvm@vger.kernel.org, Jim Mattson <jmattson@google.com>,
	Maxim Levitsky <mlevitsk@redhat.com>,
	Vasant Hegde <vasant.hegde@amd.com>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Alejandro Jimenez <alejandro.j.jimenez@oracle.com>,
	Joao Martins <joao.m.martins@oracle.com>,
	"Maciej S. Szmigiero" <maciej.szmigiero@oracle.com>
Subject: Re: [RFC PATCH v2 1/5] KVM: SVM: Stop warning if x2AVIC feature bit alone is enabled
Date: Tue, 16 Sep 2025 08:40:10 -0500	[thread overview]
Message-ID: <f9d43ba5-0655-4a4e-b911-30b11615361d@kernel.org> (raw)
In-Reply-To: <wo2sfg7sxkpnemiznpjtjou4xc6alad2muewkjulqk2wr2lc5q@vlb7m34ez2il>

On 9/16/25 2:14 AM, Naveen N Rao wrote:
> On Mon, Sep 15, 2025 at 01:04:56PM -0700, Sean Christopherson wrote:
>> On Thu, Sep 04, 2025, Naveen N Rao (AMD) wrote:
>>> A platform can choose to disable AVIC by turning off the AVIC CPUID
>>> feature bit, while keeping x2AVIC CPUID feature bit enabled to indicate
>>> AVIC support for the x2APIC MSR interface. Since this is a valid
>>> configuration, stop printing a warning.
>>>
>>> Signed-off-by: Naveen N Rao (AMD) <naveen@kernel.org>
>>> ---
>>>   arch/x86/kvm/svm/avic.c | 8 +-------
>>>   1 file changed, 1 insertion(+), 7 deletions(-)
>>>
>>> diff --git a/arch/x86/kvm/svm/avic.c b/arch/x86/kvm/svm/avic.c
>>> index a34c5c3b164e..346cd23a43a9 100644
>>> --- a/arch/x86/kvm/svm/avic.c
>>> +++ b/arch/x86/kvm/svm/avic.c
>>> @@ -1101,14 +1101,8 @@ bool avic_hardware_setup(void)
>>>   	if (!npt_enabled)
>>>   		return false;
>>>   
>>> -	/* AVIC is a prerequisite for x2AVIC. */
>>> -	if (!boot_cpu_has(X86_FEATURE_AVIC) && !force_avic) {
>>> -		if (boot_cpu_has(X86_FEATURE_X2AVIC)) {
>>> -			pr_warn(FW_BUG "Cannot support x2AVIC due to AVIC is disabled");
>>> -			pr_warn(FW_BUG "Try enable AVIC using force_avic option");
>>
>> I agree with the existing code, KVM should treat this as a firmware bug, where
>> "firmware" could also be the host VMM.  AIUI, x2AVIC can't actualy work without
>> AVIC support, so enumerating x2AVIC without AVIC is pointless and unexpected.
> 
> There are platforms where this is the case though:
> 
> $ cpuid -1 -l 0x8000000A | grep -i avic
>        AVIC: AMD virtual interrupt controller  = false
>        X2AVIC: virtualized X2APIC              = true
>        extended LVT AVIC access changes        = true
> 
> The above is from Zen 4 (Phoenix), and my primary concern is that we
> will start printing a warning by default. Besides, there isn't much a
> user can do here (except start using force_avic, which will taint the
> kernel). Maybe we can warn only if AVIC is being explicitly enabled?
> 

I'd say if you need to say something downgrade it to info instead and 
not mark it as firmware bug.

> There is another aspect to this: if we are force-enabling AVIC, then
> this can serve as a way to discover support for x2AVIC mode (this is
> what we do currently).  Otherwise, we may want to force-enable x2AVIC
> based on cpu family/model.
> 
> 
> - Naveen
> 


  reply	other threads:[~2025-09-16 13:40 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-04 18:00 [RFC PATCH v2 0/5] KVM: SVM: Enable AVIC by default on Zen 4+ Naveen N Rao (AMD)
2025-09-04 18:00 ` [RFC PATCH v2 1/5] KVM: SVM: Stop warning if x2AVIC feature bit alone is enabled Naveen N Rao (AMD)
2025-09-15 20:04   ` Sean Christopherson
2025-09-16  7:14     ` Naveen N Rao
2025-09-16 13:40       ` Mario Limonciello [this message]
2025-09-16 13:51         ` Sean Christopherson
2025-09-16 18:37           ` Naveen N Rao
2025-09-16 19:26             ` Mario Limonciello
2025-09-17  0:44               ` Sean Christopherson
2025-09-04 18:00 ` [RFC PATCH v2 2/5] KVM: SVM: Simplify the message printed with 'force_avic' Naveen N Rao (AMD)
2025-09-15 22:42   ` Sean Christopherson
2025-09-04 18:00 ` [RFC PATCH v2 3/5] KVM: SVM: Move all AVIC setup to avic_hardware_setup() Naveen N Rao (AMD)
2025-09-15 19:59   ` Sean Christopherson
2025-09-04 18:00 ` [RFC PATCH v2 4/5] KVM: SVM: Move 'force_avic' module parameter to svm.c Naveen N Rao (AMD)
2025-09-15 22:43   ` Sean Christopherson
2025-09-04 18:00 ` [RFC PATCH v2 5/5] KVM: SVM: Enable AVIC by default from Zen 4 Naveen N Rao (AMD)
2025-09-15 22:53   ` Sean Christopherson
2025-09-16  7:39     ` Naveen N Rao
2025-09-16 14:27       ` Sean Christopherson
2025-09-16 18:53         ` Naveen N Rao
2025-09-15 23:17   ` Sean Christopherson
2025-09-16 10:17     ` Naveen N Rao
2025-09-15 23:23 ` [RFC PATCH v2 0/5] KVM: SVM: Enable AVIC by default on Zen 4+ Sean Christopherson
2025-09-16 10:31   ` Naveen N Rao

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=f9d43ba5-0655-4a4e-b911-30b11615361d@kernel.org \
    --to=superm1@kernel.org \
    --cc=alejandro.j.jimenez@oracle.com \
    --cc=jmattson@google.com \
    --cc=joao.m.martins@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=maciej.szmigiero@oracle.com \
    --cc=mlevitsk@redhat.com \
    --cc=naveen@kernel.org \
    --cc=nikunj@amd.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=vasant.hegde@amd.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