From: Paolo Bonzini Date: Thu, 02 Dec 2021 10:31:28 +0000 Subject: Re: [PATCH v2 11/43] KVM: Don't block+unblock when halt-polling is successful Message-Id: <6200f141-8e6f-fe68-9539-22aa68559cb7@redhat.com> List-Id: References: <20211009021236.4122790-1-seanjc@google.com> <20211009021236.4122790-12-seanjc@google.com> <4e883728e3e5201a94eb46b56315afca5e95ad9c.camel@redhat.com> <496c2fc6-26b0-9b5d-32f4-2f9e9dd6a064@redhat.com> <880a5727-69d1-72a1-b129-b053781625ad@redhat.com> <458c0819a578ba854f00089bc312c8faa177a81a.camel@redhat.com> <32eabe7d270e5a466ba2d9345b4270b8fe27700c.camel@redhat.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable To: Sean Christopherson , Maxim Levitsky Cc: Marc Zyngier , Huacai Chen , Aleksandar Markovic , Paul Mackerras , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , James Morse , Alexandru Elisei , Suzuki K Poulose , Atish Patra , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-mips@vger.kernel.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, David Matlack , Oliver Upton , Jing Zhang , Wei Huang On 12/2/21 03:00, Sean Christopherson wrote: > Hmm, that suggests the bug/erratum is due to the CPU consuming stale data= from #4 > for the IsRunning check in #5, or retiring uops for the IsRunning check b= efore > retiring the vIRR update. Yes, this seems to be an error in the implementation of step 5. In=20 assembly, atomic operations have implicit memory barriers, but who knows=20 what's going on in microcode. So either it's the former, or something=20 is going on that's specific to the microcode sequencer, or it's a more=20 mundane implementation bug. In any case, AVIC is disabled for now and will need a list of model=20 where it works, so I'll go on and queue the first part of this series. Paolo > It would be helpful if the erratum actually provided > info on the "highly specific and detailed set of internal timing conditio= ns". :-/ >=20 > 4. Lookup the vAPIC backing page address in the Physical APIC table us= ing the > guest physical APIC ID as an index into the table. > 5. For every valid destination: > - Atomically set the appropriate IRR bit in each of the destination= s=E2=80=99 vAPIC > backing page. > - Check the IsRunning status of each destination.