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] [IOEMU] Fix wrong INTx for pass-through device

To: "Zhai, Edwin" <edwin.zhai@xxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] [IOEMU] Fix wrong INTx for pass-through device
From: Simon Horman <horms@xxxxxxxxxxxx>
Date: Mon, 28 Dec 2009 18:54:31 +1100
Cc: Xen Developers <xen-devel@xxxxxxxxxxxxxxxxxxx>, Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Delivery-date: Sun, 27 Dec 2009 23:54:56 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4B38589B.8060307@xxxxxxxxx>
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: <4B38589B.8060307@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.20 (2009-06-14)
On Mon, Dec 28, 2009 at 03:04:59PM +0800, Zhai, Edwin wrote:
> Simon,
> For the pass-through device's INTx emulation, we follow the policy:
> if virtual function 0, use INTA#, otherwise use hardware value.
> However, this policy only apply when bind_pt_pci_irq to xen, and
> always use physical value when exporting to guest. This discrepancy
> cause different INTx, thus different GSI in xen and guest, so that
> interrupts never got injected to guest. E.g. when assigning a USB
> controller with non-zero function(00:1d.2) to guest as 00:4.0, xen
> will see INTA#, while guest see INTC#.
> 
> This simple patch can fix it. Could you pls. review it?

Hi Edwin,

that seems reasonable to me. I will have time to review
this more thoroughly tomorrow.

> 
> Thanks,
> 
> -- 
> best rgds,
> edwin
> 

> Signed-Off-By: Zhai Edwin <edwin.zhai@xxxxxxxxx>
> 
> diff --git a/hw/pass-through.c b/hw/pass-through.c
> index e7bd386..a08c0bf 100644
> --- a/hw/pass-through.c
> +++ b/hw/pass-through.c
> @@ -2710,7 +2710,8 @@ static uint32_t pt_status_reg_init(struct pt_dev *ptdev,
>  static uint32_t pt_irqpin_reg_init(struct pt_dev *ptdev,
>          struct pt_reg_info_tbl *reg, uint32_t real_offset)
>  {
> -    return ptdev->dev.config[real_offset];
> +    /* Translate xen INTx value to hw */
> +    return pci_intx(ptdev) + 1;
>  }
>  
>  /* initialize BAR */

> _______________________________________________
> 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