From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PART1 RFC 5/9] svm: Add VMEXIT handlers for AVIC Date: Thu, 18 Feb 2016 15:51:14 +0100 Message-ID: <56C5DA62.8080204@redhat.com> References: <1455285574-27892-1-git-send-email-suravee.suthikulpanit@amd.com> <1455285574-27892-6-git-send-email-suravee.suthikulpanit@amd.com> <56BDFC72.7030905@redhat.com> <56C2C1BF.7010700@amd.com> <56C312E1.1080902@redhat.com> <20160216141330.GG10555@potion.brq.redhat.com> <56C354A5.4040807@redhat.com> <20160216180618.GA18952@potion.brq.redhat.com> <56C52B80.5050104@amd.com> <20160218141817.GA6289@potion.brq.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: joro@8bytes.org, alex.williamson@redhat.com, gleb@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, wei@redhat.com, sherry.hurwitz@amd.com To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Suravee Suthikulpanit Return-path: In-Reply-To: <20160218141817.GA6289@potion.brq.redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 18/02/2016 15:18, Radim Kr=C4=8Dm=C3=A1=C5=99 wrote: > KVM just has to make sure that targeted VCPUs notice the interrupt, > which means to kick (wake up) VCPUs that don't have IsRunning set. > There is no need to do anything with running VCPUs, because they > - are in guest mode and noticed the doorbell > - are in host mode, where they will > 1) VMRUN as fast as they can because the VCPU didn't want to halt > (and IRR is handled on VMRUN) > 2) check IRR after unsetting IsRunning and goto (1) if there are > pending interrupts. (RFC doesn't do this, which is another bug= ) This is not necessary. IsRunning is only cleared at vcpu_put time. Th= e next KVM_RUN will look at IRR (kvm_arch_vcpu_runnable), if necessary se= t the mp_state to KVM_MP_STATE_RUNNABLE, and do the VMRUN. But I agree that this is what Suravee is missing. > It's still possible that we misunderstood the spec. Does AVIC handle > IPIs differently? I don't think we misunderstood it. Well, I did, but that's fixed now. = :) Paolo