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

[Xen-devel] RE: [PATCH] Fix casting usage in xen_create_msi_irq.

To: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] RE: [PATCH] Fix casting usage in xen_create_msi_irq.
From: "Zhang, Xiantao" <xiantao.zhang@xxxxxxxxx>
Date: Thu, 3 Dec 2009 13:29:08 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Delivery-date: Wed, 02 Dec 2009 21:30:08 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1259172945-19486-1-git-send-email-konrad.wilk@xxxxxxxxxx>
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>
References: <1259172945-19486-1-git-send-email-konrad.wilk@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acpt/DzDL9gvpFPRSG+GCdxK0xgtQgF3MtiQ
Thread-topic: [PATCH] Fix casting usage in xen_create_msi_irq.
Jeremy, 

Seems this fix is still not in xen/master branch, pv-ops dom0 is blocked to 
enable SR-IOV devices without it. Could you merge it into xen/master branch ? 

Acked-by: Xiantao Zhang <xiantao.zhang@xxxxxxxxx>

Xiantao


Konrad Rzeszutek Wilk wrote:
> rc is int, domid is unsigned int. The casting of negatives values
> to domid results in wrap where -16 becomes 0xfff0. If we check
> for rc (instead of domid) and find a negative value (which you can't
> with domid) then we will default to DOMID_SELF - which is exactly
> what this line was intending to do earlier but failed to do.
> 
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
> ---
>  drivers/xen/events.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/xen/events.c b/drivers/xen/events.c
> index adc8c09..67598bc 100644
> --- a/drivers/xen/events.c
> +++ b/drivers/xen/events.c
> @@ -678,7 +678,7 @@ int xen_create_msi_irq(struct pci_dev *dev,
>       struct msi_desc *msidesc, /* Walk the XenStore keys to see if the
>        device is assigned to any * domain. If so, extract the domain id.
>       */ domid = rc = xenbus_walk( "/local/domain/0", get_domid_for_dev,
> dev); -       if (domid <= 0)
> +     if (rc <= 0)
>               domid = DOMID_SELF;
> 
>       memset(&map_irq, 0, sizeof(map_irq));


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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] RE: [PATCH] Fix casting usage in xen_create_msi_irq., Zhang, Xiantao <=