From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel De Graaf Subject: Re: [PATCH 02/18] xen: allow global VIRQ handlers to be delegated to other domains Date: Fri, 13 Jan 2012 08:58:17 -0500 Message-ID: <4F103879.50709@tycho.nsa.gov> References: <1326302490-19428-1-git-send-email-dgdegra@tycho.nsa.gov> <1326411330-7915-1-git-send-email-dgdegra@tycho.nsa.gov> <1326411330-7915-3-git-send-email-dgdegra@tycho.nsa.gov> <4F0FF367020000780006C59D@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4F0FF367020000780006C59D@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jan Beulich Cc: Alex Zeffertt , xen-devel@lists.xensource.com, Diego Ongaro List-Id: xen-devel@lists.xenproject.org On 01/13/2012 03:03 AM, Jan Beulich wrote: >>>> On 13.01.12 at 00:35, Daniel De Graaf wrote: >> +int set_global_virq_handler(struct domain *d, uint32_t virq) >> +{ >> + struct domain *old; >> + >> + if (virq >= NR_VIRQS) >> + return -EINVAL; >> + if (!virq_is_global(virq)) >> + return -EINVAL; >> + >> + if (global_virq_handlers[virq] == d) >> + return 0; >> + >> + if (unlikely(!get_domain(d))) >> + return -EINVAL; >> + >> + spin_lock(&global_virq_handlers_lock); >> + old = global_virq_handlers[virq]; >> + global_virq_handlers[virq] = d; >> + spin_unlock(&global_virq_handlers_lock); >> + >> + if (old != NULL) >> + put_domain(old); >> + >> + return 0; >> +} >> + >> +static void clear_global_virq_handlers(struct domain *d) >> +{ >> + uint32_t virq; >> + int put_count = 0; >> + >> + spin_lock(&global_virq_handlers_lock); >> + >> + for (virq = 0; virq < NR_VIRQS; virq++) { >> + if (global_virq_handlers[virq] == d) { >> + global_virq_handlers[virq] = NULL; >> + put_count++; >> + } >> + } >> + >> + spin_unlock(&global_virq_handlers_lock); >> + >> + while (put_count) { >> + put_domain(d); >> + put_count--; >> + } >> +} > > Formatting in this entire hunk should be changed to match that of the > rest of the file. > >> --- a/xen/include/xsm/xsm.h >> +++ b/xen/include/xsm/xsm.h >> @@ -64,6 +64,7 @@ struct xsm_operations { >> int (*domain_settime) (struct domain *d); >> int (*set_target) (struct domain *d, struct domain *e); >> int (*domctl) (struct domain *d, int cmd); >> + int (*set_virq_handler) (struct domain *d, int virq); > > Here and further down, the 'int' still survived. > > Jan > Much of the existing code handling virqs uses int; should I also change these instances to uint32_t?