WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] x86/MSI: drop local cpumask_t variable from msi_

To: Jan Beulich <JBeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] x86/MSI: drop local cpumask_t variable from msi_compose_msg()
From: Keir Fraser <keir.xen@xxxxxxxxx>
Date: Fri, 14 Oct 2011 13:08:10 +0100
Cc:
Delivery-date: Fri, 14 Oct 2011 05:09:07 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=user-agent:date:subject:from:to:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; bh=24c4RVpN+lkRoVkxCDxpUK2+nb72b/9rcx2rsXKJPdE=; b=s2lSUptwyXe80S4GRpNllxUWbnAHwcBP2QFKAbJC0eA9D7//bzFQTq041V6B8l1Lq0 9RR4Z9VbZW4V3M1g+vhGKyGgT3uoqF/+iAIgSik5sf6NoZJKEywFVIPWxMFyn7nfRNEE oUHleJH4/fx+TuyBZZVcNbBsPU9PAjQ109esQ=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4E982A07020000780005B629@xxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcyKafCeZ4z9YG0rvkypt4E5MmxgDw==
Thread-topic: [Xen-devel] [PATCH] x86/MSI: drop local cpumask_t variable from msi_compose_msg()
User-agent: Microsoft-Entourage/12.30.0.110427
On 14/10/2011 11:24, "Jan Beulich" <JBeulich@xxxxxxxx> wrote:

> The function gets called only during initialization/resume (when no
> other CPUs are running) or with the IRQ descriptor lock held, so
> there's no way for the CPU mask to change under its feet.
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Acked-by: Keir Fraser <keir@xxxxxxx>

I wonder whether the cpus_empty() check should be a BUG_ON. Or an ASSERT
pushed into cpu_mask_to_apicid.

 -- Keir

> --- a/xen/arch/x86/msi.c
> +++ b/xen/arch/x86/msi.c
> @@ -123,18 +123,16 @@ static void msix_put_fixmap(struct pci_d
>  void msi_compose_msg(struct irq_desc *desc, struct msi_msg *msg)
>  {
>      unsigned dest;
> -    cpumask_t domain;
>      struct irq_cfg *cfg = desc->chip_data;
>      int vector = cfg->vector;
> -    domain = cfg->cpu_mask;
>  
> -    if ( cpus_empty( domain ) ) {
> +    if ( cpus_empty(cfg->cpu_mask) ) {
>          dprintk(XENLOG_ERR,"%s, compose msi message error!!\n", __func__);
> -     return;
> +        return;
>      }
>  
>      if ( vector ) {
> -        dest = cpu_mask_to_apicid(&domain);
> +        dest = cpu_mask_to_apicid(&cfg->cpu_mask);
>  
>          msg->address_hi = MSI_ADDR_BASE_HI;
>          msg->address_lo =
> 
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel