From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [PATCH v7 15/17] vmx: VT-d posted-interrupt core logic handling Date: Mon, 21 Sep 2015 10:54:21 +0100 Message-ID: <55FFD3CD.3030004@citrix.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "Wu, Feng" , George Dunlap , Dario Faggioli Cc: Andrew Cooper , "Tian, Kevin" , Keir Fraser , Jan Beulich , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On 09/21/2015 06:09 AM, Wu, Feng wrote: > > >> -----Original Message----- >> From: dunlapg@gmail.com [mailto:dunlapg@gmail.com] On Behalf Of George >> Dunlap >> Sent: Friday, September 18, 2015 10:34 PM >> To: Dario Faggioli >> Cc: Jan Beulich; George Dunlap; Tian, Kevin; Keir Fraser; Andrew Cooper; >> xen-devel@lists.xen.org; Wu, Feng >> Subject: Re: [Xen-devel] [PATCH v7 15/17] vmx: VT-d posted-interrupt core logic >> handling >> >> On Fri, Sep 18, 2015 at 3:31 PM, George Dunlap >> wrote: >>>> As said, me too. Perhaps we can go for option 1, which is simpler, >>>> cleaner and more consistent, considering the current status of the >>>> code. We can always investigate, in future, whether and how to >>>> implement the optimization for all the blockings, if beneficial and fea >>>> sible, or have them diverge, if deemed worthwhile. >>> >>> Sounds like a plan. >> >> Er, just in case that idiom wasn't clear: Option 1 sounds like a >> *good* plan, so unless Feng disagrees, let's go with that. :-) > > Sorry for the late response, I was on leave last Friday. > > Thanks for your discussions and suggestions. I have one question about option 1. > I find that there are two places where '_VPF_blocked' can get set: vcpu_block() > and do_poll(). After putting the logic in vcpu_block(), do we need to care about > do_poll(). I don't know the purpose of do_poll() and the usage case of it. > Dario/George, could you please share some knowledge about it? Thanks a lot! Yes, you'll need to make the callback everywhere _VPF_blocked is set. Normally you'd want to try to refactor both of those to share a commmon codepath, but it looks like there are specific reasons why they have to be different codepaths; so you'll just have to make the callback in both places (after setting VPF_blocked). You also need to check that local_events_need_delivery() will return "true" if you get an interrupt between that time and entering the hypervisor. Will that happen automatically from hvm_local_events_need_delivery() -> hvm_vcpu_has_pending_irq() -> vlapic_has_pending_irq()? Or will you need to add a hook in hvm_vcpu_has_pending_irq()? -George