From: Paolo Bonzini Date: Mon, 25 Oct 2021 15:57:39 +0000 Subject: Re: [PATCH v2 37/43] KVM: SVM: Unconditionally mark AVIC as running on vCPU load (with APICv) Message-Id: List-Id: References: <20211009021236.4122790-1-seanjc@google.com> <20211009021236.4122790-38-seanjc@google.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Sean Christopherson 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 On 25/10/21 17:48, Sean Christopherson wrote: > On Mon, Oct 25, 2021, Paolo Bonzini wrote: >> On 09/10/21 04:12, Sean Christopherson wrote: >>> + /* TODO: Document why the unblocking path checks for updates. */ >> >> Is that a riddle or what? :) > > Yes? I haven't been able to figure out why the unblocking path explicitly > checks and handles an APICv update. > Challenge accepted. In the original code, it was because without it avic_vcpu_load would do nothing, and nothing would update the IS_RUNNING flag. It shouldn't be necessary anymore since commit df7e4827c549 ("KVM: SVM: call avic_vcpu_load/avic_vcpu_put when enabling/disabling AVIC", 2021-08-20), where svm_refresh_apicv_exec_ctrl takes care of the avic_vcpu_load on the next VMRUN. Paolo