From: Paolo Bonzini <pbonzini@redhat.com>
To: Maxim Levitsky <mlevitsk@redhat.com>, kvm@vger.kernel.org
Cc: Wanpeng Li <wanpengli@tencent.com>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Sean Christopherson <seanjc@google.com>,
Jim Mattson <jmattson@google.com>,
"H. Peter Anvin" <hpa@zytor.com>, Joerg Roedel <joro@8bytes.org>,
Dave Hansen <dave.hansen@linux.intel.com>,
Ingo Molnar <mingo@redhat.com>,
Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
linux-kernel@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>,
x86@kernel.org, Borislav Petkov <bp@alien8.de>,
stable@vger.kernel.org
Subject: Re: [PATCH 4/7] KVM: x86: SVM: fix avic_kick_target_vcpus_fast
Date: Wed, 8 Jun 2022 15:21:42 +0200 [thread overview]
Message-ID: <c7fb78e2-2650-f9a2-3062-5d5ecc34332b@redhat.com> (raw)
In-Reply-To: <20220606180829.102503-5-mlevitsk@redhat.com>
On 6/6/22 20:08, Maxim Levitsky wrote:
> There are two issues in avic_kick_target_vcpus_fast
>
> 1. It is legal to issue an IPI request with APIC_DEST_NOSHORT
> and a physical destination of 0xFF (or 0xFFFFFFFF in case of x2apic),
> which must be treated as a broadcast destination.
>
> Fix this by explicitly checking for it.
> Also don’t use ‘index’ in this case as it gives no new information.
>
> 2. It is legal to issue a logical IPI request to more than one target.
> Index field only provides index in physical id table of first
> such target and therefore can't be used before we are sure
> that only a single target was addressed.
>
> Instead, parse the ICRL/ICRH, double check that a unicast interrupt
> was requested, and use that info to figure out the physical id
> of the target vCPU.
> At that point there is no need to use the index field as well.
>
>
> In addition to fixing the above issues, also skip the call to
> kvm_apic_match_dest.
>
> It is possible to do this now, because now as long as AVIC is not
> inhibited, it is guaranteed that none of the vCPUs changed their
> apic id from its default value.
>
>
> This fixes boot of windows guest with AVIC enabled because it uses
> IPI with 0xFF destination and no destination shorthand.
>
> Fixes: 7223fd2d5338 ("KVM: SVM: Use target APIC ID to complete AVIC IRQs when possible")
> Cc: stable@vger.kernel.org
>
> Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Is it possible to use kvm_intr_is_single_vcpu_fast, or am I missing
something?
Series queued, thanks.
Paolo
next prev parent reply other threads:[~2022-06-08 13:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-06 18:08 [PATCH 0/7] KVM: x86: AVIC/APICv patch queue Maxim Levitsky
2022-06-06 18:08 ` [PATCH 1/7] KVM: x86: document AVIC/APICv inhibit reasons Maxim Levitsky
2022-06-06 18:08 ` [PATCH 2/7] KVM: x86: inhibit APICv/AVIC when the guest and/or host changes either apic id or the apic base from their default values Maxim Levitsky
2022-06-07 7:05 ` Chao Gao
2022-06-07 7:53 ` Maxim Levitsky
2022-06-06 18:08 ` [PATCH 3/7] KVM: x86: SVM: remove avic's broken code that updated APIC ID Maxim Levitsky
2022-06-06 18:08 ` [PATCH 4/7] KVM: x86: SVM: fix avic_kick_target_vcpus_fast Maxim Levitsky
2022-06-08 13:21 ` Paolo Bonzini [this message]
2022-06-09 8:13 ` Maxim Levitsky
2022-06-06 18:08 ` [PATCH 5/7] KVM: x86: disable preemption while updating apicv inhibition Maxim Levitsky
2022-06-06 18:08 ` [PATCH 6/7] KVM: x86: disable preemption around the call to kvm_arch_vcpu_{un|}blocking Maxim Levitsky
2022-06-06 18:08 ` [PATCH 7/7] KVM: x86: SVM: there is no need for preempt safe wrappers for avic_vcpu_load/put Maxim Levitsky
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=c7fb78e2-2650-f9a2-3062-5d5ecc34332b@redhat.com \
--to=pbonzini@redhat.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mlevitsk@redhat.com \
--cc=seanjc@google.com \
--cc=stable@vger.kernel.org \
--cc=suravee.suthikulpanit@amd.com \
--cc=tglx@linutronix.de \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.com \
--cc=x86@kernel.org \
/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
all inboxes | Powered by JetHome®