From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [ PATCH 2/2] xen: enable Virtual-interrupt delivery Date: Thu, 06 Sep 2012 11:47:09 +0100 Message-ID: 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: "Li, Jiongxi" , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On 06/09/2012 11:00, "Li, Jiongxi" wrote: >>> int hvm_local_events_need_delivery(struct vcpu *v) { >>> - struct hvm_intack intack = hvm_vcpu_has_pending_irq(v); >>> + struct hvm_intack intack; >>> + >>> + pt_update_irq(v); >> >> Why would this change be needed for vAPIC? > When vcpu is scheduled out, there will be periodic timer interrupt pending for > injection. Every VMExit is a chance to inject the pending periodic timer > interrupt on vmx_intr_assist. In no virtual interrupt delivery case, although > injected timer interrupt is edge trigger, EOI always induces VMExit, pending > periodic timer can be kept injected till there is no pending left. But in > virtual interrupt delivery case, only level trigger interrupt can induce > VMExit, there is much less chance for injecting pending timer interrupt > through VMExit. > Adding pt_update_irq here is another code path to inject pending periodic > timer, but it can't guarantee every pending timer interrupt can be injected. > Another way is to make every EOI of pending timer interrupt induce VMExit, but > it may obey the spirit of virtual interrupt delivery - reducing VMExit. > We have been evaluating that. Should cause EOI to induce VMExit only when there is more periodic timer work to be done? That would be better than this hack. -- Keir