[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5476ef637f70def68b8f9ec50579d5580659fe9a.camel@redhat.com>
Date: Thu, 08 Dec 2022 23:53:07 +0200
From: Maxim Levitsky <mlevitsk@...hat.com>
To: Sean Christopherson <seanjc@...gle.com>,
Paolo Bonzini <pbonzini@...hat.com>
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
Alejandro Jimenez <alejandro.j.jimenez@...cle.com>,
Suravee Suthikulpanit <suravee.suthikulpanit@....com>,
Li RongQing <lirongqing@...du.com>
Subject: Re: [PATCH v4 05/32] KVM: x86: Don't inhibit APICv/AVIC on xAPIC ID
"change" if APIC is disabled
On Sat, 2022-10-01 at 00:58 +0000, Sean Christopherson wrote:
> Don't inhibit APICv/AVIC due to an xAPIC ID mismatch if the APIC is
> hardware disabled. The ID cannot be consumed while the APIC is disabled,
> and the ID is guaranteed to be set back to the vcpu_id when the APIC is
> hardware enabled (architectural behavior correctly emulated by KVM).
>
> Fixes: 3743c2f02517 ("KVM: x86: inhibit APICv/AVIC on changes to APIC ID or APIC base")
> Cc: stable@...r.kernel.org
> Signed-off-by: Sean Christopherson <seanjc@...gle.com>
> ---
> arch/x86/kvm/lapic.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
> index 5de1c7aa1ce9..67260f7ce43a 100644
> --- a/arch/x86/kvm/lapic.c
> +++ b/arch/x86/kvm/lapic.c
> @@ -2072,6 +2072,9 @@ static void kvm_lapic_xapic_id_updated(struct kvm_lapic *apic)
> {
> struct kvm *kvm = apic->vcpu->kvm;
>
> + if (!kvm_apic_hw_enabled(apic))
> + return;
> +
> if (KVM_BUG_ON(apic_x2apic_mode(apic), kvm))
> return;
>
Reviewed-by: Maxim Levitsky <mlevitsk@...hat.com>
Best regards,
Maxim Levitsky
Powered by blists - more mailing lists