From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [RFC v1 14/15] Suppress posting interrupts when 'SN' is set Date: Mon, 30 Mar 2015 11:11:09 +0100 Message-ID: <5519213D.8020900@citrix.com> References: <1427286717-4093-1-git-send-email-feng.wu@intel.com> <1427286717-4093-15-git-send-email-feng.wu@intel.com> <55146D5C.4000305@citrix.com> <551547A9.7090408@citrix.com> <55155FD2.8080503@citrix.com> 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" , "xen-devel@lists.xen.org" Cc: "Zhang, Yang Z" , "Tian, Kevin" , "keir@xen.org" , "JBeulich@suse.com" List-Id: xen-devel@lists.xenproject.org On 30/03/15 03:11, Wu, Feng wrote: > >> -----Original Message----- >> From: Andrew Cooper [mailto:andrew.cooper3@citrix.com] >> Sent: Friday, March 27, 2015 9:49 PM >> To: Wu, Feng; xen-devel@lists.xen.org >> Cc: Zhang, Yang Z; Tian, Kevin; keir@xen.org; JBeulich@suse.com >> Subject: Re: [Xen-devel] [RFC v1 14/15] Suppress posting interrupts when 'SN' is >> set >> >> On 27/03/15 13:45, Wu, Feng wrote: >>>> -----Original Message----- >>>> From: Andrew Cooper [mailto:andrew.cooper3@citrix.com] >>>> Sent: Friday, March 27, 2015 8:06 PM >>>> To: Wu, Feng; xen-devel@lists.xen.org >>>> Cc: Zhang, Yang Z; Tian, Kevin; keir@xen.org; JBeulich@suse.com >>>> Subject: Re: [Xen-devel] [RFC v1 14/15] Suppress posting interrupts when >> 'SN' is >>>> set >>>> >>>> On 27/03/15 03:00, Wu, Feng wrote: >>>>>>> static void vmx_deliver_posted_intr(struct vcpu *v, u8 vector) >>>>>>> { >>>>>>> + int r, sn; >>>>>>> + >>>>>>> if ( pi_test_and_set_pir(vector, &v->arch.hvm_vmx.pi_desc) ) >>>>>>> return; >>>>>>> >>>>>>> + /* >>>>>>> + * Currently, we don't support urgent interrupt, all interrupts >>>>>>> + * are recognized as non-urgent interrupt, so we cannot send >>>>>>> + * posted-interrupt when 'SN' is set. >>>>>>> + */ >>>>>>> + >>>>>>> + sn = pi_test_sn(&v->arch.hvm_vmx.pi_desc); >>>>>> Is there anywhere which sets sn at all? I cant spot anywhere. >>>>>> >>>>> SN is set in [13/15] while vCPU is going to runnable state. >>>> Then please do not set SN in the first place if we don't support it. >>> What do you mean here. Setting 'SN' can suppress non-urgent interrupt. (we >> only support this) >> >> Sorry, in which case patch 13 shouldn't clear SN then. >> >> Either way - we should not be fixing up something in this patch which >> was introduced in the previous patch. > I think there are some misunderstanding here. > > - In patch 13, we need to set 'SN', so as to suppress the interrupts when vCPU > is in runnable state, since we don't need to send notification event then. > - Here in patch 14, it is another story. From hardware p.o.v, if 'SN' is set, it doesn't > send notification event. vmx_deliver_posted_intr() is the software way to delivery > posted-interrupts, so we need to follow the HW's behavior. Hence we check 'SN' > first, and not send notification event if it is set. Ah I see. Thanks for the clarification. ~Andrew