From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [RFC v2 08/15] Update IRTE according to guest interrupt config changes Date: Fri, 12 Jun 2015 11:40:46 +0100 Message-ID: <557AD34E0200007800084235@mail.emea.novell.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Feng Wu Cc: Kevin Tian , "keir@xen.org" , "george.dunlap@eu.citrix.com" , "andrew.cooper3@citrix.com" , "xen-devel@lists.xen.org" , Yang Z Zhang List-Id: xen-devel@lists.xenproject.org >>> On 12.06.15 at 11:40, wrote: >> From: Jan Beulich [mailto:JBeulich@suse.com] >> Sent: Tuesday, June 09, 2015 11:06 PM >> >>> On 08.05.15 at 11:07, wrote: >> > +static bool_t pi_find_dest_vcpu(struct domain *d, uint8_t dest_id, >> > + uint8_t dest_mode, uint8_t >> delivery_mode, >> > + uint8_t gvec, struct vcpu >> **dest_vcpu) >> > +{ >> > + struct vcpu *v, **dest_vcpu_array; >> > + unsigned int dest_vcpu_num = 0; >> > + int ret; >> >> This, being given as operand to "return", should match in type with >> the function's return type. >> >> > + dest_vcpu_array = xzalloc_array(struct vcpu *, d->max_vcpus); >> >> You realize that this can be quite big an allocation? (You could at >> least halve it by storing vCPU IDs instead of pointers, but if I'm >> not mistaken this could even be a simple bitmap.) > > If we use vCPU IDs or bitmap, we need to iterate all the vCPUs in the > domain to find the right vCPU from the vcpu_id, right? Why? You can index d->vcpu[]. Jan