From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Wu, Feng" Subject: Re: Fwd: [v3 14/15] Update Posted-Interrupts Descriptor during vCPU scheduling Date: Thu, 2 Jul 2015 04:32:55 +0000 Message-ID: References: <1435123109-10481-15-git-send-email-feng.wu@intel.com> <55918214.4030102@citrix.com> <1435633087.25170.274.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1435633087.25170.274.camel@citrix.com> Content-Language: en-US List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dario Faggioli Cc: "Tian, Kevin" , "keir@xen.org" , "george.dunlap@eu.citrix.com" , "andrew.cooper3@citrix.com" , xen-devel , "jbeulich@suse.com" , "Zhang, Yang Z" , "Wu, Feng" List-Id: xen-devel@lists.xenproject.org > -----Original Message----- > From: Dario Faggioli [mailto:dario.faggioli@citrix.com] > Sent: Tuesday, June 30, 2015 10:58 AM > To: Wu, Feng > Cc: xen-devel; keir@xen.org; jbeulich@suse.com; andrew.cooper3@citrix.com; > Tian, Kevin; Zhang, Yang Z; george.dunlap@eu.citrix.com; Wu, Feng > Subject: Re: Fwd: [v3 14/15] Update Posted-Interrupts Descriptor during vCPU > scheduling > > On Mon, 2015-06-29 at 18:36 +0100, Andrew Cooper wrote: > > > > > The basic idea here is: > > 1. When vCPU's state is RUNSTATE_running, > > - set 'NV' to 'Notification Vector'. > > - Clear 'SN' to accpet PI. > > - set 'NDST' to the right pCPU. > > 2. When vCPU's state is RUNSTATE_blocked, > > - set 'NV' to 'Wake-up Vector', so we can wake up the > > related vCPU when posted-interrupt happens for it. > > - Clear 'SN' to accpet PI. > > 3. When vCPU's state is RUNSTATE_runnable/RUNSTATE_offline, > > - Set 'SN' to suppress non-urgent interrupts. > > (Current, we only support non-urgent interrupts) > > - Set 'NV' back to 'Notification Vector' if needed. > > > It might be me, but it feels a bit odd to see RUNSTATE-s being (ab)used > directly for this, as it does feel odd to see arch specific code being > added in there. > > Can't this be done in context_switch(), which is already architecture > specific? I was thinking to something very similar to what has been done > for PSR, i.e., on x86, put everything in __context_switch(). > > Looking at who's prev and who's next, and at what pause_flags each has > set, you should be able to implement all of the above logic. > > Or am I missing something? As mentioned in the description of this patch, here we need to do something when the vCPU's state is changed, can we get the state transition in __context_switch(), such as "running -> blocking"? Thanks, Feng > > Regards, > Dario > > -- > <> (Raistlin Majere) > ----------------------------------------------------------------- > Dario Faggioli, Ph.D, http://about.me/dario.faggioli > Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)